From 5d96409276eb64e873a7421b50d3116417fe18e3 Mon Sep 17 00:00:00 2001 From: Yaser Moradi Date: Thu, 18 Jan 2024 07:38:48 +0100 Subject: [PATCH 01/37] fix(docs): Fix broken links in ReadMe #6615 (#6616) --- README.md | 16 ++++++++-------- .../Pages/HomePage.razor | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 09e2d57fed..12981b827f 100644 --- a/README.md +++ b/README.md @@ -34,16 +34,16 @@ The following apps are our open-source projects powered by the bit platform show | |    Web    |    iOS    | Android | Windows | macOS | |:-:|:--:|:--:|:--:|:--:|:--:| -| bit BlazorUI | [![Prerendered PWA](https://github-production-user-asset-6210df.s3.amazonaws.com/6169846/251381583-8b8eb895-80c9-4811-9641-57a5a08db163.png)](https://components.bitplatform.dev) | [![iOS app](https://github-production-user-asset-6210df.s3.amazonaws.com/6169846/251381842-e72976ce-fd20-431d-a677-ca1ed625b83b.png)](https://apps.apple.com/us/app/bit-blazor-ui/id6450401404) | [![Android app](https://github-production-user-asset-6210df.s3.amazonaws.com/6169846/251381958-24931682-87f6-44fc-a1c7-eecf46387005.png)](https://play.google.com/store/apps/details?id=com.bitplatform.BlazorUI.Demo) | [![Windows app](https://github-production-user-asset-6210df.s3.amazonaws.com/6169846/251382080-9ae97fea-934c-4097-aca4-124a2aed1595.png)](https://github.com/bitfoundation/bitplatform/releases/latest/download/BlazorUIDemo-Windows.zip) | [![macOS app](https://github-production-user-asset-6210df.s3.amazonaws.com/6169846/251382211-0d58f9ba-1a1f-4481-a0ca-b23a393cca9f.png)](https://github.com/bitfoundation/bitplatform/releases/latest/download/BlazorUIDemo-macOS.pkg) -| Todo | [![Prerendered PWA](https://github-production-user-asset-6210df.s3.amazonaws.com/6169846/251381583-8b8eb895-80c9-4811-9641-57a5a08db163.png)](https://todo.bitplatform.dev) | [![iOS app](https://github-production-user-asset-6210df.s3.amazonaws.com/6169846/251381842-e72976ce-fd20-431d-a677-ca1ed625b83b.png)](https://apps.apple.com/us/app/bit-todotemplate/id6450611072) | [![Android app](https://github-production-user-asset-6210df.s3.amazonaws.com/6169846/251381958-24931682-87f6-44fc-a1c7-eecf46387005.png)](https://play.google.com/store/apps/details?id=com.bitplatform.Todo.Template) | [![Windows app](https://github-production-user-asset-6210df.s3.amazonaws.com/6169846/251382080-9ae97fea-934c-4097-aca4-124a2aed1595.png)](https://github.com/bitfoundation/bitplatform/releases/latest/download/TodoTemplate-Windows.zip) | [![macOS app](https://github-production-user-asset-6210df.s3.amazonaws.com/6169846/251382211-0d58f9ba-1a1f-4481-a0ca-b23a393cca9f.png)](https://github.com/bitfoundation/bitplatform/releases/latest/download/TodoTemplate-macOS.pkg) -| AdminPanel | [![Prerendered PWA](https://github-production-user-asset-6210df.s3.amazonaws.com/6169846/251381583-8b8eb895-80c9-4811-9641-57a5a08db163.png)](https://adminpanel.bitplatform.dev) | [![iOS app](https://github-production-user-asset-6210df.s3.amazonaws.com/6169846/251381842-e72976ce-fd20-431d-a677-ca1ed625b83b.png)](https://apps.apple.com/us/app/bit-adminpanel/id6450611349) | [![Android app](https://github-production-user-asset-6210df.s3.amazonaws.com/6169846/251381958-24931682-87f6-44fc-a1c7-eecf46387005.png)](https://play.google.com/store/apps/details?id=com.bitplatform.AdminPanel.Template) | [![Windows app](https://github-production-user-asset-6210df.s3.amazonaws.com/6169846/251382080-9ae97fea-934c-4097-aca4-124a2aed1595.png)](https://github.com/bitfoundation/bitplatform/releases/latest/download/AdminPanel-Windows.zip) | [![macOS app](https://github-production-user-asset-6210df.s3.amazonaws.com/6169846/251382211-0d58f9ba-1a1f-4481-a0ca-b23a393cca9f.png)](https://github.com/bitfoundation/bitplatform/releases/latest/download/AdminPanel-macOS.pkg) | +| bit BlazorUI | [![Prerendered PWA](https://github-production-user-asset-6210df.s3.amazonaws.com/6169846/251381583-8b8eb895-80c9-4811-9641-57a5a08db163.png)](https://components.bitplatform.dev) | [![iOS app](https://github-production-user-asset-6210df.s3.amazonaws.com/6169846/251381842-e72976ce-fd20-431d-a677-ca1ed625b83b.png)](https://apps.apple.com/us/app/bit-blazor-ui/id6450401404) | [![Android app](https://github-production-user-asset-6210df.s3.amazonaws.com/6169846/251381958-24931682-87f6-44fc-a1c7-eecf46387005.png)](https://play.google.com/store/apps/details?id=com.bitplatform.BlazorUI.Demo) | [![Windows app](https://github-production-user-asset-6210df.s3.amazonaws.com/6169846/251382080-9ae97fea-934c-4097-aca4-124a2aed1595.png)](https://github.com/bitfoundation/bitplatform/releases/latest/download/BlazorUIDemo-Windows.zip) | [![macOS app](https://github-production-user-asset-6210df.s3.amazonaws.com/6169846/251382211-0d58f9ba-1a1f-4481-a0ca-b23a393cca9f.png)](https://apps.apple.com/nl/app/bit-blazor-ui/id6450401404) +| Todo | [![Prerendered PWA](https://github-production-user-asset-6210df.s3.amazonaws.com/6169846/251381583-8b8eb895-80c9-4811-9641-57a5a08db163.png)](https://todo.bitplatform.dev) | [![iOS app](https://github-production-user-asset-6210df.s3.amazonaws.com/6169846/251381842-e72976ce-fd20-431d-a677-ca1ed625b83b.png)](https://apps.apple.com/us/app/bit-todotemplate/id6450611072) | [![Android app](https://github-production-user-asset-6210df.s3.amazonaws.com/6169846/251381958-24931682-87f6-44fc-a1c7-eecf46387005.png)](https://play.google.com/store/apps/details?id=com.bitplatform.Todo.Template) | [![Windows app](https://github-production-user-asset-6210df.s3.amazonaws.com/6169846/251382080-9ae97fea-934c-4097-aca4-124a2aed1595.png)](https://github.com/bitfoundation/bitplatform/releases/latest/download/TodoTemplate-Windows.zip) | [![macOS app](https://github-production-user-asset-6210df.s3.amazonaws.com/6169846/251382211-0d58f9ba-1a1f-4481-a0ca-b23a393cca9f.png)](https://apps.apple.com/nl/app/bit-todotemplate/id6450611072) +| AdminPanel | [![Prerendered PWA](https://github-production-user-asset-6210df.s3.amazonaws.com/6169846/251381583-8b8eb895-80c9-4811-9641-57a5a08db163.png)](https://adminpanel.bitplatform.dev) | [![iOS app](https://github-production-user-asset-6210df.s3.amazonaws.com/6169846/251381842-e72976ce-fd20-431d-a677-ca1ed625b83b.png)](https://apps.apple.com/us/app/bit-adminpanel/id6450611349) | [![Android app](https://github-production-user-asset-6210df.s3.amazonaws.com/6169846/251381958-24931682-87f6-44fc-a1c7-eecf46387005.png)](https://play.google.com/store/apps/details?id=com.bitplatform.AdminPanel.Template) | [![Windows app](https://github-production-user-asset-6210df.s3.amazonaws.com/6169846/251382080-9ae97fea-934c-4097-aca4-124a2aed1595.png)](https://github.com/bitfoundation/bitplatform/releases/latest/download/AdminPanel-Windows.zip) | [![macOS app](https://github-production-user-asset-6210df.s3.amazonaws.com/6169846/251382211-0d58f9ba-1a1f-4481-a0ca-b23a393cca9f.png)](https://apps.apple.com/nl/app/bit-adminpanel/id6450611349) | | bitplatform | [![SPA](https://github-production-user-asset-6210df.s3.amazonaws.com/6169846/251395129-71a5a79c-af74-4d4e-a0f7-ed9a15cf2e46.png)](https://bitplatform.dev)| -1. [bitplatform.dev](bitplatform.dev): Pre-rendered SPA with Blazor WebAssembly -2. [components.bitplatform.dev](components.bitplatform.dev): Pre-rendered PWA with Blazor Auto -3. [todo.bitplatform.dev](todo.bitplatform.dev): Pre-rendered PWA with Blazor WebAssembly -4. [static-todo.bitplatform.dev](static-todo.bitplatform.dev): PWA with Blazor WebAssembly Standalone (Hosted on Cloudflare Pages) -5. [adminpanel.bitplatform.dev](adminpanel.bitplatform.dev): PWA with Blazor WebAssembly +1. [bitplatform.dev](https://bitplatform.dev): Pre-rendered SPA with Blazor WebAssembly +2. [components.bitplatform.dev](https://components.bitplatform.dev): Pre-rendered PWA with Blazor Auto +3. [todo.bitplatform.dev](https://todo.bitplatform.dev): Pre-rendered PWA with Blazor WebAssembly +4. [static-todo.bitplatform.dev](https://static-todo.bitplatform.dev): PWA with Blazor WebAssembly Standalone (Hosted on Cloudflare Pages) +5. [adminpanel.bitplatform.dev](https://adminpanel.bitplatform.dev): PWA with Blazor WebAssembly [Todo](https://todo.bitplatform.dev) & [Adminpanel](https://adminpanel.bitplatform.dev) web apps will launch their respective Android and iOS applications if you have already installed them, mirroring the behavior of apps like YouTube and Instagram. diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/HomePage.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/HomePage.razor index b6ac2383ff..45ea05687d 100644 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/HomePage.razor +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/HomePage.razor @@ -227,7 +227,7 @@ Project templates From 873ada8accf47467b99f4e9f4e1b02cfe3f8f60e Mon Sep 17 00:00:00 2001 From: Mohammad Hossein Rastegarinia Date: Thu, 18 Jan 2024 13:02:36 +0330 Subject: [PATCH 02/37] feat(websites): add samples for Butil Location methods in Platform website #6617 (#6618) --- .../Pages/Butil/Butil12LocationPage.razor | 684 +++++++++++++++++- 1 file changed, 672 insertions(+), 12 deletions(-) diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil12LocationPage.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil12LocationPage.razor index 74ae1091d3..17e28c4096 100644 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil12LocationPage.razor +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil12LocationPage.razor @@ -1,5 +1,6 @@ @page "/butil/location" @inherits AppComponentBase +@inject Bit.Butil.Location location Methods
- SetHref, GetHref: Gets/Sets the href of the location andn then the associated document navigates to the new page +
+ 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 ':' + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + Assign:
+ Loads the resource at the URL provided in parameter (MDN).

