diff --git a/README.md b/README.md index 8b538ba9dcf..603cf9893a2 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ ![License](https://img.shields.io/github/license/bitfoundation/bitplatform.svg) ![Release CI Status](https://github.com/bitfoundation/bitplatform/actions/workflows/bit.ci.release.yml/badge.svg) ![NuGet version](https://img.shields.io/nuget/v/bit.blazorui.svg?logo=nuget) -[![Nuget downloads](https://img.shields.io/badge/packages_download-9M-blue.svg?logo=nuget)](https://www.nuget.org/profiles/bit-foundation) +[![Nuget downloads](https://img.shields.io/badge/packages_download-10M-blue.svg?logo=nuget)](https://www.nuget.org/profiles/bit-foundation) [![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/bitfoundation/bitplatform.svg)](http://isitmaintained.com/project/bitfoundation/bitplatform "Average time to resolve an issue") [![Percentage of issues still open](http://isitmaintained.com/badge/open/bitfoundation/bitplatform.svg)](http://isitmaintained.com/project/bitfoundation/bitplatform "Percentage of issues still open") [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/bitfoundation/bitplatform) diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/Home/HomePage.razor b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/Home/HomePage.razor index 032b09380a7..92ace91a112 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/Home/HomePage.razor +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/Home/HomePage.razor @@ -143,7 +143,7 @@ - + diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Bit.Websites.Platform.Client.csproj b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Bit.Websites.Platform.Client.csproj index ed13d824b07..0f0e331937a 100644 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Bit.Websites.Platform.Client.csproj +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Bit.Websites.Platform.Client.csproj @@ -4,8 +4,11 @@ net10.0 true Default - true - true + + true + true service-worker-assets.js BeforeBuildTasks; @@ -15,7 +18,10 @@ false false false - false + + false @@ -27,9 +33,6 @@ - - - @@ -58,7 +61,15 @@ - + + + + @@ -78,9 +89,11 @@ - + - + + @@ -100,7 +113,7 @@ - + diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Extensions/IJSRuntimeExtension.cs b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Extensions/IJSRuntimeExtension.cs index 591b1d4cd55..1ff4120e50b 100644 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Extensions/IJSRuntimeExtension.cs +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Extensions/IJSRuntimeExtension.cs @@ -6,4 +6,9 @@ public static async Task ToggleBodyOverflow(this IJSRuntime jsRuntime, bool isNa { await jsRuntime.InvokeVoidAsync("toggleBodyOverflow", isNavOpen); } + + public static async Task BlurActiveElement(this IJSRuntime jsRuntime) + { + await jsRuntime.InvokeVoidAsync("blurActiveElement"); + } } diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Extensions/IServiceCollectionExtensions.cs b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Extensions/IServiceCollectionExtensions.cs index 60e510f88d1..e3a303aba67 100644 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Extensions/IServiceCollectionExtensions.cs +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Extensions/IServiceCollectionExtensions.cs @@ -11,7 +11,7 @@ public static IServiceCollection AddClientSharedServices(this IServiceCollection { services.AddSharedServices(); - services.AddScoped(); + services.AddScoped(); services.AddTransient(); services.AddTransient(); diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/AboutUsPage.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/AboutUsPage.razor index d95cbb8b61a..0958447bbc0 100644 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/AboutUsPage.razor +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/AboutUsPage.razor @@ -3,7 +3,7 @@ + Description="Meet the team behind bit platform and learn about our mission to empower C# .NET developers to build fast, cross-platform apps." />
@@ -45,9 +45,9 @@
- 9M + 10M
- + Total downloads of packages @@ -62,25 +62,25 @@
- Team member image + Saleh Yusefnejad
Saleh Yusefnejad
Co-Founder
@@ -90,24 +90,24 @@
- Team member image + Mohammad Aminsafaei
Mohammad Aminsafaei
Developer
- +
- Team member image + M. H. Rastegarinia
M. H. Rastegarinia
Developer
@@ -117,23 +117,23 @@
- Team member image + Zahra Sangtarash
Zahra Sangtarash
UI/UX designer
- +
- Team member image + Zahra Yousefi
Zahra Yousefi
UI/UX designer
- +
diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Besql/Besql01OverviewPage.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Besql/Besql01OverviewPage.razor index 861098c67ff..8a2fc15e94f 100644 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Besql/Besql01OverviewPage.razor +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Besql/Besql01OverviewPage.razor @@ -1,13 +1,13 @@ -@page "/besql" +@page "/besql" @page "/besql/overview" @inherits AppComponentBase - + Description="bit Besql brings Entity Framework Core and SQLite to the browser in Blazor WebAssembly apps, enabling offline-capable data storage." />
- Besql + Besql
Blazor Entity Framework SQLite utilities
@@ -25,7 +25,7 @@

- @@ -33,7 +33,7 @@
You can find the sample source-code of the above video - here. + here.

Supported browsers diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Besql/Besql02InstallPage.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Besql/Besql02InstallPage.razor index ac71c883d29..4b78b5f5ca4 100644 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Besql/Besql02InstallPage.razor +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Besql/Besql02InstallPage.razor @@ -3,10 +3,10 @@ + Description="Install the Bit.Besql NuGet package to use Entity Framework Core with SQLite in your Blazor WebAssembly apps." />
- Install bit Besql + Install bit Besql
How to install the bit Besql? @@ -28,7 +28,7 @@ Open your Visual Studio's Manage NuGet Packages window and install the Bit.Besql package:

- + Installing the Bit.Besql NuGet package in Visual Studio
diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Besql/Besql03UsagePage.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Besql/Besql03UsagePage.razor index ef908a5c779..183323cb81e 100644 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Besql/Besql03UsagePage.razor +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Besql/Besql03UsagePage.razor @@ -3,10 +3,10 @@ + Description="Use bit Besql in three steps: add the script tag, register the services, then use EF Core's SQLite provider with IDbContextFactory in the browser." />
- Using bit Besql + Using bit Besql
How to use the bit Besql? @@ -38,4 +38,4 @@
- + diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Bswup/Bswup01OverviewPage.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Bswup/Bswup01OverviewPage.razor deleted file mode 100644 index f4a34643cfd..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Bswup/Bswup01OverviewPage.razor +++ /dev/null @@ -1,75 +0,0 @@ -@page "/bswup" -@page "/bswup/overview" -@inherits AppComponentBase - - - -
- Bswup -
- Blazor Service Worker Update Progress utilities -
- - bit Bswup is a set of tools that assists developers in making the most out of the - Service Worker when building PWAs with Blazor. - It utilizes the Service Worker's events to handle Installing and Updating the app - as fast and smooth as possible while minimizing the download size. -
- This unique tool harnesses the power of Progressive Web Apps (PWA) within the innovative - new structure of dotnet 8. By amalgamating pre-rendering techniques reminiscent of renowned - platforms like GitHub, Reddit, and Facebook, Bswup ensures an exceptional user experience. -
-
-
- Note: Currently, bit Bswup is the only tool that can enable complete PWA solution for the new Blazor web app - project template that introduced in .NET 8 which has different render mode (Auto, Server, WebAssembly). -
-
-
-
- You can watch this step by step walkthrough video to see bit Bswup in action: -
-
-
- -
-
-
- You can find the sample source-code of the above video - here. -
-


- -

- -

- -

- -
- -

- Supported browsers -
-
    -
  • - - Blazor is supported in the browsers shown in the following list on both mobile and desktop platforms. - -
      -
    • Apple Safari (Current† version)
    • -
    • Google Chrome (Current† version)
    • -
    • Microsoft Edge (Current† version)
    • -
    • Mozilla Firefox (Current† version)
    • -
    -
  • -
-
-
-
- - \ No newline at end of file diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Bswup/Bswup01OverviewPage.razor.scss b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Bswup/Bswup01OverviewPage.razor.scss deleted file mode 100644 index dc54591014d..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Bswup/Bswup01OverviewPage.razor.scss +++ /dev/null @@ -1,23 +0,0 @@ -@import '../../Styles/abstracts/_colors.scss'; -@import '../../Styles/abstracts/_mixins.scss'; -@import '../../Styles/abstracts/_functions.scss'; -@import '../../Styles/abstracts/_media-queries.scss'; - -.page-container { - @include PageContainer; - display: flex; - flex-flow: column; -} - -.video-container { - width: 100%; - display: flex; - justify-content: center; -} - -.bswup-img { - width: 100%; - margin: auto; - max-width: rem2(500px); - border: 1px solid gray; -} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Bswup/Bswup02InstallPage.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Bswup/Bswup02InstallPage.razor deleted file mode 100644 index a5abc139f90..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Bswup/Bswup02InstallPage.razor +++ /dev/null @@ -1,36 +0,0 @@ -@page "/bswup/install" -@inherits AppComponentBase - - - -
- Install bit Bswup -
- - How to install the bit Bswup? - -
- -
- CLI -
- Open the command line of your choice and run the following command: - dotnet add package Bit.Bswup -
-
- -
- Visual Studio -
-
- Open your Visual Studio's Manage NuGet Packages window and install the Bit.Bswup package: -
-
- -
-
-
- - diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Bswup/Bswup02InstallPage.razor.scss b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Bswup/Bswup02InstallPage.razor.scss deleted file mode 100644 index 2533de02bf3..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Bswup/Bswup02InstallPage.razor.scss +++ /dev/null @@ -1,22 +0,0 @@ -@import '../../Styles/abstracts/_colors.scss'; -@import '../../Styles/abstracts/_mixins.scss'; -@import '../../Styles/abstracts/_functions.scss'; -@import '../../Styles/abstracts/_media-queries.scss'; - -.page-container { - @include PageContainer; -} - -.section-card { - @include SectionCard; -} - -.section-card-txt { - @include SectionCardText; -} - -.bswup-img { - width: 100%; - max-width: rem2(900px); - border: 1px solid gray; -} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Bswup/Bswup03ScriptsPage.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Bswup/Bswup03ScriptsPage.razor deleted file mode 100644 index 6d16693050c..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Bswup/Bswup03ScriptsPage.razor +++ /dev/null @@ -1,62 +0,0 @@ -@page "/bswup/scripts" -@inherits AppComponentBase - - - -
- Scripts -
- - How to setup the bit Bswup's scripts? - -
- -
- Blazor script -
- Since Bswup is taking care of the lifecycle of the application, we need to disable - the autostart of the Blazor by adding autostart=false to the Blazor script tag: - - <script src="_framework/blazor.web.js" autostart="false"></script> - Or for the standalone template: - <script src="_framework/blazor.webassembly.js" autostart="false"></script> -
-
- -
- Bswup script -
-
- The next step is to add and configure the bit Bswup's script tag itself: - - <script src="_content/Bit.Bswup/bit-bswup.js" - scope="/" - log="verbose" - sw="service-worker.js" - handler="bitBswupHandler" - blazorScript="_framework/blazor.webassembly.js"></script> -
- -
- This script tag as shown above, has some options: -

- scope: The scope of the service-worker - (read more). -

- log: The log level of the Bswup logger. available options are: info, verbose, debug, and error (coming soon). -

- sw: The file path of the service-worker file. -

- handler: The name of the handler function for the service-worker events that explained here. -

- blazorScript: The file path of the Blazor's js script file. -
-
- Note: You can remove any of these attributes which makes the bit Bswup to use the default values mentioned above. -
-
-
- - diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Bswup/Bswup03ScriptsPage.razor.scss b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Bswup/Bswup03ScriptsPage.razor.scss deleted file mode 100644 index 2533de02bf3..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Bswup/Bswup03ScriptsPage.razor.scss +++ /dev/null @@ -1,22 +0,0 @@ -@import '../../Styles/abstracts/_colors.scss'; -@import '../../Styles/abstracts/_mixins.scss'; -@import '../../Styles/abstracts/_functions.scss'; -@import '../../Styles/abstracts/_media-queries.scss'; - -.page-container { - @include PageContainer; -} - -.section-card { - @include SectionCard; -} - -.section-card-txt { - @include SectionCardText; -} - -.bswup-img { - width: 100%; - max-width: rem2(900px); - border: 1px solid gray; -} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Bswup/Bswup04EventsPage.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Bswup/Bswup04EventsPage.razor deleted file mode 100644 index 5406681d8d0..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Bswup/Bswup04EventsPage.razor +++ /dev/null @@ -1,88 +0,0 @@ -@page "/bswup/events" -@inherits AppComponentBase - - - -
- Events -
- - bit Bswup calls the handler js function and pass the event arguments to it for each of its event. - -
- -
- Bswup Handler function -
- below you can see a sample bswup events handler function in js: - - const appEl = document.getElementById('app'); -const bswupEl = document.getElementById('bit-bswup'); -const progressBar = document.getElementById('bit-bswup-progress-bar'); -const reloadButton = document.getElementById('bit-bswup-reload'); - -function bitBswupHandler(type, data) { - switch (type) - { - case BswupMessage.updateFound: return console.log('an update found.'); - - case BswupMessage.stateChanged: return console.log('state has changed to:', data.currentTarget.state); - - case BswupMessage.activate: return console.log('new version activated:', data.version); - - case BswupMessage.downloadStarted: - appEl.style.display = 'none'; - bswupEl.style.display = 'block'; - return console.log('downloading assets started:', data?.version); - - case BswupMessage.downloadProgress: - progressBar.style.width = `${percent}%`; - return console.log('asset downloaded:', data); - - case BswupMessage.downloadFinished: - if (data.firstInstall) { - data.reload().then(() => { - appEl.style.display = 'block'; - bswupEl.style.display = 'none'; - }); - } else { - reloadButton.style.display = 'block'; - reloadButton.onclick = data.reload; - } - return console.log('downloading assets finished.'); - - case BswupMessage.updateReady: - reloadButton.style.display = 'block'; - reloadButton.onclick = data.reload; - return console.log('new update ready.'); - } -} -
-
- -
- Bswup Events -
-
- All the bit Bswup events are as follows: -

- updateFound: when a new update for the app is found by the bit Bswup's Service Worker. -

- stateChanged: when the state of the Service Worker is changed. -

- activate: when a new version of the Service Worker is activated. -

- downloadStarted: when download of the new version of the app started. -

- downloadProgress: the progress of downloading the new version of the app. -

- downloadFinished: when the download of the new version of the app finished. -

- updateReady: when the new version of the app is ready to apply. -
-
-
- - diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Bswup/Bswup04EventsPage.razor.scss b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Bswup/Bswup04EventsPage.razor.scss deleted file mode 100644 index 2533de02bf3..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Bswup/Bswup04EventsPage.razor.scss +++ /dev/null @@ -1,22 +0,0 @@ -@import '../../Styles/abstracts/_colors.scss'; -@import '../../Styles/abstracts/_mixins.scss'; -@import '../../Styles/abstracts/_functions.scss'; -@import '../../Styles/abstracts/_media-queries.scss'; - -.page-container { - @include PageContainer; -} - -.section-card { - @include SectionCard; -} - -.section-card-txt { - @include SectionCardText; -} - -.bswup-img { - width: 100%; - max-width: rem2(900px); - border: 1px solid gray; -} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Bswup/Bswup05ServiceWorkerPage.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Bswup/Bswup05ServiceWorkerPage.razor deleted file mode 100644 index 8eba049823c..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Bswup/Bswup05ServiceWorkerPage.razor +++ /dev/null @@ -1,113 +0,0 @@ -@page "/bswup/service-worker" -@inherits AppComponentBase - - - -
- Service Worker -
- - bit Bswup has a lot of options available in the service worker file to configure its behavior. - -
- -
- Bswup Service Worker -
- A sample of all configuration available inside of the service worker file is shown here: - - self.assetsInclude = [/\data.db$/]; -self.assetsExclude = [/\.scp\.css$/, /weather\.json$/]; -self.defaultUrl = '/'; -self.prohibitedUrls = [/\/admin\//]; -self.serverHandledUrls = [/\/api\//]; -self.serverRenderedUrls = [/\/privacy$/]; -self.externalAssets = [ - { - "url": "/" - }, - { - "url": "https://www.googletagmanager.com/gtag/js?id=G-G123456789" - } -]; -self.assetsUrl = '/service-worker-assets.js'; -self.noPrerenderQuery = 'no-prerender=true'; -self.caseInsensitiveUrl = true; -self.ignoreDefaultInclude = true; -self.ignoreDefaultExclude = true; -self.isPassive = true; -self.disablePassiveFirstBoot = true; -self.enableIntegrityCheck = true; -self.enableDiagnostics = true; -self.enableFetchDiagnostics = true; - -self.importScripts('_content/Bit.Bswup/bit-bswup.sw.js'); - -
- Note: The most important line here is the last line which is the only mandatory config in this file - that imports the Bswup service-worker file: - - self.importScripts('_content/Bit.Bswup/bit-bswup.sw.js'); -
- - These available configurations are explained below: -

- assetsInclude: The list of file names from the assets list to include when the Bswup - tries to store them in the cache storage (regex supported). -

- assetsExclude: The list of file names from the assets list to exclude when the Bswup - tries to store them in the cache storage (regex supported). -

- externalAssets: The list of external assets to cache that are not included in the auto-generated assets file. - For example, if you're not using index.html (like _host.cshtml), then you should add { "url": "/" }. -

- defaultUrl: The default page URL. Use / when using _Host.cshtml. -

- assetsUrl: The file path of the service-worker assets file generated at compile time - (the default file name is service-worker-assets.js). -

- prohibitedUrls: The list of file names that should not be accessed (regex supported). -

- caseInsensitiveUrl: Enables the case insensitivity in the URL checking of the cache process. -

- serverHandledUrls: The list of URLs that do not enter the service-worker offline process and - will be handled only by server (regex supported). such as /api, /swagger, ... -

- serverRenderedUrls: The list of URLs that should be rendered by the server and not - client while navigating (regex supported). such as /about.html, /privacy, ... -

- noPrerenderQuery: The query string attached to the default document request to disable - the prerendering from the server so an unwanted prerendered result not be cached. -

- ignoreDefaultInclude: Ignores the default asset includes array which is provided by the - Bswup itself which is like this: - [/\.dll$/, /\.pdb$/, /\.wasm/, /\.html/, /\.js$/, /\.json$/, /\.css$/, /\.woff$/, /\.png$/, /\.jpe?g$/, /\.gif$/, /\.ico$/, /\.blat$/, /\.dat$/, /\.svg$/, /\.woff2$/, /\.ttf$/, /\.webp$/] - - ignoreDefaultExclude: Ignores the default asset excludes array which is provided by the Bswup - itself which is like this: - [/^_content\/Bit\.Bswup\/bit-bswup\.sw\.js$/, /^service-worker\.js$/]" - - Note: Keep in mind that caching service-worker related files will corrupt the update cycle of the service-worker. - Only the browser should handle these files. -

- isPassive: Enables the Bswup's passive mode. In this mode, the assets won't be - cached in advance but rather upon initial request. -

- disablePassiveFirstBoot: Disables downloading the Blazor's boot files in first time of Passive mode. -

- enableIntegrityCheck: Enables the default integrity check available in browsers by setting - the integrity attribute of the request object created in the service-worker to fetch the assets. -

- enableDiagnostics: Enables diagnostics by pushing service-worker logs to the browser console. -

- enableFetchDiagnostics: Enables fetch event diagnostics by pushing service-worker - fetch event logs to the browser console. - -
-
- -
- - diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Bswup/Bswup05ServiceWorkerPage.razor.scss b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Bswup/Bswup05ServiceWorkerPage.razor.scss deleted file mode 100644 index 2533de02bf3..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Bswup/Bswup05ServiceWorkerPage.razor.scss +++ /dev/null @@ -1,22 +0,0 @@ -@import '../../Styles/abstracts/_colors.scss'; -@import '../../Styles/abstracts/_mixins.scss'; -@import '../../Styles/abstracts/_functions.scss'; -@import '../../Styles/abstracts/_media-queries.scss'; - -.page-container { - @include PageContainer; -} - -.section-card { - @include SectionCard; -} - -.section-card-txt { - @include SectionCardText; -} - -.bswup-img { - width: 100%; - max-width: rem2(900px); - border: 1px solid gray; -} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Bswup/Bswup06ProgressPage.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Bswup/Bswup06ProgressPage.razor deleted file mode 100644 index 9ad6d1266fb..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Bswup/Bswup06ProgressPage.razor +++ /dev/null @@ -1,131 +0,0 @@ -@page "/bswup/progress" -@inherits AppComponentBase - - - -
- Progress component -
- - bit Bswup has its own Progress component to simplify the process of implementing a sophisticated UI widget to show the update progress. - -
- -
- BswupProgress -
- The BswupProgress component can be used to implement a customizable update progress easily. - In order to use this component first add its script tag to the default document of your app: -
- <script src="_content/Bit.Bswup/bit-bswup.progress.js"></script> - - Then you can use it in your app like this: -
- <div> - <BswupProgress AppContainer="#app-container" AutoReload=false> - <div class="bswup-progress-text" /> - <svg class="bswup-container"> - <circle r="40%" cx="50%" cy="50%" /> - <circle r="40%" cx="50%" cy="50%" /> - </svg> - </BswupProgress> - <button id="bit-bswup-reload">Update available, Click to Reload</button> -</div> - - -
- #bit-bswup { - top: 2px; - left: 50%; - display: none; - z-index: 999999; - position: fixed; - text-align: center; - transform: translateX(-50%); - font-family: "Segoe UI", "Segoe UI Web (West European)", "Segoe UI"; -} - -#bit-bswup .bswup-container { - width: 3rem; - height: 3rem; - display: block; - position: relative; -} - -#bit-bswup .bswup-container circle { - fill: none; - stroke: #e0e0e0; - stroke-width: 0.2rem; - transform: rotate(-90deg); - transform-origin: 50% 50%; -} - -#bit-bswup .bswup-container circle:last-child { - stroke: #1b6ec2; - transition: stroke-dasharray 0.05s ease-in-out; - stroke-dasharray: calc(3.141 * var(--bit-bswup-percent, 0%) * 0.8), 500%; -} - -#bit-bswup .bswup-progress-text { - top: 50%; - left: 50%; - font-size: 12px; - position: absolute; - text-align: center; - font-weight: normal; - transform: translate(-50%, -50%); -} - -#bit-bswup .bswup-progress-text::after { - content: var(--bit-bswup-percent-text, ""); -} - -#bit-bswup-reload { - top: 10px; - right: 10px; - display: none; - position: fixed; -} -
-
-

- The parameters of this component are as follows: -

- AutoReload: if the BswupProgress should auto-reload the app after downloading the new update. - The default value is true. -

- ShowAssets: if the BswupProgress should show the assets list in its default UI. - The default value is false. -

- ShowLogs: if the BswupProgress should show the logs of its process in the console of the web browser. - The default value is false. -

- HideApp: if the BswupProgress should hide the main app's UI in the process of the update progress. - The default value is false. -

- AppContainer: the css selector of the blazor app container element. - The default value is "#app". -

- Handler: the custom js handler function to do custom additional tasks in Bswup events. - The default value is null. -


- - As you can see in the above example, you can provide your own custom UI and use it - instead of the default UI of the BswupProgress component. - -

- - Note: In the case of using a custom UI, you can use the following custom CSS properties to access the progress -

- --bit-bswup-percent: the number value of the current progress percent. -

- --bit-bswup-percent-text: the string (text) value of the current progress percent with % character at the end of it. -
- -
- -
- - diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Bswup/Bswup06ProgressPage.razor.scss b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Bswup/Bswup06ProgressPage.razor.scss deleted file mode 100644 index 2533de02bf3..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Bswup/Bswup06ProgressPage.razor.scss +++ /dev/null @@ -1,22 +0,0 @@ -@import '../../Styles/abstracts/_colors.scss'; -@import '../../Styles/abstracts/_mixins.scss'; -@import '../../Styles/abstracts/_functions.scss'; -@import '../../Styles/abstracts/_media-queries.scss'; - -.page-container { - @include PageContainer; -} - -.section-card { - @include SectionCard; -} - -.section-card-txt { - @include SectionCardText; -} - -.bswup-img { - width: 100%; - max-width: rem2(900px); - border: 1px solid gray; -} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil01OverviewPage.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil01OverviewPage.razor deleted file mode 100644 index ce81cf6b2fd..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil01OverviewPage.razor +++ /dev/null @@ -1,64 +0,0 @@ -@page "/butil" -@page "/butil/overview" -@inherits AppComponentBase - - - -
- Butil -
- Blazor utils for Browser APIs - - Embracing Blazor because of your love for C#? - - -
- -
- What is bit Butil? -
- Butil enables you to stay true to that sentiment by providing essential Browser APIs in C#, - eliminating the need to revert to JavaScript for any functionality. -

- bit Butil helps C# developers to access the browser APIs that are only accessible through JavaScript in C#. -
-
- -
- -
- Supported browsers -
- Blazor is supported in the browsers shown in the following list on both mobile and desktop platforms: -
-
    -
  • Apple Safari (Current version)
  • -
  • Google Chrome (Current version)
  • -
  • Microsoft Edge (Current version)
  • -
  • Mozilla Firefox (Current version)
  • -
-
-
- -
- -
- Supported platforms -
- Blazor Hybrid apps have the following additional platform requirements: -
-
    -
  • Android 7.1 (API Level 24) or higher
  • -
  • iOS 15 or higher
  • -
  • macOS 12 (Monterey) or higher
  • -
  • Windows 7 SP1 or higher
  • -
-
-
- -
-
- - \ No newline at end of file diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil01OverviewPage.razor.scss b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil01OverviewPage.razor.scss deleted file mode 100644 index 8aaa3d4621e..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil01OverviewPage.razor.scss +++ /dev/null @@ -1,24 +0,0 @@ -@import '../../Styles/abstracts/_colors.scss'; -@import '../../Styles/abstracts/_mixins.scss'; -@import '../../Styles/abstracts/_functions.scss'; -@import '../../Styles/abstracts/_media-queries.scss'; - -.page-container { - @include PageContainer; - display: flex; - flex-flow: column; -} - -.section-card { - @include SectionCard; -} - -.section-card-txt { - @include SectionCardText; -} - -.video-container { - width: 100%; - display: flex; - justify-content: center; -} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil02InstallPage.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil02InstallPage.razor deleted file mode 100644 index fd9bceda0bc..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil02InstallPage.razor +++ /dev/null @@ -1,36 +0,0 @@ -@page "/butil/install" -@inherits AppComponentBase - - - -
- Install Butil -
- - How to install bit Butil? - -
- -
- CLI -
- Open the command line of your choice and run the following command: - dotnet add package Bit.Butil -
-
- -
- Visual Studio -
-
- Open your Visual Studio's Manage NuGet Packages window and install the Bit.Butil package: -
-
- -
-
-
- - diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil02InstallPage.razor.scss b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil02InstallPage.razor.scss deleted file mode 100644 index 8400e87da03..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil02InstallPage.razor.scss +++ /dev/null @@ -1,22 +0,0 @@ -@import '../../Styles/abstracts/_colors.scss'; -@import '../../Styles/abstracts/_mixins.scss'; -@import '../../Styles/abstracts/_functions.scss'; -@import '../../Styles/abstracts/_media-queries.scss'; - -.page-container { - @include PageContainer; -} - -.section-card { - @include SectionCard; -} - -.section-card-txt { - @include SectionCardText; -} - -.butil-img { - width: 100%; - max-width: rem2(900px); - border: 1px solid gray; -} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil03SetupPage.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil03SetupPage.razor deleted file mode 100644 index 8dadc4d993f..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil03SetupPage.razor +++ /dev/null @@ -1,34 +0,0 @@ -@page "/butil/setup" -@inherits AppComponentBase - - - -
- Setup Butil -
- - How to setup bit Butil? - -
- -
- Script -
- Add the following script tag to your default document: - <script src="_content/Bit.Butil/bit-butil.js"></script> -
-
- -
- Service -
- Add the following line to register the bit Butil services: - builder.Services.AddBitButilServices(); - Now you can inject its classes to use the bit Butil tools. -
-
-
- - diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil03SetupPage.razor.scss b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil03SetupPage.razor.scss deleted file mode 100644 index 7cee07def47..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil03SetupPage.razor.scss +++ /dev/null @@ -1,16 +0,0 @@ -@import '../../Styles/abstracts/_colors.scss'; -@import '../../Styles/abstracts/_mixins.scss'; -@import '../../Styles/abstracts/_functions.scss'; -@import '../../Styles/abstracts/_media-queries.scss'; - -.page-container { - @include PageContainer; -} - -.section-card { - @include SectionCard; -} - -.section-card-txt { - @include SectionCardText; -} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil04CryptoPage.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil04CryptoPage.razor deleted file mode 100644 index f318203f8df..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil04CryptoPage.razor +++ /dev/null @@ -1,87 +0,0 @@ -@page "/butil/crypto" -@inherits AppComponentBase -@inject Bit.Butil.Crypto crypto - - - -
- Crypto - Cryptography API (Encryption/Decryption) -
- - How to use the Crypto class of the bit Butil? - -
- -
- Usage -
- To use the browser crypto features you need to inject the Bit.Butil.Crypto class and use it like this: - -@@inject Bit.Butil.Crypto crypto - -@@code { - await crypto.Encrypt(...); -} -
-
- -
- Methods -
-
- Encrypt:
- The Encrypt method of the Crypto interface that encrypts data - (MDN). -

- - - - - @encryptExampleCode - - - -
- -
- Encrypt -
-
-
Encrypted text: @encryptedText
-
-
-
-
-

- - Decrypt:
- The Decrypt method of the Crypto interface that decrypts data - (MDN). -

- - - - - @decryptExampleCode - - - -
- -
- Decrypt -
-
-
Decrypted text: @decryptedText
-
-
-
-
-
-
-
- - diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil04CryptoPage.razor.cs b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil04CryptoPage.razor.cs deleted file mode 100644 index 636b292fc48..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil04CryptoPage.razor.cs +++ /dev/null @@ -1,98 +0,0 @@ -using Bit.Butil; - -namespace Bit.Websites.Platform.Client.Pages.Butil; - -public partial class Butil04CryptoPage -{ - private byte[] iv = new byte[16]; - private byte[] key = new byte[16]; - - private string? encryptText; - private byte[]? encryptedBytes; - private string? encryptedText; - - private string? decryptText; - private byte[]? decryptedBytes; - private string? decryptedText; - - - protected override async Task OnInitAsync() - { - System.Security.Cryptography.RandomNumberGenerator.Fill(iv); - System.Security.Cryptography.RandomNumberGenerator.Fill(key); - } - - private async Task Encrypt() - { - var textAsUtf8Bytes = System.Text.Encoding.UTF8.GetBytes(encryptText!); - encryptedBytes = await crypto.Encrypt(CryptoAlgorithm.AesCbc, key, textAsUtf8Bytes, iv: iv); - encryptedText = BitConverter.ToString(encryptedBytes!); - } - - private async Task Decrypt() - { - decryptedBytes = await crypto.Decrypt(CryptoAlgorithm.AesCbc, key, encryptedBytes!, iv: iv); - decryptedText = System.Text.Encoding.UTF8.GetString(decryptedBytes); - } - - - private string encryptExampleCode = -@"@inject Bit.Butil.Crypto crypto - - - -Encrypt - -
Encrypted text: @encryptedText
- -@code { - private byte[] iv = new byte[16]; - private byte[] key = new byte[16]; - - private string? encryptText; - private byte[]? encryptedBytes; - private string? encryptedText; - - protected override async Task OnInitAsync() - { - System.Security.Cryptography.RandomNumberGenerator.Fill(iv); - System.Security.Cryptography.RandomNumberGenerator.Fill(key); - } - - private async Task Encrypt() - { - var textAsUtf8Bytes = System.Text.Encoding.UTF8.GetBytes(encryptText!); - encryptedBytes = await crypto.Encrypt(CryptoAlgorithm.AesCbc, key, textAsUtf8Bytes, iv: iv); - encryptedText = BitConverter.ToString(encryptedBytes!); - } -}"; - private string decryptExampleCode = -@"@inject Bit.Butil.Crypto crypto - - - -Decrypt - -
Decrypted text: @decryptedText
- -@code { - private byte[] iv = new byte[16]; - private byte[] key = new byte[16]; - - private string? decryptText; - private byte[]? decryptedBytes; - private string? decryptedText; - - protected override async Task OnInitAsync() - { - System.Security.Cryptography.RandomNumberGenerator.Fill(iv); - System.Security.Cryptography.RandomNumberGenerator.Fill(key); - } - - private async Task Decrypt() - { - decryptedBytes = await crypto.Decrypt(CryptoAlgorithm.AesCbc, key, encryptedBytes!, iv: iv); - decryptedText = System.Text.Encoding.UTF8.GetString(decryptedBytes); - } -}"; -} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil04CryptoPage.razor.scss b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil04CryptoPage.razor.scss deleted file mode 100644 index 7cee07def47..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil04CryptoPage.razor.scss +++ /dev/null @@ -1,16 +0,0 @@ -@import '../../Styles/abstracts/_colors.scss'; -@import '../../Styles/abstracts/_mixins.scss'; -@import '../../Styles/abstracts/_functions.scss'; -@import '../../Styles/abstracts/_media-queries.scss'; - -.page-container { - @include PageContainer; -} - -.section-card { - @include SectionCard; -} - -.section-card-txt { - @include SectionCardText; -} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil05WebAuthnPage.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil05WebAuthnPage.razor deleted file mode 100644 index 39964bb1103..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil05WebAuthnPage.razor +++ /dev/null @@ -1,124 +0,0 @@ -@page "/butil/webAuthn" -@inherits AppComponentBase -@inject Bit.Butil.WebAuthn webAuthn - - - -
- WebAuthn - Web Authentication API (Password-less/Passkey) -
- - How to use the WebAuthn class of the bit Butil? - -
- -
- Usage -
- To use the WebAuthn api of Butil you need to inject the Bit.Butil.WebAuthn class and use it like this: - -@@inject Bit.Butil.WebAuthn webAuthn - -@@code { - var result = await webAuthn.CreateCredential(new { ... }); -} - -
- - - Note: For optimal security, it is advisable to implement Web Authentication alongside a server-side counterpart - that securely stores essential data for future verification. This approach, similar to our existing integration with - the FIDO2 infrastructure, - ensures robust authentication and safeguards against potential threats. -
- You can check it out in action in the Passwordless tab on the settings page of - bit Boilerplate project template -
-
- -
- Methods -
-
- CreateCredential:
- Creates a new credential using the provided options. - (MDN). -

- - - - - @createExampleCode - - - -
- Create -
-
-
Result:
-
@createResult?.ToString()?.Replace(",", ",\n")
- @if (string.IsNullOrWhiteSpace(createError) is false) - { -
error: @createError
- } -
-
-
-

- - GetCredential:
- Gets a credential using the provided options. - (MDN). -

- - - - - @getExampleCode - - - -
- Get -
-
-
Result:
-
@getResult?.ToString()?.Replace(",", ",\n")
- @if (string.IsNullOrWhiteSpace(getError) is false) - { -
error: @getError
- } -
-
-
-

- - Verify:
- Verifies a user using the credential api of the browser. -

- - - - - @verifyExampleCode - - - -
- Verify -
-
-
Result: @verifyResult
-
-
-
-

-
-
-
- - diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil05WebAuthnPage.razor.cs b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil05WebAuthnPage.razor.cs deleted file mode 100644 index e1f7f6553f9..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil05WebAuthnPage.razor.cs +++ /dev/null @@ -1,158 +0,0 @@ -using System.Text.Json; - -namespace Bit.Websites.Platform.Client.Pages.Butil; - -public partial class Butil05WebAuthnPage -{ - private object? createResult; - private string? createError; - - private object? getResult; - private string? getError; - - private bool? verifyResult; - - private async Task Create() - { - try - { - createError = null; - createResult = await webAuthn.CreateCredential(new - { - challenge = "testChallenge", - rp = new { name = "testRp" }, - attestation = "direct", - user = new { id = "userId", name = "testUser", displayName = "testUser" }, - authenticatorSelection = new { authenticatorAttachment = "platform" }, - pubKeyCredParams = new object[] - { - new { alg = -7, type = "public-key" }, - new { alg = -8, type = "public-key" }, - new { alg = -257, type = "public-key" } - } - }); - } - catch (Exception ex) - { - createError = ex.ToString(); - } - } - - private async Task Get() - { - try - { - getError = null; - var id = ((JsonElement?)createResult)?.GetProperty("rawId").ToString(); - var options = id is null - ? new { challenge = "test", allowCredentials = new object[] { } } - : new { challenge = "test", allowCredentials = new object[] { new { id, type = "public-key" } } }; - - getResult = await webAuthn.GetCredential(options); - } - catch (Exception ex) - { - getError = ex.ToString(); - } - } - - private async Task Verify() - { - verifyResult = await webAuthn.Verify(); - } - - - private string createExampleCode = -@"@inject Bit.Butil.WebAuthn webAuthn - -Create - -
Result:
-
@createResult?.ToString()?.Replace("","", "",\n"")
-@if (string.IsNullOrWhiteSpace(createError) is false) -{ -
error: @createError
-} - -@code { - private object? createResult; - private string? createError; - - private async Task Create() - { - try - { - createError = null; - createResult = await webAuthn.CreateCredential(new - { - challenge = ""testChallenge"", - rp = new { name = ""testRp"" }, - attestation = ""direct"", - user = new { id = ""userId"", name = ""testUser"", displayName = ""testUser"" }, - authenticatorSelection = new { authenticatorAttachment = ""platform"" }, - pubKeyCredParams = new object[] - { - new { alg = -7, type = ""public-key"" }, - new { alg = -8, type = ""public-key"" }, - new { alg = -257, type = ""public-key"" } - } - }); - } - catch (Exception ex) - { - createError = ex.ToString(); - } - } -}"; - - private string getExampleCode = -@"@inject Bit.Butil.WebAuthn webAuthn - -Get - -
Result:
-
@getResult?.ToString()?.Replace("","", "",\n"")
-@if (string.IsNullOrWhiteSpace(getError) is false) -{ -
error: @getError
-} - -@code { - private object? getResult; - private string? getError; - - private async Task Get() - { - try - { - getError = null; - var id = ((JsonElement?)createResult)?.GetProperty(""rawId"").ToString(); - var options = id is null - ? new { challenge = ""test"", allowCredentials = new object[] { } } - : new { challenge = ""test"", allowCredentials = new object[] { new { id, type = ""public-key"" } } }; - - getResult = await webAuthn.GetCredential(options); - } - catch (Exception ex) - { - getError = ex.ToString(); - } - } -}"; - - private string verifyExampleCode = -@"@inject Bit.Butil.WebAuthn webAuthn - -Verify - -
Result: @verifyResult
- -@code { - private bool? verifyResult; - - private async Task Verify() - { - verifyResult = await webAuthn.Verify(); - } -}"; -} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil05WebAuthnPage.razor.scss b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil05WebAuthnPage.razor.scss deleted file mode 100644 index 93d7ccf2290..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil05WebAuthnPage.razor.scss +++ /dev/null @@ -1,21 +0,0 @@ -@import '../../Styles/abstracts/_colors.scss'; -@import '../../Styles/abstracts/_mixins.scss'; -@import '../../Styles/abstracts/_functions.scss'; -@import '../../Styles/abstracts/_media-queries.scss'; - -.page-container { - @include PageContainer; -} - -.section-card { - @include SectionCard; -} - -.section-card-txt { - @include SectionCardText; -} - -.result { - word-break: break-all; - white-space: break-spaces; -} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil06ClipboardPage.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil06ClipboardPage.razor deleted file mode 100644 index bc6659291e5..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil06ClipboardPage.razor +++ /dev/null @@ -1,130 +0,0 @@ -@page "/butil/clipboard" -@inherits AppComponentBase -@inject Bit.Butil.Clipboard clipboard - - - -
- Clipboard -
- - How to use the Clipboard class of the bit Butil? - -
- -
- Usage -
- To use the browser Clipboard features you need to inject the Bit.Butil.Clipboard class and use it like this: - -@@inject Bit.Butil.Clipboard clipboard - -@@code { - var text = await clipboard.ReadText(); -} -
-
- -
- Methods -
-
- ReadText:
- Requests text from the system clipboard, returning a Promise that is fulfilled with - a string containing the clipboard's text once it's available - (MDN). -

- - - - - @readTextExampleCode - - - -
- ReadText -

-
Clipboard text: "@clipboardText"
-
-
-
-

- - WriteText:
- Requests text from the system clipboard, returning a Promise that is fulfilled with - a string containing the clipboard's text once it's available - (MDN). -

- - - - - @writeTextExampleCode - - - -
- -
- WriteText -
-
-
-

- Read:
- Requests arbitrary data (such as images) from the clipboard, returning a Promise that - resolves with an array of ClipboardItem objects containing the clipboard's contents - (MDN). -

- - - - - @readExampleCode - - - -
- Read -

- @foreach (var item in clipboardItems) - { -
Clipboard MimeType: "@item.MimeType"
-
Clipboard Data: "@System.Text.Encoding.UTF8.GetString(item.Data)"
-
-
- } -
-
-
-

- - Write:
- Writes arbitrary data to the system clipboard, returning a Promise - that resolves when the operation completes - (MDN). -

- - - - - @writeExampleCode - - - -
- -
- Write -
-
-
-

-
-
-
- - diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil06ClipboardPage.razor.cs b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil06ClipboardPage.razor.cs deleted file mode 100644 index b758bb2bc26..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil06ClipboardPage.razor.cs +++ /dev/null @@ -1,103 +0,0 @@ -using Bit.Butil; - -namespace Bit.Websites.Platform.Client.Pages.Butil; - -public partial class Butil06ClipboardPage -{ - private string clipboardText = string.Empty; - private string newClipboardText = string.Empty; - private ClipboardItem[] clipboardItems = []; - private string newText = string.Empty; - - private async Task ReadText() - { - clipboardText = await clipboard.ReadText(); - } - - private async Task WriteText() - { - await clipboard.WriteText(newClipboardText); - } - - private async Task Read() - { - clipboardItems = await clipboard.Read(); - } - - private async Task Write() - { - var data = System.Text.Encoding.UTF8.GetBytes(newText); - var item = new ClipboardItem() { MimeType = "text/plain", Data = data }; - await clipboard.Write([item]); - } - - private string readTextExampleCode = -@"@inject Bit.Butil.Clipboard clipboard - -ReadText - -
Clipboard text: @clipboardText
- -@code { - private string clipboardText = string.Empty; - - private async Task ReadText() - { - clipboardText = await clipboard.ReadText(); - } -}"; - - private string writeTextExampleCode = -@"@inject Bit.Butil.Clipboard clipboard - - - -WriteText - -@code { - private string newClipboardText = string.Empty; - - private async Task WriteText() - { - await clipboard.WriteText(newClipboardText); - } -}"; - - private string readExampleCode = -@"@inject Bit.Butil.Clipboard clipboard - -Read - -@foreach (var item in clipboardItems) -{ -
Clipboard MimeType: ""@item.MimeType""
-
Clipboard Data: ""@System.Text.Encoding.UTF8.GetString(item.Data)""
-} - -@code { - private ClipboardItem[] clipboardItems = []; - - private async Task Read() - { - clipboardItems = await clipboard.Read(); - } -}"; - - private string writeExampleCode = -@"@inject Bit.Butil.Clipboard clipboard - - - -Write - -@code { - private string newText = string.Empty; - - private async Task Write() - { - var data = System.Text.Encoding.UTF8.GetBytes(newText); - var item = new ClipboardItem() { MimeType = ""text/plain"", Data = data }; - await clipboard.Write([item]); - } -}"; -} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil06ClipboardPage.razor.scss b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil06ClipboardPage.razor.scss deleted file mode 100644 index 7cee07def47..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil06ClipboardPage.razor.scss +++ /dev/null @@ -1,16 +0,0 @@ -@import '../../Styles/abstracts/_colors.scss'; -@import '../../Styles/abstracts/_mixins.scss'; -@import '../../Styles/abstracts/_functions.scss'; -@import '../../Styles/abstracts/_media-queries.scss'; - -.page-container { - @include PageContainer; -} - -.section-card { - @include SectionCard; -} - -.section-card-txt { - @include SectionCardText; -} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil07KeyboardPage.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil07KeyboardPage.razor deleted file mode 100644 index 6a3466efd6e..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil07KeyboardPage.razor +++ /dev/null @@ -1,58 +0,0 @@ -@page "/butil/keyboard" -@inherits AppComponentBase -@inject Bit.Butil.Keyboard keyboard - - - -
- Keyboard -
- - How to use the Keyboard class of the bit Butil? - -
- -
- Usage -
- To use the browser Keyboard features you need to inject the Bit.Butil.Keyboard class and use it like this: - -@@inject Bit.Butil.Keyboard keyboard - -@@code { - await keyboard.Add(ButilKeyCodes.F10, args => { ... }, , ButilModifiers.Alt | ButilModifiers.Ctrl); - await keyboard.Remove(ButilKeyCodes.F10, handler); -} -
-
- -
- Methods -
-
- Add, Remove:
- Adds/Removes a handler to a keyboard key combination. -

- - - - - @addExampleCode - - - -
-
Press Ctrl+F to focus on search box
-
- -
-
-
-
-
-
-
- - diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil07KeyboardPage.razor.cs b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil07KeyboardPage.razor.cs deleted file mode 100644 index c67e9f6b2fb..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil07KeyboardPage.razor.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Bit.Butil; - -namespace Bit.Websites.Platform.Client.Pages.Butil; - -public partial class Butil07KeyboardPage -{ - private BitSearchBox searchBox = default!; - - protected override async Task OnAfterFirstRenderAsync() - { - await keyboard.Add(ButilKeyCodes.KeyF, () => _ = searchBox?.FocusAsync(), ButilModifiers.Ctrl); - } - - - private string addExampleCode = -@"@inject Bit.Butil.Keyboard keyboard - -
Press Ctrl+F to focus on search box
- - - -@code { - private BitSearchBox searchBox = default!; - - protected override async Task OnAfterFirstRenderAsync() - { - await keyboard.Add(ButilKeyCodes.KeyF, () => _ = searchBox?.FocusAsync(), ButilModifiers.Ctrl); - } -}"; -} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil07KeyboardPage.razor.scss b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil07KeyboardPage.razor.scss deleted file mode 100644 index 7cee07def47..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil07KeyboardPage.razor.scss +++ /dev/null @@ -1,16 +0,0 @@ -@import '../../Styles/abstracts/_colors.scss'; -@import '../../Styles/abstracts/_mixins.scss'; -@import '../../Styles/abstracts/_functions.scss'; -@import '../../Styles/abstracts/_media-queries.scss'; - -.page-container { - @include PageContainer; -} - -.section-card { - @include SectionCard; -} - -.section-card-txt { - @include SectionCardText; -} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil08ConsolePage.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil08ConsolePage.razor deleted file mode 100644 index d86c458550d..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil08ConsolePage.razor +++ /dev/null @@ -1,558 +0,0 @@ -@page "/butil/console" -@inherits AppComponentBase -@inject Bit.Butil.Console console - - - -
- Console -
- - How to use the Console class of the bit Butil? - -
- -
- Usage -
- To use the browser console features you need to inject the Bit.Butil.Console class and use it like this: - -@@inject Bit.Butil.Console console - -@@code { - console.Log("This is a test log:", value); - console.Error("This is a test error:", value); - console.Assert(condition, "The condition failed!", value); -} -
-
- -
- Methods -
-
- Assert:
- Log a message and stack trace to console if the first argument is false - (MDN). -

- - - - - @assertExampleCode - - - -
- -
-
Open the DevTools console and start clicking on the button
-
- Assert -
-
-
-
-

- - Count:
- Log the number of times this line has been called with the given label - (MDN). -

- - - - - @countExampleCode - - - -
- -
-
Open the DevTools console and start clicking on the button
-
- Count -
-
-
-
-

- - CountReset:
- Resets the value of the counter with the given label - (MDN). -

- - - - - @countResetExampleCode - - - -
- -
-
Open the DevTools console and start clicking on the button
-
- CountReset -
-
-
-
-

- - Debug:
- Outputs a message to the console with the log level debug - (MDN). -

- - - - - @debugExampleCode - - - -
- -
-
Open the DevTools console and start clicking on the button
-
- Debug -
-
-
-
-

- - Dir:
- Displays an interactive listing of the properties of a specified JavaScript object - (MDN). -

- - - - - @dirExampleCode - - - -
- -
-
Open the DevTools console and start clicking on the button
-
- Dir -
-
-
-
-

- - Dirxml:
- Displays an XML/HTML Element representation of the specified object if possible or the JavaScript Object view if it is not possible - (MDN). -

- - - - - @dirxmlExampleCode - - - -
- -
-
Open the DevTools console and start clicking on the button
-
- Dirxml -
-
-
-
-

- - Error:
- Outputs an error message. You may use string substitution and additional arguments with this method - (MDN). -

- - - - - @errorExampleCode - - - -
- -
-
Open the DevTools console and start clicking on the button
-
- Error -
-
-
-
-

- - Group:
- Creates a new inline group, indenting all following output by another level. To move back out a level, call console.groupEnd() - (MDN). -

- - - - - @groupExampleCode - - - -
-
Open the DevTools console and start clicking on the button
-
- Create group logs -
-
-
-
-

- - GroupCollapsed:
- Creates a new inline group, indenting all following output by another level. However, unlike console.group() this starts with the inline group collapsed requiring the use of a disclosure button to expand it. To move back out a level, call console.groupEnd() - (MDN). -

- - - - - @groupExampleCode - - - -
-
Open the DevTools console and start clicking on the button
-
- Create group logs -
-
-
-
-

- - GroupEnd:
- Exits the current inline group - (MDN). -

- - - - - @groupExampleCode - - - -
-
Open the DevTools console and start clicking on the button
-
- Create group logs -
-
-
-
-

- - Info:
- Informative logging of information. You may use string substitution and additional arguments with this method - (MDN). -

- - - - - @infoExampleCode - - - -
- -
-
Open the DevTools console and start clicking on the button
-
- Info -
-
-
-
-

- - Log:
- For general output of logging information. You may use string substitution and additional arguments with this method - (MDN). -

- - - - - @logExampleCode - - - -
- -
-
Open the DevTools console and start clicking on the button
-
- Log -
-
-
-
-

- - Warn:
- Outputs a warning message - (MDN). -

- - - - - @warnExampleCode - - - -
- -
-
Open the DevTools console and start clicking on the button
-
- Warn -
-
-
-
-

- - Table:
- Displays tabular data as a table - (MDN). -

- - - - - @tableExampleCode - - - -
- -
-
Open the DevTools console and start clicking on the button
-
- Table -
-
-
-
-

- - Profile:
- Starts the browser's built-in profiler (for example, the Firefox performance tool). You can specify an optional name for the profile - (MDN). -

- - - - - @profileExampleCode - - - -
- -
-
Open the DevTools console and start clicking on the button
-
- Profile -
-
-
-
-

- - ProfileEnd:
- Stops the profiler. You can see the resulting profile in the browser's performance tool (for example, the Firefox performance tool) - (MDN). -

- - - - - @profileEndExampleCode - - - -
- -
-
Open the DevTools console and start clicking on the button
-
- ProfileEnd -
-
-
-
-

- - Time:
- Starts a timer with a name specified as an input parameter. Up to 10,000 simultaneous timers can run on a given page - (MDN). -

- - - - - @timeExampleCode - - - -
- -
-
Open the DevTools console and start clicking on the button
-
- Time -
-
-
-
-

- - TimeLog:
- Logs the value of the specified timer to the console - (MDN). -

- - - - - @timeLogExampleCode - - - -
- -
-
Open the DevTools console and start clicking on the button
-
- TimeLog -
-
-
-
-

- - TimeEnd:
- Stops the specified timer and logs the elapsed time in milliseconds since it started - (MDN). -

- - - - - @timeEndExampleCode - - - -
- -
-
Open the DevTools console and start clicking on the button
-
- TimeEnd -
-
-
-
-

- - TimeStamp:
- Adds a marker to the browser performance tool's timeline - (MDN). -

- - - - - @timeStampExampleCode - - - -
- -
-
Open the DevTools console and start clicking on the button
-
- TimeStamp -
-
-
-
-

- - Trace:
- Outputs a stack trace - (MDN). -

- - - - - @traceExampleCode - - - -
- -
-
Open the DevTools console and start clicking on the button
-
- Trace -
-
-
-
-

- - Clear:
- Clear the console - (MDN). -

- - - - - @clearExampleCode - - - -
-
Open the DevTools console and start clicking on the button
-
- Clear -
-
-
-
-
-
-
- - diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil08ConsolePage.razor.cs b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil08ConsolePage.razor.cs deleted file mode 100644 index 9ec5f5893f8..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil08ConsolePage.razor.cs +++ /dev/null @@ -1,227 +0,0 @@ -namespace Bit.Websites.Platform.Client.Pages.Butil; - -public partial class Butil08ConsolePage -{ - private string value = "Test"; - - - private async Task CreateGroupLogs() - { - await console.Log("This is the outer level"); - await console.Group(); - await console.Log("Level 2"); - await console.Group(); - await console.Log("Level 3"); - await console.Warn("More of level 3"); - await console.GroupCollapsed(); - await console.Log("Back to level 2"); - await console.GroupEnd(); - await console.Log("Back to the outer level"); - } - - - private string assertExampleCode = -@"@inject Bit.Butil.Console console - - - - console.Assert(false, ""This is a test assert:"", value))"">Assert - -@code { - private string value = ""Test""; -}"; - private string countExampleCode = -@"@inject Bit.Butil.Console console - - - - console.Count(value))"">Count - -@code { - private string value = ""Test""; -}"; - private string countResetExampleCode = -@"@inject Bit.Butil.Console console - - - - console.CountReset(value))"">CountReset - -@code { - private string value = ""Test""; -}"; - private string debugExampleCode = -@"@inject Bit.Butil.Console console - - - - console.Debug(value))"">Debug - -@code { - private string value = ""Test""; -}"; - private string dirExampleCode = -@"@inject Bit.Butil.Console console - - - - console.Dir(value))"">Dir - -@code { - private string value = ""Test""; -}"; - private string dirxmlExampleCode = -@"@inject Bit.Butil.Console console - - - - console.Dirxml(value))"">Dirxml - -@code { - private string value = ""Test""; -}"; - private string errorExampleCode = -@"@inject Bit.Butil.Console console - - - - console.Error(""This is a test error:"", value))"">Error - -@code { - private string value = ""Test""; -}"; - private string groupExampleCode = -@"@inject Bit.Butil.Console console - -Create group logs - -@code { - private async Task CreateGroupLogs() - { - await console.Log(""This is the outer level""); - await console.Group(); - await console.Log(""Level 2""); - await console.Group(); - await console.Log(""Level 3""); - await console.Warn(""More of level 3""); - await console.GroupCollapsed(); - await console.Log(""Back to level 2""); - await console.GroupEnd(); - await console.Log(""Back to the outer level""); - } -}"; - private string infoExampleCode = -@"@inject Bit.Butil.Console console - - - - console.Info(""This is a test info:"", value))"">Info - -@code { - private string value = ""Test""; -}"; - private string logExampleCode = -@"@inject Bit.Butil.Console console - - - - console.Log(""This is a test log:"", value))"">Log - -@code { - private string value = ""Test""; -}"; - private string warnExampleCode = -@"@inject Bit.Butil.Console console - - - - console.Warn(""This is a test warn:"", value))"">Warn - -@code { - private string value = ""Test""; -}"; - private string tableExampleCode = -@"@inject Bit.Butil.Console console - - - - console.Table(new {Name = ""Value"", Value = value }))"">Table - -@code { - private string value = ""Test""; -}"; - private string profileExampleCode = -@"@inject Bit.Butil.Console console - - - - console.Profile(value))"">Profile - -@code { - private string value = ""Test""; -}"; - private string profileEndExampleCode = -@"@inject Bit.Butil.Console console - - - - console.ProfileEnd(value))"">ProfileEnd - -@code { - private string value = ""Test""; -}"; - private string timeExampleCode = -@"@inject Bit.Butil.Console console - - - - console.Time(value))"">Time - -@code { - private string value = ""Test""; -}"; - private string timeLogExampleCode = -@"@inject Bit.Butil.Console console - - - - console.TimeLog(value))"">TimeLog - -@code { - private string value = ""Test""; -}"; - private string timeEndExampleCode = -@"@inject Bit.Butil.Console console - - - - console.TimeEnd(value))"">TimeEnd - -@code { - private string value = ""Test""; -}"; - private string timeStampExampleCode = -@"@inject Bit.Butil.Console console - - - - console.TimeStamp(value))"">TimeStamp - -@code { - private string value = ""Test""; -}"; - private string traceExampleCode = -@"@inject Bit.Butil.Console console - - - - console.Trace(value))"">Trace - -@code { - private string value = ""Test""; -}"; - private string clearExampleCode = -@"@inject Bit.Butil.Console console - - console.Clear(value))"">Clear"; -} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil08ConsolePage.razor.scss b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil08ConsolePage.razor.scss deleted file mode 100644 index 7cee07def47..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil08ConsolePage.razor.scss +++ /dev/null @@ -1,16 +0,0 @@ -@import '../../Styles/abstracts/_colors.scss'; -@import '../../Styles/abstracts/_mixins.scss'; -@import '../../Styles/abstracts/_functions.scss'; -@import '../../Styles/abstracts/_media-queries.scss'; - -.page-container { - @include PageContainer; -} - -.section-card { - @include SectionCard; -} - -.section-card-txt { - @include SectionCardText; -} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil09NotificationPage.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil09NotificationPage.razor deleted file mode 100644 index 411b4a9c67f..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil09NotificationPage.razor +++ /dev/null @@ -1,126 +0,0 @@ -@page "/butil/notification" -@inherits AppComponentBase -@inject Bit.Butil.Notification notification - - - -
- Notification -
- - How to use the Notification class of the bit Butil? - -
- -
- Usage -
- To use the browser notification features you need to inject the Bit.Butil.Notification class and use it like this: - -@@inject Bit.Butil.Notification notification - -@@code { - await notification.IsSupported(); - await notification.Show("title", new() { Body = "this is body." }); -} -
-
- -
- Methods -
-
- IsSupported:
- Checks if the runtime (browser or web-view) is supporting the Web Notification API. -

- - - - - @isSupportedExampleCode - - - -
- Notification supported? [@isNotificationSupported] -
- IsSupported -
-
-
-
-

- - GetPermission:
- Gets the current permission of the Notification API. - (MDN). -

- - - - - @getPermissionExampleCode - - - -
- Current permission state: [@permissionResult] -
- GetPermission -
-
-
-
-

- - RequestPermission:
- Requests permission from the user for the current origin to display notifications. - (MDN). -

- - - - - @requestPermissionExampleCode - - - -
- Request permission result: [@requestPermissionResult] -
- RequestPermission -
-
-
-
-

- - Show:
- Requests a native notification to show to the user. - (MDN). -
- Note: The Notification api has some limitation on Android and for it to work properly a - Service Worker needs to be registered first. -

- - - - - @showExampleCode - - - -
- Show -
-
-
-
-

-
-
-
- - diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil09NotificationPage.razor.cs b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil09NotificationPage.razor.cs deleted file mode 100644 index f699038ce14..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil09NotificationPage.razor.cs +++ /dev/null @@ -1,88 +0,0 @@ -using Bit.Butil; - -namespace Bit.Websites.Platform.Client.Pages.Butil; - -public partial class Butil09NotificationPage -{ - private bool? isNotificationSupported; - private async Task CheckIsSupported() - { - isNotificationSupported = await notification.IsSupported(); - } - - private NotificationPermission? permissionResult = null; - private async Task GetCurrentPermissionState() - { - permissionResult = await notification.GetPermission(); - } - - private NotificationPermission? requestPermissionResult = null; - private async Task RequestPermission() - { - requestPermissionResult = await notification.RequestPermission(); - } - - private async Task ShowNotification() - { - await notification.Show("title", new() { Body = "this is body." }); - } - - - - private string isSupportedExampleCode = -@"@inject Bit.Butil.Notification notification - -Notification supported? [@isNotificationSupported] - -IsSupported - -@code { - private bool? isNotificationSupported; - - private async Task CheckIsSupported() - { - isNotificationSupported = await notification.IsSupported(); - } -}"; - private string getPermissionExampleCode = -@"@inject Bit.Butil.Notification notification - -Current permission state: [@permissionResult] - -GetPermission - -@code { - private NotificationPermission? permissionResult = null; - - private async Task GetCurrentPermissionState() - { - permissionResult = await notification.GetPermission(); - } -}"; - private string requestPermissionExampleCode = -@"@inject Bit.Butil.Notification notification - -Request permission result: [@requestPermissionResult] - -RequestPermission - -@code { - private NotificationPermission? requestPermissionResult = null; - - private async Task RequestPermission() - { - requestPermissionResult = await notification.RequestPermission(); - } -}"; - private string showExampleCode = -@"@inject Bit.Butil.Notification notification - -Show - -@code { - private async Task ShowNotification() - { - await notification.Show(""title"", new() { Body = ""this is body."" }); - } -}"; -} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil09NotificationPage.razor.scss b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil09NotificationPage.razor.scss deleted file mode 100644 index 7cee07def47..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil09NotificationPage.razor.scss +++ /dev/null @@ -1,16 +0,0 @@ -@import '../../Styles/abstracts/_colors.scss'; -@import '../../Styles/abstracts/_mixins.scss'; -@import '../../Styles/abstracts/_functions.scss'; -@import '../../Styles/abstracts/_media-queries.scss'; - -.page-container { - @include PageContainer; -} - -.section-card { - @include SectionCard; -} - -.section-card-txt { - @include SectionCardText; -} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil10StoragePage.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil10StoragePage.razor deleted file mode 100644 index a24243561c5..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil10StoragePage.razor +++ /dev/null @@ -1,191 +0,0 @@ -@page "/butil/storage" -@inherits AppComponentBase -@inject Bit.Butil.LocalStorage localStorage -@inject Bit.Butil.SessionStorage sessionStorage - - - -
- Storage -
- - How to use the Storage class of the bit Butil? - -
- -
- Usage -
- To use the browser storage features you need to inject the Bit.Butil.Storage class and use it like this: - -@@inject Bit.Butil.LocalStorage localStorage -@@inject Bit.Butil.SessionStorage sessionStorage - -@@code { - await localStorage.SetItem("my-key", "my-value"); - await sessionStorage.SetItem("my-key2", "my-value2"); -} -
-
- -
- Methods -
-
- GetLength:
- Returns an integer representing the number of data items stored in the Storage object - (MDN). -

- - - - - @getLengthExampleCode - - - -
- GetLength -
-
-
LocalStorage length: @localLength
-
-
SessionStorage length: @sessionLength
-
-
-
-
-

- - GetKey:
- When passed a number n, this method will return the name of the nth key in the storage - (MDN). -

- - - - - @getKeyExampleCode - - - -
- -
- GetKey -
-
-
LocalStorage key: @localKey
-
-
SessionStorage key: @sessionKey
-
-
-
-
-

- - GetItem:
- When passed a key name, will return that key's value - (MDN). -

- - - - - @getItemExampleCode - - - -
- -
- -
-
- GetItem -
-
-
LocalStorage item: @currentLocalItem
-
-
SessionStorage item: @currentSessionItem
-
-
-
-
-

- - SetItem:
- When passed a key name and value, will add that key to the storage, or update that key's value if it already exists - (MDN). -

- - - - - @setItemExampleCode - - - -
- -
- -
-
- SetItem -
-
-
-
-

- - RemoveItem:
- When passed a key name, will remove that key from the storage - (MDN). -

- - - - - @removeItemExampleCode - - - -
- -
- -
-
- RemoveItem -
-
-
-
-

- - Clear:
- When invoked, will empty all keys out of the storage - (MDN). -

- - - - - @clearItemExampleCode - - - -
- Clear -
-
-
-
-
-
-
- - diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil10StoragePage.razor.cs b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil10StoragePage.razor.cs deleted file mode 100644 index 531a2a2940f..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil10StoragePage.razor.cs +++ /dev/null @@ -1,199 +0,0 @@ -namespace Bit.Websites.Platform.Client.Pages.Butil; - -public partial class Butil10StoragePage -{ - private string? localLength; - private string? sessionLength; - - private double keyIndex; - private string? localKey; - private string? sessionKey; - - private string? currentLocalItemKey; - private string? currentSessionItemKey; - private string? currentLocalItem; - private string? currentSessionItem; - - private string? newLocalItemKey; - private string? newSessionItemKey; - - private string? localItemKey; - private string? sessionItemKey; - - - private async Task GetLength() - { - var localResult = await localStorage.GetLength(); - localLength = localResult.ToString(); - - var sessionResult = await sessionStorage.GetLength(); - sessionLength = sessionResult.ToString(); - } - - private async Task GetKey() - { - localKey = await localStorage.GetKey((int)keyIndex); - - sessionKey = await sessionStorage.GetKey((int)keyIndex); - } - - private async Task GetItem() - { - currentLocalItem = await localStorage.GetItem(currentLocalItemKey); - - currentSessionItem = await sessionStorage.GetItem(currentSessionItemKey); - } - - private async Task SetItem() - { - await localStorage.SetItem(newLocalItemKey, newLocalItemKey); - - await sessionStorage.SetItem(newSessionItemKey, newSessionItemKey); - } - - private async Task RemoveItem() - { - await localStorage.RemoveItem(localItemKey); - - await sessionStorage.RemoveItem(sessionItemKey); - } - - private async Task Clear() - { - await localStorage.Clear(); - - await sessionStorage.Clear(); - } - - - private string getLengthExampleCode = -@"@inject Bit.Butil.LocalStorage localStorage -@inject Bit.Butil.SessionStorage sessionStorage - -GetLength - -
LocalStorage length: @localLength
- -
SessionStorage length: @sessionLength
- -@code { - private string? localLength; - private string? sessionLength; - - private async Task GetLength() - { - var localResult = await localStorage.GetLength(); - localLength = localResult.ToString(); - - var sessionResult = await sessionStorage.GetLength(); - sessionLength = sessionResult.ToString(); - } -}"; - private string getKeyExampleCode = -@"@inject Bit.Butil.LocalStorage localStorage -@inject Bit.Butil.SessionStorage sessionStorage - - - -GetKey - -
LocalStorage key: @localKey
- -
SessionStorage key: @sessionKey
- -@code { - private double keyIndex; - private string? localKey; - private string? sessionKey; - - private async Task GetKey() - { - localKey = await localStorage.GetKey((int)keyIndex); - - sessionKey = await sessionStorage.GetKey((int)keyIndex); - } -}"; - private string getItemExampleCode = -@"@inject Bit.Butil.LocalStorage localStorage -@inject Bit.Butil.SessionStorage sessionStorage - - - - - -GetItem - -
LocalStorage item: @currentLocalItem
- -
SessionStorage item: @currentSessionItem
- -@code { - private string? currentLocalItemKey; - private string? currentSessionItemKey; - private string? currentLocalItem; - private string? currentSessionItem; - - private async Task GetItem() - { - currentLocalItem = await localStorage.GetItem(currentLocalItemKey); - - currentSessionItem = await sessionStorage.GetItem(currentSessionItemKey); - } -}"; - private string setItemExampleCode = -@"@inject Bit.Butil.LocalStorage localStorage -@inject Bit.Butil.SessionStorage sessionStorage - - - - - -SetItem - -@code { - private string? newLocalItemKey; - private string? newSessionItemKey; - - private async Task SetItem() - { - await localStorage.SetItem(newLocalItemKey, newLocalItemKey); - - await sessionStorage.SetItem(newSessionItemKey, newSessionItemKey); - } -}"; - private string removeItemExampleCode = -@"@inject Bit.Butil.LocalStorage localStorage -@inject Bit.Butil.SessionStorage sessionStorage - - - - - -RemoveItem - -@code { - private string? localItemKey; - private string? sessionItemKey; - - private async Task RemoveItem() - { - await localStorage.RemoveItem(localItemKey); - - await sessionStorage.RemoveItem(sessionItemKey); - } -}"; - private string clearItemExampleCode = -@"@inject Bit.Butil.LocalStorage localStorage -@inject Bit.Butil.SessionStorage sessionStorage - -Clear - -@code { - private async Task Clear() - { - await localStorage.Clear(); - - await sessionStorage.Clear(); - } -}"; -} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil10StoragePage.razor.scss b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil10StoragePage.razor.scss deleted file mode 100644 index 7cee07def47..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil10StoragePage.razor.scss +++ /dev/null @@ -1,16 +0,0 @@ -@import '../../Styles/abstracts/_colors.scss'; -@import '../../Styles/abstracts/_mixins.scss'; -@import '../../Styles/abstracts/_functions.scss'; -@import '../../Styles/abstracts/_media-queries.scss'; - -.page-container { - @include PageContainer; -} - -.section-card { - @include SectionCard; -} - -.section-card-txt { - @include SectionCardText; -} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil11CookiePage.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil11CookiePage.razor deleted file mode 100644 index 420093945e5..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil11CookiePage.razor +++ /dev/null @@ -1,136 +0,0 @@ -@page "/butil/cookie" -@inherits AppComponentBase -@inject Bit.Butil.Cookie cookie - - - -
- Cookie -
- - How to use the Cookie class of the bit Butil? - -
- -
- Usage -
- To use the browser cookie features you need to inject the Bit.Butil.Cookie class and use it like this: - -@@inject Bit.Butil.Cookie cookie - -@@code { - await cookie.Remove("cookie-name"); -} -
-
- -
- Methods -
-
- Set, Get:
- Gets/Sets a cookie by providing the cookie name - (MDN). -

- - - - - @getSetExampleCode - - - -
- -
- -
- Set -
-
-
- -
- Get -
-
-
Cookie value: @getCookieValue
-
-
-
-
-

- - GetAll:
- Gets all cookies registered on the current document. -

- - - - - @getAllExampleCode - - - -
- GetAll -
-
-
Cookies: @getAllCookieValues
-
-
-
-
-

- - GetValue:
- Returns the cookie value by providing its name. -

- - - - - @getValueExampleCode - - - -
- -
- GetValue -
-
-
Cookie value: @getValueCookieValue
-
-
-
-
-

- - Remove:
- Removes a cookie by providing the its name. -

- - - - - @removeExampleCode - - - -
- -
- Remove -
-
-
-
-
-
-
- - diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil11CookiePage.razor.cs b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil11CookiePage.razor.cs deleted file mode 100644 index 9d69c7bc868..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil11CookiePage.razor.cs +++ /dev/null @@ -1,131 +0,0 @@ -using Bit.Butil; - -namespace Bit.Websites.Platform.Client.Pages.Butil; - -public partial class Butil11CookiePage -{ - private string? newCookieName; - private string? newCookieValue; - private string? getCookieName; - private string? getCookieValue; - - private string? getAllCookieValues; - - private string? getValueCookieName; - private string? getValueCookieValue; - - private string? removeCookieName; - - - private async Task SetCookie() - { - await cookie.Set(new ButilCookie { Name = newCookieName, Value = newCookieValue }); - } - - private async Task GetCookie() - { - var result = await cookie.Get(getCookieName!); - getCookieValue = result?.Value; - } - - private async Task GetAllCookies() - { - getAllCookieValues = string.Join(", ", await cookie.GetAll()); - } - - private async Task GetValue() - { - getValueCookieValue = await cookie.GetValue(getValueCookieName!); - } - - private async Task RemoveCookie() - { - await cookie.Remove(removeCookieName!); - } - - - private string getSetExampleCode = -@"@inject Bit.Butil.Cookie cookie - - - - - -Set - - - -Get - -
Cookie value: @getCookieValue
- -@code { - private string? newCookieName; - private string? newCookieValue; - private string? getCookieName; - private string? getCookieValue; - - private async Task SetCookie() - { - await cookie.Set(new ButilCookie { Name = newCookieName, Value = newCookieValue }); - } - - private async Task GetCookie() - { - var result = await cookie.Get(getCookieName!); - currentCookieValue = result?.Value; - } -}"; - - private string getAllExampleCode = -@"@inject Bit.Butil.Cookie cookie - -GetAll - -
Cookies: @getAllCookieValues
- -@code { - private string? getAllCookieValues; - - private async Task GetAllCookies() - { - getAllCookieValues = string.Join("", "", await cookie.GetAll()); - } -}"; - - private string getValueExampleCode = -@"@inject Bit.Butil.Cookie cookie - - - -GetValue - -
Cookie value: @getValueCookieValue
- -@code { - private string? getValueCookieName; - private string? getValueCookieValue; - - private async Task GetValue() - { - getValueCookieValue = await cookie.GetValue(getValueCookieName!); - } -}"; - - - private string removeExampleCode = -@"@inject Bit.Butil.Cookie cookie - - - -Remove - -@code { - private string? removeCookieName; - - private async Task RemoveCookie() - { - await cookie.Remove(removeCookieName!); - } -}"; -} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil11CookiePage.razor.scss b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil11CookiePage.razor.scss deleted file mode 100644 index 7cee07def47..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil11CookiePage.razor.scss +++ /dev/null @@ -1,16 +0,0 @@ -@import '../../Styles/abstracts/_colors.scss'; -@import '../../Styles/abstracts/_mixins.scss'; -@import '../../Styles/abstracts/_functions.scss'; -@import '../../Styles/abstracts/_media-queries.scss'; - -.page-container { - @include PageContainer; -} - -.section-card { - @include SectionCard; -} - -.section-card-txt { - @include SectionCardText; -} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil12HistoryPage.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil12HistoryPage.razor deleted file mode 100644 index ef4e08aad77..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil12HistoryPage.razor +++ /dev/null @@ -1,199 +0,0 @@ -@page "/butil/history" -@inherits AppComponentBase -@inject Bit.Butil.History history - - - -
- History -
- - How to use the History class of the bit Butil? - -
- -
- Usage -
- To use the browser history features you need to inject the Bit.Butil.History class and use it like this: - -@@inject Bit.Butil.History history - -@@code { - await history.GoBack(); -} -
-
- -
- Methods -
-
- GetLength:
- Returns an Integer representing the number of elements in the session history, including the currently loaded page - (MDN). -

- - - - - @getLengthExampleCode - - - -
- GetLength -
-
-
History length is: @historyLength
-
-
-
-
-

- - SetScrollRestoration, GetScrollRestoration:
- Gets/Sets default scroll restoration behavior on history navigation. This property can be either auto or manual - (MDN). -

- - - - - @setScrollRestorationExampleCode - - - -
- -
- SetScrollRestoration -
-
-
-
-

- - GetState: Returns an any value representing the state at the top of the history stack - (MDN). -

- - GoBack:
- This asynchronous method goes to the previous page in session history, the same action as when the user clicks the browser's Back button. - Calling this method to go back beyond the first page in the session history has no effect and doesn't raise an exception - (MDN). -

- - - - - @goBackExampleCode - - - -
- GoBack -
-
-
-
-

- - GoForward:
- This asynchronous method goes to the next page in session history, the same action as when the user clicks the browser's Forward button. - Calling this method to go forward beyond the most recent page in the session history has no effect and doesn't raise an exception - (MDN). -

- - - - - @goForwardExampleCode - - - -
- GoForward -
-
-
-
-

- - Go:
- Asynchronously loads a page from the session history, identified by its relative location to the current page, for example -1 for the previous page or 1 for the next page. - Calling this method without parameters or a value of 0 reloads the current page - (MDN). -

- - - - - @goExampleCode - - - -
- -
- Go -
-
-
-
-

- - PushState:
- Pushes the given data onto the session history stack with the specified title (and, if provided, URL) - (MDN). -

- - - - - @pushStateExampleCode - - - -
- -
- PushState -
-
-
-
-

- - ReplaceState:
- Updates the most recent entry on the history stack to have the specified data, title, and, if provided, URL - (MDN). -

- - - - - @replaceStateExampleCode - - - -
- -
- ReplaceState -
-
-
-
-

- - AddPopState, RemovePopState:
- The popstate event of the Window interface is fired when the active history entry changes while the user navigates the session history - (MDN). -
-
-
- - diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil12HistoryPage.razor.cs b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil12HistoryPage.razor.cs deleted file mode 100644 index 75a0510ecb3..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil12HistoryPage.razor.cs +++ /dev/null @@ -1,129 +0,0 @@ -using Bit.Butil; - -namespace Bit.Websites.Platform.Client.Pages.Butil; - -public partial class Butil12HistoryPage -{ - private string? historyLength; - - private bool isScrollRestorationManual; - - private double delta; - - private string pushStateUrl = "butil/history#push-state"; - - private string replaceStateUrl = "butil/history#replace-state"; - - - private async Task GetLength() - { - var result = await history.GetLength(); - historyLength = result.ToString(); - } - - private async Task SetScrollRestoration() - { - await history.SetScrollRestoration(isScrollRestorationManual ? ScrollRestoration.Manual : ScrollRestoration.Auto); - } - - private async Task Go() - { - await history.Go((int)delta); - } - - private async Task PushState() - { - await history.PushState(url: pushStateUrl); - } - - private async Task ReplaceState() - { - await history.ReplaceState(url: replaceStateUrl); - } - - - private string getLengthExampleCode = -@"@inject Bit.Butil.History history - -GetLength - -
History length is: @historyLength
- -@code { - private string? historyLength; - - private async Task GetLength() - { - var result = await history.GetLength(); - historyLength = result.ToString(); - } -}"; - private string setScrollRestorationExampleCode = -@"@inject Bit.Butil.History history - - - -SetScrollRestoration - -@code { - private bool isScrollRestorationManual; - - private async Task SetScrollRestoration() - { - await history.SetScrollRestoration(isScrollRestorationManual ? ScrollRestoration.Manual : ScrollRestoration.Auto); - } -}"; - private string goBackExampleCode = -@"@inject Bit.Butil.History history - - history.GoBack())"">GoBack"; - private string goForwardExampleCode = -@"@inject Bit.Butil.History history - - history.GoForward())"">GoForward"; - private string goExampleCode = -@"@inject Bit.Butil.History history - - - -Go - -@code { - private double delta; - - private async Task Go() - { - await history.Go((int)delta); - } -}"; - private string pushStateExampleCode = -@"@inject Bit.Butil.History history - - - -PushState - -@code { - private string pushStateUrl = ""butil/history#push-state""; - - private async Task PushState() - { - await history.PushState(url: pushStateUrl); - } -}"; - private string replaceStateExampleCode = -@"@inject Bit.Butil.History history - - - -ReplaceState - -@code { - private string replaceStateUrl = ""butil/history#replace-state""; - - private async Task ReplaceState() - { - await history.ReplaceState(url: replaceStateUrl); - } -}"; -} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil12HistoryPage.razor.scss b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil12HistoryPage.razor.scss deleted file mode 100644 index 7cee07def47..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil12HistoryPage.razor.scss +++ /dev/null @@ -1,16 +0,0 @@ -@import '../../Styles/abstracts/_colors.scss'; -@import '../../Styles/abstracts/_mixins.scss'; -@import '../../Styles/abstracts/_functions.scss'; -@import '../../Styles/abstracts/_media-queries.scss'; - -.page-container { - @include PageContainer; -} - -.section-card { - @include SectionCard; -} - -.section-card-txt { - @include SectionCardText; -} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil13ElementPage.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil13ElementPage.razor deleted file mode 100644 index fb7f5e59c9c..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil13ElementPage.razor +++ /dev/null @@ -1,1360 +0,0 @@ -@page "/butil/element" -@inherits AppComponentBase - - - -
- Element -
- - How to use the Element class of the bit Butil? - -
- -
- Usage -
- To use the browser Element features you need to just use the Bit.Butil namesapce and utilize its extension methods like this: - -@@using Bit.Butil - -<div @@ref="elementRef">Element</div> - -@@code { - private ElementReference elementRef; - - var rect = await elementRef.GetBoundingClientRect(); -} -
-
- -
- Methods -
-
- GetAttribute:
- Retrieves the value of the named attribute from the current node and returns it as a string - (MDN). -

- - - - - @getAttributeExampleCode - - - -
-
- Element -
-
- -
- GetAttribute -
-
-
Attribute: @currentAttribute
-
-
-
-
-

- - GetAttributeNames:
- Returns an array of attribute names from the current element - (MDN). -

- - - - - @getAttributeNamesExampleCode - - - -
-
- Element -
-
- GetAttributeNames -
-
-
Attribute names: @currentAttributeNames
-
-
-
-
-

- - GetBoundingClientRect:
- Returns the size of an element and its position relative to the viewport - (MDN). -

- - - - - @getBoundingClientRectExampleCode - - - -
-
- Element -
-
- GetBoundingClientRect -
-
-
Bounding client rect: @currentBoundingClientRect
-
-
-
-
-

- - HasAttribute:
- Returns a boolean value indicating if the element has the specified attribute or not - (MDN). -

- - - - - @hasAttributeExampleCode - - - -
-
- Element -
-
- -
- GetHasAttribute -
-
-
Has attribute: @hasAttribute
-
-
-
-
-

- - HasAttributes:
- Returns a boolean value indicating if the element has one or more HTML attributes present - (MDN). -

- - - - - @hasAttributesExampleCode - - - -
-
- Element -
-
- GetHasAttributes -
-
-
Has attributes: @hasAttributes
-
-
-
-
-

- - SetPointerCapture:
- Designates a specific element as the capture target of future pointer events - (MDN). -


- - HasPointerCapture:
- Indicates whether the element on which it is invoked has pointer capture for the pointer identified by the given pointer ID - (MDN). -


- - ReleasePointerCapture:
- Releases (stops) pointer capture that was previously set for a specific pointer event - (MDN). -


- - RequestPointerLock:
- Allows to asynchronously ask for the pointer to be locked on the given element - (MDN). -

- - - - - @requestPointerLockExampleCode - - - -
-
- Element -
-
- - RequestPointerLock - -
-
-
-
-

- - RequestFullScreen:
- Asynchronously asks the browser to make the element fullscreen - (MDN). -

- - - - - @requestFullScreenExampleCode - - - -
-
- Element -
-
- RequestFullScreen -
-
-
-
-

- - Matches:
- Returns a boolean value indicating whether or not the element would be selected by the specified selector string - (MDN). -

- - - - - @matchesExampleCode - - - -
-
- Element -
-
- -
- Matches -
-
-
Matches: @matches
-
-
-
-
-

- - Scroll:
- Scrolls to a particular set of coordinates inside a given element - (MDN). -

- - - - - @scrollExampleCode - - - -
-
-
Element
-
-
- -
- -
- - - - - -
- Scroll -
-
-
-
-

- - ScrollBy:
- Scrolls an element by the given amount - (MDN). -

- - - - - @scrollByExampleCode - - - -
-
-
Element
-
-
- -
- -
- - - - - -
- ScrollBy -
-
-
-
-

- - ScrollIntoView:
- Scrolls the page until the element gets into the view - (MDN). -

- - - - - @scrollIntoViewExampleCode - - - -
-
- Element -
-
- - - - - - -
- - - - - - -
- - - - - -
- ScrollIntoView -
-
-
-
-

- - RemoveAttribute:
- Removes the named attribute from the current node - (MDN). -

- - - - - @removeAttributeExampleCode - - - -
-
- Element -
-
- -
- RemoveAttribute -
-
-
-
-

- - SetAttribute:
- Sets the value of a named attribute of the current node - (MDN). -

- - - - - @setAttributeExampleCode - - - -
-
- Element -
-
- -
- -
- SetAttribute -
-
-
-
-

- - ToggleAttribute:
- Toggles a boolean attribute, removing it if it is present and adding it if it is not present, on the specified element - (MDN). -

- - - - - @toggleAttributeExampleCode - - - -
-
- Element -
-
- -
- -
- ToggleAttribute -
-
-
-
-

- - SetAccessKey, GetAccessKey:
- Gets/Sets a string representing the access key assigned to the element - (MDN). -

- - - - - @accessKeyExampleCode - - - -
-
- Element -
-
- -
- SetAccessKey -   - GetAccessKey -
-
-
Access key: @currentAccessKey
-
-
-
-
-

- - SetClassName, GetClassName:
- Gets/Sets a string representing the class of the element - (MDN). -

- - - - - @classNameExampleCode - - - -
-
- Element -
-
- -
- SetClassName -   - GetClassName -
-
-
ClassName: @currentClassName
-
-
-
-
-

- - GetClientHeight:
- Returns a number representing the inner height of the element in px - (MDN). -

- - - - - @getClientHeightExampleCode - - - -
-
- Element -
-
- GetClientHeight -
-
-
ClientHeight: @currentClientHeight
-
-
-
-
-

- - GetClientLeft:
- Returns a number representing the width of the left border of the element in px - (MDN). -

- - - - - @getClientLeftExampleCode - - - -
-
- Element -
-
- GetClientLeft -
-
-
ClientLeft: @currentClientLeft
-
-
-
-
-

- - GetClientTop:
- Returns a number representing the width of the top border of the element in px - (MDN). -

- - - - - @getClientTopExampleCode - - - -
-
- Element -
-
- GetClientTop -
-
-
ClientTop: @currentClientTop
-
-
-
-
-

- - GetClientWidth:
- Returns a number representing the inner width of the element in px - (MDN). -

- - - - - @getClientWidthExampleCode - - - -
-
- Element -
-
- GetClientWidth -
-
-
ClientWidth: @currentClientWidth
-
-
-
-
-

- - SetId, GetId:
- Gets/Sets a string representing the id of the element - (MDN). -

- - - - - @idExampleCode - - - -
-
- Element -
-
- -
- SetId -   - GetId -
-
-
Id: @currentId
-
-
-
-
-

- - SetInnerHTML, GetInnerHTML:
- Gets/Sets a string representing the markup of the element's content - (MDN). -

- - - - - @innerHTMLExampleCode - - - -
-
- Element -
-
- -
- SetInnerHTML -   - GetInnerHTML -
-
-
InnerHTML: @currentInnerHTML
-
-
-
-
-

- - SetOuterHtml, GetOuterHtml:
- Gets/Sets a string representing the markup of the element including its content. When used as a setter, replaces the element with nodes parsed from the given string - (MDN). -

- - - - - @outerHTMLExampleCode - - - -
-
- Element -
-
- GetOuterHTML -
-
-
OuterHTML: @currentOuterHTML
-
-
-
-
-

- - GetScrollHeight:
- Returns a number representing the scroll view height of an element - (MDN). -

- - - - - @getScrollHeightExampleCode - - - -
-
-
Element
-
-
- GetScrollHeight -
-
-
ScrollHeight: @currentScrollHeight
-
-
-
-
-

- - GetScrollLeft:
- A number representing the left scroll offset of the element - (MDN). -

- - - - - @getScrollLeftExampleCode - - - -
-
-
Element
-
-
- GetScrollLeft -
-
-
ScrollLeft: @currentScrollLeft
-
-
-
-
-

- - GetScrollTop:
- A number representing number of pixels the top of the element is scrolled vertically - (MDN). -

- - - - - @getScrollTopExampleCode - - - -
-
-
Element
-
-
- GetScrollTop -
-
-
ScrollTop: @currentScrollTop
-
-
-
-
-

- - GetScrollWidth:
- Returns a number representing the scroll view width of the element - (MDN). -

- - - - - @getScrollWidthExampleCode - - - -
-
-
Element
-
-
- GetScrollWidth -
-
-
ScrollWidth: @currentScrollWidth
-
-
-
-
-

- - GetTagName:
- Returns a string with the name of the tag for the given element - (MDN). -

- - - - - @getTagNameExampleCode - - - -
-
- Element -
-
- GetTagName -
-
-
TagName: @currentTagName
-
-
-
-
-

- - IsContentEditable:
- Returns a boolean value indicating whether or not the content of the element can be edited - (MDN). -

- - - - - @isContentEditableExampleCode - - - -
-
- Element -
-
- GetIsContentEditable -
-
-
Is content editable: @isContentEditable
-
-
-
-
-

- - SetContentEditable, GetContentEditable:
- Gets/Sets the contentEditable property, which specifies whether or not the element is editable - (MDN). -

- - - - - @contentEditableExampleCode - - - -
-
- Element -
-
- - - - - - -
- SetContentEditable -   - GetContentEditable -
-
-
ContentEditable: @currentContentEditable
-
-
-
-
-

- - SetDir, GetDir:
- Gets/Sets the text writing directionality of the content of the current element - (MDN). -

- - - - - @dirExampleCode - - - -
-
- Element -
-
- - - - - - -
- SetDir -   - GetDir -
-
-
Dir: @currentDir
-
-
-
-
-

- - SetEnterKeyHint, GetEnterKeyHint:
- Gets/Sets the enterKeyHint property, which is an enumerated property defining what action label (or icon) to present for the enter key on virtual keyboards - (MDN). -

- - - - - @enterKeyHintExampleCode - - - -
- -
-
- - - - - - - - - - -
- SetEnterKeyHint -   - GetEnterKeyHint -
-
-
EnterKeyHint: @currentEnterKeyHint
-
-
-
-
-

- - SetHidden, GetHidden:
- Gets/Sets the hidden property, which reflects the value of the element's hidden attribute - (MDN). -


- - SetInert, GetInert:
- Gets/Sets the inert property, which reflects the value of the element's inert attribute. It is a boolean value that, when present, makes the browser "ignore" user input events for the element, including focus events and events from assistive technologies - (MDN). -

- - - - - @inertExampleCode - - - -
-
-
Element
-
-
- -
- SetInert -   - GetInert -
-
-
Inert: @currentInert
-
-
-
-
-

- - SetInnerText, GetInnerText:
- Gets/Sets the innerText property, which represents the rendered text content of a node and its descendants - (MDN). -

- - - - - @innerTextExampleCode - - - -
-
- Element -
-
- -
- SetInnerText -   - GetInnerText -
-
-
InnerText: @currentInnerText
-
-
-
-
-

- - SetInputMode, GetInputMode:
- Gets/Sets the inputMode property, which reflects the value of the element's inputmode attribute - (MDN). -

- - - - - @inputModeExampleCode - - - -
- -
-
- - - - - - - - - - - -
- SetInputMode -   - GetInputMode -
-
-
InputMode: @currentInputMode
-
-
-
-
-

- - SetTabIndex, GetTabIndex:
- Gets/Sets a number representing the position of the element in the tabbing order - (MDN). -

- - - - - @tabIndexExampleCode - - - -
-
- Element -
-
- -
- SetTabIndex -   - GetTabIndex -
-
-
TabIndex: @currentTabIndex
-
-
-
-
-

- - GetOffsetHeight:
- Returns the height of an element, including vertical padding and borders in px - (MDN). -

- - - - - @getOffsetHeightExampleCode - - - -
-
- Element -
-
- GetOffsetHeight -
-
-
OffsetHeight: @currentOffsetHeight
-
-
-
-
-

- - GetOffsetLeft:
- Returns the number of pixels that the upper left corner of the current element is offset to the left within the offsetParent node - (MDN). -

- - - - - @getOffsetLeftExampleCode - - - -
-
- Element -
-
- GetOffsetLeft -
-
-
OffsetLeft: @currentOffsetLeft
-
-
-
-
-

- - GetOffsetTop:
- Returns the distance from the outer border of the current element (including its margin) to the top padding edge of the offsetParent, the closest positioned ancestor element - (MDN). -

- - - - - @getOffsetTopExampleCode - - - -
-
- Element -
-
- GetOffsetTop -
-
-
OffsetTop: @currentOffsetTop
-
-
-
-
-

- - GetOffsetWidth:
- The layout width of an element in px - (MDN). -

- - - - - @getOffsetWidthExampleCode - - - -
-
- Element -
-
- GetOffsetWidth -
-
-
OffsetWidth: @currentOffsetWidth
-
-
-
-
-

- - Blur:
- Removes keyboard focus from the currently focused element - (MDN). -

- - - - - @blurExampleCode - - - -
- -
-
- Blur -
-
-
-
-

- - Remove:
- Removes the element from the children list of its parent - (MDN). -
-
-
- - diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil13ElementPage.razor.cs b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil13ElementPage.razor.cs deleted file mode 100644 index a995e9f6fc9..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil13ElementPage.razor.cs +++ /dev/null @@ -1,1502 +0,0 @@ -using Bit.Butil; - -namespace Bit.Websites.Platform.Client.Pages.Butil; - -public partial class Butil13ElementPage -{ - private string? attributeName; - private string? currentAttribute; - private ElementReference getAttributeElementRef; - - private string? currentAttributeNames; - private ElementReference getAttributeNamesElementRef; - - private string? currentBoundingClientRect; - private ElementReference getBoundingClientRectElementRef; - - private string? hasAttribute; - private string? hasAttributeName; - private ElementReference hasAttributeElementRef; - - private string? hasAttributes; - private ElementReference hasAttributesElementRef; - - private ElementReference requestPointerLockElementRef; - - private ElementReference requestFullScreenElementRef; - - private string? matches; - private string? selector = "#target"; - private ElementReference matchesElementRef; - - private double scrollX = 0; - private double scrollY = 100; - private ScrollBehavior scrollBehavior; - private ElementReference scrollElementRef; - - private double scrollByX = 0; - private double scrollByY = 156; - private ScrollBehavior scrollByBehavior; - private ElementReference scrollByElementRef; - - private ScrollBehavior scrollIntoViewBehavior; - private ScrollLogicalPosition blockScrollPosition; - private ScrollLogicalPosition inlineScrollPosition; - private ElementReference scrollIntoViewElementRef; - - private string? removeAttributeName; - private ElementReference removeAttributeElementRef; - - private string? setAttributeName; - private string? setAttributeValue; - private ElementReference setAttributeElementRef; - - private bool toggleAttributeForce; - private string? toggleAttributeName; - private ElementReference toggleAttributeElementRef; - - private string? newAccessKey; - private string? currentAccessKey; - private ElementReference accessKeyElementRef; - - private string? newClassName; - private string? currentClassName; - private ElementReference classNameElementRef; - - private string? currentClientHeight; - private ElementReference getClientHeightElementRef; - - private string? currentClientLeft; - private ElementReference getClientLeftElementRef; - - private string? currentClientTop; - private ElementReference getClientTopElementRef; - - private string? currentClientWidth; - private ElementReference getClientWidthElementRef; - - private string? newId; - private string? currentId; - private ElementReference idElementRef; - - private string? newInnerHTML; - private string? currentInnerHTML; - private ElementReference innerHTMLElementRef; - - private string? currentOuterHTML; - private ElementReference outerHTMLElementRef; - - private string? currentScrollHeight; - private ElementReference getScrollHeightElementRef; - - private string? currentScrollLeft; - private ElementReference getScrollLeftElementRef; - - private string? currentScrollTop; - private ElementReference getScrollTopElementRef; - - private string? currentScrollWidth; - private ElementReference getScrollWidthElementRef; - - private string? currentTagName; - private ElementReference getTagNameElementRef; - - private string? currentContentEditable; - private ContentEditable newContentEditable; - private ElementReference contentEditableElementRef; - - private string? isContentEditable; - private ElementReference isContentEditableElementRef; - - private ElementDir newDir; - private string? currentDir; - private ElementReference dirElementRef; - - private string? currentEnterKeyHint; - private EnterKeyHint newEnterKeyHint; - private ElementReference enterKeyHintElementRef; - - private bool newInert; - private string? currentInert; - private ElementReference inertElementRef; - - private string? newInnerText; - private string? currentInnerText; - private ElementReference innerTextElementRef; - - private string? currentInputMode; - private InputMode newInputMode; - private ElementReference inputModeElementRef; - - private double newTabIndex; - private string? currentTabIndex; - private ElementReference tabIndexElementRef; - - private string? currentOffsetHeight; - private ElementReference getOffsetHeightElementRef; - - private string? currentOffsetLeft; - private ElementReference getOffsetLeftElementRef; - - private string? currentOffsetTop; - private ElementReference getOffsetTopElementRef; - - private string? currentOffsetWidth; - private ElementReference getOffsetWidthElementRef; - - private ElementReference blurElementRef; - - - private async Task GetAttribute() - { - currentAttribute = await getAttributeElementRef.GetAttribute(attributeName!); - } - - private async Task GetAttributeNames() - { - var result = await getAttributeNamesElementRef.GetAttributeNames(); - currentAttributeNames = string.Join(", ", result); - } - - private async Task GetBoundingClientRect() - { - var result = await getBoundingClientRectElementRef.GetBoundingClientRect(); - currentBoundingClientRect = string.Join(", ", - $"Height: {result.Height}", - $"Width: {result.Width}", - $"X: {result.X}", - $"Y: {result.Y}" - ); - } - - private async Task GetHasAttribute() - { - var result = await hasAttributeElementRef.HasAttribute(hasAttributeName!); - hasAttribute = result.ToString(); - } - - private async Task GetHasAttributes() - { - var result = await hasAttributesElementRef.HasAttributes(); - hasAttributes = result.ToString(); - } - - private async Task RequestFullScreen() - { - var options = new FullScreenOptions() { NavigationUI = FullScreenNavigationUI.Show }; - await requestFullScreenElementRef.RequestFullScreen(options); - } - - private async Task Matches() - { - var result = await matchesElementRef.Matches(selector!); - matches = result.ToString(); - } - - private async Task Scroll() - { - var scrollOptions = new ScrollOptions() - { - Top = scrollY, - Left = scrollX, - Behavior = scrollBehavior - }; - - await scrollElementRef.Scroll(scrollOptions); - } - - private async Task ScrollBy() - { - var scrollOptions = new ScrollOptions() - { - Top = scrollByY, - Left = scrollByX, - Behavior = scrollByBehavior - }; - - await scrollByElementRef.ScrollBy(scrollOptions); - } - - private async Task ScrollIntoView() - { - var scrollOptions = new ScrollIntoViewOptions() - { - Inline = inlineScrollPosition, - Block = blockScrollPosition, - Behavior = scrollIntoViewBehavior - }; - - await scrollIntoViewElementRef.ScrollIntoView(scrollOptions); - } - - private async Task RemoveAttribute() - { - await removeAttributeElementRef.RemoveAttribute(removeAttributeName!); - } - - private async Task SetAttribute() - { - await setAttributeElementRef.SetAttribute(setAttributeName!, setAttributeValue!); - } - - private async Task ToggleAttribute() - { - await toggleAttributeElementRef.ToggleAttribute(toggleAttributeName!, toggleAttributeForce); - } - - private async Task SetAccessKey() - { - await accessKeyElementRef.SetAccessKey(newAccessKey!); - } - - private async Task GetAccessKey() - { - currentAccessKey = await accessKeyElementRef.GetAccessKey(); - } - - private async Task SetClassName() - { - await classNameElementRef.SetClassName(newClassName!); - } - - private async Task GetClassName() - { - currentClassName = await classNameElementRef.GetClassName(); - } - - private async Task GetClientHeight() - { - var result = await getClientHeightElementRef.GetClientHeight(); - currentClientHeight = result.ToString(); - } - - private async Task GetClientLeft() - { - var result = await getClientLeftElementRef.GetClientLeft(); - currentClientLeft = result.ToString(); - } - - private async Task GetClientTop() - { - var result = await getClientTopElementRef.GetClientTop(); - currentClientTop = result.ToString(); - } - - private async Task GetClientWidth() - { - var result = await getClientWidthElementRef.GetClientWidth(); - currentClientWidth = result.ToString(); - } - - private async Task SetId() - { - await idElementRef.SetId(newId!); - } - - private async Task GetId() - { - currentId = await idElementRef.GetId(); - } - - private async Task SetInnerHTML() - { - await innerHTMLElementRef.SetInnerHtml(newInnerHTML!); - } - - private async Task GetInnerHTML() - { - currentInnerHTML = await innerHTMLElementRef.GetInnerHtml(); - } - - private async Task GetOuterHTML() - { - currentOuterHTML = await outerHTMLElementRef.GetOuterHtml(); - } - - private async Task GetScrollHeight() - { - var result = await getScrollHeightElementRef.GetScrollHeight(); - currentScrollHeight = result.ToString(); - } - - private async Task GetScrollLeft() - { - var result = await getScrollLeftElementRef.GetScrollLeft(); - currentScrollLeft = result.ToString(); - } - - private async Task GetScrollTop() - { - var result = await getScrollTopElementRef.GetScrollTop(); - currentScrollTop = result.ToString(); - } - - private async Task GetScrollWidth() - { - var result = await getScrollWidthElementRef.GetScrollWidth(); - currentScrollWidth = result.ToString(); - } - - private async Task GetTagName() - { - var result = await getTagNameElementRef.GetTagName(); - currentTagName = result.ToString(); - } - - private async Task GetIsContentEditable() - { - var result = await isContentEditableElementRef.IsContentEditable(); - isContentEditable = result.ToString(); - } - - private async Task SetContentEditable() - { - await contentEditableElementRef.SetContentEditable(newContentEditable); - } - - private async Task GetContentEditable() - { - var result = await contentEditableElementRef.GetContentEditable(); - currentContentEditable = result.ToString(); - } - - private async Task SetDir() - { - await dirElementRef.SetDir(newDir); - } - - private async Task GetDir() - { - var result = await dirElementRef.GetDir(); - currentDir = result.ToString(); - } - - private async Task SetEnterKeyHint() - { - await enterKeyHintElementRef.SetEnterKeyHint(newEnterKeyHint); - } - - private async Task GetEnterKeyHint() - { - var result = await enterKeyHintElementRef.GetEnterKeyHint(); - currentEnterKeyHint = result.ToString(); - } - - private async Task SetInert() - { - await inertElementRef.SetInert(newInert); - } - - private async Task GetInert() - { - var result = await inertElementRef.GetInert(); - currentInert = result.ToString(); - } - - private async Task SetInnerText() - { - await innerTextElementRef.SetInnerText(newInnerText!); - } - - private async Task GetInnerText() - { - currentInnerText = await innerTextElementRef.GetInnerText(); - } - - private async Task SetInputMode() - { - await inputModeElementRef.SetInputMode(newInputMode); - } - - private async Task GetInputMode() - { - var result = await inputModeElementRef.GetInputMode(); - currentInputMode = result.ToString(); - } - - private async Task SetTabIndex() - { - await tabIndexElementRef.SetTabIndex((int)newTabIndex); - } - - private async Task GetTabIndex() - { - var result = await tabIndexElementRef.GetTabIndex(); - currentTabIndex = result.ToString(); - } - - private async Task GetOffsetHeight() - { - var result = await getOffsetHeightElementRef.GetOffsetHeight(); - currentOffsetHeight = result.ToString(); - } - - private async Task GetOffsetLeft() - { - var result = await getOffsetLeftElementRef.GetOffsetLeft(); - currentOffsetLeft = result.ToString(); - } - - private async Task GetOffsetTop() - { - var result = await getOffsetTopElementRef.GetOffsetTop(); - currentOffsetTop = result.ToString(); - } - - private async Task GetOffsetWidth() - { - var result = await getOffsetWidthElementRef.GetOffsetWidth(); - currentOffsetWidth = result.ToString(); - } - - - private string getAttributeExampleCode = -@"
- Element -
- - - -GetAttribute - -
Attribute: @currentAttribute
- -@code { - private string? attributeName; - private string? currentAttribute; - private ElementReference getAttributeElementRef; - - private async Task GetAttribute() - { - currentAttribute = await getAttributeElementRef.GetAttribute(attributeName!); - } -}"; - private string getAttributeNamesExampleCode = -@"
- Element -
- -GetAttributeNames - -
Attribute names: @currentAttributeNames
- -@code { - private string? currentAttributeNames; - private ElementReference getAttributeNamesElementRef; - - private async Task GetAttributeNames() - { - var result = await getAttributeNamesElementRef.GetAttributeNames(); - currentAttributeNames = string.Join("", "", result); - } -}"; - private string getBoundingClientRectExampleCode = -@"
- Element -
- -GetBoundingClientRect - -
Bounding client rect: @currentBoundingClientRect
- -@code { - private string? currentBoundingClientRect; - private ElementReference getBoundingClientRectElementRef; - - private async Task GetBoundingClientRect() - { - var result = await getBoundingClientRectElementRef.GetBoundingClientRect(); - currentBoundingClientRect = string.Join("", "", - $""Height: {result.Height}"", - $""Width: {result.Width}"", - $""X: {result.X}"", - $""Y: {result.Y}"" - ); - } -}"; - private string hasAttributeExampleCode = -@"
- Element -
- - - -GetHasAttribute - -
Has attribute: @hasAttribute
- -@code { - private string? hasAttribute; - private string? hasAttributeName; - private ElementReference hasAttributeElementRef; - - private async Task GetHasAttribute() - { - var result = await hasAttributeElementRef.HasAttribute(hasAttributeName!); - hasAttribute = result.ToString(); - } -}"; - private string hasAttributesExampleCode = -@"
- Element -
- -GetHasAttributes - -
Has attributes: @hasAttributes
- -@code { - private string? hasAttributes; - private ElementReference hasAttributesElementRef; - - private async Task GetHasAttributes() - { - var result = await hasAttributesElementRef.HasAttributes(); - hasAttributes = result.ToString(); - } -}"; - private string requestPointerLockExampleCode = -@"
- Element -
- - requestPointerLockElementRef.RequestPointerLock())""> - RequestPointerLock - - -@code { - private ElementReference requestPointerLockExampleCode; -}"; - private string requestFullScreenExampleCode = -@"
- Element -
- -RequestFullScreen - -@code { - private ElementReference requestFullScreenElementRef; - - private async Task RequestFullScreen() - { - var options = new FullScreenOptions() { NavigationUI = FullScreenNavigationUI.Show }; - await requestFullScreenElementRef.RequestFullScreen(options); - } -}"; - private string matchesExampleCode = -@"
- Element -
- - - -Matches - -
Matches: @matches
- -@code { - private string? matches; - private string? selector = ""#target""; - private ElementReference matchesElementRef; - - private async Task Matches() - { - var result = await matchesElementRef.Matches(selector!); - matches = result.ToString(); - } -}"; - private string scrollExampleCode = -@"
-
Element
-
- - - - - -"" TValue=""ScrollBehavior""> - - - - - -Scroll - -@code { - private float scrollX = 0; - private float scrollY = 100; - private ScrollBehavior scrollBehavior; - private ElementReference scrollElementRef; - - private async Task Scroll() - { - var scrollOptions = new ScrollToOptions() - { - Top = scrollY, - Left = scrollX, - Behavior = scrollBehavior - }; - - await scrollElementRef.Scroll(scrollOptions); - } -}"; - private string scrollByExampleCode = -@"
-
Element
-
- - - - - -"" TValue=""ScrollBehavior""> - - - - - -ScrollBy - -@code { - private float scrollByX = 0; - private float scrollByY = 156; - private ScrollBehavior scrollByBehavior; - private ElementReference scrollByElementRef; - - private async Task ScrollBy() - { - var scrollByOptions = new ScrollByToOptions() - { - Top = scrollByY, - Left = scrollByX, - Behavior = scrollByBehavior - }; - - await scrollByElementRef.ScrollBy(scrollByOptions); - } -}"; - private string scrollIntoViewExampleCode = -@"
- Element -
- -"" TValue=""ScrollLogicalPosition""> - - - - - - -"" TValue=""ScrollLogicalPosition""> - - - - - - -"" TValue=""ScrollBehavior""> - - - - - -ScrollIntoView - -@code { - private ScrollBehavior scrollIntoViewBehavior; - private ScrollLogicalPosition blockScrollPosition; - private ScrollLogicalPosition inlineScrollPosition; - private ElementReference scrollIntoViewElementRef; - - private async Task ScrollIntoView() - { - var scrollOptions = new ScrollIntoViewOptions() - { - Inline = inlineScrollPosition, - Block = blockScrollPosition, - Behavior = scrollIntoViewBehavior - }; - - await scrollIntoViewElementRef.ScrollIntoView(scrollOptions); - } -}"; - private string removeAttributeExampleCode = -@"
- Element -
- - - -RemoveAttribute - -@code { - private string? removeAttributeName; - private ElementReference removeAttributeElementRef; - - private async Task RemoveAttribute() - { - await removeAttributeElementRef.RemoveAttribute(removeAttributeName!); - } -}"; - private string setAttributeExampleCode = -@"
- Element -
- - - - - -SetAttribute - -@code { - private string? setAttributeName; - private string? setAttributeValue; - private ElementReference setAttributeElementRef; - - private async Task SetAttribute() - { - await setAttributeElementRef.SetAttribute(setAttributeName!, setAttributeValue!); - } -}"; - private string toggleAttributeExampleCode = -@"
- Element -
- - - - - -ToggleAttribute - -@code { - private bool toggleAttributeForce; - private string? toggleAttributeName; - private ElementReference toggleAttributeElementRef; - - private async Task ToggleAttribute() - { - await toggleAttributeElementRef.ToggleAttribute(toggleAttributeName!, toggleAttributeForce); - } -}"; - private string accessKeyExampleCode = -@"
- Element -
- - - -SetAccessKey - -GetAccessKey - -
Access key: @currentAccessKey
- -@code { - private string? newAccessKey; - private string? currentAccessKey; - private ElementReference accessKeyElementRef; - - private async Task SetAccessKey() - { - await accessKeyElementRef.SetAccessKey(newAccessKey!); - } - - private async Task GetAccessKey() - { - currentAccessKey = await accessKeyElementRef.GetAccessKey(); - } -}"; - private string classNameExampleCode = -@"
- Element -
- - - -SetClassName - -GetClassName - -
ClassName: @currentClassName
- -@code { - private string? newClassName; - private string? currentClassName; - private ElementReference classNameElementRef; - - private async Task SetClassName() - { - await classNameElementRef.SetClassName(newClassName!); - } - - private async Task GetClassName() - { - currentClassName = await classNameElementRef.GetClassName(); - } -}"; - private string getClientHeightExampleCode = -@"
- Element -
- -GetClientHeight - -
ClientHeight: @currentClientHeight
- -@code { - private string? currentClientHeight; - private ElementReference getClientHeightElementRef; - - private async Task GetClientHeight() - { - var result = await getClientHeightElementRef.GetClientHeight(); - currentClientHeight = result.ToString(); - } -}"; - private string getClientLeftExampleCode = -@"
- Element -
- -GetClientLeft - -
ClientLeft: @currentClientLeft
- -@code { - private string? currentClientLeft; - private ElementReference getClientLeftElementRef; - - private async Task GetClientLeft() - { - var result = await getClientLeftElementRef.GetClientLeft(); - currentClientLeft = result.ToString(); - } -}"; - private string getClientTopExampleCode = -@"
- Element -
- -GetClientTop - -
ClientTop: @currentClientTop
- -@code { - private string? currentClientTop; - private ElementReference getClientTopElementRef; - - private async Task GetClientTop() - { - var result = await getClientTopElementRef.GetClientTop(); - currentClientTop = result.ToString(); - } -}"; - private string getClientWidthExampleCode = -@"
- Element -
- -GetClientWidth - -
ClientWidth: @currentClientWidth
- -@code { - private string? currentClientWidth; - private ElementReference getClientWidthElementRef; - - private async Task GetClientWidth() - { - var result = await getClientWidthElementRef.GetClientWidth(); - currentClientWidth = result.ToString(); - } -}"; - private string idExampleCode = -@"
- Element -
- - - -SetId - -GetId - -
Id: @currentId
- -@code { - private string? newId; - private string? currentId; - private ElementReference idElementRef; - - private async Task SetId() - { - await idElementRef.SetId(newId!); - } - - private async Task GetId() - { - currentId = await idElementRef.GetId(); - } -}"; - private string innerHTMLExampleCode = -@"
- Element -
- - - -SetInnerHTML - -GetInnerHTML - -
InnerHTML: @currentInnerHTML
- -@code { - private string? newInnerHTML; - private string? currentInnerHTML; - private ElementReference innerHTMLElementRef; - - private async Task SetInnerHTML() - { - await innerHTMLElementRef.SetInnerHTML(newInnerHTML!); - } - - private async Task GetInnerHTML() - { - currentInnerHTML = await innerHTMLElementRef.GetInnerHTML(); - } -}"; - private string outerHTMLExampleCode = -@"
- Element -
- -GetOuterHTML - -
OuterHTML: @currentOuterHTML
- -@code { - private string? currentOuterHTML; - private ElementReference outerHTMLElementRef; - - private async Task GetOuterHTML() - { - currentOuterHTML = await outerHTMLElementRef.GetOuterHTML(); - } -}"; - private string getScrollHeightExampleCode = -@"
-
Element
-
- -GetScrollHeight - -
ScrollHeight: @currentScrollHeight
- -@code { - private string? currentScrollHeight; - private ElementReference getScrollHeightElementRef; - - private async Task GetScrollHeight() - { - var result = await getScrollHeightElementRef.GetScrollHeight(); - currentScrollHeight = result.ToString(); - } -}"; - private string getScrollLeftExampleCode = -@"
-
Element
-
- -GetScrollLeft - -
ScrollLeft: @currentScrollLeft
- -@code { - private string? currentScrollLeft; - private ElementReference getScrollLeftElementRef; - - private async Task GetScrollLeft() - { - var result = await getScrollLeftElementRef.GetScrollLeft(); - currentScrollLeft = result.ToString(); - } -}"; - private string getScrollTopExampleCode = -@"
-
Element
-
- -GetScrollTop - -
ScrollTop: @currentScrollTop
- -@code { - private string? currentScrollTop; - private ElementReference getScrollTopElementRef; - - private async Task GetScrollTop() - { - var result = await getScrollTopElementRef.GetScrollTop(); - currentScrollTop = result.ToString(); - } -}"; - private string getScrollWidthExampleCode = -@"
-
Element
-
- -GetScrollWidth - -
ScrollWidth: @currentScrollWidth
- -@code { - private string? currentScrollWidth; - private ElementReference getScrollWidthElementRef; - - private async Task GetScrollWidth() - { - var result = await getScrollWidthElementRef.GetScrollWidth(); - currentScrollWidth = result.ToString(); - } -}"; - private string getTagNameExampleCode = -@"
- Element -
- -GetTagName - -
TagName: @currentTagName
- -@code { - private string? currentTagName; - private ElementReference getTagNameElementRef; - - private async Task GetTagName() - { - var result = await getTagNameElementRef.GetTagName(); - currentTagName = result.ToString(); - } -}"; - private string isContentEditableExampleCode = -@"
- Element -
- -GetIsContentEditable - -
Is content editable: @isContentEditable
- -@code { - private string? isContentEditable; - private ElementReference isContentEditableElementRef; - - private async Task GetIsContentEditable() - { - var result = await isContentEditableElementRef.IsContentEditable(); - isContentEditable = result.ToString(); - } -}"; - private string contentEditableExampleCode = -@"
- Element -
- -"" TValue=""ContentEditable""> - - - - - - -SetContentEditable - -GetContentEditable - -
ContentEditable: @currentContentEditable
- -@code { - private string? currentContentEditable; - private ContentEditable newContentEditable; - private ElementReference contentEditableElementRef; - - private async Task SetContentEditable() - { - await contentEditableElementRef.SetContentEditable(newContentEditable); - } - - private async Task GetContentEditable() - { - var result = await contentEditableElementRef.GetContentEditable(); - currentContentEditable = result.ToString(); - } -}"; - private string dirExampleCode = -@"
- Element -
- -"" TValue=""ElementDir""> - - - - - - -SetDir - -GetDir - -
Dir: @currentDir
- -@code { - private ElementDir newDir; - private string? currentDir; - private ElementReference dirElementRef; - - private async Task SetDir() - { - await dirElementRef.SetDir(newDir); - } - - private async Task GetDir() - { - var result = await dirElementRef.GetDir(); - currentDir = result.ToString(); - } -}"; - private string enterKeyHintExampleCode = -@" - -"" TValue=""EnterKeyHint""> - - - - - - - - - - -SetEnterKeyHint - -GetEnterKeyHint - -
EnterKeyHint: @currentEnterKeyHint
- -@code { - private string? currentEnterKeyHint; - private EnterKeyHint newEnterKeyHint; - private ElementReference enterKeyHintElementRef; - - private async Task SetEnterKeyHint() - { - await enterKeyHintElementRef.SetEnterKeyHint(newEnterKeyHint); - } - - private async Task GetEnterKeyHint() - { - var result = await enterKeyHintElementRef.GetEnterKeyHint(); - currentEnterKeyHint = result.ToString(); - } -}"; - private string inertExampleCode = -@"
-
Element
-
- - - -SetInert - -GetInert - -
Inert: @currentInert
- -@code { - private bool newInert; - private string? currentInert; - private ElementReference inertElementRef; - - private async Task SetInert() - { - await inertElementRef.SetInert(newInert); - } - - private async Task GetInert() - { - var result = await inertElementRef.GetInert(); - currentInert = result.ToString(); - } -}"; - private string innerTextExampleCode = -@"
- Element -
- - - -SetInnerText - -GetInnerText - -
InnerText: @currentInnerText
- -@code { - private string? newInnerText; - private string? currentInnerText; - private ElementReference innerTextElementRef; - - private async Task SetInnerText() - { - await innerTextElementRef.SetInnerText(newInnerText!); - } - - private async Task GetInnerText() - { - currentInnerText = await innerTextElementRef.GetInnerText(); - } -}"; - private string inputModeExampleCode = -@" - -"" TValue=""InputMode""> - - - - - - - - - - - -SetInputMode - -GetInputMode - -
InputMode: @currentInputMode
- -@code { - private string? currentInputMode; - private InputMode newInputMode; - private ElementReference inputModeElementRef; - - private async Task SetInputMode() - { - await inputModeElementRef.SetInputMode(newInputMode); - } - - private async Task GetInputMode() - { - var result = await inputModeElementRef.GetInputMode(); - currentInputMode = result.ToString(); - } -}"; - private string tabIndexExampleCode = -@"
- Element -
- - - -SetTabIndex - -GetTabIndex - -
TabIndex: @currentTabIndex
- -@code { - private double newTabIndex; - private string? currentTabIndex; - private ElementReference tabIndexElementRef; - - private async Task SetTabIndex() - { - await tabIndexElementRef.SetTabIndex((int)newTabIndex); - } - - private async Task GetTabIndex() - { - var result = await tabIndexElementRef.GetTabIndex(); - currentTabIndex = result.ToString(); - } -}"; - private string getOffsetHeightExampleCode = -@"
- Element -
- -GetOffsetHeight - -
OffsetHeight: @currentOffsetHeight
- -@code { - private string? currentOffsetHeight; - private ElementReference getOffsetHeightElementRef; - - private async Task GetOffsetHeight() - { - var result = await getOffsetHeightElementRef.GetOffsetHeight(); - currentOffsetHeight = result.ToString(); - } -}"; - private string getOffsetLeftExampleCode = -@"
- Element -
- -GetOffsetLeft - -
OffsetLeft: @currentOffsetLeft
- -@code { - private string? currentOffsetLeft; - private ElementReference getOffsetLeftElementRef; - - private async Task GetOffsetLeft() - { - var result = await getOffsetLeftElementRef.GetOffsetLeft(); - currentOffsetLeft = result.ToString(); - } -}"; - private string getOffsetTopExampleCode = -@"
- Element -
- -GetOffsetTop - -
OffsetTop: @currentOffsetTop
- -@code { - private string? currentOffsetTop; - private ElementReference getOffsetTopElementRef; - - private async Task GetOffsetTop() - { - var result = await getOffsetTopElementRef.GetOffsetTop(); - currentOffsetTop = result.ToString(); - } -}"; - private string getOffsetWidthExampleCode = -@"
- Element -
- -GetOffsetWidth - -
OffsetWidth: @currentOffsetWidth
- -@code { - private string? currentOffsetWidth; - private ElementReference getOffsetWidthElementRef; - - private async Task GetOffsetWidth() - { - var result = await getOffsetWidthElementRef.GetOffsetWidth(); - currentOffsetWidth = result.ToString(); - } -}"; - private string blurExampleCode = -@" - - blurElementRef.Blur())"">Blur - -@code { - private ElementReference blurElementRef; -}"; -} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil13ElementPage.razor.scss b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil13ElementPage.razor.scss deleted file mode 100644 index b5efd6e7e0e..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil13ElementPage.razor.scss +++ /dev/null @@ -1,20 +0,0 @@ -@import '../../Styles/abstracts/_colors.scss'; -@import '../../Styles/abstracts/_mixins.scss'; -@import '../../Styles/abstracts/_functions.scss'; -@import '../../Styles/abstracts/_media-queries.scss'; - -.page-container { - @include PageContainer; -} - -.section-card { - @include SectionCard; -} - -.section-card-txt { - @include SectionCardText; -} - -::-webkit-input-placeholder { - color: $bit-color-primary-text; -} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil14WindowPage.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil14WindowPage.razor deleted file mode 100644 index 7244c5eea85..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil14WindowPage.razor +++ /dev/null @@ -1,350 +0,0 @@ -@page "/butil/window" -@inherits AppComponentBase -@inject Bit.Butil.Window window - - - -
- Window -
- - How to use the Window class of the bit Butil? - -
- -
- Usage -
- To use the browser window features you need to inject the Bit.Butil.Window class and use it like this: - -@@inject Bit.Butil.Window window - -@@code { - await window.AddEventListener(ButilEvents.KeyDown, args => { ... }); - await window.Alert("Alert from C#"); -} -
-
- -
- Methods -
-
- AddBeforeUnload, RemoveBeforeUnload:
- The beforeunload event is fired when the current window, - contained document, and associated resources are about to be unloaded. The main use case for this event is to - trigger a browser-generated confirmation dialog that asks users to confirm if they really want to leave the page - when they try to close or reload it, or navigate somewhere else. This is intended to help prevent loss of unsaved data - (MDN). -


- - AddEventListener, RemoveEventListener:
- Sets up a function that will be called whenever the specified event is delivered to the window - (MDN). -


- - GetInnerHeight:
- Gets the height of the content area of the browser window in px including, if rendered, the horizontal scrollbar - (MDN). -

- - - - - @getInnerHeightExampleCode - - - -
- GetInnerHeight -
-
-
InnerHeight is: @innerHeight
-
-
-
-
-

- - GetInnerWidth:
- Gets the width of the content area of the browser window in px including, if rendered, the vertical scrollbar - (MDN). -

- - - - - @getInnerWidthExampleCode - - - -
- GetInnerWidth -
-
-
InnerWidth is: @innerWidth
-
-
-
-
-

- - IsSecureContext:
- Returns a boolean indicating whether the current context is secure (true) or not (false) - (MDN). -


- - GetLocationBar:
- Returns the locationbar object. For privacy and interoperability reasons, the value of the visible property is now false if this Window is a popup, and true otherwise - (MDN). -


- - SetName, GetName:
- Gets/Sets the name of the window's browsing context - (MDN). -


- - GetOrigin:
- Returns the global object's origin, serialized as a string - (MDN). -

- - - - - @getOriginExampleCode - - - -
- GetOrigin -
-
-
Origin is: @origin
-
-
-
-
-

- - GetOuterHeight:
- Gets the height of the outside of the browser window in px - (MDN). -

- - - - - @getOuterHeightExampleCode - - - -
- GetOuterHeight -
-
-
OuterHeight is: @outerHeight
-
-
-
-
-

- - GetOuterWidth:
- Gets the width of the outside of the browser window in px - (MDN). -

- - - - - @getOuterWidthExampleCode - - - -
- GetOuterWidth -
-
-
OuterWidth is: @outerWidth
-
-
-
-
-

- - GetScreenX:
- Returns the horizontal distance in px from the left border of the user's browser viewport to the left side of the screen - (MDN). -


- - GetScreenY:
- Returns the vertical distance in px from the top border of the user's browser viewport to the top side of the screen - (MDN). -


- - GetScrollX:
- Returns the number of pixels that the document has already been scrolled horizontally - (MDN). -


- - GetScrollY:
- Returns the number of pixels that the document has already been scrolled vertically - (MDN). -


- - Btoa:
- Creates a base-64 encoded ASCII string from a string of binary data - (MDN). -

- - - - - @btoaExampleCode - - - -
- -
- EncodeData -
-
-
Encoded data is: @btoaText
-
-
-
-
-

- - Atob:
- Decodes a string of data which has been encoded using base-64 encoding - (MDN). -

- - - - - @atobExampleCode - - - -
- -
- DecodeData -
-
-
Decoded text is: @atobText
-
-
-
-
-

- - Alert:
- Displays an alert dialog - (MDN). -

- - - - - @alertExampleCode - - - -
- ShowAlert -
-
-
-
-

- - Blur:
- Sets focus away from the window - (MDN). -


- - Close:
- Closes the current window - (MDN). -


- - Confirm:
- Displays a dialog with a message that the user needs to respond to - (MDN). -

- - - - - @confirmExampleCode - - - -
- ShowConfirm -
-
-
-
-

- - Find:
- Searches for a given string in a window - (MDN). -


- - Focus:
- Sets focus on the current window - (MDN). -


- - GetSelection:
- Returns the selection text representing the selected item(s) - (MDN). -


- - MatchMedia:
- Returns a MediaQueryList object representing the specified media query string - (MDN). -


- - Open:
- Opens a new window - (MDN). -


- - Print:
- Opens the Print Dialog to print the current document - (MDN). -


- - Prompt:
- Returns the text entered by the user in a prompt dialog - (MDN). -


- - Scroll:
- Scrolls the window to a particular place in the document - (MDN). -


- - ScrollBy:
- Scrolls the document in the window by the given amount - (MDN). -


- - Stop:
- This method stops window loading - (MDN). -
-
-
- - \ No newline at end of file diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil14WindowPage.razor.cs b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil14WindowPage.razor.cs deleted file mode 100644 index cb7d41460c1..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil14WindowPage.razor.cs +++ /dev/null @@ -1,134 +0,0 @@ -namespace Bit.Websites.Platform.Client.Pages.Butil; - -public partial class Butil14WindowPage -{ - private float innerHeight; - - private float innerWidth; - - private string? origin; - - private float outerHeight; - - private float outerWidth; - - private string? btoaText; - private string? btoaValue; - - private string? atobText; - private string? atobValue; - - - private async Task GetInnerHeight() => innerHeight = await window.GetInnerHeight(); - - private async Task GetInnerWidth() => innerWidth = await window.GetInnerWidth(); - - private async Task GetOrigin() => origin = await window.GetOrigin(); - - private async Task GetOuterHeight() => outerHeight = await window.GetOuterHeight(); - - private async Task GetOuterWidth() => outerWidth = await window.GetOuterWidth(); - - private async Task EncodeData() => btoaText = await window.Btoa(btoaValue!); - - private async Task DecodeData() => atobText = await window.Atob(atobValue!); - - private string getInnerHeightExampleCode = - @"@inject Bit.Butil.Window window - -GetInnerHeight - -
InnerHeight is: @innerHeight
- -@code { - private string? innerHeight; - - private async Task GetInnerHeight() => innerHeight = await window.GetInnerHeight(); -}"; - private string getInnerWidthExampleCode = -@"@inject Bit.Butil.Window window - -GetInnerWidth - -
InnerWidth is: @innerWidth
- -@code { - private string? innerWidth; - - private async Task GetInnerWidth() => innerWidth = await window.GetInnerWidth(); -}"; - private string getOriginExampleCode = - @"@inject Bit.Butil.Window window - -GetOrigin - -
Origin is: @origin
- -@code { - private string? origin; - - private async Task GetOrigin() => origin = await window.GetOrigin(); -}"; - private string getOuterHeightExampleCode = - @"@inject Bit.Butil.Window window - -GetOuterHeight - -
OuterHeight is: @outerHeight
- -@code { - private float outerHeight; - - private async Task GetOuterHeight() => outerHeight = await window.GetOuterHeight(); -}"; - private string getOuterWidthExampleCode = - @"@inject Bit.Butil.Window window - -GetOuterWidth - -
OuterWidth is: @outerWidth
- -@code { - private float outerWidth; - - private async Task GetOuterWidth() => outerWidth = await window.GetOuterWidth(); -}"; - private string btoaExampleCode = - @"@inject Bit.Butil.Window window - - - -EncodeData - -
Encoded data is: @btoaText
- -@code { - private string? btoaText; - private string? btoaValue; - - private async Task EncodeData() => btoaText = await window.Btoa(btoaValue!); -}"; - private string atobExampleCode = - @"@inject Bit.Butil.Window window - - - -DecodeData - -
Decoded data is: @atobText
- -@code { - private string? atobText; - private string? atobValue; - - private async Task DecodeData() => atobText = await window.Atob(atobValue!); -}"; - private string alertExampleCode = - @"@inject Bit.Butil.Window window - - window.Alert(""Alert from C#""))"">ShowAlert"; - private string confirmExampleCode = - @"@inject Bit.Butil.Window window - - window.Confirm(""Confirm from C#""))"">ShowConfirm"; -} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil14WindowPage.razor.scss b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil14WindowPage.razor.scss deleted file mode 100644 index 7cee07def47..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil14WindowPage.razor.scss +++ /dev/null @@ -1,16 +0,0 @@ -@import '../../Styles/abstracts/_colors.scss'; -@import '../../Styles/abstracts/_mixins.scss'; -@import '../../Styles/abstracts/_functions.scss'; -@import '../../Styles/abstracts/_media-queries.scss'; - -.page-container { - @include PageContainer; -} - -.section-card { - @include SectionCard; -} - -.section-card-txt { - @include SectionCardText; -} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil15DocumentPage.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil15DocumentPage.razor deleted file mode 100644 index de7c6b85698..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil15DocumentPage.razor +++ /dev/null @@ -1,114 +0,0 @@ -@page "/butil/document" -@inherits AppComponentBase -@inject Bit.Butil.Document document - - - -
- Document -
- - How to use the Document class of the bit Butil? - -
- -
- Usage -
- To use the browser document features you need to inject the Bit.Butil.Document class and use it like this: - -@@inject Bit.Butil.Document document - -@@code { - await document.AddEventListener(ButilEvents.Click, args => { ... }); - await document.SetTitle("New shinny title"); -} -
-
- -
- Methods -
-
- AddEventListener, RemoveEventListener:
- Sets up a function that will be called whenever the specified event is delivered to the document - (MDN). -


- - GetCharacterSet:
- Returns the character set being used by the document - (MDN). -


- - GetCompatMode:
- Indicates whether the document is rendered in quirks or strict mode - (MDN). -


- - GetContentType:
- Returns the Content-Type from the MIME Header of the current document - (MDN). -


- - GetDocumentURI:
- Returns the document location as a string - (MDN). -


- - SetDesignMode, GetDesignMode:
- Gets/Sets ability to edit the whole document - (MDN). -

- - - - - @designModeExampleCode - - - -
- -
- SetDesignMode -
-
-
-
-

- - SetDir, GetDir:
- Gets/Sets directionality (Rtl/Ltr) of the document - (MDN). -


- - SetTitle, GetTitle:
- Gets/Sets the title of the current document - (MDN). -


- - GetReferrer:
- Returns the URI of the page that linked to this page - (MDN). -


- - GetUrl:
- Returns the document location as a string - (MDN). -


- - ExitFullscreen:
- Stops document's fullscreen element from being displayed fullscreen - (MDN). -


- - ExitPointerLock:
- Release the pointer lock - (MDN). -
-
-
- - diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil15DocumentPage.razor.cs b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil15DocumentPage.razor.cs deleted file mode 100644 index bc621f033e4..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil15DocumentPage.razor.cs +++ /dev/null @@ -1,31 +0,0 @@ -using Bit.Butil; - -namespace Bit.Websites.Platform.Client.Pages.Butil; - -public partial class Butil15DocumentPage -{ - private bool isDesignModeOn; - - - private async Task SetDesignMode() - { - await document.SetDesignMode(isDesignModeOn ? DesignMode.On : DesignMode.Off); - } - - - private string designModeExampleCode = -@"@inject Bit.Butil.Document document - - - -SetDesignMode - -@code { - private bool isDesignModeOn; - - private async Task SetDesignMode() - { - await document.SetDesignMode(isDesignModeOn ? DesignMode.On : DesignMode.Off); - } -}"; -} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil15DocumentPage.razor.scss b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil15DocumentPage.razor.scss deleted file mode 100644 index 7cee07def47..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil15DocumentPage.razor.scss +++ /dev/null @@ -1,16 +0,0 @@ -@import '../../Styles/abstracts/_colors.scss'; -@import '../../Styles/abstracts/_mixins.scss'; -@import '../../Styles/abstracts/_functions.scss'; -@import '../../Styles/abstracts/_media-queries.scss'; - -.page-container { - @include PageContainer; -} - -.section-card { - @include SectionCard; -} - -.section-card-txt { - @include SectionCardText; -} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil16NavigatorPage.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil16NavigatorPage.razor deleted file mode 100644 index 367dbfb40bf..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil16NavigatorPage.razor +++ /dev/null @@ -1,354 +0,0 @@ -@page "/butil/navigator" -@inherits AppComponentBase -@inject Bit.Butil.Navigator navigator - - - -
- Navigator -
- - How to use the Navigator class of the bit Butil? - -
- -
- Usage -
- To use the browser navigator features you need to inject the Bit.Butil.Navigator class and use it like this: - -@@inject Bit.Butil.Navigator navigator - -@@code { - var userAgent = await navigator.GetUserAgent(); -} -
-
- -
- Methods -
-
- GetDeviceMemory:
- Returns the amount of device memory in gigabytes. This value is an approximation given by rounding to the nearest power of 2 and dividing that number by 1024 - (MDN). -

- - - - - @getDeviceMemoryExampleCode - - - -
- GetDeviceMemory -
-
-
Device memory is: @deviceMemory
-
-
-
-
-

- - GetHardwareConcurrency:
- Returns the number of logical processor cores available - (MDN). -

- - - - - @getHardwareConcurrencyExampleCode - - - -
- GetHardwareConcurrency -
-
-
Hardware concurrency is: @hardwareConcurrency
-
-
-
-
-

- - GetLanguage:
- Returns a string representing the preferred language of the user, usually the language of the browser UI. The null value is returned when this is unknown - (MDN). -

- - - - - @getLanguageExampleCode - - - -
- GetLanguage -
-
-
Language: @language
-
-
-
-
-

- - GetLanguages:
- Returns an array of strings representing the languages known to the user, by order of preference - (MDN). -

- - - - - @getLanguagesExampleCode - - - -
- GetLanguages -
-
-
Languages: @languages
-
-
-
-
-

- - GetMaxTouchPoints:
- Returns the maximum number of simultaneous touch contact points are supported by the current device - (MDN). -

- - - - - @getMaxTouchPointsExampleCode - - - -
- GetMaxTouchPoints -
-
-
Max touch points: @maxTouchPoints
-
-
-
-
-

- - IsOnLine:
- Returns a boolean value indicating whether the browser is working online - (MDN). -

- - - - - @isOnLineExampleCode - - - -
- GetIsOnLine -
-
-
Is OnLine: @isOnLine
-
-
-
-
-

- - IsPdfViewerEnabled:
- Returns true if the browser can display PDF files inline when navigating to them, and false otherwise - (MDN). -

- - - - - @isPdfViewerEnabledExampleCode - - - -
- GetIsPdfViewerEnabled -
-
-
Is Pdf viewer enabled: @isPdfViewerEnabled
-
-
-
-
-

- - GetUserAgent:
- Returns the user agent string for the current browser - (MDN). -

- - - - - @getUserAgentExampleCode - - - -
- GetUserAgent -
-
-
User agent: @userAgent
-
-
-
-
-

- - IsWebDriver:
- Indicates whether the user agent is controlled by automation - (MDN). -


- - CanShare:
- Returns true if a call to navigator.Share() would succeed - (MDN). -

- - - - - @canShareExampleCode - - - -
- GetCanShare -
-
-
Can share: @canShare
-
-
-
-
-

- - ClearAppBadge:
- Clears a badge on the current app's icon and returns a Promise that resolves with undefined - (MDN). -

- - - - - @clearAppBadgeExampleCode - - - -
- ClearAppBadge -
-
-
-
-

- - SendBeacon:
- Used to asynchronously transfer a small amount of data using HTTP from the User Agent to a web server - (MDN). -

- - - - - @sendBeaconExampleCode - - - -
- SendBeacon -
-
-
-
-

- - SetAppBadge:
- Sets a badge on the icon associated with this app and returns a Promise that resolves with undefined - (MDN). -

- - - - - @setAppBadgeExampleCode - - - -
- SetAppBadge -
-
-
-
-

- - Share:
- Invokes the native sharing mechanism of the current platform - (MDN). -

- - - - - @shareExampleCode - - - -
- -
- -
- -
- Share -
-
-
-
-

- - Vibrate:
- Causes vibration on devices with support for it. Does nothing if vibration support isn't available - (MDN). -

- - - - - @vibrateExampleCode - - - -
- Vibrate -
-
-
-
-
-
-
- - diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil16NavigatorPage.razor.cs b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil16NavigatorPage.razor.cs deleted file mode 100644 index 8187be5cd4d..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil16NavigatorPage.razor.cs +++ /dev/null @@ -1,291 +0,0 @@ -using Bit.Butil; - -namespace Bit.Websites.Platform.Client.Pages.Butil; - -public partial class Butil16NavigatorPage -{ - private string? deviceMemory; - - private string? hardwareConcurrency; - - private string? language; - - private string? languages; - - private string? maxTouchPoints; - - private string? isOnLine; - - private string? isPdfViewerEnabled; - - private string? userAgent; - - private string? canShare; - - private string? textValue; - private string? titleValue; - private string? urlValue; - - private int[] sosPattern = [100, 30, 100, 30, 100, 30, 200, 30, 200, 30, 200, 30, 100, 30, 100, 30, 100]; - - - private async Task GetDeviceMemory() - { - var result = await navigator.GetDeviceMemory(); - deviceMemory = result.ToString(); - } - - private async Task GetHardwareConcurrency() - { - var result = await navigator.GetHardwareConcurrency(); - hardwareConcurrency = result.ToString(); - } - - private async Task GetLanguage() - { - var result = await navigator.GetLanguage(); - language = result.ToString(); - } - - private async Task GetLanguages() - { - var result = await navigator.GetLanguages(); - languages = string.Join(",", result); - } - - private async Task GetMaxTouchPoints() - { - var result = await navigator.GetMaxTouchPoints(); - maxTouchPoints = result.ToString(); - } - - private async Task GetIsOnLine() - { - var result = await navigator.IsOnLine(); - isOnLine = result.ToString(); - } - - private async Task GetIsPdfViewerEnabled() - { - var result = await navigator.IsPdfViewerEnabled(); - isPdfViewerEnabled = result.ToString(); - } - - private async Task GetUserAgent() - { - var result = await navigator.GetUserAgent(); - userAgent = result.ToString(); - } - - private async Task GetCanShare() - { - var result = await navigator.CanShare(); - canShare = result.ToString(); - } - - private async Task Share() - { - var shareData = new ShareData() - { - Text = textValue, - title = titleValue, - url = urlValue - }; - - await navigator.Share(shareData); - } - - - private string getDeviceMemoryExampleCode = -@"@inject Bit.Butil.Navigator navigator - -GetDeviceMemory - -
Device memory is: @deviceMemory
- -@code { - private string? deviceMemory; - - private async Task GetDeviceMemory() - { - var result = await navigator.GetDeviceMemory(); - deviceMemory = result.ToString(); - } -}"; - private string getHardwareConcurrencyExampleCode = -@"@inject Bit.Butil.Navigator navigator - -GetHardwareConcurrency - -
Hardware concurrency is: @hardwareConcurrency
- -@code { - private string? hardwareConcurrency; - - private async Task GetHardwareConcurrency() - { - var result = await navigator.GetHardwareConcurrency(); - hardwareConcurrency = result.ToString(); - } -}"; - private string getLanguageExampleCode = -@"@inject Bit.Butil.Navigator navigator - -GetLanguage - -
Language: @language
- -@code { - private string? language; - - private async Task GetLanguage() - { - var result = await navigator.GetLanguage(); - language = result.ToString(); - } -}"; - private string getLanguagesExampleCode = -@"@inject Bit.Butil.Navigator navigator - -GetLanguages - -
Languages: @languages
- -@code { - private string? languages; - - private async Task GetLanguages() - { - var result = await navigator.GetLanguages(); - languages = string.Join("","", result); - } -}"; - private string getMaxTouchPointsExampleCode = -@"@inject Bit.Butil.Navigator navigator - -GetMaxTouchPoints - -
Max touch points: @maxTouchPoints
- -@code { - private string? maxTouchPoints; - - private async Task GetMaxTouchPoints() - { - var result = await navigator.GetMaxTouchPoints(); - maxTouchPoints = result.ToString(); - } -}"; - private string isOnLineExampleCode = -@"@inject Bit.Butil.Navigator navigator - -GetIsOnLine - -
Is OnLine: @isOnLine
- -@code { - private string? isOnLine; - - private async Task GetIsOnLine() - { - var result = await navigator.IsOnLine(); - isOnLine = result.ToString(); - } -}"; - private string isPdfViewerEnabledExampleCode = -@"@inject Bit.Butil.Navigator navigator - -GetIsPdfViewerEnabled - -
Is Pdf viewer enabled: @isPdfViewerEnabled
- -@code { - private string? isPdfViewerEnabled; - - private async Task GetIsPdfViewerEnabled() - { - var result = await navigator.IsPdfViewerEnabled(); - isPdfViewerEnabled = result.ToString(); - } -}"; - private string getUserAgentExampleCode = -@"@inject Bit.Butil.Navigator navigator - -GetUserAgent - -
User agent: @userAgent
- -@code { - private string? userAgent; - - private async Task GetUserAgent() - { - var result = await navigator.GetUserAgent(); - userAgent = result.ToString(); - } -}"; - private string canShareExampleCode = -@"@inject Bit.Butil.Navigator navigator - -GetCanShare - -
Can share: @canShare
- -@code { - private string? canShare; - - private async Task CanShare() - { - var result = await navigator.CanShare(); - canShare = result.ToString(); - } -}"; - private string clearAppBadgeExampleCode = -@"@inject Bit.Butil.Navigator navigator - - navigator.ClearAppBadge())"">ClearAppBadge"; - private string sendBeaconExampleCode = -@"@inject Bit.Butil.Navigator navigator - - navigator.SendBeacon())"">SendBeacon"; - private string setAppBadgeExampleCode = -@"@inject Bit.Butil.Navigator navigator - - navigator.SetAppBadge())"">SetAppBadge"; - private string shareExampleCode = -@"@inject Bit.Butil.Navigator navigator - - - - - - - -Share - -@code { - private string? textValue; - private string? titleValue; - private string? urlValue; - - private async Task Share() - { - var shareData = new ShareData() - { - Text = textValue, - title = titleValue, - url = urlValue - }; - - await navigator.Share(shareData); - } -}"; - private string vibrateExampleCode = -@"@inject Bit.Butil.Navigator navigator - - navigator.Vibrate(sosPattern))"">Vibrate - -@code { - private int[] sosPattern = [100, 30, 100, 30, 100, 30, 200, 30, 200, 30, 200, 30, 100, 30, 100, 30, 100]; -}"; -} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil16NavigatorPage.razor.scss b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil16NavigatorPage.razor.scss deleted file mode 100644 index 7cee07def47..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil16NavigatorPage.razor.scss +++ /dev/null @@ -1,16 +0,0 @@ -@import '../../Styles/abstracts/_colors.scss'; -@import '../../Styles/abstracts/_mixins.scss'; -@import '../../Styles/abstracts/_functions.scss'; -@import '../../Styles/abstracts/_media-queries.scss'; - -.page-container { - @include PageContainer; -} - -.section-card { - @include SectionCard; -} - -.section-card-txt { - @include SectionCardText; -} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil17LocationPage.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil17LocationPage.razor deleted file mode 100644 index 527838d9893..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil17LocationPage.razor +++ /dev/null @@ -1,339 +0,0 @@ -@page "/butil/location" -@inherits AppComponentBase -@inject Bit.Butil.Location location - - - -
- Location -
- - How to use the Location class of the bit Butil? - -
- -
- Usage -
- To use the browser location features you need to inject the Bit.Butil.Location class and use it like this: - -@@inject Bit.Butil.Location location - -@@code { - await location.Reload(); -} -
-
- -
- Methods -
-
- SetHref, GetHref:
- Gets/Sets the href of the location and then the associated document navigates to the new page - (MDN). -

- - - - - @hrefExampleCode - - - -
- -
- SetHref -   - GetHref -
-
-
Href: @currentHref
-
-
-
-
-

- - SetProtocol, GetProtocol:
- Gets/Sets a string containing the protocol scheme of the URL, including the final ':' - (MDN). -

- - - - - @protocolExampleCode - - - -
- -
- SetProtocol -   - GetProtocol -
-
-
Protocol: @currentProtocol
-
-
-
-
-

- - SetHost, GetHost:
- Gets/Sets a string containing the host, that is the hostname, a ':', and the port of the URL - (MDN). -

- - - - - @hostExampleCode - - - -
- -
- SetHost -   - GetHost -
-
-
Host: @currentHost
-
-
-
-
-

- - SetHostname, GetHostname:
- Gets/Sets the hostname of the location and then the associated document navigates to the new page - (MDN). -

- - - - - @hostnameExampleCode - - - -
- -
- SetHostname -   - GetHostname -
-
-
Hostname: @currentHostname
-
-
-
-
-

- - SetPort, GetPort:
- Gets/Sets the port of the location and then the associated document navigates to the new page - (MDN). -

- - - - - @portExampleCode - - - -
- -
- SetPort -   - GetPort -
-
-
Port: @currentPort
-
-
-
-
-

- - SetPathname, GetPathname:
- Gets/Sets a string containing an initial '/' followed by the path of the URL, not including the query string or fragment - (MDN). -

- - - - - @pathnameExampleCode - - - -
- -
- SetPathname -   - GetPathname -
-
-
Pathname: @currentPathname
-
-
-
-
-

- - SetSearch, GetSearch:
- Gets/Sets a string containing a '#' followed by the fragment identifier of the URL - (MDN). -

- - - - - @searchExampleCode - - - -
- -
- SetSearch -   - GetSearch -
-
-
Search: @currentSearch
-
-
-
-
-

- - SetHash, GetHash:
- Gets/Sets the hash of the location and then the associated document navigates to the new page - (MDN). -

- - - - - @hashExampleCode - - - -
- -
- SetHash -   - GetHash -
-
-
Hash: @currentHash
-
-
-
-
-

- - GetOrigin:
- Returns a string containing the canonical form of the origin of the specific location - (MDN). -

- - - - - @originExampleCode - - - -
- GetOrigin -
-
-
Origin: @currentOrigin
-
-
-
-
-

- - Assign:
- Loads the resource at the URL provided in parameter - (MDN). -

- - - - - @assignExampleCode - - - -
- -
- Assign -
-
-
-
-

- - Reload:
- Reloads the current URL, like the Refresh button - (MDN). -

- - - - - @reloadExampleCode - - - -
- Reload -
-
-
-
-

- - Replace:
- Replaces the current resource with the one at the provided URL (redirects to the provided URL) - (MDN). -

- - - - - @replaceExampleCode - - - -
- -
- Replace -
-
-
-
-
-
-
- - diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil17LocationPage.razor.cs b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil17LocationPage.razor.cs deleted file mode 100644 index 96d57aaf38e..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil17LocationPage.razor.cs +++ /dev/null @@ -1,381 +0,0 @@ -namespace Bit.Websites.Platform.Client.Pages.Butil; - -public partial class Butil17LocationPage -{ - private string? newHref; - private string? currentHref; - - private string? newProtocol; - private string? currentProtocol; - - private string? newHost; - private string? currentHost; - - private string? newHostname; - private string? currentHostname; - - private string? newPort; - private string? currentPort; - - private string? newPathname; - private string? currentPathname; - - private string? newSearch; - private string? currentSearch; - - private string? newHash; - private string? currentHash; - - private string? currentOrigin; - - private string? newAssign; - - private string? newReplace; - - - private async Task GetHref() - { - currentHref = await location.GetHref(); - } - - private async Task SetHref() - { - await location.SetHref(newHref!); - } - - private async Task GetProtocol() - { - currentProtocol = await location.GetProtocol(); - } - - private async Task SetProtocol() - { - await location.SetProtocol(newProtocol!); - } - - private async Task GetHost() - { - currentHost = await location.GetHost(); - } - - private async Task SetHost() - { - await location.SetHost(newHost!); - } - - private async Task GetHostname() - { - currentHostname = await location.GetHostname(); - } - - private async Task SetHostname() - { - await location.SetHostname(newHostname!); - } - - private async Task GetPort() - { - currentPort = await location.GetPort(); - } - - private async Task SetPort() - { - await location.SetPort(newPort!); - } - - private async Task GetPathname() - { - currentPathname = await location.GetPathname(); - } - - private async Task SetPathname() - { - await location.SetPathname(newPathname!); - } - - private async Task GetSearch() - { - currentSearch = await location.GetSearch(); - } - - private async Task SetSearch() - { - await location.SetSearch(newSearch!); - } - - private async Task GetHash() - { - currentHash = await location.GetHash(); - } - - private async Task SetHash() - { - await location.SetHash(newHash!); - } - - private async Task GetOrigin() - { - currentOrigin = await location.GetOrigin(); - } - - private async Task SetAssign() - { - await location.Assign(newAssign!); - } - - private async Task SetReplace() - { - await location.Replace(newReplace!); - } - - - private string hrefExampleCode = -@"@inject Bit.Butil.Location location - - - -SetHref - -GetHref - -
Href: @currentHref
- -@code { - private string? newHref; - private string? currentHref; - - private async Task GetHref() - { - currentHref = await location.GetHref(); - } - - private async Task SetHref() - { - await location.SetHref(newHref!); - } -}"; - private string protocolExampleCode = -@"@inject Bit.Butil.Location location - - - -SetProtocol - -GetProtocol - -
Protocol: @currentProtocol
- -@code { - private string? newProtocol; - private string? currentProtocol; - - private async Task GetProtocol() - { - currentProtocol = await location.GetProtocol(); - } - - private async Task SetProtocol() - { - await location.SetProtocol(newProtocol!); - } -}"; - private string hostExampleCode = -@"@inject Bit.Butil.Location location - - - -SetHost - -GetHost - -
Host: @currentHost
- -@code { - private string? newHost; - private string? currentHost; - - private async Task GetHost() - { - currentHost = await location.GetHost(); - } - - private async Task SetHost() - { - await location.SetHost(newHost!); - } -}"; - private string hostnameExampleCode = -@"@inject Bit.Butil.Location location - - - -SetHostname - -GetHostname - -
Hostname: @currentHostname
- -@code { - private string? newHostname; - private string? currentHostname; - - private async Task GetHostname() - { - currentHostname = await location.GetHostname(); - } - - private async Task SetHostname() - { - await location.SetHostname(newHostname!); - } -}"; - private string portExampleCode = -@"@inject Bit.Butil.Location location - - - -SetPort - -GetPort - -
Port: @currentPort
- -@code { - private string? newPort; - private string? currentPort; - - private async Task GetPort() - { - currentPort = await location.GetPort(); - } - - private async Task SetPort() - { - await location.SetPort(newPort!); - } -}"; - private string pathnameExampleCode = -@"@inject Bit.Butil.Location location - - - -SetPathname - -GetPathname - -
Pathname: @currentPathname
- -@code { - private string? newPathname; - private string? currentPathname; - - private async Task GetPathname() - { - currentPathname = await location.GetPathname(); - } - - private async Task SetPathname() - { - await location.SetPathname(newPathname!); - } -}"; - private string searchExampleCode = -@"@inject Bit.Butil.Location location - - - -SetSearch - -GetSearch - -
Search: @currentSearch
- -@code { - private string? newSearch; - private string? currentSearch; - - private async Task GetSearch() - { - currentSearch = await location.GetSearch(); - } - - private async Task SetSearch() - { - await location.SetSearch(newSearch!); - } -}"; - private string hashExampleCode = -@"@inject Bit.Butil.Location location - - - -SetHash - -GetHash - -
Hash: @currentHash
- -@code { - private string? newHash; - private string? currentHash; - - private async Task GetHash() - { - currentHash = await location.GetHash(); - } - - private async Task SetHash() - { - await location.SetHash(newHash!); - } -}"; - private string originExampleCode = -@"@inject Bit.Butil.Location location - -GetOrigin - -
Origin: @currentOrigin
- -@code { - private string? currentOrigin; - - private async Task GetOrigin() - { - currentOrigin = await location.GetOrigin(); - } -}"; - private string assignExampleCode = -@"@inject Bit.Butil.Location location - - - -Assign - -@code { - private string? newAssign; - - private async Task SetAssign() - { - await location.Assign(newAssign!); - } -}"; - private string reloadExampleCode = -@"@inject Bit.Butil.Location location - - location.Reload())"">Reload"; - private string replaceExampleCode = -@"@inject Bit.Butil.Location location - - - -Replace - -@code { - private string? newReplace; - - private async Task SetReplace() - { - await location.Replace(newReplace!); - } -}"; -} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil17LocationPage.razor.scss b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil17LocationPage.razor.scss deleted file mode 100644 index 7cee07def47..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil17LocationPage.razor.scss +++ /dev/null @@ -1,16 +0,0 @@ -@import '../../Styles/abstracts/_colors.scss'; -@import '../../Styles/abstracts/_mixins.scss'; -@import '../../Styles/abstracts/_functions.scss'; -@import '../../Styles/abstracts/_media-queries.scss'; - -.page-container { - @include PageContainer; -} - -.section-card { - @include SectionCard; -} - -.section-card-txt { - @include SectionCardText; -} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil18ScreenPage.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil18ScreenPage.razor deleted file mode 100644 index 6b079c70d2c..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil18ScreenPage.razor +++ /dev/null @@ -1,202 +0,0 @@ -@page "/butil/screen" -@inherits AppComponentBase -@inject Bit.Butil.Screen screen - - - -
- Screen -
- - How to use the Screen class of the bit Butil? - -
- -
- Usage -
- To use the browser screen features you need to inject the Bit.Butil.Screen class and use it like this: - -@@inject Bit.Butil.Screen screen - -@@code { - var screenWidth = await screen.GetWidth(); -} -
-
- -
- Methods -
-
- GetAvailableHeight:
- Specifies the height of the screen, in pixels, minus permanent or semipermanent user interface features displayed by the operating system, such as the Taskbar on Windows - (MDN). -

- - - - - @getAvailableHeightExampleCode - - - -
- GetAvailableHeight -
-
-
Available height: @availableHeight
-
-
-
-
-

- - GetAvailableWidth:
- Returns the amount of horizontal space in pixels available to the window - (MDN). -

- - - - - @getAvailableWidthExampleCode - - - -
- GetAvailableWidth -
-
-
Available width: @availableWidth
-
-
-
-
-

- - GetColorDepth:
- Returns the color depth of the screen - (MDN). -

- - - - - @getColorDepthExampleCode - - - -
- GetColorDepth -
-
-
Color depth: @colorDepth
-
-
-
-
-

- - GetHeight:
- Returns the height of the screen in pixels - (MDN). -

- - - - - @getHeightExampleCode - - - -
- GetHeight -
-
-
Height: @height
-
-
-
-
-

- - IsExtended:
- Returns true if the user's device has multiple screens, and false if not - (MDN). -

- - - - - @getIsExtendedExampleCode - - - -
- GetIsExtended -
-
-
Is extended: @isExtended
-
-
-
-
-

- - GetPixelDepth:
- Gets the bit depth of the screen - (MDN). -

- - - - - @getPixelDepthExampleCode - - - -
- GetPixelDepth -
-
-
Pixel depth: @pixelDepth
-
-
-
-
-

- - GetWidth:
- Returns the width of the screen - (MDN). -

- - - - - @getWidthExampleCode - - - -
- GetWidth -
-
-
Width: @width
-
-
-
-
-

- - AddChange, RemoveChange:
- Fired on a specific screen when it changes in some way - width or height, available width or height, color depth, or orientation - (MDN). -
-
-
- - diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil18ScreenPage.razor.cs b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil18ScreenPage.razor.cs deleted file mode 100644 index a23898b08a4..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil18ScreenPage.razor.cs +++ /dev/null @@ -1,175 +0,0 @@ -namespace Bit.Websites.Platform.Client.Pages.Butil; - -public partial class Butil18ScreenPage -{ - private string? availableHeight; - - private string? availableWidth; - - private string? colorDepth; - - private string? height; - - private string? isExtended; - - private string? pixelDepth; - - private string? width; - - - private async Task GetAvailableHeight() - { - var result = await screen.GetAvailableHeight(); - availableHeight = result.ToString(); - } - - private async Task GetAvailableWidth() - { - var result = await screen.GetAvailableWidth(); - availableWidth = result.ToString(); - } - - private async Task GetColorDepth() - { - var result = await screen.GetColorDepth(); - colorDepth = result.ToString(); - } - - private async Task GetHeight() - { - var result = await screen.GetHeight(); - height = result.ToString(); - } - - private async Task GetIsExtended() - { - var result = await screen.IsExtended(); - isExtended = result.ToString(); - } - - private async Task GetPixelDepth() - { - var result = await screen.GetPixelDepth(); - pixelDepth = result.ToString(); - } - - private async Task GetWidth() - { - var result = await screen.GetWidth(); - width = result.ToString(); - } - - - private string getAvailableHeightExampleCode = -@"@inject Bit.Butil.Screen screen - -GetAvailableHeight - -
Available height: @availableHeight
- -@code { - private string? availableHeight; - - private async Task GetAvailableHeight() - { - var result = await screen.GetAvailableHeight(); - availableHeight = result.ToString(); - } -}"; - private string getAvailableWidthExampleCode = -@"@inject Bit.Butil.Screen screen - -GetAvailableWidth - -
Available width: @availableWidth
- -@code { - private string? availableWidth; - - private async Task GetAvailableWidth() - { - var result = await screen.GetAvailableWidth(); - availableWidth = result.ToString(); - } -}"; - private string getColorDepthExampleCode = -@"@inject Bit.Butil.Screen screen - -GetColorDepth - -
Color depth: @colorDepth
- -@code { - private string? colorDepth; - - private async Task GetColorDepth() - { - var result = await screen.GetColorDepth(); - colorDepth = result.ToString(); - } -}"; - private string getHeightExampleCode = -@"@inject Bit.Butil.Screen screen - -GetHeight - -
Height: @height
- -@code { - private string? height; - - private async Task GetHeight() - { - var result = await screen.GetHeight(); - height = result.ToString(); - } -}"; - private string getIsExtendedExampleCode = -@"@inject Bit.Butil.Screen screen - -GetIsExtended - -
Is extended: @IsExtended
- -@code { - private string? isExtended; - - private async Task GetIsExtended() - { - var result = await screen.IsExtended(); - isExtended = result.ToString(); - } -}"; - private string getPixelDepthExampleCode = -@"@inject Bit.Butil.Screen screen - -GetPixelDepth - -
Pixel depth: @PixelDepth
- -@code { - private string? pixelDepth; - - private async Task GetPixelDepth() - { - var result = await screen.GetPixelDepth(); - pixelDepth = result.ToString(); - } -}"; - private string getWidthExampleCode = -@"@inject Bit.Butil.Screen screen - -GetWidth - -
Width: @width
- -@code { - private string? width; - - private async Task GetWidth() - { - var result = await screen.GetWidth(); - width = result.ToString(); - } -}"; -} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil18ScreenPage.razor.scss b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil18ScreenPage.razor.scss deleted file mode 100644 index 7cee07def47..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil18ScreenPage.razor.scss +++ /dev/null @@ -1,16 +0,0 @@ -@import '../../Styles/abstracts/_colors.scss'; -@import '../../Styles/abstracts/_mixins.scss'; -@import '../../Styles/abstracts/_functions.scss'; -@import '../../Styles/abstracts/_media-queries.scss'; - -.page-container { - @include PageContainer; -} - -.section-card { - @include SectionCard; -} - -.section-card-txt { - @include SectionCardText; -} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil19VisualViewportPage.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil19VisualViewportPage.razor deleted file mode 100644 index 3fe8fed7875..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil19VisualViewportPage.razor +++ /dev/null @@ -1,212 +0,0 @@ -@page "/butil/visualViewport" -@inherits AppComponentBase -@inject Bit.Butil.VisualViewport visualViewport - - - -
- VisualViewport -
- - How to use the VisualViewport class of the bit Butil? - -
- -
- Usage -
- To use the browser VisualViewport features you need to inject the Bit.Butil.VisualViewport class and use it like this: - -@@inject Bit.Butil.VisualViewport visualViewport - -@@code { - var offsetLeft = await VisualViewport.GetOffsetLeft(); -} -
-
- -
- Methods -
-
- GetOffsetLeft:
- Returns the offset of the left edge of the visual viewport from the left edge of - the layout viewport in CSS pixels, or 0 if current document is not fully active. - (MDN). -

- - - - - @getOffsetLeftExampleCode - - - -
- GetOffsetLeft -
-
-
OffsetLeft: @offsetLeft
-
-
-
-
-

- - GetOffsetTop:
- Returns the offset of the top edge of the visual viewport from the top edge of - the layout viewport in CSS pixels, or 0 if current document is not fully active. - (MDN). -

- - - - - @getOffsetTopExampleCode - - - -
- GetOffsetTop -
-
-
OffsetTop: @offsetTop
-
-
-
-
-

- - GetPageLeft:
- Returns the x coordinate of the left edge of the visual viewport relative to the - initial containing block origin, in CSS pixels, or 0 if current document is not fully active. - (MDN). -

- - - - - @getPageLeftExampleCode - - - -
- GetPageLeft -
-
-
PageLeft: @pageLeft
-
-
-
-
-

- - GetPageTop:
- Returns the y coordinate of the top edge of the visual viewport relative to the - initial containing block origin, in CSS pixels, or 0 if current document is not fully active. - (MDN). -

- - - - - @getPageTopExampleCode - - - -
- GetPageTop -
-
-
PageTop: @pageTop
-
-
-
-
-

- - GetWidth:
- Returns the width of the visual viewport, in CSS pixels, or 0 if current document is not fully active. - (MDN). -

- - - - - @getWidthExampleCode - - - -
- GetWidth -
-
-
Width: @width
-
-
-
-
-

- - GetHeight:
- Returns the height of the visual viewport, in CSS pixels, or 0 if current document is not fully active. - (MDN). -

- - - - - @getHeightExampleCode - - - -
- GetHeight -
-
-
Height: @height
-
-
-
-
-

- - GetScale:
- Returns the pinch-zoom scaling factor applied to the visual viewport, or 0 if current - document is not fully active, or 1 if there is no output device. - (MDN). -

- - - - - @getScaleExampleCode - - - -
- GetScale -
-
-
Scale: @scale
-
-
-
-
-

- - AddResize, RemoveResize:
- Fired when the visual viewport is resized. - (MDN). -


- - AddScroll, RemoveScroll:
- Fired when the visual viewport is scrolled. - (MDN). -
-
-
- - diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil19VisualViewportPage.razor.cs b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil19VisualViewportPage.razor.cs deleted file mode 100644 index 921fc299f29..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil19VisualViewportPage.razor.cs +++ /dev/null @@ -1,160 +0,0 @@ -namespace Bit.Websites.Platform.Client.Pages.Butil; - -public partial class Butil19VisualViewportPage -{ - private double offsetLeft; - - private double offsetTop; - - private double pageLeft; - - private double pageTop; - - private double width; - - private double height; - - private double scale; - - - private async Task GetOffsetLeft() - { - offsetLeft = await visualViewport.GetOffsetLeft(); - } - private async Task GetOffsetTop() - { - offsetTop = await visualViewport.GetOffsetTop(); - } - - private async Task GetPageLeft() - { - pageLeft = await visualViewport.GetPageLeft(); - } - - private async Task GetPageTop() - { - pageTop = await visualViewport.GetPageTop(); - } - - private async Task GetWidth() - { - width = await visualViewport.GetWidth(); - } - - private async Task GetHeight() - { - height = await visualViewport.GetHeight(); - } - - private async Task GetScale() - { - scale = await visualViewport.GetScale(); - } - - - private string getOffsetLeftExampleCode = -@"@inject Bit.Butil.VisualViewport visualViewport - -GetOffsetLeft - -
OffsetLeft: @offsetLeft
- -@code { - private double offsetLeft; - - private async Task GetOffsetLeft() - { - offsetLeft = await visualViewport.GetOffsetLeft(); - } -}"; - private string getOffsetTopExampleCode = -@"@inject Bit.Butil.VisualViewport visualViewport - -GetOffsetTop - -
OffsetTop: @offsetTop
- -@code { - private double offsetTop; - - private async Task GetOffsetTop() - { - offsetTop = await visualViewport.GetOffsetTop(); - } -}"; - private string getPageLeftExampleCode = -@"@inject Bit.Butil.VisualViewport visualViewport - -GetPageLeft - -
pageLeft: @pageLeft
- -@code { - private double pageLeft; - - private async Task GetPageLeft() - { - pageLeft = await visualViewport.GetPageLeft(); - } -}"; - private string getPageTopExampleCode = -@"@inject Bit.Butil.VisualViewport visualViewport - -GetPageTop - -
pageTop: @pageTop
- -@code { - private double pageTop; - - private async Task GetPageTop() - { - pageTop = await visualViewport.GetPageTop(); - } -}"; - private string getWidthExampleCode = -@"@inject Bit.Butil.VisualViewport visualViewport - -GetWidth - -
Width: @width
- -@code { - private double width; - - private async Task GetWidth() - { - width = await visualViewport.GetWidth(); - } -}"; - private string getHeightExampleCode = -@"@inject Bit.Butil.VisualViewport visualViewport - -GetHeight - -
Height: @height
- -@code { - private double height; - - private async Task GetHeight() - { - height = await visualViewport.GetHeight(); - } -}"; - private string getScaleExampleCode = -@"@inject Bit.Butil.VisualViewport visualViewport - -GetScale - -
Height: @height
- -@code { - private double height; - - private async Task GetScale() - { - height = await visualViewport.GetScale(); - } -}"; -} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil19VisualViewportPage.razor.scss b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil19VisualViewportPage.razor.scss deleted file mode 100644 index 7cee07def47..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil19VisualViewportPage.razor.scss +++ /dev/null @@ -1,16 +0,0 @@ -@import '../../Styles/abstracts/_colors.scss'; -@import '../../Styles/abstracts/_mixins.scss'; -@import '../../Styles/abstracts/_functions.scss'; -@import '../../Styles/abstracts/_media-queries.scss'; - -.page-container { - @include PageContainer; -} - -.section-card { - @include SectionCard; -} - -.section-card-txt { - @include SectionCardText; -} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil20ScreenOrientationPage.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil20ScreenOrientationPage.razor deleted file mode 100644 index c3c6b858f24..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil20ScreenOrientationPage.razor +++ /dev/null @@ -1,99 +0,0 @@ -@page "/butil/screenOrientation" -@inherits AppComponentBase -@inject Bit.Butil.ScreenOrientation screenOrientation - - - -
- ScreenOrientation -
- - How to use the ScreenOrientation class of the bit Butil? - -
- -
- Usage -
- To use the browser ScreenOrientation features you need to inject the Bit.Butil.ScreenOrientation class and use it like this: - -@@inject Bit.Butil.ScreenOrientation screenOrientation - -@@code { - var angle = await screenOrientation.GetAngle(); -} -
-
- -
- Methods -
-
- GetOrientationType:
- Returns the document's current orientation type. - (MDN). -

- - - - - @getOrientationTypeExampleCode - - - -
- GetOrientationType -
-
-
Orientation type: @orientationType
-
-
-
-
-

- - GetAngle:
- Returns the document's current orientation angle. - (MDN). -

- - - - - @getAngleExampleCode - - - -
- GetAngle -
-
-
Angle: @angle
-
-
-
-
-

- - Lock:
- Locks the orientation of the containing document to the specified orientation. - Typically orientation locking is only enabled on mobile devices, and when the browser context is full screen. - (MDN). -


- - Unlock:
- Unlocks the orientation of the containing document from its default orientation. - (MDN). -


- - AddChange, RemoveChange:
- The change event of the ScreenOrientation interface fires when the orientation of the - screen has changed, for example when a user rotates their mobile phone. - (MDN). -
-
-
- - diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil20ScreenOrientationPage.razor.cs b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil20ScreenOrientationPage.razor.cs deleted file mode 100644 index 61ed89371df..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil20ScreenOrientationPage.razor.cs +++ /dev/null @@ -1,52 +0,0 @@ -namespace Bit.Websites.Platform.Client.Pages.Butil; - -public partial class Butil20ScreenOrientationPage -{ - private ushort angle; - - private string? orientationType; - - private async Task GetOrientationType() - { - var result = await screenOrientation.GetOrientationType(); - orientationType = result.ToString(); - } - - private async Task GetAngle() - { - angle = await screenOrientation.GetAngle(); - } - - - private string getOrientationTypeExampleCode = -@"@inject Bit.Butil.ScreenOrientation screenOrientation - -GetOrientationType - -
Orientation type: @orientationType
- -@code { - private string? orientationType; - - private async Task GetOrientationType() - { - var result = await screenOrientation.GetOrientationType(); - orientationType = result.ToString(); - } -}"; - private string getAngleExampleCode = -@"@inject Bit.Butil.ScreenOrientation screenOrientation - -GetAngle - -
Angle: @angle
- -@code { - private ushort angle; - - private async Task GetAngle() - { - angle = await screenOrientation.GetAngle(); - } -}"; -} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil20ScreenOrientationPage.razor.scss b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil20ScreenOrientationPage.razor.scss deleted file mode 100644 index 7cee07def47..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil20ScreenOrientationPage.razor.scss +++ /dev/null @@ -1,16 +0,0 @@ -@import '../../Styles/abstracts/_colors.scss'; -@import '../../Styles/abstracts/_mixins.scss'; -@import '../../Styles/abstracts/_functions.scss'; -@import '../../Styles/abstracts/_media-queries.scss'; - -.page-container { - @include PageContainer; -} - -.section-card { - @include SectionCard; -} - -.section-card-txt { - @include SectionCardText; -} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil21UserAgentPage.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil21UserAgentPage.razor deleted file mode 100644 index b19695bbdcc..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil21UserAgentPage.razor +++ /dev/null @@ -1,68 +0,0 @@ -@page "/butil/userAgent" -@inherits AppComponentBase -@inject Bit.Butil.UserAgent userAgent - - - -
- UserAgent -
- - How to use the UserAgent class of the bit Butil? - -
- -
- Usage -
- To use the UserAgent api of Butil you need to inject the Bit.Butil.UserAgent class and use it like this: - -@@inject Bit.Butil.UserAgent userAgent - -@@code { - var props = await userAgent.Extract(); -} - -
-
- -
- Methods -
-
- Extract:
- Returns an instance of the Bit.Butil.UserAgentProperties class containing all possible data that extracted from the client's browser. -

- - - - - @extractExampleCode - - - -
- Extract -
-
-
Name: @props?.Name
-
Version: @props?.Version
-
Prerelease: @props?.Prerelease
-
Layout: @props?.Layout
-
Manufacturer: @props?.Manufacturer
-
Product: @props?.Product
-
OsName: @props?.OsName
-
OsVersion: @props?.OsVersion
-
OsArchitecture: @props?.OsArchitecture
-
Description: @props?.Description
-
UserAgentValue: @props?.UserAgentValue
-
-
-
-
-
-
- - diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil21UserAgentPage.razor.cs b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil21UserAgentPage.razor.cs deleted file mode 100644 index 1e4b39b7807..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil21UserAgentPage.razor.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Bit.Butil; - -namespace Bit.Websites.Platform.Client.Pages.Butil; - -public partial class Butil21UserAgentPage -{ - private UserAgentProperties? props; - - private async Task Extract() - { - props = await userAgent.Extract(); - } - - - private string extractExampleCode = -@"@inject Bit.Butil.UserAgent userAgent - -Extract - -
Name: @props?.Name
-
Version: @props?.Version
-
Prerelease: @props?.Prerelease
-
Layout: @props?.Layout
-
Manufacturer: @props?.Manufacturer
-
Product: @props?.Product
-
OsName: @props?.OsName
-
OsVersion: @props?.OsVersion
-
OsArchitecture: @props?.OsArchitecture
-
Description: @props?.Description
-
UserAgentValue: @props?.UserAgentValue
- -@code { - private Bit.Butil.UserAgentProperties? props; - - private async Task Extract() - { - props = await userAgent.Extract(); - } -}"; -} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil21UserAgentPage.razor.scss b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil21UserAgentPage.razor.scss deleted file mode 100644 index 7cee07def47..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil21UserAgentPage.razor.scss +++ /dev/null @@ -1,16 +0,0 @@ -@import '../../Styles/abstracts/_colors.scss'; -@import '../../Styles/abstracts/_mixins.scss'; -@import '../../Styles/abstracts/_functions.scss'; -@import '../../Styles/abstracts/_media-queries.scss'; - -.page-container { - @include PageContainer; -} - -.section-card { - @include SectionCard; -} - -.section-card-txt { - @include SectionCardText; -} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil22DevicePage.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil22DevicePage.razor deleted file mode 100644 index 4c2d910d97d..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil22DevicePage.razor +++ /dev/null @@ -1,180 +0,0 @@ -@page "/butil/device" -@inherits AppComponentBase -@inject Bit.Butil.Battery battery -@inject Bit.Butil.NetworkInformation networkInformation -@inject Bit.Butil.WakeLock wakeLock -@inject Bit.Butil.IdleDetector idleDetector - - - -
- Device -
- - How to use the device sensor classes of the bit Butil? - -
- -
- Usage -
- The device sensor features are spread across a few classes. Inject the ones you need and use them like this: - -@@inject Bit.Butil.Battery battery -@@inject Bit.Butil.NetworkInformation networkInformation -@@inject Bit.Butil.WakeLock wakeLock -@@inject Bit.Butil.IdleDetector idleDetector - -@@code { - var status = await battery.GetStatus(); - var net = await networkInformation.GetStatus(); -} -
-
- -
- Battery -
- The Battery class wraps the - Battery Status API. -

- - IsSupported:
- Returns whether the Battery Status API is available in the current browser. -

- - - - @batterySupportedExampleCode - - -
- IsSupported -

-
Is supported: @batterySupported
-
-
-
-
-

- - GetStatus:
- Returns a snapshot of the battery charging state and level - (MDN). -

- - - - @batteryStatusExampleCode - - -
- GetStatus -

-
Battery: @batteryStatus
-
-
-
-
-
-
- -
- NetworkInformation -
- The NetworkInformation class wraps the - Network Information API - plus the always-available navigator.onLine flag. -

- - GetStatus:
- Returns the online flag, effective connection type, downlink and round-trip-time estimates. -

- - - - @networkStatusExampleCode - - -
- GetStatus -

-
Network: @networkStatus
-
-
-
-
-
-
- -
- WakeLock -
- The WakeLock class wraps the - Screen Wake Lock API, - which prevents the screen from dimming while the app is active. -

- - Request / Release:
- Acquires or releases a screen wake lock. RequestPersistent keeps the lock re-acquired automatically when the page becomes visible again. -

- - - - @wakeLockExampleCode - - -
- Request -   - Release -   - RequestPersistent -

-
@wakeLockResult
-
-
-
-
-
-
- -
- IdleDetector -
- The IdleDetector class wraps the - Idle Detection API - (Chromium-based browsers, requires permission). -

- - RequestPermission / Start:
- Requests the idle-detection permission and starts watching the user/screen idle state until it is stopped. -

- - - - @idleDetectorExampleCode - - -
- -
- RequestPermission -   - Start -   - Stop -

-
Permission: @idlePermission
-
State: @idleState
-
-
-
-
-
-
-
- - diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil22DevicePage.razor.cs b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil22DevicePage.razor.cs deleted file mode 100644 index d05c2b4df55..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil22DevicePage.razor.cs +++ /dev/null @@ -1,221 +0,0 @@ -using Bit.Butil; - -namespace Bit.Websites.Platform.Client.Pages.Butil; - -public partial class Butil22DevicePage -{ - private string? batterySupported; - private string? batteryStatus; - private string? networkStatus; - private string? wakeLockResult; - private string? idlePermission; - private string? idleState; - - private int idleThreshold = 60; - private ButilSubscription? idleSub; - private IAsyncDisposable? persistentWakeLock; - - - private async Task BatterySupported() - { - batterySupported = (await battery.IsSupported()).ToString(); - } - - private async Task BatteryStatus() - { - var status = await battery.GetStatus(); - batteryStatus = $"level={status.Level:P0}, charging={status.Charging}"; - } - - private async Task NetworkStatus() - { - var status = await networkInformation.GetStatus(); - networkStatus = $"online={status.Online}, type={status.EffectiveType ?? status.Type ?? "n/a"}, downlink={status.Downlink}, rtt={status.Rtt}"; - } - - private async Task AcquireWakeLock() - { - if (await wakeLock.IsSupported() is false) - { - wakeLockResult = "Wake lock is not supported."; - return; - } - - var ok = await wakeLock.Request(); - wakeLockResult = ok ? "Wake lock acquired." : "Wake lock request failed."; - } - - private async Task ReleaseWakeLock() - { - await wakeLock.Release(); - wakeLockResult = "Wake lock released."; - } - - private async Task AcquirePersistentWakeLock() - { - if (await wakeLock.IsSupported() is false) - { - wakeLockResult = "Wake lock is not supported."; - return; - } - - if (persistentWakeLock is not null) - await persistentWakeLock.DisposeAsync(); - - persistentWakeLock = await wakeLock.RequestPersistent(); - wakeLockResult = "Persistent wake lock started (auto re-acquire on visibility)."; - } - - private async Task RequestIdlePermission() - { - if (await idleDetector.IsSupported() is false) - { - idlePermission = "IdleDetector is not supported."; - return; - } - - idlePermission = (await idleDetector.RequestPermission()).ToString(); - } - - private async Task StartIdleWatch() - { - await StopIdleWatch(); - - if (await idleDetector.IsSupported() is false) - { - idleState = "IdleDetector is not supported."; - return; - } - - idleSub = await idleDetector.Start(idleThreshold, state => - { - idleState = $"user={state.UserState}, screen={state.ScreenState}"; - InvokeAsync(StateHasChanged); - }); - - idleState = "Idle watch started."; - } - - private async Task StopIdleWatch() - { - if (idleSub is null) return; - await idleSub.DisposeAsync(); - idleSub = null; - idleState = "Idle watch stopped."; - } - - - protected override async ValueTask DisposeAsync(bool disposing) - { - if (idleSub is not null) - await idleSub.DisposeAsync(); - if (persistentWakeLock is not null) - await persistentWakeLock.DisposeAsync(); - await wakeLock.DisposeAsync(); - - await base.DisposeAsync(disposing); - } - - - private readonly string batterySupportedExampleCode = -@"@inject Bit.Butil.Battery battery - -IsSupported - -
Is supported: @batterySupported
- -@code { - private string? batterySupported; - - private async Task BatterySupported() - { - batterySupported = (await battery.IsSupported()).ToString(); - } -}"; - - private readonly string batteryStatusExampleCode = -@"@inject Bit.Butil.Battery battery - -GetStatus - -
Battery: @batteryStatus
- -@code { - private string? batteryStatus; - - private async Task BatteryStatus() - { - var status = await battery.GetStatus(); - batteryStatus = $""level={status.Level:P0}, charging={status.Charging}""; - } -}"; - - private readonly string networkStatusExampleCode = -@"@inject Bit.Butil.NetworkInformation networkInformation - -GetStatus - -
Network: @networkStatus
- -@code { - private string? networkStatus; - - private async Task NetworkStatus() - { - var status = await networkInformation.GetStatus(); - networkStatus = $""online={status.Online}, type={status.EffectiveType ?? status.Type ?? ""n/a""}, downlink={status.Downlink}, rtt={status.Rtt}""; - } -}"; - - private readonly string wakeLockExampleCode = -@"@inject Bit.Butil.WakeLock wakeLock - -Request -Release -RequestPersistent - -@code { - private IAsyncDisposable? persistentWakeLock; - - private async Task AcquireWakeLock() - { - if (await wakeLock.IsSupported() is false) return; - await wakeLock.Request(); - } - - private async Task ReleaseWakeLock() - { - await wakeLock.Release(); - } - - private async Task AcquirePersistentWakeLock() - { - persistentWakeLock = await wakeLock.RequestPersistent(); - } -}"; - - private readonly string idleDetectorExampleCode = -@"@inject Bit.Butil.IdleDetector idleDetector - -RequestPermission -Start - -@code { - private ButilSubscription? idleSub; - - private async Task RequestIdlePermission() - { - if (await idleDetector.IsSupported() is false) return; - var permission = await idleDetector.RequestPermission(); - } - - private async Task StartIdleWatch() - { - idleSub = await idleDetector.Start(60, state => - { - var current = $""user={state.UserState}, screen={state.ScreenState}""; - InvokeAsync(StateHasChanged); - }); - } -}"; -} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil22DevicePage.razor.scss b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil22DevicePage.razor.scss deleted file mode 100644 index dc4b53c541b..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil22DevicePage.razor.scss +++ /dev/null @@ -1,16 +0,0 @@ -@import '../../Styles/abstracts/_colors.scss'; -@import '../../Styles/abstracts/_mixins.scss'; -@import '../../Styles/abstracts/_functions.scss'; -@import '../../Styles/abstracts/_media-queries.scss'; - -.page-container { - @include PageContainer; -} - -.section-card { - @include SectionCard; -} - -.section-card-txt { - @include SectionCardText; -} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil23GeolocationPage.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil23GeolocationPage.razor deleted file mode 100644 index 493bccc62b7..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil23GeolocationPage.razor +++ /dev/null @@ -1,103 +0,0 @@ -@page "/butil/geolocation" -@inherits AppComponentBase -@inject Bit.Butil.Geolocation geolocation - - - -
- Geolocation -
- - How to use the Geolocation class of the bit Butil? - -
- -
- Usage -
- To read the device's position you need to inject the Bit.Butil.Geolocation class and use it like this: - -@@inject Bit.Butil.Geolocation geolocation - -@@code { - var position = await geolocation.GetCurrentPosition(); - await using var sub = await geolocation.SubscribeWatch(p => { /* ... */ }); -} -
-
- -
- Methods -
- The Geolocation class wraps the - Geolocation API - (navigator.geolocation). -

- - IsSupported:
- Returns whether the Geolocation API (navigator.geolocation) is available in the current browser - (MDN). -

- - - - @isSupportedExampleCode - - -
- IsSupported -

-
Is supported: @isSupported
-
-
-
-
-

- - GetCurrentPosition:
- Returns the device's current position once. The browser prompts for permission on first use - (MDN). -

- - - - @getCurrentPositionExampleCode - - -
- GetCurrentPosition -

-
Current position: @currentPosition
-
-
-
-
-

- - SubscribeWatch:
- Subscribes to continuous position updates and returns a ButilSubscription handle. Dispose the handle to stop watching - (MDN). -

- - - - @subscribeWatchExampleCode - - -
- Start watch -   - Stop watch -

-
Watch: @watchResult
-
-
-
-
-
-
-
- - diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil23GeolocationPage.razor.cs b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil23GeolocationPage.razor.cs deleted file mode 100644 index c19b8f981cc..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil23GeolocationPage.razor.cs +++ /dev/null @@ -1,143 +0,0 @@ -using Bit.Butil; - -namespace Bit.Websites.Platform.Client.Pages.Butil; - -public partial class Butil23GeolocationPage -{ - private string? isSupported; - private string? currentPosition; - private string? watchResult; - - private ButilSubscription? watchSub; - - - private async Task IsSupported() - { - isSupported = (await geolocation.IsSupported()).ToString(); - } - - private async Task GetCurrentPosition() - { - try - { - var position = await geolocation.GetCurrentPosition(); - var coords = position.Coords; - currentPosition = $"lat={coords.Latitude:F6}, lng={coords.Longitude:F6}, accuracy={coords.Accuracy:F1}m"; - } - catch (GeolocationException ex) - { - currentPosition = $"{ex.Code} → {ex.Message}"; - } - } - - private async Task StartWatch() - { - await StopWatch(); - - watchSub = await geolocation.SubscribeWatch( - onPosition: position => - { - var coords = position.Coords; - watchResult = $"lat={coords.Latitude:F6}, lng={coords.Longitude:F6}, accuracy={coords.Accuracy:F1}m"; - InvokeAsync(StateHasChanged); - }, - onError: ex => - { - watchResult = $"{ex.Code} → {ex.Message}"; - InvokeAsync(StateHasChanged); - }); - - watchResult = "Watch started."; - } - - private async Task StopWatch() - { - if (watchSub is null) return; - await watchSub.DisposeAsync(); - watchSub = null; - watchResult = "Watch stopped."; - } - - - protected override async ValueTask DisposeAsync(bool disposing) - { - if (watchSub is not null) - await watchSub.DisposeAsync(); - - await base.DisposeAsync(disposing); - } - - - private readonly string isSupportedExampleCode = -@"@inject Bit.Butil.Geolocation geolocation - -IsSupported - -
Is supported: @isSupported
- -@code { - private string? isSupported; - - private async Task IsSupported() - { - isSupported = (await geolocation.IsSupported()).ToString(); - } -}"; - - private readonly string getCurrentPositionExampleCode = -@"@inject Bit.Butil.Geolocation geolocation - -GetCurrentPosition - -
Current position: @currentPosition
- -@code { - private string? currentPosition; - - private async Task GetCurrentPosition() - { - try - { - var position = await geolocation.GetCurrentPosition(); - var coords = position.Coords; - currentPosition = $""lat={coords.Latitude:F6}, lng={coords.Longitude:F6}, accuracy={coords.Accuracy:F1}m""; - } - catch (GeolocationException ex) - { - currentPosition = $""{ex.Code} → {ex.Message}""; - } - } -}"; - - private readonly string subscribeWatchExampleCode = -@"@inject Bit.Butil.Geolocation geolocation - -Start watch -Stop watch - -
Watch: @watchResult
- -@code { - private ButilSubscription? watchSub; - - private async Task StartWatch() - { - await StopWatch(); - - watchSub = await geolocation.SubscribeWatch( - onPosition: position => - { - var coords = position.Coords; - watchResult = $""lat={coords.Latitude:F6}, lng={coords.Longitude:F6}""; - InvokeAsync(StateHasChanged); - }); - } - - private async Task StopWatch() - { - if (watchSub is null) return; - await watchSub.DisposeAsync(); - watchSub = null; - } -}"; -} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil23GeolocationPage.razor.scss b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil23GeolocationPage.razor.scss deleted file mode 100644 index dc4b53c541b..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil23GeolocationPage.razor.scss +++ /dev/null @@ -1,16 +0,0 @@ -@import '../../Styles/abstracts/_colors.scss'; -@import '../../Styles/abstracts/_mixins.scss'; -@import '../../Styles/abstracts/_functions.scss'; -@import '../../Styles/abstracts/_media-queries.scss'; - -.page-container { - @include PageContainer; -} - -.section-card { - @include SectionCard; -} - -.section-card-txt { - @include SectionCardText; -} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil24MediaDevicesPage.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil24MediaDevicesPage.razor deleted file mode 100644 index 58fb8e1740d..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil24MediaDevicesPage.razor +++ /dev/null @@ -1,115 +0,0 @@ -@page "/butil/mediaDevices" -@inherits AppComponentBase -@inject Bit.Butil.MediaDevices mediaDevices - - - -
- MediaDevices -
- - How to use the MediaDevices class of the bit Butil? - -
- -
- Usage -
- Inject the MediaDevices class, enumerate the available cameras and microphones, - request a live stream, and attach it to a video element: - -@@inject Bit.Butil.MediaDevices mediaDevices - -@@code { - var devices = await mediaDevices.EnumerateDevices(); - var stream = await mediaDevices.GetUserMedia(audio: true, video: true); - await stream.AttachTo(videoElement); -} -
-
- -
- Methods -
- The MediaDevices class wraps - navigator.mediaDevices. -

- - IsSupported:
- Returns whether navigator.mediaDevices is available in the current browser - (MDN). -

- - - - @isSupportedExampleCode - - -
- IsSupported -

-
Is supported: @isSupported
-
-
-
-
-

- - EnumerateDevices:
- Lists all input/output media devices. Labels may be empty until the user has granted - permission to a matching input - (MDN). -

- - - - @enumerateDevicesExampleCode - - -
- EnumerateDevices -

-
Devices: @devices
-
-
-
-
-

- - GetUserMedia / AttachTo / SetEnabled:
- Requests camera and/or microphone access and returns a MediaStreamHandle (or null when - the user denies the prompt). Attach the stream to a video element with AttachTo, - pause or resume its tracks with SetEnabled, and stop the stream by disposing the handle - (MDN). -

- - - - @getUserMediaExampleCode - - -
- - -
- Start stream -   - Toggle enabled -   - Stop stream -

- -

-
@streamResult
-
-
-
-
-
-
-
- - diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil24MediaDevicesPage.razor.cs b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil24MediaDevicesPage.razor.cs deleted file mode 100644 index 00b21f6f2dd..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil24MediaDevicesPage.razor.cs +++ /dev/null @@ -1,183 +0,0 @@ -using Bit.Butil; - -namespace Bit.Websites.Platform.Client.Pages.Butil; - -public partial class Butil24MediaDevicesPage -{ - private string? isSupported; - private string? devices; - private string? streamResult; - - private bool requestAudio = true; - private bool requestVideo = true; - private bool enabled = true; - - private ElementReference preview; - private MediaStreamHandle? stream; - private bool startingStream; - - - private async Task IsSupported() - { - isSupported = (await mediaDevices.IsSupported()).ToString(); - } - - private async Task EnumerateDevices() - { - var result = await mediaDevices.EnumerateDevices(); - if (result.Length == 0) - { - devices = "No media devices reported."; - return; - } - - devices = string.Join(", ", result.Select(d => - { - var label = string.IsNullOrEmpty(d.Label) - ? d.DeviceId[..Math.Min(8, d.DeviceId.Length)] + "…" - : d.Label; - return $"{d.Kind}: {label}"; - })); - } - - private async Task StartStream() - { - // Guard against overlapping clicks racing across the GetUserMedia await and - // leaking/overwriting the active stream - only one invocation may run at a time. - if (startingStream) return; - startingStream = true; - - try - { - await StopStream(); - - if (!requestAudio && !requestVideo) - { - streamResult = "Enable at least audio or video."; - return; - } - - stream = await mediaDevices.GetUserMedia(requestAudio, requestVideo); - if (stream is null) - { - streamResult = "GetUserMedia returned null - permission denied or no device available."; - return; - } - - await stream.AttachTo(preview); - enabled = true; - streamResult = $"Stream started → {stream.Id}"; - } - finally - { - startingStream = false; - } - } - - private async Task ToggleEnabled() - { - if (stream is null) - { - streamResult = "Start a stream first."; - return; - } - - enabled = !enabled; - await stream.SetEnabled(enabled); - streamResult = $"Tracks enabled → {enabled}"; - } - - private async Task StopStream() - { - if (stream is null) return; - await stream.DisposeAsync(); - stream = null; - streamResult = "Stream stopped."; - } - - - protected override async ValueTask DisposeAsync(bool disposing) - { - if (stream is not null) - await stream.DisposeAsync(); - - await base.DisposeAsync(disposing); - } - - - private readonly string isSupportedExampleCode = -@"@inject Bit.Butil.MediaDevices mediaDevices - -IsSupported - -
Is supported: @isSupported
- -@code { - private string? isSupported; - - private async Task IsSupported() - { - isSupported = (await mediaDevices.IsSupported()).ToString(); - } -}"; - - private readonly string enumerateDevicesExampleCode = -@"@inject Bit.Butil.MediaDevices mediaDevices - -EnumerateDevices - -
Devices: @devices
- -@code { - private string? devices; - - private async Task EnumerateDevices() - { - var result = await mediaDevices.EnumerateDevices(); - devices = string.Join("", "", result.Select(d => $""{d.Kind}: {d.Label}"")); - } -}"; - - private readonly string getUserMediaExampleCode = -@"@inject Bit.Butil.MediaDevices mediaDevices - - - - -Start stream -Toggle enabled -Stop stream - - - -@code { - private bool requestAudio = true; - private bool requestVideo = true; - private bool enabled = true; - private ElementReference preview; - private MediaStreamHandle? stream; - - private async Task StartStream() - { - await StopStream(); - stream = await mediaDevices.GetUserMedia(requestAudio, requestVideo); - if (stream is null) return; - await stream.AttachTo(preview); - enabled = true; - } - - private async Task ToggleEnabled() - { - if (stream is null) return; - enabled = !enabled; - await stream.SetEnabled(enabled); - } - - private async Task StopStream() - { - if (stream is null) return; - await stream.DisposeAsync(); - stream = null; - } -}"; -} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil24MediaDevicesPage.razor.scss b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil24MediaDevicesPage.razor.scss deleted file mode 100644 index dc4b53c541b..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil24MediaDevicesPage.razor.scss +++ /dev/null @@ -1,16 +0,0 @@ -@import '../../Styles/abstracts/_colors.scss'; -@import '../../Styles/abstracts/_mixins.scss'; -@import '../../Styles/abstracts/_functions.scss'; -@import '../../Styles/abstracts/_media-queries.scss'; - -.page-container { - @include PageContainer; -} - -.section-card { - @include SectionCard; -} - -.section-card-txt { - @include SectionCardText; -} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil25PermissionsPage.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil25PermissionsPage.razor deleted file mode 100644 index ea8ef268a82..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil25PermissionsPage.razor +++ /dev/null @@ -1,92 +0,0 @@ -@page "/butil/permissions" -@inherits AppComponentBase -@inject Bit.Butil.Permissions permissions - - - -
- Permissions -
- - How to use the Permissions class of the bit Butil? - -
- -
- Usage -
- To query the browser's permission state you need to inject the Bit.Butil.Permissions class and use it like this: - -@@inject Bit.Butil.Permissions permissions - -@@code { - var state = await permissions.Query("geolocation"); -} -
-
- -
- Methods -
-
- IsSupported:
- Returns whether the Permissions API (navigator.permissions) is available in the current browser - (MDN). -

- - - - - @isSupportedExampleCode - - - -
- IsSupported -
-
-
Is supported: @isSupported
-
-
-
-
-

- - Query:
- Returns the current state (granted, denied, prompt or unknown) for a given permission descriptor name, without triggering a prompt - (MDN). -

- - - - - @queryExampleCode - - - -
- -
-
- Query selected -   - Query all common -
-
-
@queryResult
-
-
-
-
-
-
-
- - diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil25PermissionsPage.razor.cs b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil25PermissionsPage.razor.cs deleted file mode 100644 index 8c597959031..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil25PermissionsPage.razor.cs +++ /dev/null @@ -1,110 +0,0 @@ -using Bit.Butil; - -namespace Bit.Websites.Platform.Client.Pages.Butil; - -public partial class Butil25PermissionsPage -{ - private string? isSupported; - - private string selectedPermission = "geolocation"; - - private string? queryResult; - - private static readonly string[] permissionNames = - [ - "geolocation", - "notifications", - "camera", - "microphone", - "clipboard-read", - "clipboard-write", - "push", - "midi", - "background-sync", - "persistent-storage", - ]; - - - private async Task CheckSupported() - { - isSupported = (await permissions.IsSupported()).ToString(); - } - - private async Task QuerySelected() - { - var state = await permissions.Query(selectedPermission); - queryResult = $"{selectedPermission} → {state}"; - } - - private async Task QueryAll() - { - var result = ""; - foreach (var name in permissionNames) - { - var state = await permissions.Query(name); - result += $"{name} → {state}\n"; - } - queryResult = result; - } - - - private string isSupportedExampleCode = -@"@inject Bit.Butil.Permissions permissions - -IsSupported - -
Is supported: @isSupported
- -@code { - private string? isSupported; - - private async Task CheckSupported() - { - isSupported = (await permissions.IsSupported()).ToString(); - } -}"; - - private string queryExampleCode = -@"@inject Bit.Butil.Permissions permissions - - - -Query selected -Query all common - -
@queryResult
- -@code { - private string selectedPermission = ""geolocation""; - private string? queryResult; - - private static readonly string[] permissionNames = - [ - ""geolocation"", ""notifications"", ""camera"", ""microphone"", - ""clipboard-read"", ""clipboard-write"", ""push"", ""midi"", - ""background-sync"", ""persistent-storage"", - ]; - - private async Task QuerySelected() - { - var state = await permissions.Query(selectedPermission); - queryResult = $""{selectedPermission} → {state}""; - } - - private async Task QueryAll() - { - var result = """"; - foreach (var name in permissionNames) - { - var state = await permissions.Query(name); - result += $""{name} → {state}\n""; - } - queryResult = result; - } -}"; -} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil25PermissionsPage.razor.scss b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil25PermissionsPage.razor.scss deleted file mode 100644 index dc4b53c541b..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil25PermissionsPage.razor.scss +++ /dev/null @@ -1,16 +0,0 @@ -@import '../../Styles/abstracts/_colors.scss'; -@import '../../Styles/abstracts/_mixins.scss'; -@import '../../Styles/abstracts/_functions.scss'; -@import '../../Styles/abstracts/_media-queries.scss'; - -.page-container { - @include PageContainer; -} - -.section-card { - @include SectionCard; -} - -.section-card-txt { - @include SectionCardText; -} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil26FetchPage.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil26FetchPage.razor deleted file mode 100644 index ec35976fbd1..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil26FetchPage.razor +++ /dev/null @@ -1,85 +0,0 @@ -@page "/butil/fetch" -@inherits AppComponentBase -@inject Bit.Butil.Fetch fetch - - - -
- Fetch -
- - How to use the Fetch class of the bit Butil? - -
- -
- Usage -
- The Fetch class wraps the browser's - Fetch API - with progress reporting and an abortable handle. Prefer HttpClient for normal API calls; - reach for this when you need progress for big downloads or fetch-only semantics. Inject it and use it like this: - -@@inject Bit.Butil.Fetch fetch - -@@code { - var response = await fetch.Send(new FetchRequest { Url = "https://..." }, - onProgress: p => { /* bytes received */ }); -} -
-
- -
- Methods -
- Send:
- Sends the request and returns the full FetchResponse (status, headers and body bytes). -

- - - - @sendGetExampleCode - - -
- -
- Send GET -

-
@sendGetStatus
- @if (sendGetBody is not null) - { -
@sendGetBody
- } -
-
-
-
-

- - Send with progress and cancellation:
- Pass an onProgress callback to watch bytes arrive, and a CancellationToken to abort mid-flight. -

- - - - @sendProgressExampleCode - - -
- Download with progress -   - Abort -

-
@progressText
-
-
-
-
-
-
-
- - diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil26FetchPage.razor.cs b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil26FetchPage.razor.cs deleted file mode 100644 index 76b4d9e4132..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil26FetchPage.razor.cs +++ /dev/null @@ -1,176 +0,0 @@ -using Bit.Butil; - -namespace Bit.Websites.Platform.Client.Pages.Butil; - -public partial class Butil26FetchPage -{ - private string url = "https://jsonplaceholder.typicode.com/todos/1"; - private string? sendGetStatus; - private string? sendGetBody; - private string? progressText; - - private CancellationTokenSource? cts; - - - private async Task SendGet() - { - sendGetStatus = null; - sendGetBody = null; - - if (string.IsNullOrWhiteSpace(url)) - { - sendGetStatus = "Enter a URL first."; - return; - } - - try - { - var response = await fetch.Send(new FetchRequest { Url = url.Trim() }); - - if (response.Error is not null) - { - sendGetStatus = $"Error: {response.Error}"; - return; - } - - sendGetStatus = $"Status {response.Status} {response.StatusText} - {response.Body.Length} bytes from {response.Url}"; - sendGetBody = PreviewBody(response.Body); - } - catch (Exception ex) - { - sendGetStatus = $"Error: {ex.Message}"; - } - } - - private bool sending; - - private async Task SendWithProgress() - { - // Prevent overlapping downloads from racing on the shared cts field. - if (sending) return; - sending = true; - - progressText = null; - - // Cancel and dispose any previous source before replacing it; keep a local - // reference so this call only ever disposes/clears its own token source. - cts?.Cancel(); - cts?.Dispose(); - var localCts = cts = new CancellationTokenSource(); - - try - { - var response = await fetch.Send( - new FetchRequest { Url = "https://jsonplaceholder.typicode.com/photos" }, - onProgress: p => - { - progressText = p.Total.HasValue - ? $"Received {p.Loaded} / {p.Total} bytes" - : $"Received {p.Loaded} bytes"; - InvokeAsync(StateHasChanged); - }, - cancellationToken: localCts.Token); - - progressText = response.Aborted ? "Aborted" : $"Complete - {response.Body.Length} bytes"; - } - catch (Exception ex) - { - progressText = $"Error: {ex.Message}"; - } - finally - { - if (ReferenceEquals(cts, localCts)) cts = null; - localCts.Dispose(); - sending = false; - } - } - - private void AbortRequest() => cts?.Cancel(); - - private static string PreviewBody(byte[] body) - { - if (body.Length == 0) return "(empty body)"; - var text = System.Text.Encoding.UTF8.GetString(body); - return text.Length > 500 ? text[..500] + "..." : text; - } - - - protected override async ValueTask DisposeAsync(bool disposing) - { - if (cts is not null) - { - // Cancel first so any in-flight SendWithProgress request aborts the JS fetch - // (via BitButil.fetch.abort) instead of being left running after teardown. - cts.Cancel(); - cts.Dispose(); - cts = null; - } - - await base.DisposeAsync(disposing); - } - - - private readonly string sendGetExampleCode = -@"@inject Bit.Butil.Fetch fetch - - - -Send GET - -
@sendGetStatus
-
@sendGetBody
- -@code { - private string url = ""https://jsonplaceholder.typicode.com/todos/1""; - private string? sendGetStatus; - private string? sendGetBody; - - private async Task SendGet() - { - var response = await fetch.Send(new FetchRequest { Url = url.Trim() }); - - if (response.Error is not null) - { - sendGetStatus = $""Error: {response.Error}""; - return; - } - - sendGetStatus = $""Status {response.Status} {response.StatusText} - {response.Body.Length} bytes from {response.Url}""; - sendGetBody = System.Text.Encoding.UTF8.GetString(response.Body); - } -}"; - - private readonly string sendProgressExampleCode = -@"@inject Bit.Butil.Fetch fetch - -Download with progress -Abort - -
@progressText
- -@code { - private string? progressText; - private CancellationTokenSource? cts; - - private async Task SendWithProgress() - { - cts?.Dispose(); - cts = new CancellationTokenSource(); - - var response = await fetch.Send( - new FetchRequest { Url = ""https://jsonplaceholder.typicode.com/photos"" }, - onProgress: p => - { - progressText = p.Total.HasValue - ? $""Received {p.Loaded} / {p.Total} bytes"" - : $""Received {p.Loaded} bytes""; - InvokeAsync(StateHasChanged); - }, - cancellationToken: cts.Token); - - progressText = response.Aborted ? ""Aborted"" : ""Complete""; - } - - private void AbortRequest() => cts?.Cancel(); -}"; -} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil26FetchPage.razor.scss b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil26FetchPage.razor.scss deleted file mode 100644 index dc4b53c541b..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil26FetchPage.razor.scss +++ /dev/null @@ -1,16 +0,0 @@ -@import '../../Styles/abstracts/_colors.scss'; -@import '../../Styles/abstracts/_mixins.scss'; -@import '../../Styles/abstracts/_functions.scss'; -@import '../../Styles/abstracts/_media-queries.scss'; - -.page-container { - @include PageContainer; -} - -.section-card { - @include SectionCard; -} - -.section-card-txt { - @include SectionCardText; -} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil27FilesPage.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil27FilesPage.razor deleted file mode 100644 index a24e8cbd319..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil27FilesPage.razor +++ /dev/null @@ -1,216 +0,0 @@ -@page "/butil/files" -@inherits AppComponentBase -@inject Bit.Butil.FileReader fileReader -@inject Bit.Butil.ObjectUrls objectUrls - - - -
- Files -
- - How to use the file related classes of the bit Butil? - -
- -
- Usage -
- The file features live in two classes. Inject the ones you need and use them like this: - -@@inject Bit.Butil.FileReader fileReader -@@inject Bit.Butil.ObjectUrls objectUrls - -@@code { - var text = await fileReader.ReadAsText(fileInput); - var url = await objectUrls.Create(bytes, "image/png"); -} -
-
- -
- FileReader -
- The FileReader class wraps the - FileReader API - to read files selected in an <input type="file"> element as metadata, text, bytes or data URLs. -

- - GetFileInfos:
- Returns metadata (Name, Size and Type) for every file selected in the given input element - (MDN). -

- - - - @getFileInfosExampleCode - - -
- -

- GetFileInfos -

-
@fileInfos
-
-
-
-
-

- - ReadAsText:
- Reads the first selected file as UTF-8 text - (MDN). -

- - - - @readAsTextExampleCode - - -
- -

- ReadAsText -

-
@fileText
-
-
-
-
-

- - ReadAsBytes:
- Reads the first selected file as raw bytes - (MDN). -

- - - - @readAsBytesExampleCode - - -
- -

- ReadAsBytes -

-
@fileBytes
-
-
-
-
-

- - ReadAsDataUrl:
- Reads the first selected file as a base-64 data URL, convenient for image previews - (MDN). -

- - - - @readAsDataUrlExampleCode - - -
- -

- ReadAsDataUrl -

-
@fileDataUrl
- @if (imagePreviewUrl is not null) - { -
- Preview - } -
-
-
-
-

- - Clear:
- Clears the input's selection (resets its files list) - (MDN). -

- - - - @clearExampleCode - - -
- -

- Clear -

-
@clearResult
-
-
-
-
-
-
- -
- ObjectUrls -
- The ObjectUrls class wraps - URL.createObjectURL - and - URL.revokeObjectURL - for arbitrary byte payloads. -

- - Create:
- Creates a blob object URL from raw bytes plus an optional MIME type - (MDN). -

- - - - @createExampleCode - - -
- -
- Create -

- @if (objectUrl is not null) - { - - } -
-
-
-
-

- - Revoke:
- Revokes a previously created object URL to release its memory - (MDN). -

- - - - @revokeExampleCode - - -
- Revoke -

-
@revokeResult
-
-
-
-
-
-
-
- - diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil27FilesPage.razor.cs b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil27FilesPage.razor.cs deleted file mode 100644 index 551a7268098..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil27FilesPage.razor.cs +++ /dev/null @@ -1,268 +0,0 @@ -using Bit.Butil; - -namespace Bit.Websites.Platform.Client.Pages.Butil; - -public partial class Butil27FilesPage -{ - private ElementReference fileInput; - - private string? fileInfos; - private string? fileText; - private string? fileBytes; - private string? fileDataUrl; - private string? clearResult; - private string? imagePreviewUrl; - - private string? blobText = "Hello from Bit.Butil ObjectUrls!"; - private string? objectUrl; - private string? revokeResult; - - - private async Task GetFileInfos() - { - var infos = await fileReader.GetFileInfos(fileInput); - if (infos.Length == 0) - { - fileInfos = "No file selected."; - return; - } - - fileInfos = string.Join(" | ", infos.Select(i => $"{i.Name} ({i.Size} bytes, {i.Type})")); - } - - private async Task ReadAsText() - { - var text = await fileReader.ReadAsText(fileInput); - if (string.IsNullOrEmpty(text)) - { - fileText = "No file or empty content."; - return; - } - - fileText = text.Length > 300 ? text[..300] + "…" : text; - } - - private async Task ReadAsBytes() - { - var bytes = await fileReader.ReadAsBytes(fileInput); - if (bytes is null) - { - fileBytes = "No file selected."; - return; - } - - fileBytes = $"{bytes.Length} bytes"; - } - - private async Task ReadAsDataUrl() - { - var dataUrl = await fileReader.ReadAsDataUrl(fileInput); - if (string.IsNullOrEmpty(dataUrl)) - { - fileDataUrl = "No file selected."; - imagePreviewUrl = null; - return; - } - - imagePreviewUrl = dataUrl.StartsWith("data:image/", StringComparison.OrdinalIgnoreCase) - ? dataUrl - : null; - - fileDataUrl = dataUrl.Length > 120 ? dataUrl[..120] + "…" : dataUrl; - } - - private async Task Clear() - { - await fileReader.Clear(fileInput); - imagePreviewUrl = null; - clearResult = "Input cleared."; - } - - private async Task CreateObjectUrl() - { - await RevokeObjectUrlInternal(); - - var bytes = System.Text.Encoding.UTF8.GetBytes(blobText ?? string.Empty); - objectUrl = await objectUrls.Create(bytes, "text/plain"); - } - - private async Task RevokeObjectUrl() - { - await RevokeObjectUrlInternal(); - revokeResult = "Object URL revoked."; - } - - private async Task RevokeObjectUrlInternal() - { - if (objectUrl is null) return; - await objectUrls.Revoke(objectUrl); - objectUrl = null; - } - - - protected override async ValueTask DisposeAsync(bool disposing) - { - // Ensure any blob URL created via CreateObjectUrl is revoked when the user leaves the page. - await RevokeObjectUrlInternal(); - - await base.DisposeAsync(disposing); - } - - - private readonly string getFileInfosExampleCode = -@"@inject Bit.Butil.FileReader fileReader - - - -GetFileInfos - -
@fileInfos
- -@code { - private ElementReference fileInput; - private string? fileInfos; - - private async Task GetFileInfos() - { - var infos = await fileReader.GetFileInfos(fileInput); - if (infos.Length == 0) - { - fileInfos = ""No file selected.""; - return; - } - - fileInfos = string.Join("" | "", infos.Select(i => $""{i.Name} ({i.Size} bytes, {i.Type})"")); - } -}"; - - private readonly string readAsTextExampleCode = -@"@inject Bit.Butil.FileReader fileReader - - - -ReadAsText - -
@fileText
- -@code { - private ElementReference fileInput; - private string? fileText; - - private async Task ReadAsText() - { - var text = await fileReader.ReadAsText(fileInput); - fileText = string.IsNullOrEmpty(text) ? ""No file or empty content."" : text; - } -}"; - - private readonly string readAsBytesExampleCode = -@"@inject Bit.Butil.FileReader fileReader - - - -ReadAsBytes - -
@fileBytes
- -@code { - private ElementReference fileInput; - private string? fileBytes; - - private async Task ReadAsBytes() - { - var bytes = await fileReader.ReadAsBytes(fileInput); - fileBytes = bytes is null ? ""No file selected."" : $""{bytes.Length} bytes""; - } -}"; - - private readonly string readAsDataUrlExampleCode = -@"@inject Bit.Butil.FileReader fileReader - - - -ReadAsDataUrl - -
@fileDataUrl
- -@if (imagePreviewUrl is not null) -{ - -} - -@code { - private ElementReference fileInput; - private string? fileDataUrl; - private string? imagePreviewUrl; - - private async Task ReadAsDataUrl() - { - var dataUrl = await fileReader.ReadAsDataUrl(fileInput); - if (string.IsNullOrEmpty(dataUrl)) - { - fileDataUrl = ""No file selected.""; - imagePreviewUrl = null; - return; - } - - imagePreviewUrl = dataUrl.StartsWith(""data:image/"", StringComparison.OrdinalIgnoreCase) - ? dataUrl - : null; - fileDataUrl = dataUrl; - } -}"; - - private readonly string clearExampleCode = -@"@inject Bit.Butil.FileReader fileReader - - - -Clear - -@code { - private ElementReference fileInput; - - private async Task Clear() - { - await fileReader.Clear(fileInput); - } -}"; - - private readonly string createExampleCode = -@"@inject Bit.Butil.ObjectUrls objectUrls - - - -Create - -@if (objectUrl is not null) -{ - Open blob URL -} - -@code { - private string? blobText; - private string? objectUrl; - - private async Task CreateObjectUrl() - { - var bytes = System.Text.Encoding.UTF8.GetBytes(blobText ?? string.Empty); - objectUrl = await objectUrls.Create(bytes, ""text/plain""); - } -}"; - - private readonly string revokeExampleCode = -@"@inject Bit.Butil.ObjectUrls objectUrls - -Revoke - -@code { - private string? objectUrl; - - private async Task RevokeObjectUrl() - { - if (objectUrl is null) return; - await objectUrls.Revoke(objectUrl); - objectUrl = null; - } -}"; -} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil27FilesPage.razor.scss b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil27FilesPage.razor.scss deleted file mode 100644 index dc4b53c541b..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil27FilesPage.razor.scss +++ /dev/null @@ -1,16 +0,0 @@ -@import '../../Styles/abstracts/_colors.scss'; -@import '../../Styles/abstracts/_mixins.scss'; -@import '../../Styles/abstracts/_functions.scss'; -@import '../../Styles/abstracts/_media-queries.scss'; - -.page-container { - @include PageContainer; -} - -.section-card { - @include SectionCard; -} - -.section-card-txt { - @include SectionCardText; -} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil28SpeechPage.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil28SpeechPage.razor deleted file mode 100644 index b3f37013f83..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil28SpeechPage.razor +++ /dev/null @@ -1,187 +0,0 @@ -@page "/butil/speech" -@inherits AppComponentBase -@inject Bit.Butil.SpeechSynthesis speechSynthesis -@inject Bit.Butil.SpeechRecognition speechRecognition - - - -
- Speech -
- - How to use the speech classes of the bit Butil? - -
- -
- Usage -
- The speech features are split across two classes. Inject the ones you need and use them like this: - -@@inject Bit.Butil.SpeechSynthesis speechSynthesis -@@inject Bit.Butil.SpeechRecognition speechRecognition - -@@code { - await speechSynthesis.Speak("Hello from Butil!"); - await using var rec = await speechRecognition.Start(options, onResult: r => { /* ... */ }); -} -
-
- -
- SpeechSynthesis -
- The SpeechSynthesis class wraps the - SpeechSynthesis API - for text-to-speech. -

- - GetVoices:
- Returns the list of voices the platform makes available - (MDN). -

- - - - @getVoicesExampleCode - - -
- GetVoices -

-
Voices count: @voices.Length
-
@getVoicesResult
-
-
-
-
-

- - Speak:
- Speaks the configured utterance with an optional voice, rate and pitch - (MDN). -

- - - - @speakExampleCode - - -
- -
- -

- Speak -
-
-
-
-

- - Pause / Resume / Cancel:
- Pauses the current utterance, resumes a paused utterance, or cancels all pending utterances - (MDN). -

- - - - @pauseResumeCancelExampleCode - - -
- Pause -   - Resume -   - Cancel -

-
@speakResult
-
-
-
-
-

- - IsSpeaking:
- Returns whether the engine is currently speaking (or paused) - (MDN). -

- - - - @isSpeakingExampleCode - - -
- IsSpeaking -

-
Is speaking: @isSpeaking
-
-
-
-
-
-
- -
- SpeechRecognition -
- The SpeechRecognition class wraps the - SpeechRecognition API - for speech-to-text (Chromium-based browsers). -

- - Start:
- Captures microphone input and reports interim and final transcripts through the onResult callback. - The Continuous and InterimResults options control the stream, and onError / onEnd surface errors and completion. - Returns an IAsyncDisposable handle that stops recognition when disposed - (MDN). -

- - - - @startExampleCode - - -
- Start -   - Stop -

-
Transcript: @transcript
-
-
-
-
-

- - Stop:
- Stops the recognition session early. Disposing the handle returned by Start is equivalent - (MDN). -

- - - - @stopExampleCode - - -
- Stop -
-
-
-
-
-
-
- - diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil28SpeechPage.razor.cs b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil28SpeechPage.razor.cs deleted file mode 100644 index 94f23a06b6a..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil28SpeechPage.razor.cs +++ /dev/null @@ -1,298 +0,0 @@ -using Bit.Butil; - -namespace Bit.Websites.Platform.Client.Pages.Butil; - -public partial class Butil28SpeechPage -{ - private SpeechVoice[] voices = []; - private string? speakText = "Hello from Bit.Butil speech synthesis!"; - private string? voiceName; - private string? getVoicesResult; - private string? speakResult; - private string? isSpeaking; - - private string? transcript; - private bool recognizing; - private IAsyncDisposable? recognitionHandle; - - - protected override async Task OnAfterFirstRenderAsync() - { - await base.OnAfterFirstRenderAsync(); - - await GetVoices(); - } - - - private async Task GetVoices() - { - if (await speechSynthesis.IsSupported() is false) - { - getVoicesResult = "Speech synthesis is not supported."; - return; - } - - voices = await speechSynthesis.GetVoices(); - getVoicesResult = $"{voices.Length} voice(s) available."; - StateHasChanged(); - } - - private async Task Speak() - { - if (string.IsNullOrWhiteSpace(speakText)) return; - - if (await speechSynthesis.IsSupported() is false) - { - speakResult = "Speech synthesis is not supported."; - return; - } - - await speechSynthesis.Speak(new SpeechUtterance - { - Text = speakText, - VoiceName = string.IsNullOrWhiteSpace(voiceName) ? null : voiceName, - Rate = 1, - Pitch = 1, - }); - } - - private async Task PauseSpeech() - { - if (await speechSynthesis.IsSupported() is false) - { - speakResult = "Speech synthesis is not supported."; - return; - } - - await speechSynthesis.Pause(); - speakResult = $"Paused (speaking={await speechSynthesis.IsSpeaking()})."; - } - - private async Task ResumeSpeech() - { - if (await speechSynthesis.IsSupported() is false) - { - speakResult = "Speech synthesis is not supported."; - return; - } - - await speechSynthesis.Resume(); - speakResult = "Resumed."; - } - - private async Task CancelSpeech() - { - if (await speechSynthesis.IsSupported() is false) - { - speakResult = "Speech synthesis is not supported."; - return; - } - - await speechSynthesis.Cancel(); - speakResult = "Cancelled."; - } - - private async Task IsSpeaking() - { - if (await speechSynthesis.IsSupported() is false) - { - isSpeaking = "Speech synthesis is not supported."; - return; - } - - isSpeaking = (await speechSynthesis.IsSpeaking()).ToString(); - } - - private async Task StartRecognition() - { - if (await speechRecognition.IsSupported() is false) - { - transcript = "Speech recognition is not supported."; - return; - } - - await StopRecognitionInternal(); - - transcript = ""; - recognizing = true; - - recognitionHandle = await speechRecognition.Start( - new SpeechRecognitionOptions { Continuous = true, InterimResults = true }, - onResult: result => - { - transcript = result.IsFinal - ? $"Final: {result.Transcript} ({result.Confidence:P0})" - : $"Interim: {result.Transcript}"; - InvokeAsync(StateHasChanged); - }, - onError: err => - { - transcript = $"Error: {err}"; - InvokeAsync(StateHasChanged); - }, - onEnd: () => - { - recognizing = false; - InvokeAsync(StateHasChanged); - }); - } - - private async Task StopRecognition() - { - await StopRecognitionInternal(); - } - - private async Task StopRecognitionInternal() - { - if (recognitionHandle is null) return; - await recognitionHandle.DisposeAsync(); - recognitionHandle = null; - recognizing = false; - } - - - protected override async ValueTask DisposeAsync(bool disposing) - { - // Stop any active/pending speech so navigating away cancels ongoing utterances. - await speechSynthesis.Cancel(); - - if (recognitionHandle is not null) - await recognitionHandle.DisposeAsync(); - - await base.DisposeAsync(disposing); - } - - - private readonly string getVoicesExampleCode = -@"@inject Bit.Butil.SpeechSynthesis speechSynthesis - -GetVoices - -
Voices count: @voices.Length
- -@code { - private SpeechVoice[] voices = []; - - private async Task GetVoices() - { - if (await speechSynthesis.IsSupported() is false) return; - voices = await speechSynthesis.GetVoices(); - } -}"; - - private readonly string speakExampleCode = -@"@inject Bit.Butil.SpeechSynthesis speechSynthesis - - - - - -Speak - -@code { - private string? speakText = ""Hello from Bit.Butil speech synthesis!""; - private string? voiceName; - - private async Task Speak() - { - await speechSynthesis.Speak(new SpeechUtterance - { - Text = speakText, - VoiceName = string.IsNullOrWhiteSpace(voiceName) ? null : voiceName, - Rate = 1, - Pitch = 1, - }); - } -}"; - - private readonly string pauseResumeCancelExampleCode = -@"@inject Bit.Butil.SpeechSynthesis speechSynthesis - -Pause -Resume -Cancel - -@code { - private async Task PauseSpeech() - { - await speechSynthesis.Pause(); - } - - private async Task ResumeSpeech() - { - await speechSynthesis.Resume(); - } - - private async Task CancelSpeech() - { - await speechSynthesis.Cancel(); - } -}"; - - private readonly string isSpeakingExampleCode = -@"@inject Bit.Butil.SpeechSynthesis speechSynthesis - -IsSpeaking - -
Is speaking: @isSpeaking
- -@code { - private string? isSpeaking; - - private async Task IsSpeaking() - { - isSpeaking = (await speechSynthesis.IsSpeaking()).ToString(); - } -}"; - - private readonly string startExampleCode = -@"@inject Bit.Butil.SpeechRecognition speechRecognition - -Start - -
Transcript: @transcript
- -@code { - private string? transcript; - private IAsyncDisposable? recognitionHandle; - - private async Task StartRecognition() - { - if (await speechRecognition.IsSupported() is false) return; - - recognitionHandle = await speechRecognition.Start( - new SpeechRecognitionOptions { Continuous = true, InterimResults = true }, - onResult: result => - { - transcript = result.IsFinal - ? $""Final: {result.Transcript} ({result.Confidence:P0})"" - : $""Interim: {result.Transcript}""; - InvokeAsync(StateHasChanged); - }, - onError: err => { InvokeAsync(StateHasChanged); }, - onEnd: () => { InvokeAsync(StateHasChanged); }); - } -}"; - - private readonly string stopExampleCode = -@"@inject Bit.Butil.SpeechRecognition speechRecognition - -Stop - -@code { - private IAsyncDisposable? recognitionHandle; - - private async Task StopRecognition() - { - if (recognitionHandle is null) return; - await recognitionHandle.DisposeAsync(); - recognitionHandle = null; - } -}"; -} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil28SpeechPage.razor.scss b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil28SpeechPage.razor.scss deleted file mode 100644 index dc4b53c541b..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil28SpeechPage.razor.scss +++ /dev/null @@ -1,16 +0,0 @@ -@import '../../Styles/abstracts/_colors.scss'; -@import '../../Styles/abstracts/_mixins.scss'; -@import '../../Styles/abstracts/_functions.scss'; -@import '../../Styles/abstracts/_media-queries.scss'; - -.page-container { - @include PageContainer; -} - -.section-card { - @include SectionCard; -} - -.section-card-txt { - @include SectionCardText; -} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil29ObserversPage.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil29ObserversPage.razor deleted file mode 100644 index 7594c63a728..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil29ObserversPage.razor +++ /dev/null @@ -1,284 +0,0 @@ -@page "/butil/observers" -@inherits AppComponentBase -@inject Bit.Butil.Performance performance -@inject Bit.Butil.StorageManager storageManager -@inject Bit.Butil.NetworkInformation networkInformation -@inject Bit.Butil.BroadcastChannel broadcastChannel -@inject Bit.Butil.IndexedDb indexedDb - - - -
- Observers -
- - How to use the observers and async browser APIs of the bit Butil? - -
- -
- Usage -
- These reactive and async browser APIs are spread across a few classes and element extension methods. - Inject the ones you need (the element observers take the injected IJSRuntime) and use them like this: - -@@inject Bit.Butil.Performance performance -@@inject Bit.Butil.StorageManager storageManager -@@inject Bit.Butil.NetworkInformation networkInformation -@@inject Bit.Butil.BroadcastChannel broadcastChannel -@@inject Bit.Butil.IndexedDb indexedDb -@@inject IJSRuntime js - -@@code { - var sub = await element.ObserveIntersection(js, entries => { /* ... */ }); - await using var db = await indexedDb.Open("my-db", 1, [new IndexedDbStoreSchema { Name = "items", KeyPath = "id" }]); -} -
-
- -
- Element observers -
- The ObserveIntersection, ObserveResize and ObserveMutations extension methods wire the - matching browser observers onto an ElementReference. Each returns a ButilSubscription you - dispose to stop observing. The samples below all watch this shared target element: -

-
- target -
-
- - ObserveIntersection:
- Fires when the target enters or leaves the viewport, reporting the intersection ratio and visibility - (MDN). -

- - - - @intersectionExampleCode - - -
- Observe -   - Stop -

-
@intersectionResult
-
-
-
-
-

- - ObserveResize:
- Reports size changes when the target is resized, surfacing the new content-rect dimensions - (MDN). -

- - - - @resizeExampleCode - - -
- Observe -   - Grow target -   - Stop -

-
@resizeResult
-
-
-
-
-

- - ObserveMutations:
- Logs DOM changes on the target element, such as attribute mutations - (MDN). -

- - - - @mutationExampleCode - - -
- Observe -   - Mutate attribute -   - Stop -

-
@mutationResult
-
-
-
-
-
-
- -
- Performance -
- The Performance class wraps the - Performance - timing and marker API. -

- - Mark / Measure / GetEntries:
- Adds named marks to the timeline, measures the elapsed time between them, and reads back the recorded entries - (MDN). -

- - - - @perfMeasureExampleCode - - -
- Mark + Measure -

-
@perfMeasureResult
-
-
-
-
-

- - SubscribeObserver:
- Subscribes a PerformanceObserver to one or more entry types and reports each batch as it arrives - (MDN). -

- - - - @perfObserverExampleCode - - -
- SubscribeObserver -

-
@perfObserverResult
-
-
-
-
-
-
- -
- StorageManager & NetworkInformation -
- The StorageManager class wraps - navigator.storage - and the NetworkInformation class wraps the - Network Information API. -

- - Estimate:
- Reports an estimate of the storage quota and current usage for the origin - (MDN). -

- - - - @storageExampleCode - - -
- Estimate -

-
@storageResult
-
-
-
-
-

- - GetStatus:
- Returns the online flag, effective connection type, downlink and round-trip-time estimates - (MDN). -

- - - - @networkExampleCode - - -
- GetStatus -

-
@networkResult
-
-
-
-
-
-
- -
- BroadcastChannel -
- The BroadcastChannel class wraps the - BroadcastChannel - API for cross-tab pub/sub on the same origin. -

- - Subscribe / Post:
- Subscribes to a named channel and posts messages to every other listener on that channel in the same origin - (the sender does not receive its own message). Open a second tab to see messages arrive - (MDN). -

- - - - @broadcastExampleCode - - -
- Subscribe -   - Post -

-
@broadcastResult
-
-
-
-
-
-
- -
- IndexedDB -
- The IndexedDb class is a lightweight wrapper over - IndexedDB. -

- - Open / Put / Get:
- Opens (and upgrades if needed) a database, stores a record and reads it back by key - (MDN). -

- - - - @indexedDbExampleCode - - -
- Round-trip -

-
@indexedDbResult
-
-
-
-
-
-
-
- - diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil29ObserversPage.razor.cs b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil29ObserversPage.razor.cs deleted file mode 100644 index c79ec567044..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil29ObserversPage.razor.cs +++ /dev/null @@ -1,488 +0,0 @@ -using Bit.Butil; -using Microsoft.AspNetCore.Components; - -namespace Bit.Websites.Platform.Client.Pages.Butil; - -public partial class Butil29ObserversPage -{ - private ElementReference target; - private int targetWidth = 120; - - private ButilSubscription? intersectionSub; - private ButilSubscription? resizeSub; - private ButilSubscription? mutationSub; - private ButilSubscription? perfObserverSub; - private ButilSubscription? broadcastSub; - - private string? intersectionResult; - private string? resizeResult; - private string? mutationResult; - private string? perfMeasureResult; - private string? perfObserverResult; - private string? storageResult; - private string? networkResult; - private string? broadcastResult; - private string? indexedDbResult; - - - private async Task StartIntersection() - { - await StopIntersection(); - intersectionSub = await target.ObserveIntersection(JSRuntime, entries => - { - if (entries.Length > 0) - { - intersectionResult = $"ratio={entries[0].IntersectionRatio:F2}, visible={entries[0].IsIntersecting}"; - InvokeAsync(StateHasChanged); - } - }); - intersectionResult = "Intersection observer started."; - } - - private async Task StopIntersection() - { - if (intersectionSub is null) return; - await intersectionSub.DisposeAsync(); - intersectionSub = null; - } - - private async Task StartResize() - { - await StopResize(); - resizeSub = await target.ObserveResize(JSRuntime, entries => - { - if (entries.Length > 0) - { - var rect = entries[0].ContentRect; - resizeResult = $"{rect?.Width:F0}x{rect?.Height:F0}"; - InvokeAsync(StateHasChanged); - } - }); - resizeResult = "Resize observer started."; - } - - private async Task GrowTarget() - { - targetWidth += 40; - await target.SetAttribute("style", - $"width:{targetWidth}px;height:48px;border:2px solid var(--bit-clr-pri);border-radius:6px;display:flex;align-items:center;justify-content:center"); - } - - private async Task StopResize() - { - if (resizeSub is null) return; - await resizeSub.DisposeAsync(); - resizeSub = null; - } - - private async Task StartMutation() - { - await StopMutation(); - mutationSub = await target.ObserveMutations(JSRuntime, records => - { - if (records.Length > 0) - { - mutationResult = $"{records[0].Type} on {records[0].TargetId ?? "target"}"; - InvokeAsync(StateHasChanged); - } - }, new MutationObserverOptions { Attributes = true }); - mutationResult = "Mutation observer started."; - } - - private async Task MutateTarget() - { - await target.SetAttribute("data-butil", Guid.NewGuid().ToString("N")[..8]); - } - - private async Task StopMutation() - { - if (mutationSub is null) return; - await mutationSub.DisposeAsync(); - mutationSub = null; - } - - private async Task PerfMarkMeasure() - { - await performance.Mark("butil-demo-a"); - await Task.Delay(50); - await performance.Mark("butil-demo-b"); - await performance.Measure("butil-demo-measure", "butil-demo-a", "butil-demo-b"); - var entries = await performance.GetEntries("butil-demo-measure", "measure"); - perfMeasureResult = entries.Length > 0 ? entries[0].ToString() : "(no entry)"; - } - - private async Task PerfObserver() - { - await StopPerfObserver(); - perfObserverSub = await performance.SubscribeObserver(["mark"], entries => - { - if (entries.Length > 0) - { - perfObserverResult = entries[0].ToString(); - InvokeAsync(StateHasChanged); - } - }, buffered: false); - - await performance.Mark("butil-demo-observed"); - perfObserverResult = "PerformanceObserver subscribed - mark created."; - } - - private async Task StopPerfObserver() - { - if (perfObserverSub is null) return; - await perfObserverSub.DisposeAsync(); - perfObserverSub = null; - } - - private async Task StorageEstimate() - { - var est = await storageManager.Estimate(); - storageResult = $"quota={est.Quota}, usage={est.Usage}"; - } - - private async Task NetworkStatus() - { - var status = await networkInformation.GetStatus(); - networkResult = $"online={status.Online}, type={status.EffectiveType ?? status.Type ?? "n/a"}, downlink={status.Downlink}, rtt={status.Rtt}"; - } - - private async Task BroadcastSubscribe() - { - await StopBroadcast(); - broadcastSub = await broadcastChannel.Subscribe("butil-demo-channel", msg => - { - broadcastResult = $"received -> {msg}"; - InvokeAsync(StateHasChanged); - }); - broadcastResult = "Subscribed to butil-demo-channel."; - } - - private async Task BroadcastPost() - { - await broadcastChannel.Post("butil-demo-channel", new { text = "hello from this tab", at = DateTimeOffset.Now }); - broadcastResult = "Posted (same tab won't receive its own message; open a second tab)."; - } - - private async Task StopBroadcast() - { - if (broadcastSub is null) return; - await broadcastSub.DisposeAsync(); - broadcastSub = null; - } - - private async Task IndexedDbRoundTrip() - { - await using var db = await indexedDb.Open("butil-demo-db", 1, - [ - new IndexedDbStoreSchema { Name = "items", KeyPath = "id" } - ]); - - var item = new DemoIdbItem { Id = "demo-1", Value = "stored at " + DateTimeOffset.Now.ToString("HH:mm:ss") }; - await db.Put("items", item); - var read = await db.Get("items", "demo-1"); - indexedDbResult = read?.Value ?? "(null)"; - } - - - protected override async ValueTask DisposeAsync(bool disposing) - { - if (intersectionSub is not null) - await intersectionSub.DisposeAsync(); - if (resizeSub is not null) - await resizeSub.DisposeAsync(); - if (mutationSub is not null) - await mutationSub.DisposeAsync(); - if (perfObserverSub is not null) - await perfObserverSub.DisposeAsync(); - if (broadcastSub is not null) - await broadcastSub.DisposeAsync(); - - await base.DisposeAsync(disposing); - } - - - // Public so System.Text.Json can materialize it via its public parameterless - // constructor in trimmed/published builds when db.Get deserializes. - public class DemoIdbItem - { - public string Id { get; set; } = ""; - public string Value { get; set; } = ""; - } - - - private readonly string intersectionExampleCode = -@"@inject IJSRuntime js - -
target
- -Observe -Stop - -
@intersectionResult
- -@code { - private ElementReference target; - private ButilSubscription? intersectionSub; - private string? intersectionResult; - - private async Task StartIntersection() - { - await StopIntersection(); - intersectionSub = await target.ObserveIntersection(js, entries => - { - if (entries.Length > 0) - { - intersectionResult = $""ratio={entries[0].IntersectionRatio:F2}, visible={entries[0].IsIntersecting}""; - InvokeAsync(StateHasChanged); - } - }); - } - - private async Task StopIntersection() - { - if (intersectionSub is null) return; - await intersectionSub.DisposeAsync(); - intersectionSub = null; - } -}"; - - private readonly string resizeExampleCode = -@"@inject IJSRuntime js - -
target
- -Observe -Grow target -Stop - -
@resizeResult
- -@code { - private int targetWidth = 120; - private ElementReference target; - private ButilSubscription? resizeSub; - private string? resizeResult; - - private async Task StartResize() - { - await StopResize(); - resizeSub = await target.ObserveResize(js, entries => - { - if (entries.Length > 0) - { - var rect = entries[0].ContentRect; - resizeResult = $""{rect?.Width:F0}x{rect?.Height:F0}""; - InvokeAsync(StateHasChanged); - } - }); - } - - private async Task GrowTarget() - { - targetWidth += 40; - await target.SetAttribute(""style"", $""width:{targetWidth}px;height:48px""); - } - - private async Task StopResize() - { - if (resizeSub is null) return; - await resizeSub.DisposeAsync(); - resizeSub = null; - } -}"; - - private readonly string mutationExampleCode = -@"@inject IJSRuntime js - -
target
- -Observe -Mutate attribute - -
@mutationResult
- -@code { - private ElementReference target; - private ButilSubscription? mutationSub; - private string? mutationResult; - - private async Task StartMutation() - { - await StopMutation(); - mutationSub = await target.ObserveMutations(js, records => - { - if (records.Length > 0) - { - mutationResult = $""{records[0].Type} on {records[0].TargetId ?? ""target""}""; - InvokeAsync(StateHasChanged); - } - }, new MutationObserverOptions { Attributes = true }); - } - - private async Task MutateTarget() - { - await target.SetAttribute(""data-butil"", Guid.NewGuid().ToString(""N"")[..8]); - } - - private async Task StopMutation() - { - if (mutationSub is null) return; - await mutationSub.DisposeAsync(); - mutationSub = null; - } -}"; - - private readonly string perfMeasureExampleCode = -@"@inject Bit.Butil.Performance performance - -Mark + Measure - -
@perfMeasureResult
- -@code { - private string? perfMeasureResult; - - private async Task PerfMarkMeasure() - { - await performance.Mark(""butil-demo-a""); - await Task.Delay(50); - await performance.Mark(""butil-demo-b""); - await performance.Measure(""butil-demo-measure"", ""butil-demo-a"", ""butil-demo-b""); - var entries = await performance.GetEntries(""butil-demo-measure"", ""measure""); - perfMeasureResult = entries.Length > 0 ? entries[0].ToString() : ""(no entry)""; - } -}"; - - private readonly string perfObserverExampleCode = -@"@inject Bit.Butil.Performance performance - -SubscribeObserver - -
@perfObserverResult
- -@code { - private ButilSubscription? perfObserverSub; - private string? perfObserverResult; - - private async Task PerfObserver() - { - await StopPerfObserver(); - perfObserverSub = await performance.SubscribeObserver([""mark""], entries => - { - if (entries.Length > 0) - { - perfObserverResult = entries[0].ToString(); - InvokeAsync(StateHasChanged); - } - }, buffered: false); - - await performance.Mark(""butil-demo-observed""); - } - - private async Task StopPerfObserver() - { - if (perfObserverSub is null) return; - await perfObserverSub.DisposeAsync(); - perfObserverSub = null; - } -}"; - - private readonly string storageExampleCode = -@"@inject Bit.Butil.StorageManager storageManager - -Estimate - -
@storageResult
- -@code { - private string? storageResult; - - private async Task StorageEstimate() - { - var est = await storageManager.Estimate(); - storageResult = $""quota={est.Quota}, usage={est.Usage}""; - } -}"; - - private readonly string networkExampleCode = -@"@inject Bit.Butil.NetworkInformation networkInformation - -GetStatus - -
@networkResult
- -@code { - private string? networkResult; - - private async Task NetworkStatus() - { - var status = await networkInformation.GetStatus(); - networkResult = $""online={status.Online}, type={status.EffectiveType}, downlink={status.Downlink}, rtt={status.Rtt}""; - } -}"; - - private readonly string broadcastExampleCode = -@"@inject Bit.Butil.BroadcastChannel broadcastChannel - -Subscribe -Post - -
@broadcastResult
- -@code { - private ButilSubscription? broadcastSub; - private string? broadcastResult; - - private async Task BroadcastSubscribe() - { - await StopBroadcast(); - broadcastSub = await broadcastChannel.Subscribe(""butil-demo-channel"", msg => - { - broadcastResult = $""received -> {msg}""; - InvokeAsync(StateHasChanged); - }); - } - - private async Task BroadcastPost() - { - await broadcastChannel.Post(""butil-demo-channel"", new { text = ""hello from this tab"", at = DateTime.Now }); - } - - private async Task StopBroadcast() - { - if (broadcastSub is null) return; - await broadcastSub.DisposeAsync(); - broadcastSub = null; - } -}"; - - private readonly string indexedDbExampleCode = -@"@inject Bit.Butil.IndexedDb indexedDb - -Round-trip - -
@indexedDbResult
- -@code { - private string? indexedDbResult; - - private class DemoIdbItem - { - public string Id { get; set; } = """"; - public string Value { get; set; } = """"; - } - - private async Task IndexedDbRoundTrip() - { - await using var db = await indexedDb.Open(""butil-demo-db"", 1, - [ - new IndexedDbStoreSchema { Name = ""items"", KeyPath = ""id"" } - ]); - - var item = new DemoIdbItem { Id = ""demo-1"", Value = ""stored at "" + DateTime.Now.ToString(""HH:mm:ss"") }; - await db.Put(""items"", item); - var read = await db.Get(""items"", ""demo-1""); - indexedDbResult = read?.Value ?? ""(null)""; - } -}"; -} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil29ObserversPage.razor.scss b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil29ObserversPage.razor.scss deleted file mode 100644 index dc4b53c541b..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil29ObserversPage.razor.scss +++ /dev/null @@ -1,16 +0,0 @@ -@import '../../Styles/abstracts/_colors.scss'; -@import '../../Styles/abstracts/_mixins.scss'; -@import '../../Styles/abstracts/_functions.scss'; -@import '../../Styles/abstracts/_media-queries.scss'; - -.page-container { - @include PageContainer; -} - -.section-card { - @include SectionCard; -} - -.section-card-txt { - @include SectionCardText; -} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/ContactUsPage.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/ContactUsPage.razor index ae7d7c6b357..19ab9a585fc 100644 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/ContactUsPage.razor +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/ContactUsPage.razor @@ -2,8 +2,8 @@ @inherits AppComponentBase + Title="Contact us" + Description="Get in touch with the bit platform team for questions, feedback, or project inquiries." />
@@ -45,6 +45,13 @@ Placeholder="Enter your message" /> + @if (isSent) + { + + Thank you! Your message has been sent. We will get back to you soon. + + } + Send @@ -54,7 +61,7 @@ Color="BitColor.Tertiary" Variant="BitVariant.Text" ButtonType="BitButtonType.Button" - OnClick="() => contactUsModel = new()"> + OnClick="ResetForm"> Reset diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/ContactUsPage.razor.cs b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/ContactUsPage.razor.cs index 264588f2b75..5e433b971ea 100644 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/ContactUsPage.razor.cs +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/ContactUsPage.razor.cs @@ -4,21 +4,30 @@ namespace Bit.Websites.Platform.Client.Pages; public partial class ContactUsPage { - private ContactUsDto contactUsModel { get; set; } = new(); + private bool isSent; + private bool isSending; + private ContactUsDto contactUsModel = new(); - private bool isSending { get; set; } + private void ResetForm() + { + isSent = false; + contactUsModel = new(); + } private async Task SendMessage() { if (isSending) return; isSending = true; + isSent = false; try { + // ExceptionDelegatingHandler in the HttpClient pipeline throws a typed exception on any + // non-success response; WrapHandled on the form's OnValidSubmit surfaces its message. await HttpClient.PostAsJsonAsync("api/ContactUs/SendMessage", contactUsModel, AppJsonContext.Default.ContactUsDto); - contactUsModel.Email = ""; - contactUsModel.Message = ""; + contactUsModel = new(); + isSent = true; } finally { diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/CustomerCarousel.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/CustomerCarousel.razor index 597b52675e5..2fde8368de4 100644 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/CustomerCarousel.razor +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/CustomerCarousel.razor @@ -2,7 +2,7 @@ - + RIGID Robotics Offers a unified and scalable Cloud Platform and Applications that gather Data in Real-time from its Sensors @@ -12,7 +12,7 @@ - + CrystaCode CrystaCode lets anyone create a real, working AI agent just by talking. No coding, no setup, @@ -22,7 +22,7 @@ - + Antargyan Serving over 450,000 students and 500+ educators, Antargyan is known for its innovative RioPlay platform. @@ -32,7 +32,7 @@ - + Functionland Want to own your files, literally? This is something that will not happen ever on traditional cloud services. diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/CustomerCarousel.razor.scss b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/CustomerCarousel.razor.scss index 92191f378ea..5910865a165 100644 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/CustomerCarousel.razor.scss +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/CustomerCarousel.razor.scss @@ -21,6 +21,7 @@ } .text-subtitle { + line-height: 1.5; font-size: 2.25rem; text-align: center; color: $bit-color-foreground-secondary; diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/DemosPage.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/DemosPage.razor index f65b8ae5a98..0051ad56eb4 100644 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/DemosPage.razor +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/DemosPage.razor @@ -27,7 +27,7 @@
- Open source❤️ + Open source ❤️ Full stack Cross platform Multi-Tenant @@ -68,7 +68,7 @@
- + From active shovels in Canadian mines to logistics drivers in Sweden, over 450K students in India, platform to maintain 3D information of 4M house units, these are just a few of the groundbreaking software projects built on the bitplatform! @@ -77,34 +77,29 @@
- + Boilerplate

- + The bit Boilerplate is a feature-packed project template that accelerates your development.

- - @*
-
*@




- + The source code is yours to explore and modify! Deploy it on your own server or any cloud platform you choose.
Check out the following fully functional demo apps to see the Boilerplate in action across various platforms. @@ -114,7 +109,7 @@



- AdminPanel + AdminPanel Need a robust back-office or admin panel?
@@ -123,64 +118,64 @@
- Sales (still shaping up) + Sales (preview) See the speed of a website built with our Boilerplate.
- Sales sample - Sales sample + Sales sample + Sales sample
- PWA - Android - iOS - macOS - Windows + PWA + Android + iOS - macOS + Windows
- Todo + Todo Experience the rapid performance of our sample app on mobile, desktop, and web, all built with our Boilerplate.
- + Platform website

- + Experience the blazing speed of bitplatform.dev.
This site was built using our own product, showcasing the exceptional performance you can achieve for your projects. @@ -188,40 +183,40 @@
- + BlazorUI

- + A lightweight yet powerful component library for C# developers.
- It’s ideal for building consumer-facing apps and websites that are fast, responsive, and optimized for both desktop and mobile. + It's ideal for building consumer-facing apps and websites that are fast, responsive, and optimized for both desktop and mobile.

diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/DemosPage.razor.scss b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/DemosPage.razor.scss index 89a671dfa83..bd36501d0a7 100644 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/DemosPage.razor.scss +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/DemosPage.razor.scss @@ -81,24 +81,12 @@ } } +// Visibility (dark-image/light-image classes) is owned by the global themed utilities in app.scss. .template-img { width: 100%; - display: none; border: 1px solid $bit-color-border-secondary; } -.bit-platform-dark-theme { - .dark-image { - display: unset; - } -} - -.bit-platform-light-theme { - .light-image { - display: unset; - } -} - .primary-btn { border: 0; outline: 0; @@ -116,18 +104,17 @@ border-radius: rem2(4px); margin-bottom: rem2(8px); padding: rem2(12px) rem2(16px); - color: $White; - background-color: $B6Color; + color: $bit-color-primary-text; + background-color: $bit-color-primary; &:hover { - background-color: #0052cc; + background-color: $bit-color-primary-hover; } } .secondary-btn { outline: 0; width: 100%; - color: #1976d2; cursor: pointer; font-weight: 600; line-height: 1.2; @@ -141,16 +128,18 @@ border-radius: rem2(4px); margin-bottom: rem2(8px); justify-content: center; - background-color: $White; padding: rem2(12px) rem2(16px); - border: rem2(1px) solid #bdbdbd; + color: $bit-color-primary; + background-color: $bit-color-background-primary; + border: rem2(1px) solid $bit-color-border-secondary; &.disabled { - color: gray; + cursor: default; + color: $bit-color-foreground-secondary; } &:hover { - background-color: #ccc; + background-color: $bit-color-background-primary-hover; } } @@ -265,4 +254,4 @@ -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-image: linear-gradient(351deg, #31b3ec 23%, #524add 87%); -} \ No newline at end of file +} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Home/HomePage.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Home/HomePage.razor index b99a4154547..851a2dfc059 100644 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Home/HomePage.razor +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Home/HomePage.razor @@ -2,16 +2,17 @@ @inherits AppComponentBase + Title="Build cross-platform .NET & Blazor apps" + Description="Build web, mobile, and desktop apps from a single C# codebase with open-source tools: BlazorUI components, the Boilerplate project template, Bswup, Butil, Besql, Brouter, and Bmotion."> +
- - + +
-
+
bit platform @@ -20,6 +21,10 @@
using what you already know and love +
@@ -46,7 +51,30 @@
- + bit platform apps running on web, mobile, and desktop + +
+
+
+
+ 10M+ + NuGet downloads +
+
+ 1.3K+ + GitHub stars +
+
+ 150+ + Contributors +
+
+ 80+ + UI components +
+
+
+
@@ -101,16 +129,16 @@



- - - - - + + + + + - +


@@ -138,4 +166,24 @@
+ +
+
+ + start building today + +
+ + Free and open source. MIT licensed. No sign-up required. + +
+
+ dotnet new install Bit.Boilerplate +
+ +
+
diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Home/HomePage.razor.cs b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Home/HomePage.razor.cs index a2b8a2e9b2e..667cc64cf13 100644 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Home/HomePage.razor.cs +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Home/HomePage.razor.cs @@ -5,9 +5,29 @@ namespace Bit.Websites.Platform.Client.Pages.Home; public partial class HomePage { private const string OUR_PRODUCTS_SECTION_ID = "our-products"; + private const string HERO_INTRO_STATE_KEY = "home-hero-intro"; + + private bool animateHeroIntro = true; private ElementReference ourProductsRef = default!; + protected override async Task OnInitAsync() + { + // The prerendered markup plays the hero intro the moment it paints, and then the wasm app comes up, + // throws that DOM away and rebuilds it - which replayed the animation from the start. + // Prerender state is handed back to the client exactly once, on that boot render, so getting a value + // out of it is the signal that the intro has already been seen and this render has to skip it. + // Later client-side navigations back to the home page find nothing stored and animate as usual. + var restoredFromPrerenderState = true; + await PrerenderStateService.GetValue(HERO_INTRO_STATE_KEY, () => + { + restoredFromPrerenderState = false; + return Task.FromResult(true); + }); + + animateHeroIntro = restoredFromPrerenderState is false; + } + protected override async Task OnAfterFirstRenderAsync() { if (NavigationManager.Uri.Contains(OUR_PRODUCTS_SECTION_ID)) @@ -15,4 +35,9 @@ protected override async Task OnAfterFirstRenderAsync() await ourProductsRef.ScrollIntoView(); } } + + private async Task ScrollToProducts() + { + await ourProductsRef.ScrollIntoView(new ScrollIntoViewOptions { Behavior = ScrollBehavior.Smooth }); + } } diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Home/HomePage.razor.scss b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Home/HomePage.razor.scss index 8c428fb071c..40b147c23d1 100644 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Home/HomePage.razor.scss +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Home/HomePage.razor.scss @@ -1,5 +1,6 @@ @import '../../Styles/abstracts/_vars.scss'; @import '../../Styles/abstracts/_colors.scss'; +@import '../../Styles/abstracts/_mixins.scss'; @import '../../Styles/abstracts/_functions.scss'; @import '../../Styles/abstracts/_media-queries.scss'; @import '../../Styles/abstracts/_bit-css-variables.scss'; @@ -13,10 +14,10 @@ flex-flow: column nowrap; justify-content: flex-start; + // Visibility (dark-theme/light-theme classes) is owned by the global themed utilities in app.scss. .hero-gradient { top: 0; left: 50%; - display: none; max-width: 70rem; position: absolute; transform: translate(-50%, -10%); @@ -45,18 +46,7 @@ margin: auto; padding: 1rem; max-width: rem2(800px); - } -} - -.bit-platform-dark-theme { - .dark-theme { - display: unset; - } -} - -.bit-platform-light-theme { - .light-theme { - display: unset; + filter: drop-shadow(0 24px 48px rgba(24, 120, 253, 0.18)); } } @@ -100,6 +90,9 @@ ::deep .section-title { font-size: 1rem; + font-weight: 600; + white-space: nowrap; + letter-spacing: 0.25em; text-transform: uppercase; color: $bit-color-foreground-secondary; } @@ -155,9 +148,22 @@ .hero-subtitle { text-align: center; + color: $bit-color-foreground-secondary; } } + .hero-cta-container { + gap: 1rem; + display: flex; + flex-wrap: wrap; + margin-top: 3rem; + justify-content: center; + } + + .hero-cta { + @include GradientCtaButton; + } + @include lt-lg { padding-top: 4rem; @@ -203,8 +209,9 @@ font-size: 6rem; line-height: 1.1; font-weight: 600; - text-align:center; + text-align: center; margin-bottom: 2rem; + letter-spacing: -0.02em; @include lt-xl { font-size: 5rem; @@ -227,6 +234,7 @@ } .text-subtitle { + line-height: 1.5; font-size: 2.25rem; text-align: center; color: $bit-color-foreground-secondary; @@ -254,6 +262,72 @@ } } +.stats-section { + padding-top: 2rem; + padding-bottom: 2rem; + + .stats-list { + display: flex; + flex-wrap: wrap; + gap: 2rem 4rem; + justify-content: center; + } + + .stats-item { + gap: 0.5rem; + display: flex; + align-items: center; + flex-flow: column nowrap; + } + + .stats-number { + font-size: 3rem; + font-weight: 700; + line-height: 1.1; + background-clip: text; + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; + background-image: linear-gradient(351deg, #31b3ec 23%, #524add 87%); + + @include lt-md { + font-size: 2rem; + } + } + + .stats-label { + font-size: 1rem; + color: $bit-color-foreground-secondary; + } +} + +.cta-section { + text-align: center; + + .page-section-content { + display: flex; + align-items: center; + flex-flow: column nowrap; + } + + .cta-command { + width: 100%; + max-width: rem2(480px); + text-align: left; + } + + .cta-buttons { + gap: 1rem; + display: flex; + flex-wrap: wrap; + margin-top: 2rem; + justify-content: center; + } + + .cta-btn { + @include GradientCtaButton; + } +} + .products-section { padding-top: 0; scroll-margin: 5rem; @@ -269,12 +343,6 @@ } ::deep { - .tech-title { - @include lt-md { - font-size: 2.5rem; - } - } - .tech-subtitle { @include lt-md { font-size: 1.25rem; @@ -298,9 +366,22 @@ width: rem2(70px); height: rem2(70px); margin: rem2(20px); + border-radius: 0.5rem; background-size: contain; background-position: center; background-repeat: no-repeat; + transition: transform 0.2s $MotionEase, filter 0.2s $MotionEase; + + &:hover, + &:focus-visible { + transform: translateY(-6px) scale(1.08); + filter: drop-shadow(0 10px 16px rgba(82, 74, 221, 0.35)); + } + + &:focus-visible { + outline: 2px solid $bit-color-primary; + outline-offset: 4px; + } } .blazor-item { @@ -330,5 +411,55 @@ } } -.customer-section { +// animate-intro is off on the render that replaces the prerendered markup: that DOM already played the +// intro, so replaying it there would show the whole hero fade in twice (see HomePage.razor.cs). +.hero-section-content.animate-intro { + + ::deep .hero-title, + ::deep .hero-subtitle, + .hero-cta-container { + animation: hero-enter 0.7s ease-out both; + } + + ::deep .hero-subtitle { + animation-delay: 0.15s; + } + + .hero-cta-container { + animation-delay: 0.3s; + } +} + +@supports (animation-timeline: view()) { + + .page-container .hero-image, + .page-section:not(.hero-section) .page-section-content { + animation: section-reveal linear both; + animation-timeline: view(); + animation-range: entry 5% entry 45%; + } } + +@keyframes hero-enter { + from { + opacity: 0; + transform: translateY(1.5rem); + } + + to { + opacity: 1; + transform: translateY(0); + } +} + +@keyframes section-reveal { + from { + opacity: 0; + transform: translateY(2rem); + } + + to { + opacity: 1; + transform: translateY(0); + } +} \ No newline at end of file diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Home/Products.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Home/Products.razor index c39c09d3ae4..3119a53bf80 100644 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Home/Products.razor +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Home/Products.razor @@ -1,19 +1,47 @@ @inherits AppComponentBase
- - -
- -
- Boilerplate - Feature-rich .NET project template + @for (var i = 0; i < products.Length; i++) + { + var product = products[i]; + + @if (i > 0) + { +
+ } + + +
+ +
+ @product.Title + @product.Subtitle +
-
- - -
+ + +
+ @product.Body + + Learn more + +
+
+ + } +
+ +@code { + private readonly ProductAccordionItem[] products = + [ + new() + { + Title = "Boilerplate", + Subtitle = "Feature-rich .NET project template", + LinkUrl = Urls.Templates, + IsExpanded = true, + Body = @ - bit Boilerplate is a Visual studio and .NET project template that enables high-quality, speedy cross-platform development + bit Boilerplate is a Visual Studio and .NET project template that enables high-quality, speedy cross-platform development for PWA/SSR enabled websites and Android, iOS, macOS, Windows apps.
@@ -26,27 +54,15 @@ admin sales --name MyAwesomeProject
- - Learn more - -
- -
-
- - -
- -
- Butil - - Blazor utilities to use browser JS APIs in C# - -
-
-
- -
+ + }, + new() + { + Title = "Butil", + Subtitle = "Blazor utilities to use browser JS APIs in C#", + LinkUrl = Urls.Butil, + External = true, + Body = @ bit Butil helps C# developers to access the browser APIs that are only accessible through JavaScript in C#. @@ -57,79 +73,85 @@ var encryptedBytes = await crypto.Encrypt(CryptoAlgorithm.AesCbc, key, textAsUtf8Bytes, iv: iv); }
- - Learn more - -
- - -
- - -
- -
- Bswup - - Blazor PWA on steroids - -
-
-
- -
+ + }, + new() + { + Title = "Bswup", + Subtitle = "Blazor PWA on steroids", + LinkUrl = Urls.Bswup, + External = true, + Body = @ bit Bswup is a set of tools that assists developers in making the most out of the Service Worker when building apps with Blazor.
- + bit Bswup service worker update flow in a Blazor PWA

- - Learn more - -
-
-
-
- - -
- -
- Besql - Blazor Entity Framework SQLite -
-
-
- -
+ + }, + new() + { + Title = "Besql", + Subtitle = "Blazor Entity Framework SQLite", + LinkUrl = Urls.Besql, + Body = @ bit Besql facilitates the use of Entity Framework and SQLite in web browsers with Blazor WebAssembly.
services.AddBesqlDbContextFactory();
- - Learn more - -
-
-
-
- - -
- + + }, + new() + { + Title = "Brouter", + Subtitle = "Modern declarative Blazor router", + LinkUrl = Urls.Brouter, + External = true, + Body = @ + + bit Brouter is a modern, declarative, nestable router for Blazor with async guards, data loaders, + named routes, programmatic navigation, query string binding, and global navigation hooks. + +
+ <Brouter NotFoundUrl="404"> + <Broute Path="/" RedirectTo="/home" /> + <Broute Name="home" Path="/home"> + <Content><HomePage /></Content> + </Broute> + <Broute Name="user" Path="/users/{id:int}" Component="@@typeof(UserPage)" /> +</Brouter> +
+
+ }, + new() + { + Title = "Bmotion", + Subtitle = "Blazor-native animation library", + LinkUrl = Urls.Bmotion, + External = true, + Body = @ + + bit Bmotion is a Blazor-native animation library with springs, gestures, keyframes, variants, drag, + layout animations, shared-element transitions and exit animations, no manual JavaScript wiring required. +
- BlazorUI - Native Blazor UI components + <Bmotion Initial="Bm.To(opacity: 0, y: 20)" + Animate="Bm.To(opacity: 1, y: 0)">
-
-
- -
+ + }, + new() + { + Title = "BlazorUI", + Subtitle = "Native Blazor UI components", + LinkUrl = Urls.BlazorUI, + External = true, + Body = @ bit BlazorUI components are native, easy-to-customize, and work seamlessly in all interactive Blazor modes (WASM, Server, Hybrid, pre-rendering), saving you time and making development enjoyable. @@ -142,10 +164,7 @@ Combo Chips Dynamic Responsive OnDynamicAdd="(BitDropdownItem<string> item) => HandleOnDynamicAdd(item)" />
- - Learn more - - -
-
- \ No newline at end of file + + }, + ]; +} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Home/Products.razor.cs b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Home/Products.razor.cs index 6a37cb287ad..79c8bed8faf 100644 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Home/Products.razor.cs +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Home/Products.razor.cs @@ -2,9 +2,13 @@ public partial class Products { - private bool _boilerplateExpanded = true; - private bool _butilExpanded; - private bool _bswupExpanded; - private bool _besqlExpanded; - private bool _blazoruiExpanded; + private sealed class ProductAccordionItem + { + public required string Title { get; init; } + public required string Subtitle { get; init; } + public required string LinkUrl { get; init; } + public bool External { get; init; } + public bool IsExpanded { get; set; } + public required RenderFragment Body { get; init; } + } } diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Home/Products.razor.scss b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Home/Products.razor.scss index f5f19066ef5..92d7918aef6 100644 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Home/Products.razor.scss +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Home/Products.razor.scss @@ -1,8 +1,12 @@ +@import '../../Styles/abstracts/_vars.scss'; @import '../../Styles/abstracts/_mixins.scss'; @import '../../Styles/abstracts/_functions.scss'; ::deep .accordion { - border: none; + overflow: hidden; + border-radius: 0.75rem; + border: 1px solid $bit-color-border-secondary; + transition: border-color 0.2s $MotionEase, box-shadow 0.2s $MotionEase, background-color 0.2s $MotionEase; .bit-acd-hdr, .bit-acd-con { @@ -14,7 +18,14 @@ padding-top: 0; } + &:hover { + border-color: $bit-color-border-primary; + background-color: $bit-color-background-secondary; + box-shadow: 0 12px 32px -20px rgba(82, 74, 221, 0.5); + } + &.expanded { + border-color: $bit-color-border-primary; background-color: $bit-color-background-secondary; } } @@ -25,15 +36,12 @@ padding: 1rem; align-items: flex-start; - &:hover { - background-color: $bit-color-background-secondary; - } - ::deep { .header-icon { font-size: 1.25rem; margin-top: 0.8rem; margin-right: 0.625rem; + transition: transform 0.2s $MotionEase; @include lt-lg { font-size: 1rem; @@ -121,8 +129,10 @@ flex-wrap: wrap; align-items: center; margin: rem2(25px) 0; - border-radius: rem2(4px); + border-radius: rem2(8px); background-color: #060e2d; + border: 1px solid rgba(140, 133, 255, 0.25); + box-shadow: 0 16px 40px -24px rgba(6, 14, 45, 0.9); @include lt-md { padding: 1.5rem; @@ -141,9 +151,6 @@ .animation-container { display: flex; position: relative; - - * { - } } .animated { @@ -157,14 +164,6 @@ position: absolute; } - .a-1 { - animation-duration: 8s; - } - - .d-1 { - animation-delay: 4s; - } - .a-2 { animation-duration: 6s; } diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Lcnc/Lcnc01OverviewPage.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Lcnc/Lcnc01OverviewPage.razor index 3df732952cc..c995cbd1e6a 100644 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Lcnc/Lcnc01OverviewPage.razor +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Lcnc/Lcnc01OverviewPage.razor @@ -1,12 +1,12 @@ @page "/lowcode-nocode/overview" @inherits AppComponentBase - -
- Low-code No-code +
+ Low-code No-code The low-code no-code platform of the bit platform is a plate to bake any application. @@ -15,4 +15,4 @@
- + diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Lcnc/Lcnc01OverviewPage.razor.scss b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Lcnc/Lcnc01OverviewPage.razor.scss deleted file mode 100644 index 8e7839faad0..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Lcnc/Lcnc01OverviewPage.razor.scss +++ /dev/null @@ -1,16 +0,0 @@ -@import '../../Styles/abstracts/_colors.scss'; -@import '../../Styles/abstracts/_mixins.scss'; -@import '../../Styles/abstracts/_functions.scss'; -@import '../../Styles/abstracts/_media-queries.scss'; - -.page-container { - @include PageContainer; - display: flex; - flex-flow: column; -} - -.video-container { - width: 100%; - display: flex; - justify-content: center; -} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Lcnc/Lcnc02BenefitsPage.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Lcnc/Lcnc02BenefitsPage.razor index 519d92a5673..c2af96f45dd 100644 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Lcnc/Lcnc02BenefitsPage.razor +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Lcnc/Lcnc02BenefitsPage.razor @@ -1,12 +1,12 @@ @page "/lowcode-nocode/benefits" @inherits AppComponentBase - -
- Benefits +
+ Benefits Benefits @@ -15,4 +15,4 @@
- + diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Lcnc/Lcnc02BenefitsPage.razor.scss b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Lcnc/Lcnc02BenefitsPage.razor.scss deleted file mode 100644 index 8e7839faad0..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Lcnc/Lcnc02BenefitsPage.razor.scss +++ /dev/null @@ -1,16 +0,0 @@ -@import '../../Styles/abstracts/_colors.scss'; -@import '../../Styles/abstracts/_mixins.scss'; -@import '../../Styles/abstracts/_functions.scss'; -@import '../../Styles/abstracts/_media-queries.scss'; - -.page-container { - @include PageContainer; - display: flex; - flex-flow: column; -} - -.video-container { - width: 100%; - display: flex; - justify-content: center; -} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Lcnc/Lcnc03SpecsPage.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Lcnc/Lcnc03SpecsPage.razor index 78f4efe4d0f..186e892ea1a 100644 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Lcnc/Lcnc03SpecsPage.razor +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Lcnc/Lcnc03SpecsPage.razor @@ -1,12 +1,12 @@ @page "/lowcode-nocode/specs" @inherits AppComponentBase - -
- Specifications +
+ Specifications OOTB Specifications @@ -24,4 +24,4 @@
- + diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Lcnc/Lcnc03SpecsPage.razor.scss b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Lcnc/Lcnc03SpecsPage.razor.scss deleted file mode 100644 index 8e7839faad0..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Lcnc/Lcnc03SpecsPage.razor.scss +++ /dev/null @@ -1,16 +0,0 @@ -@import '../../Styles/abstracts/_colors.scss'; -@import '../../Styles/abstracts/_mixins.scss'; -@import '../../Styles/abstracts/_functions.scss'; -@import '../../Styles/abstracts/_media-queries.scss'; - -.page-container { - @include PageContainer; - display: flex; - flex-flow: column; -} - -.video-container { - width: 100%; - display: flex; - justify-content: center; -} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Lcnc/Lcnc04CustomizationsPage.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Lcnc/Lcnc04CustomizationsPage.razor index 455d6a60961..8f293548d9f 100644 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Lcnc/Lcnc04CustomizationsPage.razor +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Lcnc/Lcnc04CustomizationsPage.razor @@ -1,12 +1,12 @@ @page "/lowcode-nocode/customizations" @inherits AppComponentBase - -
- Customizations +
+ Customizations Customizations @@ -19,4 +19,4 @@
- + diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Lcnc/Lcnc04CustomizationsPage.razor.scss b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Lcnc/Lcnc04CustomizationsPage.razor.scss deleted file mode 100644 index 8e7839faad0..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Lcnc/Lcnc04CustomizationsPage.razor.scss +++ /dev/null @@ -1,16 +0,0 @@ -@import '../../Styles/abstracts/_colors.scss'; -@import '../../Styles/abstracts/_mixins.scss'; -@import '../../Styles/abstracts/_functions.scss'; -@import '../../Styles/abstracts/_media-queries.scss'; - -.page-container { - @include PageContainer; - display: flex; - flex-flow: column; -} - -.video-container { - width: 100%; - display: flex; - justify-content: center; -} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Lcnc/Lcnc05ComparisonPage.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Lcnc/Lcnc05ComparisonPage.razor index 9318ae1cc4a..28d71055eda 100644 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Lcnc/Lcnc05ComparisonPage.razor +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Lcnc/Lcnc05ComparisonPage.razor @@ -1,12 +1,12 @@ @page "/lowcode-nocode/comparison" @inherits AppComponentBase - -
- Comparison +
+ Comparison Comparison @@ -22,4 +22,4 @@
- + diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Lcnc/Lcnc05ComparisonPage.razor.scss b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Lcnc/Lcnc05ComparisonPage.razor.scss deleted file mode 100644 index 8e7839faad0..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Lcnc/Lcnc05ComparisonPage.razor.scss +++ /dev/null @@ -1,16 +0,0 @@ -@import '../../Styles/abstracts/_colors.scss'; -@import '../../Styles/abstracts/_mixins.scss'; -@import '../../Styles/abstracts/_functions.scss'; -@import '../../Styles/abstracts/_media-queries.scss'; - -.page-container { - @include PageContainer; - display: flex; - flex-flow: column; -} - -.video-container { - width: 100%; - display: flex; - justify-content: center; -} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Lcnc/Lcnc06StatsPage.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Lcnc/Lcnc06StatsPage.razor index 2beac86d9f5..54864a21017 100644 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Lcnc/Lcnc06StatsPage.razor +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Lcnc/Lcnc06StatsPage.razor @@ -1,12 +1,12 @@ @page "/lowcode-nocode/stats" @inherits AppComponentBase - -
- Statistics +
+ Statistics Statistics diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Lcnc/Lcnc06StatsPage.razor.scss b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Lcnc/Lcnc06StatsPage.razor.scss deleted file mode 100644 index 8e7839faad0..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Lcnc/Lcnc06StatsPage.razor.scss +++ /dev/null @@ -1,16 +0,0 @@ -@import '../../Styles/abstracts/_colors.scss'; -@import '../../Styles/abstracts/_mixins.scss'; -@import '../../Styles/abstracts/_functions.scss'; -@import '../../Styles/abstracts/_media-queries.scss'; - -.page-container { - @include PageContainer; - display: flex; - flex-flow: column; -} - -.video-container { - width: 100%; - display: flex; - justify-content: center; -} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Lcnc/LcncPage.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Lcnc/LcncPage.razor index 94a4a67a161..fcfeec31e95 100644 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Lcnc/LcncPage.razor +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Lcnc/LcncPage.razor @@ -3,7 +3,7 @@ + Description="The bit low-code no-code platform (private alpha): visually build .NET & Blazor apps and export human-readable C# code at any time." />
@@ -23,8 +23,8 @@
- - What can i build? + + What can I build?
@@ -35,26 +35,26 @@ open-source modules
- +
AdminPanel module: - PWA - iOS - macOS - Android - Windows + PWA + iOS + macOS + Android + Windows
Sales module: - PWA + PWA
80+ UI components: - PWA - iOS - macOS - Android - Windows + PWA + iOS + macOS + Android + Windows
@@ -63,7 +63,7 @@
- + Specifications
@@ -77,7 +77,7 @@ out of the box

- +
Super-optimized Dark & Light theme @@ -95,7 +95,7 @@
- + Comparisons
@@ -105,7 +105,7 @@ a unique Approach


- +
Secure by default
@@ -126,7 +126,7 @@
- + Statistics
@@ -136,9 +136,9 @@ our progress and stats

- +
-
+9M NuGet downloads
+
+10M NuGet downloads
+1.3K GitHub stars
+150 contributors
diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/NotFoundPage.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/NotFoundPage.razor index 8d51e4efc13..a9d2f6f5880 100644 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/NotFoundPage.razor +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/NotFoundPage.razor @@ -2,11 +2,23 @@ @inherits AppComponentBase - + + + 404 - There is nothing here: [@Url] + There is nothing here: [@Url] + Here are some helpful links instead: + + Home + Boilerplate + Demos + Pricing + Contact us + @code { [SupplyParameterFromQuery(Name = "url")] public string? Url { get; set; } -} \ No newline at end of file +} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/PricingPage.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/PricingPage.razor index f2e145aefc8..3ef34e569bb 100644 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/PricingPage.razor +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/PricingPage.razor @@ -3,7 +3,7 @@ + Description="bit platform is free and open source. Optional paid support packages give your team direct access to the bit core developers." />
@@ -45,23 +45,23 @@
- + MIT License
- + Unlimited commercial apps
- + Access to all components
- + Access to all project templates
- + Open-source support (GitHub issues)
@@ -81,27 +81,27 @@
- + Expert-Led Workshops
- + Focused Code Reviews
- + Performance / Security Consultation
- + Custom feature Development
- + Implement Design System / Theme
- + Priority support

@@ -128,7 +128,7 @@ else { - + Contact sale team Buying the commercial package @@ -151,4 +151,4 @@ } -
\ No newline at end of file +
diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/PricingPage.razor.cs b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/PricingPage.razor.cs index 06a4f6ad0f8..ef88091fb4a 100644 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/PricingPage.razor.cs +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/PricingPage.razor.cs @@ -30,12 +30,14 @@ private async Task SendMessage() try { + // ExceptionDelegatingHandler in the HttpClient pipeline throws a typed exception on any + // non-success response; WrapHandled on the submit button surfaces its message. await HttpClient.PostAsJsonAsync("api/SupportPackage/BuyPackage", buyPackageModel, AppJsonContext.Default.BuyPackageDto); + isSent = true; } finally { isSending = false; - isSent = true; } } } diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/PricingPage.razor.scss b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/PricingPage.razor.scss index 8eb86dad7e7..d68eb3c1aef 100644 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/PricingPage.razor.scss +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/PricingPage.razor.scss @@ -40,9 +40,6 @@ padding-bottom: rem2(80px); } -.main-section { -} - .mid-section { background: $bit-color-background-secondary; @@ -112,6 +109,11 @@ display: flex; text-align: left; align-items: baseline; + + ::deep .plan-check-icon { + font-size: rem2(18px); + color: $bit-color-primary; + } } } diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates01OverviewPage.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates01OverviewPage.razor index ddb892fef8c..bdeb7d6e088 100644 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates01OverviewPage.razor +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates01OverviewPage.razor @@ -1,15 +1,15 @@ -@page "/templates" +@page "/templates" @page "/templates/overview" @page "/boilerplate" @page "/boilerplate/overview" @inherits AppComponentBase - + Description="The bit Boilerplate project template is a production-ready .NET & Blazor foundation for building web, Android, iOS, Windows, and macOS apps from a single C# codebase." />
- bit Boilerplate + bit Boilerplate If our efforts in providing modern tooling have piqued your interest, dive into the Bit Boilerplate project template.
@@ -23,7 +23,7 @@


- @@ -94,7 +94,7 @@
  1. - Install latest .NET SDK + Install latest .NET SDK @if (devOS is "Linux") {
    @@ -112,7 +112,7 @@ rm $HOME/dotnet.tar.gz {
  2. Install python -
    Ensure the `python --version` command works. While Ubuntu comes with Python 3 pre-installed, you need to create a symbolic link to use the `python` command. Use the following command:
    +
    Ensure the python --version command works. While Ubuntu comes with Python 3 pre-installed, you need to create a symbolic link to use the python command. Use the following command:
    sudo apt update sudo apt install python-is-python3
  3. } @@ -152,8 +152,8 @@ rm $HOME/dotnet.tar.gz }
  4. -
    Install Bit Boilerplate project template
    - dotnet new install Bit.Boilerplate::10.5.0 +
    Install Bit Boilerplate project template
    + dotnet new install Bit.Boilerplate
  5. @if (showCrossPlatform && devOS is "Windows") { @@ -176,7 +176,7 @@ rm $HOME/dotnet.tar.gz Make sure Virtualization is enabled on your system:
    - + Virtualization enabled in Windows Task Manager
  6. @@ -184,7 +184,7 @@ rm $HOME/dotnet.tar.gz

    - @@ -202,7 +202,7 @@ rm $HOME/dotnet.tar.gz
    @if (showCrossPlatform) { - VS Setup + Visual Studio installer workloads selection } } diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates03GettingStartedPage.razor.cs b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates02GettingStartedPage.razor.cs similarity index 97% rename from src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates03GettingStartedPage.razor.cs rename to src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates02GettingStartedPage.razor.cs index 9f4ee80f83b..a27a17e58a2 100644 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates03GettingStartedPage.razor.cs +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates02GettingStartedPage.razor.cs @@ -1,8 +1,8 @@ -using Bit.Butil; +using Bit.Butil; namespace Bit.Websites.Platform.Client.Pages.Templates; -public partial class Templates03GettingStartedPage +public partial class Templates02GettingStartedPage { [Inject] private Clipboard clipboard { get; set; } = default!; @@ -42,8 +42,8 @@ public partial class Templates03GettingStartedPage (text:@"echo 'Install Aspire CLI tool';", command:"dotnet tool install -g Aspire.Cli"), - (text:@"echo 'Install the Bit.Boilerplate project template https://www.nuget.org/packages/Boilerplate.Templates';", - command:"dotnet new install Bit.Boilerplate::10.5.0;") + (text:@"echo 'Install the Bit.Boilerplate project template https://www.nuget.org/packages/Bit.Boilerplate';", + command:"dotnet new install Bit.Boilerplate;") ]; if (enableVirtualization) diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates03GettingStartedPage.razor.scss b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates02GettingStartedPage.razor.scss similarity index 100% rename from src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates03GettingStartedPage.razor.scss rename to src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates02GettingStartedPage.razor.scss diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates02SamplesPage.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates02SamplesPage.razor deleted file mode 100644 index 9f8b6d72c83..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates02SamplesPage.razor +++ /dev/null @@ -1,73 +0,0 @@ -@page "/templates/samples" -@page "/boilerplate/samples" -@inherits AppComponentBase - - - -
    - Boilerplate Samples - - - We published a few apps using our own bit Boilerplate project template in different platforms. -
    - Two distinct samples that further explain the features in action are included in the project template: -
    - -
    -
    -
    - - AdminPanel sample -
    -
    - - - The AdminPanel sample is a project powered by bit Boilerplate that includes all the necessary parts to create a fully-featured cross-platform admin/management website/app. - -
    - - -
    - -
    -
    -
    - - Todo sample -
    -
    - - - The Todo sample is a project powered by Boilerplate that includes work packages and actions that you can apply to various cross-platform projects. - -
    - - -
    -
    - -

    - - diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates02SamplesPage.razor.scss b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates02SamplesPage.razor.scss deleted file mode 100644 index 78416fe6275..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates02SamplesPage.razor.scss +++ /dev/null @@ -1,192 +0,0 @@ -@import '../../Styles/abstracts/_colors.scss'; -@import '../../Styles/abstracts/_mixins.scss'; -@import '../../Styles/abstracts/_functions.scss'; -@import '../../Styles/abstracts/_media-queries.scss'; - -.page-container { - @include PageContainer; -} - -.page-flex-container { - width: 100%; - display: flex; - flex-flow: row wrap; - box-sizing: border-box; -} - -.page-content-container { - margin: 0; - flex-grow: 0; - max-width: 66%; - flex-basis: 66%; - flex-direction: row; - box-sizing: border-box; - - &:last-child { - max-width: 34%; - flex-basis: 34%; - padding-left: rem2(48px); - } - - @include lt-xl { - flex-grow: 0; - max-width: 100%; - flex-basis: 100%; - - &:last-child { - padding-left: 0; - max-width: 100%; - flex-basis: 100%; - padding-top: rem2(32px); - } - } -} - -.image-container { - position: relative; - padding: 50% 0 0 0; - margin-bottom: 1rem; - - .template-img { - top: 0; - width: 100%; - height: 100%; - color: #f5f5f5; - display: block; - position: absolute; - border-radius: rem2(8px); - background-color: #f5f5f5; - box-shadow: $bit-box-shadow-callout; - } - - .demo-btn-shadow { - top: 0; - left: 0; - right: 0; - bottom: 0; - opacity: 0; - display: flex; - position: absolute; - align-items: center; - justify-content: center; - border-radius: rem2(8px); - background-color: rgba(25, 118, 210, 0.6); - transition: opacity 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms; - } - - .demo-btn { - border: 0; - margin: 0; - outline: 0; - cursor: pointer; - font-weight: 500; - line-height: 1.2; - position: relative; - align-items: center; - display: inline-flex; - min-width: rem2(64px); - font-size: rem2(16px); - text-decoration: none; - box-sizing: border-box; - border-radius: rem2(4px); - justify-content: center; - padding: rem2(12px) rem2(16px); - transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms; - color: $White; - background-color: #1976d2; - - &:hover { - background-color: #0052cc; - } - } - - &:hover { - .demo-btn-shadow { - opacity: 1; - } - } -} - -.primary-btn { - border: 0; - outline: 0; - width: 100%; - cursor: pointer; - font-weight: 600; - line-height: 1.2; - position: relative; - align-items: center; - font-size: rem2(16px); - min-width: rem2(64px); - display: inline-flex; - text-decoration: none; - justify-content: center; - border-radius: rem2(4px); - margin-bottom: rem2(8px); - padding: rem2(12px) rem2(16px); - color: $White; - background-color: $B6Color; - - &:hover { - background-color: #0052cc; - } -} - -.secondary-btn { - outline: 0; - width: 100%; - cursor: pointer; - font-weight: 600; - line-height: 1.2; - position: relative; - align-items: center; - display: inline-flex; - font-size: rem2(16px); - min-width: rem2(64px); - text-decoration: none; - box-sizing: border-box; - border-radius: rem2(4px); - margin-bottom: rem2(8px); - justify-content: center; - padding: rem2(12px) rem2(16px); - border: rem2(1px) solid #bdbdbd; - color: #1976d2; - background-color: $White; - - &:hover { - background-color: #eee; - } -} - -.btn-img { - width: rem2(18px); - height: rem2(18px); - margin-right: rem2(8px); - background-size: contain; - background-position: center; - background-repeat: no-repeat; -} - -.google-play { - background-image: url('/images/templates/google-play.svg'); -} - -.windows { - background-image: url('/images/templates/windows.svg'); -} - -.apple-store { - background-image: url('/images/templates/apple-store.svg'); -} - -.nuget { - background-image: url('/images/templates/nuget.svg'); -} - -.figma { - background-image: url('/images/templates/figma.svg'); -} - -::deep a { - color: $bit-color-primary; -} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates04ProjectStructurePage.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates03ProjectStructurePage.razor similarity index 87% rename from src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates04ProjectStructurePage.razor rename to src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates03ProjectStructurePage.razor index 85735b388f3..39fd74ab1d6 100644 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates04ProjectStructurePage.razor +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates03ProjectStructurePage.razor @@ -4,10 +4,10 @@ + Description="Explore the project structure of the bit Boilerplate template: client, server, and shared projects, and how they fit together." />
    - Project structure + Project structure
    @@ -35,18 +35,18 @@ The subsequent sections will provide detailed information about these files.

    - The .devcontainer enables seamless integration with GitHub Codespaces when pushing your project to GitHub repository. Demo repository + The .devcontainer enables seamless integration with GitHub Codespaces when pushing your project to GitHub repository. Demo repository

    To enhance the development experience with Visual Studio Code, several configuration files has been included in .vscode directory.

    - In addition to the .editorconfig and .gitignore files, + In addition to the .editorconfig and .gitignore files, which have clear purposes, there are two additional files: Clean.bat (Windows) and Clean.sh (macOS/Linux). These scripts are designed to remove all auto-generated files from your project. - To understand what are these extra files, please refer to the comments within these scripts. In short, if you face a tough build issue, close your IDE and run the `Clean.bat` or `Clean.sh` file. + To understand what are these extra files, please refer to the comments within these scripts. In short, if you face a tough build issue, close your IDE and run the Clean.bat or Clean.sh file.

    - There is also a file named global.json, which mitigates potential issues arising from the use of different .NET SDK versions by team members. + There is also a file named global.json, which mitigates potential issues arising from the use of different .NET SDK versions by team members.

    @@ -82,11 +82,11 @@

    - <LangVersion>12.0</langVersion> + <LangVersion>13.0</LangVersion>

    - This setting enforces the use of C# 12 across all projects. + This setting enforces the use of C# 13 across all projects. The following sections will provide further details on the Directory.Build.props file and .csproj files.
    @@ -94,7 +94,7 @@
- Boilerplate solution + Boilerplate solution structure in Visual Studio
@@ -106,7 +106,7 @@
  • Features: Business-related code organized by domain (e.g., Identity, Products, Dashboard).
  • -
  • Components: Features Client-side UI & Logic, implemented by razor, razor.csss and razor.cs (e.g., DashboardPage).
  • +
  • Components: Features Client-side UI & Logic, implemented by .razor, .razor.scss and .razor.cs (e.g., DashboardPage).
  • Infrastructure: Technical cross-cutting concerns not tied to a specific business domain (e.g., DbContext, Services, Middleware).
@@ -128,11 +128,11 @@ Running this project will make the features mentioned in Server.Api section available on port 5000 as well as server components for Blazor pre-rendering and Blazor Server.
  • - Server.AppHost: This is the app host for ASP.NET Aspire, which is optional to use. + Server.AppHost: This is the app host for ASP.NET Aspire, which is optional to use.
  • Server.Shared: The Server.Shared project includes code shared between the Server.Api and Server.Web projects. - Optionally, it may contain code for use within ASP.NET Aspire, similar to the Aspire's `ServiceDefaults` project. + Optionally, it may contain code for use within ASP.NET Aspire, similar to the Aspire's ServiceDefaults project.
  • @@ -173,9 +173,9 @@

    Client.Web project can be published as a - Blazor WebAssembly Standalone application on platforms such as Cloudflare Pages, - Azure Static Web Apps, - GitHub Pages, and others, without requiring ASP.NET Core. + Blazor WebAssembly Standalone application on platforms such as Cloudflare Pages, + Azure Static Web Apps, + GitHub Pages, and others, without requiring ASP.NET Core.
    diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates04ProjectStructurePage.razor.scss b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates03ProjectStructurePage.razor.scss similarity index 92% rename from src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates04ProjectStructurePage.razor.scss rename to src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates03ProjectStructurePage.razor.scss index d9635d6ca5b..cb5b8bb171e 100644 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates04ProjectStructurePage.razor.scss +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates03ProjectStructurePage.razor.scss @@ -36,6 +36,10 @@ .row-section-container{ display:flex; + + @include sm { + flex-direction: column; + } } .image { diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates05CreateProjectPage.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates04CreateProjectPage.razor similarity index 88% rename from src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates05CreateProjectPage.razor rename to src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates04CreateProjectPage.razor index 1e3fcefd33b..0fa32f52eaf 100644 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates05CreateProjectPage.razor +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates04CreateProjectPage.razor @@ -1,20 +1,20 @@ -@page "/templates/create-project" +@page "/templates/create-project" @page "/boilerplate/create-project" @inherits AppComponentBase + Description="Create a new project from the bit Boilerplate template and customize it with parameters like database, authentication, and CI/CD pipeline." />
    - Create Project + Create Project
    Let's make our next cross platform project a success with Bit.Boilerplate.
    - + @GetFinalCommand() @@ -56,20 +56,20 @@ Supported options include SqlServer, PostgreSQL, MySQL and Other.

    - For the default SQLite option, we'd recommend installing sqlite package for Visual Studio and Visual Studio Code. + For the default SQLite option, we'd recommend installing sqlite package for Visual Studio and Visual Studio Code.
    break; case "SqlServer":
    You can use Sql Server LocalDb 2025 for development purposes.
    - It gets installed within Visual Studio by default, but you can either download it from here or install it using PowerShell: + It gets installed within Visual Studio by default, but you can either download it from here or install it using PowerShell: $ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest -Uri https://download.microsoft.com/download/3/8/d/38de7036-2433-4207-8eae-06e247e17b25/SqlLocalDB.msi -OutFile SqlLocalDB.msi; msiexec /i SqlLocalDB.msi /quiet
    break; case "PostgreSQL":
    - Download and install @database.Value here. + Download and install @database.Value here. Alternatively, use the following command:
    winget install --id=PostgreSQL.PostgreSQL.18 @@ -77,12 +77,12 @@ break; case "MySQL":
    - Both MariaDB and MySql are supported. + Both MariaDB and MySql are supported.
    break; case "Other":
    - Add the desired database package and configure it in the AddDbContextPool method which is located in the Program.Services.cs file within the Server.Api project. + Add the desired database package and configure it in the AddDbContextPool method which is located in the Program.Services.cs file within the Server.Api project.
    break; } @@ -97,7 +97,7 @@ @GetMultiTenantCommand() - You can experience the Multi-tenancy feature instantly by logging into adminpanel.bitplatform.dev using store-user@bitplatform.dev (Password: 123456). This gives you access to a demo tenant ("Store") where you can explore the Dashboard, Products, and Categories. + You can experience the Multi-tenancy feature instantly by logging into adminpanel.bitplatform.dev using store-user@bitplatform.dev (Password: 123456). This gives you access to a demo tenant ("Store") where you can explore the Dashboard, Products, and Categories. Alternatively, you can sign in using your regular Google/Gmail account to automatically create your own isolated tenant. Once inside your personal tenant, you will also gain access to advanced Identity Management features, including User and Role administration pages. @@ -121,7 +121,7 @@ case "Local":
    The API project includes an Attachment Controller responsible for handling user images, - including resizing and saving them in the WebP format using FluentStorage + including resizing and saving them in the WebP format using FluentStorage

    Local option stores files on local hard drive. @@ -134,13 +134,13 @@ break; case "S3":
    - Install and configure FluentStorage.AWS, which supports Amazon S3. + Install and configure FluentStorage.AWS, which supports Amazon S3. This allows you to use any file storage solution compatible with S3, such as AWS, DigitalOcean Spaces, MinIO, Hetzner, Contabo etc.
    break; case "Other":
    - Install and configure any of the FluentStorage packages. + Install and configure any of the FluentStorage packages.
    break; } @@ -166,12 +166,12 @@ case "GitHub":
    Ensure a rapid and reliable deployment by utilizing a pipeline. - By selecting GitHub, CI/ CD pipelines will be set up using Github Actions. + By selecting GitHub, CI/ CD pipelines will be set up using Github Actions.
    break; case "Azure":
    - By selecting Azure, CI/ CD pipelines will be set up using Azure Devops. + By selecting Azure, CI/ CD pipelines will be set up using Azure Devops.
    break; } @@ -218,9 +218,9 @@ @GetAspireCommand() - Aspire helps you build, test, and deploy distributed applications with ease. Learn more at ASP.NET Core Aspire. + Aspire helps you build, test, and deploy distributed applications with ease. Learn more at ASP.NET Core Aspire. dotnet tool install -g Aspire.Cli - Aspire requires Docker Desktop to be installed and running. Download and install Docker Desktop from here. + Aspire requires Docker Desktop to be installed and running. Download and install Docker Desktop from here. @@ -243,7 +243,7 @@

    - + Integrated API architecture diagram
    } else @@ -253,7 +253,7 @@

    - + Standalone API architecture diagram
    } @@ -269,7 +269,7 @@ @GetModuleCommand() Use this parameter to initialize the project with a module. - The two available options are Admin Panel and Sales. + The two available options are Admin Panel and Sales. @@ -292,8 +292,8 @@ else {
    - To integrate Google reCAPTCHA into - the app, include --captcha reCaptcha in the dotnet new command. Live demo + To integrate Google reCAPTCHA into + the app, include --captcha reCaptcha in the dotnet new command. Live demo
    }
    @@ -321,7 +321,7 @@ @GetSampleCommand() Use this parameter to initialize the project with a sample pages. - Checkout demo sample at Todo. + Checkout demo sample at Todo. @@ -405,7 +405,7 @@ @GetGoogleAdsCommand() - Helps you earn money by displaying reward-based Google ads. Demo + Helps you earn money by displaying reward-based Google ads. Demo @@ -432,12 +432,12 @@
    - + Create a new project dialog in Visual Studio
    - + Configure the Boilerplate project options in Visual Studio
    diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates05CreateProjectPage.razor.cs b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates04CreateProjectPage.razor.cs similarity index 99% rename from src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates05CreateProjectPage.razor.cs rename to src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates04CreateProjectPage.razor.cs index 77a87d7a461..1c6b4260ecc 100644 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates05CreateProjectPage.razor.cs +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates04CreateProjectPage.razor.cs @@ -1,8 +1,8 @@ -using System.Text; +using System.Text; namespace Bit.Websites.Platform.Client.Pages.Templates; -public partial class Templates05CreateProjectPage +public partial class Templates04CreateProjectPage { private string name = "MyFirstProject"; diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates05CreateProjectPage.razor.scss b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates04CreateProjectPage.razor.scss similarity index 84% rename from src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates05CreateProjectPage.razor.scss rename to src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates04CreateProjectPage.razor.scss index 5f1dafec353..6c57ead00ac 100644 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates05CreateProjectPage.razor.scss +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates04CreateProjectPage.razor.scss @@ -29,7 +29,14 @@ .image { @include Image; + + // The Image mixin's fixed 85% height distorts these diagrams inside the 350px-tall + // .api-image-container; scale the height from the intrinsic ratio instead and cap both axes + // (the max-height leaves room for the mixin's 25px vertical margins). + height: auto; width: rem2(600px); + max-width: 100%; + max-height: calc(100% - #{rem2(50px)}); } ::deep a { diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates06RunProjectPage.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates05RunProjectPage.razor similarity index 90% rename from src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates06RunProjectPage.razor rename to src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates05RunProjectPage.razor index c44558c1e2a..2127596f579 100644 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates06RunProjectPage.razor +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates05RunProjectPage.razor @@ -1,13 +1,13 @@ -@page "/templates/run-project" +@page "/templates/run-project" @page "/boilerplate/run-project" @inherits AppComponentBase + Description="Build and run your bit Boilerplate project on web, Android, iOS, Windows, and macOS." />
    - Project Run + Run project

    @@ -45,12 +45,12 @@
    Development Environment The project is configured to use Blazor Server as the default mode to enhance the development experience, - enabling features such as Visual Studio .NET Hot Reload - and dotnet watch. To utilize the Hot Reload feature, + enabling features such as Visual Studio .NET Hot Reload + and dotnet watch. To utilize the Hot Reload feature, ensure that you have the latest versions of Visual Studio and the .NET SDK. This setup allows for automatic application of changes made to .razor, .scss, or .cs files without the need to rebuild the project. If any changes to these files do not take effect without a rebuild, please feel free to create an issue - here. + here.

    @@ -88,7 +88,7 @@ If you're developing on Windows, it is recommended to run bash ./Clean.sh inside container the first time you open the project.
    - + Running the project in VS Code with Docker
    @@ -112,11 +112,11 @@
    "ServerAddress": "https://r3c136gg-5030.euw.devtunnels.ms"
    - For additional details about dev tunnels, please refer to the following video and docs. + For additional details about dev tunnels, please refer to the following video and docs.

    - @@ -143,7 +143,7 @@

    - @@ -160,7 +160,7 @@

    - @@ -170,7 +170,7 @@

    - @@ -180,7 +180,7 @@

    - @@ -194,7 +194,7 @@ Run MAUI in Visual Studio for iOS, Android Running your project on Android, Windows, and Web using Visual Studio is straightforward. However, testing a macOS version with Visual Studio isn't possible. For iOS, if you have a Mac connected to the same network as your Windows PC, you can follow - this documentation + this documentation to connect your Visual Studio to the mac device and run the iOS project using Visual Studio while coding on Windows.

    @@ -204,7 +204,7 @@

    - diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates05RunProjectPage.razor.cs b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates05RunProjectPage.razor.cs new file mode 100644 index 00000000000..a7a2d20d1cc --- /dev/null +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates05RunProjectPage.razor.cs @@ -0,0 +1,5 @@ +namespace Bit.Websites.Platform.Client.Pages.Templates; + +public partial class Templates05RunProjectPage +{ +} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates06RunProjectPage.razor.scss b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates05RunProjectPage.razor.scss similarity index 100% rename from src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates06RunProjectPage.razor.scss rename to src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates05RunProjectPage.razor.scss diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates06RunProjectPage.razor.cs b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates06RunProjectPage.razor.cs deleted file mode 100644 index 18d155bdef7..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates06RunProjectPage.razor.cs +++ /dev/null @@ -1,5 +0,0 @@ -namespace Bit.Websites.Platform.Client.Pages.Templates; - -public partial class Templates06RunProjectPage -{ -} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates07Wiki.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates06Wiki.razor similarity index 79% rename from src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates07Wiki.razor rename to src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates06Wiki.razor index 54f930e05db..c18978c18f7 100644 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates07Wiki.razor +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates06Wiki.razor @@ -4,10 +4,10 @@ + Description="Deep-dive articles in the bit Boilerplate wiki: architecture, authentication, deployment, and more." />
    - Wiki + Wiki
    @@ -22,7 +22,7 @@
    - + bit Boilerplate wiki pages on GitHub

    @@ -42,7 +42,7 @@

    Stage 2: DTOs, Mappers, and Mapperly -

    Explore Data Transfer Objects, `AppJsonContext`, and how Mapperly simplifies object mapping. Learn the difference between Project() and Map() methods, and how Patch() updates client-side objects.

    +

    Explore Data Transfer Objects, AppJsonContext, and how Mapperly simplifies object mapping. Learn the difference between Project() and Map() methods, and how Patch() updates client-side objects.



    @@ -57,12 +57,12 @@

    Stage 5: Localization and Multi-language Support -

    Master resource files (resx), `DtoResourceType` attribute, `AppDataAnnotationsValidator`, IStringLocalizer usage, and the `bit-resx` tool for managing translations.

    +

    Master resource files (resx), DtoResourceType attribute, AppDataAnnotationsValidator, IStringLocalizer usage, and the bit-resx tool for managing translations.



    Stage 6: Exception Handling and Error Management -

    Learn about Known vs Unknown exceptions, safe exception throwing, `WithData()` and `WithExtensionData()` methods, automatic exception handling in Blazor, and `WrapHandled()` for event handlers.

    +

    Learn about Known vs Unknown exceptions, safe exception throwing, WithData() and WithExtensionData() methods, automatic exception handling in Blazor, and WrapHandled() for event handlers.



    @@ -72,12 +72,12 @@

    Stage 8: Blazor Pages, Components, Styling & Navigation -

    Understand the three-file structure (.razor, .razor.cs, .razor.scss), isolated component styles, global styles, ::deep selector, Bit.BlazorUI components, and navigation with `PageUrls`.

    +

    Understand the three-file structure (.razor, .razor.cs, .razor.scss), isolated component styles, global styles, ::deep selector, Bit.BlazorUI components, and navigation with PageUrls.



    Stage 9: Dependency Injection & Service Registration -

    Explore service registration patterns across different projects, `AddSessioned` method for session-scoped services, and appropriate service lifetimes (Singleton, Scoped, Transient, `Sessioned`).

    +

    Explore service registration patterns across different projects, AddSessioned method for session-scoped services, and appropriate service lifetimes (Singleton, Scoped, Transient, Sessioned).



    @@ -87,27 +87,27 @@

    Stage 11: TypeScript, Build Process & JavaScript Interop -

    Understand TypeScript integration, MSBuild targets for JavaScript compilation, `IJSRuntimeExtensions` for C#-to-JS calls, and how to add npm packages with type definitions.

    +

    Understand TypeScript integration, MSBuild targets for JavaScript compilation, IJSRuntimeExtensions for C#-to-JS calls, and how to add npm packages with type definitions.



    Stage 12: Blazor Modes, PreRendering & PWA -

    Explore Blazor Server, WebAssembly, and Auto modes, pre-rendering configuration for SEO and performance, PWA capabilities, service workers, and `IPrerenderStateService`.

    +

    Explore Blazor Server, WebAssembly, and Auto modes, pre-rendering configuration for SEO and performance, PWA capabilities, service workers, and IPrerenderStateService.



    Stage 13: Force Update System -

    Learn how `ForceUpdateMiddleware` validates app versions on every request, supports platform-specific update behaviors (auto-update for web/Windows, store redirect for mobile), and ensures all users run supported versions.

    +

    Learn how ForceUpdateMiddleware validates app versions on every request, supports platform-specific update behaviors (auto-update for web/Windows, store redirect for mobile), and ensures all users run supported versions.



    Stage 14: Response Caching System -

    Master multi-layer caching: client-side memory cache, browser HTTP cache, CDN edge cache, and ASP.NET Core Output Cache. Learn about `AppResponseCache` attribute, cache purging with `ResponseCacheService`, and optimizing performance.

    +

    Master multi-layer caching: client-side memory cache, browser HTTP cache, CDN edge cache, and ASP.NET Core Output Cache. Learn about AppResponseCache attribute, cache purging with ResponseCacheService, and optimizing performance.



    Stage 15: Logging, OpenTelemetry and Health Checks -

    Understand ILogger for logging, `ActivitySource` and `Meter` for tracking operations, in-app Diagnostic Modal, integration with Sentry and Azure App Insights, Aspire Dashboard, and built-in health checks.

    +

    Understand ILogger for logging, ActivitySource and Meter for tracking operations, in-app Diagnostic Modal, integration with Sentry and Azure App Insights, Aspire Dashboard, and built-in health checks.



    @@ -137,12 +137,12 @@

    Stage 21: .NET MAUI / Blazor Hybrid -

    Explore native platform capabilities on Android, iOS, macOS, and Windows. Learn about Deep Links/Universal Links, `ApplicationVersion` for app stores, Windows project advantages, and WebView considerations.

    +

    Explore native platform capabilities on Android, iOS, macOS, and Windows. Learn about Deep Links/Universal Links, ApplicationVersion for app stores, Windows project advantages, and WebView considerations.



    Stage 22: Messaging -

    Master in-app messaging with `PubSubService`, JavaScript-to-C# communication with `AppJsBridge`, real-time server-to-client messaging with SignalR, and push notifications with deep linking.

    +

    Master in-app messaging with PubSubService, JavaScript-to-C# communication with AppJsBridge, real-time server-to-client messaging with SignalR, and push notifications with deep linking.



    @@ -164,25 +164,19 @@
    AI-Powered Wiki
    - You can also visit wiki.bitplatform.dev anytime to ask questions about bit Boilerplate and the entire bitplatform ecosystem. + You can also visit wiki.bitplatform.dev anytime to ask questions about bit Boilerplate and the entire bitplatform ecosystem.

    To enhance the understanding of our Open Source Project Repository, all documentation is maintained within a single mono repo. This approach ensures that the AI Wiki can cohesively analyze the entire set of documents, README files, in-code comments, and source code to provide comprehensive insights when queried.

    - Here are some example questions that can be answered by wiki.bitplatform.dev: + Here are some example questions that can be answered by wiki.bitplatform.dev:
      -
    • What is the optimal way to load page data using StateHasChanged in conjunction with a Skeleton UI or Shimmer? Link
    • -
      -
    • How can I remove google reCAPTCHA from a project I created from bit Boilerplate? Link
    • -
      -
    • What is the difference between Patch and Map, and what is their relationship with Entity Framework Core and Blazor change tracking? Link
    • -
      -
    • How can I implement a Grid System and layout using BitGrid and BitStack components, especially if I'm familiar with the Bootstrap grid system? Link
    • -
      -
    • How does a refresh token function in a Boilerplate project template? Link
    • -
      -
    • How does passwordless authentication work in Boilerplate, particularly in Blazor Hybrid versions of the app, given that this feature is browser-only? Link
    • -
      -
    • How does using embeddings with the PostgreSQL vector extension enable product search functionality via LINQ and Entity Framework Core? Link
    • +
    • What is the optimal way to load page data using StateHasChanged in conjunction with a Skeleton UI or Shimmer? Link
    • +
    • How can I remove google reCAPTCHA from a project I created from bit Boilerplate? Link
    • +
    • What is the difference between Patch and Map, and what is their relationship with Entity Framework Core and Blazor change tracking? Link
    • +
    • How can I implement a Grid System and layout using BitGrid and BitStack components, especially if I'm familiar with the Bootstrap grid system? Link
    • +
    • How does a refresh token function in a Boilerplate project template? Link
    • +
    • How does passwordless authentication work in Boilerplate, particularly in Blazor Hybrid versions of the app, given that this feature is browser-only? Link
    • +
    • How does using embeddings with the PostgreSQL vector extension enable product search functionality via LINQ and Entity Framework Core? Link
    diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates06Wiki.razor.cs b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates06Wiki.razor.cs new file mode 100644 index 00000000000..08ace6fae6e --- /dev/null +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates06Wiki.razor.cs @@ -0,0 +1,5 @@ +namespace Bit.Websites.Platform.Client.Pages.Templates; + +public partial class Templates06Wiki +{ +} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates07Wiki.razor.scss b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates06Wiki.razor.scss similarity index 100% rename from src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates07Wiki.razor.scss rename to src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates06Wiki.razor.scss diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates07Wiki.razor.cs b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates07Wiki.razor.cs deleted file mode 100644 index 24174b51fa4..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Templates/Templates07Wiki.razor.cs +++ /dev/null @@ -1,5 +0,0 @@ -namespace Bit.Websites.Platform.Client.Pages.Templates; - -public partial class Templates07Wiki -{ -} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Program.cs b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Program.cs index 7b5b7e71994..a9ca5e8934c 100644 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Program.cs +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Program.cs @@ -12,7 +12,7 @@ apiServerAddress = new Uri($"{builder.HostEnvironment.BaseAddress}{apiServerAddress}"); } -builder.Services.AddSingleton(sp => new HttpClient(sp.GetRequiredService()) { BaseAddress = apiServerAddress }); +builder.Services.AddSingleton(sp => new HttpClient(sp.GetRequiredService()) { BaseAddress = apiServerAddress }); builder.Services.AddClientSharedServices(); diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Scripts/app.ts b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Scripts/app.ts index d5d28313e8a..1d32c22be01 100644 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Scripts/app.ts +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Scripts/app.ts @@ -12,21 +12,31 @@ function goToTop() { window.scrollTo({ top: 0 }); } -declare class BitTheme { static init(options: any): void; }; +// Closes CSS :hover/:focus-within driven popups (e.g. the header products menu) from C#: after a tap +// or an Escape press the trigger keeps focus, so the popup would stay open until focus moves away. +function blurActiveElement() { + (document.activeElement as HTMLElement | null)?.blur?.(); +} + +declare namespace BitBlazorUI { + class Theme { static init(options: any): void; } +} -BitTheme.init({ - //system: true, - default: 'dark', +// Theme-dependent styling keys off the bit-theme attribute the library script keeps on the document +// element (:root[bit-theme=...] selectors in the stylesheets), so this callback only has to maintain +// what CSS cannot reach: the browser chrome color. +BitBlazorUI.Theme.init({ + system: true, persist: true, - onChange: (newTheme: string, oldThem: string) => { - if (newTheme === 'dark') { - document.body.classList.add('bit-platform-dark-theme'); - document.body.classList.remove('bit-platform-light-theme'); - document.querySelector("meta[name=theme-color]")?.setAttribute('content', '#060E2D'); - } else { - document.body.classList.add('bit-platform-light-theme'); - document.body.classList.remove('bit-platform-dark-theme'); - document.querySelector("meta[name=theme-color]")?.setAttribute('content', '#FFFFFF'); - } + // Mirror every theme change into the bit-theme-preference cookie so the server can paint the + // right theme into the prerendered markup (see App.razor). Without it the server would fall back + // to guessing and the page would flash the wrong theme for visitors who picked one. + persistCookie: true, + onChange: (newTheme: string, oldTheme: string) => { + // Same dark-name predicate and hex values (--bit-clr-bg-pri of each palette) as the + // first-paint bootstrap in the server's App.razor - keep the two in sync. + const name = (newTheme ?? '').toLowerCase(); + const isDark = name === 'dark' || name.endsWith('-dark'); + document.querySelector("meta[name=theme-color]")?.setAttribute('content', isDark ? '#060E2D' : '#FFFFFF'); } -}); \ No newline at end of file +}); diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Services/HttpMessageHandlers/RetryDelegatingHandler.cs b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Services/HttpMessageHandlers/RetryDelegatingHandler.cs index 40376916f88..bb08b792f3f 100644 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Services/HttpMessageHandlers/RetryDelegatingHandler.cs +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Services/HttpMessageHandlers/RetryDelegatingHandler.cs @@ -6,6 +6,13 @@ public class RetryDelegatingHandler(ExceptionDelegatingHandler handler) protected override async Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) { + if (request.Method != HttpMethod.Get) + { + // Retrying a non-idempotent request that already reached the server would repeat its + // side effect (e.g. re-delivering a contact-us message on a transient failure). + return await base.SendAsync(request, cancellationToken); + } + var delays = GetDelays(scaleFirstTry: TimeSpan.FromSeconds(3), maxRetries: 3).ToArray(); Exception? lastExp = null; diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Services/NavManuService.cs b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Services/NavManuService.cs deleted file mode 100644 index dfb28f71791..00000000000 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Services/NavManuService.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace Bit.Websites.Platform.Client.Services; - -public class NavManuService -{ - public event Func OnToggleMenu = default!; - - public void ToggleMenu() - { - OnToggleMenu.Invoke(); - } -} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Services/NavMenuService.cs b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Services/NavMenuService.cs new file mode 100644 index 00000000000..c33d3f84730 --- /dev/null +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Services/NavMenuService.cs @@ -0,0 +1,54 @@ +namespace Bit.Websites.Platform.Client.Services; + +/// +/// Owns the docs nav menu toggle and the URL-derived route flags, so Header (which renders the docs +/// hamburger trigger) and MainLayout (which mounts the NavMenu it toggles) can never disagree about +/// which routes count as docs routes. +/// +public class NavMenuService +{ + public event Func? OnToggleMenu; + + /// + /// No-ops when NavMenu is not mounted (Header renders the trigger on docs routes before + /// NavMenu subscribes), and awaits the handler so its exceptions surface instead of being lost. + /// + public Task ToggleMenu() + { + return OnToggleMenu?.Invoke() ?? Task.CompletedTask; + } + + + /// Current base-relative path, without query or fragment, with a leading slash. + public string CurrentUrl { get; private set; } = "/"; + + public bool IsTemplateDocRoute { get; private set; } + public bool IsBesqlDocRoute { get; private set; } + public bool IsLcncDocRoute { get; private set; } + + /// + /// Docs routes get the docs nav menu (hamburger); Lcnc has no docs yet, so it is excluded here, + /// but it still counts as a product route for highlighting the Products menu trigger. + /// + public bool IsDocsRoute => IsTemplateDocRoute || IsBesqlDocRoute; + + public bool IsProductsRoute => IsDocsRoute || IsLcncDocRoute; + + /// + /// Idempotent; called by every component that reacts to LocationChanged, whichever fires first. + /// + public void UpdateRouteFlags(string currentUrl) + { + var fragmentIndex = currentUrl.IndexOfAny(['?', '#']); + if (fragmentIndex >= 0) + { + currentUrl = currentUrl[..fragmentIndex]; + } + + CurrentUrl = currentUrl; + + IsTemplateDocRoute = currentUrl.Contains("/templates") || currentUrl.Contains("/boilerplate"); + IsBesqlDocRoute = currentUrl.Contains("/besql"); + IsLcncDocRoute = currentUrl.Contains("/lowcode-nocode"); + } +} diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Shared/AppAiChatPanel.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Shared/AppAiChatPanel.razor index 8cdaa33d0a5..b244921017a 100644 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Shared/AppAiChatPanel.razor +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Shared/AppAiChatPanel.razor @@ -1,4 +1,4 @@ -@using Bit.Websites.Platform.Shared.Dtos.AiChat +@using Bit.Websites.Platform.Shared.Dtos.AiChat @inherits AppComponentBase @@ -72,7 +72,7 @@ @if (chatMessages.Count == 1) { - +
    - +

    Oops, something went wrong...

    @if (showException) @@ -19,8 +19,8 @@ else if (ErrorContent is null)
    @CurrentException?.ToString()
    }
    - Refresh - Home + Refresh + Home
    } diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Shared/Footer.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Shared/Footer.razor index 616ccdec57c..935822be76f 100644 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Shared/Footer.razor +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Shared/Footer.razor @@ -10,47 +10,49 @@
    \ No newline at end of file diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Shared/Footer.razor.scss b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Shared/Footer.razor.scss index e049c89bf6e..358047ef848 100644 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Shared/Footer.razor.scss +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Shared/Footer.razor.scss @@ -157,6 +157,15 @@ footer { &:hover { text-decoration: underline; } + + &.coming-soon { + cursor: default; + color: $bit-color-foreground-secondary; + + &:hover { + text-decoration: none; + } + } } .copyright-txt { @@ -182,7 +191,7 @@ footer { cursor: pointer; width: rem2(32px); height: rem2(32px); - margin: 0 rem2(10); + margin: 0 rem2(10px); border-radius: 50%; background-color: #a19f9d; background-size: rem2(18px); @@ -202,7 +211,7 @@ footer { background-image: url('/images/footer/github-icon.svg'); &:hover { - background-color: #333; + background-color: $GithubColor; } } @@ -210,7 +219,7 @@ footer { background-image: url('/images/footer/youtube-icon.svg'); &:hover { - background-color: #FF0000; + background-color: $YouTubeColor; } } @@ -218,6 +227,6 @@ footer { background-image: url('/images/footer/linkedin-icon.svg'); &:hover { - background-color: #0077B5; + background-color: $LinkedinColor; } } diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Shared/Header.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Shared/Header.razor index 422b4db7a79..1cdb218f953 100644 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Shared/Header.razor +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Shared/Header.razor @@ -1,12 +1,14 @@ @inherits AppComponentBase
    +
    - @if (isDocsRoute) + @if (navMenuService.IsDocsRoute) { @@ -15,80 +17,53 @@ } -