+ + + + +
+                                @assignExampleCode
+                            
+
+ +
+ +
+ Assign +
+
+
+
+
+

- Reload: Reloads the current URL, like the Refresh button + 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) + Replace:
+ Replaces the current resource with the one at the provided URL (redirects to the provided URL) (MDN). +

+ + + + +
+                                @replaceExampleCode
+                            
+
+ +
+ +
+ Replace +
+
+
+
+
+ +@code { + 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!); + } +}"; +} \ No newline at end of file From 1681f768a5c6c0155305f4c56a031c6e99a6f502 Mon Sep 17 00:00:00 2001 From: Mohammad Hossein Rastegarinia Date: Thu, 18 Jan 2024 13:09:20 +0330 Subject: [PATCH 03/37] feat(websites): add samples for Butil Screen methods in Platform website #6619 (#6620) --- .../Pages/Butil/Butil13ScreenPage.razor | 339 +++++++++++++++++- 1 file changed, 331 insertions(+), 8 deletions(-) diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil13ScreenPage.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil13ScreenPage.razor index 74ac944f60..e19fb0bbbe 100644 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil13ScreenPage.razor +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil13ScreenPage.razor @@ -1,5 +1,6 @@ @page "/butil/screen" @inherits AppComponentBase +@inject Bit.Butil.Screen screen 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 +
+ 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 + 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 + GetColorDepth:
+ Returns the color depth of the screen (MDN).

+ + + + +
+                                @getColorDepthExampleCode
+                            
+
+ +
+ GetColorDepth +
+
+
Color depth: @colorDepth
+
+
+
+
+
+

- GetHeight: Returns the height of the screen in pixels + 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 + 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 + GetPixelDepth:
+ Gets the bit depth of the screen (MDN).

+ + + + +
+                                @getPixelDepthExampleCode
+                            
+
+ +
+ GetPixelDepth +
+
+
Pixel depth: @pixelDepth
+
+
+
+
+
+

- GetWidth: Returns the width of the screen + 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 + 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).
+ +@code { + 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(); + } +}"; +} \ No newline at end of file From 70abfb3d5116bc9530d7a2b9c8a1229072d9a63e Mon Sep 17 00:00:00 2001 From: Mohammad Hossein Rastegarinia Date: Thu, 18 Jan 2024 13:10:50 +0330 Subject: [PATCH 04/37] feat(websites): add samples for Butil Cookie methods in Platform website #6621 (#6622) --- .../Pages/Butil/Butil14CookiePage.razor | 179 +++++++++++++++++- 1 file changed, 175 insertions(+), 4 deletions(-) diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil14CookiePage.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil14CookiePage.razor index bc85706cf3..90f36c770c 100644 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil14CookiePage.razor +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil14CookiePage.razor @@ -1,5 +1,6 @@ @page "/butil/cookie" @inherits AppComponentBase +@inject Bit.Butil.Cookie cookie @@ -29,16 +30,186 @@
Methods
- Set, Get: Gets/Sets a cookie by providing the cookie name +
+ Set, Get:
+ Gets/Sets a cookie by providing the cookie name (MDN).

+ + + + +
+                                @cookieExampleCode
+                            
+
+ +
+ +
+ +
+ SetCookie +
+
+
+ +
+ GetCookie +
+
+
Cookie value: @currentCookieValue
+
+
+
+
+
+

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

+ + + + +
+                                @cookiesExampleCode
+                            
+
+ +
+ GetAllCookies +
+
+
Cookies: @currentCookies
+
+
+
+
+


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

+ + + + +
+                                @removeExampleCode
+                            
+
+ +
+ +
+ RemoveCookie +
+
+
+
+
+ +@code { + private string? newCookieName; + private string? newCookieValue; + private string? currentCookieName; + private string? currentCookieValue; + + private string? currentCookies; + + private string? cookieName; + + + private async Task SetCookie() + { + await cookie.Set(new ButilCookie { Name = newCookieName, Value = newCookieValue }); + } + + private async Task GetCookie() + { + var result = await cookie.Get(currentCookieName!); + currentCookieValue = result?.Value; + } + + private async Task GetAllCookies() + { + currentCookies = string.Join(", ", await cookie.GetAll()); + } + + private async Task RemoveCookie() + { + await cookie.Remove(cookieName!); + } + + + private string cookieExampleCode = +@"@inject Bit.Butil.Cookie cookie + + + + + +SetCookie + + + +GetCookie + +
Cookie value: @currentCookieValue
+ +@code { + private string? newCookieName; + private string? newCookieValue; + private string? currentCookieName; + private string? currentCookieValue; + + private async Task SetCookie() + { + await cookie.Set(new ButilCookie { Name = newCookieName, Value = newCookieValue }); + } + + private async Task GetCookie() + { + var result = await cookie.Get(currentCookieName!); + currentCookieValue = result?.Value; + } +}"; + private string cookiesExampleCode = +@"@inject Bit.Butil.Cookie cookie + +GetAllCookies + +
Cookies: @currentCookies
+ +@code { + private string? currentCookies; + + private async Task GetAllCookies() + { + currentCookies = string.Join("", "", await cookie.GetAll()); + } +}"; + private string removeExampleCode = +@"@inject Bit.Butil.Cookie cookie + + + +RemoveCookie + +@code { + private string? cookieName; + + private async Task RemoveCookie() + { + await cookie.Remove(cookieName!); + } +}"; +} \ No newline at end of file From 6478f7cfb30b592ce27476b0e922022afcb12050 Mon Sep 17 00:00:00 2001 From: Mohammad Hossein Rastegarinia Date: Thu, 18 Jan 2024 13:12:13 +0330 Subject: [PATCH 05/37] feat(websites): add samples for Butil Crypto methods in Platform website #6623 (#6624) --- .../Pages/Butil/Butil15CryptoPage.razor | 149 +++++++++++++++++- 1 file changed, 146 insertions(+), 3 deletions(-) diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil15CryptoPage.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil15CryptoPage.razor index d7e9ece3dd..52227c7a82 100644 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil15CryptoPage.razor +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil15CryptoPage.razor @@ -1,5 +1,6 @@ @page "/butil/crypto" @inherits AppComponentBase +@inject Bit.Butil.Crypto crypto @@ -29,14 +30,156 @@
Methods
- Encrypt: The Encrypt method of the Crypto interface that encrypts data +
+ 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 + Decrypt:
+ The Decrypt method of the Crypto interface that decrypts data (MDN). +

+ + + + +
+                                @decryptExampleCode
+                            
+
+ +
+ +
+ Decrypt +
+
+
Decrypted text: @decryptedText
+
+
+
+
+
+ + +@code { + 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); + } +}"; +} From 0dc3105021df31ba34499173c07d8c23bc974e0e Mon Sep 17 00:00:00 2001 From: Saleh Yusefnejad Date: Fri, 19 Jan 2024 15:53:25 +0330 Subject: [PATCH 06/37] fix(websites): resolve issues of NavMenu of Platform website #6625 (#6626) --- .../Pages/Butil/Butil01OverviewPage.razor | 4 +- .../Shared/NavMenu.razor | 1 + .../Shared/NavMenu.razor.scss | 91 +++---------------- 3 files changed, 18 insertions(+), 78 deletions(-) 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 index 0783b9a10e..185125a201 100644 --- 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 @@ -12,10 +12,10 @@ Embracing Blazor because of your love for C#? -
+

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#.
diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Shared/NavMenu.razor b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Shared/NavMenu.razor index a83fe885a8..0bec3ba23f 100644 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Shared/NavMenu.razor +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Shared/NavMenu.razor @@ -24,5 +24,6 @@ Items="filteredNavItems" AriaLabel="bit project templates doc nav" OnItemClick="WrapHandled(HandleOnItemClick)" /> +
\ No newline at end of file diff --git a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Shared/NavMenu.razor.scss b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Shared/NavMenu.razor.scss index 608fe5b48d..743c02ebae 100644 --- a/src/Websites/Platform/src/Bit.Websites.Platform.Client/Shared/NavMenu.razor.scss +++ b/src/Websites/Platform/src/Bit.Websites.Platform.Client/Shared/NavMenu.razor.scss @@ -21,11 +21,10 @@ background-color: $bit-color-background-primary; @include lt-lg { + inset: 0; height: 100vh; - position: fixed; z-index: 1200; - top: 0; - inset: 0; + position: fixed; } @include sm { @@ -50,28 +49,16 @@ } .nav-menu-shadow { - position: fixed; inset: 0; - background-color: rgba(0, 0, 0, 0.5); z-index: 1101; + position: fixed; + background-color: rgba(0, 0, 0, 0.5); } .search-box-container { width: 100%; - padding: rem2(24px) rem2(22px); box-sizing: border-box; -} - -.nav-menu-list { - width: 100%; - height: calc(100% - #{rem2(89px)}); - box-sizing: border-box; - overflow-y: auto; - overflow-x: hidden; - - &::-webkit-scrollbar { - width: 0; - } + padding: rem2(24px) rem2(22px); } ::deep .nav-menu-search-box { @@ -79,68 +66,20 @@ height: rem2(40px); input::-webkit-input-placeholder { - font-size: rem2(14px); font-weight: 500; - } -} - -::deep .side-nav { - .link-enabled-nourl { - font-weight: 600; - font-size: rem2(14px); - line-height: rem2(32px); - color: #323130; - } - - .chevron-btn { - &:hover { - color: #323130; - } - - i { - height: 100%; - transform: rotate( -90deg); - } - - .expand { - height: 100%; - transform: rotate(0deg); - } - } - - .group-content { - margin-bottom: 0; - } - - .link-txt { - white-space: nowrap; - } - - .link-enabled-hasurl { - height: rem2(40px); - box-sizing: border-box; font-size: rem2(14px); - font-weight: 400; - line-height: rem2(26px); - color: #323130; - - &:hover { - color: #323130; - } } +} - .selected { - font-weight: unset; - color: $B6Color; +.nav-menu-list { + width: 100%; + overflow-y: auto; + overflow-x: hidden; + box-sizing: border-box; + height: calc(100% - #{rem2(89px)}); + max-height: calc(100% - #{rem2(89px)}); - &:after { - border-left: rem2(4px) solid $B6Color; - } + &::-webkit-scrollbar { + width: 0; } } - -::deep .searched-side-nav { - .link-enabled-hasurl { - padding: 0 20px 0 27px !important; - } -} \ No newline at end of file From 61156fb87a1c1c3778498654075e02156f294c49 Mon Sep 17 00:00:00 2001 From: Saleh Yusefnejad Date: Fri, 19 Jan 2024 16:26:56 +0330 Subject: [PATCH 07/37] fix(blazorui): resolve visual issues of the BlazorUI demo #6627 (#6628) --- .../Pages/Home/HeroSection.razor.scss | 7 +- .../Shared/Footer.razor.scss | 90 +++++++------------ .../Shared/MainLayout.razor | 4 +- .../Shared/MainLayout.razor.scss | 5 +- .../Shared/NavMenu.razor | 1 + 5 files changed, 41 insertions(+), 66 deletions(-) diff --git a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Home/HeroSection.razor.scss b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Home/HeroSection.razor.scss index 34a32a01f9..834bc8bd36 100644 --- a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Home/HeroSection.razor.scss +++ b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Home/HeroSection.razor.scss @@ -1,3 +1,4 @@ +@import '../../Styles/abstracts/_vars.scss'; @import '../../Styles/abstracts/_functions.scss'; @import '../../Styles/abstracts/_media-queries.scss'; @import '../../Styles/abstracts/_bit-css-variables.scss'; @@ -27,13 +28,13 @@ position: relative; padding: rem2(30px); flex-flow: row nowrap; - min-width: rem2(2000px); - margin-left: rem2(20px); box-sizing: border-box; + min-width: rem2(2000px); min-height: rem2(500px); + margin-left: rem2(20px); transition: max-height 0.3s; - height: calc(100vh - 120px); border-bottom-left-radius: rem2(2px); + height: calc(100vh - #{$HeaderHeight}); @include gt-md { max-height: rem2(700px); diff --git a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Shared/Footer.razor.scss b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Shared/Footer.razor.scss index 27aa860caf..fd8326b452 100644 --- a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Shared/Footer.razor.scss +++ b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Shared/Footer.razor.scss @@ -9,14 +9,13 @@ footer { box-sizing: border-box; flex-flow: column nowrap; justify-content: flex-start; - background-color: $bit-color-background-secondary; } section { width: 100%; position: relative; - max-width: rem2(1200px); box-sizing: border-box; + max-width: rem2(1200px); padding: rem2(100px) rem2(16px); &:first-child { @@ -24,13 +23,9 @@ section { gap: rem2(40px); align-items: center; grid-auto-columns: 1fr; + grid-template-rows: auto; grid-template-columns: 1fr 1fr; justify-content: space-between; - grid-template-rows: auto; - - @include lg { - grid-template-columns: 1fr 1.75fr; - } } &:last-child { @@ -53,6 +48,25 @@ section { } } +a { + text-decoration: none; +} + +.links-container { + gap: 20px; + display: flex; + flex-wrap: wrap; + justify-content: space-evenly; +} + +.column { + height: 100%; + display: flex; + align-items: flex-start; + flex-flow: column nowrap; + justify-content: flex-start; +} + .bit-logo { width: rem2(32px); height: rem2(27px); @@ -65,22 +79,21 @@ section { .go-to-top { bottom: 0; - right: rem2(2px); cursor: pointer; + right: rem2(2px); position: absolute; padding: rem2(8px) rem2(12px); - color: #EEEE; - background-color: #888; -} + background-color: $bit-color-background-secondary; -a { - text-decoration: none; + &:hover { + background-color: $bit-color-action-hover-background-secondary; + } } .address-info { display: flex; - flex-flow: column nowrap; gap: rem2(3px); + flex-flow: column nowrap; @include sm { margin-bottom: rem2(30px); @@ -93,10 +106,10 @@ a { } .address, .tel { - color: #3E5060; + color: $bit-color-primary-main; &:hover { - color: #4A5AAB; + color: $bit-color-action-hover-primary; } } @@ -113,58 +126,19 @@ a { } } -.links-container { - gap: 20px; - display: flex; - flex-wrap: wrap; -} - -.column { - height: 100%; - display: flex; - align-items: flex-start; - flex-flow: column nowrap; - justify-content: flex-start; -} - -.col-title { - margin: 0; - color: #1A2027; - line-height: 1.5; - font-weight: 700; - letter-spacing: 0; - font-size: rem2(14px); -} - -.footer-link { - margin-top: rem2(10px); - color: #3E5060; - font-size: rem2(14px); - line-height: 1.5; - letter-spacing: 0; - font-weight: 400; - text-decoration: none; - - &:hover { - color: #007FFF; - text-decoration: underline; - } -} - .copy-right-txt { - font-size: rem2(14px); line-height: 1.5; - letter-spacing: 0; font-weight: 400; - color: #3E5060; + letter-spacing: 0; + font-size: rem2(14px); margin-top: rem2(16px); } .social-link-group { display: flex; + align-items: center; flex-flow: row nowrap; justify-content: center; - align-items: center; @include sm { margin-bottom: rem2(8px); diff --git a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Shared/MainLayout.razor b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Shared/MainLayout.razor index ae267a2b11..7cbbc4fd76 100644 --- a/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Shared/MainLayout.razor +++ b/src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Shared/MainLayout.razor @@ -15,9 +15,9 @@ @Body -