diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..1ff0c42 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,63 @@ +############################################################################### +# Set default behavior to automatically normalize line endings. +############################################################################### +* text=auto + +############################################################################### +# Set default behavior for command prompt diff. +# +# This is need for earlier builds of msysgit that does not have it on by +# default for csharp files. +# Note: This is only used by command line +############################################################################### +#*.cs diff=csharp + +############################################################################### +# Set the merge driver for project and solution files +# +# Merging from the command prompt will add diff markers to the files if there +# are conflicts (Merging from VS is not affected by the settings below, in VS +# the diff markers are never inserted). Diff markers may cause the following +# file extensions to fail to load in VS. An alternative would be to treat +# these files as binary and thus will always conflict and require user +# intervention with every merge. To do so, just uncomment the entries below +############################################################################### +#*.sln merge=binary +#*.csproj merge=binary +#*.vbproj merge=binary +#*.vcxproj merge=binary +#*.vcproj merge=binary +#*.dbproj merge=binary +#*.fsproj merge=binary +#*.lsproj merge=binary +#*.wixproj merge=binary +#*.modelproj merge=binary +#*.sqlproj merge=binary +#*.wwaproj merge=binary + +############################################################################### +# behavior for image files +# +# image files are treated as binary by default. +############################################################################### +#*.jpg binary +#*.png binary +#*.gif binary + +############################################################################### +# diff behavior for common document formats +# +# Convert binary document formats to text before diffing them. This feature +# is only available from the command line. Turn it on by uncommenting the +# entries below. +############################################################################### +#*.doc diff=astextplain +#*.DOC diff=astextplain +#*.docx diff=astextplain +#*.DOCX diff=astextplain +#*.dot diff=astextplain +#*.DOT diff=astextplain +#*.pdf diff=astextplain +#*.PDF diff=astextplain +#*.rtf diff=astextplain +#*.RTF diff=astextplain diff --git a/.github/workflows/dotnet-desktop.yml b/.github/workflows/dotnet-desktop.yml new file mode 100644 index 0000000..5a1ba14 --- /dev/null +++ b/.github/workflows/dotnet-desktop.yml @@ -0,0 +1,53 @@ +name: .NET Core Desktop + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + + build: + + strategy: + matrix: + configuration: [Debug, Release] + + runs-on: windows-latest + + env: + Solution_Name: src\framework\kaspirin.sln + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + # Install the .NET Core workload + - name: Install .NET Core + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.0.x + + # Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild + - name: Setup MSBuild.exe + uses: microsoft/setup-msbuild@v2 + + # Execute all unit tests in the solution + - name: Execute unit tests + run: dotnet test --logger trx --results-directory "TestResults-trx" + + - name: Upload dotnet test results + uses: actions/upload-artifact@v3 + with: + name: dotnet-results-trx + path: TestResults-trx + if: ${{ always() }} + + # Restore the application to populate the obj folder with RuntimeIdentifiers + - name: Restore the application + run: msbuild $env:Solution_Name /t:Restore /p:Configuration=$env:Configuration + env: + Configuration: ${{ matrix.configuration }} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8e403db --- /dev/null +++ b/.gitignore @@ -0,0 +1,366 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# Kaspirin Output +src/framework/_*/ + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Oo]ut/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..6cd38ed --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,23 @@ +# CONTRIBUTOR LICENSE AGREEMENT +You accept and agree to the following terms and conditions for Your past, present and future Contributions submitted to the AO Kaspersky Lab (“Company”). +1. Definitions. +"You" (or "Your") shall mean the legal owner of the Contribution that is making this CLA with the Company. For legal entities, the entity making a Contribution and all other entities that control, are controlled by, or are under common control with that entity are considered to be a single Contributor. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. +"Contribution" shall mean any original work of authorship, including any derivative works, modifications or additions to an existing work, that is intentionally submitted by You to the Company for inclusion in, or documentation of, any of the products owned or distributed by the Company (the "Work"). You acknowledge that the Company desires to have all contributions made by You under the terms of this CLA and, thus, this CLA will apply to all of your Contributions submitted both before and after the date of signature. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Company or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Company for the purpose of discussing and improving the Work. +2. Grant of Copyright and Patent Licenses. +Subject to the terms and conditions of this Agreement, You hereby grant to the Company and to recipients of software distributed by the Company a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license, including a license, to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, distribute, or sell Your Contributions and the Work. +Subject to the terms and conditions of this Agreement, You hereby grant to the Company and to recipients of the Work distributed by the Company a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable patent license to make, have made, use, offer to sell, sell, import, distribute, and otherwise transfer Your Contributions and the Work. +3. Ownership and third party rights. +You represent that you are the sole legal owner and are legally entitled to grant the above license for the Contributions. If: +o (A.) your employer(s) has intellectual property or other rights to your Contributions, you represent that you have both (i.) received express, prior, written permission to make Contributions on behalf of that employer; and (ii.) that your employer has waived any of its rights for or claims in your Contributions to the Company, or +o (B.) if another individual or third party has rights to intellectual property to your Contributions – whether as a result of being a co-inventor, assignee, or other right, you represent that you have both (i.) received express, prior, written permission to make Contributions on behalf of that individual or third party; and (ii.) that such individual or third party has waived any of its rights for or claims in your Contributions to the Company. +You will submit such written permission to the Company at the time of the submission of your Contribution. +4. Your original creation. +You represent that each of Your Contributions is Your original creation (see section 5 for submissions on behalf of others). You represent that Your Contribution submissions include complete details (including required attributions and details of applicable license restrictions) of any third-party license or public domain licenses, or other restriction (including, but not limited to, related patents and trademarks) of which you are personally aware or should be aware and which are associated with any part of Your Contributions. +5. Third party owned creation(s). +Should You wish to submit work that is not Your original creation, You may submit it to the Company separately from any Contribution, clearly identifying the complete details of its ownership and source, and any applicable license or other restriction (including, but not limited to, related patents, trademarks, and license agreements) of which you are personally aware, and conspicuously marking the work, for example: "Submitted on behalf of a third-party: [named here].” “Owned by third-party: [named here.]” or “Copyright held by third-party: [named here].” +6. Notification. +You agree to notify the Company of any facts or circumstances of which you become aware that would make these representations inaccurate in any respect, including if you become aware of any third party intellectual property rights that are infringed by your Contributions. +7. Assignment. +Neither party may assign this Agreement without the other party’s consent which will not be unreasonably withheld; however, each party may assign this Agreement without the other party’s consent to an entity or individual that acquires all or substantially all of the business or assets of the assigning party or for an individual acquires all of the intellectual property rights in the Contribution owned by such individual, whether by merger, sale of assets, or otherwise, provided that such entity or individual assumes and agrees in writing to be bound by all of the obligations of the assigning party under this Agreement. +8. Entire agreement. +This Agreement is the entire agreement, both written or oral, with respect to the Contributions between the parties. No amendment, modification or waiver of any provision of this Agreement will be effective unless in writing and signed by both parties. If any provision of this Agreement is held to be invalid or unenforceable, the remaining portions will remain in full force and effect and such provision will be enforced to the maximum extent possible so as to affect the intent of the parties and will be reformed to the extent necessary to make such provision valid and enforceable. All notices and other communications herein permitted or required under this Agreement will be sent by postage prepaid, via registered or certified mail or overnight courier, return receipt requested, or delivered personally to the parties at their respective addresses, or to such other address as either party will give to the other party in the manner provided herein for giving notice. Notice will be considered given upon receipt. diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..7a4a3ea --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/NOTICE.txt b/NOTICE.txt new file mode 100644 index 0000000..27c6d87 --- /dev/null +++ b/NOTICE.txt @@ -0,0 +1,40 @@ +This file contains information about dependencies which are used in the Kaspirin +============================================================================= + +SharpVectors.Reloaded 1.5.0 +Copyright (c) 2010 - 2018, Elinam LLC +All rights reserved. +----------------------------------------------------------------------- +== +the BSD License (three-clause) +== +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. +3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +----------------------------------------------------------------------- + +BidiSharp 0.2 +Copyright (c) 2019 Fayyad Sufyan +----------------------------------------------------------------------- +Distributed under the terms of the MIT License +----------------------------------------------------------------------- + +Microsoft.Xaml.Behavior 1.1.19 +Copyright (c) Microsoft Corporation +----------------------------------------------------------------------- +Distributed under the terms of the MIT License +----------------------------------------------------------------------- + +== + +the MIT License + +== + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the"Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..3036d33 --- /dev/null +++ b/README.md @@ -0,0 +1,90 @@ + Kaspirin + + # Kaspirin Documentation + +This documentation provides a brief overview of the key functionality provided by the Kaspirin platform, which consists of the following projects: + +* Kaspirin.UI.Framework +* Kaspirin.UI.Framework.UiKit +* Kaspirin.UI.Framework.UiKit.Media +* Kaspirin.UI.Framework.UiKit.Styles +* Kaspirin.UI.Framework.UiKit.Translator.Core +* Kaspirin.UI.Framework.UiKit.Translator.Launcher + +Kaspirin is an extension of the WPF platform, so all solutions implemented in Kaspirin will also work in other WPF projects. + +## Kaspirin.UI.Framework + +Kaspirin.UI.Framework is a set of basic services and tools designed to help developers create high-quality, maintainable, and efficient applications with a user interface or console applications. + +### Key Features +* Custom IoC container implementation +* Basic classes for implementing the MVVM approach +* Services for organizing logging in the application +* A wide range of protective methods (Guards) for data validation +* Various tools for working with multithreading +* A set of convenient extension methods for working with collections, dictionaries, strings, and other data types + +## Kaspirin.UI.Framework.UiKit + +Kaspirin.UI.Framework.UiKit provides a large set of ready-to-use tools that allow you to solve typical problems that developers face when creating a user interface for OS Windows applications. + +### Key Features + +* Custom system for organizing UI element styles, separating style into two components: a common template and a visual component loaded from Figma +* A large set of custom UI elements, converters, and other tools that simplify the development of the user interface +* Convenient localization system that works with over 30 languages +* Built-in support for light and dark themes +* Tools for working with animations + +## Kaspirin.UI.Framework.UiKit.Styles and Kaspirin.UI.Framework.UiKit.Media + +These assemblies consist mainly of auto-generated files created during the style translation procedure from Figma. + +* Kaspirin.UI.Framework.UiKit.Media contains examples of SVG illustrations (a set for light and dark themes) and auxiliary tools for their use in XAML. +* Kaspirin.UI.Framework.UiKit.Styles contains generated styles for UI elements, describing the visual component, as well as a palette and a set of text styles. + +## Kaspirin.UI.Framework.UiKit.Translator.Core and Kaspirin.UI.Framework.UiKit.Translator.Launcher + +These assemblies provide one of the key features of Kaspirin - translation of styles loaded from Figma into XAML format. This style translation mechanism allows you to create and configure the visual representation of UI elements in Figma and then use it in your application. + +### What can be converted from Figma + +* Figma UI component styles (element colors in different states, margins, sizes, etc.) +* Icons and illustrations in SVG format +* Palette for light and dark themes +* A set of test styles + +Figma plugin that performs page parsing will be published at a later date. + +Currently, the resulting file UI_KIT.xml is available, which demonstrates all the data loaded from Figma. + +## Getting Started + +To get started with Kaspirin, you need to: + +1. Create a new WPF Application project; +2. Add references to packages: + * Kaspirin.UI.Framework + * Kaspirin.UI.Framework.UiKit + * Kaspirin.UI.Framework.UiKit.Styles + * Kaspirin.UI.Framework.UiKit.Media; +3. Add to Application.Resources: + * a link to the Visuals.xaml dictionary from Kaspirin.UI.Framework.UiKit.Styles +4. Add to the application initialization code the following steps: + * Initialization of logging + * Initialization of the container + * Initialization of the localization manager + +## Releases + +Currently we expect that the project will be regularly updated with new functionality and improvements that we would like to share with you. Also, it is possible that some functionality may be removed from the project over time. Therefore, we cannot guarantee full backward compatibility of new Kaspirin releases with previous ones. + +## Contribution + +This is an open source project. If you are interested in making a code contribution, please see [CONTRIBUTING.md](CONTRIBUTING.md) for more information. + +## License + +Copyright © 2024 AO Kaspersky Lab +Licensed under the Apache 2.0 License. See the [LICENSE.txt](LICENSE.txt) file in the root directory for details. \ No newline at end of file diff --git a/docs/logo.png b/docs/logo.png new file mode 100644 index 0000000..d34c16d Binary files /dev/null and b/docs/logo.png differ diff --git a/src/figma/Schema/Badge.xsd b/src/figma/Schema/Badge.xsd new file mode 100644 index 0000000..b2bda12 --- /dev/null +++ b/src/figma/Schema/Badge.xsd @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/figma/Schema/Bullet.xsd b/src/figma/Schema/Bullet.xsd new file mode 100644 index 0000000..b7cd1a3 --- /dev/null +++ b/src/figma/Schema/Bullet.xsd @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/figma/Schema/Button.xsd b/src/figma/Schema/Button.xsd new file mode 100644 index 0000000..347d0cb --- /dev/null +++ b/src/figma/Schema/Button.xsd @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/figma/Schema/CarouselItem.xsd b/src/figma/Schema/CarouselItem.xsd new file mode 100644 index 0000000..4710744 --- /dev/null +++ b/src/figma/Schema/CarouselItem.xsd @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/figma/Schema/CheckBoxRadioButton.xsd b/src/figma/Schema/CheckBoxRadioButton.xsd new file mode 100644 index 0000000..46c579e --- /dev/null +++ b/src/figma/Schema/CheckBoxRadioButton.xsd @@ -0,0 +1,125 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/figma/Schema/ChipsControl.xsd b/src/figma/Schema/ChipsControl.xsd new file mode 100644 index 0000000..acf067c --- /dev/null +++ b/src/figma/Schema/ChipsControl.xsd @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/figma/Schema/ChipsItem.xsd b/src/figma/Schema/ChipsItem.xsd new file mode 100644 index 0000000..5ac60aa --- /dev/null +++ b/src/figma/Schema/ChipsItem.xsd @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/figma/Schema/CodeInput.xsd b/src/figma/Schema/CodeInput.xsd new file mode 100644 index 0000000..779e32e --- /dev/null +++ b/src/figma/Schema/CodeInput.xsd @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/figma/Schema/Common.xsd b/src/figma/Schema/Common.xsd new file mode 100644 index 0000000..d70ba9e --- /dev/null +++ b/src/figma/Schema/Common.xsd @@ -0,0 +1,288 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/figma/Schema/ContentButton.xsd b/src/figma/Schema/ContentButton.xsd new file mode 100644 index 0000000..9f085a6 --- /dev/null +++ b/src/figma/Schema/ContentButton.xsd @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/figma/Schema/ContextMenu.xsd b/src/figma/Schema/ContextMenu.xsd new file mode 100644 index 0000000..ecd0686 --- /dev/null +++ b/src/figma/Schema/ContextMenu.xsd @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/figma/Schema/DateTimeInput.xsd b/src/figma/Schema/DateTimeInput.xsd new file mode 100644 index 0000000..22378df --- /dev/null +++ b/src/figma/Schema/DateTimeInput.xsd @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/figma/Schema/DateTimePopupFooterButton.xsd b/src/figma/Schema/DateTimePopupFooterButton.xsd new file mode 100644 index 0000000..f4f0718 --- /dev/null +++ b/src/figma/Schema/DateTimePopupFooterButton.xsd @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/figma/Schema/DateTimePopupItemButton.xsd b/src/figma/Schema/DateTimePopupItemButton.xsd new file mode 100644 index 0000000..852c16b --- /dev/null +++ b/src/figma/Schema/DateTimePopupItemButton.xsd @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/figma/Schema/DateTimePopupPresenter.xsd b/src/figma/Schema/DateTimePopupPresenter.xsd new file mode 100644 index 0000000..ab272f8 --- /dev/null +++ b/src/figma/Schema/DateTimePopupPresenter.xsd @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/figma/Schema/Divider.xsd b/src/figma/Schema/Divider.xsd new file mode 100644 index 0000000..cfc28c8 --- /dev/null +++ b/src/figma/Schema/Divider.xsd @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/figma/Schema/Hyperlink.xsd b/src/figma/Schema/Hyperlink.xsd new file mode 100644 index 0000000..ca29296 --- /dev/null +++ b/src/figma/Schema/Hyperlink.xsd @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/figma/Schema/Icon.xsd b/src/figma/Schema/Icon.xsd new file mode 100644 index 0000000..7abf1f2 --- /dev/null +++ b/src/figma/Schema/Icon.xsd @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/figma/Schema/IconButton.xsd b/src/figma/Schema/IconButton.xsd new file mode 100644 index 0000000..8a7ab13 --- /dev/null +++ b/src/figma/Schema/IconButton.xsd @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/figma/Schema/Illustration.xsd b/src/figma/Schema/Illustration.xsd new file mode 100644 index 0000000..9e1ad98 --- /dev/null +++ b/src/figma/Schema/Illustration.xsd @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/figma/Schema/ImageGallery.xsd b/src/figma/Schema/ImageGallery.xsd new file mode 100644 index 0000000..43271cc --- /dev/null +++ b/src/figma/Schema/ImageGallery.xsd @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/figma/Schema/ImageGalleryButton.xsd b/src/figma/Schema/ImageGalleryButton.xsd new file mode 100644 index 0000000..ccb880d --- /dev/null +++ b/src/figma/Schema/ImageGalleryButton.xsd @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/figma/Schema/ImageGalleryList.xsd b/src/figma/Schema/ImageGalleryList.xsd new file mode 100644 index 0000000..295cbf4 --- /dev/null +++ b/src/figma/Schema/ImageGalleryList.xsd @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/figma/Schema/ImageGalleryListButton.xsd b/src/figma/Schema/ImageGalleryListButton.xsd new file mode 100644 index 0000000..fc9e66f --- /dev/null +++ b/src/figma/Schema/ImageGalleryListButton.xsd @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/figma/Schema/InteractivityDialog.xsd b/src/figma/Schema/InteractivityDialog.xsd new file mode 100644 index 0000000..04e7ae1 --- /dev/null +++ b/src/figma/Schema/InteractivityDialog.xsd @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/figma/Schema/InteractivityNotification.xsd b/src/figma/Schema/InteractivityNotification.xsd new file mode 100644 index 0000000..408b2aa --- /dev/null +++ b/src/figma/Schema/InteractivityNotification.xsd @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/figma/Schema/InteractivityOverlay.xsd b/src/figma/Schema/InteractivityOverlay.xsd new file mode 100644 index 0000000..c52aa0e --- /dev/null +++ b/src/figma/Schema/InteractivityOverlay.xsd @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/figma/Schema/Island.xsd b/src/figma/Schema/Island.xsd new file mode 100644 index 0000000..79227b2 --- /dev/null +++ b/src/figma/Schema/Island.xsd @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/figma/Schema/IslandButton.xsd b/src/figma/Schema/IslandButton.xsd new file mode 100644 index 0000000..bd9ed02 --- /dev/null +++ b/src/figma/Schema/IslandButton.xsd @@ -0,0 +1,134 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/figma/Schema/IslandToggleButton.xsd b/src/figma/Schema/IslandToggleButton.xsd new file mode 100644 index 0000000..238d627 --- /dev/null +++ b/src/figma/Schema/IslandToggleButton.xsd @@ -0,0 +1,230 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/figma/Schema/ListMenuItem.xsd b/src/figma/Schema/ListMenuItem.xsd new file mode 100644 index 0000000..d875a24 --- /dev/null +++ b/src/figma/Schema/ListMenuItem.xsd @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/figma/Schema/MenuItem.xsd b/src/figma/Schema/MenuItem.xsd new file mode 100644 index 0000000..8a2a71b --- /dev/null +++ b/src/figma/Schema/MenuItem.xsd @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/figma/Schema/NavigationMenuButton.xsd b/src/figma/Schema/NavigationMenuButton.xsd new file mode 100644 index 0000000..c306a68 --- /dev/null +++ b/src/figma/Schema/NavigationMenuButton.xsd @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/figma/Schema/NavigationMenuFooterButton.xsd b/src/figma/Schema/NavigationMenuFooterButton.xsd new file mode 100644 index 0000000..613bff9 --- /dev/null +++ b/src/figma/Schema/NavigationMenuFooterButton.xsd @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/figma/Schema/NotificationHint.xsd b/src/figma/Schema/NotificationHint.xsd new file mode 100644 index 0000000..5458756 --- /dev/null +++ b/src/figma/Schema/NotificationHint.xsd @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/figma/Schema/NotificationPanel.xsd b/src/figma/Schema/NotificationPanel.xsd new file mode 100644 index 0000000..88d2855 --- /dev/null +++ b/src/figma/Schema/NotificationPanel.xsd @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/figma/Schema/NotificationSpinner.xsd b/src/figma/Schema/NotificationSpinner.xsd new file mode 100644 index 0000000..9b2ec5a --- /dev/null +++ b/src/figma/Schema/NotificationSpinner.xsd @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/figma/Schema/NumberInput.xsd b/src/figma/Schema/NumberInput.xsd new file mode 100644 index 0000000..e18a23a --- /dev/null +++ b/src/figma/Schema/NumberInput.xsd @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/figma/Schema/Palette.xsd b/src/figma/Schema/Palette.xsd new file mode 100644 index 0000000..aa13099 --- /dev/null +++ b/src/figma/Schema/Palette.xsd @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/figma/Schema/PasswordInput.xsd b/src/figma/Schema/PasswordInput.xsd new file mode 100644 index 0000000..66f5c30 --- /dev/null +++ b/src/figma/Schema/PasswordInput.xsd @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/figma/Schema/Popup.xsd b/src/figma/Schema/Popup.xsd new file mode 100644 index 0000000..415f860 --- /dev/null +++ b/src/figma/Schema/Popup.xsd @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/figma/Schema/ProgressBar.xsd b/src/figma/Schema/ProgressBar.xsd new file mode 100644 index 0000000..246c6e2 --- /dev/null +++ b/src/figma/Schema/ProgressBar.xsd @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/figma/Schema/RoundProgress.xsd b/src/figma/Schema/RoundProgress.xsd new file mode 100644 index 0000000..f340d3c --- /dev/null +++ b/src/figma/Schema/RoundProgress.xsd @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/figma/Schema/RoundTimer.xsd b/src/figma/Schema/RoundTimer.xsd new file mode 100644 index 0000000..4889d4c --- /dev/null +++ b/src/figma/Schema/RoundTimer.xsd @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/figma/Schema/ScrollBar.xsd b/src/figma/Schema/ScrollBar.xsd new file mode 100644 index 0000000..2f2631c --- /dev/null +++ b/src/figma/Schema/ScrollBar.xsd @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/figma/Schema/Search.xsd b/src/figma/Schema/Search.xsd new file mode 100644 index 0000000..990819b --- /dev/null +++ b/src/figma/Schema/Search.xsd @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/figma/Schema/Select.xsd b/src/figma/Schema/Select.xsd new file mode 100644 index 0000000..32b6fce --- /dev/null +++ b/src/figma/Schema/Select.xsd @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/figma/Schema/SelectItem.xsd b/src/figma/Schema/SelectItem.xsd new file mode 100644 index 0000000..3e379a8 --- /dev/null +++ b/src/figma/Schema/SelectItem.xsd @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/figma/Schema/SelectPresenter.xsd b/src/figma/Schema/SelectPresenter.xsd new file mode 100644 index 0000000..45ee756 --- /dev/null +++ b/src/figma/Schema/SelectPresenter.xsd @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/figma/Schema/SelectableText.xsd b/src/figma/Schema/SelectableText.xsd new file mode 100644 index 0000000..695ebe4 --- /dev/null +++ b/src/figma/Schema/SelectableText.xsd @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/figma/Schema/Spinner.xsd b/src/figma/Schema/Spinner.xsd new file mode 100644 index 0000000..ffb0f1f --- /dev/null +++ b/src/figma/Schema/Spinner.xsd @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/figma/Schema/SplitButton.xsd b/src/figma/Schema/SplitButton.xsd new file mode 100644 index 0000000..16e7c08 --- /dev/null +++ b/src/figma/Schema/SplitButton.xsd @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/figma/Schema/SsoButton.xsd b/src/figma/Schema/SsoButton.xsd new file mode 100644 index 0000000..87583c3 --- /dev/null +++ b/src/figma/Schema/SsoButton.xsd @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/figma/Schema/StatusBullet.xsd b/src/figma/Schema/StatusBullet.xsd new file mode 100644 index 0000000..1cf3962 --- /dev/null +++ b/src/figma/Schema/StatusBullet.xsd @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/figma/Schema/StatusTag.xsd b/src/figma/Schema/StatusTag.xsd new file mode 100644 index 0000000..b574fa2 --- /dev/null +++ b/src/figma/Schema/StatusTag.xsd @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/figma/Schema/SvgIcon.xsd b/src/figma/Schema/SvgIcon.xsd new file mode 100644 index 0000000..4f45b2c --- /dev/null +++ b/src/figma/Schema/SvgIcon.xsd @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/figma/Schema/Switch.xsd b/src/figma/Schema/Switch.xsd new file mode 100644 index 0000000..cbb884f --- /dev/null +++ b/src/figma/Schema/Switch.xsd @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/figma/Schema/TabMenu.xsd b/src/figma/Schema/TabMenu.xsd new file mode 100644 index 0000000..7251454 --- /dev/null +++ b/src/figma/Schema/TabMenu.xsd @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/figma/Schema/TabMenuItem.xsd b/src/figma/Schema/TabMenuItem.xsd new file mode 100644 index 0000000..c671755 --- /dev/null +++ b/src/figma/Schema/TabMenuItem.xsd @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/figma/Schema/Tag.xsd b/src/figma/Schema/Tag.xsd new file mode 100644 index 0000000..bc811e5 --- /dev/null +++ b/src/figma/Schema/Tag.xsd @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/figma/Schema/TextArea.xsd b/src/figma/Schema/TextArea.xsd new file mode 100644 index 0000000..137a21c --- /dev/null +++ b/src/figma/Schema/TextArea.xsd @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/figma/Schema/TextInput.xsd b/src/figma/Schema/TextInput.xsd new file mode 100644 index 0000000..a12c628 --- /dev/null +++ b/src/figma/Schema/TextInput.xsd @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/figma/Schema/TextStyle.xsd b/src/figma/Schema/TextStyle.xsd new file mode 100644 index 0000000..079f066 --- /dev/null +++ b/src/figma/Schema/TextStyle.xsd @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/figma/Schema/TextViewer.xsd b/src/figma/Schema/TextViewer.xsd new file mode 100644 index 0000000..4a9ea2e --- /dev/null +++ b/src/figma/Schema/TextViewer.xsd @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/figma/Schema/ToolTip.xsd b/src/figma/Schema/ToolTip.xsd new file mode 100644 index 0000000..2e29a69 --- /dev/null +++ b/src/figma/Schema/ToolTip.xsd @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/figma/Schema/UiKit.xsd b/src/figma/Schema/UiKit.xsd new file mode 100644 index 0000000..c44bd33 --- /dev/null +++ b/src/figma/Schema/UiKit.xsd @@ -0,0 +1,558 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/figma/Schema/Vector.xsd b/src/figma/Schema/Vector.xsd new file mode 100644 index 0000000..db51047 --- /dev/null +++ b/src/figma/Schema/Vector.xsd @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/figma/plugin_output/UI_KIT.xml b/src/figma/plugin_output/UI_KIT.xml new file mode 100644 index 0000000..396592b --- /dev/null +++ b/src/figma/plugin_output/UI_KIT.xml @@ -0,0 +1,8901 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg"> +<path fill-rule="evenodd" clip-rule="evenodd" d="M6 0.75C6 0.335786 6.33747 -0.00491726 6.74851 0.0462347C9.70897 0.414647 12 2.93977 12 6C12 9.31371 9.31371 12 6 12C2.93977 12 0.414647 9.70897 0.0462348 6.74851C-0.00491724 6.33747 0.335786 6 0.75 6C1.16421 6 1.49345 6.33831 1.56169 6.74686C1.91746 8.87669 3.76916 10.5 6 10.5C8.48528 10.5 10.5 8.48528 10.5 6C10.5 3.76916 8.87669 1.91746 6.74686 1.56169C6.33831 1.49345 6 1.16421 6 0.75Z" fill="#1DA189"/> +</svg> + + + + + + + + + + + <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"> +<path fill-rule="evenodd" clip-rule="evenodd" d="M8 1C8 0.447715 8.44996 -0.00655635 8.99801 0.0616463C12.9453 0.552862 16 3.9197 16 8C16 12.4183 12.4183 16 8 16C3.9197 16 0.552863 12.9453 0.0616464 8.99801C-0.00655632 8.44996 0.447715 8 1 8C1.55228 8 1.99127 8.45107 2.08226 8.99581C2.55661 11.8356 5.02554 14 8 14C11.3137 14 14 11.3137 14 8C14 5.02554 11.8356 2.55661 8.99581 2.08226C8.45108 1.99127 8 1.55228 8 1Z" fill="#1DA189"/> +</svg> + + + + + + + + + + + <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> +<path fill-rule="evenodd" clip-rule="evenodd" d="M12 1C12 0.447715 12.4493 -0.00434558 12.9997 0.041049C19.1594 0.549057 24 5.70923 24 12C24 18.6274 18.6274 24 12 24C5.70923 24 0.549057 19.1594 0.041049 12.9997C-0.00434557 12.4493 0.447715 12 1 12C1.55228 12 1.99475 12.449 2.04924 12.9986C2.55031 18.0526 6.81417 22 12 22C17.5228 22 22 17.5228 22 12C22 6.81417 18.0526 2.55031 12.9986 2.04924C12.449 1.99475 12 1.55228 12 1Z" fill="#1DA189"/> +</svg> + + + + + + + + + + + <svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"> +<path fill-rule="evenodd" clip-rule="evenodd" d="M24 2C24 0.895431 24.8986 -0.00869116 25.9994 0.0820979C38.3187 1.09811 48 11.4185 48 24C48 37.2548 37.2548 48 24 48C11.4185 48 1.09811 38.3187 0.082098 25.9994C-0.00869114 24.8986 0.895431 24 2 24C3.10457 24 3.98949 24.898 4.09847 25.9972C5.10062 36.1052 13.6283 44 24 44C35.0457 44 44 35.0457 44 24C44 13.6283 36.1052 5.10062 25.9972 4.09847C24.898 3.9895 24 3.10457 24 2Z" fill="#1DA189"/> +</svg> + + + + + + + + + + + <svg width="64" height="64" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg"> +<path fill-rule="evenodd" clip-rule="evenodd" d="M30 2C30 0.89543 30.8954 0 32 0C38.329 1.19209e-07 44.5159 1.87677 49.7782 5.39297C55.0406 8.90918 59.1421 13.9069 61.5641 19.7541C63.9861 25.6014 64.6199 32.0355 63.3851 38.2429C62.1504 44.4503 59.1027 50.1521 54.6274 54.6274C50.1521 59.1027 44.4503 62.1504 38.2429 63.3851C32.0355 64.6199 25.6014 63.9861 19.7541 61.5641C13.9069 59.1421 8.90918 55.0406 5.39297 49.7782C1.87677 44.5159 -2.38419e-07 38.329 0 32C0 30.8954 0.895431 30 2 30C3.10457 30 4 30.8954 4 32C4 37.5379 5.64217 42.9514 8.71885 47.556C11.7955 52.1605 16.1685 55.7494 21.2849 57.8686C26.4012 59.9879 32.0311 60.5424 37.4625 59.462C42.894 58.3816 47.8831 55.7149 51.799 51.799C55.7149 47.8831 58.3816 42.894 59.462 37.4625C60.5424 32.0311 59.9879 26.4012 57.8686 21.2849C55.7494 16.1685 52.1605 11.7955 47.556 8.71885C42.9514 5.64217 37.5379 4 32 4C30.8954 4 30 3.10457 30 2Z" fill="#1DA189"/> +</svg> + + + + + + + + + + + <svg width="8" height="8" viewBox="0 0 8 8" fill="none" xmlns="http://www.w3.org/2000/svg"> +<path fill-rule="evenodd" clip-rule="evenodd" d="M4 0.5C4 0.223858 4.22498 -0.00327817 4.49901 0.0308232C6.47264 0.276431 8 1.95985 8 4C8 6.20914 6.20914 8 4 8C1.95985 8 0.276431 6.47264 0.0308232 4.49901C-0.00327816 4.22498 0.223858 4 0.5 4C0.776142 4 0.995633 4.22554 1.04113 4.49791C1.2783 5.91779 2.51277 7 4 7C5.65685 7 7 5.65685 7 4C7 2.51277 5.91779 1.2783 4.49791 1.04113C4.22554 0.995633 4 0.776142 4 0.5Z" fill="#1DA189"/> +</svg> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <svg width="13" height="6" viewBox="0 0 13 6" fill="none" xmlns="http://www.w3.org/2000/svg"> +<path fill-rule="evenodd" clip-rule="evenodd" d="M12.5 0L7.20711 5.29289C6.81658 5.68342 6.18342 5.68342 5.79289 5.29289L0.5 0L12.5 0Z" fill="#DB3545"/> +</svg> + + + + + + <svg width="6" height="12" viewBox="0 0 6 12" fill="none" xmlns="http://www.w3.org/2000/svg"> +<path fill-rule="evenodd" clip-rule="evenodd" d="M6 12L0.707107 6.70711C0.316583 6.31658 0.316583 5.68342 0.707107 5.29289L6 0V12Z" fill="#DB3545"/> +</svg> + + + + + + <svg width="6" height="12" viewBox="0 0 6 12" fill="none" xmlns="http://www.w3.org/2000/svg"> +<path fill-rule="evenodd" clip-rule="evenodd" d="M0 0L5.29289 5.29289C5.68342 5.68342 5.68342 6.31658 5.29289 6.70711L0 12L0 0Z" fill="#DB3545"/> +</svg> + + + + + + <svg width="13" height="6" viewBox="0 0 13 6" fill="none" xmlns="http://www.w3.org/2000/svg"> +<path fill-rule="evenodd" clip-rule="evenodd" d="M0.5 6L5.79289 0.707107C6.18342 0.316583 6.81658 0.316583 7.20711 0.707107L12.5 6L0.5 6Z" fill="#DB3545"/> +</svg> + + + + + + + + + + + + + + + + + + + + + + <svg width="13" height="6" viewBox="0 0 13 6" fill="none" xmlns="http://www.w3.org/2000/svg"> +<path fill-rule="evenodd" clip-rule="evenodd" d="M12.5 0L7.20711 5.29289C6.81658 5.68342 6.18342 5.68342 5.79289 5.29289L0.5 0L12.5 0Z" fill="#2A3541" fill-opacity="0.95"/> +</svg> + + + + + + <svg width="6" height="12" viewBox="0 0 6 12" fill="none" xmlns="http://www.w3.org/2000/svg"> +<path fill-rule="evenodd" clip-rule="evenodd" d="M6 12L0.707107 6.70711C0.316583 6.31658 0.316583 5.68342 0.707107 5.29289L6 0V12Z" fill="#2A3541" fill-opacity="0.95"/> +</svg> + + + + + + <svg width="6" height="12" viewBox="0 0 6 12" fill="none" xmlns="http://www.w3.org/2000/svg"> +<path fill-rule="evenodd" clip-rule="evenodd" d="M0 0L5.29289 5.29289C5.68342 5.68342 5.68342 6.31658 5.29289 6.70711L0 12L0 0Z" fill="#2A3541" fill-opacity="0.95"/> +</svg> + + + + + + <svg width="13" height="6" viewBox="0 0 13 6" fill="none" xmlns="http://www.w3.org/2000/svg"> +<path fill-rule="evenodd" clip-rule="evenodd" d="M0.5 6L5.79289 0.707107C6.18342 0.316583 6.81658 0.316583 7.20711 0.707107L12.5 6L0.5 6Z" fill="#2A3541" fill-opacity="0.95"/> +</svg> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <svg width="10" height="8" viewBox="0 0 10 8" fill="none" xmlns="http://www.w3.org/2000/svg"> +<path fill-rule="evenodd" clip-rule="evenodd" d="M9.36395 0.233155C9.7999 0.572225 9.87843 1.2005 9.53936 1.63645L4.93802 7.55247C4.5486 8.05315 3.81756 8.12161 3.34195 7.70195L0.58839 5.27234C0.174266 4.90694 0.134771 4.27501 0.500174 3.86089C0.865578 3.44676 1.49751 3.40727 1.91163 3.77267L3.94719 5.56875L7.96066 0.408566C8.29973 -0.0273809 8.92801 -0.105915 9.36395 0.233155Z" fill="#F5F8FB"/> +</svg> + + + + + + <svg width="8" height="2" viewBox="0 0 8 2" fill="none" xmlns="http://www.w3.org/2000/svg"> +<path fill-rule="evenodd" clip-rule="evenodd" d="M0 1C0 0.447715 0.447715 0 1 0H7C7.55228 0 8 0.447715 8 1C8 1.55228 7.55228 2 7 2H1C0.447715 2 0 1.55228 0 1Z" fill="#F5F8FB"/> +</svg> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <svg width="8" height="8" viewBox="0 0 8 8" fill="none" xmlns="http://www.w3.org/2000/svg"> +<circle cx="4" cy="4" r="4" fill="#1DA189"/> +</svg> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <svg width="8" height="8" viewBox="0 0 8 8" fill="none" xmlns="http://www.w3.org/2000/svg"> +<circle cx="4" cy="4" r="4" fill="#B2B8BF"/> +</svg> + + + + + + + + + + + + + + + + + + + + + + + + + + + <svg width="8" height="8" viewBox="0 0 8 8" fill="none" xmlns="http://www.w3.org/2000/svg"> +<circle cx="4" cy="4" r="4" fill="#B2B8BF"/> +</svg> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" viewBox="0 0 12 12"><path stroke="#000" d="M1.5 1.5h9v9h-9z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" viewBox="0 0 12 12"><path stroke="#000" d="M1.5 1.5h9v9h-9z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" viewBox="0 0 12 12"><path stroke="#000" d="M1.5 1.5h9v9h-9z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path stroke="#000" d="M1.5 1.5h13v13h-13z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path stroke="#000" d="M1.5 1.5h13v13h-13z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path stroke="#000" d="M1.5 1.5h13v13h-13z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path stroke="#000" d="M1.5 1.5h13v13h-13z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path stroke="#000" d="M1.5 1.5h13v13h-13z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path stroke="#000" d="M1.5 1.5h13v13h-13z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path stroke="#000" d="M1.5 1.5h13v13h-13z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path stroke="#000" d="M1.5 1.5h13v13h-13z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path stroke="#000" d="M1.5 1.5h13v13h-13z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path stroke="#000" d="M1.5 1.5h13v13h-13z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path stroke="#000" d="M1.5 1.5h13v13h-13z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path stroke="#000" d="M1.5 1.5h13v13h-13z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path stroke="#000" d="M1.5 1.5h13v13h-13z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path stroke="#000" d="M1.5 1.5h13v13h-13z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path stroke="#000" d="M1.5 1.5h13v13h-13z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path stroke="#000" d="M1.5 1.5h13v13h-13z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path stroke="#000" d="M1.5 1.5h13v13h-13z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path stroke="#000" d="M1.5 1.5h13v13h-13z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path stroke="#000" d="M1.5 1.5h13v13h-13z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path stroke="#000" d="M1.5 1.5h13v13h-13z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path stroke="#000" d="M1.5 1.5h13v13h-13z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path stroke="#000" d="M1.5 1.5h13v13h-13z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path stroke="#000" d="M1.5 1.5h13v13h-13z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path stroke="#000" d="M1.5 1.5h13v13h-13z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path stroke="#000" d="M1.5 1.5h13v13h-13z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path stroke="#000" d="M1.5 1.5h13v13h-13z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path stroke="#000" d="M1.5 1.5h13v13h-13z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path stroke="#000" d="M1.5 1.5h13v13h-13z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path stroke="#000" d="M1.5 1.5h13v13h-13z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path stroke="#000" d="M1.5 1.5h13v13h-13z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path stroke="#000" d="M1.5 1.5h13v13h-13z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path stroke="#000" d="M1.5 1.5h13v13h-13z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path stroke="#000" d="M1.5 1.5h13v13h-13z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path stroke="#000" d="M1.5 1.5h13v13h-13z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path stroke="#000" d="M1.5 1.5h13v13h-13z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path stroke="#000" d="M1.5 1.5h13v13h-13z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path stroke="#000" d="M1.5 1.5h13v13h-13z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path stroke="#000" d="M1.5 1.5h13v13h-13z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path stroke="#000" d="M1.5 1.5h13v13h-13z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path stroke="#000" d="M1.5 1.5h13v13h-13z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path stroke="#000" d="M1.5 1.5h13v13h-13z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path stroke="#000" d="M1.5 1.5h13v13h-13z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path stroke="#000" d="M1.5 1.5h13v13h-13z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="#000" d="M3.5 3.5h17v17h-17z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="#000" d="M3.5 3.5h17v17h-17z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="#000" d="M3.5 3.5h17v17h-17z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="#000" d="M3.5 3.5h17v17h-17z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="#000" d="M3.5 3.5h17v17h-17z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="#000" d="M3.5 3.5h17v17h-17z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="#000" d="M3.5 3.5h17v17h-17z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="#000" d="M3.5 3.5h17v17h-17z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="#000" d="M3.5 3.5h17v17h-17z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="#000" d="M3.5 3.5h17v17h-17z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="#000" d="M3.5 3.5h17v17h-17z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="#000" d="M3.5 3.5h17v17h-17z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="#000" d="M3.5 3.5h17v17h-17z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="#000" d="M3.5 3.5h17v17h-17z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="#000" d="M3.5 3.5h17v17h-17z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="#000" d="M3.5 3.5h17v17h-17z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="#000" d="M3.5 3.5h17v17h-17z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="#000" d="M3.5 3.5h17v17h-17z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="#000" d="M3.5 3.5h17v17h-17z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="#000" d="M3.5 3.5h17v17h-17z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="#000" d="M3.5 3.5h17v17h-17z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="#000" d="M3.5 3.5h17v17h-17z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="#000" d="M3.5 3.5h17v17h-17z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="#000" d="M3.5 3.5h17v17h-17z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="#000" d="M3.5 3.5h17v17h-17z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="#000" d="M3.5 3.5h17v17h-17z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="#000" d="M3.5 3.5h17v17h-17z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="#000" d="M3.5 3.5h17v17h-17z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="#000" d="M3.5 3.5h17v17h-17z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="#000" d="M3.5 3.5h17v17h-17z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="#000" d="M3.5 3.5h17v17h-17z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="#000" d="M3.5 3.5h17v17h-17z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="#000" d="M3.5 3.5h17v17h-17z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="#000" d="M3.5 3.5h17v17h-17z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="#000" d="M3.5 3.5h17v17h-17z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="#000" d="M3.5 3.5h17v17h-17z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="#000" d="M3.5 3.5h17v17h-17z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="#000" d="M3.5 3.5h17v17h-17z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="#000" d="M3.5 3.5h17v17h-17z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="#000" d="M3.5 3.5h17v17h-17z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="#000" d="M3.5 3.5h17v17h-17z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="#000" d="M3.5 3.5h17v17h-17z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="#000" d="M3.5 3.5h17v17h-17z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="none" viewBox="0 0 32 32"><path stroke="#000" d="M4.5 4.5h23v23h-23z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" fill="none" viewBox="0 0 48 48"><path stroke="#000" d="M4.5 4.5h39v39h-39z"/></svg> + + + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" fill="none"><path fill="#CCC" d="M45 10H15a5 5 0 0 0-5 5v30a5 5 0 0 0 5 5h30a5 5 0 0 0 5-5V15a5 5 0 0 0-5-5Z"/><path fill="#666" d="M35 20H25a5 5 0 0 0-5 5v10a5 5 0 0 0 5 5h10a5 5 0 0 0 5-5V25a5 5 0 0 0-5-5Zm7-18 20 20H42V2Zm-2 43H20a5 5 0 0 0 0 10h20a5 5 0 0 0 0-10Z"/><path stroke="#000" stroke-width="2" d="M57 2H7a5 5 0 0 0-5 5v50a5 5 0 0 0 5 5h50a5 5 0 0 0 5-5V7a5 5 0 0 0-5-5Z"/></svg> + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" fill="none"><path fill="#333" d="M45 10H15a5 5 0 0 0-5 5v30a5 5 0 0 0 5 5h30a5 5 0 0 0 5-5V15a5 5 0 0 0-5-5Z"/><path fill="#555" d="M35 20H25a5 5 0 0 0-5 5v10a5 5 0 0 0 5 5h10a5 5 0 0 0 5-5V25a5 5 0 0 0-5-5Zm7-18 20 20H42V2Zm-2 43H20a5 5 0 0 0 0 10h20a5 5 0 0 0 0-10Z"/><path stroke="#fff" stroke-width="2" d="M57 2H7a5 5 0 0 0-5 5v50a5 5 0 0 0 5 5h50a5 5 0 0 0 5-5V7a5 5 0 0 0-5-5Z"/></svg> + + + + + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" fill="none"><path fill="#CCC" d="M45 10H15a5 5 0 0 0-5 5v30a5 5 0 0 0 5 5h30a5 5 0 0 0 5-5V15a5 5 0 0 0-5-5Z"/><path fill="#666" d="M25 24H15a5 5 0 0 0-5 5v10a5 5 0 0 0 5 5h10a5 5 0 0 0 5-5V29a5 5 0 0 0-5-5Z"/><path fill="#666" d="m10 30 20 20H10V30Z"/><path fill="#666" d="M45 40H25a5 5 0 0 0 0 10h20a5 5 0 0 0 0-10Z"/><path stroke="#000" stroke-width="2" d="M57 2H7a5 5 0 0 0-5 5v50a5 5 0 0 0 5 5h50a5 5 0 0 0 5-5V7a5 5 0 0 0-5-5Z"/></svg> + + + + + + + <svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" fill="none"><path fill="#333" d="M45 10H15a5 5 0 0 0-5 5v30a5 5 0 0 0 5 5h30a5 5 0 0 0 5-5V15a5 5 0 0 0-5-5Z"/><path fill="#555" d="M25 25H15a5 5 0 0 0-5 5v10a5 5 0 0 0 5 5h10a5 5 0 0 0 5-5V30a5 5 0 0 0-5-5Z"/><path fill="#555" d="m10 30 20 20H10V30Z"/><path fill="#555" d="M45 40H25a5 5 0 0 0 0 10h20a5 5 0 0 0 0-10Z"/><path stroke="#fff" stroke-width="2" d="M57 2H7a5 5 0 0 0-5 5v50a5 5 0 0 0 5 5h50a5 5 0 0 0 5-5V7a5 5 0 0 0-5-5Z"/></svg> + + + + + + + \ No newline at end of file diff --git a/src/framework/.editorconfig b/src/framework/.editorconfig new file mode 100644 index 0000000..ed20d5e --- /dev/null +++ b/src/framework/.editorconfig @@ -0,0 +1,7 @@ +[*.cs] +# Editor Guidelines Plugin +guidelines = 120 +guidelines_style = 2.5px solid 10999999 + +# CA1416: Validate platform compatibility +dotnet_diagnostic.CA1416.severity = none \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.Tests/Kaspirin.UI.Framework.Tests.csproj b/src/framework/Kaspirin.UI.Framework.Tests/Kaspirin.UI.Framework.Tests.csproj new file mode 100644 index 0000000..36312f7 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.Tests/Kaspirin.UI.Framework.Tests.csproj @@ -0,0 +1,26 @@ + + + true + Kaspirin.UI.Framework.Tests + kaspirin.ui.framework.tests + true + + + + + + + + + + + + + + + + + + + + diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Media/Illustrations/UIKitIllustrationsGenerated.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Media/Illustrations/UIKitIllustrationsGenerated.cs new file mode 100644 index 0000000..5dd723e --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Media/Illustrations/UIKitIllustrationsGenerated.cs @@ -0,0 +1,50 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This file was automatically generated by the 'Kaspirin.UI.Framework.UiKit.Translator'. +// Code generated by the 'Kaspirin.UI.Framework.UiKit.Translator' is owned by the owner of the input file used when generating it. +// The following copyright applies to the portions of the 'Kaspirin.UI.Framework.UiKit.Translator' located in this file: Copyright © 2024 AO Kaspersky Lab. + +using System.Runtime.CompilerServices; +using System.Threading; + +namespace Kaspirin.UI.Framework.UiKit.Media.Illustrations +{ + /// UIKit illustrations with ExampleOne scope. + public enum UIKitIllustration_ExampleOne + { + UIKitUnset = 0, + Image1, + Image2, + } + + internal static class UIKitIllustrationMetadataRegistrar + { +#if NETFRAMEWORK + public static void RegisterMetadata() +#else + [ModuleInitializer] + internal static void RegisterMetadata() +#endif + { + if (Interlocked.CompareExchange(ref _isRegistered, 1, 0) == 0) + { + UIKitIllustrationMetadataStorage.Register(UIKitIllustration_ExampleOne.Image1, isAutoRTL: false, height: 64, width: 64); + UIKitIllustrationMetadataStorage.Register(UIKitIllustration_ExampleOne.Image2, isAutoRTL: false, height: 64, width: 64); + } + } + + private static int _isRegistered = 0; + } +} \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Media/Kaspirin.UI.Framework.UiKit.Media.csproj b/src/framework/Kaspirin.UI.Framework.UiKit.Media/Kaspirin.UI.Framework.UiKit.Media.csproj new file mode 100644 index 0000000..e9c836a --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Media/Kaspirin.UI.Framework.UiKit.Media.csproj @@ -0,0 +1,19 @@ + + + true + Kaspirin.UI.Framework.UiKit.Media + kaspirin.ui.framework.uikit.media + + + + + + + + + + + + + + diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Media/MarkupExtensions/UIKitIllustrationExtensionGenerated.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Media/MarkupExtensions/UIKitIllustrationExtensionGenerated.cs new file mode 100644 index 0000000..ca83b8a --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Media/MarkupExtensions/UIKitIllustrationExtensionGenerated.cs @@ -0,0 +1,29 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This file was automatically generated by the 'Kaspirin.UI.Framework.UiKit.Translator'. +// Code generated by the 'Kaspirin.UI.Framework.UiKit.Translator' is owned by the owner of the input file used when generating it. +// The following copyright applies to the portions of the 'Kaspirin.UI.Framework.UiKit.Translator' located in this file: Copyright © 2024 AO Kaspersky Lab. + +using Kaspirin.UI.Framework.UiKit.Media.Illustrations; + +namespace Kaspirin.UI.Framework.UiKit.Media.MarkupExtensions +{ + public sealed class UIKitIllustrationExtension : UIKitIllustrationExtensionBase + { + public UIKitIllustration_ExampleOne ExampleOne { get => _exampleOne; set => EnsureCanSet(ref _exampleOne, value); } + + private UIKitIllustration_ExampleOne _exampleOne; + } +} \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Media/Properties/AssemblyDefinitions.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Media/Properties/AssemblyDefinitions.cs new file mode 100644 index 0000000..679f3c0 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Media/Properties/AssemblyDefinitions.cs @@ -0,0 +1,24 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System.Windows.Markup; + +[assembly: XmlnsDefinition("http://schemas.microsoft.com/winfx/2006/xaml/presentation", "Kaspirin.UI.Framework.UiKit.Media.MarkupExtensions")] + +[assembly: XmlnsDefinition("http://schemas.kaspirin.com/common/visuals", "Kaspirin.UI.Framework.UiKit.Media.Illustrations")] + +[assembly: XmlnsDefinition("http://schemas.kaspirin.com/common/visuals", "Kaspirin.UI.Framework.UiKit.Media.Illustrations")] +[assembly: XmlnsDefinition("http://schemas.kaspirin.com/common/visuals", "Kaspirin.UI.Framework.UiKit.Media.MarkupExtensions")] + +[assembly: XmlnsPrefix("http://schemas.kaspirin.com/common/visuals", "visuals")] diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Media/Resources/neutral/dark/images/exampleone/UIKitIllustration_Image1.svg b/src/framework/Kaspirin.UI.Framework.UiKit.Media/Resources/neutral/dark/images/exampleone/UIKitIllustration_Image1.svg new file mode 100644 index 0000000..b883f42 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Media/Resources/neutral/dark/images/exampleone/UIKitIllustration_Image1.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Media/Resources/neutral/dark/images/exampleone/UIKitIllustration_Image2.svg b/src/framework/Kaspirin.UI.Framework.UiKit.Media/Resources/neutral/dark/images/exampleone/UIKitIllustration_Image2.svg new file mode 100644 index 0000000..2826d19 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Media/Resources/neutral/dark/images/exampleone/UIKitIllustration_Image2.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Media/Resources/neutral/images/exampleone/UIKitIllustration_Image1.svg b/src/framework/Kaspirin.UI.Framework.UiKit.Media/Resources/neutral/images/exampleone/UIKitIllustration_Image1.svg new file mode 100644 index 0000000..a5c371a --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Media/Resources/neutral/images/exampleone/UIKitIllustration_Image1.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Media/Resources/neutral/images/exampleone/UIKitIllustration_Image2.svg b/src/framework/Kaspirin.UI.Framework.UiKit.Media/Resources/neutral/images/exampleone/UIKitIllustration_Image2.svg new file mode 100644 index 0000000..ecea865 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Media/Resources/neutral/images/exampleone/UIKitIllustration_Image2.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Media/framework.uikit.media.props b/src/framework/Kaspirin.UI.Framework.UiKit.Media/framework.uikit.media.props new file mode 100644 index 0000000..45acde6 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Media/framework.uikit.media.props @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Converters/ResourcePalette.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Converters/ResourcePalette.cs new file mode 100644 index 0000000..0b7ebec --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Converters/ResourcePalette.cs @@ -0,0 +1,29 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using Kaspirin.UI.Framework.UiKit.Styles.Palette; +using Kaspirin.UI.Framework.UiKit.Converters.DictionaryConverters; + +namespace Kaspirin.UI.Framework.UiKit.Styles.Converters +{ + public sealed class ResourcePalette : IDictionaryConverterItem + { + public UIKitPaletteStorage.UIKitPalette Id { get; set; } + + public object GetItemValue() + { + return Id; + } + } +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Fonts/UIKitFontBrushExtension.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Fonts/UIKitFontBrushExtension.cs new file mode 100644 index 0000000..49738d9 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Fonts/UIKitFontBrushExtension.cs @@ -0,0 +1,21 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +namespace Kaspirin.UI.Framework.UiKit.Styles.Fonts +{ + public sealed class UIKitFontBrushExtension : UIKitFontBrushExtension + { + protected override string Map(UIKitFontStorage.UIKitFontBrush brush) => UIKitFontStorage.Map(brush); + } +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Fonts/UIKitFontStorage.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Fonts/UIKitFontStorage.cs new file mode 100644 index 0000000..3dc932e --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Fonts/UIKitFontStorage.cs @@ -0,0 +1,72 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This file was automatically generated by the 'Kaspirin.UI.Framework.UiKit.Translator'. +// Code generated by the 'Kaspirin.UI.Framework.UiKit.Translator' is owned by the owner of the input file used when generating it. +// The following copyright applies to the portions of the 'Kaspirin.UI.Framework.UiKit.Translator' located in this file: Copyright © 2024 AO Kaspersky Lab. + +using System; +using Kaspirin.UI.Framework.UiKit.Styles.Palette; + +namespace Kaspirin.UI.Framework.UiKit.Styles.Fonts +{ + public sealed class UIKitFontStorage + { + public static string Map(UIKitFontStyle id) + => $"UiKitTextStyle{id}"; + + public static string Map(UIKitFontBrush id) + { + var paletteIdString = $"TextIconsElements{id}"; + + var paletteId = (UIKitPaletteStorage.UIKitPalette)Enum.Parse(typeof(UIKitPaletteStorage.UIKitPalette), paletteIdString); + + return UIKitPaletteStorage.Map(paletteId); + } + + public enum UIKitFontBrush + { + Base, + BaseIcon, + BaseIconInvert, + BaseInvert, + Disabled, + DisabledInvert, + Emerald, + Primary, + PrimaryInvert, + Red, + Secondary, + SecondaryInvert, + Yellow + } + + public enum UIKitFontStyle + { + BaseText, + BaseTextMonospace, + BaseTextSemibold, + Button, + Header1, + Header2, + Header3, + Header3Monospace, + Header4, + Header5, + SmallText, + SmallTextMedium, + Subheader + } + } +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Fonts/UIKitFontStyleExtension.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Fonts/UIKitFontStyleExtension.cs new file mode 100644 index 0000000..e0f9e56 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Fonts/UIKitFontStyleExtension.cs @@ -0,0 +1,21 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +namespace Kaspirin.UI.Framework.UiKit.Styles.Fonts +{ + public sealed class UIKitFontStyleExtension : UIKitFontStyleExtension + { + protected override string Map(UIKitFontStorage.UIKitFontStyle style) => UIKitFontStorage.Map(style); + } +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Kaspirin.UI.Framework.UiKit.Styles.csproj b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Kaspirin.UI.Framework.UiKit.Styles.csproj new file mode 100644 index 0000000..a854db6 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Kaspirin.UI.Framework.UiKit.Styles.csproj @@ -0,0 +1,19 @@ + + + true + Kaspirin.UI.Framework.UiKit.Styles + kaspirin.ui.framework.uikit.styles + + + + + + + + + + + + + + diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Palette/UIKitPaletteExtension.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Palette/UIKitPaletteExtension.cs new file mode 100644 index 0000000..1507ff7 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Palette/UIKitPaletteExtension.cs @@ -0,0 +1,23 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using Kaspirin.UI.Framework.UiKit.Palettes; + +namespace Kaspirin.UI.Framework.UiKit.Styles.Palette +{ + public sealed class UIKitPaletteExtension : UIKitPaletteExtension + { + protected override string Map(UIKitPaletteStorage.UIKitPalette id) => UIKitPaletteStorage.Map(id); + } +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Palette/UIKitPaletteStorage.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Palette/UIKitPaletteStorage.cs new file mode 100644 index 0000000..faa9e0b --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Palette/UIKitPaletteStorage.cs @@ -0,0 +1,304 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This file was automatically generated by the 'Kaspirin.UI.Framework.UiKit.Translator'. +// Code generated by the 'Kaspirin.UI.Framework.UiKit.Translator' is owned by the owner of the input file used when generating it. +// The following copyright applies to the portions of the 'Kaspirin.UI.Framework.UiKit.Translator' located in this file: Copyright © 2024 AO Kaspersky Lab. + +using System.Collections.Generic; + +namespace Kaspirin.UI.Framework.UiKit.Styles.Palette +{ + public static class UIKitPaletteStorage + { + public static string Map(UIKitPalette id) + { + return PaletteMapping[id]; + } + + private static IDictionary PaletteMapping { get; } = new Dictionary + { + { UIKitPalette.BackgroundElevation, "Background_Elevation" }, + { UIKitPalette.BackgroundElevationInvert, "Background_Elevation-Invert" }, + { UIKitPalette.BackgroundIslandElevation, "Background_Island-Elevation" }, + { UIKitPalette.BackgroundIslandElevationInvert, "Background_Island-Elevation-Invert" }, + { UIKitPalette.BackgroundIslandInner, "Background_Island-Inner" }, + { UIKitPalette.BackgroundIslandInnerInvert, "Background_Island-Inner-Invert" }, + { UIKitPalette.BackgroundIslandPrimary, "Background_Island-Primary" }, + { UIKitPalette.BackgroundIslandPrimaryInvert, "Background_Island-Primary-Invert" }, + { UIKitPalette.BackgroundIslandSecondary, "Background_Island-Secondary" }, + { UIKitPalette.BackgroundIslandSecondaryInvert, "Background_Island-Secondary-Invert" }, + { UIKitPalette.BackgroundOverlay, "Background_Overlay" }, + { UIKitPalette.BackgroundPrimary, "Background_Primary" }, + { UIKitPalette.BackgroundPrimaryInvert, "Background_Primary-Invert" }, + { UIKitPalette.BackgroundSecondary, "Background_Secondary" }, + { UIKitPalette.BackgroundSecondaryInvert, "Background_Secondary-Invert" }, + { UIKitPalette.ControlsBGBase, "ControlsBG_Base" }, + { UIKitPalette.ControlsBGBaseInvert, "ControlsBG_Base-Invert" }, + { UIKitPalette.ControlsBGEmeraldDefaultFocusLoading, "ControlsBG_Emerald-Default-Focus-Loading" }, + { UIKitPalette.ControlsBGEmeraldHover, "ControlsBG_Emerald-Hover" }, + { UIKitPalette.ControlsBGEmeraldPressed, "ControlsBG_Emerald-Pressed" }, + { UIKitPalette.ControlsBGGrayDefaultFocusLoading, "ControlsBG_Gray-Default-Focus-Loading" }, + { UIKitPalette.ControlsBGGrayHover, "ControlsBG_Gray-Hover" }, + { UIKitPalette.ControlsBGGrayPressed, "ControlsBG_Gray-Pressed" }, + { UIKitPalette.ControlsBGGraySlimHover, "ControlsBG_Gray-Slim-Hover" }, + { UIKitPalette.ControlsBGGraySlimPressed, "ControlsBG_Gray-Slim-Pressed" }, + { UIKitPalette.ControlsBGIslandElevationPressed, "ControlsBG_Island-Elevation-Pressed" }, + { UIKitPalette.ControlsBGIslandPrimaryPressed, "ControlsBG_Island-Primary-Pressed" }, + { UIKitPalette.ControlsBGIslandSecondaryPressed, "ControlsBG_Island-Secondary-Pressed" }, + { UIKitPalette.ControlsBGRedDefaultFocusLoading, "ControlsBG_Red-Default-Focus-Loading" }, + { UIKitPalette.ControlsBGRedHover, "ControlsBG_Red-Hover" }, + { UIKitPalette.ControlsBGRedPressed, "ControlsBG_Red-Pressed" }, + { UIKitPalette.ControlsBGWhiteDefaultFocusLoading, "ControlsBG_White-Default-Focus-Loading" }, + { UIKitPalette.ControlsBGWhiteHover, "ControlsBG_White-Hover" }, + { UIKitPalette.ControlsBGWhitePressed, "ControlsBG_White-Pressed" }, + { UIKitPalette.ElementsLine, "Elements_Line" }, + { UIKitPalette.ElementsLineDanger, "Elements_Line-Danger" }, + { UIKitPalette.ElementsLineDangerFocus, "Elements_Line-Danger-Focus" }, + { UIKitPalette.ElementsLineDangerHover, "Elements_Line-Danger-Hover" }, + { UIKitPalette.ElementsLineEmerald, "Elements_Line-Emerald" }, + { UIKitPalette.ElementsLineInvert, "Elements_Line-Invert" }, + { UIKitPalette.ElementsSeparator, "Elements_Separator" }, + { UIKitPalette.ElementsSeparatorBold, "Elements_SeparatorBold" }, + { UIKitPalette.ElementsSeparatorBoldHover, "Elements_SeparatorBold-Hover" }, + { UIKitPalette.ElementsSeparatorBoldInvert, "Elements_SeparatorBold-Invert" }, + { UIKitPalette.ElementsSeparatorEmerald, "Elements_SeparatorEmerald" }, + { UIKitPalette.ElementsSeparatorEmeraldInvert, "Elements_SeparatorEmerald-Invert" }, + { UIKitPalette.ElementsSeparatorInvert, "Elements_Separator-Invert" }, + { UIKitPalette.ElementsSeparatorMarina, "Elements_SeparatorMarina" }, + { UIKitPalette.ElementsSeparatorMarinaInvert, "Elements_SeparatorMarina-Invert" }, + { UIKitPalette.ElementsSeparatorRed, "Elements_SeparatorRed" }, + { UIKitPalette.ElementsSeparatorRedInvert, "Elements_SeparatorRed-Invert" }, + { UIKitPalette.ElementsSeparatorYellow, "Elements_SeparatorYellow" }, + { UIKitPalette.ElementsSeparatorYellowInvert, "Elements_SeparatorYellow-Invert" }, + { UIKitPalette.FixedColorAlternative, "FixedColor_Alternative" }, + { UIKitPalette.FixedColorAlternative2, "FixedColor_Alternative2" }, + { UIKitPalette.FixedColorAlternative2White, "FixedColor_Alternative2White" }, + { UIKitPalette.FixedColorAlternative3, "FixedColor_Alternative3" }, + { UIKitPalette.FixedColorAlternativeWhite, "FixedColor_AlternativeWhite" }, + { UIKitPalette.FixedColorBase, "FixedColor_Base" }, + { UIKitPalette.FixedColorBaseIcon, "FixedColor_BaseIcon" }, + { UIKitPalette.FixedColorBaseIconWhite, "FixedColor_BaseIconWhite" }, + { UIKitPalette.FixedColorBaseWhite, "FixedColor_BaseWhite" }, + { UIKitPalette.FixedColorControlGrayHover, "FixedColor_Control-Gray-Hover" }, + { UIKitPalette.FixedColorControlGrayPressed, "FixedColor_Control-Gray-Pressed" }, + { UIKitPalette.FixedColorDisabled, "FixedColor_Disabled" }, + { UIKitPalette.FixedColorDisabledWhite, "FixedColor_DisabledWhite" }, + { UIKitPalette.FixedColorLine, "FixedColor_Line" }, + { UIKitPalette.FixedColorLineWhite, "FixedColor_LineWhite" }, + { UIKitPalette.FixedColorOverlay, "FixedColor_Overlay" }, + { UIKitPalette.FixedColorPrimary, "FixedColor_Primary" }, + { UIKitPalette.FixedColorPrimaryWhite, "FixedColor_PrimaryWhite" }, + { UIKitPalette.FixedColorSecondary, "FixedColor_Secondary" }, + { UIKitPalette.FixedColorSecondary2, "FixedColor_Secondary2" }, + { UIKitPalette.FixedColorSecondary2White, "FixedColor_Secondary2White" }, + { UIKitPalette.FixedColorSecondaryWhite, "FixedColor_SecondaryWhite" }, + { UIKitPalette.FixedColorSeparator, "FixedColor_Separator" }, + { UIKitPalette.FixedColorSeparatorBold, "FixedColor_SeparatorBold" }, + { UIKitPalette.FixedColorSeparatorBoldWhite, "FixedColor_SeparatorBoldWhite" }, + { UIKitPalette.FixedColorSeparatorWhite, "FixedColor_SeparatorWhite" }, + { UIKitPalette.FixedColorSnackbar, "FixedColor_Snackbar" }, + { UIKitPalette.StatusHigh, "Status_High" }, + { UIKitPalette.StatusInfo, "Status_Info" }, + { UIKitPalette.StatusLow, "Status_Low" }, + { UIKitPalette.StatusMedium, "Status_Medium" }, + { UIKitPalette.StatusPositive, "Status_Positive" }, + { UIKitPalette.SurfaceColdGrey, "Surface_ColdGrey" }, + { UIKitPalette.SurfaceEmerald, "Surface_Emerald" }, + { UIKitPalette.SurfaceEmeraldTransparent20, "Surface_Emerald_Transparent_20" }, + { UIKitPalette.SurfaceGrass, "Surface_Grass" }, + { UIKitPalette.SurfaceMarengo, "Surface_Marengo" }, + { UIKitPalette.SurfaceMarina, "Surface_Marina" }, + { UIKitPalette.SurfaceMarinaTransparent20, "Surface_Marina_Transparent_20" }, + { UIKitPalette.SurfaceOrange, "Surface_Orange" }, + { UIKitPalette.SurfacePurple, "Surface_Purple" }, + { UIKitPalette.SurfaceRed, "Surface_Red" }, + { UIKitPalette.SurfaceRedTransparent20, "Surface_Red_Transparent_20" }, + { UIKitPalette.SurfaceViolet, "Surface_Violet" }, + { UIKitPalette.SurfaceYellow, "Surface_Yellow" }, + { UIKitPalette.SurfaceYellowTransparent20, "Surface_Yellow_Transparent_20" }, + { UIKitPalette.TagsEmerald, "Tags_Emerald" }, + { UIKitPalette.TagsEmeraldInvert, "Tags_Emerald-Invert" }, + { UIKitPalette.TagsGrass, "Tags_Grass" }, + { UIKitPalette.TagsGrassInvert, "Tags_Grass-Invert" }, + { UIKitPalette.TagsMarengo, "Tags_Marengo" }, + { UIKitPalette.TagsMarengoInvert, "Tags_Marengo-Invert" }, + { UIKitPalette.TagsMarina, "Tags_Marina" }, + { UIKitPalette.TagsMarinaInvert, "Tags_Marina-Invert" }, + { UIKitPalette.TagsNeutral, "Tags_Neutral" }, + { UIKitPalette.TagsNeutralInvert, "Tags_Neutral-Invert" }, + { UIKitPalette.TagsOrange, "Tags_Orange" }, + { UIKitPalette.TagsOrangeInvert, "Tags_Orange-Invert" }, + { UIKitPalette.TagsPurple, "Tags_Purple" }, + { UIKitPalette.TagsPurpleInvert, "Tags_Purple-Invert" }, + { UIKitPalette.TagsRed, "Tags_Red" }, + { UIKitPalette.TagsRedInvert, "Tags_Red-Invert" }, + { UIKitPalette.TagsViolet, "Tags_Violet" }, + { UIKitPalette.TagsVioletInvert, "Tags_Violet-Invert" }, + { UIKitPalette.TagsYellow, "Tags_Yellow" }, + { UIKitPalette.TagsYellowInvert, "Tags_Yellow-Invert" }, + { UIKitPalette.TextIconsElementsBase, "Text-Icons-Elements_Base" }, + { UIKitPalette.TextIconsElementsBaseIcon, "Text-Icons-Elements_BaseIcon" }, + { UIKitPalette.TextIconsElementsBaseIconInvert, "Text-Icons-Elements_BaseIcon-Invert" }, + { UIKitPalette.TextIconsElementsBaseInvert, "Text-Icons-Elements_Base-Invert" }, + { UIKitPalette.TextIconsElementsDisabled, "Text-Icons-Elements_Disabled" }, + { UIKitPalette.TextIconsElementsDisabledInvert, "Text-Icons-Elements_Disabled-Invert" }, + { UIKitPalette.TextIconsElementsEmerald, "Text-Icons-Elements_Emerald" }, + { UIKitPalette.TextIconsElementsPrimary, "Text-Icons-Elements_Primary" }, + { UIKitPalette.TextIconsElementsPrimaryInvert, "Text-Icons-Elements_Primary-Invert" }, + { UIKitPalette.TextIconsElementsRed, "Text-Icons-Elements_Red" }, + { UIKitPalette.TextIconsElementsSecondary, "Text-Icons-Elements_Secondary" }, + { UIKitPalette.TextIconsElementsSecondaryInvert, "Text-Icons-Elements_Secondary-Invert" }, + { UIKitPalette.TextIconsElementsYellow, "Text-Icons-Elements_Yellow" }, + { UIKitPalette.Transparent, "Transparent" } + }; + + public enum UIKitPalette + { + Transparent = 0, + BackgroundElevation, + BackgroundElevationInvert, + BackgroundIslandElevation, + BackgroundIslandElevationInvert, + BackgroundIslandInner, + BackgroundIslandInnerInvert, + BackgroundIslandPrimary, + BackgroundIslandPrimaryInvert, + BackgroundIslandSecondary, + BackgroundIslandSecondaryInvert, + BackgroundOverlay, + BackgroundPrimary, + BackgroundPrimaryInvert, + BackgroundSecondary, + BackgroundSecondaryInvert, + ControlsBGBase, + ControlsBGBaseInvert, + ControlsBGEmeraldDefaultFocusLoading, + ControlsBGEmeraldHover, + ControlsBGEmeraldPressed, + ControlsBGGrayDefaultFocusLoading, + ControlsBGGrayHover, + ControlsBGGrayPressed, + ControlsBGGraySlimHover, + ControlsBGGraySlimPressed, + ControlsBGIslandElevationPressed, + ControlsBGIslandPrimaryPressed, + ControlsBGIslandSecondaryPressed, + ControlsBGRedDefaultFocusLoading, + ControlsBGRedHover, + ControlsBGRedPressed, + ControlsBGWhiteDefaultFocusLoading, + ControlsBGWhiteHover, + ControlsBGWhitePressed, + ElementsLine, + ElementsLineDanger, + ElementsLineDangerFocus, + ElementsLineDangerHover, + ElementsLineEmerald, + ElementsLineInvert, + ElementsSeparator, + ElementsSeparatorBold, + ElementsSeparatorBoldHover, + ElementsSeparatorBoldInvert, + ElementsSeparatorEmerald, + ElementsSeparatorEmeraldInvert, + ElementsSeparatorInvert, + ElementsSeparatorMarina, + ElementsSeparatorMarinaInvert, + ElementsSeparatorRed, + ElementsSeparatorRedInvert, + ElementsSeparatorYellow, + ElementsSeparatorYellowInvert, + FixedColorAlternative, + FixedColorAlternative2, + FixedColorAlternative2White, + FixedColorAlternative3, + FixedColorAlternativeWhite, + FixedColorBase, + FixedColorBaseIcon, + FixedColorBaseIconWhite, + FixedColorBaseWhite, + FixedColorControlGrayHover, + FixedColorControlGrayPressed, + FixedColorDisabled, + FixedColorDisabledWhite, + FixedColorLine, + FixedColorLineWhite, + FixedColorOverlay, + FixedColorPrimary, + FixedColorPrimaryWhite, + FixedColorSecondary, + FixedColorSecondary2, + FixedColorSecondary2White, + FixedColorSecondaryWhite, + FixedColorSeparator, + FixedColorSeparatorBold, + FixedColorSeparatorBoldWhite, + FixedColorSeparatorWhite, + FixedColorSnackbar, + StatusHigh, + StatusInfo, + StatusLow, + StatusMedium, + StatusPositive, + SurfaceColdGrey, + SurfaceEmerald, + SurfaceEmeraldTransparent20, + SurfaceGrass, + SurfaceMarengo, + SurfaceMarina, + SurfaceMarinaTransparent20, + SurfaceOrange, + SurfacePurple, + SurfaceRed, + SurfaceRedTransparent20, + SurfaceViolet, + SurfaceYellow, + SurfaceYellowTransparent20, + TagsEmerald, + TagsEmeraldInvert, + TagsGrass, + TagsGrassInvert, + TagsMarengo, + TagsMarengoInvert, + TagsMarina, + TagsMarinaInvert, + TagsNeutral, + TagsNeutralInvert, + TagsOrange, + TagsOrangeInvert, + TagsPurple, + TagsPurpleInvert, + TagsRed, + TagsRedInvert, + TagsViolet, + TagsVioletInvert, + TagsYellow, + TagsYellowInvert, + TextIconsElementsBase, + TextIconsElementsBaseIcon, + TextIconsElementsBaseIconInvert, + TextIconsElementsBaseInvert, + TextIconsElementsDisabled, + TextIconsElementsDisabledInvert, + TextIconsElementsEmerald, + TextIconsElementsPrimary, + TextIconsElementsPrimaryInvert, + TextIconsElementsRed, + TextIconsElementsSecondary, + TextIconsElementsSecondaryInvert, + TextIconsElementsYellow + } + } +} \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Properties/AssemblyDefinitions.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Properties/AssemblyDefinitions.cs new file mode 100644 index 0000000..4fd6f6b --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Properties/AssemblyDefinitions.cs @@ -0,0 +1,25 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System.Windows.Markup; + +[assembly: XmlnsDefinition("http://schemas.microsoft.com/winfx/2006/xaml/presentation", "Kaspirin.UI.Framework.UiKit.Styles")] +[assembly: XmlnsDefinition("http://schemas.microsoft.com/winfx/2006/xaml/presentation", "Kaspirin.UI.Framework.UiKit.Styles.Fonts")] +[assembly: XmlnsDefinition("http://schemas.microsoft.com/winfx/2006/xaml/presentation", "Kaspirin.UI.Framework.UiKit.Styles.Palette")] + +[assembly: XmlnsDefinition("http://schemas.kaspirin.com/common/visuals", "Kaspirin.UI.Framework.UiKit.Styles")] +[assembly: XmlnsDefinition("http://schemas.kaspirin.com/common/visuals", "Kaspirin.UI.Framework.UiKit.Styles.Converters")] +[assembly: XmlnsDefinition("http://schemas.kaspirin.com/common/visuals", "Kaspirin.UI.Framework.UiKit.Styles.Fonts")] +[assembly: XmlnsDefinition("http://schemas.kaspirin.com/common/visuals", "Kaspirin.UI.Framework.UiKit.Styles.Palette")] + diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dark/dictionaries/Palette.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dark/dictionaries/Palette.xaml new file mode 100644 index 0000000..0d4dc49 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dark/dictionaries/Palette.xaml @@ -0,0 +1,141 @@ + + + #ff212328 + #ffffffff + #ff2e3137 + #ffecedef + #0fe1e2e3 + #0a0f519d + #ff212328 + #ffffffff + #ff212328 + #ffecedef + #cc0d0d15 + #ff0d0d15 + #ffecedef + #ff0d0d15 + #ffffffff + #ff212328 + #ffffffff + #ff422446 + #ff2c182f + #ff58305e + #0fe1e2e3 + #1a99a8bd + #1fbfc5ee + #1abfc5ee + #24bfc5ee + #1fbfc5ee + #1fbfc5ee + #1fbfc5ee + #ffbc2c24 + #ffd9423b + #ff92221c + #42d4d9f2 + #5ce5ecfb + #1fbfc5ee + #42d4d9f2 + #ff92221c + #ffbc2c24 + #ffbc2c24 + #ff58305e + #451f3247 + #ff422446 + #ffa88aac + #ff130ea4 + #ff8d8af5 + #ff92221c + #ffea9490 + #ff9f8a14 + #fff1e28e + #1fbfc5ee + #17294d75 + #2bd0d7fb + #66d4d9f2 + #2b1d3653 + #ff131518 + #ff212328 + #ffecedef + #ff2e3137 + #fff9fafa + #ff0d0d15 + #99273544 + #7de7f1fd + #ffffffff + #29ecedef + #47ecedef + #66223449 + #5ce5ecfb + #451f3247 + #42d4d9f2 + #f2212328 + #ff0d0d15 + #ffebedef + #f22a3541 + #cc2a3541 + #a8e7eef7 + #d1eff5fa + #17294d75 + #2b1d3653 + #2bd0d7fb + #1fbfc5ee + #ff34383f + #ffd9423b + #ff605bf1 + #ffb6bec9 + #ffebd660 + #ff6e3c75 + #ff21252c + #ff160c17 + #338b6391 + #ff1a2c16 + #ff0d2935 + #ff080646 + #33605bf1 + #ff422300 + #ff1a0f3e + #ff3c0e0b + #33e26b65 + #ff3c0b32 + #ff443b08 + #33ebd660 + #ff422446 + #ffe2d8e3 + #ff417138 + #ffe9f3e7 + #ff216987 + #ffe2f2f8 + #ff130ea4 + #ffe8e8fd + #ff4c5767 + #fff0f2f4 + #ffa85a00 + #ffffeedb + #ff3c2390 + #ffeeeafa + #ff92221c + #fffae6e5 + #ff931b7b + #fffae5f6 + #ff9f8a14 + #fffcf9e8 + #d1eff5fa + #f22a3541 + #7de7f1fd + #99273544 + #5ce5ecfb + #66223449 + #ff6e3c75 + #ffebedef + #ff0d0d15 + #ffd9423b + #a8e7eef7 + #cc2a3541 + #ffe6cb32 + #00000000 + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/Palette.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/Palette.xaml new file mode 100644 index 0000000..b9c110a --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/Palette.xaml @@ -0,0 +1,141 @@ + + + #ffffffff + #ff212328 + #ffecedef + #ff2e3137 + #0a0f519d + #0fe1e2e3 + #ffffffff + #ff212328 + #ffecedef + #ff212328 + #800d0d15 + #ffecedef + #ff0d0d15 + #ffffffff + #ff0d0d15 + #ffffffff + #ff212328 + #ff58305e + #ff422446 + #ff6e3c75 + #0a0f519d + #17294d75 + #2b1d3653 + #0f17495e + #1a17495e + #80ecedef + #80ffffff + #80ecedef + #ffd9423b + #ffe26b65 + #ffbc2c24 + #ffffffff + #fff9fafa + #ffd0d4d8 + #451f3247 + #ffe26b65 + #ffe26b65 + #ff92221c + #ff58305e + #42d4d9f2 + #ffa88aac + #ff422446 + #ff8d8af5 + #ff130ea4 + #ffea9490 + #ff92221c + #fff1e28e + #ff9f8a14 + #17294d75 + #1fbfc5ee + #2b1d3653 + #7a0d2935 + #2bd0d7fb + #ff131518 + #ff212328 + #ffecedef + #ff2e3137 + #fff9fafa + #ff0d0d15 + #99273544 + #7de7f1fd + #ffffffff + #29ecedef + #47ecedef + #66223449 + #5ce5ecfb + #451f3247 + #42d4d9f2 + #f2212328 + #ff0d0d15 + #ffebedef + #f22a3541 + #cc2a3541 + #a8e7eef7 + #d1eff5fa + #17294d75 + #2b1d3653 + #2bd0d7fb + #1fbfc5ee + #ff34383f + #ffbc2c24 + #ff312aec + #ffb6bec9 + #ffe6cb32 + #ff6e3c75 + #fff6f7f8 + #fff1ecf1 + #336e3c75 + #ffeff7ee + #ffeaf5fa + #fff1f1fe + #33312aec + #fffff3e5 + #fff5f3fc + #fffcefee + #33bc2c24 + #fffceef9 + #fffdfcf1 + #33e6cb32 + #ffe2d8e3 + #ff422446 + #ffe9f3e7 + #ff417138 + #ffe2f2f8 + #ff216987 + #ffe8e8fd + #ff130ea4 + #fff0f2f4 + #ff4c5767 + #ffffeedb + #ffa85a00 + #ffeeeafa + #ff3c2390 + #fffae6e5 + #ff92221c + #fffae5f6 + #ff931b7b + #fffcf9e8 + #ff9f8a14 + #f22a3541 + #d1eff5fa + #99273544 + #7de7f1fd + #66223449 + #5ce5ecfb + #ff58305e + #ff0d0d15 + #ffebedef + #ffbc2c24 + #cc2a3541 + #a8e7eef7 + #ff71630e + #00000000 + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitBadge.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitBadge.xaml new file mode 100644 index 0000000..6b3f176 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitBadge.xaml @@ -0,0 +1,13 @@ + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitBadgeCounter.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitBadgeCounter.xaml new file mode 100644 index 0000000..14388a7 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitBadgeCounter.xaml @@ -0,0 +1,14 @@ + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitBadgeText.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitBadgeText.xaml new file mode 100644 index 0000000..14388a7 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitBadgeText.xaml @@ -0,0 +1,14 @@ + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitBigButtonBaseOutlineSecondary.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitBigButtonBaseOutlineSecondary.xaml new file mode 100644 index 0000000..fbf4640 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitBigButtonBaseOutlineSecondary.xaml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitBigButtonBasePrimary.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitBigButtonBasePrimary.xaml new file mode 100644 index 0000000..70ddb27 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitBigButtonBasePrimary.xaml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitBigButtonBaseSecondary.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitBigButtonBaseSecondary.xaml new file mode 100644 index 0000000..979c5c3 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitBigButtonBaseSecondary.xaml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitBigButtonNeutralPrimary.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitBigButtonNeutralPrimary.xaml new file mode 100644 index 0000000..9c81b97 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitBigButtonNeutralPrimary.xaml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitBigButtonStaticWhite.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitBigButtonStaticWhite.xaml new file mode 100644 index 0000000..80b5b29 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitBigButtonStaticWhite.xaml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitBulletBold.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitBulletBold.xaml new file mode 100644 index 0000000..82a198f --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitBulletBold.xaml @@ -0,0 +1,10 @@ + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitBulletRegular.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitBulletRegular.xaml new file mode 100644 index 0000000..82a198f --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitBulletRegular.xaml @@ -0,0 +1,10 @@ + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitButtonBaseGhost.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitButtonBaseGhost.xaml new file mode 100644 index 0000000..631047c --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitButtonBaseGhost.xaml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitButtonBaseOutlineSecondary.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitButtonBaseOutlineSecondary.xaml new file mode 100644 index 0000000..fbf4640 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitButtonBaseOutlineSecondary.xaml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitButtonBasePrimary.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitButtonBasePrimary.xaml new file mode 100644 index 0000000..70ddb27 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitButtonBasePrimary.xaml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitButtonBaseSecondary.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitButtonBaseSecondary.xaml new file mode 100644 index 0000000..979c5c3 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitButtonBaseSecondary.xaml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitButtonDangerGhost.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitButtonDangerGhost.xaml new file mode 100644 index 0000000..790a37b --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitButtonDangerGhost.xaml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitButtonDangerOutlineSecondary.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitButtonDangerOutlineSecondary.xaml new file mode 100644 index 0000000..0f90c5d --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitButtonDangerOutlineSecondary.xaml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitButtonDangerPrimary.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitButtonDangerPrimary.xaml new file mode 100644 index 0000000..e791ff4 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitButtonDangerPrimary.xaml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitButtonNeutralGhost.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitButtonNeutralGhost.xaml new file mode 100644 index 0000000..f6aeee5 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitButtonNeutralGhost.xaml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitButtonNeutralPrimary.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitButtonNeutralPrimary.xaml new file mode 100644 index 0000000..9c81b97 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitButtonNeutralPrimary.xaml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitButtonStaticWhite.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitButtonStaticWhite.xaml new file mode 100644 index 0000000..80b5b29 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitButtonStaticWhite.xaml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitButtonStaticWhiteOutlineSecondary.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitButtonStaticWhiteOutlineSecondary.xaml new file mode 100644 index 0000000..cc1c698 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitButtonStaticWhiteOutlineSecondary.xaml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitCarouselItemInvert.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitCarouselItemInvert.xaml new file mode 100644 index 0000000..693e425 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitCarouselItemInvert.xaml @@ -0,0 +1,16 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitCarouselItemNormal.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitCarouselItemNormal.xaml new file mode 100644 index 0000000..8cd4642 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitCarouselItemNormal.xaml @@ -0,0 +1,16 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitCheckbox.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitCheckbox.xaml new file mode 100644 index 0000000..9a7f2d8 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitCheckbox.xaml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitChipsControlGrey.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitChipsControlGrey.xaml new file mode 100644 index 0000000..6b94dc1 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitChipsControlGrey.xaml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitChipsControlWhite.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitChipsControlWhite.xaml new file mode 100644 index 0000000..6b94dc1 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitChipsControlWhite.xaml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitChipsItemGrey.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitChipsItemGrey.xaml new file mode 100644 index 0000000..fa94e3e --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitChipsItemGrey.xaml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitChipsItemWhite.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitChipsItemWhite.xaml new file mode 100644 index 0000000..7b9f17a --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitChipsItemWhite.xaml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitCodeInput.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitCodeInput.xaml new file mode 100644 index 0000000..a9f6f1e --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitCodeInput.xaml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitContentButton.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitContentButton.xaml new file mode 100644 index 0000000..60e0b0d --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitContentButton.xaml @@ -0,0 +1,17 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitContextMenu.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitContextMenu.xaml new file mode 100644 index 0000000..70fc814 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitContextMenu.xaml @@ -0,0 +1,16 @@ + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitDateTimeInput.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitDateTimeInput.xaml new file mode 100644 index 0000000..70fc814 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitDateTimeInput.xaml @@ -0,0 +1,16 @@ + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitDateTimePopupFooterButton.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitDateTimePopupFooterButton.xaml new file mode 100644 index 0000000..b00e160 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitDateTimePopupFooterButton.xaml @@ -0,0 +1,16 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitDateTimePopupItemButton.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitDateTimePopupItemButton.xaml new file mode 100644 index 0000000..44591a3 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitDateTimePopupItemButton.xaml @@ -0,0 +1,14 @@ + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitDateTimePopupPresenter.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitDateTimePopupPresenter.xaml new file mode 100644 index 0000000..44f2eff --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitDateTimePopupPresenter.xaml @@ -0,0 +1,11 @@ + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitDividerMedium.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitDividerMedium.xaml new file mode 100644 index 0000000..0d240a2 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitDividerMedium.xaml @@ -0,0 +1,11 @@ + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitDividerRegular.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitDividerRegular.xaml new file mode 100644 index 0000000..c4e999b --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitDividerRegular.xaml @@ -0,0 +1,11 @@ + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitHyperlinkDanger.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitHyperlinkDanger.xaml new file mode 100644 index 0000000..eba5154 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitHyperlinkDanger.xaml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitHyperlinkDefault.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitHyperlinkDefault.xaml new file mode 100644 index 0000000..0fa6760 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitHyperlinkDefault.xaml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitIcon12.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitIcon12.xaml new file mode 100644 index 0000000..74dc8d0 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitIcon12.xaml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitIcon16.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitIcon16.xaml new file mode 100644 index 0000000..74dc8d0 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitIcon16.xaml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitIcon24.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitIcon24.xaml new file mode 100644 index 0000000..74dc8d0 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitIcon24.xaml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitIcon32.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitIcon32.xaml new file mode 100644 index 0000000..74dc8d0 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitIcon32.xaml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitIcon48.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitIcon48.xaml new file mode 100644 index 0000000..74dc8d0 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitIcon48.xaml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitIconButton16.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitIconButton16.xaml new file mode 100644 index 0000000..dbb1323 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitIconButton16.xaml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitIconButton24.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitIconButton24.xaml new file mode 100644 index 0000000..dbb1323 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitIconButton24.xaml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitImageGallery.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitImageGallery.xaml new file mode 100644 index 0000000..6eb8dfe --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitImageGallery.xaml @@ -0,0 +1,11 @@ + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitImageGalleryButton.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitImageGalleryButton.xaml new file mode 100644 index 0000000..fcf929e --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitImageGalleryButton.xaml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitImageGalleryListButton.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitImageGalleryListButton.xaml new file mode 100644 index 0000000..39ba899 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitImageGalleryListButton.xaml @@ -0,0 +1,15 @@ + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitInteractivityDialog.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitInteractivityDialog.xaml new file mode 100644 index 0000000..7004ada --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitInteractivityDialog.xaml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitInteractivityNotification.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitInteractivityNotification.xaml new file mode 100644 index 0000000..96a3e3c --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitInteractivityNotification.xaml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitInteractivityOverlayModal.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitInteractivityOverlayModal.xaml new file mode 100644 index 0000000..4cb3e16 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitInteractivityOverlayModal.xaml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitInteractivityOverlayPromo.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitInteractivityOverlayPromo.xaml new file mode 100644 index 0000000..04530e6 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitInteractivityOverlayPromo.xaml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitIsland.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitIsland.xaml new file mode 100644 index 0000000..6edf92f --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitIsland.xaml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitIslandButton.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitIslandButton.xaml new file mode 100644 index 0000000..2a7416b --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitIslandButton.xaml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitIslandToggleButton.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitIslandToggleButton.xaml new file mode 100644 index 0000000..2855242 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitIslandToggleButton.xaml @@ -0,0 +1,105 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitListMenuItem.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitListMenuItem.xaml new file mode 100644 index 0000000..cc3bf35 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitListMenuItem.xaml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitMenuItem.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitMenuItem.xaml new file mode 100644 index 0000000..2639138 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitMenuItem.xaml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitNavigationMenuButton.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitNavigationMenuButton.xaml new file mode 100644 index 0000000..3326963 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitNavigationMenuButton.xaml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitNavigationMenuFooterButton.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitNavigationMenuFooterButton.xaml new file mode 100644 index 0000000..c22944a --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitNavigationMenuFooterButton.xaml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitNotificationHint.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitNotificationHint.xaml new file mode 100644 index 0000000..d9589a0 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitNotificationHint.xaml @@ -0,0 +1,16 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitNotificationPanelColorful.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitNotificationPanelColorful.xaml new file mode 100644 index 0000000..4986253 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitNotificationPanelColorful.xaml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitNotificationPanelPlain.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitNotificationPanelPlain.xaml new file mode 100644 index 0000000..c378a46 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitNotificationPanelPlain.xaml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitPasswordInput.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitPasswordInput.xaml new file mode 100644 index 0000000..ae3a86a --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitPasswordInput.xaml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitPopupDanger.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitPopupDanger.xaml new file mode 100644 index 0000000..c9d8d38 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitPopupDanger.xaml @@ -0,0 +1,17 @@ + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitPopupStandard.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitPopupStandard.xaml new file mode 100644 index 0000000..89ffaea --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitPopupStandard.xaml @@ -0,0 +1,11 @@ + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitProgressBarSmall.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitProgressBarSmall.xaml new file mode 100644 index 0000000..b5f95ec --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitProgressBarSmall.xaml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitProgressBarStandart.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitProgressBarStandart.xaml new file mode 100644 index 0000000..b5f95ec --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitProgressBarStandart.xaml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitRadiobutton.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitRadiobutton.xaml new file mode 100644 index 0000000..8b72a1b --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitRadiobutton.xaml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitRoundProgress.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitRoundProgress.xaml new file mode 100644 index 0000000..6e13c1d --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitRoundProgress.xaml @@ -0,0 +1,14 @@ + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitRoundTimer.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitRoundTimer.xaml new file mode 100644 index 0000000..7716f9b --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitRoundTimer.xaml @@ -0,0 +1,13 @@ + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitScrollBar.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitScrollBar.xaml new file mode 100644 index 0000000..44c22b5 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitScrollBar.xaml @@ -0,0 +1,16 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSearch.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSearch.xaml new file mode 100644 index 0000000..72e053b --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSearch.xaml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSelect.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSelect.xaml new file mode 100644 index 0000000..504b2b1 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSelect.xaml @@ -0,0 +1,20 @@ + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSelectItem.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSelectItem.xaml new file mode 100644 index 0000000..2434aa7 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSelectItem.xaml @@ -0,0 +1,14 @@ + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSelectPresenter.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSelectPresenter.xaml new file mode 100644 index 0000000..faf75f6 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSelectPresenter.xaml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSelectableText.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSelectableText.xaml new file mode 100644 index 0000000..fd82671 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSelectableText.xaml @@ -0,0 +1,14 @@ + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSpinner12.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSpinner12.xaml new file mode 100644 index 0000000..ba4dc0b --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSpinner12.xaml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSpinner16.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSpinner16.xaml new file mode 100644 index 0000000..ba4dc0b --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSpinner16.xaml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSpinner24.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSpinner24.xaml new file mode 100644 index 0000000..ba4dc0b --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSpinner24.xaml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSpinner48.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSpinner48.xaml new file mode 100644 index 0000000..ba4dc0b --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSpinner48.xaml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSpinner64.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSpinner64.xaml new file mode 100644 index 0000000..ba4dc0b --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSpinner64.xaml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSpinner8.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSpinner8.xaml new file mode 100644 index 0000000..ba4dc0b --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSpinner8.xaml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSplitButtonBaseOutlineSecondary.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSplitButtonBaseOutlineSecondary.xaml new file mode 100644 index 0000000..482f8b6 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSplitButtonBaseOutlineSecondary.xaml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSplitButtonBasePrimary.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSplitButtonBasePrimary.xaml new file mode 100644 index 0000000..8f428f4 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSplitButtonBasePrimary.xaml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSplitButtonBaseSecondary.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSplitButtonBaseSecondary.xaml new file mode 100644 index 0000000..47c31ed --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSplitButtonBaseSecondary.xaml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSplitButtonDangerPrimary.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSplitButtonDangerPrimary.xaml new file mode 100644 index 0000000..00af0b2 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSplitButtonDangerPrimary.xaml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSplitButtonNeutralPrimary.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSplitButtonNeutralPrimary.xaml new file mode 100644 index 0000000..a3aa689 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSplitButtonNeutralPrimary.xaml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSsoButtonAppleColor.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSsoButtonAppleColor.xaml new file mode 100644 index 0000000..4ba2f08 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSsoButtonAppleColor.xaml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSsoButtonAppleWhite.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSsoButtonAppleWhite.xaml new file mode 100644 index 0000000..cf50c21 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSsoButtonAppleWhite.xaml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSsoButtonFacebookColor.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSsoButtonFacebookColor.xaml new file mode 100644 index 0000000..1d0a642 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSsoButtonFacebookColor.xaml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSsoButtonFacebookWhite.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSsoButtonFacebookWhite.xaml new file mode 100644 index 0000000..cf50c21 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSsoButtonFacebookWhite.xaml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSsoButtonGoogleColor.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSsoButtonGoogleColor.xaml new file mode 100644 index 0000000..e3350e1 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSsoButtonGoogleColor.xaml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSsoButtonGoogleWhite.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSsoButtonGoogleWhite.xaml new file mode 100644 index 0000000..cf50c21 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSsoButtonGoogleWhite.xaml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSsoButtonVKColor.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSsoButtonVKColor.xaml new file mode 100644 index 0000000..fa0b7aa --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSsoButtonVKColor.xaml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSsoButtonVKWhite.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSsoButtonVKWhite.xaml new file mode 100644 index 0000000..cf50c21 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSsoButtonVKWhite.xaml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSsoButtonYandexIntColor.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSsoButtonYandexIntColor.xaml new file mode 100644 index 0000000..4ba2f08 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSsoButtonYandexIntColor.xaml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSsoButtonYandexIntWhite.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSsoButtonYandexIntWhite.xaml new file mode 100644 index 0000000..cf50c21 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSsoButtonYandexIntWhite.xaml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSsoButtonYandexRuColor.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSsoButtonYandexRuColor.xaml new file mode 100644 index 0000000..4ba2f08 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSsoButtonYandexRuColor.xaml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSsoButtonYandexRuWhite.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSsoButtonYandexRuWhite.xaml new file mode 100644 index 0000000..cf50c21 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSsoButtonYandexRuWhite.xaml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitStatusBulletSmall.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitStatusBulletSmall.xaml new file mode 100644 index 0000000..1150fd3 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitStatusBulletSmall.xaml @@ -0,0 +1,14 @@ + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitStatusBulletStandard.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitStatusBulletStandard.xaml new file mode 100644 index 0000000..1150fd3 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitStatusBulletStandard.xaml @@ -0,0 +1,14 @@ + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitStatusTag.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitStatusTag.xaml new file mode 100644 index 0000000..aaf7d37 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitStatusTag.xaml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSwitchBig.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSwitchBig.xaml new file mode 100644 index 0000000..57d0683 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSwitchBig.xaml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSwitchSmall.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSwitchSmall.xaml new file mode 100644 index 0000000..57d0683 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitSwitchSmall.xaml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTabMenuItemPrimary.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTabMenuItemPrimary.xaml new file mode 100644 index 0000000..74fb2c0 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTabMenuItemPrimary.xaml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTabMenuItemSecondaryGrey.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTabMenuItemSecondaryGrey.xaml new file mode 100644 index 0000000..73993ea --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTabMenuItemSecondaryGrey.xaml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTabMenuItemSecondaryWhite.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTabMenuItemSecondaryWhite.xaml new file mode 100644 index 0000000..4da2ce4 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTabMenuItemSecondaryWhite.xaml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTabMenuPrimaryGrey.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTabMenuPrimaryGrey.xaml new file mode 100644 index 0000000..59d9cc8 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTabMenuPrimaryGrey.xaml @@ -0,0 +1,11 @@ + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTabMenuPrimaryWhite.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTabMenuPrimaryWhite.xaml new file mode 100644 index 0000000..08a2679 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTabMenuPrimaryWhite.xaml @@ -0,0 +1,11 @@ + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTabMenuSecondaryGrey.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTabMenuSecondaryGrey.xaml new file mode 100644 index 0000000..59d9cc8 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTabMenuSecondaryGrey.xaml @@ -0,0 +1,11 @@ + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTabMenuSecondaryWhite.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTabMenuSecondaryWhite.xaml new file mode 100644 index 0000000..08a2679 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTabMenuSecondaryWhite.xaml @@ -0,0 +1,11 @@ + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTagDefault.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTagDefault.xaml new file mode 100644 index 0000000..03861b2 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTagDefault.xaml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTagOutline.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTagOutline.xaml new file mode 100644 index 0000000..d435db5 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTagOutline.xaml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTextArea.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTextArea.xaml new file mode 100644 index 0000000..6cab701 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTextArea.xaml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTextInput.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTextInput.xaml new file mode 100644 index 0000000..a9f6f1e --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTextInput.xaml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTextStyleBaseText.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTextStyleBaseText.xaml new file mode 100644 index 0000000..74dc8d0 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTextStyleBaseText.xaml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTextStyleBaseTextMonospace.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTextStyleBaseTextMonospace.xaml new file mode 100644 index 0000000..74dc8d0 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTextStyleBaseTextMonospace.xaml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTextStyleBaseTextSemibold.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTextStyleBaseTextSemibold.xaml new file mode 100644 index 0000000..74dc8d0 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTextStyleBaseTextSemibold.xaml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTextStyleButton.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTextStyleButton.xaml new file mode 100644 index 0000000..74dc8d0 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTextStyleButton.xaml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTextStyleHeader1.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTextStyleHeader1.xaml new file mode 100644 index 0000000..74dc8d0 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTextStyleHeader1.xaml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTextStyleHeader2.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTextStyleHeader2.xaml new file mode 100644 index 0000000..74dc8d0 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTextStyleHeader2.xaml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTextStyleHeader3.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTextStyleHeader3.xaml new file mode 100644 index 0000000..74dc8d0 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTextStyleHeader3.xaml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTextStyleHeader3Monospace.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTextStyleHeader3Monospace.xaml new file mode 100644 index 0000000..74dc8d0 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTextStyleHeader3Monospace.xaml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTextStyleHeader4.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTextStyleHeader4.xaml new file mode 100644 index 0000000..74dc8d0 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTextStyleHeader4.xaml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTextStyleHeader5.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTextStyleHeader5.xaml new file mode 100644 index 0000000..74dc8d0 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTextStyleHeader5.xaml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTextStyleSmallText.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTextStyleSmallText.xaml new file mode 100644 index 0000000..74dc8d0 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTextStyleSmallText.xaml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTextStyleSmallTextMedium.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTextStyleSmallTextMedium.xaml new file mode 100644 index 0000000..74dc8d0 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTextStyleSmallTextMedium.xaml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTextStyleSubheader.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTextStyleSubheader.xaml new file mode 100644 index 0000000..74dc8d0 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTextStyleSubheader.xaml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTextViewer.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTextViewer.xaml new file mode 100644 index 0000000..8d61686 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTextViewer.xaml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTooltipStandard.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTooltipStandard.xaml new file mode 100644 index 0000000..89ffaea --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/dictionaries/UiKitTooltipStandard.xaml @@ -0,0 +1,11 @@ + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/images/svg/UiKitCheckbox_Icon.svg b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/images/svg/UiKitCheckbox_Icon.svg new file mode 100644 index 0000000..edcb907 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/images/svg/UiKitCheckbox_Icon.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/images/svg/UiKitCheckbox_IconPartial.svg b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/images/svg/UiKitCheckbox_IconPartial.svg new file mode 100644 index 0000000..89ec284 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/images/svg/UiKitCheckbox_IconPartial.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/images/svg/UiKitPopupDanger_PopupArrowIconBottom.svg b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/images/svg/UiKitPopupDanger_PopupArrowIconBottom.svg new file mode 100644 index 0000000..d697da4 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/images/svg/UiKitPopupDanger_PopupArrowIconBottom.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/images/svg/UiKitPopupDanger_PopupArrowIconLeft.svg b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/images/svg/UiKitPopupDanger_PopupArrowIconLeft.svg new file mode 100644 index 0000000..84749b0 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/images/svg/UiKitPopupDanger_PopupArrowIconLeft.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/images/svg/UiKitPopupDanger_PopupArrowIconRight.svg b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/images/svg/UiKitPopupDanger_PopupArrowIconRight.svg new file mode 100644 index 0000000..d8304d1 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/images/svg/UiKitPopupDanger_PopupArrowIconRight.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/images/svg/UiKitPopupDanger_PopupArrowIconTop.svg b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/images/svg/UiKitPopupDanger_PopupArrowIconTop.svg new file mode 100644 index 0000000..f4bf92a --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/images/svg/UiKitPopupDanger_PopupArrowIconTop.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/images/svg/UiKitPopupStandard_PopupArrowIconBottom.svg b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/images/svg/UiKitPopupStandard_PopupArrowIconBottom.svg new file mode 100644 index 0000000..27b0108 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/images/svg/UiKitPopupStandard_PopupArrowIconBottom.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/images/svg/UiKitPopupStandard_PopupArrowIconLeft.svg b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/images/svg/UiKitPopupStandard_PopupArrowIconLeft.svg new file mode 100644 index 0000000..26cbd03 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/images/svg/UiKitPopupStandard_PopupArrowIconLeft.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/images/svg/UiKitPopupStandard_PopupArrowIconRight.svg b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/images/svg/UiKitPopupStandard_PopupArrowIconRight.svg new file mode 100644 index 0000000..63555a0 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/images/svg/UiKitPopupStandard_PopupArrowIconRight.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/images/svg/UiKitPopupStandard_PopupArrowIconTop.svg b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/images/svg/UiKitPopupStandard_PopupArrowIconTop.svg new file mode 100644 index 0000000..42e9138 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/images/svg/UiKitPopupStandard_PopupArrowIconTop.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/images/svg/UiKitRadiobutton_Icon.svg b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/images/svg/UiKitRadiobutton_Icon.svg new file mode 100644 index 0000000..14474ac --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/images/svg/UiKitRadiobutton_Icon.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/images/svg/UiKitSpinner12_Icon.svg b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/images/svg/UiKitSpinner12_Icon.svg new file mode 100644 index 0000000..33fdd58 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/images/svg/UiKitSpinner12_Icon.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/images/svg/UiKitSpinner16_Icon.svg b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/images/svg/UiKitSpinner16_Icon.svg new file mode 100644 index 0000000..576bf48 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/images/svg/UiKitSpinner16_Icon.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/images/svg/UiKitSpinner24_Icon.svg b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/images/svg/UiKitSpinner24_Icon.svg new file mode 100644 index 0000000..c3d0fc5 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/images/svg/UiKitSpinner24_Icon.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/images/svg/UiKitSpinner48_Icon.svg b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/images/svg/UiKitSpinner48_Icon.svg new file mode 100644 index 0000000..0dc014e --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/images/svg/UiKitSpinner48_Icon.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/images/svg/UiKitSpinner64_Icon.svg b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/images/svg/UiKitSpinner64_Icon.svg new file mode 100644 index 0000000..f8c499a --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/images/svg/UiKitSpinner64_Icon.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/images/svg/UiKitSpinner8_Icon.svg b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/images/svg/UiKitSpinner8_Icon.svg new file mode 100644 index 0000000..81ac270 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/images/svg/UiKitSpinner8_Icon.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/images/svg/UiKitStatusBulletSmall_BulletMark.svg b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/images/svg/UiKitStatusBulletSmall_BulletMark.svg new file mode 100644 index 0000000..7b95c6a --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/images/svg/UiKitStatusBulletSmall_BulletMark.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/images/svg/UiKitStatusBulletStandard_BulletMark.svg b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/images/svg/UiKitStatusBulletStandard_BulletMark.svg new file mode 100644 index 0000000..7b95c6a --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Resources/neutral/images/svg/UiKitStatusBulletStandard_BulletMark.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Visuals.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Visuals.xaml new file mode 100644 index 0000000..92c00f6 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Visuals.xaml @@ -0,0 +1,24 @@ + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Xaml/Generated/Styles.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Xaml/Generated/Styles.xaml new file mode 100644 index 0000000..b05d1f8 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Xaml/Generated/Styles.xaml @@ -0,0 +1,1317 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Xaml/Generated/Templates.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Xaml/Generated/Templates.xaml new file mode 100644 index 0000000..572975e --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Xaml/Generated/Templates.xaml @@ -0,0 +1,160 @@ + + + + + + + + + + + + + + diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Xaml/Manual/Styles.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Xaml/Manual/Styles.xaml new file mode 100644 index 0000000..a03b179 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Xaml/Manual/Styles.xaml @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Xaml/Manual/StylesManual.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Xaml/Manual/StylesManual.xaml new file mode 100644 index 0000000..48088da --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Xaml/Manual/StylesManual.xaml @@ -0,0 +1,25 @@ + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Xaml/Manual/Templates.xaml b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Xaml/Manual/Templates.xaml new file mode 100644 index 0000000..9bc8949 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/Xaml/Manual/Templates.xaml @@ -0,0 +1,18 @@ + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Styles/framework.uikit.styles.props b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/framework.uikit.styles.props new file mode 100644 index 0000000..0ce9f38 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Styles/framework.uikit.styles.props @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Tests/Common/LocalizationManagerDependentTests.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/Common/LocalizationManagerDependentTests.cs new file mode 100644 index 0000000..18fb247 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/Common/LocalizationManagerDependentTests.cs @@ -0,0 +1,56 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System.Globalization; + +namespace Kaspirin.UI.Framework.UiKit.Tests.Common +{ + public abstract class LocalizationManagerDependentTests + { + protected void InitializeLocalizationManager(string displayCulture, string? formatCulture = default) + { + Guard.ArgumentIsNotNull(displayCulture); + + var localizationManagerParameters = new LocalizationParameters(displayCulture) + { + FormatCulture = formatCulture ?? displayCulture, + }; + + LocalizationManager.Initialize(localizationManagerParameters); + } + + protected void AssertAreEqualInDisplayCulture(string? expected, string? actual, bool ignoreCase = true) + => AssertAreEqualInSpecificCulture(expected, actual, LocalizationManager.Current.DisplayCulture.CultureInfo, ignoreCase); + + protected void AssertAreEqualInFormatCulture(string? expected, string? actual, bool ignoreCase = true) + => AssertAreEqualInSpecificCulture(expected, actual, LocalizationManager.Current.FormatCulture.CultureInfo, ignoreCase); + + private void AssertAreEqualInSpecificCulture(string? expected, string? actual, CultureInfo cultureInfo, bool ignoreCase) + => Assert.IsTrue(Equals(expected, actual, cultureInfo, ignoreCase), $"Expected: {expected}, actual: {actual}"); + + public static bool Equals(string? string1, string? string2, CultureInfo cultureInfo, bool ignoreCase) + { + Guard.ArgumentIsNotNull(cultureInfo); + + var compareResult = cultureInfo.CompareInfo.Compare( + string1, + string2, + CompareOptions.IgnoreSymbols | (ignoreCase + ? CompareOptions.IgnoreCase + : CompareOptions.None)); + + return compareResult == 0; + } + } +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Tests/Kaspirin.UI.Framework.UiKit.Tests.csproj b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/Kaspirin.UI.Framework.UiKit.Tests.csproj new file mode 100644 index 0000000..84bc6f8 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/Kaspirin.UI.Framework.UiKit.Tests.csproj @@ -0,0 +1,27 @@ + + + true + Kaspirin.UI.Framework.UiKit.Tests + kaspirin.ui.framework.uikit.tests + true + + + + + + + + + + + + + + + + + + + + + diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/BooleanConverters/BooleanToDoubleConverterTests.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/BooleanConverters/BooleanToDoubleConverterTests.cs new file mode 100644 index 0000000..b04ef9c --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/BooleanConverters/BooleanToDoubleConverterTests.cs @@ -0,0 +1,91 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using Kaspirin.UI.Framework.UiKit.Converters.BooleanConverters; +using System; +using System.Globalization; + +namespace Kaspirin.UI.Framework.UiKit.Tests.TestSuites.Converters.BooleanConverters; + +[TestClass] +public sealed class BooleanToDoubleConverterTests +{ + [TestMethod] + public void Convert_TrueValue_Returns1() + { + // Arrange + var converter = new BooleanToDoubleConverter(); + var value = true; + var targetType = typeof(double); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(value, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, targetType); + Assert.AreEqual(1.0, result); + } + + [TestMethod] + public void Convert_FalseValue_Returns0() + { + // Arrange + var converter = new BooleanToDoubleConverter(); + var value = false; + var targetType = typeof(double); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(value, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, targetType); + Assert.AreEqual(0.0, result); + } + + [TestMethod] + public void Convert_NullValue_Returns0() + { + // Arrange + var converter = new BooleanToDoubleConverter(); + var value = default(object); + var targetType = typeof(double); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(value, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, targetType); + Assert.AreEqual(0.0, result); + } + + [TestMethod] + public void Convert_NonBooleanValue_ThrowsException() + { + // Arrange + var converter = new BooleanToDoubleConverter(); + var value = "invalid"; + var targetType = typeof(double); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + assert + Assert.ThrowsException(() => converter.Convert(value, targetType, parameter, culture)); + } +} \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/BooleanConverters/BooleanToIcon16ConverterTests.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/BooleanConverters/BooleanToIcon16ConverterTests.cs new file mode 100644 index 0000000..837f9c5 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/BooleanConverters/BooleanToIcon16ConverterTests.cs @@ -0,0 +1,91 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using Kaspirin.UI.Framework.UiKit.Converters.BooleanConverters; +using System; +using System.Globalization; + +namespace Kaspirin.UI.Framework.UiKit.Tests.TestSuites.Converters.BooleanConverters; + +[TestClass] +public sealed class BooleanToIcon16ConverterTests +{ + [TestMethod] + public void Convert_TrueValue_ReturnsTrueIcon() + { + // Arrange + var converter = new BooleanToIcon16Converter { True = UIKitIcon_16.StatusPositive }; + var value = true; + var targetType = typeof(UIKitIcon_16); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(value, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, targetType); + Assert.AreEqual(converter.True, result); + } + + [TestMethod] + public void Convert_FalseValue_ReturnsFalseIcon() + { + // Arrange + var converter = new BooleanToIcon16Converter { False = UIKitIcon_16.StatusDanger }; + var value = false; + var targetType = typeof(UIKitIcon_16); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(value, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, targetType); + Assert.AreEqual(converter.False, result); + } + + [TestMethod] + public void Convert_NullValue_ReturnsFalseIcon() + { + // Arrange + var converter = new BooleanToIcon16Converter { False = UIKitIcon_16.StatusDanger }; + var value = default(object); + var targetType = typeof(UIKitIcon_16); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(value, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, targetType); + Assert.AreEqual(converter.False, result); + } + + [TestMethod] + public void Convert_NonBooleanValue_ThrowsException() + { + // Arrange + var converter = new BooleanToIcon16Converter(); + var value = "invalid"; + var targetType = typeof(UIKitIcon_16); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + assert + Assert.ThrowsException(() => converter.Convert(value, targetType, parameter, culture)); + } +} \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/BooleanConverters/BooleanToIcon24ConverterTests.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/BooleanConverters/BooleanToIcon24ConverterTests.cs new file mode 100644 index 0000000..315cddd --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/BooleanConverters/BooleanToIcon24ConverterTests.cs @@ -0,0 +1,91 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using Kaspirin.UI.Framework.UiKit.Converters.BooleanConverters; +using System; +using System.Globalization; + +namespace Kaspirin.UI.Framework.UiKit.Tests.TestSuites.Converters.BooleanConverters; + +[TestClass] +public sealed class BooleanToIcon24ConverterTests +{ + [TestMethod] + public void Convert_TrueValue_ReturnsTrueIcon() + { + // Arrange + var converter = new BooleanToIcon24Converter { True = UIKitIcon_24.StatusPositive }; + var value = true; + var targetType = typeof(UIKitIcon_24); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(value, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, targetType); + Assert.AreEqual(converter.True, result); + } + + [TestMethod] + public void Convert_FalseValue_ReturnsFalseIcon() + { + // Arrange + var converter = new BooleanToIcon24Converter { False = UIKitIcon_24.StatusDanger }; + var value = false; + var targetType = typeof(UIKitIcon_24); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(value, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, targetType); + Assert.AreEqual(converter.False, result); + } + + [TestMethod] + public void Convert_NullValue_ReturnsFalseIcon() + { + // Arrange + var converter = new BooleanToIcon24Converter { False = UIKitIcon_24.StatusDanger }; + var value = default(object); + var targetType = typeof(UIKitIcon_24); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(value, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, targetType); + Assert.AreEqual(converter.False, result); + } + + [TestMethod] + public void Convert_NonBooleanValue_ThrowsException() + { + // Arrange + var converter = new BooleanToIcon24Converter(); + var value = "invalid"; + var targetType = typeof(UIKitIcon_24); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + assert + Assert.ThrowsException(() => converter.Convert(value, targetType, parameter, culture)); + } +} \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/BooleanConverters/BooleanToIntegerConverterTests.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/BooleanConverters/BooleanToIntegerConverterTests.cs new file mode 100644 index 0000000..8f81273 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/BooleanConverters/BooleanToIntegerConverterTests.cs @@ -0,0 +1,91 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using Kaspirin.UI.Framework.UiKit.Converters.BooleanConverters; +using System; +using System.Globalization; + +namespace Kaspirin.UI.Framework.UiKit.Tests.TestSuites.Converters.BooleanConverters; + +[TestClass] +public sealed class BooleanToIntegerConverterTests +{ + [TestMethod] + public void Convert_TrueValue_Returns1() + { + // Arrange + var converter = new BooleanToIntegerConverter(); + var value = true; + var targetType = typeof(int); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(value, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, targetType); + Assert.AreEqual(1, result); + } + + [TestMethod] + public void Convert_FalseValue_Returns0() + { + // Arrange + var converter = new BooleanToIntegerConverter(); + var value = false; + var targetType = typeof(int); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(value, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, targetType); + Assert.AreEqual(0, result); + } + + [TestMethod] + public void Convert_NullValue_Returns0() + { + // Arrange + var converter = new BooleanToIntegerConverter(); + var value = default(object); + var targetType = typeof(int); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(value, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, targetType); + Assert.AreEqual(0, result); + } + + [TestMethod] + public void Convert_NonBooleanValue_ThrowsException() + { + // Arrange + var converter = new BooleanToIntegerConverter(); + var value = "invalid"; + var targetType = typeof(int); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + assert + Assert.ThrowsException(() => converter.Convert(value, targetType, parameter, culture)); + } +} \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/BooleanConverters/BooleanToInvertedValueConverterTests.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/BooleanConverters/BooleanToInvertedValueConverterTests.cs new file mode 100644 index 0000000..3326d0d --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/BooleanConverters/BooleanToInvertedValueConverterTests.cs @@ -0,0 +1,91 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using Kaspirin.UI.Framework.UiKit.Converters.BooleanConverters; +using System; +using System.Globalization; + +namespace Kaspirin.UI.Framework.UiKit.Tests.TestSuites.Converters.BooleanConverters; + +[TestClass] +public sealed class BooleanToInvertedValueConverterTests +{ + [TestMethod] + public void Convert_TrueValue_ReturnsFalse() + { + // Arrange + var converter = new BooleanToInvertedValueConverter(); + var value = true; + var targetType = typeof(bool); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(value, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, targetType); + Assert.AreEqual(false, result); + } + + [TestMethod] + public void Convert_FalseValue_ReturnsTrue() + { + // Arrange + var converter = new BooleanToInvertedValueConverter(); + var value = false; + var targetType = typeof(bool); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(value, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, targetType); + Assert.AreEqual(true, result); + } + + [TestMethod] + public void Convert_NullValue_ReturnsTrue() + { + // Arrange + var converter = new BooleanToInvertedValueConverter(); + var value = default(object); + var targetType = typeof(bool); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(value, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, targetType); + Assert.AreEqual(true, result); + } + + [TestMethod] + public void Convert_NonBooleanValue_ThrowsException() + { + // Arrange + var converter = new BooleanToInvertedValueConverter(); + var value = "invalid"; + var targetType = typeof(bool); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + assert + Assert.ThrowsException(() => converter.Convert(value, targetType, parameter, culture)); + } +} \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/BooleanConverters/BooleanToObjectConverterTests.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/BooleanConverters/BooleanToObjectConverterTests.cs new file mode 100644 index 0000000..d6e3086 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/BooleanConverters/BooleanToObjectConverterTests.cs @@ -0,0 +1,91 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using Kaspirin.UI.Framework.UiKit.Converters.BooleanConverters; +using System; +using System.Globalization; + +namespace Kaspirin.UI.Framework.UiKit.Tests.TestSuites.Converters.BooleanConverters; + +[TestClass] +public sealed class BooleanToObjectConverterTests +{ + [TestMethod] + public void Convert_TrueValue_ReturnsTrueObject() + { + // Arrange + var converter = new BooleanToObjectConverter { True = "True" }; + var value = true; + var targetType = typeof(object); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(value, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, targetType); + Assert.AreEqual(converter.True, result); + } + + [TestMethod] + public void Convert_FalseValue_ReturnsFalseObject() + { + // Arrange + var converter = new BooleanToObjectConverter { False = "False" }; + var value = false; + var targetType = typeof(object); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(value, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, targetType); + Assert.AreEqual(converter.False, result); + } + + [TestMethod] + public void Convert_NullValue_ReturnsFalseObject() + { + // Arrange + var converter = new BooleanToObjectConverter { False = "False" }; + var value = default(object); + var targetType = typeof(object); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(value, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, targetType); + Assert.AreEqual(converter.False, result); + } + + [TestMethod] + public void Convert_NonBooleanValue_ThrowsException() + { + // Arrange + var converter = new BooleanToObjectConverter(); + var value = "invalid"; + var targetType = typeof(object); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + assert + Assert.ThrowsException(() => converter.Convert(value, targetType, parameter, culture)); + } +} \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/BooleanConverters/BooleanToVisibilityConverterTests.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/BooleanConverters/BooleanToVisibilityConverterTests.cs new file mode 100644 index 0000000..d23e9c8 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/BooleanConverters/BooleanToVisibilityConverterTests.cs @@ -0,0 +1,92 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using Kaspirin.UI.Framework.UiKit.Converters.BooleanConverters; +using System; +using System.Globalization; +using System.Windows; + +namespace Kaspirin.UI.Framework.UiKit.Tests.TestSuites.Converters.BooleanConverters; + +[TestClass] +public sealed class BooleanToVisibilityConverterTests +{ + [TestMethod] + public void Convert_TrueValue_ReturnsVisible() + { + // Arrange + var converter = new BooleanToVisibilityConverter(); + var value = true; + var targetType = typeof(Visibility); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(value, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, targetType); + Assert.AreEqual(Visibility.Visible, result); + } + + [TestMethod] + public void Convert_FalseValue_ReturnsCollapsed() + { + // Arrange + var converter = new BooleanToVisibilityConverter(); + var value = false; + var targetType = typeof(Visibility); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(value, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, targetType); + Assert.AreEqual(Visibility.Collapsed, result); + } + + [TestMethod] + public void Convert_NullValue_ReturnsCollapsed() + { + // Arrange + var converter = new BooleanToVisibilityConverter(); + var value = default(object); + var targetType = typeof(Visibility); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(value, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, targetType); + Assert.AreEqual(Visibility.Collapsed, result); + } + + [TestMethod] + public void Convert_NonBooleanValue_ThrowsException() + { + // Arrange + var converter = new BooleanToVisibilityConverter(); + var value = "invalid"; + var targetType = typeof(Visibility); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + assert + Assert.ThrowsException(() => converter.Convert(value, targetType, parameter, culture)); + } +} \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/BooleanConverters/BooleanToVisibilityInverseConverterTests.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/BooleanConverters/BooleanToVisibilityInverseConverterTests.cs new file mode 100644 index 0000000..d27e6f2 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/BooleanConverters/BooleanToVisibilityInverseConverterTests.cs @@ -0,0 +1,92 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using Kaspirin.UI.Framework.UiKit.Converters.BooleanConverters; +using System; +using System.Globalization; +using System.Windows; + +namespace Kaspirin.UI.Framework.UiKit.Tests.TestSuites.Converters.BooleanConverters; + +[TestClass] +public sealed class BooleanToVisibilityInverseConverterTests +{ + [TestMethod] + public void Convert_TrueValue_ReturnsCollapsed() + { + // Arrange + var converter = new BooleanToVisibilityInverseConverter(); + var value = true; + var targetType = typeof(Visibility); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(value, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, targetType); + Assert.AreEqual(Visibility.Collapsed, result); + } + + [TestMethod] + public void Convert_FalseValue_ReturnsVisible() + { + // Arrange + var converter = new BooleanToVisibilityInverseConverter(); + var value = false; + var targetType = typeof(Visibility); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(value, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, targetType); + Assert.AreEqual(Visibility.Visible, result); + } + + [TestMethod] + public void Convert_NullValue_ReturnsVisible() + { + // Arrange + var converter = new BooleanToVisibilityInverseConverter(); + var value = default(object); + var targetType = typeof(Visibility); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(value, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, targetType); + Assert.AreEqual(Visibility.Visible, result); + } + + [TestMethod] + public void Convert_NonBooleanValue_ThrowsException() + { + // Arrange + var converter = new BooleanToVisibilityInverseConverter(); + var value = "invalid"; + var targetType = typeof(Visibility); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + assert + Assert.ThrowsException(() => converter.Convert(value, targetType, parameter, culture)); + } +} \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/BooleanConverters/MultiBooleanToBooleanConverterTests.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/BooleanConverters/MultiBooleanToBooleanConverterTests.cs new file mode 100644 index 0000000..48869e7 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/BooleanConverters/MultiBooleanToBooleanConverterTests.cs @@ -0,0 +1,213 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using Kaspirin.UI.Framework.UiKit.Converters.BooleanConverters; +using System; +using System.Globalization; + +namespace Kaspirin.UI.Framework.UiKit.Tests.TestSuites.Converters.BooleanConverters; + +[TestClass] +public sealed class MultiBooleanToBooleanConverterTests +{ + [TestMethod] + public void Convert_AllFalseValues_AndOperation_ReturnsFalse() + { + // Arrange + var converter = new MultiBooleanToBooleanConverter { Operation = MultiBooleanOperation.And }; + var values = new object?[] { false, false, false }; + var targetType = typeof(bool); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(values, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, typeof(bool)); + Assert.AreEqual(false, result); + } + + [TestMethod] + public void Convert_AllFalseValues_OrOperation_ReturnsFalse() + { + // Arrange + var converter = new MultiBooleanToBooleanConverter { Operation = MultiBooleanOperation.Or }; + var values = new object?[] { false, false, false }; + var targetType = typeof(bool); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(values, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, typeof(bool)); + Assert.AreEqual(false, result); + } + + [TestMethod] + public void Convert_AllTrueValues_AndOperation_ReturnsTrue() + { + // Arrange + var converter = new MultiBooleanToBooleanConverter { Operation = MultiBooleanOperation.And }; + var values = new object?[] { true, true, true }; + var targetType = typeof(bool); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(values, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, typeof(bool)); + Assert.AreEqual(true, result); + } + + [TestMethod] + public void Convert_AllTrueValues_OrOperation_ReturnsTrue() + { + // Arrange + var converter = new MultiBooleanToBooleanConverter { Operation = MultiBooleanOperation.Or }; + var values = new object?[] { true, true, true }; + var targetType = typeof(bool); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(values, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, typeof(bool)); + Assert.AreEqual(true, result); + } + + [TestMethod] + public void Convert_EmptyValues_AndOperation_ReturnsTrue() + { + // Arrange + var converter = new MultiBooleanToBooleanConverter { Operation = MultiBooleanOperation.And }; + var values = Array.Empty(); + var targetType = typeof(bool); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(values, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, typeof(bool)); + Assert.AreEqual(true, result); + } + + [TestMethod] + public void Convert_EmptyValues_OrOperation_ReturnsFalse() + { + // Arrange + var converter = new MultiBooleanToBooleanConverter { Operation = MultiBooleanOperation.Or }; + var values = Array.Empty(); + var targetType = typeof(bool); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(values, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, typeof(bool)); + Assert.AreEqual(false, result); + } + + [TestMethod] + public void Convert_InvalidValue_ThrowsException() + { + // Arrange + var converter = new MultiBooleanToBooleanConverter(); + var values = new object?[] { "invalid" }; + var targetType = typeof(bool); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + assert + Assert.ThrowsException(() => converter.Convert(values, targetType, parameter, culture)); + } + + [TestMethod] + public void Convert_MixedBooleanValues_AndOperation_ReturnsFalse() + { + // Arrange + var converter = new MultiBooleanToBooleanConverter { Operation = MultiBooleanOperation.And }; + var values = new object?[] { true, false, true }; + var targetType = typeof(bool); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(values, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, typeof(bool)); + Assert.AreEqual(false, result); + } + + [TestMethod] + public void Convert_MixedBooleanValues_OrOperation_ReturnsTrue() + { + // Arrange + var converter = new MultiBooleanToBooleanConverter { Operation = MultiBooleanOperation.Or }; + var values = new object?[] { true, false, true }; + var targetType = typeof(bool); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(values, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, typeof(bool)); + Assert.AreEqual(true, result); + } + + [TestMethod] + public void Convert_NullValue_ReturnsFalse() + { + // Arrange + var converter = new MultiBooleanToBooleanConverter(); + var values = new object?[] { default }; + var targetType = typeof(bool); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(values, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, typeof(bool)); + Assert.AreEqual(false, result); + } + + [TestMethod] + public void Convert_NullValues_ThrowsException() + { + // Arrange + var converter = new MultiBooleanToBooleanConverter(); + var values = default(object?[]); + var targetType = typeof(bool); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + assert + Assert.ThrowsException(() => converter.Convert(values!, targetType, parameter, culture)); + } +} \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/BooleanConverters/MultiBooleanToInvertedValueConverterTests.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/BooleanConverters/MultiBooleanToInvertedValueConverterTests.cs new file mode 100644 index 0000000..2b18aff --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/BooleanConverters/MultiBooleanToInvertedValueConverterTests.cs @@ -0,0 +1,213 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using Kaspirin.UI.Framework.UiKit.Converters.BooleanConverters; +using System; +using System.Globalization; + +namespace Kaspirin.UI.Framework.UiKit.Tests.TestSuites.Converters.BooleanConverters; + +[TestClass] +public sealed class MultiBooleanToInvertedValueConverterTests +{ + [TestMethod] + public void Convert_AllFalseValues_AndOperation_ReturnsTrue() + { + // Arrange + var converter = new MultiBooleanToInvertedValueConverter { Operation = MultiBooleanOperation.And }; + var values = new object?[] { false, false, false }; + var targetType = typeof(bool); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(values, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, typeof(bool)); + Assert.AreEqual(true, result); + } + + [TestMethod] + public void Convert_AllFalseValues_OrOperation_ReturnsTrue() + { + // Arrange + var converter = new MultiBooleanToInvertedValueConverter { Operation = MultiBooleanOperation.Or }; + var values = new object?[] { false, false, false }; + var targetType = typeof(bool); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(values, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, typeof(bool)); + Assert.AreEqual(true, result); + } + + [TestMethod] + public void Convert_AllTrueValues_AndOperation_ReturnsFalse() + { + // Arrange + var converter = new MultiBooleanToInvertedValueConverter { Operation = MultiBooleanOperation.And }; + var values = new object?[] { true, true, true }; + var targetType = typeof(bool); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(values, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, typeof(bool)); + Assert.AreEqual(false, result); + } + + [TestMethod] + public void Convert_AllTrueValues_OrOperation_ReturnsFalse() + { + // Arrange + var converter = new MultiBooleanToInvertedValueConverter { Operation = MultiBooleanOperation.Or }; + var values = new object?[] { true, true, true }; + var targetType = typeof(bool); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(values, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, typeof(bool)); + Assert.AreEqual(false, result); + } + + [TestMethod] + public void Convert_EmptyValues_AndOperation_ReturnsFalse() + { + // Arrange + var converter = new MultiBooleanToInvertedValueConverter { Operation = MultiBooleanOperation.And }; + var values = Array.Empty(); + var targetType = typeof(bool); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(values, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, typeof(bool)); + Assert.AreEqual(false, result); + } + + [TestMethod] + public void Convert_EmptyValues_OrOperation_ReturnsTrue() + { + // Arrange + var converter = new MultiBooleanToInvertedValueConverter { Operation = MultiBooleanOperation.Or }; + var values = Array.Empty(); + var targetType = typeof(bool); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(values, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, typeof(bool)); + Assert.AreEqual(true, result); + } + + [TestMethod] + public void Convert_MixedBooleanValues_AndOperation_ReturnsTrue() + { + // Arrange + var converter = new MultiBooleanToInvertedValueConverter { Operation = MultiBooleanOperation.And }; + var values = new object?[] { true, false, true }; + var targetType = typeof(bool); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(values, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, typeof(bool)); + Assert.AreEqual(true, result); + } + + [TestMethod] + public void Convert_MixedBooleanValues_OrOperation_ReturnsFalse() + { + // Arrange + var converter = new MultiBooleanToInvertedValueConverter { Operation = MultiBooleanOperation.Or }; + var values = new object?[] { true, false, true }; + var targetType = typeof(bool); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(values, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, typeof(bool)); + Assert.AreEqual(false, result); + } + + [TestMethod] + public void Convert_InvalidValue_ThrowsException() + { + // Arrange + var converter = new MultiBooleanToInvertedValueConverter(); + var values = new object?[] { "invalid" }; + var targetType = typeof(bool); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + assert + Assert.ThrowsException(() => converter.Convert(values, targetType, parameter, culture)); + } + + [TestMethod] + public void Convert_NullValue_ReturnsTrue() + { + // Arrange + var converter = new MultiBooleanToInvertedValueConverter(); + var values = new object?[] { default }; + var targetType = typeof(bool); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(values, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, typeof(bool)); + Assert.AreEqual(true, result); + } + + [TestMethod] + public void Convert_NullValues_ThrowsException() + { + // Arrange + var converter = new MultiBooleanToInvertedValueConverter(); + var values = default(object?[]); + var targetType = typeof(bool); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + assert + Assert.ThrowsException(() => converter.Convert(values!, targetType, parameter, culture)); + } +} \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/BooleanConverters/MultiBooleanToObjectConverterTests.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/BooleanConverters/MultiBooleanToObjectConverterTests.cs new file mode 100644 index 0000000..8e18936 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/BooleanConverters/MultiBooleanToObjectConverterTests.cs @@ -0,0 +1,213 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using Kaspirin.UI.Framework.UiKit.Converters.BooleanConverters; +using System; +using System.Globalization; + +namespace Kaspirin.UI.Framework.UiKit.Tests.TestSuites.Converters.BooleanConverters; + +[TestClass] +public sealed class MultiBooleanToObjectConverterTests +{ + [TestMethod] + public void Convert_AllFalseValues_AndOperation_ReturnsFalseObject() + { + // Arrange + var converter = new MultiBooleanToObjectConverter { Operation = MultiBooleanOperation.And, False = "False" }; + var values = new object?[] { false, false, false }; + var targetType = typeof(object); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(values, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, typeof(string)); + Assert.AreEqual("False", result); + } + + [TestMethod] + public void Convert_AllFalseValues_OrOperation_ReturnsFalseObject() + { + // Arrange + var converter = new MultiBooleanToObjectConverter { Operation = MultiBooleanOperation.Or, False = "False" }; + var values = new object?[] { false, false, false }; + var targetType = typeof(object); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(values, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, typeof(string)); + Assert.AreEqual("False", result); + } + + [TestMethod] + public void Convert_AllTrueValues_AndOperation_ReturnsTrueObject() + { + // Arrange + var converter = new MultiBooleanToObjectConverter { Operation = MultiBooleanOperation.And, True = "True" }; + var values = new object?[] { true, true, true }; + var targetType = typeof(object); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(values, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, typeof(string)); + Assert.AreEqual("True", result); + } + + [TestMethod] + public void Convert_AllTrueValues_OrOperation_ReturnsTrueObject() + { + // Arrange + var converter = new MultiBooleanToObjectConverter { Operation = MultiBooleanOperation.Or, True = "True" }; + var values = new object?[] { true, true, true }; + var targetType = typeof(object); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(values, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, typeof(string)); + Assert.AreEqual("True", result); + } + + [TestMethod] + public void Convert_EmptyValues_AndOperation_ReturnsTrueObject() + { + // Arrange + var converter = new MultiBooleanToObjectConverter { Operation = MultiBooleanOperation.And, True = "True" }; + var values = Array.Empty(); + var targetType = typeof(object); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(values, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, typeof(string)); + Assert.AreEqual("True", result); + } + + [TestMethod] + public void Convert_EmptyValues_OrOperation_ReturnsFalseObject() + { + // Arrange + var converter = new MultiBooleanToObjectConverter { Operation = MultiBooleanOperation.Or, False = "False" }; + var values = Array.Empty(); + var targetType = typeof(object); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(values, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, typeof(string)); + Assert.AreEqual("False", result); + } + + [TestMethod] + public void Convert_InvalidValue_ThrowsException() + { + // Arrange + var converter = new MultiBooleanToObjectConverter(); + var values = new object?[] { "invalid" }; + var targetType = typeof(bool); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + assert + Assert.ThrowsException(() => converter.Convert(values, targetType, parameter, culture)); + } + + [TestMethod] + public void Convert_MixedBooleanValues_AndOperation_ReturnsFalseObject() + { + // Arrange + var converter = new MultiBooleanToObjectConverter { Operation = MultiBooleanOperation.And, False = "False" }; + var values = new object?[] { true, false, true }; + var targetType = typeof(object); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(values, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, typeof(string)); + Assert.AreEqual("False", result); + } + + [TestMethod] + public void Convert_MixedBooleanValues_OrOperation_ReturnsTrueObject() + { + // Arrange + var converter = new MultiBooleanToObjectConverter { Operation = MultiBooleanOperation.Or, True = "True" }; + var values = new object?[] { true, false, true }; + var targetType = typeof(object); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(values, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, typeof(string)); + Assert.AreEqual("True", result); + } + + [TestMethod] + public void Convert_NullValue_ReturnsFalseObject() + { + // Arrange + var converter = new MultiBooleanToObjectConverter { False = "False" }; + var values = new object?[] { default }; + var targetType = typeof(bool); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(values, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, typeof(string)); + Assert.AreEqual("False", result); + } + + [TestMethod] + public void Convert_NullValues_ThrowsException() + { + // Arrange + var converter = new MultiBooleanToObjectConverter(); + var values = default(object?[]); + var targetType = typeof(bool); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + assert + Assert.ThrowsException(() => converter.Convert(values!, targetType, parameter, culture)); + } +} \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/BooleanConverters/MultiBooleanToVisibilityConverterTests.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/BooleanConverters/MultiBooleanToVisibilityConverterTests.cs new file mode 100644 index 0000000..9e5d56d --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/BooleanConverters/MultiBooleanToVisibilityConverterTests.cs @@ -0,0 +1,214 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using Kaspirin.UI.Framework.UiKit.Converters.BooleanConverters; +using System; +using System.Globalization; +using System.Windows; + +namespace Kaspirin.UI.Framework.UiKit.Tests.TestSuites.Converters.BooleanConverters; + +[TestClass] +public sealed class MultiBooleanToVisibilityConverterTests +{ + [TestMethod] + public void Convert_AllFalseValues_AndOperation_ReturnsCollapsed() + { + // Arrange + var converter = new MultiBooleanToVisibilityConverter { Operation = MultiBooleanOperation.And }; + var values = new object?[] { false, false, false }; + var targetType = typeof(Visibility); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(values, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, typeof(Visibility)); + Assert.AreEqual(Visibility.Collapsed, result); + } + + [TestMethod] + public void Convert_AllFalseValues_OrOperation_ReturnsCollapsed() + { + // Arrange + var converter = new MultiBooleanToVisibilityConverter { Operation = MultiBooleanOperation.Or }; + var values = new object?[] { false, false, false }; + var targetType = typeof(Visibility); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(values, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, typeof(Visibility)); + Assert.AreEqual(Visibility.Collapsed, result); + } + + [TestMethod] + public void Convert_AllTrueValues_AndOperation_ReturnsVisible() + { + // Arrange + var converter = new MultiBooleanToVisibilityConverter { Operation = MultiBooleanOperation.And }; + var values = new object?[] { true, true, true }; + var targetType = typeof(Visibility); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(values, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, typeof(Visibility)); + Assert.AreEqual(Visibility.Visible, result); + } + + [TestMethod] + public void Convert_AllTrueValues_OrOperation_ReturnsVisible() + { + // Arrange + var converter = new MultiBooleanToVisibilityConverter { Operation = MultiBooleanOperation.Or }; + var values = new object?[] { true, true, true }; + var targetType = typeof(Visibility); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(values, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, typeof(Visibility)); + Assert.AreEqual(Visibility.Visible, result); + } + + [TestMethod] + public void Convert_EmptyValues_AndOperation_ReturnsVisible() + { + // Arrange + var converter = new MultiBooleanToVisibilityConverter { Operation = MultiBooleanOperation.And }; + var values = Array.Empty(); + var targetType = typeof(Visibility); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(values, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, typeof(Visibility)); + Assert.AreEqual(Visibility.Visible, result); + } + + [TestMethod] + public void Convert_EmptyValues_OrOperation_ReturnsCollapsed() + { + // Arrange + var converter = new MultiBooleanToVisibilityConverter { Operation = MultiBooleanOperation.Or }; + var values = Array.Empty(); + var targetType = typeof(Visibility); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(values, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, typeof(Visibility)); + Assert.AreEqual(Visibility.Collapsed, result); + } + + [TestMethod] + public void Convert_InvalidValue_ThrowsException() + { + // Arrange + var converter = new MultiBooleanToVisibilityConverter(); + var values = new object?[] { "invalid" }; + var targetType = typeof(bool); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + assert + Assert.ThrowsException(() => converter.Convert(values, targetType, parameter, culture)); + } + + [TestMethod] + public void Convert_MixedBooleanValues_AndOperation_ReturnsCollapsed() + { + // Arrange + var converter = new MultiBooleanToVisibilityConverter { Operation = MultiBooleanOperation.And }; + var values = new object?[] { true, false, true }; + var targetType = typeof(Visibility); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(values, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, typeof(Visibility)); + Assert.AreEqual(Visibility.Collapsed, result); + } + + [TestMethod] + public void Convert_MixedBooleanValues_OrOperation_ReturnsVisible() + { + // Arrange + var converter = new MultiBooleanToVisibilityConverter { Operation = MultiBooleanOperation.Or }; + var values = new object?[] { true, false, true }; + var targetType = typeof(Visibility); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(values, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, typeof(Visibility)); + Assert.AreEqual(Visibility.Visible, result); + } + + [TestMethod] + public void Convert_NullValue_ReturnsCollapsed() + { + // Arrange + var converter = new MultiBooleanToVisibilityConverter(); + var values = new object?[] { default }; + var targetType = typeof(bool); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(values, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, typeof(Visibility)); + Assert.AreEqual(Visibility.Collapsed, result); + } + + [TestMethod] + public void Convert_NullValues_ThrowsException() + { + // Arrange + var converter = new MultiBooleanToVisibilityConverter(); + var values = default(object?[]); + var targetType = typeof(bool); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + assert + Assert.ThrowsException(() => converter.Convert(values!, targetType, parameter, culture)); + } +} \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/BooleanConverters/MultiBooleanToVisibilityInverseConverterTests.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/BooleanConverters/MultiBooleanToVisibilityInverseConverterTests.cs new file mode 100644 index 0000000..7e3fd6c --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/BooleanConverters/MultiBooleanToVisibilityInverseConverterTests.cs @@ -0,0 +1,214 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using Kaspirin.UI.Framework.UiKit.Converters.BooleanConverters; +using System; +using System.Globalization; +using System.Windows; + +namespace Kaspirin.UI.Framework.UiKit.Tests.TestSuites.Converters.BooleanConverters; + +[TestClass] +public sealed class MultiBooleanToVisibilityInverseConverterTests +{ + [TestMethod] + public void Convert_AllFalseValues_AndOperation_ReturnsVisible() + { + // Arrange + var converter = new MultiBooleanToVisibilityInverseConverter { Operation = MultiBooleanOperation.And }; + var values = new object?[] { false, false, false }; + var targetType = typeof(Visibility); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(values, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, typeof(Visibility)); + Assert.AreEqual(Visibility.Visible, result); + } + + [TestMethod] + public void Convert_AllFalseValues_OrOperation_ReturnsVisible() + { + // Arrange + var converter = new MultiBooleanToVisibilityInverseConverter { Operation = MultiBooleanOperation.Or }; + var values = new object?[] { false, false, false }; + var targetType = typeof(Visibility); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(values, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, typeof(Visibility)); + Assert.AreEqual(Visibility.Visible, result); + } + + [TestMethod] + public void Convert_AllTrueValues_AndOperation_ReturnsCollapsed() + { + // Arrange + var converter = new MultiBooleanToVisibilityInverseConverter { Operation = MultiBooleanOperation.And }; + var values = new object?[] { true, true, true }; + var targetType = typeof(Visibility); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(values, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, typeof(Visibility)); + Assert.AreEqual(Visibility.Collapsed, result); + } + + [TestMethod] + public void Convert_AllTrueValues_OrOperation_ReturnsCollapsed() + { + // Arrange + var converter = new MultiBooleanToVisibilityInverseConverter { Operation = MultiBooleanOperation.Or }; + var values = new object?[] { true, true, true }; + var targetType = typeof(Visibility); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(values, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, typeof(Visibility)); + Assert.AreEqual(Visibility.Collapsed, result); + } + + [TestMethod] + public void Convert_EmptyValues_AndOperation_ReturnsCollapsed() + { + // Arrange + var converter = new MultiBooleanToVisibilityInverseConverter { Operation = MultiBooleanOperation.And }; + var values = Array.Empty(); + var targetType = typeof(Visibility); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(values, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, typeof(Visibility)); + Assert.AreEqual(Visibility.Collapsed, result); + } + + [TestMethod] + public void Convert_EmptyValues_OrOperation_ReturnsVisible() + { + // Arrange + var converter = new MultiBooleanToVisibilityInverseConverter { Operation = MultiBooleanOperation.Or }; + var values = Array.Empty(); + var targetType = typeof(Visibility); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(values, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, typeof(Visibility)); + Assert.AreEqual(Visibility.Visible, result); + } + + [TestMethod] + public void Convert_InvalidValue_ThrowsException() + { + // Arrange + var converter = new MultiBooleanToVisibilityInverseConverter(); + var values = new object?[] { "invalid" }; + var targetType = typeof(bool); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + assert + Assert.ThrowsException(() => converter.Convert(values, targetType, parameter, culture)); + } + + [TestMethod] + public void Convert_MixedBooleanValues_AndOperation_ReturnsVisible() + { + // Arrange + var converter = new MultiBooleanToVisibilityInverseConverter { Operation = MultiBooleanOperation.And }; + var values = new object?[] { true, false, true }; + var targetType = typeof(Visibility); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(values, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, typeof(Visibility)); + Assert.AreEqual(Visibility.Visible, result); + } + + [TestMethod] + public void Convert_MixedBooleanValues_OrOperation_ReturnsCollapsed() + { + // Arrange + var converter = new MultiBooleanToVisibilityInverseConverter { Operation = MultiBooleanOperation.Or }; + var values = new object?[] { true, false, true }; + var targetType = typeof(Visibility); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(values, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, typeof(Visibility)); + Assert.AreEqual(Visibility.Collapsed, result); + } + + [TestMethod] + public void Convert_NullValue_ReturnsVisible() + { + // Arrange + var converter = new MultiBooleanToVisibilityInverseConverter(); + var values = new object?[] { default }; + var targetType = typeof(bool); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(values, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, typeof(Visibility)); + Assert.AreEqual(Visibility.Visible, result); + } + + [TestMethod] + public void Convert_NullValues_ThrowsException() + { + // Arrange + var converter = new MultiBooleanToVisibilityInverseConverter(); + var values = default(object?[]); + var targetType = typeof(bool); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + assert + Assert.ThrowsException(() => converter.Convert(values!, targetType, parameter, culture)); + } +} \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/CollectionConverters/CollectionToBooleanConverterTests.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/CollectionConverters/CollectionToBooleanConverterTests.cs new file mode 100644 index 0000000..b24356f --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/CollectionConverters/CollectionToBooleanConverterTests.cs @@ -0,0 +1,21 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +namespace Kaspirin.UI.Framework.UiKit.Tests.TestSuites.Converters.CollectionConverters; + +[TestClass] +public sealed class CollectionToBooleanConverterTests +{ + // TODO. +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/CollectionConverters/CollectionToBooleanInverseConverterTests.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/CollectionConverters/CollectionToBooleanInverseConverterTests.cs new file mode 100644 index 0000000..5e9ed30 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/CollectionConverters/CollectionToBooleanInverseConverterTests.cs @@ -0,0 +1,21 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +namespace Kaspirin.UI.Framework.UiKit.Tests.TestSuites.Converters.CollectionConverters; + +[TestClass] +public sealed class CollectionToBooleanInverseConverterTests +{ + // TODO. +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/CollectionConverters/CollectionToObjectConverterTests.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/CollectionConverters/CollectionToObjectConverterTests.cs new file mode 100644 index 0000000..e23e41d --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/CollectionConverters/CollectionToObjectConverterTests.cs @@ -0,0 +1,21 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +namespace Kaspirin.UI.Framework.UiKit.Tests.TestSuites.Converters.CollectionConverters; + +[TestClass] +public sealed class CollectionToObjectConverterTests +{ + // TODO. +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/CollectionConverters/CollectionToVisibilityConverterTests.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/CollectionConverters/CollectionToVisibilityConverterTests.cs new file mode 100644 index 0000000..ef3d625 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/CollectionConverters/CollectionToVisibilityConverterTests.cs @@ -0,0 +1,21 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +namespace Kaspirin.UI.Framework.UiKit.Tests.TestSuites.Converters.CollectionConverters; + +[TestClass] +public sealed class CollectionToVisibilityConverterTests +{ + // TODO. +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/CollectionConverters/CollectionToVisibilityInverseConverterTests.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/CollectionConverters/CollectionToVisibilityInverseConverterTests.cs new file mode 100644 index 0000000..9a6cb21 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/CollectionConverters/CollectionToVisibilityInverseConverterTests.cs @@ -0,0 +1,21 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +namespace Kaspirin.UI.Framework.UiKit.Tests.TestSuites.Converters.CollectionConverters; + +[TestClass] +public sealed class CollectionToVisibilityInverseConverterTests +{ + // TODO. +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/CornerRadiusConverters/CornerRadiusSingleComponentSelectorConverterTests.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/CornerRadiusConverters/CornerRadiusSingleComponentSelectorConverterTests.cs new file mode 100644 index 0000000..b2ed6b4 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/CornerRadiusConverters/CornerRadiusSingleComponentSelectorConverterTests.cs @@ -0,0 +1,189 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using Kaspirin.UI.Framework.UiKit.Converters.CornerRadiusConverters; +using System.Globalization; +using System.Windows; + +namespace Kaspirin.UI.Framework.UiKit.Tests.TestSuites.Converters.CornerRadiusConverters; + +[TestClass] +public sealed class CornerRadiusSingleComponentSelectorConverterTests +{ + [TestMethod] + public void Convert_EqualComponentsValue_ReturnsSingleComponent() + { + // Arrange + var converter = new CornerRadiusSingleComponentSelectorConverter(); + var value = new CornerRadius(1.0, 1.0, 1.0, 1.0); + var targetType = typeof(double); + var parameter = CornerRadiusSingleComponent.All; + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(value, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, targetType); + Assert.AreEqual(1.0, result); + } + + [TestMethod] + public void Convert_NonEqualComponentsValue_ThrowsException() + { + // Arrange + var converter = new CornerRadiusSingleComponentSelectorConverter(); + var value = new CornerRadius(1.0, 2.0, 3.0, 4.0); + var targetType = typeof(double); + var parameter = CornerRadiusSingleComponent.All; + var culture = CultureInfo.InvariantCulture; + + // Act + assert + Assert.ThrowsException(() => converter.Convert(value, targetType, parameter, culture)); + } + + [TestMethod] + public void Convert_ValidValue_ReturnsTopLeftComponent() + { + // Arrange + var converter = new CornerRadiusSingleComponentSelectorConverter(); + var value = new CornerRadius(1.0, 2.0, 3.0, 4.0); + var targetType = typeof(double); + var parameter = CornerRadiusSingleComponent.TopLeft; + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(value, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, targetType); + Assert.AreEqual(1.0, result); + } + + [TestMethod] + public void Convert_ValidValue_ReturnsTopRightComponent() + { + // Arrange + var converter = new CornerRadiusSingleComponentSelectorConverter(); + var value = new CornerRadius(1.0, 2.0, 3.0, 4.0); + var targetType = typeof(double); + var parameter = CornerRadiusSingleComponent.TopRight; + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(value, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, targetType); + Assert.AreEqual(2.0, result); + } + + [TestMethod] + public void Convert_ValidValue_ReturnsBottomRightComponent() + { + // Arrange + var converter = new CornerRadiusSingleComponentSelectorConverter(); + var value = new CornerRadius(1.0, 2.0, 3.0, 4.0); + var targetType = typeof(double); + var parameter = CornerRadiusSingleComponent.BottomRight; + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(value, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, targetType); + Assert.AreEqual(3.0, result); + } + + [TestMethod] + public void Convert_ValidValue_ReturnsBottomLeftComponent() + { + // Arrange + var converter = new CornerRadiusSingleComponentSelectorConverter(); + var value = new CornerRadius(1.0, 2.0, 3.0, 4.0); + var targetType = typeof(double); + var parameter = CornerRadiusSingleComponent.BottomLeft; + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(value, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, targetType); + Assert.AreEqual(4.0, result); + } + + [TestMethod] + public void Convert_InvalidValue_ReturnsUnsetValue() + { + // Arrange + var converter = new CornerRadiusSingleComponentSelectorConverter(); + var value = "invalid"; + var targetType = typeof(double); + var parameter = default(CornerRadiusSingleComponent); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(value, targetType, parameter, culture); + + // Assert + Assert.AreEqual(DependencyProperty.UnsetValue, result); + } + + [TestMethod] + public void Convert_InvalidParameter_ReturnsUnsetValue() + { + // Arrange + var converter = new CornerRadiusSingleComponentSelectorConverter(); + var value = default(CornerRadius); + var targetType = typeof(double); + var parameter = "invalid"; + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(value, targetType, parameter, culture); + + // Assert + Assert.AreEqual(DependencyProperty.UnsetValue, result); + } + + [TestMethod] + public void Convert_NullValue_ThrowsException() + { + // Arrange + var converter = new CornerRadiusSingleComponentSelectorConverter(); + var value = default(object); + var targetType = typeof(double); + var parameter = default(CornerRadiusSingleComponent); + var culture = CultureInfo.InvariantCulture; + + // Act + assert + Assert.ThrowsException(() => converter.Convert(value, targetType, parameter, culture)); + } + + [TestMethod] + public void Convert_NullParameter_ThrowsException() + { + // Arrange + var converter = new CornerRadiusSingleComponentSelectorConverter(); + var value = default(CornerRadius); + var targetType = typeof(double); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + assert + Assert.ThrowsException(() => converter.Convert(value, targetType, parameter, culture)); + } +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/DictionaryConverters/DictionaryConverterTests.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/DictionaryConverters/DictionaryConverterTests.cs new file mode 100644 index 0000000..9a8900a --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/DictionaryConverters/DictionaryConverterTests.cs @@ -0,0 +1,21 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +namespace Kaspirin.UI.Framework.UiKit.Tests.TestSuites.Converters.DictionaryConverters; + +[TestClass] +public sealed class DictionaryConverterTests +{ + // TODO. +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/EqualityConverters/EqualityToBooleanConverterTests.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/EqualityConverters/EqualityToBooleanConverterTests.cs new file mode 100644 index 0000000..ba78810 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/EqualityConverters/EqualityToBooleanConverterTests.cs @@ -0,0 +1,21 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +namespace Kaspirin.UI.Framework.UiKit.Tests.TestSuites.Converters.EqualityConverters; + +[TestClass] +public sealed class EqualityToBooleanConverterTests +{ + // TODO. +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/EqualityConverters/EqualityToBooleanInverseConverterTests.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/EqualityConverters/EqualityToBooleanInverseConverterTests.cs new file mode 100644 index 0000000..2654d05 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/EqualityConverters/EqualityToBooleanInverseConverterTests.cs @@ -0,0 +1,21 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +namespace Kaspirin.UI.Framework.UiKit.Tests.TestSuites.Converters.EqualityConverters; + +[TestClass] +public sealed class EqualityToBooleanInverseConverterTests +{ + // TODO. +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/EqualityConverters/EqualityToObjectConverterTests.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/EqualityConverters/EqualityToObjectConverterTests.cs new file mode 100644 index 0000000..05e1b92 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/EqualityConverters/EqualityToObjectConverterTests.cs @@ -0,0 +1,21 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +namespace Kaspirin.UI.Framework.UiKit.Tests.TestSuites.Converters.EqualityConverters; + +[TestClass] +public sealed class EqualityToObjectConverterTests +{ + // TODO. +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/EqualityConverters/EqualityToVisibilityConverterTests.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/EqualityConverters/EqualityToVisibilityConverterTests.cs new file mode 100644 index 0000000..6b3df5a --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/EqualityConverters/EqualityToVisibilityConverterTests.cs @@ -0,0 +1,21 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +namespace Kaspirin.UI.Framework.UiKit.Tests.TestSuites.Converters.EqualityConverters; + +[TestClass] +public sealed class EqualityToVisibilityConverterTests +{ + // TODO. +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/EqualityConverters/EqualityToVisibilityInverseConverterTests.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/EqualityConverters/EqualityToVisibilityInverseConverterTests.cs new file mode 100644 index 0000000..c7747af --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/EqualityConverters/EqualityToVisibilityInverseConverterTests.cs @@ -0,0 +1,21 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +namespace Kaspirin.UI.Framework.UiKit.Tests.TestSuites.Converters.EqualityConverters; + +[TestClass] +public sealed class EqualityToVisibilityInverseConverterTests +{ + // TODO. +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/EqualityConverters/MultiValueEqualityToBooleanConverterTests.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/EqualityConverters/MultiValueEqualityToBooleanConverterTests.cs new file mode 100644 index 0000000..a9178b2 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/EqualityConverters/MultiValueEqualityToBooleanConverterTests.cs @@ -0,0 +1,21 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +namespace Kaspirin.UI.Framework.UiKit.Tests.TestSuites.Converters.EqualityConverters; + +[TestClass] +public sealed class MultiValueEqualityToBooleanConverterTests +{ + // TODO. +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/EqualityConverters/MultiValueEqualityToBooleanInverseConverterTests.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/EqualityConverters/MultiValueEqualityToBooleanInverseConverterTests.cs new file mode 100644 index 0000000..f203268 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/EqualityConverters/MultiValueEqualityToBooleanInverseConverterTests.cs @@ -0,0 +1,21 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +namespace Kaspirin.UI.Framework.UiKit.Tests.TestSuites.Converters.EqualityConverters; + +[TestClass] +public sealed class MultiValueEqualityToBooleanInverseConverterTests +{ + // TODO. +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/EqualityConverters/MultiValueEqualityToVisibilityConverterTests.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/EqualityConverters/MultiValueEqualityToVisibilityConverterTests.cs new file mode 100644 index 0000000..11d3450 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/EqualityConverters/MultiValueEqualityToVisibilityConverterTests.cs @@ -0,0 +1,21 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +namespace Kaspirin.UI.Framework.UiKit.Tests.TestSuites.Converters.EqualityConverters; + +[TestClass] +public sealed class MultiValueEqualityToVisibilityConverterTests +{ + // TODO. +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/NumberConverters/MultiplierConverterTests.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/NumberConverters/MultiplierConverterTests.cs new file mode 100644 index 0000000..6ee863f --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/NumberConverters/MultiplierConverterTests.cs @@ -0,0 +1,109 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using Kaspirin.UI.Framework.UiKit.Converters.NumberConverters; +using System; +using System.Globalization; +using System.Windows; + +namespace Kaspirin.UI.Framework.UiKit.Tests.TestSuites.Converters.NumberConverters; + +[TestClass] +public sealed class MultiplierConverterTests +{ + [TestMethod] + public void Convert_NullValue_ReturnsUnsetValue() + { + // Arrange + var converter = new MultiplierConverter(); + var value = default(object); + var targetType = typeof(double); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(value, targetType, parameter, culture); + + // Assert + Assert.AreEqual(DependencyProperty.UnsetValue, result); + } + + [TestMethod] + public void Convert_InvalidValue_ReturnsUnsetValue() + { + // Arrange + var converter = new MultiplierConverter(); + var value = "invalid"; + var targetType = typeof(double); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + assert + Assert.ThrowsException(() => converter.Convert(value, targetType, parameter, culture)); + } + + [TestMethod] + public void Convert_ValidValue_NegativeFactor_ReturnsCorrectResult() + { + // Arrange + var converter = new MultiplierConverter { Factor = -5 }; + var value = 2.0; + var targetType = typeof(double); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(value, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, targetType); + Assert.AreEqual(value * converter.Factor, result); + } + + [TestMethod] + public void Convert_ValidValue_ZeroFactor_ReturnsCorrectResult() + { + // Arrange + var converter = new MultiplierConverter { Factor = 0 }; + var value = 5.0; + var targetType = typeof(double); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(value, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, targetType); + Assert.AreEqual(value * converter.Factor, result); + } + + [TestMethod] + public void Convert_ValidValue_PositiveFactor_ReturnsCorrectResult() + { + // Arrange + var converter = new MultiplierConverter { Factor = 5 }; + var value = 10.0; + var targetType = typeof(double); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(value, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, targetType); + Assert.AreEqual(value * converter.Factor, result); + } +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/NumberConverters/NumberToLongConverterTests.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/NumberConverters/NumberToLongConverterTests.cs new file mode 100644 index 0000000..582c698 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/NumberConverters/NumberToLongConverterTests.cs @@ -0,0 +1,159 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using Kaspirin.UI.Framework.UiKit.Converters.NumberConverters; +using Kaspirin.UI.Framework.UiKit.Tests.Common; +using System.Collections.Generic; +using System.Globalization; +using System.Windows; + +namespace Kaspirin.UI.Framework.UiKit.Tests.TestSuites.Converters.NumberConverters; + +[TestClass] +public sealed class NumberToLongConverterTests : LocalizationManagerDependentTests +{ + [TestMethod] + public void Convert_NullValue_ReturnsUnsetValue() + { + // Arrange + InitializeLocalizationManager("en-US"); + + var converter = new NumberToLongConverter(); + var value = default(object); + var targetType = typeof(string); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(value, targetType, parameter, culture); + + // Assert + Assert.AreEqual(DependencyProperty.UnsetValue, result); + } + + [TestMethod] + public void Convert_InvalidValue_ReturnsUnsetValue() + { + // Arrange + InitializeLocalizationManager("en-US"); + + var converter = new NumberToLongConverter(); + var value = "invalid"; + var targetType = typeof(string); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(value, targetType, parameter, culture); + + // Assert + Assert.AreEqual(DependencyProperty.UnsetValue, result); + } + + [TestMethod] + public void Convert_ValidValues_EnUsFormatCulture_ReturnsFormattedString() + { + var values = new Dictionary() + { + { sbyte.MinValue, "-128" }, + { byte.MaxValue, "255" }, + { short.MinValue, "-32,768" }, + { ushort.MaxValue, "65,535" }, + { int.MinValue, "-2,147,483,648" }, + { uint.MaxValue, "4,294,967,295" }, + { long.MinValue, "-9,223,372,036,854,775,808" }, + { ulong.MaxValue, "18,446,744,073,709,551,615" }, + { 5.3f, "5" }, + { 5.5f, "6" }, + { 5.7f, "6" }, + { 1_248.2d, "1,248" }, +#if NETCOREAPP + { 1_248.5d, "1,248" }, +#else + { 1_248.5d, "1,249" }, +#endif + { 1_248.8d, "1,249" }, + { 999_999_999.11m, "999,999,999" }, + { 999_999_999.55m, "1,000,000,000" }, + { 999_999_999.88m, "1,000,000,000" } + }; + + InitializeLocalizationManager("en-US"); + + foreach (var kvp in values) + { + // Arrange + var converter = new NumberToLongConverter(); + var value = kvp.Key; + var targetType = typeof(string); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(value, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, targetType); + AssertAreEqualInFormatCulture(kvp.Value, (string?)result); + } + } + + [TestMethod] + public void Convert_ValidValues_RuRuFormatCulture_ReturnsFormattedString() + { + var values = new Dictionary() + { + { sbyte.MinValue, "-128" }, + { byte.MaxValue, "255" }, + { short.MinValue, "-32,768" }, + { ushort.MaxValue, "65,535" }, + { int.MinValue, "-2 147 483 648" }, + { uint.MaxValue, "4 294 967 295" }, + { long.MinValue, "-9 223 372 036 854 775 808" }, + { ulong.MaxValue, "18 446 744 073 709 551 615" }, + { 5.3f, "5" }, + { 5.5f, "6" }, + { 5.7f, "6" }, + { 1_248.2d, "1 248" }, +#if NETCOREAPP + { 1_248.5d, "1 248" }, +#else + { 1_248.5d, "1 249" }, +#endif + { 1_248.8d, "1 249" }, + { 999_999_999.11m, "999 999 999" }, + { 999_999_999.55m, "1 000 000 000" }, + { 999_999_999.88m, "1 000 000 000" } + }; + + InitializeLocalizationManager("ru-RU"); + + foreach (var kvp in values) + { + // Arrange + var converter = new NumberToLongConverter(); + var value = kvp.Key; + var targetType = typeof(string); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(value, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, targetType); + AssertAreEqualInFormatCulture(kvp.Value, (string?)result); + } + } +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/NumberConverters/NumberToPercentStringConverterTests.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/NumberConverters/NumberToPercentStringConverterTests.cs new file mode 100644 index 0000000..4aeac54 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/NumberConverters/NumberToPercentStringConverterTests.cs @@ -0,0 +1,210 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using Kaspirin.UI.Framework.UiKit.Converters.NumberConverters; +using Kaspirin.UI.Framework.UiKit.Tests.Common; +using System.Collections.Generic; +using System.Globalization; +using System.Windows; + +namespace Kaspirin.UI.Framework.UiKit.Tests.TestSuites.Converters.NumberConverters; + +[TestClass] +public sealed class NumberToPercentStringConverterTests : LocalizationManagerDependentTests +{ + [TestMethod] + public void Convert_NullValue_ReturnsUnsetValue() + { + // Arrange + InitializeLocalizationManager("en-US"); + + var converter = new NumberToPercentStringConverter(); + var value = default(object); + var targetType = typeof(string); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(value, targetType, parameter, culture); + + // Assert + Assert.AreEqual(DependencyProperty.UnsetValue, result); + } + + [TestMethod] + public void Convert_InvalidValue_ReturnsUnsetValue() + { + // Arrange + InitializeLocalizationManager("en-US"); + + var converter = new NumberToPercentStringConverter(); + var value = "invalid"; + var targetType = typeof(string); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(value, targetType, parameter, culture); + + // Assert + Assert.AreEqual(DependencyProperty.UnsetValue, result); + } + + [TestMethod] + public void Convert_ValidValues_EnUsFormatCulture_ReturnsFormattedString() + { + var values = new Dictionary<(ushort Precision, object Value), string>() + { + // Precision = 0 + { ( Precision: 0, -5), "-500%" }, + { ( Precision: 0, -1), "-100%" }, + { ( Precision: 0, -0.999), "-100%" }, + { ( Precision: 0, -0.153), "-15%" }, + { ( Precision: 0, -0.035), "-4%" }, + { ( Precision: 0, 0), "0%" }, + { ( Precision: 0, 0.069), "7%" }, + { ( Precision: 0, 0.2), "20%" }, + { ( Precision: 0, 0.999), "100%" }, + { ( Precision: 0, 1), "100%" }, + { ( Precision: 0, 5), "500%" }, + + // Precision = 1 + { ( Precision: 1, -5), "-500.0%" }, + { ( Precision: 1, -1), "-100.0%" }, + { ( Precision: 1, -0.9999), "-100.0%" }, + { ( Precision: 1, -0.999), "-99.9%" }, + { ( Precision: 1, -0.254), "-25.4%" }, + { ( Precision: 1, -0.0546), "-5.5%" }, + { ( Precision: 1, 0), "0.0%" }, + { ( Precision: 1, 0.0799), "8.0%" }, + { ( Precision: 1, 0.1), "10.0%" }, +#if NETCOREAPP + { ( Precision: 1, 0.5555), "55.5%" }, +#else + { ( Precision: 1, 0.5555), "55.6%" }, +#endif + { ( Precision: 1, 0.999), "99.9%" }, + { ( Precision: 1, 0.9999), "100.0%" }, + { ( Precision: 1, 1), "100.0%" }, + { ( Precision: 1, 5), "500.0%" }, + }; + + InitializeLocalizationManager("en-US"); + + foreach (var kvp in values) + { + // Arrange + var converter = new NumberToPercentStringConverter { Precision = kvp.Key.Precision }; + + var value = kvp.Key.Value; + var targetType = typeof(string); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(value, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, targetType); + Assert.AreEqual(kvp.Value, result, $"Precision={kvp.Key.Precision}"); + } + } + + [TestMethod] + public void Convert_ValidValues_RuRuFormatCulture_ReturnsFormattedString() + { + var values = new Dictionary<(ushort Precision, object Value), string>() + { + // Precision = 0 +#if NETCOREAPP + { ( Precision: 0, -5), "-500 %" }, + { ( Precision: 0, -1), "-100 %" }, + { ( Precision: 0, -0.999), "-100 %" }, + { ( Precision: 0, -0.153), "-15 %" }, + { ( Precision: 0, -0.035), "-4 %" }, + { ( Precision: 0, 0), "0 %" }, + { ( Precision: 0, 0.069), "7 %" }, + { ( Precision: 0, 0.2), "20 %" }, + { ( Precision: 0, 0.999), "100 %" }, + { ( Precision: 0, 1), "100 %" }, + { ( Precision: 0, 5), "500 %" }, +#else + { ( Precision: 0, -5), "-500%" }, + { ( Precision: 0, -1), "-100%" }, + { ( Precision: 0, -0.999), "-100%" }, + { ( Precision: 0, -0.153), "-15%" }, + { ( Precision: 0, -0.035), "-4%" }, + { ( Precision: 0, 0), "0%" }, + { ( Precision: 0, 0.069), "7%" }, + { ( Precision: 0, 0.2), "20%" }, + { ( Precision: 0, 0.999), "100%" }, + { ( Precision: 0, 1), "100%" }, + { ( Precision: 0, 5), "500%" }, +#endif + + // Precision = 1 +#if NETCOREAPP + { ( Precision: 1, -5), "-500,0 %" }, + { ( Precision: 1, -1), "-100,0 %" }, + { ( Precision: 1, -0.9999), "-100,0 %" }, + { ( Precision: 1, -0.999), "-99,9 %" }, + { ( Precision: 1, -0.254), "-25,4 %" }, + { ( Precision: 1, -0.0546), "-5,5 %" }, + { ( Precision: 1, 0), "0,0 %" }, + { ( Precision: 1, 0.0799), "8,0 %" }, + { ( Precision: 1, 0.1), "10,0 %" }, + { ( Precision: 1, 0.5555), "55,5 %" }, + { ( Precision: 1, 0.999), "99,9 %" }, + { ( Precision: 1, 0.9999), "100,0 %" }, + { ( Precision: 1, 1), "100,0 %" }, + { ( Precision: 1, 5), "500,0 %" }, +#else + { ( Precision: 1, -5), "-500,0%" }, + { ( Precision: 1, -1), "-100,0%" }, + { ( Precision: 1, -0.9999), "-100,0%" }, + { ( Precision: 1, -0.999), "-99,9%" }, + { ( Precision: 1, -0.254), "-25,4%" }, + { ( Precision: 1, -0.0546), "-5,5%" }, + { ( Precision: 1, 0), "0,0%" }, + { ( Precision: 1, 0.0799), "8,0%" }, + { ( Precision: 1, 0.1), "10,0%" }, + { ( Precision: 1, 0.5555), "55,6%" }, + { ( Precision: 1, 0.999), "99,9%" }, + { ( Precision: 1, 0.9999), "100,0%" }, + { ( Precision: 1, 1), "100,0%" }, + { ( Precision: 1, 5), "500,0%" }, +#endif + }; + + InitializeLocalizationManager("ru-RU"); + + foreach (var kvp in values) + { + // Arrange + var converter = new NumberToPercentStringConverter { Precision = kvp.Key.Precision }; + + var value = kvp.Key.Value; + var targetType = typeof(string); + var parameter = default(object); + var culture = CultureInfo.InvariantCulture; + + // Act + var result = converter.Convert(value, targetType, parameter, culture); + + // Assert + Assert.IsInstanceOfType(result, targetType); + Assert.AreEqual(kvp.Value, result, $"Precision= {kvp.Key.Precision}"); + } + } +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/ThicknessConverters/ThicknessComponentsSelectorConverterTests.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/ThicknessConverters/ThicknessComponentsSelectorConverterTests.cs new file mode 100644 index 0000000..2b74ee1 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/ThicknessConverters/ThicknessComponentsSelectorConverterTests.cs @@ -0,0 +1,21 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +namespace Kaspirin.UI.Framework.UiKit.Tests.TestSuites.Converters.ThicknessConverters; + +[TestClass] +public sealed class ThicknessComponentsSelectorConverterTests +{ + // TODO. +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/ThicknessConverters/ThicknessComponentsSwapConverterTests.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/ThicknessConverters/ThicknessComponentsSwapConverterTests.cs new file mode 100644 index 0000000..7e95947 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/ThicknessConverters/ThicknessComponentsSwapConverterTests.cs @@ -0,0 +1,21 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +namespace Kaspirin.UI.Framework.UiKit.Tests.TestSuites.Converters.ThicknessConverters; + +[TestClass] +public sealed class ThicknessComponentsSwapConverterTests +{ + // TODO. +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/ThicknessConverters/ThicknessSingleComponentSelectorConverterTests.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/ThicknessConverters/ThicknessSingleComponentSelectorConverterTests.cs new file mode 100644 index 0000000..11c5d24 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/ThicknessConverters/ThicknessSingleComponentSelectorConverterTests.cs @@ -0,0 +1,21 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +namespace Kaspirin.UI.Framework.UiKit.Tests.TestSuites.Converters.ThicknessConverters; + +[TestClass] +public sealed class ThicknessSingleComponentSelectorConverterTests +{ + // TODO. +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/TimeConverters/DateTimeConverterTests.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/TimeConverters/DateTimeConverterTests.cs new file mode 100644 index 0000000..54c0eb2 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/TimeConverters/DateTimeConverterTests.cs @@ -0,0 +1,21 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +namespace Kaspirin.UI.Framework.UiKit.Tests.TestSuites.Converters.TimeConverters; + +[TestClass] +public sealed class DateTimeConverterTests +{ + // TODO. +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/TimeConverters/DateTimeRangeConverterTests.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/TimeConverters/DateTimeRangeConverterTests.cs new file mode 100644 index 0000000..b7925e2 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/TimeConverters/DateTimeRangeConverterTests.cs @@ -0,0 +1,21 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +namespace Kaspirin.UI.Framework.UiKit.Tests.TestSuites.Converters.TimeConverters; + +[TestClass] +public sealed class DateTimeRangeConverterTests +{ + // TODO. +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/TimeConverters/TimeSpanConverterTests.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/TimeConverters/TimeSpanConverterTests.cs new file mode 100644 index 0000000..4d32277 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/TimeConverters/TimeSpanConverterTests.cs @@ -0,0 +1,21 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +namespace Kaspirin.UI.Framework.UiKit.Tests.TestSuites.Converters.TimeConverters; + +[TestClass] +public sealed class TimeSpanConverterTests +{ + // TODO. +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/TimeConverters/TimeSpanToDateTimeConverterTests.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/TimeConverters/TimeSpanToDateTimeConverterTests.cs new file mode 100644 index 0000000..30b0119 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Tests/TestSuites/Converters/TimeConverters/TimeSpanToDateTimeConverterTests.cs @@ -0,0 +1,21 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +namespace Kaspirin.UI.Framework.UiKit.Tests.TestSuites.Converters.TimeConverters; + +[TestClass] +public sealed class TimeSpanToDateTimeConverterTests +{ + // TODO. +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/CleanupTask.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/CleanupTask.cs new file mode 100644 index 0000000..179d903 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/CleanupTask.cs @@ -0,0 +1,246 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System; +using System.IO; +using System.Linq; +using Kaspirin.UI.Framework.UiKit.Translator.Core.Translation.Icons; +using Kaspirin.UI.Framework.UiKit.Translator.Core.Translation.Illustrations; +using Microsoft.Build.Framework; + +namespace Kaspirin.UI.Framework.UiKit.Translator.Core +{ +#if !NET6_0_OR_GREATER + /// + /// In case you need to modify this assembly and test it afterwards, it's better to define MSBUILDDISABLENODEREUSE environment variable with value 1. + /// Otherwise MSBuild will reuse its nodes (i.e. MSBuild.exe processes) that would load this assembly blocking it from any modifications. + /// + [LoadInSeparateAppDomain] +#endif + public sealed class CleanupTask : ConfigurableTask + { + public override bool Execute() + { + try + { + if (!CheckArguments() || !ReadConfiguration()) + { + return false; + } + + CleanupStyles(); + CleanupCustomizationDictionaries(); + CleanupPalettes(); + CleanupFonts(); + CleanupSvg(); + CleanupIcons(); + CleanupIllustrations(); + + Log.LogMessage(MessageImportance.High, "UI Kit cleanup successfully completed."); + } + catch (Exception ex) + { + Log.LogErrorFromException(ex, showStackTrace: true); + } + + return !Log.HasLoggedErrors; + } + + private void CleanupStyles() + { + CleanupFile( + _configuration.GeneratedStylesPath, + nameof(_configuration.GeneratedStylesPath), + "XAML styles resource dictionary"); + } + + private void CleanupCustomizationDictionaries() + { + CleanupFiles( + _configuration.GeneratedResourcesDirectory, + nameof(_configuration.GeneratedResourcesDirectory), + GetFilenamePattern(Const.XamlExtension), + "XAML customization resource dictionaries"); + } + + private void CleanupPalettes() + { + CleanupFiles( + Path.Combine(_configuration.PaletteDirectory, "..\\"), + nameof(_configuration.PaletteDirectory), + Const.PaletteFilename + Const.XamlExtension, + "XAML palettes", + includeSubdirectories: true); + + CleanupFile( + _configuration.PaletteEnumPath, + nameof(_configuration.PaletteEnumPath), + "XAML palette enums file"); + } + + private void CleanupFonts() + { + CleanupFile( + _configuration.FontEnumPath, + nameof(_configuration.FontEnumPath), + "Font enums file"); + } + + private void CleanupSvg() + { + CleanupFiles( + _configuration.SvgDirectory, + nameof(_configuration.SvgDirectory), + GetFilenamePattern(Const.SvgExtension), + "SVG files"); + } + + private void CleanupIcons() + { + CleanupFiles( + _configuration.IconSvgDirectory, + nameof(_configuration.IconSvgDirectory), + GetFilenamePattern(IconSvgGenerator.IconSvgFilenamePrefix, Const.SvgExtension), + "Icon SVG files", + includeSubdirectories: true); + + CleanupFile( + _configuration.IconEnumPath, + nameof(_configuration.IconEnumPath), + "Icon enums file"); + } + + private void CleanupIllustrations() + { + if (_configuration?.ProductMediaProjectInfoMapping.Any() != true) + { + Log.LogMessage( + MessageImportance.High, + $"Configuration parameter '{nameof(_configuration.ProductMediaProjectInfoMapping)}' is not set. Skip illustrations cleanup."); + return; + } + + foreach (var kvp in _configuration.ProductMediaProjectInfoMapping) + { + var product = kvp.Key; + var productMediaProjectInfo = kvp.Value; + + CleanupFiles( + productMediaProjectInfo.IllustrationSvgDirectory, + nameof(productMediaProjectInfo.IllustrationSvgDirectory), + GetFilenamePattern(IllustrationSvgGenerator.IllustrationSvgFilenamePrefix, Const.SvgExtension), + $"Illustration SVG files (product '{product}')", + includeSubdirectories: true); + + CleanupFile( + productMediaProjectInfo.IllustrationEnumPath, + nameof(productMediaProjectInfo.IllustrationEnumPath), + $"Illustration enums file (product '{product}')"); + + CleanupFile( + productMediaProjectInfo.IllustrationMarkupExtensionPath, + nameof(productMediaProjectInfo.IllustrationMarkupExtensionPath), + $"Illustration markup extension file (product '{product}')"); + } + } + + private void CleanupFile(string configurationParameterValue, string configurationParameterName, string fileDescription) + { + if (string.IsNullOrWhiteSpace(configurationParameterValue)) + { + Log.LogMessage( + MessageImportance.High, + $"Configuration parameter '{configurationParameterName}' is not set. Skip {fileDescription} cleanup."); + return; + } + + var path = Path.GetFullPath(configurationParameterValue); + if (!File.Exists(path)) + { + Log.LogMessage( + MessageImportance.High, + $"File '{path}' doesn't exist. Skip {fileDescription} cleanup."); + return; + } + + try + { + File.Delete(path); + + Log.LogMessage(MessageImportance.High, $"{fileDescription} cleanup completed."); + } + catch (Exception ex) + { + Log.LogWarning(null, null, null, path, 0, 0, 0, 0, $"Unable to remove file."); + Log.LogWarningFromException(ex, true); + } + } + + private void CleanupFiles( + string configurationParameterValue, + string configurationParameterName, + string filenamePattern, + string filesDescription, + bool includeSubdirectories = false) + { + if (string.IsNullOrWhiteSpace(configurationParameterValue)) + { + Log.LogMessage( + MessageImportance.High, + $"Configuration parameter '{configurationParameterName}' is not set. Skip {filesDescription} cleanup."); + return; + } + + var directory = Path.GetFullPath(configurationParameterValue); + if (!Directory.Exists(directory)) + { + Log.LogMessage( + MessageImportance.High, + $"Directory '{directory}' doesn't exist. Skip {filesDescription} cleanup."); + return; + } + + var searchOptions = includeSubdirectories ? SearchOption.AllDirectories : SearchOption.TopDirectoryOnly; + + var counter = 0; + foreach (var path in Directory.EnumerateFiles(directory, filenamePattern, searchOptions)) + { + Log.LogMessage(MessageImportance.Normal, $"Removing '{path}'."); + + try + { + File.Delete(path); + counter++; + } + catch (Exception ex) + { + Log.LogWarning(null, null, null, path, 0, 0, 0, 0, $"Unable to remove file."); + Log.LogWarningFromException(ex, true); + } + } + + Log.LogMessage( + MessageImportance.High, + counter > 0 + ? $"{filesDescription} cleanup completed: {counter} file(s) removed." + : $"Directory '{directory}' contains no matching files. Skip {filesDescription} cleanup."); + } + + private static string GetFilenamePattern(string extension) + => $"{Const.UIKitPrefix}*{extension}"; + + private static string GetFilenamePattern(string prefix, string extension) + => $"{prefix}*{extension}"; + } +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/ConfigurableTask.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/ConfigurableTask.cs new file mode 100644 index 0000000..ede9a21 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/ConfigurableTask.cs @@ -0,0 +1,62 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System; +using System.IO; +using Microsoft.Build.Framework; +using Microsoft.Build.Utilities; + +namespace Kaspirin.UI.Framework.UiKit.Translator.Core +{ + public abstract class ConfigurableTask +#if !NET6_0_OR_GREATER + : AppDomainIsolatedTask +#else + : Task +#endif + { + [Required] + public string ConfigPath { get; set; } + + protected virtual bool CheckArguments() + { + if (!File.Exists(ConfigPath)) + { + Log.LogError($"Config file '{Path.GetFullPath(ConfigPath)}' doesn't exist."); + return false; + } + + return true; + } + + protected bool ReadConfiguration() + { + try + { + var configContent = File.ReadAllText(ConfigPath); + _configuration = JsonHelper.Deserialize(configContent); + } + catch (Exception ex) + { + Log.LogError("Config deserialization failed."); + Log.LogErrorFromException(ex, showStackTrace: true); + return false; + } + + return true; + } + + private protected Configuration _configuration; + } +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Configuration.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Configuration.cs new file mode 100644 index 0000000..d2ac8e5 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Configuration.cs @@ -0,0 +1,98 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System; +using System.Collections.Generic; +using System.Runtime.Serialization; + +namespace Kaspirin.UI.Framework.UiKit.Translator.Core +{ + [DataContract] + internal sealed class Configuration + { + [DataMember] + public string[] ExcludedControls { get; private set; } + + [DataMember] + public IDictionary ProductMediaProjectInfoMapping { get; private set; } + + [DataMember] + public string GeneratedStylesPath { get; private set; } + + [DataMember] + public string GeneratedResourcesDirectory { get; private set; } + + [DataMember] + public string FontEnumPath { get; private set; } + + [DataMember] + public string FontNamespacePart { get; private set; } + + [DataMember] + public string PaletteDirectory { get; private set; } + + [DataMember] + public string PaletteEnumPath { get; private set; } + + [DataMember] + public string PaletteNamespacePart { get; private set; } + + [DataMember] + public string SvgDirectory { get; private set; } + + [DataMember] + public string IconSvgDirectory { get; private set; } + + [DataMember] + public string IconEnumPath { get; private set; } + + [DataMember] + public bool FailOnValidationErrors { get; private set; } + + [DataMember] + public bool FormatXamlFiles { get; private set; } + + [DataMember] + public string UiKitPath { get; private set; } + + [DataMember] + public string FileComment { get; internal set; } + + [DataContract] + internal sealed class ProductMediaProjectInfo + { + [DataMember] + public string IllustrationSvgDirectory { get; private set; } + + [DataMember] + public string IllustrationEnumPath { get; private set; } + + [DataMember] + public string IllustrationMarkupExtensionPath { get; private set; } + + [DataMember] + public string ProductNamespacePart { get; private set; } + } + + internal ProductMediaProjectInfo GetProductMediaProjectInfo(string product) + { + if (!ProductMediaProjectInfoMapping.TryGetValue(product, out var productMediaProjectInfo)) + { + throw new InvalidOperationException($"Media project info for product '{product}' is not configured"); + } + + return productMediaProjectInfo; + } + } +} \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Const.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Const.cs new file mode 100644 index 0000000..2d19c9b --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Const.cs @@ -0,0 +1,118 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +namespace Kaspirin.UI.Framework.UiKit.Translator.Core +{ + internal static class Const + { + public const LineEndingMode DefaultLineEndingMode = LineEndingMode.Lf; + public const string DefaultOutputIndentChars = " "; + public const string SvgExtension = ".svg"; + public const string XamlExtension = ".xaml"; + public const string UIKitPrefix = "UIKit"; + public const string UIKitIllustrationPrefix = "UIKitIllustration_"; + + public const string RootElementName = "UiKit"; + + public const string UIKitFontEnumsTemplateFilename = "UIKitFonts.Enums.Template.cs"; + public const string UIKitFontTemplateDirectory = "Translation\\Fonts"; + + public const string UIKitIconEnumsTemplateFilename = "UIKitIcons.Enums.Template.cs"; + public const string UIKitIconTemplateDirectory = "Translation\\Icons"; + + public const string UIKitIllustrationEnumsTemplateFilename = "UIKitIllustrations.Enums.Template.cs"; + public const string UIKitIllustrationMarkupExtensionTemplateFilename = "UIKitIllustrations.MarkupExtension.Template.cs"; + public const string UIKitIllustrationTemplateDirectory = "Translation\\Illustrations"; + + public const string UIKitPaletteTextIconsBrushPrefix = "TextIconsElements"; + public const string UIKitPaletteTemplateFilename = "UIKitPalettes.Template.cs"; + public const string UIKitPaletteTemplateDirectory = "Translation\\Palettes"; + + public const string SchemaResourcesDirectory = "Schema"; + public const string UiKitSchemaFilename = "UiKit.xsd"; + public const string SchemasDirectoryEmbeddedConfigurationKey = "SchemasDirectory"; + public const string RootNamespaceEmbeddedConfigurationKey = "RootNamespace"; + + public const string TransformationResourcesDirectory = "Transformations"; + public const string TransformationCoreDirectory = "Core"; + public const string StylesTransformationFilename = "Styles.xslt"; + public const string CustomizationDictionariesTransformationFilename = "CustomizationDictionaries.xslt"; + public const string PalettesTransformationFilename = "Palettes.xslt"; + public const string SvgTransformationFilename = "Svg.xslt"; + + public const string CustomizationDictionariesElementName = "CustomizationDictionaries"; + public const string CustomizationDictionaryElementName = "CustomizationDictionary"; + public const string CustomizationDictionaryIdAttributeName = "Id"; + + public const string PalettesElementName = "Palettes"; + public const string PaletteElementName = "Palette"; + public const string PaletteIdAttributeName = "Id"; + public const string BrushesElementName = "Brushes"; + public const string BrushElementName = "PaletteBrush"; + public const string BrushIdAttributeName = "Id"; + + public const string DefaultPaletteId = "Light"; + public const string PaletteFilename = "Palette"; + public const string TemplateDictionaryName = "Templates.xaml"; + + public const string TextStylesElementName = "TextStyles"; + public const string TextStyleElementName = "TextStyle"; + public const string TextStyleIdAttributeName = "Id"; + public const string TextStyleIdPrefix = "UiKitTextStyle"; + + public const string SvgFilesElementName = "SvgFiles"; + public const string SvgFileElementName = "SvgFile"; + public const string SvgFileFilenameAttributeName = "Filename"; + + public const string ControlsElementName = "Controls"; + + public const string SvgIconsElementName = "SvgIcons"; + public const string SvgIconElementName = "SvgIcon"; + public const string SvgIconIdAttributeName = "Id"; + public const string SvgIconIsAutoRTLAttributeName = "IsAutoRTL"; + public const string SvgIconIsColorfullAttributeName = "IsColorfull"; + + public const string IllustrationsElementName = "Illustrations"; + public const string IllustrationElementName = "Illustration"; + public const string IllustrationIdAttributeName = "Id"; + public const string IllustrationHeightAttributeName = "Height"; + public const string IllustrationIsAutoRTLAttributeName = "IsAutoRTL"; + public const string IllustrationNameAttributeName = "Name"; + public const string IllustrationProductAttributeName = "Product"; + public const string IllustrationScopeAttributeName = "Scope"; + public const string IllustrationWidthAttributeName = "Width"; + + public const string VectorsElementName = "Vectors"; + public const string VectorElementName = "Vector"; + public const string VectorIsRTLAttributeName = "IsRTL"; + public const string VectorThemeAttributeName = "Theme"; + public const string VectorDataElementName = "Data"; + public const string SvgElementName = "Svg"; + + public const string ExcludedControlsFilterParameterName = "excludedControlsFilter"; + public const string ExcludedControlsFilterDelimiterParameterName = "excludedControlsFilterDelimiter"; + public const string ExcludedControlsFilterDelimiter = ";"; + + public const string ExternalResourceDictionariesParameterName = "externalResourceDictionaries"; + public const string ExternalResourceDictionariesDelimiterParameterName = "externalResourceDictionariesDelimiter"; + public const string ExternalResourceDictionariesDelimiter = "|"; + + public const string ConditionalNamespacePrefixParameterName = "conditionalNamespacePrefix"; + + public const string CommentTextParameterName = "commentText"; + + public static readonly string[] NeutralLocales = new[] { "neutral" }; + public static readonly string[] RtlLocales = new[] { "ar" }; + } +} \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/EmbeddedConfigurationAttribute.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/EmbeddedConfigurationAttribute.cs new file mode 100644 index 0000000..5a7038e --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/EmbeddedConfigurationAttribute.cs @@ -0,0 +1,32 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System; + +namespace Kaspirin.UI.Framework.UiKit.Translator.Core +{ + [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] + internal sealed class EmbeddedConfigurationAttribute : Attribute + { + public EmbeddedConfigurationAttribute(string key, string value) + { + Key = key; + Value = value; + } + + public string Key { get; set; } + + public string Value { get; set; } + } +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/EmbeddedConfigurationProvider.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/EmbeddedConfigurationProvider.cs new file mode 100644 index 0000000..bb00460 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/EmbeddedConfigurationProvider.cs @@ -0,0 +1,46 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System.Collections.Generic; +using System.Linq; +using System.Reflection; + +namespace Kaspirin.UI.Framework.UiKit.Translator.Core +{ + internal sealed class EmbeddedConfigurationProvider + { + public EmbeddedConfigurationProvider() + { + _configuration = new Dictionary(); + + var attributes = Assembly.GetExecutingAssembly() + .GetCustomAttributes(typeof(EmbeddedConfigurationAttribute), false) + .OfType(); + + foreach (var attribute in attributes) + { + if (attribute.Key == null) + { + continue; + } + + _configuration.Add(attribute.Key, attribute.Value); + } + } + + public bool TryGetValue(string key, out string value) => _configuration.TryGetValue(key, out value); + + private readonly Dictionary _configuration; + } +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/EmbeddedResourceHelper.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/EmbeddedResourceHelper.cs new file mode 100644 index 0000000..37558aa --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/EmbeddedResourceHelper.cs @@ -0,0 +1,48 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System; +using System.IO; +using System.Linq; +using System.Reflection; + +namespace Kaspirin.UI.Framework.UiKit.Translator.Core +{ + internal static class EmbeddedResourceHelper + { + public static Stream GetEmbeddedResource(string resourceDirectory, string resourceName) + { + // Replace all slashes by dots. + var resourcePath = resourceDirectory.Replace(Path.DirectorySeparatorChar, '.'); + + var embeddedConfigurationProvider = new EmbeddedConfigurationProvider(); + if (!embeddedConfigurationProvider.TryGetValue(Const.RootNamespaceEmbeddedConfigurationKey, out var rootNamespace)) + { + throw new Exception("failed to provide assembly root namespace"); + } + + var assembly = Assembly.GetExecutingAssembly(); + var expectedResourcePath = $"{rootNamespace}.{resourcePath}.{resourceName}"; + var resolvedResourcePath = assembly.GetManifestResourceNames() + .FirstOrDefault(existingResourcePath => + string.Equals(existingResourcePath, expectedResourcePath, StringComparison.InvariantCultureIgnoreCase)); + + return resolvedResourcePath switch + { + null => null, + _ => assembly.GetManifestResourceStream(resolvedResourcePath) + }; + } + } +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/EmbeddedResourceXmlUrlResolver.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/EmbeddedResourceXmlUrlResolver.cs new file mode 100644 index 0000000..75601ed --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/EmbeddedResourceXmlUrlResolver.cs @@ -0,0 +1,54 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System; +using System.IO; +using System.Xml; +using Microsoft.Build.Framework; +using Microsoft.Build.Utilities; + +namespace Kaspirin.UI.Framework.UiKit.Translator.Core +{ + internal sealed class EmbeddedResourceXmlUrlResolver : XmlUrlResolver + { + public EmbeddedResourceXmlUrlResolver(string resourcesDirectory, TaskLoggingHelper log) + { + _resourcesDirectory = resourcesDirectory; + _log = log; + } + + public override object GetEntity(Uri absoluteUri, string role, Type ofObjectToReturn) + { + var message = $"Schema import resolve '{absoluteUri}'"; + + if (absoluteUri.IsFile) + { + var schemaFilename = Path.GetFileName(absoluteUri.AbsolutePath); + var schemaStream = EmbeddedResourceHelper.GetEmbeddedResource(_resourcesDirectory, schemaFilename); + + if (schemaStream != null) + { + _log.LogMessage(MessageImportance.Normal, $"{message} [success]"); + return schemaStream; + } + } + + _log.LogMessage(MessageImportance.High, $"{message} [fail]"); + return null; + } + + private readonly string _resourcesDirectory; + private readonly TaskLoggingHelper _log; + } +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/JsonHelper.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/JsonHelper.cs new file mode 100644 index 0000000..8821df5 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/JsonHelper.cs @@ -0,0 +1,38 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System.IO; +using System.Runtime.Serialization.Json; +using System.Text; + +namespace Kaspirin.UI.Framework.UiKit.Translator.Core +{ + internal static class JsonHelper + { + public static string Serialize(T value) + { + var serializer = new DataContractJsonSerializer(typeof(T)); + using var memoryStream = new MemoryStream(); + serializer.WriteObject(memoryStream, value); + return Encoding.Default.GetString(memoryStream.ToArray()); + } + + public static T Deserialize(string json) + { + using var memoryStream = new MemoryStream(Encoding.UTF8.GetBytes(json)); + var serializer = new DataContractJsonSerializer(typeof(T)); + return (T)serializer.ReadObject(memoryStream); + } + } +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Kaspirin.UI.Framework.UiKit.Translator.Core.csproj b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Kaspirin.UI.Framework.UiKit.Translator.Core.csproj new file mode 100644 index 0000000..bfcbdd0 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Kaspirin.UI.Framework.UiKit.Translator.Core.csproj @@ -0,0 +1,60 @@ + + + kaspirin.ui.framework.uikit.translator.core + Kaspirin.UI.Framework.UiKit.Translator.Core + + + + + + + + + disable + + + + $(IntermediateOutputPath)\AssemblyInfo.g.cs + true + + + + + + + + + + + + + + + Schema\%(Filename).xsd + Designer + + + + + + + + + + + + + + + + <_Parameter1>SchemasDirectory + <_Parameter2>$(RepoRoot)src\figma\Schema + + + <_Parameter1>RootNamespace + <_Parameter2>$(RootNamespace) + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/LineEndingHelper.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/LineEndingHelper.cs new file mode 100644 index 0000000..44d7249 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/LineEndingHelper.cs @@ -0,0 +1,40 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System; +using System.Text.RegularExpressions; + +namespace Kaspirin.UI.Framework.UiKit.Translator.Core +{ + internal static class LineEndingHelper + { + public static string NormalizeLineEndings(string value, LineEndingMode mode) + => _lineEndingsRegex.Replace(value, GetLineEnding(mode)); + + private static string GetLineEnding(LineEndingMode mode) + { + return mode switch + { + LineEndingMode.CrLf => CrLfLineEnding, + LineEndingMode.Lf => LfLineEnding, + _ => throw new ArgumentOutOfRangeException(nameof(mode), mode, "Unsupported line ending mode"), + }; + } + + private static readonly Regex _lineEndingsRegex = new(@"\r\n|\n\r|\n|\r", RegexOptions.Compiled); + + private const string CrLfLineEnding = "\r\n"; + private const string LfLineEnding = "\n"; + } +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/LineEndingMode.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/LineEndingMode.cs new file mode 100644 index 0000000..d70662d --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/LineEndingMode.cs @@ -0,0 +1,22 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +namespace Kaspirin.UI.Framework.UiKit.Translator.Core +{ + internal enum LineEndingMode + { + Lf, + CrLf + } +} \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/SchemaValidator.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/SchemaValidator.cs new file mode 100644 index 0000000..c3cc2c2 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/SchemaValidator.cs @@ -0,0 +1,178 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System; +using System.IO; +using System.Xml; +using System.Xml.Schema; +using Microsoft.Build.Utilities; + +namespace Kaspirin.UI.Framework.UiKit.Translator.Core +{ + internal sealed class SchemaValidator + { + public SchemaValidator(bool failOnValidationErrors, TaskLoggingHelper log) + { + _failOnValidationErrors = failOnValidationErrors; + _log = log; + } + + public bool Validate(string uiKitPath) + { + var schemaStream = EmbeddedResourceHelper.GetEmbeddedResource(Const.SchemaResourcesDirectory, Const.UiKitSchemaFilename); + + var schemas = new XmlSchemaSet(); + + var schemaReadingErrors = 0; + schemas.ValidationEventHandler += (s, args) => + { + Trace(args); + + if (args.Severity == XmlSeverityType.Error) + { + schemaReadingErrors++; + } + }; + + schemas.XmlResolver = new EmbeddedResourceXmlUrlResolver(Const.SchemaResourcesDirectory, _log); + + var schema = XmlSchema.Read(schemaStream, null); + schemas.Add(schema); + + schemas.Compile(); + + if (schemaReadingErrors > 0) + { + Trace("UI Kit XSD-schema reading failed."); + if (_failOnValidationErrors) + { + return false; + } + } + + var settings = new XmlReaderSettings(); + settings.ValidationFlags |= XmlSchemaValidationFlags.ReportValidationWarnings; + settings.ValidationType = ValidationType.Schema; + + settings.Schemas.Add(schema); + + var schemaValidationErrors = 0; + settings.ValidationEventHandler += (s, args) => + { + Trace(args); + + if (args.Severity == XmlSeverityType.Error) + { + schemaValidationErrors++; + } + }; + + using var xmlReader = XmlReader.Create(uiKitPath, settings); + var xmlDocument = new XmlDocument { PreserveWhitespace = true }; + xmlDocument.Load(xmlReader); + + if (schemaValidationErrors > 0) + { + Trace("UI Kit XSD-schema validation failed."); + if (_failOnValidationErrors) + { + return false; + } + } + + return true; + } + + private void Trace(string message) + { + if (!_failOnValidationErrors) + { + _log.LogWarning(message); + } + else + { + _log.LogError(message); + } + } + + private void Trace(ValidationEventArgs args) + { + var message = args.Message; + var lineNumber = args.Exception.LineNumber; + var linePosition = args.Exception.LinePosition; + var sourceUri = args.Exception.SourceUri; + + var shouldLogAsError = _failOnValidationErrors && args.Severity == XmlSeverityType.Error; + + if (TryResolvePath(sourceUri, out var path)) + { + // If we have a reference to an existing file, we can provide logging routines with this information. + // In this case warnings and errors will be interactive, so one can click on it and get redirected + // to the particular location inside the file with the problem. Very convenient for XML and XSD troubleshooting. + + if (shouldLogAsError) + { + _log.LogError(null, null, null, path, lineNumber, linePosition, lineNumber, linePosition, message); + } + else + { + _log.LogWarning(null, null, null, path, lineNumber, linePosition, lineNumber, linePosition, message); + } + + return; + } + + message = $"{message} ({sourceUri}, line: {lineNumber}, position: {linePosition})"; + + if (shouldLogAsError) + { + _log.LogError(message); + } + else + { + _log.LogWarning(message); + } + } + + private static bool TryResolvePath(string sourceUri, out string path) + { + if (Uri.TryCreate(sourceUri, UriKind.Absolute, out var uri)) + { + path = Path.GetFullPath(Uri.UnescapeDataString(uri.AbsolutePath)); + if (File.Exists(path)) + { + return true; + } + + var embeddedConfigurationProvider = new EmbeddedConfigurationProvider(); + if (embeddedConfigurationProvider.TryGetValue(Const.SchemasDirectoryEmbeddedConfigurationKey, out var schemasDirectory)) + { + // Schema files are packed into the assembly as embedded resources. + // Try to locate file from embedded resource in the original directory with schemas. + path = Path.GetFullPath(Path.Combine(schemasDirectory, Path.GetFileName(path))); + if (File.Exists(path)) + { + return true; + } + } + } + + path = sourceUri; + return false; + } + + private readonly bool _failOnValidationErrors; + private readonly TaskLoggingHelper _log; + } +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/BadgeCustomizationDictionary.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/BadgeCustomizationDictionary.xslt new file mode 100644 index 0000000..5165fea --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/BadgeCustomizationDictionary.xslt @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BackgroundDanger + + + + + + + + BackgroundInfo + + + + + + + + BackgroundNeutral + + + + + + + + BackgroundPositive + + + + + + + + BackgroundWarning + + + + + + + + Foreground + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/BadgeStyle.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/BadgeStyle.xslt new file mode 100644 index 0000000..b9b38a6 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/BadgeStyle.xslt @@ -0,0 +1,219 @@ + + + + + + + + + + + + + + + + + + Badges + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Foreground + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Type + Danger + + + + + + + + BackgroundDanger + + + + + + + + + + + + + Type + Info + + + + + + + + BackgroundInfo + + + + + + + + + + + + + Type + Neutral + + + + + + + + BackgroundNeutral + + + + + + + + + + + + + Type + Positive + + + + + + + + BackgroundPositive + + + + + + + + + + + + + Type + Warning + + + + + + + + BackgroundWarning + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/BulletCustomizationDictionary.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/BulletCustomizationDictionary.xslt new file mode 100644 index 0000000..f5c2504 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/BulletCustomizationDictionary.xslt @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BulletColor + + + + + + + + Foreground + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/BulletStyle.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/BulletStyle.xslt new file mode 100644 index 0000000..927bbd1 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/BulletStyle.xslt @@ -0,0 +1,107 @@ + + + + + + + + + + + + + + + + + + Bullets + + + + + + + + + + + + + + + + + + + + visuals:Bullet + BulletUniversal + + + + + + + + + TextBlock + + TextStyle + + + + TextElement.Foreground + + + Foreground + + + + + + + + + + + + Bullet_Color + BulletColor + + + + + + Bullet_Margin + + + + + + Bullet_TextStyle + TextStyle + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ButtonCustomizationDictionary.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ButtonCustomizationDictionary.xslt new file mode 100644 index 0000000..15f437d --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ButtonCustomizationDictionary.xslt @@ -0,0 +1,211 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BackgroundDisabled + + + + + + BackgroundHover + + + + + + BackgroundNormal + + + + + + BackgroundPressed + + + + + + BorderDisabled + + + + + + BorderHover + + + + + + BorderNormal + + + + + + BorderPressed + + + + + + FocusVisualBrush + + + + + + ForegroundDisabled + + + + + + ForegroundHover + + + + + + ForegroundNormal + + + + + + ForegroundPressed + + + + + + IconForegroundDisabledCenterLocation + + + + + + IconForegroundDisabledSideLocation + + + + + + IconForegroundHoverCenterLocation + + + + + + IconForegroundHoverSideLocation + + + + + + IconForegroundNormalCenterLocation + + + + + + IconForegroundNormalSideLocation + + + + + + IconForegroundPressedCenterLocation + + + + + + IconForegroundPressedSideLocation + + + + + + ShadowDisabled + + + + + + ShadowHover + + + + + + ShadowNormal + + + + + + ShadowPressed + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ButtonStyle.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ButtonStyle.xslt new file mode 100644 index 0000000..54f35f0 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ButtonStyle.xslt @@ -0,0 +1,736 @@ + + + + + + + + + + + + + + + + + + Buttons + + + + + + + + + + + + + + + + + + + + + ButtonGhostUniversal + ButtonUniversal + + + + + + visuals:BigButton + ButtonBase + + + + + + + + + + + + + + + + + + + visuals:Spinner + + SpinnerStyle + + + + Spinner_Foreground + ForegroundNormal + + + + + + + + visuals:Spinner + + SpinnerStyleDisabled + + + + Spinner_Foreground + ForegroundDisabled + + + + + + + + visuals:Spinner + + SpinnerStyleHover + + + + Spinner_Foreground + ForegroundHover + + + + + + + + visuals:Spinner + + SpinnerStylePressed + + + + Spinner_Foreground + ForegroundPressed + + + + + + + + TextBlock + + TextStyle + + + + TextElement.Foreground + ForegroundNormal + + + + + + + + TextBlock + + TextStyleDisabled + + + + TextElement.Foreground + ForegroundDisabled + + + + + + + + TextBlock + + TextStyleHover + + + + TextElement.Foreground + ForegroundHover + + + + + + + + TextBlock + + TextStylePressed + + + + TextElement.Foreground + ForegroundPressed + + + + + + + + + + Button_Container_Background + BackgroundNormal + + + + + + Button_Container_BorderBrush + BorderNormal + + + + + + Button_Container_BorderThickness + + + + + + Button_Container_CornerRadius + + + + + Button_Container_Shadow + + + + + + + Button_Icon_Foreground + IconForegroundNormalSideLocation + + + + + + Button_Icon_MarginLeft + + + + + + Button_Icon_MarginRight + + + + + + Button_Icon_Opacity + + + + + + Button_Spinner_Style + SpinnerStyle + + + + + Button_FocusVisualStyle + + + + + + Button_Height + + + + + Button_Opacity + + + + + + Button_Padding + + + + + Button_TextStyle + TextStyle + + + + + Button_TextStyleDisabled + TextStyleDisabled + + + + + Button_TextStyleHover + TextStyleHover + + + + + Button_TextStylePressed + TextStylePressed + + + + + + + + + visuals:StateService.State + Disabled + + + + + Button_Container_Background + BackgroundDisabled + + + + + + Button_Container_BorderBrush + BorderDisabled + + + + + + Button_Container_BorderThickness + + + + + + Button_Container_Shadow + + + + + + + Button_Icon_Foreground + IconForegroundDisabledSideLocation + + + + + + Button_Icon_Opacity + + + + + + Button_Opacity + + + + + + Button_Spinner_Style + SpinnerStyleDisabled + + + + + + + + visuals:StateService.State + Hover + + + + + Button_Container_Background + BackgroundHover + + + + + + Button_Container_BorderBrush + BorderHover + + + + + + Button_Container_BorderThickness + + + + + + Button_Container_Shadow + + + + + + + Button_Icon_Foreground + IconForegroundHoverSideLocation + + + + + + Button_Icon_Opacity + + + + + + Button_Opacity + + + + + + Button_Spinner_Style + SpinnerStyleHover + + + + + + + + visuals:StateService.State + Pressed + + + + + Button_Container_Background + BackgroundPressed + + + + + + Button_Container_BorderBrush + BorderPressed + + + + + + Button_Container_BorderThickness + + + + + + Button_Container_Shadow + + + + + + + Button_Icon_Foreground + IconForegroundPressedSideLocation + + + + + + Button_Icon_Opacity + + + + + + Button_Opacity + + + + + + Button_Spinner_Style + SpinnerStylePressed + + + + + + + + Content + {x:Null} + + + + + Button_Padding + 0 + + + + + Button_Icon_MarginLeft + + + + + + Button_Icon_MarginRight + + + + + + + + + + + + + Content + {x:Null} + + + + + visuals:StateService.State + Disabled + + + + + + + + + Button_Icon_Foreground + IconForegroundDisabledCenterLocation + + + + + + + + + + + + + Content + {x:Null} + + + + + visuals:StateService.State + Hover + + + + + + + + + Button_Icon_Foreground + IconForegroundHoverCenterLocation + + + + + + + + + + + + + Content + {x:Null} + + + + + visuals:StateService.State + Normal + + + + + + + + + Button_Icon_Foreground + IconForegroundNormalCenterLocation + + + + + + + + + + + + + Content + {x:Null} + + + + + visuals:StateService.State + Pressed + + + + + + + + + Button_Icon_Foreground + IconForegroundPressedCenterLocation + + + + + + + + + + + + + + + + + Button + ToggleButton + + + + + + + + + ToggleButton + + + + + + + + + + + Button + ContextMenuButton + + + + + + + + + visuals:ContextMenuButton + ContextMenuButtonUniversal + + + + + + + ContextMenuButton_ToggleButton_Style + + + + + + + + + + + + Button + ContextMenuSelect + + + + + + + + + visuals:ContextMenuSelect + ContextMenuButtonUniversal + + + + + + + ContextMenuButton_ToggleButton_Style + + + + + + + + + + + diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/CarouselItemCustomizationDictionary.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/CarouselItemCustomizationDictionary.xslt new file mode 100644 index 0000000..200d0ff --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/CarouselItemCustomizationDictionary.xslt @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BackgroundDisabled + + + + + + BackgroundHover + + + + + + BackgroundNormal + + + + + + BackgroundSelected + + + + + + BorderColorDisabled + + + + + + BorderColorHover + + + + + + BorderColorNormal + + + + + + BorderColorSelected + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/CarouselItemStyle.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/CarouselItemStyle.xslt new file mode 100644 index 0000000..5779ab6 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/CarouselItemStyle.xslt @@ -0,0 +1,291 @@ + + + + + + + + + + + + + + + + + + CarouselItems + + + + + + + + + + + + + + + visuals:CarouselItem + CarouselItemUniversal + + + + + + + + + + + + + + CarouselItem_CornerRadius + + + + + CarouselItem_Height + + + + + + CarouselItem_Width + + + + + + + + + + visuals:StateService.SelectableState + Normal + + + + + CarouselItem_Background + BackgroundNormal + + + + + + CarouselItem_BorderBrush + BorderColorNormal + + + + + + CarouselItem_BorderThickness + + + + + + + + + visuals:StateService.SelectableState + Hover + + + + + CarouselItem_Background + BackgroundHover + + + + + + CarouselItem_BorderBrush + BorderColorHover + + + + + + CarouselItem_BorderThickness + + + + + + + + + visuals:StateService.SelectableState + Disabled + + + + + CarouselItem_Background + BackgroundDisabled + + + + + + CarouselItem_BorderBrush + BorderColorDisabled + + + + + + CarouselItem_BorderThickness + + + + + + + + + visuals:StateService.SelectableState + SelectedNormal + + + + + CarouselItem_Background + BackgroundSelected + + + + + + CarouselItem_BorderBrush + BorderColorSelected + + + + + + CarouselItem_BorderThickness + + + + + + CarouselItem_Height + + + + + + CarouselItem_Width + + + + + + + + + visuals:StateService.SelectableState + SelectedDisabled + + + + + CarouselItem_Background + BackgroundDisabled + + + + + + CarouselItem_BorderBrush + BorderColorDisabled + + + + + + CarouselItem_BorderThickness + + + + + + CarouselItem_Height + + + + + + CarouselItem_Width + + + + + + + + + + + + + + + Item + + + + + + + + + + visuals:Carousel + CarouselUniversal + + + + + + + ItemContainerStyle + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/CheckBoxRadioButtonCustomizationDictionary.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/CheckBoxRadioButtonCustomizationDictionary.xslt new file mode 100644 index 0000000..3a7976e --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/CheckBoxRadioButtonCustomizationDictionary.xslt @@ -0,0 +1,469 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BackgroundCheckedDisabled + + + + + + BackgroundCheckedHover + + + + + + BackgroundCheckedInvalidHover + + + + + + BackgroundCheckedInvalidNormal + + + + + + BackgroundCheckedInvalidPressed + + + + + + BackgroundCheckedNormal + + + + + + BackgroundCheckedPressed + + + + + + BackgroundDisabled + + + + + + BackgroundHover + + + + + + BackgroundInvalidHover + + + + + + BackgroundInvalidNormal + + + + + + BackgroundInvalidPressed + + + + + + BackgroundNormal + + + + + + + BackgroundPartialDisabled + + + + + + + + BackgroundPartialHover + + + + + + + + BackgroundPartialInvalidHover + + + + + + + + BackgroundPartialInvalidNormal + + + + + + + + BackgroundPartialInvalidPressed + + + + + + + + BackgroundPartialNormal + + + + + + + + BackgroundPartialPressed + + + + + + + BackgroundPressed + + + + + + BorderCheckedDisabled + + + + + + BorderCheckedHover + + + + + + BorderCheckedInvalidHover + + + + + + BorderCheckedInvalidNormal + + + + + + BorderCheckedInvalidPressed + + + + + + BorderCheckedNormal + + + + + + BorderCheckedPressed + + + + + + BorderDisabled + + + + + + BorderHover + + + + + + BorderInvalidHover + + + + + + BorderInvalidNormal + + + + + + BorderInvalidPressed + + + + + + BorderNormal + + + + + + + BorderPartialDisabled + + + + + + + + BorderPartialHover + + + + + + + + BorderPartialInvalidHover + + + + + + + + BorderPartialInvalidNormal + + + + + + + + BorderPartialInvalidPressed + + + + + + + + BorderPartialNormal + + + + + + + + BorderPartialPressed + + + + + + + BorderPressed + + + + + + DescriptionForeground + + + + + + DescriptionForegroundDisabled + + + + + + FocusVisualBrush + + + + + + MarkColorCheckedDisabled + + + + + + MarkColorCheckedHover + + + + + + MarkColorCheckedInvalidHover + + + + + + MarkColorCheckedInvalidNormal + + + + + + MarkColorCheckedInvalidPressed + + + + + + MarkColorCheckedNormal + + + + + + MarkColorCheckedPressed + + + + + + + MarkColorPartialDisabled + + + + + + + + MarkColorPartialHover + + + + + + + + MarkColorPartialInvalidHover + + + + + + + + MarkColorPartialInvalidNormal + + + + + + + + MarkColorPartialInvalidPressed + + + + + + + + MarkColorPartialNormal + + + + + + + + MarkColorPartialPressed + + + + + + + TextForeground + + + + + + TextForegroundDisabled + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/CheckBoxRadioButtonStyle.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/CheckBoxRadioButtonStyle.xslt new file mode 100644 index 0000000..2c2b894 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/CheckBoxRadioButtonStyle.xslt @@ -0,0 +1,1360 @@ + + + + + + + + + + + + + + + + + + CheckBoxes + + + + + + + + + + + RadioButtons + + + + + + + + + + + + + + + + + + + ToggleButton + CheckableUniversal + + + + + + + + + TextBlock + + DescriptionStyle + + + + TextElement.Foreground + + + DescriptionForeground + + + + + + + + + + TextBlock + + DescriptionStyleDisabled + + + + TextElement.Foreground + + + DescriptionForegroundDisabled + + + + + + + + + + TextBlock + + TextStyle + + + + TextElement.Foreground + + + TextForeground + + + + + + + + + + TextBlock + + TextStyleDisabled + + + + TextElement.Foreground + + + TextForegroundDisabled + + + + + + + + + + + + Checkable_DescriptionStyle + DescriptionStyle + + + + + Checkable_DescriptionStyleDisabled + DescriptionStyleDisabled + + + + + Checkable_Description_Margin + + + + + + Checkable_Mark_Source + + + + + + + + + + + + + + + Checkable_MarkContainer_CornerRadius + + + + + + Checkable_MarkContainer_Height + + + + + + Checkable_MarkContainer_Margin + + + + + + Checkable_MarkContainer_Width + + + + + + Checkable_FocusVisualStyle + + + + + + Checkable_Padding + + + + + Checkable_TextStyle + TextStyle + + + + + Checkable_TextStyleDisabled + TextStyleDisabled + + + + + + + + + IsChecked + {x:Null} + + + + + + Checkable_Mark_Source + + + + + + + + + + + + + + + + + + + + + + + IsChecked + False + + + + + visuals:StateService.State + Disabled + + + + + + + + + Checkable_MarkContainer_Background + BackgroundDisabled + + + + + + Checkable_MarkContainer_BorderBrush + BorderDisabled + + + + + + Checkable_MarkContainer_BorderThickness + + + + + + + + + + + + + IsChecked + False + + + + + visuals:StateService.State + Normal + + + + + + + + + Checkable_MarkContainer_Background + BackgroundNormal + + + + + + Checkable_MarkContainer_BorderBrush + BorderNormal + + + + + + Checkable_MarkContainer_BorderThickness + + + + + + + + + + + + + IsChecked + False + + + + + visuals:StateService.State + Hover + + + + + + + + Checkable_MarkContainer_Background + BackgroundHover + + + + + + Checkable_MarkContainer_BorderBrush + BorderHover + + + + + + Checkable_MarkContainer_BorderThickness + + + + + + + + + + + + + IsChecked + False + + + + + visuals:StateService.State + Pressed + + + + + + + + + Checkable_MarkContainer_Background + BackgroundPressed + + + + + + Checkable_MarkContainer_BorderBrush + BorderPressed + + + + + + Checkable_MarkContainer_BorderThickness + + + + + + + + + + + + + IsChecked + False + + + + + visuals:StateService.State + Normal + + + + + visuals:CheckableInternals.IsInvalidState + True + + + + + + + + + Checkable_MarkContainer_Background + BackgroundInvalidNormal + + + + + + Checkable_MarkContainer_BorderBrush + BorderInvalidNormal + + + + + + Checkable_MarkContainer_BorderThickness + + + + + + + + + + + + + IsChecked + False + + + + + visuals:StateService.State + Hover + + + + + visuals:CheckableInternals.IsInvalidState + True + + + + + + + + Checkable_MarkContainer_Background + BackgroundInvalidHover + + + + + + Checkable_MarkContainer_BorderBrush + BorderInvalidHover + + + + + + Checkable_MarkContainer_BorderThickness + + + + + + + + + + + + + IsChecked + False + + + + + visuals:StateService.State + Pressed + + + + + visuals:CheckableInternals.IsInvalidState + True + + + + + + + + + Checkable_MarkContainer_Background + BackgroundInvalidPressed + + + + + + Checkable_MarkContainer_BorderBrush + BorderInvalidPressed + + + + + + Checkable_MarkContainer_BorderThickness + + + + + + + + + + + + + IsChecked + {x:Null} + + + + + visuals:StateService.State + Disabled + + + + + + + + + + Checkable_Mark_Brush + MarkColorPartialDisabled + + + + + + + + Checkable_MarkContainer_Background + BackgroundPartialDisabled + + + + + + + + Checkable_MarkContainer_BorderBrush + BorderPartialDisabled + + + + + + + Checkable_MarkContainer_BorderThickness + + + + + + + + + + + + + IsChecked + {x:Null} + + + + + visuals:StateService.State + Hover + + + + + + + + + + Checkable_Mark_Brush + MarkColorPartialHover + + + + + + + + Checkable_MarkContainer_Background + BackgroundPartialHover + + + + + + + + Checkable_MarkContainer_BorderBrush + BorderPartialHover + + + + + + + Checkable_MarkContainer_BorderThickness + + + + + + + + + + + + + IsChecked + {x:Null} + + + + + visuals:StateService.State + Normal + + + + + + + + + + Checkable_Mark_Brush + MarkColorPartialNormal + + + + + + + + Checkable_MarkContainer_Background + BackgroundPartialNormal + + + + + + + + Checkable_MarkContainer_BorderBrush + BorderPartialNormal + + + + + + + Checkable_MarkContainer_BorderThickness + + + + + + + + + + + + + IsChecked + {x:Null} + + + + + visuals:StateService.State + Pressed + + + + + + + + + + Checkable_Mark_Brush + MarkColorPartialPressed + + + + + + + + Checkable_MarkContainer_Background + BackgroundPartialPressed + + + + + + + + Checkable_MarkContainer_BorderBrush + BorderPartialPressed + + + + + + + Checkable_MarkContainer_BorderThickness + + + + + + + + + + + + + IsChecked + {x:Null} + + + + + visuals:StateService.State + Hover + + + + + visuals:CheckableInternals.IsInvalidState + True + + + + + + + + + + Checkable_Mark_Brush + MarkColorPartialInvalidHover + + + + + + + + Checkable_MarkContainer_Background + BackgroundPartialInvalidHover + + + + + + + + Checkable_MarkContainer_BorderBrush + BorderPartialInvalidHover + + + + + + + Checkable_MarkContainer_BorderThickness + + + + + + + + + + + + + IsChecked + {x:Null} + + + + + visuals:StateService.State + Normal + + + + + visuals:CheckableInternals.IsInvalidState + True + + + + + + + + + + Checkable_Mark_Brush + MarkColorPartialInvalidNormal + + + + + + + + Checkable_MarkContainer_Background + BackgroundPartialInvalidNormal + + + + + + + + Checkable_MarkContainer_BorderBrush + BorderPartialInvalidNormal + + + + + + + Checkable_MarkContainer_BorderThickness + + + + + + + + + + + + + IsChecked + {x:Null} + + + + + visuals:StateService.State + Pressed + + + + + visuals:CheckableInternals.IsInvalidState + True + + + + + + + + + + Checkable_Mark_Brush + MarkColorPartialInvalidPressed + + + + + + + + Checkable_MarkContainer_Background + BackgroundPartialInvalidPressed + + + + + + + + Checkable_MarkContainer_BorderBrush + BorderPartialInvalidPressed + + + + + + + Checkable_MarkContainer_BorderThickness + + + + + + + + + + + + + IsChecked + True + + + + + visuals:StateService.State + Disabled + + + + + + + + + Checkable_Mark_Brush + MarkColorCheckedDisabled + + + + + + Checkable_MarkContainer_Background + BackgroundCheckedDisabled + + + + + + Checkable_MarkContainer_BorderBrush + BorderCheckedDisabled + + + + + + Checkable_MarkContainer_BorderThickness + + + + + + + + + + + + + IsChecked + True + + + + + visuals:StateService.State + Hover + + + + + + + + + Checkable_Mark_Brush + MarkColorCheckedHover + + + + + + Checkable_MarkContainer_Background + BackgroundCheckedHover + + + + + + Checkable_MarkContainer_BorderBrush + BorderCheckedHover + + + + + + Checkable_MarkContainer_BorderThickness + + + + + + + + + + + + + IsChecked + True + + + + + visuals:StateService.State + Normal + + + + + + + + + Checkable_Mark_Brush + MarkColorCheckedNormal + + + + + + Checkable_MarkContainer_Background + BackgroundCheckedNormal + + + + + + Checkable_MarkContainer_BorderBrush + BorderCheckedNormal + + + + + + Checkable_MarkContainer_BorderThickness + + + + + + + + + + + + + IsChecked + True + + + + + visuals:StateService.State + Pressed + + + + + + + + + Checkable_Mark_Brush + MarkColorCheckedPressed + + + + + + Checkable_MarkContainer_Background + BackgroundCheckedPressed + + + + + + Checkable_MarkContainer_BorderBrush + BorderCheckedPressed + + + + + + Checkable_MarkContainer_BorderThickness + + + + + + + + + + + + + IsChecked + True + + + + + visuals:StateService.State + Hover + + + + + visuals:CheckableInternals.IsInvalidState + True + + + + + + + + + Checkable_Mark_Brush + MarkColorCheckedInvalidHover + + + + + + Checkable_MarkContainer_Background + BackgroundCheckedInvalidHover + + + + + + Checkable_MarkContainer_BorderBrush + BorderCheckedInvalidHover + + + + + + Checkable_MarkContainer_BorderThickness + + + + + + + + + + + + + IsChecked + True + + + + + visuals:StateService.State + Normal + + + + + visuals:CheckableInternals.IsInvalidState + True + + + + + + + + + Checkable_Mark_Brush + MarkColorCheckedInvalidNormal + + + + + + Checkable_MarkContainer_Background + BackgroundCheckedInvalidNormal + + + + + + Checkable_MarkContainer_BorderBrush + BorderCheckedInvalidNormal + + + + + + Checkable_MarkContainer_BorderThickness + + + + + + + + + + + + + IsChecked + True + + + + + visuals:StateService.State + Pressed + + + + + visuals:CheckableInternals.IsInvalidState + True + + + + + + + + + Checkable_Mark_Brush + MarkColorCheckedInvalidPressed + + + + + + Checkable_MarkContainer_Background + BackgroundCheckedInvalidPressed + + + + + + Checkable_MarkContainer_BorderBrush + BorderCheckedInvalidPressed + + + + + + Checkable_MarkContainer_BorderThickness + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ChipsControlCustomizationDictionary.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ChipsControlCustomizationDictionary.xslt new file mode 100644 index 0000000..b4461f1 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ChipsControlCustomizationDictionary.xslt @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ButtonForeground + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ChipsControlStyle.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ChipsControlStyle.xslt new file mode 100644 index 0000000..49027ce --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ChipsControlStyle.xslt @@ -0,0 +1,136 @@ + + + + + + + + + + + + + + + + + + ChipsControls + + + + + + + + + + + + + + + + + + + + visuals:ChipsControl + ChipsControlUniversal + + + + + + + + + visuals:IconButtonBase + + IconButtonStyle + + + + + + IconButton_Icon_Foreground + ButtonForeground + + + + + + IconButton_Padding + + + + + + + + + + visuals:FadeLine + FadeLineUniversal + FadeLineStyle + + + + + + FadeLine_IconButton_LeftIcon + + + + + + FadeLine_IconButton_RightIcon + + + + + + FadeLine_IconButtonStyle + IconButtonStyle + + + + + + + + + + + ChipsControl_FadeLineStyle + FadeLineStyle + + + + + ChipsControl_ItemContainerStyle + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ChipsItemCustomizationDictionary.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ChipsItemCustomizationDictionary.xslt new file mode 100644 index 0000000..76b7176 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ChipsItemCustomizationDictionary.xslt @@ -0,0 +1,301 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BackgroundDisabled + + + + + + BackgroundHover + + + + + + BackgroundNormal + + + + + + BackgroundSelectedDisabled + + + + + + BackgroundSelectedHover + + + + + + BackgroundSelectedNormal + + + + + + BadgeCounterBackgroundDisabled + + + + + + BadgeCounterBackgroundHover + + + + + + BadgeCounterBackgroundNormal + + + + + + BadgeCounterBackgroundSelectedDisabled + + + + + + BadgeCounterBackgroundSelectedHover + + + + + + BadgeCounterBackgroundSelectedNormal + + + + + + BadgeCounterForegroundDisabled + + + + + + BadgeCounterForegroundHover + + + + + + BadgeCounterForegroundNormal + + + + + + BadgeCounterForegroundSelectedDisabled + + + + + + BadgeCounterForegroundSelectedHover + + + + + + BadgeCounterForegroundSelectedNormal + + + + + + BorderColorDisabled + + + + + + BorderColorHover + + + + + + BorderColorNormal + + + + + + BorderColorSelectedDisabled + + + + + + BorderColorSelectedHover + + + + + + BorderColorSelectedNormal + + + + + + CloseIconForegroundSelectedDisabled + + + + + + CloseIconForegroundSelectedHover + + + + + + CloseIconForegroundSelectedNormal + + + + + + FocusVisualBrush + + + + + + ForegroundDisabled + + + + + + ForegroundHover + + + + + + ForegroundNormal + + + + + + ForegroundSelectedDisabled + + + + + + ForegroundSelectedHover + + + + + + ForegroundSelectedNormal + + + + + + IconForegroundDisabled + + + + + + IconForegroundHover + + + + + + IconForegroundNormal + + + + + + IconForegroundSelectedDisabled + + + + + + IconForegroundSelectedHover + + + + + + IconForegroundSelectedNormal + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ChipsItemStyle.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ChipsItemStyle.xslt new file mode 100644 index 0000000..e407cea --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ChipsItemStyle.xslt @@ -0,0 +1,933 @@ + + + + + + + + + + + + + + + + + + ChipsItems + + + + + + + + + + + + + + + visuals:ChipsItem + ChipsItemUniversal + ChipsItem_ + + + + + + + + + + + + + + + + + visuals:BadgeCounter + + BadgeCounterStyle + + + + + + + + + Path=(visuals:StateService.SelectableState) + + + FindAncestor + visuals:ChipsItem + + + + + + Normal + + + + + + BadgeCounter_Background + + + BadgeCounterBackgroundNormal + + + + + + + + BadgeCounter_Foreground + + + BadgeCounterForegroundNormal + + + + + + + + + + + + + + Path=(visuals:StateService.SelectableState) + + + FindAncestor + visuals:ChipsItem + + + + + + Disabled + + + + + + BadgeCounter_Background + + + BadgeCounterBackgroundDisabled + + + + + + + + BadgeCounter_Foreground + + + BadgeCounterForegroundDisabled + + + + + + + + + + + + + + Path=(visuals:StateService.SelectableState) + + + FindAncestor + visuals:ChipsItem + + + + + + Hover + + + + + + BadgeCounter_Background + + + BadgeCounterBackgroundHover + + + + + + + + BadgeCounter_Foreground + + + BadgeCounterForegroundHover + + + + + + + + + + + + + + Path=(visuals:StateService.SelectableState) + + + FindAncestor + visuals:ChipsItem + + + + + + SelectedNormal + + + + + + BadgeCounter_Background + + + BadgeCounterBackgroundSelectedNormal + + + + + + + + BadgeCounter_Foreground + + + BadgeCounterForegroundSelectedNormal + + + + + + + + + + + + + + Path=(visuals:StateService.SelectableState) + + + FindAncestor + visuals:ChipsItem + + + + + + SelectedHover + + + + + + BadgeCounter_Background + + + BadgeCounterBackgroundSelectedHover + + + + + + + + BadgeCounter_Foreground + + + BadgeCounterForegroundSelectedHover + + + + + + + + + + + + + + Path=(visuals:StateService.SelectableState) + + + FindAncestor + visuals:ChipsItem + + + + + + SelectedDisabled + + + + + + BadgeCounter_Background + + + BadgeCounterBackgroundSelectedDisabled + + + + + + + + BadgeCounter_Foreground + + + BadgeCounterForegroundSelectedDisabled + + + + + + + + + + + + + + + TextBlock + + TextStyle + + + + + + TextElement.Foreground + + + ForegroundNormal + + + + + + + + + + TextBlock + + TextStyleDisabled + + + + + + TextElement.Foreground + + + ForegroundDisabled + + + + + + + + + + TextBlock + + TextStyleHover + + + + + + TextElement.Foreground + + + ForegroundHover + + + + + + + + + + TextBlock + + TextStyleSelectedDisabled + + + + + + TextElement.Foreground + + + ForegroundSelectedDisabled + + + + + + + + + + TextBlock + + TextStyleSelectedHover + + + + + + TextElement.Foreground + + + ForegroundSelectedHover + + + + + + + + + + TextBlock + + TextStyleSelectedNormal + + + + + + TextElement.Foreground + + + ForegroundSelectedNormal + + + + + + + + + + + + + + + + + + + + + BadgeCounterStyle + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + TextStyle + + + + + + + + + + TextStyleDisabled + + + + + + + + + + TextStyleHover + + + + + + + + + + TextStyleSelectedDisabled + + + + + + + + + + TextStyleSelectedHover + + + + + + + + + + TextStyleSelectedNormal + + + + + + + + + + + visuals:StateService.SelectableState + Normal + + + + + + + + BackgroundNormal + + + + + + + + + + + BorderColorNormal + + + + + + + + + + + + + + + + + + + + + IconForegroundNormal + + + + + + + + + + + visuals:StateService.SelectableState + Hover + + + + + + + + BackgroundHover + + + + + + + + + + + BorderColorHover + + + + + + + + + + + + + + + + + + + + + IconForegroundHover + + + + + + + + + + + visuals:StateService.SelectableState + Disabled + + + + + + + + BackgroundDisabled + + + + + + + + + + + BorderColorDisabled + + + + + + + + + + + + + + + + + + + + + IconForegroundDisabled + + + + + + + + + + + visuals:StateService.SelectableState + SelectedNormal + + + + + + + + CloseIconForegroundSelectedNormal + + + + + + + + + + + BackgroundSelectedNormal + + + + + + + + + + + BorderColorSelectedNormal + + + + + + + + + + + + + + + + + + + + + IconForegroundSelectedNormal + + + + + + + + + + + visuals:StateService.SelectableState + SelectedHover + + + + + + + + CloseIconForegroundSelectedHover + + + + + + + + + + + BackgroundSelectedHover + + + + + + + + + + + BorderColorSelectedHover + + + + + + + + + + + + + + + + + + + + + IconForegroundSelectedHover + + + + + + + + + + + visuals:StateService.SelectableState + SelectedDisabled + + + + + + + + CloseIconForegroundSelectedDisabled + + + + + + + + + + + BackgroundSelectedDisabled + + + + + + + + + + + BorderColorSelectedDisabled + + + + + + + + + + + + + + + + + + + + + IconForegroundSelectedDisabled + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/CodeInputCustomizationDictionary.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/CodeInputCustomizationDictionary.xslt new file mode 100644 index 0000000..27d68c2 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/CodeInputCustomizationDictionary.xslt @@ -0,0 +1,193 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BackgroundDisabled + + + + + + BackgroundFocus + + + + + + BackgroundHover + + + + + + BackgroundInvalidFocus + + + + + + BackgroundInvalidHover + + + + + + BackgroundInvalidNormal + + + + + + BackgroundNormal + + + + + + BackgroundReadOnly + + + + + + BorderColorDisabled + + + + + + BorderColorFocus + + + + + + BorderColorHover + + + + + + BorderColorInvalidFocus + + + + + + BorderColorInvalidHover + + + + + + BorderColorInvalidNormal + + + + + + BorderColorNormal + + + + + + BorderColorReadOnly + + + + + + CaptionForeground + + + + + + CaretBrush + + + + + + LabelForeground + + + + + + PlaceholderForeground + + + + + + TextForegroundDisabled + + + + + + TextForeground + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/CodeInputStyle.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/CodeInputStyle.xslt new file mode 100644 index 0000000..62edc4c --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/CodeInputStyle.xslt @@ -0,0 +1,443 @@ + + + + + + + + + + + + + + + + + + CodeInputs + + + + + + + + + + + + + + + + + + + + {x:Type visuals:CodeInput} + {StaticResource TextInputUniversal} + + + + + + + + + + TextBlock + + CaptionStyle + + + + TextElement.Foreground + + + CaptionForeground + + + + + + + + + + TextBlock + + LabelStyle + + + + TextElement.Foreground + + + LabelForeground + + + + + + + + + + + + TextInput_Background + BackgroundNormal + + + + + + TextInput_BorderBrush + BorderColorNormal + + + + + + TextInput_BorderThickness + + + + + + TextInput_CaretBrush + CaretBrush + + + + + + TextInput_CornerRadius + + + + + TextInput_Height + + + + + TextInput_Padding + + + + + TextInput_Placeholder_Foreground + PlaceholderForeground + + + + + + TextInput_PlaceholderStyle + + + + + + TextInput_CaptionStyle + CaptionStyle + + + + + TextInput_Caption_Margin + + + + + + TextInput_LabelStyle + LabelStyle + + + + + TextInput_Label_Margin + + + + + + TextInput_TextForeground + TextForeground + + + + + + TextInput_ValidationPopupStyle + + + + + + + + FontMode + Regular + + + + + TextInput_TextStyle + + + + + + + + + FontMode + Monospace + + + + + TextInput_TextStyle + + + + + + + + + visuals:StateService.TextInputState + Disabled + + + + + TextInput_Background + BackgroundDisabled + + + + + + TextInput_BorderBrush + BorderColorDisabled + + + + + + TextInput_BorderThickness + + + + + + TextInput_TextForeground + TextForegroundDisabled + + + + + + + + + visuals:StateService.TextInputState + Hover + + + + + TextInput_Background + BackgroundHover + + + + + + TextInput_BorderBrush + BorderColorHover + + + + + + TextInput_BorderThickness + + + + + + + + + visuals:StateService.TextInputState + Focus + + + + + TextInput_Background + BackgroundFocus + + + + + + TextInput_BorderBrush + BorderColorFocus + + + + + + TextInput_BorderThickness + + + + + + + + + visuals:StateService.TextInputState + InvalidNormal + + + + + TextInput_Background + BackgroundInvalidNormal + + + + + + TextInput_BorderBrush + BorderColorInvalidNormal + + + + + + TextInput_BorderThickness + + + + + + + + + visuals:StateService.TextInputState + InvalidHover + + + + + TextInput_Background + BackgroundInvalidHover + + + + + + TextInput_BorderBrush + BorderColorInvalidHover + + + + + + TextInput_BorderThickness + + + + + + + + + visuals:StateService.TextInputState + InvalidFocus + + + + + TextInput_Background + BackgroundInvalidFocus + + + + + + TextInput_BorderBrush + BorderColorInvalidFocus + + + + + + TextInput_BorderThickness + + + + + + + + + visuals:StateService.TextInputState + ReadOnly + + + + + TextInput_Background + BackgroundReadOnly + + + + + + TextInput_BorderBrush + BorderColorReadOnly + + + + + + TextInput_BorderThickness + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/Common.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/Common.xslt new file mode 100644 index 0000000..52db630 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/Common.xslt @@ -0,0 +1,1504 @@ + + + + + + + + + + + + + + + + #region + + + + #endregion + + + + + + [] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + lower + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Unable to generate MultiTrigger since conditions are not set. + + + + + + + + + + + + + + + + + + + + + + + + + Unable to generate MultiDataTrigger since conditions are not set. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + FocusVisualBrush + + + + + + + + + + + + + + + + + + + + FocusVisualBrush + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Svg + SvgImage + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Unable to generate Condition since both Binding and PropertyName are set. + + + + + + + + + + + + + + + + + + + + + + + + + + Unable to generate Binding since both PropertyName and Path are set. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Unable to generate CompactMultiBinding since at least Binding1 is not set. + + + + Unable to generate CompactMultiBinding since Converter is not set. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Self + + + + + + + + + + {RelativeSource PreviousData} + {RelativeSource TemplatedParent} + {RelativeSource Self} + + + + + + Unable to generate RelativeSource since AncestorType is not set. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Unable to generate UIKitSetter since property id is not set. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Unable to generate BrushSetter because propertyId and propertyName are set at the same time. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Shadow + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Container_Shadow + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + HorizontalContentAlignment + + + + + + + + + VerticalContentAlignment + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Auto + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Unable to split text since delimiter is not set. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + TextDecorations + + true + + + + + + + + + + + + + + + + + TextDecorations + TextDecorations + + true + + + + + + + + + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Palette + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + , + + + , + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + , + + + + + + + + ,,, + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + a + b + c + d + e + f + a + + + + + + + + + + + + + + + + + + + + + FontFamily + FontSize + FontStyle + FontWeight + + + + + + + + + + Fonts + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ContentButtonCustomizationDictionary.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ContentButtonCustomizationDictionary.xslt new file mode 100644 index 0000000..c032790 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ContentButtonCustomizationDictionary.xslt @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BackgroundDisabled + + + + + + BackgroundHover + + + + + + BackgroundNormal + + + + + + BackgroundPressed + + + + + + BorderDisabled + + + + + + BorderHover + + + + + + BorderNormal + + + + + + BorderPressed + + + + + + FocusVisualBrush + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ContentButtonStyle.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ContentButtonStyle.xslt new file mode 100644 index 0000000..56a9d4c --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ContentButtonStyle.xslt @@ -0,0 +1,187 @@ + + + + + + + + + + + + + + + + + + ContentButtons + + + + + + + + + + + + + + + + + + + + visuals:ContentButton + ContentButtonUniversal + + + + + + ContentButton_Background + BackgroundNormal + + + + + + ContentButton_BorderBrush + BorderNormal + + + + + + ContentButton_BorderThickness + + + + + + ContentButton_CornerRadius + + + + + ContentButton_FocusVisualStyle + + + + + + + + + + visuals:StateService.State + Disabled + + + + + ContentButton_Background + BackgroundDisabled + + + + + + ContentButton_BorderBrush + BorderDisabled + + + + + + ContentButton_BorderThickness + + + + + + + + + visuals:StateService.State + Hover + + + + + ContentButton_Background + BackgroundHover + + + + + + ContentButton_BorderBrush + BorderHover + + + + + + ContentButton_BorderThickness + + + + + + + + + visuals:StateService.State + Pressed + + + + + ContentButton_Background + BackgroundPressed + + + + + + ContentButton_BorderBrush + BorderPressed + + + + + + ContentButton_BorderThickness + + + + + + + + + + + + diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ContextMenuCustomizationDictionary.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ContextMenuCustomizationDictionary.xslt new file mode 100644 index 0000000..8f8a284 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ContextMenuCustomizationDictionary.xslt @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + PopupDecoratorBackground + + + + + + PopupDecoratorBorderColor + + + + + + PopupDecoratorShadow + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ContextMenuStyle.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ContextMenuStyle.xslt new file mode 100644 index 0000000..8360c5b --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ContextMenuStyle.xslt @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + ContextMenus + + + + + + + + + + + + + + + + + + + + visuals:ContextMenu + ContextMenuUniversal + + + + + + + + + visuals:ContextMenuPopupDecorator + PopupDecoratorUniversal + PopupDecoratorStyle + + + + + PopupDecorator_Background + PopupDecoratorBackground + + + + + + PopupDecorator_BorderBrush + PopupDecoratorBorderColor + + + + + + PopupDecorator_BorderThickness + + + + + + PopupDecorator_CornerRadius + + + + + + PopupDecorator_Padding + + + + + + PopupDecorator_Shadow + + + + + + + + + + + + ContextMenu_PopupDecoratorStyle + PopupDecoratorStyle + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/Core/CustomizationDictionaries.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/Core/CustomizationDictionaries.xslt new file mode 100644 index 0000000..09107cc --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/Core/CustomizationDictionaries.xslt @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/Core/Palettes.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/Core/Palettes.xslt new file mode 100644 index 0000000..e15c6bd --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/Core/Palettes.xslt @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/Core/Styles.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/Core/Styles.xslt new file mode 100644 index 0000000..9af5077 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/Core/Styles.xslt @@ -0,0 +1,169 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + External resource dictionaries are not set. + + + + External resource dictionaries delimiter is not set. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/DateTimeInputCustomizationDictionary.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/DateTimeInputCustomizationDictionary.xslt new file mode 100644 index 0000000..6c89319 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/DateTimeInputCustomizationDictionary.xslt @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + PopupDecoratorBackground + + + + + + PopupDecoratorBorderColor + + + + + + PopupDecoratorShadow + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/DateTimeInputStyle.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/DateTimeInputStyle.xslt new file mode 100644 index 0000000..4cda043 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/DateTimeInputStyle.xslt @@ -0,0 +1,144 @@ + + + + + + + + + + + + + + + + + + DateTimeInputs + + + + + + + + + + + + + + + + + + + + visuals:DateTimeInput + DateTimeInputUniversal + + + + + + + + + visuals:DateTimePopupDecorator + PopupDecoratorUniversal + PopupDecoratorStyle + + + + + PopupDecorator_Background + PopupDecoratorBackground + + + + + + PopupDecorator_BorderBrush + PopupDecoratorBorderColor + + + + + + PopupDecorator_BorderThickness + + + + + + PopupDecorator_CornerRadius + + + + + + PopupDecorator_Padding + + + + + + PopupDecorator_Shadow + + + + + + + + + + + + DateTimeInput_ActionDate_IconName + + + + + + DateTimeInput_ActionTime_IconName + + + + + + DateTimeInput_PopupDecoratorStyle + PopupDecoratorStyle + + + + + DateTimeInput_PopupPresenterStyle + + + + + + + + + + diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/DateTimePopupFooterButtonCustomizationDictionary.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/DateTimePopupFooterButtonCustomizationDictionary.xslt new file mode 100644 index 0000000..519ddfc --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/DateTimePopupFooterButtonCustomizationDictionary.xslt @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BackgroundHover + + + + + + BackgroundNormal + + + + + + BackgroundPressed + + + + + + BorderColorHover + + + + + + BorderColorNormal + + + + + + BorderColorPressed + + + + + + FocusVisualBrush + + + + + + IconBrush + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/DateTimePopupFooterButtonStyle.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/DateTimePopupFooterButtonStyle.xslt new file mode 100644 index 0000000..002f2c2 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/DateTimePopupFooterButtonStyle.xslt @@ -0,0 +1,174 @@ + + + + + + + + + + + + + + + + + + DateTimePopupFooterButtons + + + + + + + + + + + + + + + + + + + + visuals:DateTimePopupFooterButton + DateTimePopupFooterButtonUniversal + + + + + + DateTimePopupFooterButton_Background + BackgroundNormal + + + + + + DateTimePopupFooterButton_BorderBrush + BorderColorNormal + + + + + + DateTimePopupFooterButton_BorderThickness + BorderThicknessNormal + + + + + + DateTimePopupFooterButton_CornerRadius + + + + + DateTimePopupFooterButton_FocusVisualStyle + + + + + + DateTimePopupFooterButton_Height + + + + + + DateTimePopupFooterButton_IconBrush + IconBrush + + + + + + + + + + visuals:StateService.State + Hover + + + + + DateTimePopupFooterButton_Background + BackgroundHover + + + + + + DateTimePopupFooterButton_BorderBrush + BorderColorHover + + + + + + DateTimePopupFooterButton_BorderThickness + BorderThicknessHover + + + + + + + + + visuals:StateService.State + Pressed + + + + + DateTimePopupFooterButton_Background + BackgroundPressed + + + + + + DateTimePopupFooterButton_BorderBrush + BorderColorPressed + + + + + + DateTimePopupFooterButton_BorderThickness + BorderThicknessPressed + + + + + + + + + + + + diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/DateTimePopupItemButtonCustomizationDictionary.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/DateTimePopupItemButtonCustomizationDictionary.xslt new file mode 100644 index 0000000..a454cc3 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/DateTimePopupItemButtonCustomizationDictionary.xslt @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BackgroundHover + + + + + + BackgroundNormal + + + + + + BackgroundPressed + + + + + + BorderColorHover + + + + + + BorderColorNormal + + + + + + BorderColorPressed + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/DateTimePopupItemButtonStyle.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/DateTimePopupItemButtonStyle.xslt new file mode 100644 index 0000000..e44db54 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/DateTimePopupItemButtonStyle.xslt @@ -0,0 +1,165 @@ + + + + + + + + + + + + + + + + + + DateTimePopupItemButtons + + + + + + + + + + + + + + + + + + + + visuals:DateTimePopupItemButton + DateTimePopupItemButtonUniversal + + + + + + DateTimePopupItemButton_Background + BackgroundNormal + + + + + + DateTimePopupItemButton_BorderBrush + BorderColorNormal + + + + + + DateTimePopupItemButton_BorderThickness + BorderThicknessNormal + + + + + + DateTimePopupItemButton_CornerRadius + + + + + DateTimePopupItemButton_Margin + + + + + DateTimePopupItemButton_Padding + + + + + + + + + visuals:StateService.State + Hover + + + + + DateTimePopupItemButton_Background + BackgroundHover + + + + + + DateTimePopupItemButton_BorderBrush + BorderColorHover + + + + + + DateTimePopupItemButton_BorderThickness + BorderThicknessHover + + + + + + + + + visuals:StateService.State + Pressed + + + + + DateTimePopupItemButton_Background + BackgroundPressed + + + + + + DateTimePopupItemButton_BorderBrush + BorderColorPressed + + + + + + DateTimePopupItemButton_BorderThickness + BorderThicknessPressed + + + + + + + + + + + + diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/DateTimePopupPresenterCustomizationDictionary.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/DateTimePopupPresenterCustomizationDictionary.xslt new file mode 100644 index 0000000..faa14ae --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/DateTimePopupPresenterCustomizationDictionary.xslt @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ItemButtonTextForeground + + + + + + MarkerBackground + + + + + + MarkerBorderColor + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/DateTimePopupPresenterStyle.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/DateTimePopupPresenterStyle.xslt new file mode 100644 index 0000000..5bcf0b0 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/DateTimePopupPresenterStyle.xslt @@ -0,0 +1,182 @@ + + + + + + + + + + + + + + + + + + DateTimePopupPresenters + + + + + + + + + + + + + + + + + + + + visuals:DateTimePopupPresenter + DateTimePopupPresenterUniversal + + + + + + + + TextBlock + + ItemButtonTextStyle + + + + TextElement.Foreground + ItemButtonTextForeground + + + + + + + + + DateTimePopupPresenter_FooterButton_Cancel_IconName + + + + + + DateTimePopupPresenter_FooterButton_Cancel_Margin + + + + + + DateTimePopupPresenter_FooterButton_Confirm_IconName + + + + + + DateTimePopupPresenter_FooterButton_Confirm_Margin + + + + + + DateTimePopupPresenter_FooterButtonStyle + + + + + + DateTimePopupPresenter_SelectionMarker_Background + MarkerBackground + + + + + + DateTimePopupPresenter_SelectionMarker_BorderBrush + MarkerBorderColor + + + + + + DateTimePopupPresenter_SelectionMarker_BorderThickness + + + + + + DateTimePopupPresenter_SelectionMarker_CornerRadius + + + + + + DateTimePopupPresenter_SelectionMarker_Height + + + + + + DateTimePopupPresenter_SelectionMarker_Margin + + + + + + DateTimePopupPresenter_SelectorItem_ButtonStyle + + + + + + DateTimePopupPresenter_SelectorItem_Height + + + + + + DateTimePopupPresenter_SelectorItem_Padding + + + + + + DateTimePopupPresenter_SelectorItem_TextStyle + ItemButtonTextStyle + + + + + DateTimePopupPresenter_SelectorItem_Width + + + + + + + + + + diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/DividerCustomizationDictionary.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/DividerCustomizationDictionary.xslt new file mode 100644 index 0000000..4c7df69 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/DividerCustomizationDictionary.xslt @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Background + + + + + + + + Foreground + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/DividerStyle.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/DividerStyle.xslt new file mode 100644 index 0000000..589d997 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/DividerStyle.xslt @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + Dividers + + + + + + + + + + + + + + + + + + + + {x:Type visuals:Divider} + {StaticResource DividerUniversal} + + + + + + + + Divider_Background + + + Background + + + + + + + + + + Divider_Foreground + + + Foreground + + + + + + + + + + Divider_Thickness + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/HyperlinkCustomizationDictionary.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/HyperlinkCustomizationDictionary.xslt new file mode 100644 index 0000000..2af0347 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/HyperlinkCustomizationDictionary.xslt @@ -0,0 +1,141 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + FocusVisualBrush + + + + + + + + ForegroundDisabled + + + + + + + + ForegroundHover + + + + + + + + ForegroundNormal + + + + + + + + ForegroundPressed + + + + + + + + TextDecorationsDisabled + + 0 + + + + + + + + TextDecorationsHover + + 0 + + + + + + + + TextDecorationsNormal + + 0 + + + + + + + + TextDecorationsPressed + + 0 + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/HyperlinkStyle.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/HyperlinkStyle.xslt new file mode 100644 index 0000000..29841d3 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/HyperlinkStyle.xslt @@ -0,0 +1,197 @@ + + + + + + + + + + + + + + + + + + Hyperlinks + + + + + + + + + + + + + + + + + + + + Hyperlink + HyperlinkUniversal + + + + + + Hyperlink_FocusVisualStyle + + + + + + + Hyperlink_Foreground + + + ForegroundNormal + + + + + + + + + + + Hyperlink_TextDecoration + TextDecorationsNormal + + + + + + + + + + + + visuals:StateService.State + Disabled + + + + + + Hyperlink_Foreground + + + ForegroundDisabled + + + + + + + + + + + Hyperlink_TextDecoration + TextDecorationsDisabled + + + + + + + + + + + visuals:StateService.State + Hover + + + + + + Hyperlink_Foreground + + + ForegroundHover + + + + + + + + + + + Hyperlink_TextDecoration + TextDecorationsHover + + + + + + + + + + + visuals:StateService.State + Pressed + + + + + + Hyperlink_Foreground + + + ForegroundPressed + + + + + + + + + + + Hyperlink_TextDecoration + TextDecorationsPressed + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/IconButtonCustomizationDictionary.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/IconButtonCustomizationDictionary.xslt new file mode 100644 index 0000000..7e12401 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/IconButtonCustomizationDictionary.xslt @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BackgroundDisabled + + + + + + BackgroundHover + + + + + + BackgroundNormal + + + + + + BackgroundPressed + + + + + + BorderDisabled + + + + + + BorderHover + + + + + + BorderNormal + + + + + + BorderPressed + + + + + + FocusVisualBrush + + + + + + IconForeground + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/IconButtonStyle.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/IconButtonStyle.xslt new file mode 100644 index 0000000..04c4a14 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/IconButtonStyle.xslt @@ -0,0 +1,263 @@ + + + + + + + + + + + + + + + + + + IconButtons + + + + + + + + + + + + + + + + + + + + visuals:IconButtonBase + IconButtonUniversal + + + + + + IconButton_Background + BackgroundNormal + + + + + + IconButton_BorderBrush + BorderNormal + + + + + + IconButton_BorderThickness + + + + + + + + + + IconButton_CornerRadius + + + + + IconButton_FocusVisualStyle + + + + + + IconButton_Icon_Foreground + IconForeground + + + + + + IconButton_Icon_Opacity + + + + + + IconButton_Padding + + + + + + + + + visuals:StateService.State + Disabled + + + + + IconButton_Background + + + BackgroundDisabled + + + + + + + + IconButton_BorderBrush + + + BorderDisabled + + + + + + + + IconButton_BorderThickness + + + + + + + + + + IconButton_Icon_Opacity + + + + + + + + + visuals:StateService.State + Hover + + + + + IconButton_Background + + + BackgroundHover + + + + + + + + IconButton_BorderBrush + + + BorderHover + + + + + + + + IconButton_BorderThickness + + + + + + + + + + IconButton_Icon_Opacity + + + + + + + + + visuals:StateService.State + Pressed + + + + + IconButton_Background + + + BackgroundPressed + + + + + + + + IconButton_BorderBrush + + + BorderPressed + + + + + + + + IconButton_BorderThickness + + + + + + + + + + IconButton_Icon_Opacity + + + + + + + + + + + + diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/IconCustomizationDictionary.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/IconCustomizationDictionary.xslt new file mode 100644 index 0000000..ddd13e7 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/IconCustomizationDictionary.xslt @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Foreground + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/IconStyle.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/IconStyle.xslt new file mode 100644 index 0000000..7ef34ea --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/IconStyle.xslt @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + Icons + + + + + + + + + + + + + + + + + + + + visuals:IconBase + IconUniversal + + + + + + Icon_Foreground + Foreground + + + + + + + + + + diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ImageGalleryButtonCustomizationDictionary.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ImageGalleryButtonCustomizationDictionary.xslt new file mode 100644 index 0000000..31b46ba --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ImageGalleryButtonCustomizationDictionary.xslt @@ -0,0 +1,139 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BackgroundDisabled + + + + + + BackgroundHover + + + + + + BackgroundNormal + + + + + + BackgroundPressed + + + + + + BorderDisabled + + + + + + BorderHover + + + + + + BorderNormal + + + + + + BorderPressed + + + + + + FocusVisualBrush + + + + + + IconForegroundDisabled + + + + + + IconForegroundHover + + + + + + IconForegroundNormal + + + + + + IconForegroundPressed + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ImageGalleryButtonStyle.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ImageGalleryButtonStyle.xslt new file mode 100644 index 0000000..3d8066a --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ImageGalleryButtonStyle.xslt @@ -0,0 +1,231 @@ + + + + + + + + + + + + + + + + + + ImageGalleryButtons + + + + + + + + + + + + + + + + + + + + visuals:ImageGalleryButton + ImageGalleryButtonUniversal + + + + + + ImageGalleryButton_Background + BackgroundNormal + + + + + + ImageGalleryButton_BorderBrush + BorderNormal + + + + + + ImageGalleryButton_BorderThickness + BorderThicknessNormal + + + + + + ImageGalleryButton_CornerRadius + + + + + ImageGalleryButton_FocusVisualStyle + + + + + + ImageGalleryButton_Height + + + + + + ImageGalleryButton_Icon_Foreground + IconForegroundNormal + + + + + + ImageGalleryButton_Width + + + + + + + + + + visuals:StateService.State + Disabled + + + + + ImageGalleryButton_Background + BackgroundDisabled + + + + + + ImageGalleryButton_BorderBrush + BorderDisabled + + + + + + ImageGalleryButton_BorderThickness + BorderThicknessDisabled + + + + + + ImageGalleryButton_Icon_Foreground + IconForegroundDisabled + + + + + + + + + visuals:StateService.State + Hover + + + + + ImageGalleryButton_Background + BackgroundHover + + + + + + ImageGalleryButton_BorderBrush + BorderHover + + + + + + ImageGalleryButton_BorderThickness + BorderThicknessHover + + + + + + ImageGalleryButton_Icon_Foreground + IconForegroundHover + + + + + + + + + visuals:StateService.State + Pressed + + + + + ImageGalleryButton_Background + BackgroundPressed + + + + + + ImageGalleryButton_BorderBrush + BorderPressed + + + + + + ImageGalleryButton_BorderThickness + BorderThicknessPressed + + + + + + ImageGalleryButton_Icon_Foreground + IconForegroundPressed + + + + + + + + + + + + diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ImageGalleryCustomizationDictionary.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ImageGalleryCustomizationDictionary.xslt new file mode 100644 index 0000000..97c67ea --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ImageGalleryCustomizationDictionary.xslt @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CarouselContainerBackground + + + + + + CounterContainerBackground + + + + + + CounterTextForeground + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ImageGalleryListButtonCustomizationDictionary.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ImageGalleryListButtonCustomizationDictionary.xslt new file mode 100644 index 0000000..f55ab2d --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ImageGalleryListButtonCustomizationDictionary.xslt @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BackgroundHover + + + + + + BackgroundNormal + + + + + + BackgroundPressed + + + + + + BorderHover + + + + + + BorderNormal + + + + + + BorderPressed + + + + + + FocusVisualBrush + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ImageGalleryListButtonStyle.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ImageGalleryListButtonStyle.xslt new file mode 100644 index 0000000..9f19379 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ImageGalleryListButtonStyle.xslt @@ -0,0 +1,156 @@ + + + + + + + + + + + + + + + + + + ImageGalleryListButtons + + + + + + + + + + + + + + + + + + + + visuals:ImageGalleryListButton + ImageGalleryListButtonUniversal + + + + + + ImageGalleryListButton_Background + BackgroundNormal + + + + + + ImageGalleryListButton_BorderBrush + BorderNormal + + + + + + ImageGalleryListButton_BorderThickness + BorderThicknessNormal + + + + + + ImageGalleryListButton_FocusVisualStyle + + + + + + + + + + visuals:StateService.State + Hover + + + + + ImageGalleryListButton_Background + BackgroundHover + + + + + + ImageGalleryListButton_BorderBrush + BorderHover + + + + + + ImageGalleryListButton_BorderThickness + BorderThicknessHover + + + + + + + + + visuals:StateService.State + Pressed + + + + + ImageGalleryListButton_Background + BackgroundPressed + + + + + + ImageGalleryListButton_BorderBrush + BorderPressed + + + + + + ImageGalleryListButton_BorderThickness + BorderThicknessPressed + + + + + + + + + + + + diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ImageGalleryListStyle.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ImageGalleryListStyle.xslt new file mode 100644 index 0000000..9774dd1 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ImageGalleryListStyle.xslt @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + ImageGalleryLists + + + + + + + + + + + + + + + + + + + + visuals:ImageGalleryList + ImageGalleryListUniversal + + + + + + + + visuals:ImageGalleryListButton + + ImageButtonStyle + + + + visuals:ImageGalleryButton + + LeftButtonStyle + + + + Icon + + + + + + + visuals:ImageGalleryButton + + RightButtonStyle + + + + Icon + + + + + + + + + ImageGalleryList_ImageButtonStyle + ImageButtonStyle + + + + + ImageGalleryList_ImageGap + + + + + + ImageGalleryList_LeftButton_Margin + + + + + + ImageGalleryList_LeftButtonStyle + LeftButtonStyle + + + + + ImageGalleryList_RightButton_Margin + + + + + + ImageGalleryList_RightButtonStyle + RightButtonStyle + + + + + + + + + diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ImageGalleryStyle.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ImageGalleryStyle.xslt new file mode 100644 index 0000000..756e80f --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ImageGalleryStyle.xslt @@ -0,0 +1,245 @@ + + + + + + + + + + + + + + + + + + ImageGalleries + + + + + + + + + + + + + + + + + + + + + + visuals:ImageGallery + ImageGalleryUniversal + + + + + + + + + Item + + + + + + + visuals:Carousel + + CarouselStyle + + + + + TextBlock + + CounterTextStyle + + + + TextElement.Foreground + + + CounterTextForeground + + + + + + + + + + visuals:ImageGalleryButton + + CloseButtonStyle + + + + Icon + + + + + + + + visuals:ImageGalleryButton + + LeftButtonStyle + + + + Icon + + + + + + + + visuals:ImageGalleryButton + + RightButtonStyle + + + + Icon + + + + + + + + + ImageGallery_CarouselContainer_Background + CarouselContainerBackground + + + + + + ImageGallery_CarouselContainer_CornerRadius + + + + + + ImageGallery_CarouselContainer_Margin + + + + + + ImageGallery_CarouselContainer_Padding + + + + + + ImageGallery_CarouselStyle + CarouselStyle + + + + + ImageGallery_CloseButton_Margin + + + + + + ImageGallery_CloseButtonStyle + CloseButtonStyle + + + + + ImageGallery_CounterContainer_Background + CounterContainerBackground + + + + + + ImageGallery_CounterContainer_CornerRadius + + + + + + ImageGallery_CounterContainer_Margin + + + + + + ImageGallery_CounterContainer_Padding + + + + + + ImageGallery_CounterTextStyle + CounterTextStyle + + + + + ImageGallery_LeftButton_Margin + + + + + + ImageGallery_LeftButtonStyle + LeftButtonStyle + + + + + ImageGallery_RightButton_Margin + + + + + + ImageGallery_RightButtonStyle + RightButtonStyle + + + + + + + + + diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/InteractivityDialogCustomizationDictionary.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/InteractivityDialogCustomizationDictionary.xslt new file mode 100644 index 0000000..b6d1aca --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/InteractivityDialogCustomizationDictionary.xslt @@ -0,0 +1,151 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Background + + + + + + BorderColor + + + + + + ButtonForeground + + + + + + HeaderForeground + + + + + + StatusBackgroundDanger + + + + + + StatusBackgroundInfo + + + + + + StatusBackgroundLoading + + + + + + StatusBackgroundPositive + + + + + + StatusBackgroundWarning + + + + + + StatusForegroundDanger + + + + + + StatusForegroundInfo + + + + + + StatusForegroundPositive + + + + + + StatusForegroundWarning + + + + + + SubHeaderForeground + + + + + + TextForeground + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/InteractivityDialogStyle.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/InteractivityDialogStyle.xslt new file mode 100644 index 0000000..ebb4fd9 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/InteractivityDialogStyle.xslt @@ -0,0 +1,524 @@ + + + + + + + + + + + + + + + + + + InteractivityDialogs + + + + + + + + + + + + + + + + + + + + visuals:InteractivityDialog + InteractivityDialogUniversal + + + + + + + + + visuals:IconButton + + ButtonStyle + + + + + IconForeground + + + ButtonForeground + + + + + + + + + + + + visuals:InteractivityDialogFooter + InteractivityDialogFooterUniversal + FooterStyle + + + + InteractivityDialogFooter_ButtonMargin + + + + + InteractivityDialogFooter_PrimaryButtonStyle + + + + + InteractivityDialogFooter_ReferenceButtonStyle + + + + + InteractivityDialogFooter_SecondaryButtonStyle + + + + + + + + TextBlock + + HeaderStyle + + + + TextElement.Foreground + + + HeaderForeground + + + + + + + + + + TextBlock + + SubHeaderStyle + + + + TextElement.Foreground + + + SubHeaderForeground + + + + + + + + + + TextBlock + + TextStyle + + + + TextElement.Foreground + + + TextForeground + + + + + + + + + + + + InteractivityDialog_Background + Background + + + + + + InteractivityDialog_BorderBrush + BorderColor + + + + + + InteractivityDialog_BorderThickness + + + + + InteractivityDialog_Button_CloseIcon + + + + + + InteractivityDialog_Button_HelpIcon + + + + + + InteractivityDialog_Button_Margin + + + + + + InteractivityDialog_Button_Style + ButtonStyle + + + + + InteractivityDialog_ButtonsContainer_Margin + + + + + + InteractivityDialog_ContentContainer_Margin + + + + + + InteractivityDialog_CornerRadius + + + + + InteractivityDialog_DescriptionStyle + TextStyle + + + + + InteractivityDialog_Description_Margin + + + + + + InteractivityDialog_FooterContainer_Margin + + + + + + InteractivityDialog_FooterStyle + FooterStyle + + + + + InteractivityDialog_HeaderContainer_Margin + + + + + + InteractivityDialog_Header_Margin + + + + + + InteractivityDialog_HeaderStyle + HeaderStyle + + + + + InteractivityDialog_Icon_Height + + + + + + InteractivityDialog_Icon_Margin + + + + + + InteractivityDialog_Icon_Width + + + + + + InteractivityDialog_Margin + + + + + InteractivityDialog_InteractivityOverlayStyle + + + + + + InteractivityDialog_Padding + + + + + InteractivityDialog_Spinner_Style + + + + + + InteractivityDialog_Status_Background_Height + + + + + + InteractivityDialog_Status_Background_Width + + + + + + InteractivityDialog_SubHeader_Margin + + + + + + InteractivityDialog_SubHeaderStyle + SubHeaderStyle + + + + + + + + + Type + Danger + + + + + InteractivityDialog_Status_Background + StatusBackgroundDanger + + + + + + InteractivityDialog_Status_Foreground + StatusForegroundDanger + + + + + + InteractivityDialog_Status_IconName + + + + + + + + + Type + Info + + + + + InteractivityDialog_Status_Background + StatusBackgroundInfo + + + + + + InteractivityDialog_Status_Foreground + StatusForegroundInfo + + + + + + InteractivityDialog_Status_IconName + + + + + + + + + Type + Loading + + + + + InteractivityDialog_Status_Background + StatusBackgroundLoading + + + + + + + + + Type + Positive + + + + + InteractivityDialog_Status_Background + StatusBackgroundPositive + + + + + + InteractivityDialog_Status_Foreground + StatusForegroundPositive + + + + + + InteractivityDialog_Status_IconName + + + + + + + + + Type + Warning + + + + + InteractivityDialog_Status_Background + StatusBackgroundWarning + + + + + + InteractivityDialog_Status_Foreground + StatusForegroundWarning + + + + + + InteractivityDialog_Status_IconName + + + + + + + + + DialogSize + Standard + + + + + InteractivityDialog_Width + + + + + + + + + DialogSize + Medium + + + + + InteractivityDialog_Width + + + + + + + + + DialogSize + Wide + + + + + InteractivityDialog_Width + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/InteractivityNotificationCustomizationDictionary.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/InteractivityNotificationCustomizationDictionary.xslt new file mode 100644 index 0000000..198c6c2 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/InteractivityNotificationCustomizationDictionary.xslt @@ -0,0 +1,118 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Background + + + + + + BorderColor + + + + + + CloseButtonForeground + + + + + + IconForeground + + + + + + + + + StatusForegroundDanger + + + + + + StatusForegroundInfo + + + + + + StatusForegroundPositive + + + + + + StatusForegroundWarning + + + + + + TextForeground + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/InteractivityNotificationStyle.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/InteractivityNotificationStyle.xslt new file mode 100644 index 0000000..676a5ad --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/InteractivityNotificationStyle.xslt @@ -0,0 +1,313 @@ + + + + + + + + + + + + + + + + + + InteractivityNotifications + + + + + + + + + + + + + + + + + + + + visuals:InteractivityNotification + InteractivityNotificationUniversal + + + + + + + + TextBlock + + TextStyle + + + + + TextElement.Foreground + TextForeground + + + + + + + + + visuals:IconButton + + CloseButtonStyle + + + + + Icon + + + + + + IconForeground + CloseButtonForeground + + + + + + + + + + InteractivityNotification_ActionButton_ButtonStyle + + + + + + InteractivityNotification_ActionButton_Margin + + + + + + InteractivityNotification_ActionButton_MaxWidth + + + + + + InteractivityNotification_Background + Background + + + + + + InteractivityNotification_BorderBrush + BorderColor + + + + + + InteractivityNotification_BorderThickness + + + + + + InteractivityNotification_CloseButtton_Margin + + + + + + InteractivityNotification_CloseButttonStyle + CloseButtonStyle + + + + + InteractivityNotification_Content_Margin + + + + + + InteractivityNotification_CornerRadius + + + + + InteractivityNotification_Icon_Foreground + IconForeground + + + + + + InteractivityNotification_Icon_Margin + + + + + + InteractivityNotification_Margin + + + + + InteractivityNotification_Padding + + + + + InteractivityNotification_Shadow + + + + + + InteractivityNotification_Text_Margin + + + + + + InteractivityNotification_Text_MaxWidth + + + + + + InteractivityNotification_Text_MaxHeight + + + + + + InteractivityNotification_TextStyle + TextStyle + + + + + + + + + Type + Danger + + + + + InteractivityNotification_Status_Foreground + StatusForegroundDanger + + + + + + InteractivityNotification_Status_IconName + + + + + + + + + Type + Info + + + + + InteractivityNotification_Status_Foreground + StatusForegroundInfo + + + + + + InteractivityNotification_Status_IconName + + + + + + + + + Type + Positive + + + + + InteractivityNotification_Status_Foreground + StatusForegroundPositive + + + + + + InteractivityNotification_Status_IconName + + + + + + + + + Type + Warning + + + + + InteractivityNotification_Status_Foreground + StatusForegroundWarning + + + + + + InteractivityNotification_Status_IconName + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/InteractivityOverlayCustomizationDictionary.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/InteractivityOverlayCustomizationDictionary.xslt new file mode 100644 index 0000000..cb5320f --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/InteractivityOverlayCustomizationDictionary.xslt @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Background + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/InteractivityOverlayStyle.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/InteractivityOverlayStyle.xslt new file mode 100644 index 0000000..098570a --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/InteractivityOverlayStyle.xslt @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + InteractivityOverlays + + + + + + + + + + + + + + + + + + + + visuals:InteractivityOverlay + InteractivityOverlayUniversal + + + + + + InteractivityOverlay_Background + Background + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/IslandButtonCustomizationDictionary.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/IslandButtonCustomizationDictionary.xslt new file mode 100644 index 0000000..7aea2c6 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/IslandButtonCustomizationDictionary.xslt @@ -0,0 +1,547 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BackgroundElevationDisabledLevel1 + + + + + + BackgroundElevationDisabledLevel2 + + + + + + BackgroundElevationHoverLevel1 + + + + + + BackgroundElevationHoverLevel2 + + + + + + BackgroundElevationNormalLevel1 + + + + + + BackgroundElevationNormalLevel2 + + + + + + BackgroundElevationPressedLevel1 + + + + + + BackgroundElevationPressedLevel2 + + + + + + BackgroundPrimaryDisabledLevel1 + + + + + + BackgroundPrimaryDisabledLevel2 + + + + + + BackgroundPrimaryHoverLevel1 + + + + + + BackgroundPrimaryHoverLevel2 + + + + + + BackgroundPrimaryNormalLevel1 + + + + + + BackgroundPrimaryNormalLevel2 + + + + + + BackgroundPrimaryPressedLevel1 + + + + + + BackgroundPrimaryPressedLevel2 + + + + + + BackgroundSecondaryDisabledLevel1 + + + + + + BackgroundSecondaryDisabledLevel2 + + + + + + BackgroundSecondaryHoverLevel1 + + + + + + BackgroundSecondaryHoverLevel2 + + + + + + BackgroundSecondaryNormalLevel1 + + + + + + BackgroundSecondaryNormalLevel2 + + + + + + BackgroundSecondaryPressedLevel1 + + + + + + BackgroundSecondaryPressedLevel2 + + + + + + BorderColorElevationDisabledLevel1 + + + + + + BorderColorElevationDisabledLevel2 + + + + + + BorderColorElevationHoverLevel1 + + + + + + BorderColorElevationHoverLevel2 + + + + + + BorderColorElevationNormalLevel1 + + + + + + BorderColorElevationNormalLevel2 + + + + + + BorderColorElevationPressedLevel1 + + + + + + BorderColorElevationPressedLevel2 + + + + + + BorderColorPrimaryDisabledLevel1 + + + + + + BorderColorPrimaryDisabledLevel2 + + + + + + BorderColorPrimaryHoverLevel1 + + + + + + BorderColorPrimaryHoverLevel2 + + + + + + BorderColorPrimaryNormalLevel1 + + + + + + BorderColorPrimaryNormalLevel2 + + + + + + BorderColorPrimaryPressedLevel1 + + + + + + BorderColorPrimaryPressedLevel2 + + + + + + BorderColorSecondaryDisabledLevel1 + + + + + + BorderColorSecondaryDisabledLevel2 + + + + + + BorderColorSecondaryHoverLevel1 + + + + + + BorderColorSecondaryHoverLevel2 + + + + + + BorderColorSecondaryNormalLevel1 + + + + + + BorderColorSecondaryNormalLevel2 + + + + + + BorderColorSecondaryPressedLevel1 + + + + + + BorderColorSecondaryPressedLevel2 + + + + + + FocusVisualBrush + + + + + + + ShadowElevationDisabledLevel1 + + + + + + + + ShadowElevationDisabledLevel2 + + + + + + + + ShadowElevationHoverLevel1 + + + + + + + + ShadowElevationHoverLevel2 + + + + + + + + ShadowElevationNormalLevel1 + + + + + + + + ShadowElevationNormalLevel2 + + + + + + + + ShadowElevationPressedLevel1 + + + + + + + + ShadowElevationPressedLevel2 + + + + + + + + ShadowPrimaryDisabledLevel1 + + + + + + + + ShadowPrimaryDisabledLevel2 + + + + + + + + ShadowPrimaryHoverLevel1 + + + + + + + + ShadowPrimaryHoverLevel2 + + + + + + + + ShadowPrimaryNormalLevel1 + + + + + + + + ShadowPrimaryNormalLevel2 + + + + + + + + ShadowPrimaryPressedLevel1 + + + + + + + + ShadowPrimaryPressedLevel2 + + + + + + + + ShadowSecondaryDisabledLevel1 + + + + + + + + ShadowSecondaryDisabledLevel2 + + + + + + + + ShadowSecondaryHoverLevel1 + + + + + + + + ShadowSecondaryHoverLevel2 + + + + + + + + ShadowSecondaryNormalLevel1 + + + + + + + + ShadowSecondaryNormalLevel2 + + + + + + + + ShadowSecondaryPressedLevel1 + + + + + + + + ShadowSecondaryPressedLevel2 + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/IslandButtonStyle.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/IslandButtonStyle.xslt new file mode 100644 index 0000000..16f2907 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/IslandButtonStyle.xslt @@ -0,0 +1,1783 @@ + + + + + + + + + + + + + + + + + + IslandButtons + + + + + + + + + + + + + + + + + + + + visuals:IslandButton + IslandButtonUniversal + + + + + + + IslandButton_Padding + + + + + + + + + Level + First + + + + + IslandButton_FocusVisualStyle + + + + + + + IslandButton_CornerRadius + + + + + + + + + Level + Second + + + + + IslandButton_FocusVisualStyle + + + + + + + IslandButton_CornerRadius + + + + + + + + + + + + + + visuals:StateService.State + Normal + + + + + Level + First + + + + + Type + Elevation + + + + + + + + + IslandButton_Background + + + BackgroundElevationNormalLevel1 + + + + + + + + IslandButton_BorderBrush + + + BorderColorElevationNormalLevel1 + + + + + + + + IslandButton_BorderThickness + + + + + + + + + + IslandButton_Shadow + + + + + + + + + + + + + + + visuals:StateService.State + Hover + + + + + Level + First + + + + + Type + Elevation + + + + + + + + + IslandButton_Background + + + BackgroundElevationHoverLevel1 + + + + + + + + IslandButton_BorderBrush + + + BorderColorElevationHoverLevel1 + + + + + + + + IslandButton_BorderThickness + + + + + + + + + + IslandButton_Shadow + + + + + + + + + + + + + + + visuals:StateService.State + Pressed + + + + + Level + First + + + + + Type + Elevation + + + + + + + + + IslandButton_Background + + + BackgroundElevationPressedLevel1 + + + + + + + + IslandButton_BorderBrush + + + BorderColorElevationPressedLevel1 + + + + + + + + IslandButton_BorderThickness + + + + + + + + + + IslandButton_Shadow + + + + + + + + + + + + + + + visuals:StateService.State + Disabled + + + + + Level + First + + + + + Type + Elevation + + + + + + + + + IslandButton_Background + + + BackgroundElevationDisabledLevel1 + + + + + + + + IslandButton_BorderBrush + + + BorderColorElevationDisabledLevel1 + + + + + + + + IslandButton_BorderThickness + + + + + + + + + + IslandButton_Shadow + + + + + + + + + + + + + + + + visuals:StateService.State + Normal + + + + + Level + Second + + + + + Type + Elevation + + + + + + + + + IslandButton_Background + + + BackgroundElevationNormalLevel2 + + + + + + + + IslandButton_BorderBrush + + + BorderColorElevationNormalLevel2 + + + + + + + + IslandButton_BorderThickness + + + + + + + + + + IslandButton_Shadow + + + + + + + + + + + + + + + visuals:StateService.State + Hover + + + + + Level + Second + + + + + Type + Elevation + + + + + + + + + IslandButton_Background + + + BackgroundElevationHoverLevel2 + + + + + + + + IslandButton_BorderBrush + + + BorderColorElevationHoverLevel2 + + + + + + + + IslandButton_BorderThickness + + + + + + + + + + IslandButton_Shadow + + + + + + + + + + + + + + + visuals:StateService.State + Pressed + + + + + Level + Second + + + + + Type + Elevation + + + + + + + + + IslandButton_Background + + + BackgroundElevationPressedLevel2 + + + + + + + + IslandButton_BorderBrush + + + BorderColorElevationPressedLevel2 + + + + + + + + IslandButton_BorderThickness + + + + + + + + + + IslandButton_Shadow + + + + + + + + + + + + + + + visuals:StateService.State + Disabled + + + + + Level + Second + + + + + Type + Elevation + + + + + + + + + IslandButton_Background + + + BackgroundElevationDisabledLevel2 + + + + + + + + IslandButton_BorderBrush + + + BorderColorElevationDisabledLevel2 + + + + + + + + IslandButton_BorderThickness + + + + + + + + + + IslandButton_Shadow + + + + + + + + + + + + + + + + visuals:StateService.State + Normal + + + + + Level + First + + + + + Type + Primary + + + + + + + + + IslandButton_Background + + + BackgroundPrimaryNormalLevel1 + + + + + + + + IslandButton_BorderBrush + + + BorderColorPrimaryNormalLevel1 + + + + + + + + IslandButton_BorderThickness + + + + + + + + + + IslandButton_Shadow + + + + + + + + + + + + + + + visuals:StateService.State + Hover + + + + + Level + First + + + + + Type + Primary + + + + + + + + + IslandButton_Background + + + BackgroundPrimaryHoverLevel1 + + + + + + + + IslandButton_BorderBrush + + + BorderColorPrimaryHoverLevel1 + + + + + + + + IslandButton_BorderThickness + + + + + + + + + + IslandButton_Shadow + + + + + + + + + + + + + + + visuals:StateService.State + Pressed + + + + + Level + First + + + + + Type + Primary + + + + + + + + + IslandButton_Background + + + BackgroundPrimaryPressedLevel1 + + + + + + + + IslandButton_BorderBrush + + + BorderColorPrimaryPressedLevel1 + + + + + + + + IslandButton_BorderThickness + + + + + + + + + + IslandButton_Shadow + + + + + + + + + + + + + + + visuals:StateService.State + Disabled + + + + + Level + First + + + + + Type + Primary + + + + + + + + + IslandButton_Background + + + BackgroundPrimaryDisabledLevel1 + + + + + + + + IslandButton_BorderBrush + + + BorderColorPrimaryDisabledLevel1 + + + + + + + + IslandButton_BorderThickness + + + + + + + + + + IslandButton_Shadow + + + + + + + + + + + + + + + + visuals:StateService.State + Normal + + + + + Level + Second + + + + + Type + Primary + + + + + + + + + IslandButton_Background + + + BackgroundPrimaryNormalLevel2 + + + + + + + + IslandButton_BorderBrush + + + BorderColorPrimaryNormalLevel2 + + + + + + + + IslandButton_BorderThickness + + + + + + + + + + IslandButton_Shadow + + + + + + + + + + + + + + + visuals:StateService.State + Hover + + + + + Level + Second + + + + + Type + Primary + + + + + + + + + IslandButton_Background + + + BackgroundPrimaryHoverLevel2 + + + + + + + + IslandButton_BorderBrush + + + BorderColorPrimaryHoverLevel2 + + + + + + + + IslandButton_BorderThickness + + + + + + + + + + IslandButton_Shadow + + + + + + + + + + + + + + + visuals:StateService.State + Pressed + + + + + Level + Second + + + + + Type + Primary + + + + + + + + + IslandButton_Background + + + BackgroundPrimaryPressedLevel2 + + + + + + + + IslandButton_BorderBrush + + + BorderColorPrimaryPressedLevel2 + + + + + + + + IslandButton_BorderThickness + + + + + + + + + + IslandButton_Shadow + + + + + + + + + + + + + + + visuals:StateService.State + Disabled + + + + + Level + Second + + + + + Type + Primary + + + + + + + + + IslandButton_Background + + + BackgroundPrimaryDisabledLevel2 + + + + + + + + IslandButton_BorderBrush + + + BorderColorPrimaryDisabledLevel2 + + + + + + + + IslandButton_BorderThickness + + + + + + + + + + IslandButton_Shadow + + + + + + + + + + + + + + + + visuals:StateService.State + Normal + + + + + Level + First + + + + + Type + Secondary + + + + + + + + + IslandButton_Background + + + BackgroundSecondaryNormalLevel1 + + + + + + + + IslandButton_BorderBrush + + + BorderColorSecondaryNormalLevel1 + + + + + + + + IslandButton_BorderThickness + + + + + + + + + + IslandButton_Shadow + + + + + + + + + + + + + + + visuals:StateService.State + Hover + + + + + Level + First + + + + + Type + Secondary + + + + + + + + + IslandButton_Background + + + BackgroundSecondaryHoverLevel1 + + + + + + + + IslandButton_BorderBrush + + + BorderColorSecondaryHoverLevel1 + + + + + + + + IslandButton_BorderThickness + + + + + + + + + + IslandButton_Shadow + + + + + + + + + + + + + + + visuals:StateService.State + Pressed + + + + + Level + First + + + + + Type + Secondary + + + + + + + + + IslandButton_Background + + + BackgroundSecondaryPressedLevel1 + + + + + + + + IslandButton_BorderBrush + + + BorderColorSecondaryPressedLevel1 + + + + + + + + IslandButton_BorderThickness + + + + + + + + + + IslandButton_Shadow + + + + + + + + + + + + + + + visuals:StateService.State + Disabled + + + + + Level + First + + + + + Type + Secondary + + + + + + + + + IslandButton_Background + + + BackgroundSecondaryDisabledLevel1 + + + + + + + + IslandButton_BorderBrush + + + BorderColorSecondaryDisabledLevel1 + + + + + + + + IslandButton_BorderThickness + + + + + + + + + + IslandButton_Shadow + + + + + + + + + + + + + + + + visuals:StateService.State + Normal + + + + + Level + Second + + + + + Type + Secondary + + + + + + + + + IslandButton_Background + + + BackgroundSecondaryNormalLevel2 + + + + + + + + IslandButton_BorderBrush + + + BorderColorSecondaryNormalLevel2 + + + + + + + + IslandButton_BorderThickness + + + + + + + + + + IslandButton_Shadow + + + + + + + + + + + + + + + visuals:StateService.State + Hover + + + + + Level + Second + + + + + Type + Secondary + + + + + + + + + IslandButton_Background + + + BackgroundSecondaryHoverLevel2 + + + + + + + + IslandButton_BorderBrush + + + BorderColorSecondaryHoverLevel2 + + + + + + + + IslandButton_BorderThickness + + + + + + + + + + IslandButton_Shadow + + + + + + + + + + + + + + + visuals:StateService.State + Pressed + + + + + Level + Second + + + + + Type + Secondary + + + + + + + + + IslandButton_Background + + + BackgroundSecondaryPressedLevel2 + + + + + + + + IslandButton_BorderBrush + + + BorderColorSecondaryPressedLevel2 + + + + + + + + IslandButton_BorderThickness + + + + + + + + + + IslandButton_Shadow + + + + + + + + + + + + + + + visuals:StateService.State + Disabled + + + + + Level + Second + + + + + Type + Secondary + + + + + + + + + IslandButton_Background + + + BackgroundSecondaryDisabledLevel2 + + + + + + + + IslandButton_BorderBrush + + + BorderColorSecondaryDisabledLevel2 + + + + + + + + IslandButton_BorderThickness + + + + + + + + + + IslandButton_Shadow + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/IslandCustomizationDictionary.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/IslandCustomizationDictionary.xslt new file mode 100644 index 0000000..5efe16f --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/IslandCustomizationDictionary.xslt @@ -0,0 +1,181 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BackgroundElevationLevel1 + + + + + + BackgroundElevationLevel2 + + + + + + BackgroundPrimaryLevel1 + + + + + + BackgroundPrimaryLevel2 + + + + + + BackgroundSecondaryLevel1 + + + + + + BackgroundSecondaryLevel2 + + + + + + BorderColorElevationLevel1 + + + + + + BorderColorElevationLevel2 + + + + + + BorderColorPrimaryLevel1 + + + + + + BorderColorPrimaryLevel2 + + + + + + BorderColorSecondaryLevel1 + + + + + + BorderColorSecondaryLevel2 + + + + + + + ShadowElevationLevel1 + + + + + + + + ShadowElevationLevel2 + + + + + + + + ShadowPrimaryLevel1 + + + + + + + + ShadowPrimaryLevel2 + + + + + + + + ShadowSecondaryLevel1 + + + + + + + + ShadowSecondaryLevel2 + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/IslandStyle.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/IslandStyle.xslt new file mode 100644 index 0000000..f3ce5b4 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/IslandStyle.xslt @@ -0,0 +1,490 @@ + + + + + + + + + + + + + + + + + + Islands + + + + + + + + + + + + + + + + + + + + visuals:Island + IslandUniversal + + + + + + + Island_Padding + + + + + + + + + + + + + Level + First + + + + + Type + Elevation + + + + + + + + + Island_Background + + + BackgroundElevationLevel1 + + + + + + + + Island_BorderBrush + + + BorderColorElevationLevel1 + + + + + + + + Island_BorderThickness + + + + + + + + + + Island_CornerRadius + + + + + + Island_Shadow + + + + + + + + + + + + + + + Level + Second + + + + + Type + Elevation + + + + + + + + + Island_Background + + + BackgroundElevationLevel2 + + + + + + + + Island_BorderBrush + + + BorderColorElevationLevel2 + + + + + + + + Island_BorderThickness + + + + + + + + + + Island_CornerRadius + + + + + + Island_Shadow + + + + + + + + + + + + + + + Level + First + + + + + Type + Primary + + + + + + + + + Island_Background + + + BackgroundPrimaryLevel1 + + + + + + + + Island_BorderBrush + + + BorderColorPrimaryLevel1 + + + + + + + + Island_BorderThickness + + + + + + + + + + Island_CornerRadius + + + + + + Island_Shadow + + + + + + + + + + + + + + + Level + Second + + + + + Type + Primary + + + + + + + + + Island_Background + + + BackgroundPrimaryLevel2 + + + + + + + + Island_BorderBrush + + + BorderColorPrimaryLevel2 + + + + + + + + Island_BorderThickness + + + + + + + + + + Island_CornerRadius + + + + + + Island_Shadow + + + + + + + + + + + + + + + Level + First + + + + + Type + Secondary + + + + + + + + + Island_Background + + + BackgroundSecondaryLevel1 + + + + + + + + Island_BorderBrush + + + BorderColorSecondaryLevel1 + + + + + + + + Island_BorderThickness + + + + + + + + + + Island_CornerRadius + + + + + + Island_Shadow + + + + + + + + + + + + + + + Level + Second + + + + + Type + Secondary + + + + + + + + + Island_Background + + + BackgroundSecondaryLevel2 + + + + + + + + Island_BorderBrush + + + BorderColorSecondaryLevel2 + + + + + + + + Island_BorderThickness + + + + + + + + + + Island_CornerRadius + + + + + + Island_Shadow + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/IslandToggleButtonCustomizationDictionary.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/IslandToggleButtonCustomizationDictionary.xslt new file mode 100644 index 0000000..21778d5 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/IslandToggleButtonCustomizationDictionary.xslt @@ -0,0 +1,1027 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BackgroundElevationDisabledCheckedLevel1 + + + + + + BackgroundElevationDisabledCheckedLevel2 + + + + + + BackgroundElevationDisabledLevel1 + + + + + + BackgroundElevationDisabledLevel2 + + + + + + BackgroundElevationHoverCheckedLevel1 + + + + + + BackgroundElevationHoverCheckedLevel2 + + + + + + BackgroundElevationHoverLevel1 + + + + + + BackgroundElevationHoverLevel2 + + + + + + BackgroundElevationNormalCheckedLevel1 + + + + + + BackgroundElevationNormalCheckedLevel2 + + + + + + BackgroundElevationNormalLevel1 + + + + + + BackgroundElevationNormalLevel2 + + + + + + BackgroundElevationPressedCheckedLevel1 + + + + + + BackgroundElevationPressedCheckedLevel2 + + + + + + BackgroundElevationPressedLevel1 + + + + + + BackgroundElevationPressedLevel2 + + + + + + BackgroundPrimaryDisabledCheckedLevel1 + + + + + + BackgroundPrimaryDisabledCheckedLevel2 + + + + + + BackgroundPrimaryDisabledLevel1 + + + + + + BackgroundPrimaryDisabledLevel2 + + + + + + BackgroundPrimaryHoverCheckedLevel1 + + + + + + BackgroundPrimaryHoverCheckedLevel2 + + + + + + BackgroundPrimaryHoverLevel1 + + + + + + BackgroundPrimaryHoverLevel2 + + + + + + BackgroundPrimaryNormalCheckedLevel1 + + + + + + BackgroundPrimaryNormalCheckedLevel2 + + + + + + BackgroundPrimaryNormalLevel1 + + + + + + BackgroundPrimaryNormalLevel2 + + + + + + BackgroundPrimaryPressedCheckedLevel1 + + + + + + BackgroundPrimaryPressedCheckedLevel2 + + + + + + BackgroundPrimaryPressedLevel1 + + + + + + BackgroundPrimaryPressedLevel2 + + + + + + BackgroundSecondaryDisabledCheckedLevel1 + + + + + + BackgroundSecondaryDisabledCheckedLevel2 + + + + + + BackgroundSecondaryDisabledLevel1 + + + + + + BackgroundSecondaryDisabledLevel2 + + + + + + BackgroundSecondaryHoverCheckedLevel1 + + + + + + BackgroundSecondaryHoverCheckedLevel2 + + + + + + BackgroundSecondaryHoverLevel1 + + + + + + BackgroundSecondaryHoverLevel2 + + + + + + BackgroundSecondaryNormalCheckedLevel1 + + + + + + BackgroundSecondaryNormalCheckedLevel2 + + + + + + BackgroundSecondaryNormalLevel1 + + + + + + BackgroundSecondaryNormalLevel2 + + + + + + BackgroundSecondaryPressedCheckedLevel1 + + + + + + BackgroundSecondaryPressedCheckedLevel2 + + + + + + BackgroundSecondaryPressedLevel1 + + + + + + BackgroundSecondaryPressedLevel2 + + + + + + BorderColorElevationDisabledCheckedLevel1 + + + + + + BorderColorElevationDisabledCheckedLevel2 + + + + + + BorderColorElevationDisabledLevel1 + + + + + + BorderColorElevationDisabledLevel2 + + + + + + BorderColorElevationHoverCheckedLevel1 + + + + + + BorderColorElevationHoverCheckedLevel2 + + + + + + BorderColorElevationHoverLevel1 + + + + + + BorderColorElevationHoverLevel2 + + + + + + BorderColorElevationNormalCheckedLevel1 + + + + + + BorderColorElevationNormalCheckedLevel2 + + + + + + BorderColorElevationNormalLevel1 + + + + + + BorderColorElevationNormalLevel2 + + + + + + BorderColorElevationPressedCheckedLevel1 + + + + + + BorderColorElevationPressedCheckedLevel2 + + + + + + BorderColorElevationPressedLevel1 + + + + + + BorderColorElevationPressedLevel2 + + + + + + BorderColorPrimaryDisabledCheckedLevel1 + + + + + + BorderColorPrimaryDisabledCheckedLevel2 + + + + + + BorderColorPrimaryDisabledLevel1 + + + + + + BorderColorPrimaryDisabledLevel2 + + + + + + BorderColorPrimaryHoverCheckedLevel1 + + + + + + BorderColorPrimaryHoverCheckedLevel2 + + + + + + BorderColorPrimaryHoverLevel1 + + + + + + BorderColorPrimaryHoverLevel2 + + + + + + BorderColorPrimaryNormalCheckedLevel1 + + + + + + BorderColorPrimaryNormalCheckedLevel2 + + + + + + BorderColorPrimaryNormalLevel1 + + + + + + BorderColorPrimaryNormalLevel2 + + + + + + BorderColorPrimaryPressedCheckedLevel1 + + + + + + BorderColorPrimaryPressedCheckedLevel2 + + + + + + BorderColorPrimaryPressedLevel1 + + + + + + BorderColorPrimaryPressedLevel2 + + + + + + BorderColorSecondaryDisabledCheckedLevel1 + + + + + + BorderColorSecondaryDisabledCheckedLevel2 + + + + + + BorderColorSecondaryDisabledLevel1 + + + + + + BorderColorSecondaryDisabledLevel2 + + + + + + BorderColorSecondaryHoverCheckedLevel1 + + + + + + BorderColorSecondaryHoverCheckedLevel2 + + + + + + BorderColorSecondaryHoverLevel1 + + + + + + BorderColorSecondaryHoverLevel2 + + + + + + BorderColorSecondaryNormalCheckedLevel1 + + + + + + BorderColorSecondaryNormalCheckedLevel2 + + + + + + BorderColorSecondaryNormalLevel1 + + + + + + BorderColorSecondaryNormalLevel2 + + + + + + BorderColorSecondaryPressedCheckedLevel1 + + + + + + BorderColorSecondaryPressedCheckedLevel2 + + + + + + BorderColorSecondaryPressedLevel1 + + + + + + BorderColorSecondaryPressedLevel2 + + + + + + FocusVisualBrush + + + + + + + ShadowElevationDisabledCheckedLevel1 + + + + + + + + ShadowElevationDisabledCheckedLevel2 + + + + + + + + ShadowElevationDisabledLevel1 + + + + + + + + ShadowElevationDisabledLevel2 + + + + + + + + ShadowElevationHoverCheckedLevel1 + + + + + + + + ShadowElevationHoverCheckedLevel2 + + + + + + + + ShadowElevationHoverLevel1 + + + + + + + + ShadowElevationHoverLevel2 + + + + + + + + ShadowElevationNormalCheckedLevel1 + + + + + + + + ShadowElevationNormalCheckedLevel2 + + + + + + + + ShadowElevationNormalLevel1 + + + + + + + + ShadowElevationNormalLevel2 + + + + + + + + ShadowElevationPressedCheckedLevel1 + + + + + + + + ShadowElevationPressedCheckedLevel2 + + + + + + + + ShadowElevationPressedLevel1 + + + + + + + + ShadowElevationPressedLevel2 + + + + + + + + ShadowPrimaryDisabledCheckedLevel1 + + + + + + + + ShadowPrimaryDisabledCheckedLevel2 + + + + + + + + ShadowPrimaryDisabledLevel1 + + + + + + + + ShadowPrimaryDisabledLevel2 + + + + + + + + ShadowPrimaryHoverCheckedLevel1 + + + + + + + + ShadowPrimaryHoverCheckedLevel2 + + + + + + + + ShadowPrimaryHoverLevel1 + + + + + + + + ShadowPrimaryHoverLevel2 + + + + + + + + ShadowPrimaryNormalCheckedLevel1 + + + + + + + + ShadowPrimaryNormalCheckedLevel2 + + + + + + + + ShadowPrimaryNormalLevel1 + + + + + + + + ShadowPrimaryNormalLevel2 + + + + + + + + ShadowPrimaryPressedCheckedLevel1 + + + + + + + + ShadowPrimaryPressedCheckedLevel2 + + + + + + + + ShadowPrimaryPressedLevel1 + + + + + + + + ShadowPrimaryPressedLevel2 + + + + + + + + ShadowSecondaryDisabledCheckedLevel1 + + + + + + + + ShadowSecondaryDisabledCheckedLevel2 + + + + + + + + ShadowSecondaryDisabledLevel1 + + + + + + + + ShadowSecondaryDisabledLevel2 + + + + + + + + ShadowSecondaryHoverCheckedLevel1 + + + + + + + + ShadowSecondaryHoverCheckedLevel2 + + + + + + + + ShadowSecondaryHoverLevel1 + + + + + + + + ShadowSecondaryHoverLevel2 + + + + + + + + ShadowSecondaryNormalCheckedLevel1 + + + + + + + + ShadowSecondaryNormalCheckedLevel2 + + + + + + + + ShadowSecondaryNormalLevel1 + + + + + + + + ShadowSecondaryNormalLevel2 + + + + + + + + ShadowSecondaryPressedCheckedLevel1 + + + + + + + + ShadowSecondaryPressedCheckedLevel2 + + + + + + + + ShadowSecondaryPressedLevel1 + + + + + + + + ShadowSecondaryPressedLevel2 + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/IslandToggleButtonStyle.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/IslandToggleButtonStyle.xslt new file mode 100644 index 0000000..c5a6693 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/IslandToggleButtonStyle.xslt @@ -0,0 +1,2862 @@ + + + + + + + + + + + + + + + + + + IslandToggleButtons + + + + + + + + + + + + + + + + + + + + visuals:IslandToggleButton + IslandToggleButtonUniversal + + + + + + + IslandToggleButton_Padding + + + + + + + + + Level + First + + + + + IslandToggleButton_FocusVisualStyle + + + + + + + IslandToggleButton_CornerRadius + + + + + + + + + Level + Second + + + + + IslandToggleButton_FocusVisualStyle + + + + + + + IslandToggleButton_CornerRadius + + + + + + + + + + + + + + visuals:StateService.SelectableState + Normal + + + + + Level + First + + + + + Type + Elevation + + + + + + + + + IslandToggleButton_Background + BackgroundElevationNormalLevel1 + + + + + + IslandToggleButton_BorderBrush + BorderColorElevationNormalLevel1 + + + + + + IslandToggleButton_BorderThickness + + + + + + IslandToggleButton_Shadow + + + + + + + + + + + + + + + visuals:StateService.SelectableState + Hover + + + + + Level + First + + + + + Type + Elevation + + + + + + + + + IslandToggleButton_Background + BackgroundElevationHoverLevel1 + + + + + + IslandToggleButton_BorderBrush + BorderColorElevationHoverLevel1 + + + + + + IslandToggleButton_BorderThickness + + + + + + IslandToggleButton_Shadow + + + + + + + + + + + + + + + visuals:StateService.SelectableState + Pressed + + + + + Level + First + + + + + Type + Elevation + + + + + + + + + IslandToggleButton_Background + BackgroundElevationPressedLevel1 + + + + + + IslandToggleButton_BorderBrush + BorderColorElevationPressedLevel1 + + + + + + IslandToggleButton_BorderThickness + + + + + + IslandToggleButton_Shadow + + + + + + + + + + + + + + + visuals:StateService.SelectableState + Disabled + + + + + Level + First + + + + + Type + Elevation + + + + + + + + + IslandToggleButton_Background + BackgroundElevationDisabledLevel1 + + + + + + IslandToggleButton_BorderBrush + BorderColorElevationDisabledLevel1 + + + + + + IslandToggleButton_BorderThickness + + + + + + IslandToggleButton_Shadow + + + + + + + + + + + + + + + visuals:StateService.SelectableState + SelectedNormal + + + + + Level + First + + + + + Type + Elevation + + + + + + + + + IslandToggleButton_Background + BackgroundElevationNormalCheckedLevel1 + + + + + + IslandToggleButton_BorderBrush + BorderColorElevationNormalCheckedLevel1 + + + + + + IslandToggleButton_BorderThickness + + + + + + IslandToggleButton_Shadow + + + + + + + + + + + + + + + visuals:StateService.SelectableState + SelectedHover + + + + + Level + First + + + + + Type + Elevation + + + + + + + + + IslandToggleButton_Background + BackgroundElevationHoverCheckedLevel1 + + + + + + IslandToggleButton_BorderBrush + BorderColorElevationHoverCheckedLevel1 + + + + + + IslandToggleButton_BorderThickness + + + + + + IslandToggleButton_Shadow + + + + + + + + + + + + + + + visuals:StateService.SelectableState + SelectedPressed + + + + + Level + First + + + + + Type + Elevation + + + + + + + + + IslandToggleButton_Background + BackgroundElevationPressedCheckedLevel1 + + + + + + IslandToggleButton_BorderBrush + BorderColorElevationPressedCheckedLevel1 + + + + + + IslandToggleButton_BorderThickness + + + + + + IslandToggleButton_Shadow + + + + + + + + + + + + + + + visuals:StateService.SelectableState + SelectedDisabled + + + + + Level + First + + + + + Type + Elevation + + + + + + + + + IslandToggleButton_Background + BackgroundElevationDisabledCheckedLevel1 + + + + + + IslandToggleButton_BorderBrush + BorderColorElevationDisabledCheckedLevel1 + + + + + + IslandToggleButton_BorderThickness + + + + + + IslandToggleButton_Shadow + + + + + + + + + + + + + + + + visuals:StateService.SelectableState + Normal + + + + + Level + Second + + + + + Type + Elevation + + + + + + + + + IslandToggleButton_Background + BackgroundElevationNormalLevel2 + + + + + + IslandToggleButton_BorderBrush + BorderColorElevationNormalLevel2 + + + + + + IslandToggleButton_BorderThickness + + + + + + IslandToggleButton_Shadow + + + + + + + + + + + + + + + visuals:StateService.SelectableState + Hover + + + + + Level + Second + + + + + Type + Elevation + + + + + + + + + IslandToggleButton_Background + BackgroundElevationHoverLevel2 + + + + + + IslandToggleButton_BorderBrush + BorderColorElevationHoverLevel2 + + + + + + IslandToggleButton_BorderThickness + + + + + + IslandToggleButton_Shadow + + + + + + + + + + + + + + + visuals:StateService.SelectableState + Pressed + + + + + Level + Second + + + + + Type + Elevation + + + + + + + + + IslandToggleButton_Background + BackgroundElevationPressedLevel2 + + + + + + IslandToggleButton_BorderBrush + BorderColorElevationPressedLevel2 + + + + + + IslandToggleButton_BorderThickness + + + + + + IslandToggleButton_Shadow + + + + + + + + + + + + + + + visuals:StateService.SelectableState + Disabled + + + + + Level + Second + + + + + Type + Elevation + + + + + + + + + IslandToggleButton_Background + BackgroundElevationDisabledLevel2 + + + + + + IslandToggleButton_BorderBrush + BorderColorElevationDisabledLevel2 + + + + + + IslandToggleButton_BorderThickness + + + + + + IslandToggleButton_Shadow + + + + + + + + + + + + + + + visuals:StateService.SelectableState + SelectedNormal + + + + + Level + Second + + + + + Type + Elevation + + + + + + + + + IslandToggleButton_Background + BackgroundElevationNormalCheckedLevel2 + + + + + + IslandToggleButton_BorderBrush + BorderColorElevationNormalCheckedLevel2 + + + + + + IslandToggleButton_BorderThickness + + + + + + IslandToggleButton_Shadow + + + + + + + + + + + + + + + visuals:StateService.SelectableState + SelectedHover + + + + + Level + Second + + + + + Type + Elevation + + + + + + + + + IslandToggleButton_Background + BackgroundElevationHoverCheckedLevel2 + + + + + + IslandToggleButton_BorderBrush + BorderColorElevationHoverCheckedLevel2 + + + + + + IslandToggleButton_BorderThickness + + + + + + IslandToggleButton_Shadow + + + + + + + + + + + + + + + visuals:StateService.SelectableState + SelectedPressed + + + + + Level + Second + + + + + Type + Elevation + + + + + + + + + IslandToggleButton_Background + BackgroundElevationPressedCheckedLevel2 + + + + + + IslandToggleButton_BorderBrush + BorderColorElevationPressedCheckedLevel2 + + + + + + IslandToggleButton_BorderThickness + + + + + + IslandToggleButton_Shadow + + + + + + + + + + + + + + + visuals:StateService.SelectableState + SelectedDisabled + + + + + Level + Second + + + + + Type + Elevation + + + + + + + + + IslandToggleButton_Background + BackgroundElevationDisabledCheckedLevel2 + + + + + + IslandToggleButton_BorderBrush + BorderColorElevationDisabledCheckedLevel2 + + + + + + IslandToggleButton_BorderThickness + + + + + + IslandToggleButton_Shadow + + + + + + + + + + + + + + + + visuals:StateService.SelectableState + Normal + + + + + Level + First + + + + + Type + Primary + + + + + + + + + IslandToggleButton_Background + BackgroundPrimaryNormalLevel1 + + + + + + IslandToggleButton_BorderBrush + BorderColorPrimaryNormalLevel1 + + + + + + IslandToggleButton_BorderThickness + + + + + + IslandToggleButton_Shadow + + + + + + + + + + + + + + + visuals:StateService.SelectableState + Hover + + + + + Level + First + + + + + Type + Primary + + + + + + + + + IslandToggleButton_Background + BackgroundPrimaryHoverLevel1 + + + + + + IslandToggleButton_BorderBrush + BorderColorPrimaryHoverLevel1 + + + + + + IslandToggleButton_BorderThickness + + + + + + IslandToggleButton_Shadow + + + + + + + + + + + + + + + visuals:StateService.SelectableState + Pressed + + + + + Level + First + + + + + Type + Primary + + + + + + + + + IslandToggleButton_Background + BackgroundPrimaryPressedLevel1 + + + + + + IslandToggleButton_BorderBrush + BorderColorPrimaryPressedLevel1 + + + + + + IslandToggleButton_BorderThickness + + + + + + IslandToggleButton_Shadow + + + + + + + + + + + + + + + visuals:StateService.SelectableState + Disabled + + + + + Level + First + + + + + Type + Primary + + + + + + + + + IslandToggleButton_Background + BackgroundPrimaryDisabledLevel1 + + + + + + IslandToggleButton_BorderBrush + BorderColorPrimaryDisabledLevel1 + + + + + + IslandToggleButton_BorderThickness + + + + + + IslandToggleButton_Shadow + + + + + + + + + + + + + + + visuals:StateService.SelectableState + SelectedNormal + + + + + Level + First + + + + + Type + Primary + + + + + + + + + IslandToggleButton_Background + BackgroundPrimaryNormalCheckedLevel1 + + + + + + IslandToggleButton_BorderBrush + BorderColorPrimaryNormalCheckedLevel1 + + + + + + IslandToggleButton_BorderThickness + + + + + + IslandToggleButton_Shadow + + + + + + + + + + + + + + + visuals:StateService.SelectableState + SelectedHover + + + + + Level + First + + + + + Type + Primary + + + + + + + + + IslandToggleButton_Background + BackgroundPrimaryHoverCheckedLevel1 + + + + + + IslandToggleButton_BorderBrush + BorderColorPrimaryHoverCheckedLevel1 + + + + + + IslandToggleButton_BorderThickness + + + + + + IslandToggleButton_Shadow + + + + + + + + + + + + + + + visuals:StateService.SelectableState + SelectedPressed + + + + + Level + First + + + + + Type + Primary + + + + + + + + + IslandToggleButton_Background + BackgroundPrimaryPressedCheckedLevel1 + + + + + + IslandToggleButton_BorderBrush + BorderColorPrimaryPressedCheckedLevel1 + + + + + + IslandToggleButton_BorderThickness + + + + + + IslandToggleButton_Shadow + + + + + + + + + + + + + + + visuals:StateService.SelectableState + SelectedDisabled + + + + + Level + First + + + + + Type + Primary + + + + + + + + + IslandToggleButton_Background + BackgroundPrimaryDisabledCheckedLevel1 + + + + + + IslandToggleButton_BorderBrush + BorderColorPrimaryDisabledCheckedLevel1 + + + + + + IslandToggleButton_BorderThickness + + + + + + IslandToggleButton_Shadow + + + + + + + + + + + + + + + + visuals:StateService.SelectableState + Normal + + + + + Level + Second + + + + + Type + Primary + + + + + + + + + IslandToggleButton_Background + BackgroundPrimaryNormalLevel2 + + + + + + IslandToggleButton_BorderBrush + BorderColorPrimaryNormalLevel2 + + + + + + IslandToggleButton_BorderThickness + + + + + + IslandToggleButton_Shadow + + + + + + + + + + + + + + + visuals:StateService.SelectableState + Hover + + + + + Level + Second + + + + + Type + Primary + + + + + + + + + IslandToggleButton_Background + BackgroundPrimaryHoverLevel2 + + + + + + IslandToggleButton_BorderBrush + BorderColorPrimaryHoverLevel2 + + + + + + IslandToggleButton_BorderThickness + + + + + + IslandToggleButton_Shadow + + + + + + + + + + + + + + + visuals:StateService.SelectableState + Pressed + + + + + Level + Second + + + + + Type + Primary + + + + + + + + + IslandToggleButton_Background + BackgroundPrimaryPressedLevel2 + + + + + + IslandToggleButton_BorderBrush + BorderColorPrimaryPressedLevel2 + + + + + + IslandToggleButton_BorderThickness + + + + + + IslandToggleButton_Shadow + + + + + + + + + + + + + + + visuals:StateService.SelectableState + Disabled + + + + + Level + Second + + + + + Type + Primary + + + + + + + + + IslandToggleButton_Background + BackgroundPrimaryDisabledLevel2 + + + + + + IslandToggleButton_BorderBrush + BorderColorPrimaryDisabledLevel2 + + + + + + IslandToggleButton_BorderThickness + + + + + + IslandToggleButton_Shadow + + + + + + + + + + + + + + + visuals:StateService.SelectableState + SelectedNormal + + + + + Level + Second + + + + + Type + Primary + + + + + + + + + IslandToggleButton_Background + BackgroundPrimaryNormalCheckedLevel2 + + + + + + IslandToggleButton_BorderBrush + BorderColorPrimaryNormalCheckedLevel2 + + + + + + IslandToggleButton_BorderThickness + + + + + + IslandToggleButton_Shadow + + + + + + + + + + + + + + + visuals:StateService.SelectableState + SelectedHover + + + + + Level + Second + + + + + Type + Primary + + + + + + + + + IslandToggleButton_Background + BackgroundPrimaryHoverCheckedLevel2 + + + + + + IslandToggleButton_BorderBrush + BorderColorPrimaryHoverCheckedLevel2 + + + + + + IslandToggleButton_BorderThickness + + + + + + IslandToggleButton_Shadow + + + + + + + + + + + + + + + visuals:StateService.SelectableState + SelectedPressed + + + + + Level + Second + + + + + Type + Primary + + + + + + + + + IslandToggleButton_Background + BackgroundPrimaryPressedCheckedLevel2 + + + + + + IslandToggleButton_BorderBrush + BorderColorPrimaryPressedCheckedLevel2 + + + + + + IslandToggleButton_BorderThickness + + + + + + IslandToggleButton_Shadow + + + + + + + + + + + + + + + visuals:StateService.SelectableState + SelectedDisabled + + + + + Level + Second + + + + + Type + Primary + + + + + + + + + IslandToggleButton_Background + BackgroundPrimaryDisabledCheckedLevel2 + + + + + + IslandToggleButton_BorderBrush + BorderColorPrimaryDisabledCheckedLevel2 + + + + + + IslandToggleButton_BorderThickness + + + + + + IslandToggleButton_Shadow + + + + + + + + + + + + + + + + visuals:StateService.SelectableState + Normal + + + + + Level + First + + + + + Type + Secondary + + + + + + + + + IslandToggleButton_Background + BackgroundSecondaryNormalLevel1 + + + + + + IslandToggleButton_BorderBrush + BorderColorSecondaryNormalLevel1 + + + + + + IslandToggleButton_BorderThickness + + + + + + IslandToggleButton_Shadow + + + + + + + + + + + + + + + visuals:StateService.SelectableState + Hover + + + + + Level + First + + + + + Type + Secondary + + + + + + + + + IslandToggleButton_Background + BackgroundSecondaryHoverLevel1 + + + + + + IslandToggleButton_BorderBrush + BorderColorSecondaryHoverLevel1 + + + + + + IslandToggleButton_BorderThickness + + + + + + IslandToggleButton_Shadow + + + + + + + + + + + + + + + visuals:StateService.SelectableState + Pressed + + + + + Level + First + + + + + Type + Secondary + + + + + + + + + IslandToggleButton_Background + BackgroundSecondaryPressedLevel1 + + + + + + IslandToggleButton_BorderBrush + BorderColorSecondaryPressedLevel1 + + + + + + IslandToggleButton_BorderThickness + + + + + + IslandToggleButton_Shadow + + + + + + + + + + + + + + + visuals:StateService.SelectableState + Disabled + + + + + Level + First + + + + + Type + Secondary + + + + + + + + + IslandToggleButton_Background + BackgroundSecondaryDisabledLevel1 + + + + + + IslandToggleButton_BorderBrush + BorderColorSecondaryDisabledLevel1 + + + + + + IslandToggleButton_BorderThickness + + + + + + IslandToggleButton_Shadow + + + + + + + + + + + + + + + visuals:StateService.SelectableState + SelectedNormal + + + + + Level + First + + + + + Type + Secondary + + + + + + + + + IslandToggleButton_Background + BackgroundSecondaryNormalCheckedLevel1 + + + + + + IslandToggleButton_BorderBrush + BorderColorSecondaryNormalCheckedLevel1 + + + + + + IslandToggleButton_BorderThickness + + + + + + IslandToggleButton_Shadow + + + + + + + + + + + + + + + visuals:StateService.SelectableState + SelectedHover + + + + + Level + First + + + + + Type + Secondary + + + + + + + + + IslandToggleButton_Background + BackgroundSecondaryHoverCheckedLevel1 + + + + + + IslandToggleButton_BorderBrush + BorderColorSecondaryHoverCheckedLevel1 + + + + + + IslandToggleButton_BorderThickness + + + + + + IslandToggleButton_Shadow + + + + + + + + + + + + + + + visuals:StateService.SelectableState + SelectedPressed + + + + + Level + First + + + + + Type + Secondary + + + + + + + + + IslandToggleButton_Background + BackgroundSecondaryPressedCheckedLevel1 + + + + + + IslandToggleButton_BorderBrush + BorderColorSecondaryPressedCheckedLevel1 + + + + + + IslandToggleButton_BorderThickness + + + + + + IslandToggleButton_Shadow + + + + + + + + + + + + + + + visuals:StateService.SelectableState + SelectedDisabled + + + + + Level + First + + + + + Type + Secondary + + + + + + + + + IslandToggleButton_Background + BackgroundSecondaryDisabledCheckedLevel1 + + + + + + IslandToggleButton_BorderBrush + BorderColorSecondaryDisabledCheckedLevel1 + + + + + + IslandToggleButton_BorderThickness + + + + + + IslandToggleButton_Shadow + + + + + + + + + + + + + + + + visuals:StateService.SelectableState + Normal + + + + + Level + Second + + + + + Type + Secondary + + + + + + + + + IslandToggleButton_Background + BackgroundSecondaryNormalLevel2 + + + + + + IslandToggleButton_BorderBrush + BorderColorSecondaryNormalLevel2 + + + + + + IslandToggleButton_BorderThickness + + + + + + IslandToggleButton_Shadow + + + + + + + + + + + + + + + visuals:StateService.SelectableState + Hover + + + + + Level + Second + + + + + Type + Secondary + + + + + + + + + IslandToggleButton_Background + BackgroundSecondaryHoverLevel2 + + + + + + IslandToggleButton_BorderBrush + BorderColorSecondaryHoverLevel2 + + + + + + IslandToggleButton_BorderThickness + + + + + + IslandToggleButton_Shadow + + + + + + + + + + + + + + + visuals:StateService.SelectableState + Pressed + + + + + Level + Second + + + + + Type + Secondary + + + + + + + + + IslandToggleButton_Background + BackgroundSecondaryPressedLevel2 + + + + + + IslandToggleButton_BorderBrush + BorderColorSecondaryPressedLevel2 + + + + + + IslandToggleButton_BorderThickness + + + + + + IslandToggleButton_Shadow + + + + + + + + + + + + + + + visuals:StateService.SelectableState + Disabled + + + + + Level + Second + + + + + Type + Secondary + + + + + + + + + IslandToggleButton_Background + BackgroundSecondaryDisabledLevel2 + + + + + + IslandToggleButton_BorderBrush + BorderColorSecondaryDisabledLevel2 + + + + + + IslandToggleButton_BorderThickness + + + + + + IslandToggleButton_Shadow + + + + + + + + + + + + + + + visuals:StateService.SelectableState + SelectedNormal + + + + + Level + Second + + + + + Type + Secondary + + + + + + + + + IslandToggleButton_Background + BackgroundSecondaryNormalCheckedLevel2 + + + + + + IslandToggleButton_BorderBrush + BorderColorSecondaryNormalCheckedLevel2 + + + + + + IslandToggleButton_BorderThickness + + + + + + IslandToggleButton_Shadow + + + + + + + + + + + + + + + visuals:StateService.SelectableState + SelectedHover + + + + + Level + Second + + + + + Type + Secondary + + + + + + + + + IslandToggleButton_Background + BackgroundSecondaryHoverCheckedLevel2 + + + + + + IslandToggleButton_BorderBrush + BorderColorSecondaryHoverCheckedLevel2 + + + + + + IslandToggleButton_BorderThickness + + + + + + IslandToggleButton_Shadow + + + + + + + + + + + + + + + visuals:StateService.SelectableState + SelectedPressed + + + + + Level + Second + + + + + Type + Secondary + + + + + + + + + IslandToggleButton_Background + BackgroundSecondaryPressedCheckedLevel2 + + + + + + IslandToggleButton_BorderBrush + BorderColorSecondaryPressedCheckedLevel2 + + + + + + IslandToggleButton_BorderThickness + + + + + + IslandToggleButton_Shadow + + + + + + + + + + + + + + + visuals:StateService.SelectableState + SelectedDisabled + + + + + Level + Second + + + + + Type + Secondary + + + + + + + + + IslandToggleButton_Background + BackgroundSecondaryDisabledCheckedLevel2 + + + + + + IslandToggleButton_BorderBrush + BorderColorSecondaryDisabledCheckedLevel2 + + + + + + IslandToggleButton_BorderThickness + + + + + + IslandToggleButton_Shadow + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ListMenuItemCustomizationDictionary.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ListMenuItemCustomizationDictionary.xslt new file mode 100644 index 0000000..d5f99b2 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ListMenuItemCustomizationDictionary.xslt @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BackgroundDisabled + + + + + + BackgroundHover + + + + + + BackgroundNormal + + + + + + BackgroundPressed + + + + + + BorderDisabled + + + + + + BorderHover + + + + + + BorderNormal + + + + + + BorderPressed + + + + + + FocusVisualBrush + + + + + + ForegroundDisabled + + + + + + ForegroundHover + + + + + + ForegroundNormal + + + + + + ForegroundPressed + + + + + + IconForegroundDisabled + + + + + + IconForegroundHover + + + + + + IconForegroundNormal + + + + + + IconForegroundPressed + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ListMenuItemStyle.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ListMenuItemStyle.xslt new file mode 100644 index 0000000..5aca562 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ListMenuItemStyle.xslt @@ -0,0 +1,372 @@ + + + + + + + + + + + + + + + + + + ListMenuItems + + + + + + + + + + + + + + + + + + + + visuals:ListMenuItem + ListMenuItemUniversal + + + + + + + + + TextBlock + + TextStyle + + + + + TextElement.Foreground + + + ForegroundNormal + + + + + + + + + + + TextBlock + + TextStyleDisabled + + + + + TextElement.Foreground + + + ForegroundDisabled + + + + + + + + + + + TextBlock + + TextStyleHover + + + + + TextElement.Foreground + + + ForegroundHover + + + + + + + + + + + TextBlock + + TextStyleSelectedNormal + + + + + TextElement.Foreground + + + ForegroundPressed + + + + + + + + + + + + + ListMenuItem_Background + BackgroundNormal + + + + + + ListMenuItem_BorderBrush + BorderNormal + + + + + + ListMenuItem_BorderThickness + + + + + + ListMenuItem_CornerRadius + + + + + ListMenuItem_FocusVisualStyle + + + + + + ListMenuItem_Padding + + + + + ListMenuItem_Icon_Foreground + IconForegroundNormal + + + + + + ListMenuItem_Icon_Margin + + + + + + ListMenuItem_TextStyle + TextStyle + + + + + ListMenuItem_TextStyleDisabled + TextStyleDisabled + + + + + ListMenuItem_TextStyleHover + TextStyleHover + + + + + ListMenuItem_TextStyleSelectedNormal + TextStyleSelectedNormal + + + + + + + + + visuals:StateService.SelectableState + Disabled + + + + + ListMenuItem_Background + BackgroundDisabled + + + + + + ListMenuItem_BorderBrush + BorderDisabled + + + + + + ListMenuItem_BorderThickness + + + + + + ListMenuItem_Icon_Foreground + IconForegroundDisabled + + + + + + + + + visuals:StateService.SelectableState + Hover + + + + + ListMenuItem_Background + BackgroundHover + + + + + + ListMenuItem_BorderBrush + BorderHover + + + + + + ListMenuItem_BorderThickness + + + + + + ListMenuItem_Icon_Foreground + IconForegroundHover + + + + + + + + + visuals:StateService.SelectableState + SelectedNormal + + + + + ListMenuItem_Background + BackgroundPressed + + + + + + ListMenuItem_BorderBrush + BorderPressed + + + + + + ListMenuItem_BorderThickness + + + + + + ListMenuItem_Icon_Foreground + IconForegroundPressed + + + + + + + + + + + + + + + Item + + + + + + + + + + visuals:ListMenu + ListMenuUniversal + + + + + + + ItemContainerStyle + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/MenuItemCustomizationDictionary.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/MenuItemCustomizationDictionary.xslt new file mode 100644 index 0000000..cc52388 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/MenuItemCustomizationDictionary.xslt @@ -0,0 +1,229 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BackgroundDisabled + + + + + + BackgroundHover + + + + + + BackgroundNormal + + + + + + BackgroundPressed + + + + + + CheckBoxMarkIconForegroundDisabled + + + + + + CheckBoxMarkIconForegroundHover + + + + + + CheckBoxMarkIconForegroundNormal + + + + + + CheckBoxMarkIconForegroundPressed + + + + + + DescriptionForegroundDisabled + + + + + + DescriptionForegroundHover + + + + + + DescriptionForegroundNormal + + + + + + DescriptionForegroundPressed + + + + + + ForegroundDisabled + + + + + + ForegroundHover + + + + + + ForegroundNormal + + + + + + ForegroundPressed + + + + + + GroupHeaderForeground + + + + + + IconForegroundDisabled + + + + + + IconForegroundHover + + + + + + IconForegroundNormal + + + + + + IconForegroundPressed + + + + + + PopupDecoratorBackground + + + + + + PopupDecoratorBorderColor + + + + + + PopupDecoratorShadow + + + + + + SubmenuIconForegroundDisabled + + + + + + SubmenuIconForegroundHover + + + + + + SubmenuIconForegroundNormal + + + + + + SubmenuIconForegroundPressed + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/MenuItemStyle.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/MenuItemStyle.xslt new file mode 100644 index 0000000..e76d42e --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/MenuItemStyle.xslt @@ -0,0 +1,515 @@ + + + + + + + + + + + + + + + + + + MenuItems + + + + + + + + + + + + + + + + + + + + visuals:MenuItemBase + MenuItemUniversal + + + + + + + + + TextBlock + + DescriptionStyle + + + + TextElement.Foreground + DescriptionForegroundNormal + + + + + + + + TextBlock + + DescriptionStyleDisabled + + + + TextElement.Foreground + DescriptionForegroundDisabled + + + + + + + + TextBlock + + DescriptionStyleHover + + + + TextElement.Foreground + DescriptionForegroundHover + + + + + + + + TextBlock + + DescriptionStylePressed + + + + TextElement.Foreground + DescriptionForegroundPressed + + + + + + + + TextBlock + + GroupHeaderStyle + + + + TextElement.Foreground + GroupHeaderForeground + + + + + + + + visuals:ContextMenuPopupDecorator + PopupDecoratorUniversal + PopupDecoratorStyle + + + + + PopupDecorator_Background + PopupDecoratorBackground + + + + + + PopupDecorator_BorderBrush + PopupDecoratorBorderColor + + + + + + PopupDecorator_BorderThickness + + + + + + PopupDecorator_CornerRadius + + + + + + PopupDecorator_Padding + + + + + + PopupDecorator_Shadow + + + + + + + + + + TextBlock + + TextStyle + + + + TextElement.Foreground + ForegroundNormal + + + + + + + + TextBlock + + TextStyleDisabled + + + + TextElement.Foreground + ForegroundDisabled + + + + + + + + TextBlock + + TextStyleHover + + + + TextElement.Foreground + ForegroundHover + + + + + + + + TextBlock + + TextStylePressed + + + + TextElement.Foreground + ForegroundPressed + + + + + + + + + + MenuItem_Background + BackgroundNormal + + + + + + MenuItem_Badge_Margin + + + + + + MenuItem_CheckBoxMarkIcon_Foreground + CheckBoxMarkIconForegroundNormal + + + + + + MenuItem_CheckBoxMarkIcon_Margin + + + + + + MenuItem_CheckBoxMarkIcon_Name + + + + + + MenuItem_Description_Margin + + + + + + MenuItem_DescriptionStyle + DescriptionStyle + + + + + MenuItem_DescriptionStyleDisabled + DescriptionStyleDisabled + + + + + MenuItem_DescriptionStyleHover + DescriptionStyleHover + + + + + MenuItem_DescriptionStylePressed + DescriptionStylePressed + + + + + MenuItem_GroupHeader_Margin + + + + + + MenuItem_GroupHeaderStyle + GroupHeaderStyle + + + + + MenuItem_Icon_Foreground + IconForegroundNormal + + + + + + MenuItem_Icon_Margin + + + + + + MenuItem_MinHeight + + + + + + MenuItem_Padding + + + + + MenuItem_PopupDecoratorStyle + PopupDecoratorStyle + + + + + MenuItem_SubmenuIcon_Name + + + + + + MenuItem_SubmenuIcon_Foreground + SubmenuIconForegroundNormal + + + + + + MenuItem_SubmenuIcon_Margin + + + + + + MenuItem_TextStyle + TextStyle + + + + + MenuItem_TextStyleDisabled + TextStyleDisabled + + + + + MenuItem_TextStyleHover + TextStyleHover + + + + + MenuItem_TextStylePressed + TextStylePressed + + + + + + + + + visuals:StateService.State + Disabled + + + + + MenuItem_Background + BackgroundDisabled + + + + + + MenuItem_CheckBoxMarkIcon_Foreground + CheckBoxMarkIconForegroundDisabled + + + + + + MenuItem_Icon_Foreground + IconForegroundDisabled + + + + + + MenuItem_SubmenuIcon_Foreground + SubmenuIconForegroundDisabled + + + + + + + + + visuals:StateService.State + Hover + + + + + MenuItem_Background + BackgroundHover + + + + + + MenuItem_CheckBoxMarkIcon_Foreground + CheckBoxMarkIconForegroundHover + + + + + + MenuItem_Icon_Foreground + IconForegroundHover + + + + + + MenuItem_SubmenuIcon_Foreground + SubmenuIconForegroundHover + + + + + + + + + visuals:StateService.State + Pressed + + + + + MenuItem_Background + BackgroundPressed + + + + + + MenuItem_CheckBoxMarkIcon_Foreground + CheckBoxMarkIconForegroundPressed + + + + + + MenuItem_Icon_Foreground + IconForegroundPressed + + + + + + MenuItem_SubmenuIcon_Foreground + SubmenuIconForegroundPressed + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/NavigationMenuButtonCustomizationDictionary.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/NavigationMenuButtonCustomizationDictionary.xslt new file mode 100644 index 0000000..0a07d19 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/NavigationMenuButtonCustomizationDictionary.xslt @@ -0,0 +1,197 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Background + + + + + + + + BorderHover + + + + + + + + BorderNormal + + + + + + + + BorderPressed + + + + + + + + ContainerBackgroundHover + + + + + + + + ContainerBackgroundNormal + + + + + + + + ContainerBackgroundPressed + + + + + + + + FocusVisualBrush + + + + + + + + ForegroundHover + + + + + + + + ForegroundNormal + + + + + + + + ForegroundPressed + + + + + + + + ForegroundSecondLineHover + + + + + + + + ForegroundSecondLineNormal + + + + + + + + ForegroundSecondLinePressed + + + + + + + + IconForegroundHover + + + + + + + + IconForegroundNormal + + + + + + + + IconForegroundPressed + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/NavigationMenuButtonStyle.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/NavigationMenuButtonStyle.xslt new file mode 100644 index 0000000..567d1df --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/NavigationMenuButtonStyle.xslt @@ -0,0 +1,497 @@ + + + + + + + + + + + + + + + + NavigationMenuButtons + + + + + + + + + + + + + + + + + + + + visuals:NavigationMenuButton + NavigationMenuButtonUniversal + + + + + + + + + TextBlock + + CaptionTextStyle + + + + + TextElement.Foreground + + + ForegroundNormal + + + + + + + + + + + + + TextBlock + + CaptionTextStyleHover + + + + + TextElement.Foreground + + + ForegroundHover + + + + + + + + + + + + + TextBlock + + CaptionTextStylePressed + + + + + TextElement.Foreground + + + ForegroundPressed + + + + + + + + + + + + + TextBlock + + DescriptionTextStyle + + + + + TextElement.Foreground + + + ForegroundSecondLineNormal + + + + + + + + + + + + + TextBlock + + DescriptionTextStyleHover + + + + + TextElement.Foreground + + + ForegroundSecondLineHover + + + + + + + + + + + + + TextBlock + + DescriptionTextStylePressed + + + + + TextElement.Foreground + + + ForegroundSecondLinePressed + + + + + + + + + + + + + + NavigationMenuButton_Background + + + Background + + + + + + + + + NavigationMenuButton_Badge_Margin + + + + + + NavigationMenuButton_Badge_Style + + + + + + + + + + NavigationMenuButton_CaptionTextStyle + + + CaptionTextStyle + + + + + + + NavigationMenuButton_CaptionTextStyleHover + + + CaptionTextStyleHover + + + + + + + NavigationMenuButton_CaptionTextStylePressed + + + CaptionTextStylePressed + + + + + + + NavigationMenuButton_Container_Background + + + ContainerBackgroundNormal + + + + + + + + + NavigationMenuButton_Container_BorderBrush + + + BorderNormal + + + + + + + + + NavigationMenuButton_Container_BorderThickness + + + + + + + + + + NavigationMenuButton_Container_CornerRadius + + + + + NavigationMenuButton_Container_Padding + + + + + + NavigationMenuButton_DescriptionTextStyle + + + DescriptionTextStyle + + + + + + + NavigationMenuButton_DescriptionTextStyleHover + + + DescriptionTextStyleHover + + + + + + + NavigationMenuButton_DescriptionTextStylePressed + + + DescriptionTextStylePressed + + + + + + + NavigationMenuButton_FocusVisualStyle + + + + + + NavigationMenuButton_Icon_Foreground + + + IconForegroundNormal + + + + + + + + NavigationMenuButton_Icon_Margin + + + + + + NavigationMenuButton_Height + + + + + NavigationMenuButton_Container_MarginLevel1 + + + + + + NavigationMenuButton_Container_MarginLevel2 + + + + + + + + + + visuals:StateService.State + Hover + + + + + + NavigationMenuButton_Container_Background + + + ContainerBackgroundHover + + + + + + + + + + NavigationMenuButton_Container_BorderBrush + + + BorderHover + + + + + + + + + NavigationMenuButton_Container_BorderThickness + + + + + + + + + + + NavigationMenuButton_Icon_Foreground + + + IconForegroundHover + + + + + + + + + + + + visuals:StateService.State + Pressed + + + + + + NavigationMenuButton_Container_Background + + + ContainerBackgroundPressed + + + + + + + + + + NavigationMenuButton_Container_BorderBrush + + + BorderPressed + + + + + + + + + NavigationMenuButton_Container_BorderThickness + + + + + + + + + + + NavigationMenuButton_Icon_Foreground + + + IconForegroundPressed + + + + + + + + + + + + + + diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/NavigationMenuFooterButtonCustomizationDictionary.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/NavigationMenuFooterButtonCustomizationDictionary.xslt new file mode 100644 index 0000000..5e1f25d --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/NavigationMenuFooterButtonCustomizationDictionary.xslt @@ -0,0 +1,165 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BackgroundHover + + + + + + + + BackgroundNormal + + + + + + + + BackgroundPressed + + + + + + + + BorderHover + + + + + + + + BorderNormal + + + + + + + + BorderPressed + + + + + + + + FocusVisualBrush + + + + + + + + ForegroundHover + + + + + + + + ForegroundNormal + + + + + + + + ForegroundPressed + + + + + + + + IconForegroundHover + + + + + + + + IconForegroundNormal + + + + + + + + IconForegroundPressed + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/NavigationMenuFooterButtonStyle.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/NavigationMenuFooterButtonStyle.xslt new file mode 100644 index 0000000..d573d9d --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/NavigationMenuFooterButtonStyle.xslt @@ -0,0 +1,269 @@ + + + + + + + + + + + + + + + + NavigationMenuFooterButtons + + + + + + + + + + + + + + + + + + + + visuals:NavigationMenuFooterButton + NavigationMenuFooterButtonUniversal + + + + + + NavigationMenuFooterButton_Badge_Margin + + + + + + NavigationMenuFooterButton_Badge_Style + + + + + + + + + + NavigationMenuFooterButton_Container_BackgroundBrush + + + BackgroundNormal + + + + + + + + + NavigationMenuFooterButton_Container_BorderBrush + + + BorderNormal + + + + + + + + + NavigationMenuFooterButton_Container_BorderThickness + + + + + + + + + + NavigationMenuFooterButton_Container_CornerRadius + + + + + NavigationMenuFooterButton_FocusVisualStyle + + + + + + NavigationMenuFooterButton_Height + + + + + NavigationMenuFooterButton_Icon_Brush + + + IconForegroundNormal + + + + + + + + NavigationMenuFooterButton_Padding + + + + + NavigationMenuFooterButton_Width + + + + + + + + + visuals:StateService.State + Hover + + + + + + NavigationMenuFooterButton_Container_BackgroundBrush + + + BackgroundHover + + + + + + + + + + NavigationMenuFooterButton_Container_BorderBrush + + + BorderHover + + + + + + + + + NavigationMenuFooterButton_Container_BorderThickness + + + + + + + + + + + NavigationMenuFooterButton_Icon_Brush + + + IconForegroundHover + + + + + + + + + + + + visuals:StateService.State + Pressed + + + + + + NavigationMenuFooterButton_Container_BackgroundBrush + + + BackgroundPressed + + + + + + + + + + NavigationMenuFooterButton_Container_BorderBrush + + + BorderPressed + + + + + + + + + NavigationMenuFooterButton_Container_BorderThickness + + + + + + + + + + + NavigationMenuFooterButton_Icon_Brush + + + IconForegroundPressed + + + + + + + + + + + + + + diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/NotificationHintCustomizationDictionary.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/NotificationHintCustomizationDictionary.xslt new file mode 100644 index 0000000..7d58df9 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/NotificationHintCustomizationDictionary.xslt @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ForegroundDanger + + + + + + ForegroundInfo + + + + + + ForegroundPositive + + + + + + ForegroundWarning + + + + + + IconForegroundDanger + + + + + + IconForegroundInfo + + + + + + IconForegroundPositive + + + + + + IconForegroundWarning + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/NotificationHintStyle.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/NotificationHintStyle.xslt new file mode 100644 index 0000000..031208f --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/NotificationHintStyle.xslt @@ -0,0 +1,267 @@ + + + + + + + + + + + + + + + + + + NotificationHints + + + + + + + + + + + + + + + + + + + + visuals:NotificationHint + NotificationHintUniversal + + + + + + + + + TextBlock + + TextStyleDanger + + + + TextElement.Foreground + + + ForegroundDanger + + + + + + + + + + TextBlock + + TextStyleInfo + + + + TextElement.Foreground + + + ForegroundInfo + + + + + + + + + + TextBlock + + TextStylePositive + + + + TextElement.Foreground + + + ForegroundPositive + + + + + + + + + + TextBlock + + TextStyleWarning + + + + TextElement.Foreground + + + ForegroundWarning + + + + + + + + + + + + NotificationHint_Icon_Margin + + + + + + + + + + Type + Danger + + + + + NotificationHint_Icon_Color + IconForegroundDanger + + + + + + NotificationHint_Icon_Name + + + + + + NotificationHint_TextStyle + TextStyleDanger + + + + + + + + Type + Info + + + + + NotificationHint_Icon_Color + IconForegroundInfo + + + + + + NotificationHint_Icon_Name + + + + + + NotificationHint_TextStyle + TextStyleInfo + + + + + + + + Type + Positive + + + + + NotificationHint_Icon_Color + IconForegroundPositive + + + + + + NotificationHint_Icon_Name + + + + + + NotificationHint_TextStyle + TextStylePositive + + + + + + + + Type + Warning + + + + + NotificationHint_Icon_Color + IconForegroundWarning + + + + + + NotificationHint_Icon_Name + + + + + + NotificationHint_TextStyle + TextStyleWarning + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/NotificationPanelCustomizationDictionary.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/NotificationPanelCustomizationDictionary.xslt new file mode 100644 index 0000000..0114336 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/NotificationPanelCustomizationDictionary.xslt @@ -0,0 +1,151 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BackgroundDanger + + + + + + BackgroundInfo + + + + + + BackgroundPositive + + + + + + BackgroundWarning + + + + + + BorderColorDanger + + + + + + BorderColorInfo + + + + + + BorderColorPositive + + + + + + BorderColorWarning + + + + + + HeaderForeground + + + + + + IconForegroundDanger + + + + + + IconForegroundInfo + + + + + + IconForegroundPositive + + + + + + IconForegroundWarning + + + + + + SubHeaderForeground + + + + + + TextForeground + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/NotificationPanelStyle.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/NotificationPanelStyle.xslt new file mode 100644 index 0000000..cd59727 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/NotificationPanelStyle.xslt @@ -0,0 +1,470 @@ + + + + + + + + + + + + + + + + + + NotificationPanels + + + + + + + + + + + + + + + + + + + + visuals:NotificationPanel + NotificationPanelUniversal + + + + + + + + + TextBlock + + HeaderStyle + + + + TextElement.Foreground + + + HeaderForeground + + + + + + + + + + TextBlock + + SubHeaderStyle + + + + TextElement.Foreground + + + SubHeaderForeground + + + + + + + + + + TextBlock + + TextStyle + + + + TextElement.Foreground + + + TextForeground + + + + + + + + + + + + NotificationPanel_ButtonStyle + + + + + + + + + + NotificationPanel_CornerRadius + + + + + NotificationPanel_Header_Margin + + + + + + NotificationPanel_HeaderStyle + + + HeaderStyle + + + + + + + NotificationPanel_Icon_Height + + + + + + NotificationPanel_Icon_Margin + + + + + + NotificationPanel_Icon_Width + + + + + + NotificationPanel_Padding + + + + + NotificationPanel_RightBar_Margin + + + + + + NotificationPanel_SplitButtonStyle + + + + + + + + + + NotificationPanel_SubHeader_Margin + + + + + + NotificationPanel_SubHeaderStyle + + + SubHeaderStyle + + + + + + + NotificationPanel_TextContainer_Margin + + + + + + NotificationPanel_Text_Margin + + + + + + NotificationPanel_TextStyle + + + TextStyle + + + + + + + + + + + Type + Danger + + + + + NotificationPanel_Background + + + BackgroundDanger + + + + + + + + NotificationPanel_BorderBrush + + + BorderColorDanger + + + + + + + + NotificationPanel_BorderThickness + + + + + + + + + + NotificationPanel_Icon_Color + + + IconForegroundDanger + + + + + + + + NotificationPanel_Icon_Name + + + + + + + + + Type + Info + + + + + NotificationPanel_Background + + + BackgroundInfo + + + + + + + + NotificationPanel_BorderBrush + + + BorderColorInfo + + + + + + + + NotificationPanel_BorderThickness + + + + + + + + + + NotificationPanel_Icon_Color + + + IconForegroundInfo + + + + + + + + NotificationPanel_Icon_Name + + + + + + + + + Type + Positive + + + + + NotificationPanel_Background + + + BackgroundPositive + + + + + + + + NotificationPanel_BorderBrush + + + BorderColorPositive + + + + + + + + NotificationPanel_BorderThickness + + + + + + + + + + NotificationPanel_Icon_Color + + + IconForegroundPositive + + + + + + + + NotificationPanel_Icon_Name + + + + + + + + + Type + Warning + + + + + NotificationPanel_Background + + + BackgroundWarning + + + + + + + + NotificationPanel_BorderBrush + + + BorderColorWarning + + + + + + + + NotificationPanel_BorderThickness + + + + + + + + + + NotificationPanel_Icon_Color + + + IconForegroundWarning + + + + + + + + NotificationPanel_Icon_Name + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/NotificationSpinnerStyle.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/NotificationSpinnerStyle.xslt new file mode 100644 index 0000000..0e574bc --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/NotificationSpinnerStyle.xslt @@ -0,0 +1,151 @@ + + + + + + + + + + + + + + + + + + NotificationSpinners + + + + + + + + + + + + + + + + + + + + visuals:NotificationSpinner + NotificationSpinnerUniversal + + + + + + + + TextBlock + + HeaderStyle + + + + + TextBlock.TextAlignment + + + + + + + + + visuals:Spinner + + SpinnerStyle + + + + + TextBlock + + TextStyle + + + + + TextBlock.TextAlignment + + + + + + + + + + + NotificationSpinner_Header_Style + + + HeaderStyle + + + + + + + NotificationSpinner_Orientation + + + + + + NotificationSpinner_Spinner_Margin + + + + + + NotificationSpinner_Spinner_Style + SpinnerStyle + + + + + NotificationSpinner_Text_Margin + + + + + + NotificationSpinner_Text_Style + + + TextStyle + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/NumberInputStyle.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/NumberInputStyle.xslt new file mode 100644 index 0000000..6630c95 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/NumberInputStyle.xslt @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + NumberInputs + + + + + + + + + + + + + + + + + + + + visuals:NumberInput + NumberInputUniversal + + + + + + NumberInput_ActionDecrease_IconName + + + + + + NumberInput_ActionIncrease_IconName + + + + + + + + + + diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/PasswordInputCustomizationDictionary.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/PasswordInputCustomizationDictionary.xslt new file mode 100644 index 0000000..b8da1c9 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/PasswordInputCustomizationDictionary.xslt @@ -0,0 +1,181 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BackgroundDisabled + + + + + + BackgroundFocus + + + + + + BackgroundHover + + + + + + BackgroundInvalidFocus + + + + + + BackgroundInvalidHover + + + + + + BackgroundInvalidNormal + + + + + + BackgroundNormal + + + + + + BorderColorDisabled + + + + + + BorderColorFocus + + + + + + BorderColorHover + + + + + + BorderColorInvalidFocus + + + + + + BorderColorInvalidHover + + + + + + BorderColorInvalidNormal + + + + + + BorderColorNormal + + + + + + CaptionForeground + + + + + + CaretBrush + + + + + + LabelForeground + + + + + + PlaceholderForeground + + + + + + TextForegroundDisabled + + + + + + TextForeground + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/PasswordInputStyle.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/PasswordInputStyle.xslt new file mode 100644 index 0000000..ecdf555 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/PasswordInputStyle.xslt @@ -0,0 +1,420 @@ + + + + + + + + + + + + + + + + + + PasswordInputs + + + + + + + + + + + + + + + + + + + + {x:Type visuals:PasswordInput} + {StaticResource PasswordInputUniversal} + + + + + + + + + + TextBlock + + CaptionStyle + + + + TextElement.Foreground + + + CaptionForeground + + + + + + + + + + TextBlock + + LabelStyle + + + + TextElement.Foreground + + + LabelForeground + + + + + + + + + + + + PasswordInput_ActionBar_Margin + + + + + + PasswordInput_Background + BackgroundNormal + + + + + + PasswordInput_BorderBrush + BorderColorNormal + + + + + + PasswordInput_BorderThickness + + + + + + PasswordInput_CaretBrush + CaretBrush + + + + + + PasswordInput_CornerRadius + + + + + PasswordInput_Height + + + + + PasswordInput_Padding + + + + + PasswordInput_Placeholder_Foreground + PlaceholderForeground + + + + + + PasswordInput_PlaceholderStyle + + + + + + PasswordInput_CaptionStyle + CaptionStyle + + + + + PasswordInput_Caption_Margin + + + + + + PasswordInput_LabelStyle + LabelStyle + + + + + PasswordInput_Label_Margin + + + + + + PasswordInput_TextForeground + TextForeground + + + + + + PasswordInput_ValidationPopupStyle + + + + + + + + FontMode + Regular + + + + + PasswordInput_TextStyle + + + + + + + + + FontMode + Monospace + + + + + PasswordInput_TextStyle + + + + + + + + + visuals:StateService.TextInputState + Disabled + + + + + PasswordInput_Background + BackgroundDisabled + + + + + + PasswordInput_BorderBrush + BorderColorDisabled + + + + + + PasswordInput_BorderThickness + + + + + + PasswordInput_TextForeground + TextForegroundDisabled + + + + + + + + + visuals:StateService.TextInputState + Hover + + + + + PasswordInput_Background + BackgroundHover + + + + + + PasswordInput_BorderBrush + BorderColorHover + + + + + + PasswordInput_BorderThickness + + + + + + + + + visuals:StateService.TextInputState + Focus + + + + + PasswordInput_Background + BackgroundFocus + + + + + + PasswordInput_BorderBrush + BorderColorFocus + + + + + + PasswordInput_BorderThickness + + + + + + + + + visuals:StateService.TextInputState + InvalidNormal + + + + + PasswordInput_Background + BackgroundInvalidNormal + + + + + + PasswordInput_BorderBrush + BorderColorInvalidNormal + + + + + + PasswordInput_BorderThickness + + + + + + + + + visuals:StateService.TextInputState + InvalidHover + + + + + PasswordInput_Background + BackgroundInvalidHover + + + + + + PasswordInput_BorderBrush + BorderColorInvalidHover + + + + + + PasswordInput_BorderThickness + + + + + + + + + visuals:StateService.TextInputState + InvalidFocus + + + + + PasswordInput_Background + BackgroundInvalidFocus + + + + + + PasswordInput_BorderBrush + BorderColorInvalidFocus + + + + + + PasswordInput_BorderThickness + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/PopupCustomizationDictionary.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/PopupCustomizationDictionary.xslt new file mode 100644 index 0000000..87cc7a8 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/PopupCustomizationDictionary.xslt @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Background + + + + + + + + BorderColor + + + + + + + + Foreground + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/PopupStyle.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/PopupStyle.xslt new file mode 100644 index 0000000..183f2c7 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/PopupStyle.xslt @@ -0,0 +1,313 @@ + + + + + + + + + + + + + + + + + + Popups + + + + + + + + + + + + + + + + + + + + visuals:Popup + PopupUniversal + + + + + + + + + + TextBlock + + HeaderStyle + + + + + TextElement.Foreground + + + Foreground + + + + + + + + + + + + + TextBlock + + TextStyle + + + + + TextElement.Foreground + + + Foreground + + + + + + + + + + + + + + + Popup_Background + + + Background + + + + + + + + + Popup_BorderBrush + + + BorderColor + + + + + + + + Popup_BorderThickness + + + + + + + + + + Popup_CornerRadius + + + + + Popup_Header_Margin + + + + + + + Popup_HeaderStyle + + + HeaderStyle + + + + + + + + + Popup_MinHeight + + + + + + + Popup_Offset + + + + + + + + + + Popup_Padding + + + + + Popup_Shadow + + + + + + + Popup_TextStyle + + + TextStyle + + + + + + + + + + + + PopupPosition + Bottom + + + + + Popup_ArrowIcon + + + + + + + + + + + + + + + + + + PopupPosition + Left + + + + + Popup_ArrowIcon + + + + + + + + + + + + + + + + + + PopupPosition + Right + + + + + Popup_ArrowIcon + + + + + + + + + + + + + + + + + + PopupPosition + Top + + + + + Popup_ArrowIcon + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ProgressBarCustomizationDictionary.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ProgressBarCustomizationDictionary.xslt new file mode 100644 index 0000000..239e69a --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ProgressBarCustomizationDictionary.xslt @@ -0,0 +1,145 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Background + + + + + + EstimationForeground + + + + + + EstimationForegroundDisabled + + + + + + GlowColor + + + + + + IndicatorColorDanger + + + + + + IndicatorColorDisabled + + + + + + IndicatorColorInfo + + + + + + IndicatorColorNeutral + + + + + + IndicatorColorPositive + + + + + + IndicatorColorWarning + + + + + + StateForeground + + + + + + StateForegroundDisabled + + + + + + ValueForeground + + + + + + ValueForegroundDisabled + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ProgressBarStyle.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ProgressBarStyle.xslt new file mode 100644 index 0000000..865aeb2 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ProgressBarStyle.xslt @@ -0,0 +1,385 @@ + + + + + + + + + + + + + + + + + + ProgressBars + + + + + + + + + + + + + + + + + + + + visuals:ProgressBar + ProgressBarUniversal + + + + + + + + + TextBlock + + EstimationTextStyle + + + + TextElement.Foreground + + + EstimationForeground + + + + + + + + + + TextBlock + + EstimationTextDisabledStyle + + + + TextElement.Foreground + + + EstimationForegroundDisabled + + + + + + + + + + TextBlock + + StateTextStyle + + + + TextElement.Foreground + + + StateForeground + + + + + + + + + + TextBlock + + StateTextDisabledStyle + + + + TextElement.Foreground + + + StateForegroundDisabled + + + + + + + + + + TextBlock + + ValueTextStyle + + + + TextElement.Foreground + + + ValueForeground + + + + + + + + + + TextBlock + + ValueTextDisabledStyle + + + + TextElement.Foreground + + + ValueForegroundDisabled + + + + + + + + + + + + + ProgressBar_EstimationTextStyle + + + EstimationTextStyle + + + + + + + ProgressBar_Glow_Brush + GlowColor + + + + + + ProgressBar_Glow_Width + + + + + + ProgressBar_Padding + + + + + ProgressBar_Track_Background + Background + + + + + + ProgressBar_Track_CornerRadius + + + + + ProgressBar_Track_Height + + + + + ProgressBar_State_Margin + + + + + + ProgressBar_StateTextStyle + + + StateTextStyle + + + + + + + ProgressBar_ValueTextStyle + + + ValueTextStyle + + + + + + + + + + + Type + Danger + + + + + ProgressBar_Indicator_Foreground + IndicatorColorDanger + + + + + + + + + Type + Info + + + + + ProgressBar_Indicator_Foreground + IndicatorColorInfo + + + + + + + + + Type + Neutral + + + + + ProgressBar_Indicator_Foreground + IndicatorColorNeutral + + + + + + + + + Type + Positive + + + + + ProgressBar_Indicator_Foreground + IndicatorColorPositive + + + + + + + + + Type + Warning + + + + + ProgressBar_Indicator_Foreground + IndicatorColorWarning + + + + + + + + + visuals:StateService.State + Disabled + + + + + ProgressBar_EstimationTextStyle + + + EstimationTextDisabledStyle + + + + + + + ProgressBar_Indicator_Foreground + IndicatorColorDisabled + + + + + + ProgressBar_StateTextStyle + + + StateTextDisabledStyle + + + + + + + ProgressBar_ValueTextStyle + + + ValueTextDisabledStyle + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/RoundProgressCustomizationDictionary.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/RoundProgressCustomizationDictionary.xslt new file mode 100644 index 0000000..f4fa679 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/RoundProgressCustomizationDictionary.xslt @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Indicator + + + + + + IndicatorDisabled + + + + + + Track + + + + + + TrackDisabled + + + + + + ValueForeground + + + + + + ValueForegroundDisabled + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/RoundProgressStyle.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/RoundProgressStyle.xslt new file mode 100644 index 0000000..0d4459a --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/RoundProgressStyle.xslt @@ -0,0 +1,184 @@ + + + + + + + + + + + + + + + + + + RoundProgresses + + + + + + + + + + + + + + + + + + + + visuals:RoundProgress + RoundProgressUniversal + + + + + + + + + TextBlock + + ValueTextStyle + + + + + TextElement.Foreground + + + ValueForeground + + + + + + + + + + + TextBlock + + ValueTextDisabledStyle + + + + + TextElement.Foreground + + + ValueForegroundDisabled + + + + + + + + + + + + + RoundProgress_Diameter + + + + + + RoundProgress_Indicator + Indicator + + + + + + RoundProgress_StrokeThickness + + + + + + RoundProgress_Track + Track + + + + + + RoundProgress_ValueTextStyle + + + ValueTextStyle + + + + + + + + + + + visuals:StateService.State + Disabled + + + + + RoundProgress_Indicator + IndicatorDisabled + + + + + + RoundProgress_Track + TrackDisabled + + + + + + RoundProgress_ValueTextStyle + + + ValueTextDisabledStyle + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/RoundTimerCustomizationDictionary.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/RoundTimerCustomizationDictionary.xslt new file mode 100644 index 0000000..66ea0b2 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/RoundTimerCustomizationDictionary.xslt @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IndicatorColorDanger + + + + + + IndicatorColorDisabled + + + + + + IndicatorColorInfo + + + + + + IndicatorColorPositive + + + + + + IndicatorColorWarning + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/RoundTimerStyle.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/RoundTimerStyle.xslt new file mode 100644 index 0000000..6b526b2 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/RoundTimerStyle.xslt @@ -0,0 +1,162 @@ + + + + + + + + + + + + + + + + + + RoundTimers + + + + + + + + + + + + + + + + + + + + visuals:RoundTimer + RoundTimerUniversal + + + + + + RoundTimer_Diameter + + + + + + RoundTimer_Indicator + Indicator + + + + + + + + + + Type + Danger + + + + + RoundTimer_Indicator + IndicatorColorDanger + + + + + + + + + Type + Info + + + + + RoundTimer_Indicator + IndicatorColorInfo + + + + + + + + + Type + Positive + + + + + RoundTimer_Indicator + IndicatorColorPositive + + + + + + + + + Type + Warning + + + + + RoundTimer_Indicator + IndicatorColorWarning + + + + + + + + + visuals:StateService.State + Disabled + + + + + RoundTimer_Indicator + IndicatorColorDisabled + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ScrollBarCustomizationDictionary.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ScrollBarCustomizationDictionary.xslt new file mode 100644 index 0000000..7c48430 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ScrollBarCustomizationDictionary.xslt @@ -0,0 +1,125 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BackgroundDisabled + + + + + + + + BackgroundHover + + + + + + + + BackgroundNormal + + + + + + + + BackgroundPressed + + + + + + + + ThumbColorDisabled + + + + + + + + ThumbColorHover + + + + + + + + ThumbColorNormal + + + + + + + + ThumbColorPressed + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ScrollBarStyle.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ScrollBarStyle.xslt new file mode 100644 index 0000000..11c3346 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ScrollBarStyle.xslt @@ -0,0 +1,679 @@ + + + + + + + + + + + + + + + + + + ScrollBars + + + + + + + + + + + + + + + + + + + + ScrollBar + ScrollBarUniversal + + + + + + + + + Thumb + ScrollBarThumbUniversal + ThumbStyle + + + + + + ScrollBarThumb_Background + + + ThumbColorNormal + + + + + + + + + ScrollBarThumb_CornerRadius + + + + + + + + + + visuals:StateService.State + Disabled + + + + + + ScrollBarThumb_Background + + + ThumbColorDisabled + + + + + + + + + ScrollBarThumb_CornerRadius + + + + + + + + + visuals:StateService.State + Hover + + + + + + ScrollBarThumb_Background + + + ThumbColorHover + + + + + + + + + ScrollBarThumb_CornerRadius + + + + + + + + + visuals:StateService.State + Pressed + + + + + + ScrollBarThumb_Background + + + ThumbColorPressed + + + + + + + + + ScrollBarThumb_CornerRadius + + + + + + + + + + + + + + + Orientation + + + FindAncestor + ScrollBar + + + + + Horizontal + + + + + + + visuals:StateService.State + + + + + + Disabled + + + + + + + + + ScrollBarThumb_Margin + + + + + + + + + + + + + + + Orientation + + + FindAncestor + ScrollBar + + + + + Horizontal + + + + + + + visuals:StateService.State + + + + + + Hover + + + + + + + + + ScrollBarThumb_Margin + + + + + + + + + + + + + + + Orientation + + + FindAncestor + ScrollBar + + + + + Horizontal + + + + + + + visuals:StateService.State + + + + + + Normal + + + + + + + + + ScrollBarThumb_Margin + + + + + + + + + + + + + + + Orientation + + + FindAncestor + ScrollBar + + + + + Horizontal + + + + + + + visuals:StateService.State + + + + + + Pressed + + + + + + + + + ScrollBarThumb_Margin + + + + + + + + + + + + + + + Orientation + + + FindAncestor + ScrollBar + + + + + Vertical + + + + + + + visuals:StateService.State + + + + + + Disabled + + + + + + + + + ScrollBarThumb_Margin + + + + + + + + + + + + + + + Orientation + + + FindAncestor + ScrollBar + + + + + Vertical + + + + + + + visuals:StateService.State + + + + + + Hover + + + + + + + + + ScrollBarThumb_Margin + + + + + + + + + + + + + + + Orientation + + + FindAncestor + ScrollBar + + + + + Vertical + + + + + + + visuals:StateService.State + + + + + + Normal + + + + + + + + + ScrollBarThumb_Margin + + + + + + + + + + + + + + + Orientation + + + FindAncestor + ScrollBar + + + + + Vertical + + + + + + + visuals:StateService.State + + + + + + Pressed + + + + + + + + + ScrollBarThumb_Margin + + + + + + + + + + + + + + + ScrollBar_Background + + + BackgroundNormal + + + + + + + + + + ScrollBar_Size + + + + + + + ScrollBar_ThumbStyle + + + ThumbStyle + + + + + + + + + + + visuals:StateService.State + Disabled + + + + + + ScrollBar_Size + + + + + + + + ScrollBar_Background + + + BackgroundDisabled + + + + + + + + + + + + visuals:StateService.State + Hover + + + + + + ScrollBar_Size + + + + + + + + ScrollBar_Background + + + BackgroundHover + + + + + + + + + + + + visuals:StateService.State + Pressed + + + + + + ScrollBar_Size + + + + + + + + ScrollBar_Background + + + BackgroundPressed + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/SearchCustomizationDictionary.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/SearchCustomizationDictionary.xslt new file mode 100644 index 0000000..2e39081 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/SearchCustomizationDictionary.xslt @@ -0,0 +1,151 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BackgroundDisabled + + + + + + BackgroundFocus + + + + + + BackgroundHover + + + + + + BackgroundNormal + + + + + + BorderColorDisabled + + + + + + BorderColorFocus + + + + + + BorderColorHover + + + + + + BorderColorNormal + + + + + + CaretBrush + + + + + + PlaceholderForeground + + + + + + PlaceholderForegroundDisabled + + + + + + SearchIconForeground + + + + + + SearchIconForegroundDisabled + + + + + + TextForeground + + + + + + TextForegroundDisabled + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/SearchStyle.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/SearchStyle.xslt new file mode 100644 index 0000000..9a403df --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/SearchStyle.xslt @@ -0,0 +1,327 @@ + + + + + + + + + + + + + + + + + + Searches + + + + + + + + + + + + + + + + + + + + {x:Type visuals:Search} + {StaticResource SearchUniversal} + + + + + + + + + + visuals:TextInput + TextInputStyle + + + + + Search_TextInput_CaretBrush + CaretBrush + + + + + + Search_TextInput_Padding + + + + + Search_TextInput_PlaceholderForeground + PlaceholderForeground + + + + + + Search_TextInput_PlaceholderStyle + + + + + + Search_TextInput_TextForeground + TextForeground + + + + + + Search_TextInput_TextStyle + + + + + + + + visuals:StateService.TextInputState + Disabled + + + + + Search_TextInput_PlaceholderForeground + PlaceholderForegroundDisabled + + + + + + Search_TextInput_TextForeground + TextForegroundDisabled + + + + + + + + + + + + + + + + + Search_Background + BackgroundNormal + + + + + + Search_BorderBrush + BorderColorNormal + + + + + + Search_BorderThickness + + + + + + Search_ClearButtonIcon + + + + + + Search_ClearButtonMargin + + + + + + Search_ClearButtonStyle + + + + + + Search_CornerRadius + + + + + Search_Height + + + + + Search_Icon + + + + + + Search_IconForeground + SearchIconForeground + + + + + + Search_IconMargin + + + + + + Search_TextInputStyle + TextInputStyle + + + + + Search_SpinnerMargin + + + + + + Search_SpinnerStyle + + + + + + + + visuals:StateService.TextInputState + Disabled + + + + + Search_Background + BackgroundDisabled + + + + + + Search_BorderBrush + BorderColorDisabled + + + + + + Search_BorderThickness + + + + + + Search_IconForeground + SearchIconForegroundDisabled + + + + + + + + + visuals:StateService.TextInputState + Hover + + + + + Search_Background + BackgroundHover + + + + + + Search_BorderBrush + BorderColorHover + + + + + + Search_BorderThickness + + + + + + + + + visuals:StateService.TextInputState + Focus + + + + + Search_Background + BackgroundFocus + + + + + + Search_BorderBrush + BorderColorFocus + + + + + + Search_BorderThickness + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/SelectCustomizationDictionary.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/SelectCustomizationDictionary.xslt new file mode 100644 index 0000000..5a9e036 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/SelectCustomizationDictionary.xslt @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CaptionForeground + + + + + + CaptionForegroundDisabled + + + + + + LabelForeground + + + + + + LabelForegroundDisabled + + + + + + PopupDecoratorBackground + + + + + + PopupDecoratorBorderColor + + + + + + PopupDecoratorShadow + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/SelectItemCustomizationDictionary.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/SelectItemCustomizationDictionary.xslt new file mode 100644 index 0000000..a34e5e4 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/SelectItemCustomizationDictionary.xslt @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BackgroundHover + + + + + + BackgroundNormal + + + + + + BackgroundPressed + + + + + + IconForeground + + + + + + SelectionBackground + + + + + + TextForeground + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/SelectItemStyle.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/SelectItemStyle.xslt new file mode 100644 index 0000000..69c1f9e --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/SelectItemStyle.xslt @@ -0,0 +1,171 @@ + + + + + + + + + + + + + + + + + + SelectItems + + + + + + + + + + + + + + + + + + + + visuals:SelectItem + SelectItemUniversal + + + + + + + + + TextBlock + + TextStyle + + + + TextElement.Foreground + + + TextForeground + + + + + + + + + + + + SelectItem_Icon_Foreground + IconForeground + + + + + + SelectItem_Icon_Margin + + + + + + SelectItem_Padding + + + + + SelectItem_SelectionBackground + SelectionBackground + + + + + + SelectItem_TextStyle + TextStyle + + + + + + + + + visuals:StateService.State + Hover + + + + + SelectItem_StateBackground + BackgroundHover + + + + + + + + + visuals:StateService.State + Normal + + + + + SelectItem_StateBackground + BackgroundNormal + + + + + + + + + visuals:StateService.State + Pressed + + + + + SelectItem_StateBackground + BackgroundPressed + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/SelectPresenterCustomizationDictionary.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/SelectPresenterCustomizationDictionary.xslt new file mode 100644 index 0000000..34a8c8a --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/SelectPresenterCustomizationDictionary.xslt @@ -0,0 +1,193 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ArrowIconForeground + + + + + + ArrowIconForegroundDisabled + + + + + + BackgroundDisabled + + + + + + BackgroundFocus + + + + + + BackgroundHover + + + + + + BackgroundInvalidFocus + + + + + + BackgroundInvalidHover + + + + + + BackgroundInvalidNormal + + + + + + BackgroundNormal + + + + + + BorderColorDisabled + + + + + + BorderColorFocus + + + + + + BorderColorHover + + + + + + BorderColorInvalidFocus + + + + + + BorderColorInvalidHover + + + + + + BorderColorInvalidNormal + + + + + + BorderColorNormal + + + + + + CaretBrush + + + + + + IconForeground + + + + + + IconForegroundDisabled + + + + + + PlaceholderForeground + + + + + + TextForeground + + + + + + TextForegroundDisabled + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/SelectPresenterStyle.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/SelectPresenterStyle.xslt new file mode 100644 index 0000000..f6384d9 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/SelectPresenterStyle.xslt @@ -0,0 +1,434 @@ + + + + + + + + + + + + + + + + + + SelectPresenters + + + + + + + + + + + + + + + + + + + + {x:Type visuals:SelectPresenter} + {StaticResource SelectPresenterUniversal} + + + + + + + + + + visuals:TextInput + TextInputStyle + + + + + SelectPresenter_TextInput_CaretBrush + CaretBrush + + + + + + SelectPresenter_TextInput_Placeholder_Foreground + PlaceholderForeground + + + + + + SelectPresenter_TextInput_Placeholder_TextStyle + + + + + + SelectPresenter_TextInput_Foreground + TextForeground + + + + + + SelectPresenter_TextInput_TextStyle + + + + + + + + + + + + SelectPresenter_ArrowIcon_Foreground + ArrowIconForeground + + + + + + SelectPresenter_ArrowIcon_Margin + + + + + + SelectPresenter_Background + BackgroundNormal + + + + + + SelectPresenter_BorderBrush + BorderColorNormal + + + + + + SelectPresenter_BorderThickness + + + + + + SelectPresenter_CornerRadius + + + + + SelectPresenter_Height + + + + + SelectPresenter_ItemHeader_Foreground + TextForeground + + + + + + SelectPresenter_ItemHeader_TextStyle + + + + + + SelectPresenter_ItemIcon_Foreground + IconForeground + + + + + + SelectPresenter_ItemIcon_Margin + + + + + + SelectPresenter_Padding + + + + + SelectPresenter_Placeholder_Foreground + PlaceholderForeground + + + + + + SelectPresenter_Placeholder_TextStyle + + + + + + SelectPresenter_TextInputStyle + TextInputStyle + + + + + + + IsActive + True + + + + + SelectPresenter_ArrowIcon_Name + + + + + + + + + IsActive + False + + + + + SelectPresenter_ArrowIcon_Name + + + + + + + + + visuals:StateService.TextInputState + Disabled + + + + + SelectPresenter_Background + BackgroundDisabled + + + + + + SelectPresenter_BorderBrush + BorderColorDisabled + + + + + + SelectPresenter_BorderThickness + + + + + + SelectPresenter_ArrowIcon_Foreground + ArrowIconForegroundDisabled + + + + + + SelectPresenter_ItemHeader_Foreground + TextForegroundDisabled + + + + + + SelectPresenter_ItemIcon_Foreground + IconForegroundDisabled + + + + + + + + + visuals:StateService.TextInputState + Hover + + + + + SelectPresenter_Background + BackgroundHover + + + + + + SelectPresenter_BorderBrush + BorderColorHover + + + + + + SelectPresenter_BorderThickness + + + + + + + + + visuals:StateService.TextInputState + Focus + + + + + SelectPresenter_Background + BackgroundFocus + + + + + + SelectPresenter_BorderBrush + BorderColorFocus + + + + + + SelectPresenter_BorderThickness + + + + + + + + + visuals:StateService.TextInputState + InvalidNormal + + + + + SelectPresenter_Background + BackgroundInvalidNormal + + + + + + SelectPresenter_BorderBrush + BorderColorInvalidNormal + + + + + + SelectPresenter_BorderThickness + + + + + + + + + visuals:StateService.TextInputState + InvalidHover + + + + + SelectPresenter_Background + BackgroundInvalidHover + + + + + + SelectPresenter_BorderBrush + BorderColorInvalidHover + + + + + + SelectPresenter_BorderThickness + + + + + + + + + visuals:StateService.TextInputState + InvalidFocus + + + + + SelectPresenter_Background + BackgroundInvalidFocus + + + + + + SelectPresenter_BorderBrush + BorderColorInvalidFocus + + + + + + SelectPresenter_BorderThickness + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/SelectStyle.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/SelectStyle.xslt new file mode 100644 index 0000000..ded4897 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/SelectStyle.xslt @@ -0,0 +1,198 @@ + + + + + + + + + + + + + + + + + + Selects + + + + + + + + + + + + + + + + + + + + visuals:Select + SelectUniversal + + + + + + + + + TextBlock + + CaptionStyle + + + + TextElement.Foreground + CaptionForeground + + + + + + + + TextBlock + + LabelStyle + + + + TextElement.Foreground + LabelForeground + + + + + + + + visuals:SelectPopupDecorator + PopupDecoratorUniversal + PopupDecoratorStyle + + + + + PopupDecorator_Background + PopupDecoratorBackground + + + + + + PopupDecorator_BorderBrush + PopupDecoratorBorderColor + + + + + + PopupDecorator_BorderThickness + + + + + + PopupDecorator_CornerRadius + + + + + + PopupDecorator_Padding + + + + + + PopupDecorator_Shadow + + + + + + + + + + + + Select_Caption_Margin + + + + + + Select_CaptionStyle + CaptionStyle + + + + + Select_ItemContainerStyle + + + + + + Select_Label_Margin + + + + + + Select_LabelStyle + LabelStyle + + + + + Select_PopupDecoratorStyle + PopupDecoratorStyle + + + + + Select_SelectPresenterStyle + + + + + + Select_ValidationPopupStyle + + + + + + + + + + diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/SelectableTextCustomizationDictionary.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/SelectableTextCustomizationDictionary.xslt new file mode 100644 index 0000000..5c01235 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/SelectableTextCustomizationDictionary.xslt @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BackgroundHover + + + + + + BackgroundNormal + + + + + + BackgroundPressed + + + + + + ForegroundHover + + + + + + ForegroundNormal + + + + + + ForegroundPressed + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/SelectableTextStyle.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/SelectableTextStyle.xslt new file mode 100644 index 0000000..922b34a --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/SelectableTextStyle.xslt @@ -0,0 +1,169 @@ + + + + + + + + + + + + + + + + + + SelectableTexts + + + + + + + + + + + + + + + + + + + + visuals:SelectableText + SelectableTextUniversal + + + + + + + + + Hyperlink + HyperlinkUniversal + HyperlinkStyle + + + + + Hyperlink_Background + BackgroundNormal + + + + + + Hyperlink_Foreground + ForegroundNormal + + + + + + + + + + visuals:StateService.State + Hover + + + + + Hyperlink_Background + BackgroundHover + + + + + + Hyperlink_Foreground + ForegroundHover + + + + + + + + + visuals:StateService.State + Pressed + + + + + Hyperlink_Background + BackgroundPressed + + + + + + Hyperlink_Foreground + ForegroundPressed + + + + + + + + + + + + + + SelectableText_FontStyle + + + + + + SelectableText_HyperlinkStyle + HyperlinkStyle + + + + + SelectableText_HyperlinkBackgroundPressed + BackgroundPressed + + + + + + SelectableText_PopupStyle + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/SpinnerCustomizationDictionary.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/SpinnerCustomizationDictionary.xslt new file mode 100644 index 0000000..016fb18 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/SpinnerCustomizationDictionary.xslt @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Foreground + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/SpinnerStyle.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/SpinnerStyle.xslt new file mode 100644 index 0000000..d1a699a --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/SpinnerStyle.xslt @@ -0,0 +1,102 @@ + + + + + + + + + + + + + + + + + + Spinners + + + + + + + + + + + + + + + + + + + + {x:Type visuals:Spinner} + {StaticResource SpinnerUniversal} + + + + + + + + Spinner_Foreground + + + Foreground + + + + + + + + + Spinner_Height + + + + + Spinner_Image + + + + + + + + + + + + + + + Spinner_Width + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/SplitButtonCustomizationDictionary.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/SplitButtonCustomizationDictionary.xslt new file mode 100644 index 0000000..74fd313 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/SplitButtonCustomizationDictionary.xslt @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + DividerBackground + + + + + + DividerBackgroundDisabledAll + + + + + + DividerBackgroundDisabledSome + + + + + + DividerBackgroundPressed + + + + + + DividerForeground + + + + + + DividerForegroundDisabledAll + + + + + + DividerForegroundDisabledSome + + + + + + DividerForegroundPressed + + + + + + MainButtonFocusVisualBrush + + + + + + ToggleButtonFocusVisualBrush + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/SplitButtonStyle.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/SplitButtonStyle.xslt new file mode 100644 index 0000000..fd0c438 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/SplitButtonStyle.xslt @@ -0,0 +1,539 @@ + + + + + + + + + + + + + + + + + + SplitButtons + + + + + + + + + + + + + + + + + + + + + + Button + ToggleButton + + + + + visuals:SplitButton + SplitButtonUniversal + + + + + + + + + visuals:Divider + + DividerStyle + + + + Divider_Background + DividerBackground + + + + + Divider_Foreground + DividerForeground + + + + + + + + visuals:Divider + + DividerDisabledAllStyle + + + + Divider_Background + DividerBackgroundDisabledAll + + + + + Divider_Foreground + DividerForegroundDisabledAll + + + + + + + + visuals:Divider + + DividerDisabledSomeStyle + + + + Divider_Background + DividerBackgroundDisabledSome + + + + + Divider_Foreground + DividerForegroundDisabledSome + + + + + + + + visuals:Divider + + DividerPressedStyle + + + + Divider_Background + DividerBackgroundPressed + + + + + Divider_Foreground + DividerForegroundPressed + + + + + + + + Button + + MainButtonStyle + + + + + Button_Container_BorderThickness + + + + + + + + + + Button_Container_CornerRadius + + + + + + Button_FocusVisualStyle + + MainButtonFocusVisualBrush + + + + + + + + + + visuals:StateService.State + Hover + + + + + Button_Container_BorderThickness + + + + + + + + + + + + + visuals:StateService.State + Pressed + + + + + Button_Container_BorderThickness + + + + + + + + + + + + + visuals:StateService.State + Disabled + + + + + Button_Container_BorderThickness + + + + + + + + + + + + + + + + State + + + FindAncestor + visuals:SplitButton + + + + + + Disabled + + + + + + Button_Container_BorderThickness + + + + + + + + + + + + + + + + + ToggleButton + + ToggleButtonStyle + + + + + Button_Container_BorderThickness + + + + + + + + + + Button_Container_CornerRadius + + + + + + Button_FocusVisualStyle + + ToggleButtonFocusVisualBrush + + + + + + + + + + visuals:StateService.State + Hover + + + + + Button_Container_BorderThickness + + + + + + + + + + + + + visuals:StateService.State + Pressed + + + + + Button_Container_BorderThickness + + + + + + + + + + + + + visuals:StateService.State + Disabled + + + + + Button_Container_BorderThickness + + + + + + + + + + + + + + + + State + + + FindAncestor + visuals:SplitButton + + + + + + Disabled + + + + + + Button_Container_BorderThickness + + + + + + + + + + + + + + + + + + + SplitButton_Divider_Style + + + DividerStyle + + + + + + + SplitButton_MainButton_Style + + + MainButtonStyle + + + + + + + SplitButton_ToggleButton_MenuClosedIcon + + + + + + SplitButton_ToggleButton_MenuOpenedIcon + + + + + + SplitButton_ToggleButton_Style + + + ToggleButtonStyle + + + + + + + + + + + State + Disabled + + + + + SplitButton_Divider_Style + DividerDisabledAllStyle + + + + + + + + State + DisabledMain + + + + + SplitButton_Divider_Style + DividerDisabledSomeStyle + + + + + + + + State + DisabledContextMenu + + + + + SplitButton_Divider_Style + DividerDisabledSomeStyle + + + + + + + + State + PressedMain + + + + + SplitButton_Divider_Style + DividerPressedStyle + + + + + + + + State + PressedContextMenu + + + + + SplitButton_Divider_Style + DividerPressedStyle + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/SsoButtonCustomizationDictionary.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/SsoButtonCustomizationDictionary.xslt new file mode 100644 index 0000000..338c1ad --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/SsoButtonCustomizationDictionary.xslt @@ -0,0 +1,195 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BackgroundDisabled + + + + + + BackgroundHover + + + + + + BackgroundNormal + + + + + + BackgroundPressed + + + + + + BorderDisabled + + + + + + BorderHover + + + + + + BorderNormal + + + + + + BorderPressed + + + + + + FocusVisualBrush + + + + + + ForegroundDisabled + + + + + + ForegroundHover + + + + + + ForegroundNormal + + + + + + ForegroundPressed + + + + + + + IconForegroundDisabled + + + + + + + + IconForegroundHover + + + + + + + + IconForegroundNormal + + + + + + + + IconForegroundPressed + + + + + + + ShadowDisabled + + + + + + ShadowHover + + + + + + ShadowNormal + + + + + + ShadowPressed + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/SsoButtonStyle.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/SsoButtonStyle.xslt new file mode 100644 index 0000000..e4a5068 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/SsoButtonStyle.xslt @@ -0,0 +1,439 @@ + + + + + + + + + + + + + + + + + + SsoButtons + + + + + + + + + + + + + + + + + + + + visuals:SsoButton + SsoButtonUniversal + + + + + + + + + TextBlock + + TextStyle + + + + TextElement.Foreground + ForegroundNormal + + + + + + + + TextBlock + + TextStyleDisabled + + + + TextElement.Foreground + ForegroundDisabled + + + + + + + + TextBlock + + TextStyleHover + + + + TextElement.Foreground + ForegroundHover + + + + + + + + TextBlock + + TextStylePressed + + + + TextElement.Foreground + ForegroundPressed + + + + + + + + + + Button_Container_Background + BackgroundNormal + + + + + + Button_Container_BorderBrush + BorderNormal + + + + + + Button_Container_BorderThickness + + + + + + Button_Container_CornerRadius + + + + + Button_Container_Shadow + + + + + + + + Button_Icon_Foreground + IconForegroundNormal + + + + + + + Button_Icon_Opacity + + + + + + Button_Icon_MarginLeft + + + + + + Button_FocusVisualStyle + + + + + + Button_Height + + + + + Button_Opacity + + + + + + Button_Padding + + + + + Button_TextStyle + TextStyle + + + + + Button_TextStyleDisabled + TextStyleDisabled + + + + + Button_TextStyleHover + TextStyleHover + + + + + Button_TextStylePressed + TextStylePressed + + + + + SsoButton_Icon_Name + + + + + + + + + + visuals:StateService.State + Disabled + + + + + Button_Container_Background + BackgroundDisabled + + + + + + Button_Container_BorderBrush + BorderDisabled + + + + + + Button_Container_BorderThickness + + + + + + Button_Container_Shadow + + + + + + + + Button_Icon_Foreground + IconForegroundDisabled + + + + + + + Button_Icon_Opacity + + + + + + Button_Opacity + + + + + + + + + visuals:StateService.State + Hover + + + + + Button_Container_Background + BackgroundHover + + + + + + Button_Container_BorderBrush + BorderHover + + + + + + Button_Container_BorderThickness + + + + + + Button_Container_Shadow + + + + + + + + Button_Icon_Foreground + IconForegroundHover + + + + + + + Button_Icon_Opacity + + + + + + Button_Opacity + + + + + + + + + visuals:StateService.State + Pressed + + + + + Button_Container_Background + BackgroundPressed + + + + + + Button_Container_BorderBrush + BorderPressed + + + + + + Button_Container_BorderThickness + + + + + + Button_Container_Shadow + + + + + + + + Button_Icon_Foreground + IconForegroundPressed + + + + + + + Button_Icon_Opacity + + + + + + Button_Opacity + + + + + + + + + + Content + {x:Null} + + + + + Button_Padding + 0 + + + + + Button_Icon_MarginLeft + + + + + + Button_Icon_MarginRight + + + + + + + + + + + + + diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/StatusBulletCustomizationDictionary.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/StatusBulletCustomizationDictionary.xslt new file mode 100644 index 0000000..7ffce39 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/StatusBulletCustomizationDictionary.xslt @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BulletColorDanger + + + + + + + + BulletColorInfo + + + + + + + + BulletColorNeutral + + + + + + + + BulletColorPositive + + + + + + + + BulletColorWarning + + + + + + + + Foreground + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/StatusBulletStyle.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/StatusBulletStyle.xslt new file mode 100644 index 0000000..e77d246 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/StatusBulletStyle.xslt @@ -0,0 +1,239 @@ + + + + + + + + + + + + + + + + + + StatusBullets + + + + + + + + + + + + + + + + + + + + visuals:StatusBullet + StatusBulletUniversal + + + + + + + + + + TextBlock + + TextStyle + + + + + TextElement.Foreground + + + Foreground + + + + + + + + + + + + + + StatusBullet_Margin + + + + + + StatusBullet_Mark + + + + + + + + + + + + + + + + StatusBullet_TextStyle + + + TextStyle + + + + + + + + + + + + Type + Danger + + + + + + StatusBullet_Color + + + BulletColorDanger + + + + + + + + + + + + Type + Info + + + + + + StatusBullet_Color + + + BulletColorInfo + + + + + + + + + + + + Type + Neutral + + + + + + StatusBullet_Color + + + BulletColorNeutral + + + + + + + + + + + + Type + Positive + + + + + + StatusBullet_Color + + + BulletColorPositive + + + + + + + + + + + + Type + Warning + + + + + + StatusBullet_Color + + + BulletColorWarning + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/StatusTagCustomizationDictionary.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/StatusTagCustomizationDictionary.xslt new file mode 100644 index 0000000..1d981b5 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/StatusTagCustomizationDictionary.xslt @@ -0,0 +1,181 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BackgroundDanger + + + + + + BackgroundInfo + + + + + + BackgroundNeutral + + + + + + BackgroundPositive + + + + + + BackgroundWarning + + + + + + BorderColorDanger + + + + + + BorderColorInfo + + + + + + BorderColorNeutral + + + + + + BorderColorPositive + + + + + + BorderColorWarning + + + + + + ForegroundDanger + + + + + + ForegroundInfo + + + + + + ForegroundNeutral + + + + + + ForegroundPositive + + + + + + ForegroundWarning + + + + + + IconForegroundDanger + + + + + + IconForegroundInfo + + + + + + IconForegroundNeutral + + + + + + IconForegroundPositive + + + + + + IconForegroundWarning + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/StatusTagStyle.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/StatusTagStyle.xslt new file mode 100644 index 0000000..dd5136d --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/StatusTagStyle.xslt @@ -0,0 +1,530 @@ + + + + + + + + + + + + + + + + + + StatusTags + + + + + + + + + + + + + + + + + + + + visuals:StatusTag + StatusTagUniversal + + + + + + + + + TextBlock + + TextStyleDanger + + + + TextElement.Foreground + + + ForegroundDanger + + + + + + + + + + TextBlock + + TextStyleInfo + + + + TextElement.Foreground + + + ForegroundInfo + + + + + + + + + + TextBlock + + TextStyleNeutral + + + + TextElement.Foreground + + + ForegroundNeutral + + + + + + + + + + TextBlock + + TextStylePositive + + + + TextElement.Foreground + + + ForegroundPositive + + + + + + + + + + TextBlock + + TextStyleWarning + + + + TextElement.Foreground + + + ForegroundWarning + + + + + + + + + + + + StatusTag_CornerRadius + + + + + StatusTag_Height + + + + + + StatusTag_Icon_Margin + + + + + + StatusTag_Padding + + + + + + + + + Type + Danger + + + + + StatusTag_Background + + + BackgroundDanger + + + + + + + + StatusTag_BorderBrush + + + BorderColorDanger + + + + + + + + StatusTag_BorderThickness + + + + + + + + + + StatusTag_Icon_Color + + + IconForegroundDanger + + + + + + + + StatusTag_Icon_Name + + + + + + StatusTag_TextStyle + + + TextStyleDanger + + + + + + + + + + Type + Info + + + + + StatusTag_Background + + + BackgroundInfo + + + + + + + + StatusTag_BorderBrush + + + BorderColorInfo + + + + + + + + StatusTag_BorderThickness + + + + + + + + + + StatusTag_Icon_Color + + + IconForegroundInfo + + + + + + + + StatusTag_Icon_Name + + + + + + StatusTag_TextStyle + + + TextStyleInfo + + + + + + + + + + Type + Neutral + + + + + StatusTag_Background + + + BackgroundNeutral + + + + + + + + StatusTag_BorderBrush + + + BorderColorNeutral + + + + + + + + StatusTag_BorderThickness + + + + + + + + + + StatusTag_Icon_Color + + + IconForegroundNeutral + + + + + + + + StatusTag_Icon_Name + + + + + + StatusTag_TextStyle + + + TextStyleNeutral + + + + + + + + + + Type + Positive + + + + + StatusTag_Background + + + BackgroundPositive + + + + + + + + StatusTag_BorderBrush + + + BorderColorPositive + + + + + + + + StatusTag_BorderThickness + + + + + + + + + + StatusTag_Icon_Color + + + IconForegroundPositive + + + + + + + + StatusTag_Icon_Name + + + + + + StatusTag_TextStyle + + + TextStylePositive + + + + + + + + + + Type + Warning + + + + + StatusTag_Background + + + BackgroundWarning + + + + + + + + StatusTag_BorderBrush + + + BorderColorWarning + + + + + + + + StatusTag_BorderThickness + + + + + + + + + + StatusTag_Icon_Color + + + IconForegroundWarning + + + + + + + + StatusTag_Icon_Name + + + + + + StatusTag_TextStyle + + + TextStyleWarning + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/Svg.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/Svg.xslt new file mode 100644 index 0000000..a1d9cc2 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/Svg.xslt @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/SwitchCustomizationDictionary.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/SwitchCustomizationDictionary.xslt new file mode 100644 index 0000000..40fab1d --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/SwitchCustomizationDictionary.xslt @@ -0,0 +1,139 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + FocusVisualBrush + + + + + + ThumbColorOff + + + + + + ThumbColorOn + + + + + + ThumbShadowOff + + + + + + ThumbShadowOn + + + + + + TrackColorOffDisabled + + + + + + TrackColorOffHover + + + + + + TrackColorOffNormal + + + + + + TrackColorOffPressed + + + + + + TrackColorOnDisabled + + + + + + TrackColorOnHover + + + + + + TrackColorOnNormal + + + + + + TrackColorOnPressed + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/SwitchStyle.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/SwitchStyle.xslt new file mode 100644 index 0000000..caf18e1 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/SwitchStyle.xslt @@ -0,0 +1,420 @@ + + + + + + + + + + + + + + + + + + Switches + + + + + + + + + + + + + + + + + + + + visuals:Switch + SwitchUniversal + + + + + + Switch_CornerRadius + + + + + Switch_FocusVisualStyle + + + + + + Switch_Height + + + + + Switch_Opacity + + + + + + Switch_Thumb_Height + + + + + + Switch_Thumb_Margin + + + + + Switch_Thumb_Shadow + + + + + + + Switch_Thumb_Width + + + + + + Switch_Width + + + + + + + + + IsChecked + False + + + + + Switch_Thumb_Shadow + + + + + + + Switch_Thumb_Background + ThumbColorOff + + + + + + + + + IsChecked + True + + + + + Switch_Thumb_Shadow + + + + + + + Switch_Thumb_Background + ThumbColorOn + + + + + + + + + visuals:StateService.State + Disabled + + + + + Switch_Opacity + + + + + + + + + + + + + IsChecked + False + + + + + visuals:StateService.State + Disabled + + + + + + + + + Switch_Track_Background + TrackColorOffDisabled + + + + + + + + + + + + + IsChecked + False + + + + + visuals:StateService.State + Normal + + + + + + + + + Switch_Track_Background + TrackColorOffNormal + + + + + + + + + + + + + IsChecked + False + + + + + visuals:StateService.State + Hover + + + + + + + + + Switch_Track_Background + TrackColorOffHover + + + + + + + + + + + + + IsChecked + False + + + + + visuals:StateService.State + Pressed + + + + + + + + + Switch_Track_Background + TrackColorOffPressed + + + + + + + + + + + + + IsChecked + True + + + + + visuals:StateService.State + Disabled + + + + + + + + + Switch_Track_Background + TrackColorOnDisabled + + + + + + + + + + + + + IsChecked + True + + + + + visuals:StateService.State + Normal + + + + + + + + + Switch_Track_Background + TrackColorOnNormal + + + + + + + + + + + + + IsChecked + True + + + + + visuals:StateService.State + Hover + + + + + + + + + Switch_Track_Background + TrackColorOnHover + + + + + + + + + + + + + IsChecked + True + + + + + visuals:StateService.State + Pressed + + + + + + + + + Switch_Track_Background + TrackColorOnPressed + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/TabMenuCustomizationDictionary.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/TabMenuCustomizationDictionary.xslt new file mode 100644 index 0000000..e9042f3 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/TabMenuCustomizationDictionary.xslt @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Background + + + + + + BorderColor + + + + + + ButtonForeground + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/TabMenuItemCustomizationDictionary.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/TabMenuItemCustomizationDictionary.xslt new file mode 100644 index 0000000..e1927d8 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/TabMenuItemCustomizationDictionary.xslt @@ -0,0 +1,247 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BackgroundDisabled + + + + + + BackgroundHover + + + + + + BackgroundNormal + + + + + + BackgroundSelectedDisabled + + + + + + BackgroundSelectedNormal + + + + + + BadgeCounterBackgroundDisabled + + + + + + BadgeCounterBackgroundHover + + + + + + BadgeCounterBackgroundNormal + + + + + + BadgeCounterBackgroundSelectedDisabled + + + + + + BadgeCounterBackgroundSelectedNormal + + + + + + BadgeCounterForegroundDisabled + + + + + + BadgeCounterForegroundHover + + + + + + BadgeCounterForegroundNormal + + + + + + BadgeCounterForegroundSelectedDisabled + + + + + + BadgeCounterForegroundSelectedNormal + + + + + + BorderColorDisabled + + + + + + BorderColorHover + + + + + + BorderColorNormal + + + + + + BorderColorSelectedDisabled + + + + + + BorderColorSelectedNormal + + + + + + FocusVisualBrush + + + + + + ForegroundDisabled + + + + + + ForegroundHover + + + + + + ForegroundNormal + + + + + + ForegroundSelectedDisabled + + + + + + ForegroundSelectedNormal + + + + + + IconForegroundDisabled + + + + + + IconForegroundHover + + + + + + IconForegroundNormal + + + + + + IconForegroundSelectedDisabled + + + + + + IconForegroundSelectedNormal + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/TabMenuItemStyle.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/TabMenuItemStyle.xslt new file mode 100644 index 0000000..c51bd2b --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/TabMenuItemStyle.xslt @@ -0,0 +1,645 @@ + + + + + + + + + + + + + + + + + + TabMenuItems + + + + + + + + + + + + + + + visuals:TabMenuItem + TabMenuItemUniversal + TabMenuItem_ + + + + + + + + + + + + + + + + + visuals:BadgeCounter + + BadgeCounterStyle + + + + + + + + + Path=(visuals:StateService.SelectableState) + + + FindAncestor + visuals:TabMenuItem + + + + + + Normal + + + + + + BadgeCounter_Background + BadgeCounterBackgroundNormal + + + + + + BadgeCounter_Foreground + BadgeCounterForegroundNormal + + + + + + + + + + + + Path=(visuals:StateService.SelectableState) + + + FindAncestor + visuals:TabMenuItem + + + + + + Disabled + + + + + + BadgeCounter_Background + BadgeCounterBackgroundDisabled + + + + + + BadgeCounter_Foreground + BadgeCounterForegroundDisabled + + + + + + + + + + + + Path=(visuals:StateService.SelectableState) + + + FindAncestor + visuals:TabMenuItem + + + + + + Hover + + + + + + BadgeCounter_Background + BadgeCounterBackgroundHover + + + + + + BadgeCounter_Foreground + BadgeCounterForegroundHover + + + + + + + + + + + + Path=(visuals:StateService.SelectableState) + + + FindAncestor + visuals:TabMenuItem + + + + + + SelectedNormal + + + + + + BadgeCounter_Background + BadgeCounterBackgroundSelectedNormal + + + + + + BadgeCounter_Foreground + BadgeCounterForegroundSelectedNormal + + + + + + + + + + + + Path=(visuals:StateService.SelectableState) + + + FindAncestor + visuals:TabMenuItem + + + + + + SelectedDisabled + + + + + + BadgeCounter_Background + BadgeCounterBackgroundSelectedDisabled + + + + + + BadgeCounter_Foreground + BadgeCounterForegroundSelectedDisabled + + + + + + + + + + + + + TextBlock + + TextStyle + + + + + + TextElement.Foreground + + + ForegroundNormal + + + + + + + + + + TextBlock + + TextStyleDisabled + + + + + + TextElement.Foreground + + + ForegroundDisabled + + + + + + + + + + TextBlock + + TextStyleHover + + + + + + TextElement.Foreground + + + ForegroundHover + + + + + + + + + + TextBlock + + TextStyleSelectedDisabled + + + + + + TextElement.Foreground + + + ForegroundSelectedDisabled + + + + + + + + + + TextBlock + + TextStyleSelectedNormal + + + + + + TextElement.Foreground + + + ForegroundSelectedNormal + + + + + + + + + + + + + + + + + + + BadgeCounterStyle + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + TextStyle + + + + + + TextStyleDisabled + + + + + + TextStyleHover + + + + + + TextStyleSelectedDisabled + + + + + + TextStyleSelectedNormal + + + + + + + + + Content + {x:Null} + + + + + + + + + + + + 0 + + + + + + + + + visuals:StateService.SelectableState + Normal + + + + + + BackgroundNormal + + + + + + + BorderColorNormal + + + + + + + + + + + + + IconForegroundNormal + + + + + + + + + visuals:StateService.SelectableState + Hover + + + + + + BackgroundHover + + + + + + + BorderColorHover + + + + + + + + + + + + + IconForegroundHover + + + + + + + + + visuals:StateService.SelectableState + Disabled + + + + + + BackgroundDisabled + + + + + + + BorderColorDisabled + + + + + + + + + + + + + IconForegroundDisabled + + + + + + + + + visuals:StateService.SelectableState + SelectedNormal + + + + + + BackgroundSelectedNormal + + + + + + + BorderColorSelectedNormal + + + + + + + + + + + + + IconForegroundSelectedNormal + + + + + + + + + visuals:StateService.SelectableState + SelectedDisabled + + + + + + BackgroundSelectedDisabled + + + + + + + BorderColorSelectedDisabled + + + + + + + + + + + + + IconForegroundSelectedDisabled + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/TabMenuStyle.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/TabMenuStyle.xslt new file mode 100644 index 0000000..72c7e81 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/TabMenuStyle.xslt @@ -0,0 +1,166 @@ + + + + + + + + + + + + + + + + + + TabMenus + + + + + + + + + + + + + + + + + + + + visuals:TabMenu + TabMenuUniversal + + + + + + + + + visuals:IconButtonBase + + IconButtonStyle + + + + + + IconButton_Icon_Foreground + ButtonForeground + + + + + + IconButton_Padding + + + + + + + + + + visuals:FadeLine + FadeLineUniversal + FadeLineStyle + + + + + + FadeLine_IconButton_LeftIcon + + + + + + FadeLine_IconButton_RightIcon + + + + + + FadeLine_IconButtonStyle + IconButtonStyle + + + + + + + + + + + TabMenu_Background + Background + + + + + + TabMenu_BorderBrush + BorderColor + + + + + + TabMenu_BorderThickness + + + + + + TabMenu_CornerRadius + + + + + TabMenu_FadeLineStyle + FadeLineStyle + + + + + TabMenu_Padding + + + + + TabMenu_ItemContainerStyle + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/TagCustomizationDictionary.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/TagCustomizationDictionary.xslt new file mode 100644 index 0000000..a149b82 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/TagCustomizationDictionary.xslt @@ -0,0 +1,301 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BackgroundEmerald + + + + + + BackgroundGrass + + + + + + BackgroundMarina + + + + + + BackgroundMarengo + + + + + + BackgroundNeutral + + + + + + BackgroundOrange + + + + + + BackgroundPurple + + + + + + BackgroundRed + + + + + + BackgroundViolet + + + + + + BackgroundYellow + + + + + + BorderColorEmerald + + + + + + BorderColorGrass + + + + + + BorderColorMarina + + + + + + BorderColorMarengo + + + + + + BorderColorNeutral + + + + + + BorderColorOrange + + + + + + BorderColorPurple + + + + + + BorderColorRed + + + + + + BorderColorViolet + + + + + + BorderColorYellow + + + + + + ForegroundEmerald + + + + + + ForegroundGrass + + + + + + ForegroundMarina + + + + + + ForegroundMarengo + + + + + + ForegroundNeutral + + + + + + ForegroundOrange + + + + + + ForegroundPurple + + + + + + ForegroundRed + + + + + + ForegroundViolet + + + + + + ForegroundYellow + + + + + + IconForegroundEmerald + + + + + + IconForegroundGrass + + + + + + IconForegroundMarina + + + + + + IconForegroundMarengo + + + + + + IconForegroundNeutral + + + + + + IconForegroundOrange + + + + + + IconForegroundPurple + + + + + + IconForegroundRed + + + + + + IconForegroundViolet + + + + + + IconForegroundYellow + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/TagStyle.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/TagStyle.xslt new file mode 100644 index 0000000..3003786 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/TagStyle.xslt @@ -0,0 +1,905 @@ + + + + + + + + + + + + + + + + + + Tags + + + + + + + + + + + + + + + + + + + + visuals:Tag + TagUniversal + + + + + + + + + TextBlock + + TextStyleEmerald + + + + TextElement.Foreground + + + ForegroundEmerald + + + + + + + + + + TextBlock + + TextStyleGrass + + + + TextElement.Foreground + + + ForegroundGrass + + + + + + + + + + TextBlock + + TextStyleMarina + + + + TextElement.Foreground + + + ForegroundMarina + + + + + + + + + + TextBlock + + TextStyleMarengo + + + + TextElement.Foreground + + + ForegroundMarengo + + + + + + + + + + TextBlock + + TextStyleNeutral + + + + TextElement.Foreground + + + ForegroundNeutral + + + + + + + + + + TextBlock + + TextStyleOrange + + + + TextElement.Foreground + + + ForegroundOrange + + + + + + + + + + TextBlock + + TextStylePurple + + + + TextElement.Foreground + + + ForegroundPurple + + + + + + + + + + TextBlock + + TextStyleRed + + + + TextElement.Foreground + + + ForegroundRed + + + + + + + + + + TextBlock + + TextStyleViolet + + + + TextElement.Foreground + + + ForegroundViolet + + + + + + + + + + TextBlock + + TextStyleYellow + + + + TextElement.Foreground + + + ForegroundYellow + + + + + + + + + + + + Tag_CornerRadius + + + + + Tag_Height + + + + + + Tag_Icon_Margin + + + + + + Tag_Padding + + + + + + + + + Color + Emerald + + + + + Tag_Background + + + BackgroundEmerald + + + + + + + + Tag_BorderBrush + + + BorderColorEmerald + + + + + + + + Tag_BorderThickness + + + + + + + + + + Tag_Icon_Color + + + IconForegroundEmerald + + + + + + + + Tag_TextStyle + + + TextStyleEmerald + + + + + + + + + + Color + Grass + + + + + Tag_Background + + + BackgroundGrass + + + + + + + + Tag_BorderBrush + + + BorderColorGrass + + + + + + + + Tag_BorderThickness + + + + + + + + + + Tag_Icon_Color + + + IconForegroundGrass + + + + + + + + Tag_TextStyle + + + TextStyleGrass + + + + + + + + + + Color + Marina + + + + + Tag_Background + + + BackgroundMarina + + + + + + + + Tag_BorderBrush + + + BorderColorMarina + + + + + + + + Tag_BorderThickness + + + + + + + + + + Tag_Icon_Color + + + IconForegroundMarina + + + + + + + + Tag_TextStyle + + + TextStyleMarina + + + + + + + + + + Color + Marengo + + + + + Tag_Background + + + BackgroundMarengo + + + + + + + + Tag_BorderBrush + + + BorderColorMarengo + + + + + + + + Tag_BorderThickness + + + + + + + + + + Tag_Icon_Color + + + IconForegroundMarengo + + + + + + + + Tag_TextStyle + + + TextStyleMarengo + + + + + + + + + + Color + Neutral + + + + + Tag_Background + + + BackgroundNeutral + + + + + + + + Tag_BorderBrush + + + BorderColorNeutral + + + + + + + + Tag_BorderThickness + + + + + + + + + + Tag_Icon_Color + + + IconForegroundNeutral + + + + + + + + Tag_TextStyle + + + TextStyleNeutral + + + + + + + + + + Color + Orange + + + + + Tag_Background + + + BackgroundOrange + + + + + + + + Tag_BorderBrush + + + BorderColorOrange + + + + + + + + Tag_BorderThickness + + + + + + + + + + Tag_Icon_Color + + + IconForegroundOrange + + + + + + + + Tag_TextStyle + + + TextStyleOrange + + + + + + + + + + Color + Purple + + + + + Tag_Background + + + BackgroundPurple + + + + + + + + Tag_BorderBrush + + + BorderColorPurple + + + + + + + + Tag_BorderThickness + + + + + + + + + + Tag_Icon_Color + + + IconForegroundPurple + + + + + + + + Tag_TextStyle + + + TextStylePurple + + + + + + + + + + Color + Red + + + + + Tag_Background + + + BackgroundRed + + + + + + + + Tag_BorderBrush + + + BorderColorRed + + + + + + + + Tag_BorderThickness + + + + + + + + + + Tag_Icon_Color + + + IconForegroundRed + + + + + + + + Tag_TextStyle + + + TextStyleRed + + + + + + + + + + Color + Violet + + + + + Tag_Background + + + BackgroundViolet + + + + + + + + Tag_BorderBrush + + + BorderColorViolet + + + + + + + + Tag_BorderThickness + + + + + + + + + + Tag_Icon_Color + + + IconForegroundViolet + + + + + + + + Tag_TextStyle + + + TextStyleViolet + + + + + + + + + + Color + Yellow + + + + + Tag_Background + + + BackgroundYellow + + + + + + + + Tag_BorderBrush + + + BorderColorYellow + + + + + + + + Tag_BorderThickness + + + + + + + + + + Tag_Icon_Color + + + IconForegroundYellow + + + + + + + + Tag_TextStyle + + + TextStyleYellow + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/TextAreaCustomizationDictionary.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/TextAreaCustomizationDictionary.xslt new file mode 100644 index 0000000..6696b12 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/TextAreaCustomizationDictionary.xslt @@ -0,0 +1,205 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BackgroundDisabled + + + + + + BackgroundFocus + + + + + + BackgroundHover + + + + + + BackgroundInvalidFocus + + + + + + BackgroundInvalidHover + + + + + + BackgroundInvalidNormal + + + + + + BackgroundNormal + + + + + + BackgroundReadOnly + + + + + + BorderColorDisabled + + + + + + BorderColorFocus + + + + + + BorderColorHover + + + + + + BorderColorInvalidFocus + + + + + + BorderColorInvalidHover + + + + + + BorderColorInvalidNormal + + + + + + BorderColorNormal + + + + + + BorderColorReadOnly + + + + + + CaptionForeground + + + + + + CaretBrush + + + + + + CounterForeground + + + + + + CounterForegroundFull + + + + + + LabelForeground + + + + + + PlaceholderForeground + + + + + + TextForegroundDisabled + + + + + + TextForeground + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/TextAreaStyle.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/TextAreaStyle.xslt new file mode 100644 index 0000000..e6cb039 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/TextAreaStyle.xslt @@ -0,0 +1,511 @@ + + + + + + + + + + + + + + + + + + TextAreas + + + + + + + + + + + + + + + + + + + + {x:Type visuals:TextArea} + {StaticResource TextInputUniversal} + + + + + + + + + + TextBlock + + CaptionStyle + + + + TextElement.Foreground + + + CaptionForeground + + + + + + + + + + TextBlock + + CounterStyle + + + + TextElement.Foreground + + + CounterForeground + + + + + + + + + + TextBlock + + CounterFullStyle + + + + TextElement.Foreground + + + CounterForegroundFull + + + + + + + + + + TextBlock + + LabelStyle + + + + TextElement.Foreground + + + LabelForeground + + + + + + + + + + + + TextInput_Background + BackgroundNormal + + + + + + TextInput_BorderBrush + BorderColorNormal + + + + + + TextInput_BorderThickness + + + + + + TextInput_CaptionStyle + CaptionStyle + + + + + TextInput_Caption_Margin + + + + + + TextInput_CaretBrush + CaretBrush + + + + + + TextInput_CornerRadius + + + + + TextInput_CounterStyle + CounterStyle + + + + + TextInput_Counter_Margin + + + + + + TextInput_Height + + + + + TextInput_Padding + + + + + TextInput_Placeholder_Foreground + PlaceholderForeground + + + + + + TextInput_PlaceholderStyle + + + + + + TextInput_LabelStyle + LabelStyle + + + + + TextInput_Label_Margin + + + + + + TextInput_TextForeground + TextForeground + + + + + + TextInput_TextStyle + + + + + + TextInput_ValidationPopupStyle + + + + + + + + visuals:StateService.TextInputState + Disabled + + + + + TextInput_Background + BackgroundDisabled + + + + + + TextInput_BorderBrush + BorderColorDisabled + + + + + + TextInput_BorderThickness + + + + + + TextInput_TextForeground + TextForegroundDisabled + + + + + + + + + visuals:StateService.TextInputState + Hover + + + + + TextInput_Background + BackgroundHover + + + + + + TextInput_BorderBrush + BorderColorHover + + + + + + TextInput_BorderThickness + + + + + + + + + visuals:StateService.TextInputState + Focus + + + + + TextInput_Background + BackgroundFocus + + + + + + TextInput_BorderBrush + BorderColorFocus + + + + + + TextInput_BorderThickness + + + + + + + + + visuals:StateService.TextInputState + InvalidNormal + + + + + TextInput_Background + BackgroundInvalidNormal + + + + + + TextInput_BorderBrush + BorderColorInvalidNormal + + + + + + TextInput_BorderThickness + + + + + + + + + visuals:StateService.TextInputState + InvalidHover + + + + + TextInput_Background + BackgroundInvalidHover + + + + + + TextInput_BorderBrush + BorderColorInvalidHover + + + + + + TextInput_BorderThickness + + + + + + + + + visuals:StateService.TextInputState + InvalidFocus + + + + + TextInput_Background + BackgroundInvalidFocus + + + + + + TextInput_BorderBrush + BorderColorInvalidFocus + + + + + + TextInput_BorderThickness + + + + + + + + + visuals:StateService.TextInputState + ReadOnly + + + + + TextInput_Background + BackgroundReadOnly + + + + + + TextInput_BorderBrush + BorderColorReadOnly + + + + + + TextInput_BorderThickness + + + + + + + + + + + + + + + Text.Length + + + + + + + + + MaxLength + + + + + + + {visuals:MultiValueEqualityToBooleanConverter} + + + + + True + + + + + + TextInput_CounterStyle + CounterFullStyle + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/TextInputCustomizationDictionary.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/TextInputCustomizationDictionary.xslt new file mode 100644 index 0000000..5095711 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/TextInputCustomizationDictionary.xslt @@ -0,0 +1,193 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BackgroundDisabled + + + + + + BackgroundFocus + + + + + + BackgroundHover + + + + + + BackgroundInvalidFocus + + + + + + BackgroundInvalidHover + + + + + + BackgroundInvalidNormal + + + + + + BackgroundNormal + + + + + + BackgroundReadOnly + + + + + + BorderColorDisabled + + + + + + BorderColorFocus + + + + + + BorderColorHover + + + + + + BorderColorInvalidFocus + + + + + + BorderColorInvalidHover + + + + + + BorderColorInvalidNormal + + + + + + BorderColorNormal + + + + + + BorderColorReadOnly + + + + + + CaptionForeground + + + + + + CaretBrush + + + + + + LabelForeground + + + + + + PlaceholderForeground + + + + + + TextForegroundDisabled + + + + + + TextForeground + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/TextInputStyle.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/TextInputStyle.xslt new file mode 100644 index 0000000..d661b79 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/TextInputStyle.xslt @@ -0,0 +1,449 @@ + + + + + + + + + + + + + + + + + + TextInputs + + + + + + + + + + + + + + + + + + + + {x:Type visuals:TextInput} + {StaticResource TextInputUniversal} + + + + + + + + + + TextBlock + + CaptionStyle + + + + TextElement.Foreground + + + CaptionForeground + + + + + + + + + + TextBlock + + LabelStyle + + + + TextElement.Foreground + + + LabelForeground + + + + + + + + + + + + TextInput_ActionBar_Margin + + + + + + TextInput_Background + BackgroundNormal + + + + + + TextInput_BorderBrush + BorderColorNormal + + + + + + TextInput_BorderThickness + + + + + + TextInput_CaretBrush + CaretBrush + + + + + + TextInput_CornerRadius + + + + + TextInput_Height + + + + + TextInput_Padding + + + + + TextInput_Placeholder_Foreground + PlaceholderForeground + + + + + + TextInput_PlaceholderStyle + + + + + + TextInput_CaptionStyle + CaptionStyle + + + + + TextInput_Caption_Margin + + + + + + TextInput_LabelStyle + LabelStyle + + + + + TextInput_Label_Margin + + + + + + TextInput_TextForeground + TextForeground + + + + + + TextInput_ValidationPopupStyle + + + + + + + + FontMode + Regular + + + + + TextInput_TextStyle + + + + + + + + + FontMode + Monospace + + + + + TextInput_TextStyle + + + + + + + + + visuals:StateService.TextInputState + Disabled + + + + + TextInput_Background + BackgroundDisabled + + + + + + TextInput_BorderBrush + BorderColorDisabled + + + + + + TextInput_BorderThickness + + + + + + TextInput_TextForeground + TextForegroundDisabled + + + + + + + + + visuals:StateService.TextInputState + Hover + + + + + TextInput_Background + BackgroundHover + + + + + + TextInput_BorderBrush + BorderColorHover + + + + + + TextInput_BorderThickness + + + + + + + + + visuals:StateService.TextInputState + Focus + + + + + TextInput_Background + BackgroundFocus + + + + + + TextInput_BorderBrush + BorderColorFocus + + + + + + TextInput_BorderThickness + + + + + + + + + visuals:StateService.TextInputState + InvalidNormal + + + + + TextInput_Background + BackgroundInvalidNormal + + + + + + TextInput_BorderBrush + BorderColorInvalidNormal + + + + + + TextInput_BorderThickness + + + + + + + + + visuals:StateService.TextInputState + InvalidHover + + + + + TextInput_Background + BackgroundInvalidHover + + + + + + TextInput_BorderBrush + BorderColorInvalidHover + + + + + + TextInput_BorderThickness + + + + + + + + + visuals:StateService.TextInputState + InvalidFocus + + + + + TextInput_Background + BackgroundInvalidFocus + + + + + + TextInput_BorderBrush + BorderColorInvalidFocus + + + + + + TextInput_BorderThickness + + + + + + + + + visuals:StateService.TextInputState + ReadOnly + + + + + TextInput_Background + BackgroundReadOnly + + + + + + TextInput_BorderBrush + BorderColorReadOnly + + + + + + TextInput_BorderThickness + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/TextStyle.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/TextStyle.xslt new file mode 100644 index 0000000..c3e0c6c --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/TextStyle.xslt @@ -0,0 +1,110 @@ + + + + + + + + + + + + + + + + + + TextStyles + + + + + + + + + + + + + + + + + + + + + + + + + + Inline.TextDecorations + + + + + + + TextBlock.LineHeight + + + + + + TextBlock.LineStackingStrategy + BlockLineHeight + + + + + + TextElement.FontFamily + TextElement.FontSize + TextElement.FontStyle + TextElement.FontWeight + + + + + + + TextElement.Foreground + + + Foreground + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/TextStyleCustomizationDictionary.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/TextStyleCustomizationDictionary.xslt new file mode 100644 index 0000000..3e9daa6 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/TextStyleCustomizationDictionary.xslt @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Foreground + + + + + + + + TextDecorations + + 0 + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/TextViewerCustomizationDictionary.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/TextViewerCustomizationDictionary.xslt new file mode 100644 index 0000000..87b4ed1 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/TextViewerCustomizationDictionary.xslt @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + TextForeground + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/TextViewerStyle.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/TextViewerStyle.xslt new file mode 100644 index 0000000..d6e721f --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/TextViewerStyle.xslt @@ -0,0 +1,105 @@ + + + + + + + + + + + + + + + + + + TextViewers + + + + + + + + + + + + + + + + + + + + visuals:TextViewer + TextViewerUniversal + + + + + + + + + TextBox + + TextStyle + + + + TextElement.Foreground + + + TextForeground + + + + + + + + + + + + TextViewer_IslandStyle + + + + + + TextViewer_Padding + + + + + TextViewer_TextStyle + TextStyle + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ToolTipCustomizationDictionary.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ToolTipCustomizationDictionary.xslt new file mode 100644 index 0000000..3f9e25d --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ToolTipCustomizationDictionary.xslt @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Background + + + + + + + + BorderColor + + + + + + + + Foreground + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ToolTipStyle.xslt b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ToolTipStyle.xslt new file mode 100644 index 0000000..597d13e --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Transformations/ToolTipStyle.xslt @@ -0,0 +1,152 @@ + + + + + + + + + + + + + + + + + + ToolTips + + + + + + + + + + + + + + + + + + + + ToolTip + ToolTipUniversal + + + + + + + + + TextBlock + + TextStyle + + + + + TextElement.Foreground + + + Foreground + + + + + + + + + + + + + + ToolTip_Background + + + Background + + + + + + + + + ToolTip_BorderBrush + + + BorderColor + + + + + + + + ToolTip_BorderThickness + + + + + + + + + + ToolTip_CornerRadius + + + + + ToolTip_Padding + + + + + ToolTip_Shadow + + + + + + + ToolTip_TextStyle + + + TextStyle + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Translation/CommentGenerator.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Translation/CommentGenerator.cs new file mode 100644 index 0000000..b9f750e --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Translation/CommentGenerator.cs @@ -0,0 +1,37 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System; +using System.Linq; +using System.Text; + +namespace Kaspirin.UI.Framework.UiKit.Translator.Core.Translation +{ + public static class CommentGenerator + { + public static string AddFileComment(string fileText, string comment) + { + var commentBuilder = new StringBuilder(); + comment + .Split(new[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries) + .Select(p => $"// {p.Trim()}") + .ToList() + .ForEach(p => commentBuilder.AppendLine(p)); + + comment = commentBuilder.ToString(); + + return fileText.Replace("@FileComment", comment); + } + } +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Translation/CustomizationDictionariesGenerator.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Translation/CustomizationDictionariesGenerator.cs new file mode 100644 index 0000000..64a7743 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Translation/CustomizationDictionariesGenerator.cs @@ -0,0 +1,141 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Xml; +using System.Xml.Linq; +using System.Xml.Xsl; +using Microsoft.Build.Framework; +using Microsoft.Build.Utilities; + +namespace Kaspirin.UI.Framework.UiKit.Translator.Core.Translation +{ + internal sealed class CustomizationDictionariesGenerator : GeneratorBase + { + public CustomizationDictionariesGenerator( + string outputDirectory, + string comment, + string[] excludedControls, + LineEndingMode lineEndingMode, + EmbeddedResourceXmlUrlResolver xsltUrlResolver, + XmlWriterSettings xmlWriterSettings, + TaskLoggingHelper log) + : base(excludedControls, lineEndingMode, xsltUrlResolver, xmlWriterSettings, log) + { + _outputDirectory = outputDirectory; + _comment = comment; + } + + public override bool Generate(string uiKitContent, out string[] generatedFilePaths) + { + var generatedFilePathList = new List(); + + try + { + var xslTransform = new XslCompiledTransform(); + + var transformationStream = EmbeddedResourceHelper.GetEmbeddedResource( + Path.Combine(Const.TransformationResourcesDirectory, Const.TransformationCoreDirectory), + Const.CustomizationDictionariesTransformationFilename); + + using var transformationReader = XmlReader.Create(transformationStream); + xslTransform.Load(transformationReader, XsltSettings.TrustedXslt, _xsltUrlResolver); + + var arguments = new XsltArgumentList(); + arguments.AddParam(Const.ExcludedControlsFilterParameterName, string.Empty, GetExcludedControlsFilter()); + arguments.AddParam(Const.ExcludedControlsFilterDelimiterParameterName, string.Empty, Const.ExcludedControlsFilterDelimiter); + arguments.AddParam(Const.CommentTextParameterName, string.Empty, _comment); + + var xmlParserContext = new XmlParserContext(null, null, null, XmlSpace.Default); + + using var xmlReader = new XmlTextReader(uiKitContent, XmlNodeType.Document, xmlParserContext); + using var dictionariesStringWriter = new StringWriter(); + using var dictionariesXmlWriter = XmlWriter.Create(dictionariesStringWriter, _xmlWriterSettings); + xslTransform.Transform(xmlReader, arguments, dictionariesXmlWriter); + + var xml = dictionariesStringWriter.ToString(); + var xmlDocument = XDocument.Parse(xml); + + var customizationDictionariesElement = xmlDocument + .Elements(Const.CustomizationDictionariesElementName) + .SingleOrDefault(); + if (customizationDictionariesElement == null) + { + throw new InvalidOperationException( + $"Unable to find '{Const.CustomizationDictionariesElementName}' element " + + $"inside customization dictionary XSLT-transformation result: {xml}"); + } + + var customizationDictionaryElements = customizationDictionariesElement + .Elements(Const.CustomizationDictionaryElementName) + .ToArray(); + if (!customizationDictionaryElements.Any()) + { + throw new InvalidOperationException( + $"Unable to find '{Const.CustomizationDictionaryElementName}' elements " + + $"inside customization dictionary XSLT-transformation result: {xml}"); + } + + Directory.CreateDirectory(_outputDirectory); + + foreach (var customizationDictionaryElement in customizationDictionaryElements) + { + var id = customizationDictionaryElement.Attribute(Const.CustomizationDictionaryIdAttributeName)?.Value; + if (string.IsNullOrWhiteSpace(id)) + { + throw new InvalidOperationException($"Unable to determine id of customization dictionary: {customizationDictionaryElement}"); + } + + using var dictionaryStringWriter = new StringWriter(); + using (var dictionaryXmlWriter = XmlWriter.Create(dictionaryStringWriter, _xmlWriterSettings)) + { + foreach (var node in customizationDictionaryElement.Nodes()) + { + node.WriteTo(dictionaryXmlWriter); + } + } + + var path = Path.Combine(_outputDirectory, Path.ChangeExtension(id, Const.XamlExtension)); + var content = LineEndingHelper.NormalizeLineEndings(dictionaryStringWriter.ToString(), _lineEndingMode); + + _log.LogMessage(MessageImportance.Normal, $"Creating '{path}'."); + File.WriteAllText(path, content, Encoding.UTF8); + + generatedFilePathList.Add(path); + } + + _log.LogMessage( + MessageImportance.High, + $"XAML customization resource dictionaries generation completed: {generatedFilePathList.Count} file(s) created."); + } + catch (Exception ex) + { + _log.LogError("XAML customization resource dictionaries generation failed."); + _log.LogErrorFromException(ex, showStackTrace: true); + generatedFilePaths = new string[0]; + return false; + } + + generatedFilePaths = generatedFilePathList.ToArray(); + return true; + } + + private readonly string _outputDirectory; + private readonly string _comment; + } +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Translation/Fonts/Font.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Translation/Fonts/Font.cs new file mode 100644 index 0000000..055126f --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Translation/Fonts/Font.cs @@ -0,0 +1,22 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +namespace Kaspirin.UI.Framework.UiKit.Translator.Core.Translation.Fonts +{ + internal class Font + { + public string Name { get; set; } + public string Id { get; set; } + } +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Translation/Fonts/FontEnumGenerator.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Translation/Fonts/FontEnumGenerator.cs new file mode 100644 index 0000000..ee5769c --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Translation/Fonts/FontEnumGenerator.cs @@ -0,0 +1,127 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System.Collections.Generic; +using System.IO; +using System.Linq; +using Kaspirin.UI.Framework.UiKit.Translator.Core.Translation.Palettes; +using Microsoft.Build.Framework; +using Microsoft.Build.Utilities; + +namespace Kaspirin.UI.Framework.UiKit.Translator.Core.Translation.Fonts +{ + public sealed class FontEnumGenerator + { + public FontEnumGenerator( + string enumFileTargetPath, + string fontNamespacePart, + string paletteNamespacePart, + string comment, + TaskLoggingHelper log) + { + _enumFileTargetPath = enumFileTargetPath; + _fontNamespacePart = fontNamespacePart; + _paletteNamespacePart = paletteNamespacePart; + _comment = comment; + _log = log; + } + + public bool Generate(string uiKitContent) + { + var paletteItems = GetPaletteItems(uiKitContent); + + var fontItems = GetFonts(uiKitContent); + if (fontItems.Any()) + { + Translate(fontItems, paletteItems); + } + + return true; + } + + private IList GetFonts(string uiKitContent) => + new XmlFontSource(msg => _log.LogWarning(msg)) + .GetFonts(uiKitContent) + .OrderBy(r => r.Name) + .ToList(); + + private IList GetPaletteItems(string uiKitContent) => + new XmlPaletteSource() + .GetPalettes(uiKitContent) + .OrderBy(r => r.Name) + .ToList(); + + private void Translate(IList fontItems, IList paletteItems) + { + var enumsTemplate = ReadEnumsTemplate(); + + enumsTemplate = FillEnum(fontItems, paletteItems, enumsTemplate); + enumsTemplate = FillNamespace(enumsTemplate); + enumsTemplate = CommentGenerator.AddFileComment(enumsTemplate, _comment); + + SaveEnums(enumsTemplate); + } + + private string ReadEnumsTemplate() + { + using var stream = EmbeddedResourceHelper.GetEmbeddedResource( + Const.UIKitFontTemplateDirectory, + Const.UIKitFontEnumsTemplateFilename); + using var reader = new StreamReader(stream); + + return reader.ReadToEnd(); + } + + private string FillNamespace(string enumsFile) + { + return enumsFile + .Replace("@PaletteNamespacePart", _paletteNamespacePart) + .Replace("@FontNamespacePart", _fontNamespacePart); + } + + private string FillEnum(IList fontItems, IList paletteItems, string enumsFile) + { + var fontsString = string.Join(",\r\n", fontItems + .Select(i => $"{_indent}{_indent}{_indent}{i.Name}")); + + var brushesString = string.Join(",\r\n", paletteItems + .Where(i => i.Name.Contains(Const.UIKitPaletteTextIconsBrushPrefix)) + .Select(i => i.Name.Replace(Const.UIKitPaletteTextIconsBrushPrefix, "")) + .Select(i => $"{_indent}{_indent}{_indent}{i}")); + + return enumsFile + .Replace("@FontStyles", fontsString) + .Replace("@FontStyles", fontsString) + .Replace("@FontStyleIdPrefix", Const.TextStyleIdPrefix) + .Replace("@FontBrushes", brushesString) + .Replace("@FontBrushPrefix", Const.UIKitPaletteTextIconsBrushPrefix); + } + + private void SaveEnums(string enumFile) + { + Directory.CreateDirectory(Path.GetDirectoryName(_enumFileTargetPath)); + + File.WriteAllText(_enumFileTargetPath, enumFile); + + _log.LogMessage(MessageImportance.High, "Font enums file generation completed."); + } + + private readonly string _indent = Const.DefaultOutputIndentChars; + private readonly string _enumFileTargetPath; + private readonly string _fontNamespacePart; + private readonly string _paletteNamespacePart; + private readonly string _comment; + private readonly TaskLoggingHelper _log; + } +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Translation/Fonts/UIKitFonts.Enums.Template.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Translation/Fonts/UIKitFonts.Enums.Template.cs new file mode 100644 index 0000000..b66adb1 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Translation/Fonts/UIKitFonts.Enums.Template.cs @@ -0,0 +1,45 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +@FileComment +using System; +using Kaspirin.UI.Framework.UiKit.@PaletteNamespacePart.Palette; + +namespace Kaspirin.UI.Framework.UiKit.@FontNamespacePart.Fonts +{ + public sealed class UIKitFontStorage + { + public static string Map(UIKitFontStyle id) + => $"@FontStyleIdPrefix{id}"; + + public static string Map(UIKitFontBrush id) + { + var paletteIdString = $"@FontBrushPrefix{id}"; + + var paletteId = (UIKitPaletteStorage.UIKitPalette)Enum.Parse(typeof(UIKitPaletteStorage.UIKitPalette), paletteIdString); + + return UIKitPaletteStorage.Map(paletteId); + } + + public enum UIKitFontBrush + { +@FontBrushes + } + + public enum UIKitFontStyle + { +@FontStyles + } + } +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Translation/GeneratorBase.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Translation/GeneratorBase.cs new file mode 100644 index 0000000..846b819 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Translation/GeneratorBase.cs @@ -0,0 +1,56 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System.Linq; +using System.Xml; +using Microsoft.Build.Utilities; + +namespace Kaspirin.UI.Framework.UiKit.Translator.Core.Translation +{ + internal abstract class GeneratorBase + { + public GeneratorBase( + string[] excludedControls, + LineEndingMode lineEndingMode, + EmbeddedResourceXmlUrlResolver xsltUrlResolver, + XmlWriterSettings xmlWriterSettings, + TaskLoggingHelper log) + { + _excludedControls = excludedControls; + _lineEndingMode = lineEndingMode; + _xsltUrlResolver = xsltUrlResolver; + _xmlWriterSettings = xmlWriterSettings; + _log = log; + } + + public abstract bool Generate(string uiKitContent, out string[] generatedFilePaths); + + protected string GetExcludedControlsFilter() + { + if (_excludedControls?.Any() != true) + { + return string.Empty; + } + + return string.Join(Const.ExcludedControlsFilterDelimiter, _excludedControls); + } + + protected readonly LineEndingMode _lineEndingMode; + protected readonly EmbeddedResourceXmlUrlResolver _xsltUrlResolver; + protected readonly XmlWriterSettings _xmlWriterSettings; + protected readonly TaskLoggingHelper _log; + + private readonly string[] _excludedControls; + } +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Translation/Icons/Icon.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Translation/Icons/Icon.cs new file mode 100644 index 0000000..c6cc8f2 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Translation/Icons/Icon.cs @@ -0,0 +1,31 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +namespace Kaspirin.UI.Framework.UiKit.Translator.Core.Translation.Icons +{ + public sealed class Icon + { + public bool IsAutoRTL { get; set; } + + public bool IsColorfull { get; set; } + + public string Name { get; set; } + + public int Size { get; set; } + + public string Svg { get; set; } + + public string SvgRTL { get; set; } + } +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Translation/Icons/IconEnumGenerator.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Translation/Icons/IconEnumGenerator.cs new file mode 100644 index 0000000..9bb6191 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Translation/Icons/IconEnumGenerator.cs @@ -0,0 +1,120 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System.Collections.Generic; +using System.IO; +using System.Linq; +using Microsoft.Build.Framework; +using Microsoft.Build.Utilities; + +namespace Kaspirin.UI.Framework.UiKit.Translator.Core.Translation.Icons +{ + public sealed class IconEnumGenerator + { + public IconEnumGenerator( + string enumFileTargetPath, + string comment, + TaskLoggingHelper log) + { + _enumFileTargetPath = enumFileTargetPath; + _comment = comment; + _log = log; + } + + public bool Generate(string uiKitContent) + { + var icons = GetIcons(uiKitContent); + if (icons.Any()) + { + Translate(icons); + } + + return true; + } + + private IList GetIcons(string uiKitContent) => + new XmlIconSource(msg => _log.LogWarning(msg)) + .GetIcons(uiKitContent) + .OrderBy(r => r.Size) + .ThenBy(r => r.Name) + .ToList(); + + private void Translate(IList icons) + { + var enumsTemplate = ReadEnumsTemplate(); + + foreach (var iconSize in _supportedSizes) + { + enumsTemplate = FillEnum(iconSize, icons, enumsTemplate); + } + + enumsTemplate = FillMetadata(icons, enumsTemplate); + enumsTemplate = CommentGenerator.AddFileComment(enumsTemplate, _comment); + + SaveEnums(enumsTemplate); + } + + private string ReadEnumsTemplate() + { + using var stream = EmbeddedResourceHelper.GetEmbeddedResource( + Const.UIKitIconTemplateDirectory, + Const.UIKitIconEnumsTemplateFilename); + using var reader = new StreamReader(stream); + + return reader.ReadToEnd(); + } + + private string FillEnum(int iconSize, IList icons, string enumsFile) + { + var iconsString = string.Join(",\r\n", icons + .Where(i => i.Size == iconSize) + .Select(i => $"{_indent}{_indent}{i.Name}")); + + return enumsFile.Replace($"@Icons{iconSize}", iconsString); + } + + private string FillMetadata(IList icons, string enumsFile) + { + var iconsMetadata = string.Join("\r\n", icons + .Where(i => i.IsColorfull || i.IsAutoRTL) + .Select(i => + $"{_indent}{_indent}{_indent}{_indent}" + + $"UIKitIconMetadataStorage.Register(" + + $"{GetEnumTypeName(i.Size)}.{i.Name}, " + + $"isAutoRTL: {i.IsAutoRTL.ToString().ToLower()}, " + + $"isColorfull: {i.IsColorfull.ToString().ToLower()});")); + + return enumsFile.Replace("@IconsMetadataRegistration", iconsMetadata); + } + + private void SaveEnums(string enumFile) + { + Directory.CreateDirectory(Path.GetDirectoryName(_enumFileTargetPath)); + + File.WriteAllText(_enumFileTargetPath, enumFile); + + _log.LogMessage(MessageImportance.High, "Icon enums file generation completed."); + } + + private static string GetEnumTypeName(int size) + => $"UIKitIcon_{size}"; + + private readonly int[] _supportedSizes = new[] { 12, 16, 24, 32, 48 }; + + private readonly string _indent = Const.DefaultOutputIndentChars; + private readonly string _enumFileTargetPath; + private readonly string _comment; + private readonly TaskLoggingHelper _log; + } +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Translation/Icons/IconSvgGenerator.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Translation/Icons/IconSvgGenerator.cs new file mode 100644 index 0000000..ad8bafe --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Translation/Icons/IconSvgGenerator.cs @@ -0,0 +1,114 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Xml; +using Microsoft.Build.Framework; +using Microsoft.Build.Utilities; + +namespace Kaspirin.UI.Framework.UiKit.Translator.Core.Translation.Icons +{ + internal sealed class IconSvgGenerator : GeneratorBase + { + public const string IconSvgFilenamePrefix = "UIKitIcon_"; + + public IconSvgGenerator( + string outputDirectory, + string[] excludedControls, + LineEndingMode lineEndingMode, + EmbeddedResourceXmlUrlResolver xsltUrlResolver, + XmlWriterSettings xmlWriterSettings, + TaskLoggingHelper log) + : base(excludedControls, lineEndingMode, xsltUrlResolver, xmlWriterSettings, log) + { + _outputDirectory = outputDirectory; + } + + public override bool Generate(string uiKitContent, out string[] generatedFilePaths) + { + var generatedFilePathList = new List(); + + try + { + Directory.CreateDirectory(_outputDirectory); + + var icons = new XmlIconSource(msg => _log.LogWarning(msg)) + .GetIcons(uiKitContent) + .ToArray(); + + foreach (var icon in icons) + { + generatedFilePathList.AddRange(SaveSvg(icon.Svg, GetSvgPaths(icon.Name, icon.Size, isRTL: false))); + generatedFilePathList.AddRange(SaveSvg(icon.SvgRTL, GetSvgPaths(icon.Name, icon.Size, isRTL: true))); + } + + _log.LogMessage( + MessageImportance.High, + $"Icon SVG files generation completed: {generatedFilePathList.Count} file(s) created."); + } + catch (Exception ex) + { + _log.LogError("Icon SVG files generation failed."); + _log.LogErrorFromException(ex, showStackTrace: true); + generatedFilePaths = new string[0]; + return false; + } + + generatedFilePaths = generatedFilePathList.ToArray(); + return true; + } + + private IEnumerable GetSvgPaths(string name, int size, bool isRTL) + { + var filename = $"{IconSvgFilenamePrefix}{name}_{size}.svg"; + + var locales = isRTL + ? Const.RtlLocales + : Const.NeutralLocales; + + foreach (var locale in locales) + { + var directory = Path.Combine(_outputDirectory, locale, @"images\svg"); + Directory.CreateDirectory(directory); + + yield return Path.Combine(directory, filename); + } + } + + private IEnumerable SaveSvg(string svg, IEnumerable paths) + { + if (string.IsNullOrWhiteSpace(svg)) + { + yield break; + } + + var svgFileContent = LineEndingHelper.NormalizeLineEndings(svg, _lineEndingMode); + + foreach (var path in paths) + { + _log.LogMessage(MessageImportance.Normal, $"Creating icon SVG: '{path}'."); + + File.WriteAllText(path, svgFileContent, Encoding.UTF8); + + yield return path; + } + } + + private readonly string _outputDirectory; + } +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Translation/Icons/UIKitIcons.Enums.Template.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Translation/Icons/UIKitIcons.Enums.Template.cs new file mode 100644 index 0000000..e39abf7 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Translation/Icons/UIKitIcons.Enums.Template.cs @@ -0,0 +1,71 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +@FileComment +using System.Runtime.CompilerServices; +using System.Threading; + +namespace Kaspirin.UI.Framework.UiKit.Icons +{ + /// UIKit icons with 12x12 size. + public enum UIKitIcon_12 + { + UIKitUnset = 0, +@Icons12 + } + + /// UIKit icons with 16x16 size. + public enum UIKitIcon_16 + { + UIKitUnset = 0, +@Icons16 + } + + /// UIKit icons with 24x24 size. + public enum UIKitIcon_24 + { + UIKitUnset = 0, +@Icons24 + } + + /// UIKit icons with 32x32 size. + public enum UIKitIcon_32 + { + UIKitUnset = 0, +@Icons32 + } + + /// UIKit icons with 48x48 size. + public enum UIKitIcon_48 + { + UIKitUnset = 0, +@Icons48 + } + + internal static class UIKitIconMetadataRegistrar + { +#if !NETFRAMEWORK + [ModuleInitializer] +#endif + internal static void RegisterMetadata() + { + if (Interlocked.CompareExchange(ref _isRegistered, 1, 0) == 0) + { +@IconsMetadataRegistration + } + } + + private static int _isRegistered = 0; + } +} \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Translation/Illustrations/Illustration.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Translation/Illustrations/Illustration.cs new file mode 100644 index 0000000..4bd4b97 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Translation/Illustrations/Illustration.cs @@ -0,0 +1,42 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +namespace Kaspirin.UI.Framework.UiKit.Translator.Core.Translation.Illustrations +{ + public sealed class Illustration + { + public double Height { get; set; } + + public bool IsAutoRTL { get; set; } + + public string Name { get; set; } + + public string Product { get; set; } + + public string Scope { get; set; } + + public IllustrationVector[] Vectors { get; set; } + + public double Width { get; set; } + + public sealed class IllustrationVector + { + public string Theme { get; set; } + + public bool IsRTL { get; set; } + + public string Vector { get; set; } + } + } +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Translation/Illustrations/IllustrationEnumGenerator.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Translation/Illustrations/IllustrationEnumGenerator.cs new file mode 100644 index 0000000..357effb --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Translation/Illustrations/IllustrationEnumGenerator.cs @@ -0,0 +1,184 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using Microsoft.Build.Framework; +using Microsoft.Build.Utilities; + +namespace Kaspirin.UI.Framework.UiKit.Translator.Core.Translation.Illustrations +{ + internal sealed class IllustrationEnumGenerator + { + public IllustrationEnumGenerator( + Func productMediaProjectInfoProvider, + string comment, + TaskLoggingHelper log) + { + _productMediaProjectInfoProvider = productMediaProjectInfoProvider; + _comment = comment; + _log = log; + } + + public bool Generate(string uiKitContent) + { + var illustrations = GetIllustrations(uiKitContent); + if (illustrations.Any()) + { + Translate(illustrations); + } + + return true; + } + + private IDictionary GetIllustrations(string uiKitContent) => + new XmlIllustrationSource() + .GetIllustrations(uiKitContent) + .GroupBy(i => i.Product) + .ToDictionary(g => g.Key, g => g.ToArray()); + + private void Translate(IDictionary illustrations) + { + var enumsTemplate = ReadEnumsTemplate(); + + foreach (var kvp in illustrations) + { + var product = kvp.Key; + + var productIllustrations = kvp.Value + .OrderBy(i => i.Scope) + .ThenBy(i => i.Name) + .ToArray(); + + var productEnumsFile = enumsTemplate; + + productEnumsFile = FillNamespace(product, productEnumsFile); + productEnumsFile = FillEnums(productIllustrations, productEnumsFile); + productEnumsFile = FillMetadata(productIllustrations, productEnumsFile); + productEnumsFile = CommentGenerator.AddFileComment(productEnumsFile, _comment); + + SaveEnums(product, productEnumsFile); + } + } + + private string ReadEnumsTemplate() + { + using var stream = EmbeddedResourceHelper.GetEmbeddedResource( + Const.UIKitIllustrationTemplateDirectory, + Const.UIKitIllustrationEnumsTemplateFilename); + using var reader = new StreamReader(stream); + + return reader.ReadToEnd(); + } + + private string FillNamespace(string product, string enumsFile) + { + var productNamespacePart = _productMediaProjectInfoProvider(product).ProductNamespacePart; + if (string.IsNullOrWhiteSpace(productNamespacePart)) + { + throw new InvalidOperationException($"Media project namespace for product '{product}' is not configured"); + } + + return enumsFile.Replace("@ProductNamespacePart", productNamespacePart); + } + + private string FillEnums(Illustration[] illustrations, string enumsFile) + { + var illustrationEnumsStringBuilder = new StringBuilder(); + + foreach (var g in illustrations.GroupBy(i => i.Scope)) + { + var scope = g.Key; + + var enumTypeName = GetEnumTypeName(scope); + + if (illustrationEnumsStringBuilder.Length > 0) + { + illustrationEnumsStringBuilder.AppendLine(); + illustrationEnumsStringBuilder.AppendLine(); + } + + // Template is: + // /// UIKit illustrations with scope. + // public enum + // { + // UIKitUnset = 0, + // , + // ... + // , + // } + + illustrationEnumsStringBuilder.AppendLine($"{_indent}/// UIKit illustrations with {scope} scope."); + illustrationEnumsStringBuilder.AppendLine($"{_indent}public enum {enumTypeName}"); + illustrationEnumsStringBuilder.AppendLine($"{_indent}{{"); + + illustrationEnumsStringBuilder.AppendLine($"{_indent}{_indent}UIKitUnset = 0,"); + + foreach (var illustration in g) + { + illustrationEnumsStringBuilder.AppendLine($"{_indent}{_indent}{illustration.Name},"); + } + + illustrationEnumsStringBuilder.Append($"{_indent}}}"); + } + + return enumsFile.Replace("@IllustrationEnumDeclarations", illustrationEnumsStringBuilder.ToString()); + } + + private string FillMetadata(Illustration[] illustrations, string enumsFile) + { + // Template is: + // UIKitIllustrationMetadataStorage.Register(., isAutoRTL: , height: , width: ); + + var illustrationsMetadata = string.Join("\r\n", illustrations + .Select(i => + $"{_indent}{_indent}{_indent}{_indent}" + + $"UIKitIllustrationMetadataStorage.Register(" + + $"{GetEnumTypeName(i.Scope)}.{i.Name}, " + + $"isAutoRTL: {i.IsAutoRTL.ToString().ToLower()}, " + + $"height: {i.Height}, " + + $"width: {i.Width});")); + + return enumsFile.Replace("@IllustrationsMetadataRegistration", illustrationsMetadata); + } + + private void SaveEnums(string product, string enumsFile) + { + var productEnumFilePath = _productMediaProjectInfoProvider(product).IllustrationEnumPath; + if (string.IsNullOrWhiteSpace(productEnumFilePath)) + { + throw new InvalidOperationException($"Illustration enums file path for product '{product}' is not configured"); + } + + Directory.CreateDirectory(Path.GetDirectoryName(productEnumFilePath)); + + File.WriteAllText(productEnumFilePath, enumsFile); + + _log.LogMessage( + MessageImportance.High, + $"Illustration enums file generation completed for product '{product}'."); + } + + private static string GetEnumTypeName(string scope) + => $"{Const.UIKitIllustrationPrefix}{scope}"; + + private readonly string _indent = Const.DefaultOutputIndentChars; + private readonly string _comment; + private readonly Func _productMediaProjectInfoProvider; + private readonly TaskLoggingHelper _log; + } +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Translation/Illustrations/IllustrationMarkupExtensionGenerator.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Translation/Illustrations/IllustrationMarkupExtensionGenerator.cs new file mode 100644 index 0000000..a3edeaf --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Translation/Illustrations/IllustrationMarkupExtensionGenerator.cs @@ -0,0 +1,180 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using Microsoft.Build.Framework; +using Microsoft.Build.Utilities; + +namespace Kaspirin.UI.Framework.UiKit.Translator.Core.Translation.Illustrations +{ + internal sealed class IllustrationMarkupExtensionGenerator + { + public IllustrationMarkupExtensionGenerator( + Func productMediaProjectInfoProvider, + string comment, + TaskLoggingHelper log) + { + _productMediaProjectInfoProvider = productMediaProjectInfoProvider; + _comment = comment; + _log = log; + } + + public bool Generate(string uiKitContent) + { + var illustrations = GetIllustrations(uiKitContent); + if (illustrations.Any()) + { + Translate(illustrations); + } + + return true; + } + + private IDictionary GetIllustrations(string uiKitContent) => + new XmlIllustrationSource() + .GetIllustrations(uiKitContent) + .GroupBy(i => i.Product) + .ToDictionary(g => g.Key, g => g.ToArray()); + + private void Translate(IDictionary illustrations) + { + var markupExtensionTemplate = ReadMarkupExtensionTemplate(); + + foreach (var kvp in illustrations) + { + var product = kvp.Key; + + var productScopes = kvp.Value + .Select(i => i.Scope) + .Distinct() + .OrderBy(scope => scope) + .ToArray(); + + var productMarkupExtensionFile = markupExtensionTemplate; + + productMarkupExtensionFile = FillNamespace(product, productMarkupExtensionFile); + productMarkupExtensionFile = FillEnumProperties(productScopes, productMarkupExtensionFile); + productMarkupExtensionFile = FillEnumFields(productScopes, productMarkupExtensionFile); + productMarkupExtensionFile = CommentGenerator.AddFileComment(productMarkupExtensionFile, _comment); + + SaveMarkupExtension(product, productMarkupExtensionFile); + } + } + + private string ReadMarkupExtensionTemplate() + { + using var stream = EmbeddedResourceHelper.GetEmbeddedResource( + Const.UIKitIllustrationTemplateDirectory, + Const.UIKitIllustrationMarkupExtensionTemplateFilename); + using var reader = new StreamReader(stream); + + return reader.ReadToEnd(); + } + + private string FillNamespace(string product, string markupExtensionFile) + { + var productNamespacePart = _productMediaProjectInfoProvider(product).ProductNamespacePart; + if (string.IsNullOrWhiteSpace(productNamespacePart)) + { + throw new InvalidOperationException($"Media project namespace for product '{product}' is not configured"); + } + + return markupExtensionFile.Replace("@ProductNamespacePart", productNamespacePart); + } + + private string FillEnumProperties(string[] scopes, string markupExtensionFile) + { + var illustrationEnumPropertiesStringBuilder = new StringBuilder(); + + foreach (var scope in scopes) + { + if (illustrationEnumPropertiesStringBuilder.Length > 0) + { + illustrationEnumPropertiesStringBuilder.AppendLine(); + illustrationEnumPropertiesStringBuilder.AppendLine(); + } + + var enumTypeName = GetEnumTypeName(scope); + var enumPropertyName = GetEnumPropertyName(scope); + var enumFieldName = GetEnumFieldName(scope); + + // Template is: + // public { get => <_fieldName>; set => EnsureCanSet(ref <_fieldName>, value); } + + illustrationEnumPropertiesStringBuilder.Append( + $"{_indent}{_indent}public {enumTypeName} {enumPropertyName} {{ get => {enumFieldName}; set => EnsureCanSet(ref {enumFieldName}, value); }}"); + } + + return markupExtensionFile.Replace("@IllustrationEnumPropertyDeclarations", illustrationEnumPropertiesStringBuilder.ToString()); + } + + private string FillEnumFields(string[] scopes, string markupExtensionFile) + { + var illustrationEnumFieldsStringBuilder = new StringBuilder(); + + foreach (var scope in scopes) + { + if (illustrationEnumFieldsStringBuilder.Length > 0) + { + illustrationEnumFieldsStringBuilder.AppendLine(); + } + + var enumTypeName = GetEnumTypeName(scope); + var enumFieldName = GetEnumFieldName(scope); + + // Template is: + // private <_fieldName>; + + illustrationEnumFieldsStringBuilder.Append($"{_indent}{_indent}private {enumTypeName} {enumFieldName};"); + } + + return markupExtensionFile.Replace("@IllustrationEnumFieldsDeclarations", illustrationEnumFieldsStringBuilder.ToString()); + } + + private void SaveMarkupExtension(string product, string markupExtensionFile) + { + var productMarkupExtensionFilePath = _productMediaProjectInfoProvider(product).IllustrationMarkupExtensionPath; + if (string.IsNullOrWhiteSpace(productMarkupExtensionFilePath)) + { + throw new InvalidOperationException($"Illustration markup extension file path for product '{product}' is not configured"); + } + + Directory.CreateDirectory(Path.GetDirectoryName(productMarkupExtensionFilePath)); + + File.WriteAllText(productMarkupExtensionFilePath, markupExtensionFile); + + _log.LogMessage( + MessageImportance.High, + $"Illustration markup extension file generation completed for product '{product}'."); + } + + private static string GetEnumTypeName(string scope) + => $"{Const.UIKitIllustrationPrefix}{scope}"; + + private static string GetEnumPropertyName(string scope) + => scope; + + private static string GetEnumFieldName(string scope) + => $"_{char.ToLowerInvariant(scope[0])}{scope.Substring(1)}"; + + private readonly string _indent = Const.DefaultOutputIndentChars; + private readonly string _comment; + private readonly Func _productMediaProjectInfoProvider; + private readonly TaskLoggingHelper _log; + } +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Translation/Illustrations/IllustrationSvgGenerator.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Translation/Illustrations/IllustrationSvgGenerator.cs new file mode 100644 index 0000000..57dcb06 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Translation/Illustrations/IllustrationSvgGenerator.cs @@ -0,0 +1,147 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Xml; +using Microsoft.Build.Framework; +using Microsoft.Build.Utilities; + +namespace Kaspirin.UI.Framework.UiKit.Translator.Core.Translation.Illustrations +{ + internal sealed class IllustrationSvgGenerator : GeneratorBase + { + public const string IllustrationSvgFilenamePrefix = "UIKitIllustration_"; + + public IllustrationSvgGenerator( + Func productMediaProjectInfoProvider, + string[] excludedControls, + LineEndingMode lineEndingMode, + EmbeddedResourceXmlUrlResolver xsltUrlResolver, + XmlWriterSettings xmlWriterSettings, + TaskLoggingHelper log) + : base(excludedControls, lineEndingMode, xsltUrlResolver, xmlWriterSettings, log) + { + _productMediaProjectInfoProvider = productMediaProjectInfoProvider; + } + + public override bool Generate(string uiKitContent, out string[] generatedFilePaths) + { + var generatedFilePathList = new List(); + + try + { + var illustrations = GetIllustrations(uiKitContent); + foreach (var kvp in illustrations) + { + var product = kvp.Key; + + var productIllustrations = kvp.Value + .OrderBy(i => i.Scope) + .ThenBy(i => i.Name) + .ToArray(); + + var productIllustrationSvgDirectory = _productMediaProjectInfoProvider(product).IllustrationSvgDirectory; + if (string.IsNullOrWhiteSpace(productIllustrationSvgDirectory)) + { + throw new InvalidOperationException($"Illustration SVG directory for product '{product}' is not configured"); + } + + Directory.CreateDirectory(productIllustrationSvgDirectory); + + foreach (var illustration in productIllustrations) + { + foreach (var vector in illustration.Vectors) + { + var svgPaths = GetSvgPaths( + productIllustrationSvgDirectory, + illustration.Scope, + illustration.Name, + vector.IsRTL, + vector.Theme); + + generatedFilePathList.AddRange(SaveSvg(vector.Vector, svgPaths)); + } + } + + _log.LogMessage( + MessageImportance.High, + $"Illustration SVG files generation for product '{product}' completed: {generatedFilePathList.Count} file(s) created."); + } + } + catch (Exception ex) + { + _log.LogError("Illustration SVG files generation failed."); + _log.LogErrorFromException(ex, showStackTrace: true); + generatedFilePaths = new string[0]; + return false; + } + + generatedFilePaths = generatedFilePathList.ToArray(); + return true; + } + + private IDictionary GetIllustrations(string uiKitContent) => + new XmlIllustrationSource() + .GetIllustrations(uiKitContent) + .GroupBy(i => i.Product) + .ToDictionary(g => g.Key, g => g.ToArray()); + + private IEnumerable GetSvgPaths(string outputDirectory, string scope, string name, bool isRTL, string theme) + { + var filename = $"{IllustrationSvgFilenamePrefix}{name}.svg"; + + var locales = isRTL + ? Const.RtlLocales + : Const.NeutralLocales; + + foreach (var locale in locales) + { + var themeSubdirectory = string.IsNullOrWhiteSpace(theme) || theme.Equals(Const.DefaultPaletteId, StringComparison.InvariantCultureIgnoreCase) + ? string.Empty + : $@"{theme}\"; + + var directory = Path.Combine(outputDirectory, Path.Combine(locale, $@"{themeSubdirectory}images\{scope}").ToLower()); + + Directory.CreateDirectory(directory); + + yield return Path.Combine(directory, filename); + } + } + + private IEnumerable SaveSvg(string svg, IEnumerable paths) + { + if (string.IsNullOrWhiteSpace(svg)) + { + yield break; + } + + var svgFileContent = LineEndingHelper.NormalizeLineEndings(svg, _lineEndingMode); + + foreach (var path in paths) + { + _log.LogMessage(MessageImportance.Normal, $"Creating illustration SVG: '{path}'."); + + File.WriteAllText(path, svgFileContent, Encoding.UTF8); + + yield return path; + } + } + + private readonly Func _productMediaProjectInfoProvider; + } +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Translation/Illustrations/UIKitIllustrations.Enums.Template.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Translation/Illustrations/UIKitIllustrations.Enums.Template.cs new file mode 100644 index 0000000..8707552 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Translation/Illustrations/UIKitIllustrations.Enums.Template.cs @@ -0,0 +1,40 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +@FileComment +using System.Runtime.CompilerServices; +using System.Threading; + +namespace Kaspirin.UI.Framework.UiKit.@ProductNamespacePart.Illustrations +{ +@IllustrationEnumDeclarations + + internal static class UIKitIllustrationMetadataRegistrar + { +#if NETFRAMEWORK + public static void RegisterMetadata() +#else + [ModuleInitializer] + internal static void RegisterMetadata() +#endif + { + if (Interlocked.CompareExchange(ref _isRegistered, 1, 0) == 0) + { +@IllustrationsMetadataRegistration + } + } + + private static int _isRegistered = 0; + } +} \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Translation/Illustrations/UIKitIllustrations.MarkupExtension.Template.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Translation/Illustrations/UIKitIllustrations.MarkupExtension.Template.cs new file mode 100644 index 0000000..db11e16 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Translation/Illustrations/UIKitIllustrations.MarkupExtension.Template.cs @@ -0,0 +1,26 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +@FileComment +using Kaspirin.UI.Framework.UiKit.@ProductNamespacePart.Illustrations; + +namespace Kaspirin.UI.Framework.UiKit.@ProductNamespacePart.MarkupExtensions +{ + public sealed class UIKitIllustrationExtension : UIKitIllustrationExtensionBase + { +@IllustrationEnumPropertyDeclarations + +@IllustrationEnumFieldsDeclarations + } +} \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Translation/Palettes/PaletteEnumGenerator.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Translation/Palettes/PaletteEnumGenerator.cs new file mode 100644 index 0000000..1799bc0 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Translation/Palettes/PaletteEnumGenerator.cs @@ -0,0 +1,115 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using Microsoft.Build.Framework; +using Microsoft.Build.Utilities; +using System.Collections.Generic; +using System.IO; +using System.Linq; + +namespace Kaspirin.UI.Framework.UiKit.Translator.Core.Translation.Palettes +{ + internal sealed class PaletteEnumGenerator + { + public PaletteEnumGenerator( + string enumFileTargetPath, + string paletteNamespacePart, + string comment, + TaskLoggingHelper log) + { + _enumFileTargetPath = enumFileTargetPath; + _paletteNamespacePart = paletteNamespacePart; + _comment = comment; + _log = log; + } + + public bool Generate(string uiKitContent) + { + var paletteItems = GetPaletteItems(uiKitContent); + if (paletteItems.Any()) + { + Translate(paletteItems); + } + + return true; + } + + private IList GetPaletteItems(string uiKitContent) => + new XmlPaletteSource() + .GetPalettes(uiKitContent) + .OrderBy(r => r.Name) + .ToList(); + + private void Translate(IList paletteItems) + { + var enumFile = ReadEnumTemplate(); + + enumFile = CommentGenerator.AddFileComment(enumFile, _comment); + enumFile = FillNamespace(enumFile); + enumFile = FillEnum(paletteItems, enumFile); + enumFile = FillMapping(paletteItems, enumFile); + + SaveEnum(enumFile); + } + + private string ReadEnumTemplate() + { + using var stream = EmbeddedResourceHelper.GetEmbeddedResource( + Const.UIKitPaletteTemplateDirectory, + Const.UIKitPaletteTemplateFilename); + using var reader = new StreamReader(stream); + + return reader.ReadToEnd(); + } + + private string FillNamespace(string enumFile) + { + return enumFile.Replace("@PaletteNamespacePart", _paletteNamespacePart); + } + + private string FillEnum(IList paletteItems, string enumFile) + { + var paletteItemsString = string.Join(",\r\n", paletteItems + .Where(i => i.Name != "Transparent") + .Select(i => $"{_indent}{_indent}{_indent}{i.Name}")); + + return enumFile.Replace($"@PaletteItems", paletteItemsString); + } + + private string FillMapping(IList paletteItems, string enumFile) + { + var paletteMappingString = string.Join(",\r\n", paletteItems + .Select(i => $"{_indent}{_indent}{_indent}{{ UIKitPalette.{i.Name}, \"{i.Id}\" }}")); + + return enumFile.Replace("@PaletteMapping", paletteMappingString); + } + + private void SaveEnum(string enumFile) + { + Directory.CreateDirectory(Path.GetDirectoryName(_enumFileTargetPath)); + + File.WriteAllText(_enumFileTargetPath, enumFile); + + _log.LogMessage( + MessageImportance.High, + $"Palette enums file generation completed."); + } + + private readonly string _indent = Const.DefaultOutputIndentChars; + private readonly string _enumFileTargetPath; + private readonly string _paletteNamespacePart; + private readonly string _comment; + private readonly TaskLoggingHelper _log; + } +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Translation/Palettes/PaletteItem.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Translation/Palettes/PaletteItem.cs new file mode 100644 index 0000000..c3e240c --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Translation/Palettes/PaletteItem.cs @@ -0,0 +1,22 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +namespace Kaspirin.UI.Framework.UiKit.Translator.Core.Translation.Palettes +{ + internal sealed class PaletteItem + { + public string Id { get; set; } + public string Name { get; set; } + } +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Translation/Palettes/PalettesGenerator.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Translation/Palettes/PalettesGenerator.cs new file mode 100644 index 0000000..bdf204e --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Translation/Palettes/PalettesGenerator.cs @@ -0,0 +1,171 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Xml; +using System.Xml.Linq; +using System.Xml.Xsl; +using Microsoft.Build.Framework; +using Microsoft.Build.Utilities; + +namespace Kaspirin.UI.Framework.UiKit.Translator.Core.Translation.Palettes +{ + internal sealed class PalettesGenerator : GeneratorBase + { + public PalettesGenerator( + string defaultPaletteId, + string defaultPaletteOutputDirectory, + string comment, + string[] excludedControls, + LineEndingMode lineEndingMode, + EmbeddedResourceXmlUrlResolver xsltUrlResolver, + XmlWriterSettings xmlWriterSettings, + TaskLoggingHelper log) + : base(excludedControls, lineEndingMode, xsltUrlResolver, xmlWriterSettings, log) + { + _defaultPaletteId = defaultPaletteId; + _defaultPaletteOutputDirectory = defaultPaletteOutputDirectory; + _comment = comment; + _nonDefaultPalettesOutputDirectory = Path.Combine(defaultPaletteOutputDirectory, "..\\"); + } + + public override bool Generate(string uiKitContent, out string[] generatedFilePaths) + { + var generatedFilePathList = new List(); + + try + { + var xslTransform = new XslCompiledTransform(); + + var transformationStream = EmbeddedResourceHelper.GetEmbeddedResource( + Path.Combine(Const.TransformationResourcesDirectory, Const.TransformationCoreDirectory), + Const.PalettesTransformationFilename); + + using var transformationReader = XmlReader.Create(transformationStream); + xslTransform.Load(transformationReader, XsltSettings.TrustedXslt, _xsltUrlResolver); + + var arguments = new XsltArgumentList(); + arguments.AddParam(Const.CommentTextParameterName, string.Empty, _comment); + + var xmlParserContext = new XmlParserContext(null, null, null, XmlSpace.Default); + + using var xmlReader = new XmlTextReader(uiKitContent, XmlNodeType.Document, xmlParserContext); + using var palettesStringWriter = new StringWriter(); + using var palettesXmlWriter = XmlWriter.Create(palettesStringWriter, _xmlWriterSettings); + xslTransform.Transform(xmlReader, arguments, palettesXmlWriter); + + var xml = palettesStringWriter.ToString(); + var xmlDocument = XDocument.Parse(xml); + + var palettesElement = xmlDocument.Elements(Const.PalettesElementName).SingleOrDefault(); + if (palettesElement == null) + { + throw new InvalidOperationException( + $"Unable to find '{Const.PalettesElementName}' element inside palettes XSLT-transformation result: {xml}"); + } + + var paletteElements = palettesElement.Elements(Const.PaletteElementName).ToArray(); + if (!paletteElements.Any()) + { + throw new InvalidOperationException( + $"Unable to find '{Const.PaletteElementName}' elements inside palettes XSLT-transformation result: {xml}"); + } + + var defaultPaletteElement = paletteElements + .SingleOrDefault(paletteElement => + { + var paletteId = paletteElement.Attribute(Const.PaletteIdAttributeName)?.Value; + return string.Equals(paletteId, _defaultPaletteId, StringComparison.InvariantCultureIgnoreCase); + }); + if (defaultPaletteElement == null) + { + throw new InvalidOperationException( + $"Unable to find default palette with id '{_defaultPaletteId}' inside palettes XSLT-transformation result: {xml}"); + } + + Directory.CreateDirectory(_defaultPaletteOutputDirectory); + + var path = Path.Combine(_defaultPaletteOutputDirectory, Path.ChangeExtension(Const.PaletteFilename, Const.XamlExtension)); + SavePalette(defaultPaletteElement, path, _xmlWriterSettings); + + generatedFilePathList.Add(path); + + _log.LogMessage(MessageImportance.High, "XAML default palette generation completed."); + + var counter = 0; + + foreach (var nonDefaultPaletteElement in paletteElements.Except(new[] { defaultPaletteElement })) + { + var paletteId = nonDefaultPaletteElement.Attribute(Const.PaletteIdAttributeName)?.Value; + if (string.IsNullOrWhiteSpace(paletteId)) + { + throw new InvalidOperationException($"Unable to determine id of palette: {nonDefaultPaletteElement}"); + } + + var directory = Path.Combine(_nonDefaultPalettesOutputDirectory, $@"{paletteId.ToLowerInvariant()}\dictionaries"); + Directory.CreateDirectory(directory); + + path = Path.Combine(directory, Path.ChangeExtension(Const.PaletteFilename, Const.XamlExtension)); + SavePalette(nonDefaultPaletteElement, path, _xmlWriterSettings); + + generatedFilePathList.Add(path); + + counter++; + } + + _log.LogMessage( + MessageImportance.High, + counter > 0 + ? $"XAML non-default palettes generation completed: {counter} file(s) created." + : $"There are no non-default palletes inside palettes XSLT-transformation result. Skip XAML non-default palettes generation."); + } + catch (Exception ex) + { + _log.LogError("XAML palettes generation failed."); + _log.LogErrorFromException(ex, showStackTrace: true); + generatedFilePaths = new string[0]; + return false; + } + + generatedFilePaths = generatedFilePathList.ToArray(); + return true; + } + + private void SavePalette(XElement paletteElement, string path, XmlWriterSettings settings) + { + using var paletteStringWriter = new StringWriter(); + using (var paletteXmlWriter = XmlWriter.Create(paletteStringWriter, settings)) + { + foreach (var node in paletteElement.Nodes()) + { + node.WriteTo(paletteXmlWriter); + } + } + + var content = LineEndingHelper.NormalizeLineEndings(paletteStringWriter.ToString(), _lineEndingMode); + + _log.LogMessage(MessageImportance.Normal, $"Creating '{path}'."); + File.WriteAllText(path, content, Encoding.UTF8); + } + + private readonly string _comment; + private readonly string _defaultPaletteId; + private readonly string _defaultPaletteOutputDirectory; + private readonly string _nonDefaultPalettesOutputDirectory; + } +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Translation/Palettes/UIKitPalettes.Template.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Translation/Palettes/UIKitPalettes.Template.cs new file mode 100644 index 0000000..3f02775 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Translation/Palettes/UIKitPalettes.Template.cs @@ -0,0 +1,38 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +@FileComment +using System.Collections.Generic; + +namespace Kaspirin.UI.Framework.UiKit.@PaletteNamespacePart.Palette +{ + public static class UIKitPaletteStorage + { + public static string Map(UIKitPalette id) + { + return PaletteMapping[id]; + } + + private static IDictionary PaletteMapping { get; } = new Dictionary + { +@PaletteMapping + }; + + public enum UIKitPalette + { + Transparent = 0, +@PaletteItems + } + } +} \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Translation/StylesGenerator.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Translation/StylesGenerator.cs new file mode 100644 index 0000000..f94858f --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Translation/StylesGenerator.cs @@ -0,0 +1,127 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System; +using System.IO; +using System.Linq; +using System.Text; +using System.Xml; +using System.Xml.Linq; +using System.Xml.Xsl; +using Microsoft.Build.Framework; +using Microsoft.Build.Utilities; + +namespace Kaspirin.UI.Framework.UiKit.Translator.Core.Translation +{ + internal sealed class StylesGenerator : GeneratorBase + { + public StylesGenerator( + string outputPath, + string comment, + string[] excludedControls, + string[] baseStylesResourceDictionaries, + LineEndingMode lineEndingMode, + EmbeddedResourceXmlUrlResolver xsltUrlResolver, + XmlWriterSettings xmlWriterSettings, + TaskLoggingHelper log) + : base(excludedControls, lineEndingMode, xsltUrlResolver, xmlWriterSettings, log) + { + _outputPath = outputPath; + _comment = comment; + _baseStylesResourceDictionaries = baseStylesResourceDictionaries; + } + + public override bool Generate(string uiKitContent, out string[] generatedFilePaths) + { + try + { + var xslTransform = new XslCompiledTransform(); + + var transformationStream = EmbeddedResourceHelper.GetEmbeddedResource( + Path.Combine(Const.TransformationResourcesDirectory, Const.TransformationCoreDirectory), + Const.StylesTransformationFilename); + + using var transformationReader = XmlReader.Create(transformationStream); + xslTransform.Load(transformationReader, XsltSettings.TrustedXslt, _xsltUrlResolver); + + var arguments = new XsltArgumentList(); + arguments.AddParam(Const.ExcludedControlsFilterParameterName, string.Empty, GetExcludedControlsFilter()); + arguments.AddParam(Const.ExcludedControlsFilterDelimiterParameterName, string.Empty, Const.ExcludedControlsFilterDelimiter); + arguments.AddParam(Const.ExternalResourceDictionariesParameterName, string.Empty, GetExternalResourceDictionariesString()); + arguments.AddParam(Const.ExternalResourceDictionariesDelimiterParameterName, string.Empty, Const.ExternalResourceDictionariesDelimiter); + arguments.AddParam(Const.ConditionalNamespacePrefixParameterName, string.Empty, ConditionalNamespacePrefix); + arguments.AddParam(Const.CommentTextParameterName, string.Empty, _comment); + + var xmlParserContext = new XmlParserContext(null, null, null, XmlSpace.Default); + + using var xmlReader = new XmlTextReader(uiKitContent, XmlNodeType.Document, xmlParserContext); + using var stringWriter = new StringWriter(); + using var xmlWriter = XmlWriter.Create(stringWriter, _xmlWriterSettings); + xslTransform.Transform(xmlReader, arguments, xmlWriter); + + var xaml = ProcessConditionalNamespaces(stringWriter.ToString()); + var content = LineEndingHelper.NormalizeLineEndings(xaml, _lineEndingMode); + + Directory.CreateDirectory(Path.GetDirectoryName(_outputPath)); + + _log.LogMessage(MessageImportance.Normal, $"Creating '{_outputPath}'."); + File.WriteAllText(_outputPath, content, Encoding.UTF8); + + _log.LogMessage(MessageImportance.High, $"XAML styles resource dictionary generation completed."); + } + catch (Exception ex) + { + _log.LogError("XAML styles resource dictionary generation failed."); + _log.LogErrorFromException(ex, showStackTrace: true); + generatedFilePaths = new string[0]; + return false; + } + + generatedFilePaths = new[] { _outputPath }; + return true; + } + + private static string ProcessConditionalNamespaces(string xml) + { + var xmlDocument = XDocument.Parse(xml); + + var conditionalNamespaceAttributes = xmlDocument.Root?.Attributes() + .Where(attribute => attribute.Name.LocalName.StartsWith(ConditionalNamespacePrefix)) + .ToArray(); + if (conditionalNamespaceAttributes?.Any() != true) + { + return xml; + } + + foreach (var conditionalNamespaceAttribute in conditionalNamespaceAttributes) + { + xmlDocument.Root.SetAttributeValue(conditionalNamespaceAttribute.Name, null); + + var namespaceName = conditionalNamespaceAttribute.Name.LocalName.Replace(ConditionalNamespacePrefix, string.Empty); + xmlDocument.Root.SetAttributeValue(XNamespace.Xmlns + namespaceName, conditionalNamespaceAttribute.Value); + } + + return xmlDocument.ToString(SaveOptions.None); + } + + private string GetExternalResourceDictionariesString() + => string.Join(Const.ExternalResourceDictionariesDelimiter, _baseStylesResourceDictionaries); + + private readonly string _outputPath; + private readonly string _comment; + private readonly string[] _baseStylesResourceDictionaries; + + private const string ConditionalNamespacePrefix = "xmlns_"; + } +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Translation/SvgGenerator.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Translation/SvgGenerator.cs new file mode 100644 index 0000000..f6ebc29 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/Translation/SvgGenerator.cs @@ -0,0 +1,135 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Xml; +using System.Xml.Linq; +using System.Xml.Xsl; +using Microsoft.Build.Framework; +using Microsoft.Build.Utilities; + +namespace Kaspirin.UI.Framework.UiKit.Translator.Core.Translation +{ + internal sealed class SvgGenerator : GeneratorBase + { + public SvgGenerator( + string outputDirectory, + string[] excludedControls, + LineEndingMode lineEndingMode, + EmbeddedResourceXmlUrlResolver xsltUrlResolver, + XmlWriterSettings xmlWriterSettings, + TaskLoggingHelper log) + : base(excludedControls, lineEndingMode, xsltUrlResolver, xmlWriterSettings, log) + { + _outputDirectory = outputDirectory; + } + + public override bool Generate(string uiKitContent, out string[] generatedFilePaths) + { + var generatedFilePathList = new List(); + + try + { + var xslTransform = new XslCompiledTransform(); + + var transformationStream = EmbeddedResourceHelper.GetEmbeddedResource( + Const.TransformationResourcesDirectory, + Const.SvgTransformationFilename); + + var transformationReader = XmlReader.Create(transformationStream); + xslTransform.Load(transformationReader, XsltSettings.TrustedXslt, _xsltUrlResolver); + + var arguments = new XsltArgumentList(); + // TODO [UI_KIT]: to mitigate compatibility issues control excludes are disabled for SVG. + // Replace empty string with GetExcludedControlsFilter() call when it get possible. + arguments.AddParam(Const.ExcludedControlsFilterParameterName, string.Empty, string.Empty); + arguments.AddParam(Const.ExcludedControlsFilterDelimiterParameterName, string.Empty, Const.ExcludedControlsFilterDelimiter); + + var xmlParserContext = new XmlParserContext(null, null, null, XmlSpace.Default); + + using var xmlReader = new XmlTextReader(uiKitContent, XmlNodeType.Document, xmlParserContext); + using var svgFilesStringWriter = new StringWriter(); + using var svgFilesXmlWriter = XmlWriter.Create(svgFilesStringWriter, _xmlWriterSettings); + xslTransform.Transform(xmlReader, arguments, svgFilesXmlWriter); + + var xml = svgFilesStringWriter.ToString(); + var xmlDocument = XDocument.Parse(xml); + + var svgFilesElement = xmlDocument.Elements(Const.SvgFilesElementName).SingleOrDefault(); + if (svgFilesElement == null) + { + throw new InvalidOperationException( + $"Unable to find '{Const.SvgFilesElementName}' element inside SVG XSLT-transformation result: {xml}"); + } + + var svgFileElements = svgFilesElement.Elements(Const.SvgFileElementName).ToArray(); + if (!svgFileElements.Any()) + { + _log.LogWarning($"Unable to find '{Const.SvgFileElementName}' elements inside SVG XSLT-transformation result: {xml}"); + _log.LogWarning("Skip SVG processing since there is no SVG payload inside the file with UI Kit."); + generatedFilePaths = new string[0]; + return true; + } + + Directory.CreateDirectory(_outputDirectory); + + foreach (var svgFileElement in svgFileElements) + { + var filename = svgFileElement.Attribute(Const.SvgFileFilenameAttributeName)?.Value; + if (string.IsNullOrWhiteSpace(filename)) + { + throw new InvalidOperationException($"Unable to determine filename of SVG file: {svgFileElement}"); + } + + using var svgStringWriter = new StringWriter(); + using (var svgXmlWriter = XmlWriter.Create(svgStringWriter, _xmlWriterSettings)) + { + foreach (var node in svgFileElement.Nodes()) + { + node.WriteTo(svgXmlWriter); + } + } + + var path = Path.Combine(_outputDirectory, filename); + var content = LineEndingHelper.NormalizeLineEndings(svgStringWriter.ToString(), _lineEndingMode); + + _log.LogMessage(MessageImportance.Normal, $"Creating '{path}'."); + File.WriteAllText(path, content, Encoding.UTF8); + + generatedFilePathList.Add(path); + } + + _log.LogMessage( + MessageImportance.High, + $"SVG files generation completed: {generatedFilePathList.Count} file(s) created."); + } + catch (Exception ex) + { + _log.LogError("SVG files generation failed."); + _log.LogErrorFromException(ex, showStackTrace: true); + generatedFilePaths = new string[0]; + return false; + } + + generatedFilePaths = generatedFilePathList.ToArray(); + return true; + } + + private readonly string _outputDirectory; + } +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/TranslationTask.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/TranslationTask.cs new file mode 100644 index 0000000..a5d683f --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/TranslationTask.cs @@ -0,0 +1,384 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System; +using System.IO; +using System.Linq; +using System.Xml; +using Kaspirin.UI.Framework.UiKit.Translator.Core.Translation; +using Kaspirin.UI.Framework.UiKit.Translator.Core.Translation.Fonts; +using Kaspirin.UI.Framework.UiKit.Translator.Core.Translation.Icons; +using Kaspirin.UI.Framework.UiKit.Translator.Core.Translation.Illustrations; +using Kaspirin.UI.Framework.UiKit.Translator.Core.Translation.Palettes; +using Microsoft.Build.Framework; + +namespace Kaspirin.UI.Framework.UiKit.Translator.Core +{ +#if !NET6_0_OR_GREATER + /// + /// In case you need to modify this assembly and test it afterwards, it's better to define MSBUILDDISABLENODEREUSE environment variable with value 1. + /// Otherwise MSBuild will reuse its nodes (i.e. MSBuild.exe processes) that would load this assembly blocking it from any modifications. + /// + [LoadInSeparateAppDomain] +#endif + public sealed class TranslationTask : ConfigurableTask + { + public TranslationTask() + { + _xsltUrlResolver = GetXsltUrlResolver(); + _xmlWriterSettings = GetXmlWriterSettings(); + _lineEndingMode = GetLineEndingMode(); + _excludedControls = new Lazy(GetExcludedControls); + _baseStylesResourceDictionaries = GetBaseStylesResourceDictionaries(); + } + + public override bool Execute() + { + try + { + if (!CheckArguments() || !ReadConfiguration() || !ValidateConfiguration() || !ValidateSchema()) + { + return false; + } + + var uiKitContent = File.ReadAllText(_configuration.UiKitPath); + + if (!GenerateStyles(uiKitContent) || + !GenerateCustomizationDictionaries(uiKitContent) || + !GeneratePalettes(uiKitContent) || + !GeneratePalettesEnums(uiKitContent) || + !GenerateFontEnums(uiKitContent) || + !GenerateSvg(uiKitContent) || + !GenerateIconEnums(uiKitContent) || + !GenerateIconSvg(uiKitContent) || + !GenerateIllustrationEnums(uiKitContent) || + !GenerateIllustrationMarkupExtensions(uiKitContent) || + !GenerateIllustrationSvg(uiKitContent)) + { + return false; + } + + Log.LogMessage(MessageImportance.High, "UI Kit translation successfully completed."); + } + catch (Exception ex) + { + Log.LogErrorFromException(ex, showStackTrace: true); + } + + return !Log.HasLoggedErrors; + } + + private bool ValidateConfiguration() + { + if (string.IsNullOrWhiteSpace(_configuration.GeneratedStylesPath)) + { + Log.LogError($"Configuration required parameter '{nameof(_configuration.GeneratedStylesPath)}' is not set."); + return false; + } + + if (string.IsNullOrWhiteSpace(_configuration.GeneratedResourcesDirectory)) + { + Log.LogError($"Configuration required parameter '{nameof(_configuration.GeneratedResourcesDirectory)}' is not set."); + return false; + } + + if (string.IsNullOrWhiteSpace(_configuration.PaletteDirectory)) + { + Log.LogError($"Configuration required parameter '{nameof(_configuration.PaletteDirectory)}' is not set."); + return false; + } + + if (string.IsNullOrWhiteSpace(_configuration.UiKitPath)) + { + Log.LogError($"Configuration required parameter '{nameof(_configuration.UiKitPath)}' is not set."); + return false; + } + + if (string.IsNullOrWhiteSpace(_configuration.PaletteNamespacePart)) + { + Log.LogError($"Configuration required parameter '{nameof(_configuration.PaletteNamespacePart)}' is not set."); + return false; + } + + return true; + } + + private bool ValidateSchema() + { + var schemaValidator = new SchemaValidator(_configuration.FailOnValidationErrors, Log); + return schemaValidator.Validate(_configuration.UiKitPath); + } + + private bool GenerateStyles(string uiKitContent) + { + var stylesGenerator = new StylesGenerator( + _configuration.GeneratedStylesPath, + _configuration.FileComment, + _excludedControls.Value, + _baseStylesResourceDictionaries, + _lineEndingMode, + _xsltUrlResolver, + _xmlWriterSettings, + Log); + + var result = stylesGenerator.Generate(uiKitContent, out _); + + if (_configuration.FormatXamlFiles) + { + XamlStylerToolFacade.FormatXamlFiles(_configuration.GeneratedStylesPath, Log); + } + + return result; + } + + private bool GenerateCustomizationDictionaries(string uiKitContent) + { + var customizationDictionariesGenerator = new CustomizationDictionariesGenerator( + _configuration.GeneratedResourcesDirectory, + _configuration.FileComment, + _excludedControls.Value, + _lineEndingMode, + _xsltUrlResolver, + _xmlWriterSettings, + Log); + + var result = customizationDictionariesGenerator.Generate(uiKitContent, out _); + + if (_configuration.FormatXamlFiles) + { + XamlStylerToolFacade.FormatXamlFiles(_configuration.GeneratedResourcesDirectory, Log); + } + + return result; + } + + private bool GeneratePalettes(string uiKitContent) + { + var palettesGenerator = new PalettesGenerator( + GetDefaultPaletteId(), + _configuration.PaletteDirectory, + _configuration.FileComment, + _excludedControls.Value, + _lineEndingMode, + _xsltUrlResolver, + _xmlWriterSettings, + Log); + + var result = palettesGenerator.Generate(uiKitContent, out var generatedFilePaths); + + if (_configuration.FormatXamlFiles) + { + foreach (var generatedFilePath in generatedFilePaths) + { + XamlStylerToolFacade.FormatXamlFiles(generatedFilePath, Log); + } + } + + return result; + } + + private bool GeneratePalettesEnums(string uiKitContent) + { + if (string.IsNullOrWhiteSpace(_configuration.PaletteEnumPath)) + { + Log.LogWarning( + $"Configuration optional parameter '{nameof(_configuration.PaletteEnumPath)}' is not set." + + " Palette enums file generation will be skipped."); + return true; + } + + var paletteEnumGenerator = new PaletteEnumGenerator( + _configuration.PaletteEnumPath, + _configuration.PaletteNamespacePart, + _configuration.FileComment, + Log); + + return paletteEnumGenerator.Generate(uiKitContent); + } + + private bool GenerateFontEnums(string uiKitContent) + { + if (string.IsNullOrWhiteSpace(_configuration.FontEnumPath)) + { + Log.LogWarning( + $"Configuration optional parameter '{nameof(_configuration.FontEnumPath)}' is not set." + + " Font enums file generation will be skipped."); + return true; + } + + var paletteEnumGenerator = new FontEnumGenerator( + _configuration.FontEnumPath, + _configuration.FontNamespacePart, + _configuration.PaletteNamespacePart, + _configuration.FileComment, + Log); + + return paletteEnumGenerator.Generate(uiKitContent); + } + + private bool GenerateSvg(string uiKitContent) + { + if (string.IsNullOrWhiteSpace(_configuration.SvgDirectory)) + { + Log.LogWarning( + $"Configuration optional parameter '{nameof(_configuration.SvgDirectory)}' is not set." + + " SVG files generation will be skipped."); + return true; + } + + var svgGenerator = new SvgGenerator( + _configuration.SvgDirectory, + _excludedControls.Value, + _lineEndingMode, + _xsltUrlResolver, + _xmlWriterSettings, + Log); + + return svgGenerator.Generate(uiKitContent, out _); + } + + private bool GenerateIconEnums(string uiKitContent) + { + if (string.IsNullOrWhiteSpace(_configuration.IconEnumPath)) + { + Log.LogWarning( + $"Configuration optional parameter '{nameof(_configuration.IconEnumPath)}' is not set." + + " Icon enums file generation will be skipped."); + return true; + } + + var iconEnumGenerator = new IconEnumGenerator( + _configuration.IconEnumPath, + _configuration.FileComment, + Log); + + return iconEnumGenerator.Generate(uiKitContent); + } + + private bool GenerateIconSvg(string uiKitContent) + { + if (string.IsNullOrWhiteSpace(_configuration.IconSvgDirectory)) + { + Log.LogWarning( + $"Configuration optional parameter '{nameof(_configuration.IconSvgDirectory)}' is not set." + + " Icon SVG files generation will be skipped."); + return true; + } + + var iconSvgGenerator = new IconSvgGenerator( + _configuration.IconSvgDirectory, + _excludedControls.Value, + _lineEndingMode, + _xsltUrlResolver, + _xmlWriterSettings, + Log); + + return iconSvgGenerator.Generate(uiKitContent, out _); + } + + private bool GenerateIllustrationEnums(string uiKitContent) + { + if (_configuration.ProductMediaProjectInfoMapping is null) + { + Log.LogWarning( + $"Configuration optional parameter '{nameof(_configuration.ProductMediaProjectInfoMapping)}' is not set." + + " Illustration enums file generation will be skipped."); + return true; + } + + var illustrationEnumGenerator = new IllustrationEnumGenerator( + _configuration.GetProductMediaProjectInfo, + _configuration.FileComment, + Log); + + return illustrationEnumGenerator.Generate(uiKitContent); + } + + private bool GenerateIllustrationMarkupExtensions(string uiKitContent) + { + if (_configuration.ProductMediaProjectInfoMapping is null) + { + Log.LogWarning( + $"Configuration optional parameter '{nameof(_configuration.ProductMediaProjectInfoMapping)}' is not set." + + " Illustration markup extension files generation will be skipped."); + return true; + } + + var illustrationMarkupExtensionGenerator = new IllustrationMarkupExtensionGenerator( + _configuration.GetProductMediaProjectInfo, + _configuration.FileComment, + Log); + + return illustrationMarkupExtensionGenerator.Generate(uiKitContent); + } + + private bool GenerateIllustrationSvg(string uiKitContent) + { + if (string.IsNullOrWhiteSpace(_configuration.IconSvgDirectory)) + { + Log.LogWarning( + $"Configuration optional parameter '{nameof(_configuration.ProductMediaProjectInfoMapping)}' is not set." + + " Illustration SVG files generation will be skipped."); + return true; + } + + var illustrationSvgGenerator = new IllustrationSvgGenerator( + _configuration.GetProductMediaProjectInfo, + _excludedControls.Value, + _lineEndingMode, + _xsltUrlResolver, + _xmlWriterSettings, + Log); + + return illustrationSvgGenerator.Generate(uiKitContent, out _); + } + + private EmbeddedResourceXmlUrlResolver GetXsltUrlResolver() + => new(Const.TransformationResourcesDirectory, Log); + + private XmlWriterSettings GetXmlWriterSettings() + => new() + { + IndentChars = Const.DefaultOutputIndentChars, + Indent = true, + OmitXmlDeclaration = true + }; + + private string[] GetExcludedControls() + { + Log.LogMessage( + MessageImportance.High, + _configuration.ExcludedControls?.Any() == true + ? $"Configuration optional parameter '{nameof(_configuration.ExcludedControls)}' is set: {string.Join(", ", _configuration.ExcludedControls)}." + : $"Configuration optional parameter '{nameof(_configuration.ExcludedControls)}' is not set."); + + return _configuration.ExcludedControls; + } + + private LineEndingMode GetLineEndingMode() + => Const.DefaultLineEndingMode; + + private string GetDefaultPaletteId() + => Const.DefaultPaletteId; + + private string[] GetBaseStylesResourceDictionaries() + => new[] { Const.TemplateDictionaryName }; + + private readonly EmbeddedResourceXmlUrlResolver _xsltUrlResolver; + private readonly XmlWriterSettings _xmlWriterSettings; + private readonly LineEndingMode _lineEndingMode; + private readonly Lazy _excludedControls; + private readonly string[] _baseStylesResourceDictionaries; + } +} \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/XamlStylerToolFacade.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/XamlStylerToolFacade.cs new file mode 100644 index 0000000..84baf27 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/XamlStylerToolFacade.cs @@ -0,0 +1,170 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System; +using System.Diagnostics; +using System.IO; +using System.Threading; +using Microsoft.Build.Framework; +using Microsoft.Build.Utilities; + +namespace Kaspirin.UI.Framework.UiKit.Translator.Core +{ + public static class XamlStylerToolFacade + { + public static void FormatXamlFiles(string path, TaskLoggingHelper log) + { + if (!CheckXamlStylerToolInstalled()) + { + log.LogMessage(MessageImportance.High, "XamlStyler dotnet tool is not installed."); + + log.LogMessage(MessageImportance.High, "Installing XamlStyler dotnet tool."); + + var hasExited = ExecuteCommand(DotnetCommand, "tool install XamlStyler.Console --global", out _, out var exitCode); + if (hasExited && exitCode != SuccessExitCode || !CheckXamlStylerToolInstalled()) + { + log.LogWarning("Failed to install XamlStyler dotnet tool. Skip XAML files formatting."); + return; + } + + log.LogMessage(MessageImportance.High, "XamlStyler dotnet tool was successfully installed."); + } + + if (Directory.Exists(path)) + { + FormatXamlFilesInDirectory(path, log); + } + else if (File.Exists(path)) + { + FormatXamlFile(path, log); + } + else + { + log.LogWarning($"'{path}' doesn't correspond to existing file or directory. Skip XAML files formatting."); + } + } + + private static bool CheckXamlStylerToolInstalled() + { + var hasExited = ExecuteCommand(DotnetCommand, "tool list -g", out var output, out var exitCode); + return hasExited && exitCode == SuccessExitCode && output.Contains(XamlStylerToolCommand); + } + + private static bool FormatXamlFilesInDirectory(string directory, TaskLoggingHelper log) + { + directory = Path.GetFullPath(directory); + + for (var retryCounter = 1; retryCounter <= MaxRetriesCount; retryCounter++) + { + log.LogMessage(MessageImportance.Normal, $"[Attempt #{retryCounter}] Run XamlStyler dotnet tool for directory '{directory}'."); + + var hasExited = ExecuteCommand( + XamlStylerToolCommand, + $"{DirectoryParamName} {directory} {RecursiveParamName} {LogLevelParamName} None", + out _, + out var exitCode); + + if (hasExited && exitCode == SuccessExitCode) + { + log.LogMessage(MessageImportance.Normal, $"[Attempt #{retryCounter}] XAML files in directory '{directory}' were successfully formatted."); + log.LogMessage(MessageImportance.High, $"XAML files in directory '{directory}' were successfully formatted."); + return true; + } + else + { + log.LogMessage(MessageImportance.Normal, $"[Attempt #{retryCounter}] Failed to format XAML files in directory '{directory}' (exit code 0x{exitCode:X})."); + } + + if (retryCounter != MaxRetriesCount) + { + Thread.Sleep(RetryDelay); + } + } + + log.LogWarning($"Failed to format XAML files in directory '{directory}'."); + return false; + } + + private static bool FormatXamlFile(string path, TaskLoggingHelper log) + { + path = Path.GetFullPath(path); + + for (var retryCounter = 1; retryCounter <= MaxRetriesCount; retryCounter++) + { + + log.LogMessage(MessageImportance.Normal, $"[Attempt #{retryCounter}] Run XamlStyler dotnet tool for file '{path}'."); + + var hasExited = ExecuteCommand( + XamlStylerToolCommand, + $"{FileParamName} {path} {LogLevelParamName} None", + out _, + out var exitCode); + + if (hasExited && exitCode == SuccessExitCode) + { + log.LogMessage(MessageImportance.Normal, $"[Attempt #{retryCounter}] XAML file '{path}' was successfully formatted."); + log.LogMessage(MessageImportance.High, $"XAML file '{path}' was successfully formatted."); + return true; + } + else + { + log.LogMessage(MessageImportance.Normal, $"[Attempt #{retryCounter}] Failed to format XAML file '{path}' (exit code 0x{exitCode:X})."); + } + + if (retryCounter != MaxRetriesCount) + { + Thread.Sleep(RetryDelay); + } + } + + log.LogWarning($"Failed to format XAML file '{path}'."); + return false; + } + + private static bool ExecuteCommand(string command, string arguments, out string output, out int exitCode) + { + using var process = new Process(); + + process.StartInfo = new ProcessStartInfo() + { + Arguments = arguments, + FileName = command, + RedirectStandardError = true, + RedirectStandardInput = true, + RedirectStandardOutput = true, + UseShellExecute = false + }; + + process.Start(); + process.WaitForExit(XamlStylerToolExitTimeout); + + output = process.StandardOutput.ReadToEnd(); + exitCode = process.HasExited ? process.ExitCode : -1; + + return process.HasExited; + } + + private const string DotnetCommand = "dotnet"; + private const string XamlStylerToolCommand = "xstyler"; + private const string FileParamName = "--file"; + private const string DirectoryParamName = "--directory"; + private const string RecursiveParamName = "--recursive"; + private const string LogLevelParamName = "--loglevel"; + private const int MaxRetriesCount = 5; + private const int SuccessExitCode = 0; + + private static readonly TimeSpan RetryDelay = TimeSpan.FromMilliseconds(500); + private static readonly int XamlStylerToolExitTimeout = (int)TimeSpan.FromSeconds(30).TotalMilliseconds; + } +} \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/XmlFontSource.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/XmlFontSource.cs new file mode 100644 index 0000000..4581958 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/XmlFontSource.cs @@ -0,0 +1,82 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Xml.Linq; +using Kaspirin.UI.Framework.UiKit.Translator.Core.Translation.Fonts; + +namespace Kaspirin.UI.Framework.UiKit.Translator.Core +{ + internal class XmlFontSource + { + public XmlFontSource(Action logWarning) + { + _warn = logWarning ?? (_ => { }); + } + + public IEnumerable GetFonts(string uiKitContent) + { + var xmlDocument = XDocument.Parse(uiKitContent); + + var controlsElement = xmlDocument + .Elements(Const.RootElementName) + .Elements(Const.ControlsElementName) + .SingleOrDefault(); + + if (controlsElement == null) + { + throw new InvalidOperationException($"Unable to find '{Const.ControlsElementName}' element inside XSLT-transformation result: {uiKitContent}"); + } + + var textStylesElement = controlsElement.Elements(Const.TextStylesElementName).ToArray(); + if (!textStylesElement.Any()) + { + throw new InvalidOperationException($"Unable to find '{Const.TextStylesElementName}' elements inside XSLT-transformation result: {uiKitContent}"); + } + + var textStyleElements = textStylesElement.Elements(Const.TextStyleElementName).ToArray(); + if (!textStyleElements.Any()) + { + throw new InvalidOperationException($"Unable to find '{Const.TextStyleElementName}' elements inside XSLT-transformation result: {uiKitContent}"); + } + + return textStyleElements.Select(NodeToDto); + } + + private Font NodeToDto(XElement textStyleElement) + { + var textStyleId = textStyleElement.Attribute(Const.TextStyleIdAttributeName)?.Value; + if (string.IsNullOrWhiteSpace(textStyleId)) + { + throw new InvalidOperationException($"Unable to get text style id: {Environment.NewLine}{textStyleElement}."); + } + + if (!textStyleId.StartsWith(Const.TextStyleIdPrefix)) + { + _warn($"Unexpected text style id: '{textStyleId}'."); + return null; + } + + return new Font() + { + Id = textStyleId, + Name = textStyleId.Replace(Const.TextStyleIdPrefix, ""), + }; + } + + private readonly Action _warn; + } +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/XmlIconSource.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/XmlIconSource.cs new file mode 100644 index 0000000..3d02d28 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/XmlIconSource.cs @@ -0,0 +1,152 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text.RegularExpressions; +using System.Xml.Linq; +using Kaspirin.UI.Framework.UiKit.Translator.Core.Translation.Icons; + +namespace Kaspirin.UI.Framework.UiKit.Translator.Core +{ + internal sealed class XmlIconSource + { + public XmlIconSource(Action logWarning) + { + _warn = logWarning ?? (_ => { }); + } + + public IEnumerable GetIcons(string uiKitContent) + { + var xmlDocument = XDocument.Parse(uiKitContent); + + var iconsElement = xmlDocument + .Elements(Const.RootElementName) + .Elements(Const.SvgIconsElementName) + .SingleOrDefault(); + + if (iconsElement == null) + { + throw new InvalidOperationException( + $"Unable to find '{Const.SvgIconsElementName}' element inside the file with UI Kit: {Environment.NewLine}{uiKitContent}"); + } + + var iconElements = iconsElement.Elements(Const.SvgIconElementName).ToArray(); + if (!iconElements.Any()) + { + throw new InvalidOperationException( + $"Unable to find '{Const.SvgIconElementName}' elements inside the file with UI Kit: {Environment.NewLine}{uiKitContent}"); + } + + return iconElements + .Select(NodeToDto) + .Where(i => i != null); + } + + private Icon NodeToDto(XElement iconElement) + { + var iconId = iconElement.Attribute(Const.SvgIconIdAttributeName)?.Value; + if (string.IsNullOrWhiteSpace(iconId)) + { + throw new InvalidOperationException($"Unable to get icon id: {Environment.NewLine}{iconElement}."); + } + + var match = _iconIdRegex.Match(iconId); + if (!match.Success) + { + _warn($"Unexpected icon id: '{iconId}'."); + return null; + } + + if (!bool.TryParse(iconElement.Attribute(Const.SvgIconIsAutoRTLAttributeName)?.Value, out var isAutoRTL)) + { + throw new InvalidOperationException( + $"Unable to parse boolean value of attribute '{Const.SvgIconIsAutoRTLAttributeName}': {Environment.NewLine}{iconElement}"); + } + + if (!bool.TryParse(iconElement.Attribute(Const.SvgIconIsColorfullAttributeName)?.Value, out var isColorfull)) + { + throw new InvalidOperationException( + $"Unable to parse boolean value of attribute '{Const.SvgIconIsColorfullAttributeName}': {Environment.NewLine}{iconElement}"); + } + + if (!int.TryParse(match.Groups[1].Value, out var size)) + { + throw new InvalidOperationException($"Unable to get icon size from icon id: '{iconId}'."); + } + + var name = match.Groups[2].Value.Replace(" ", ""); + + var vectors = iconElement + .Elements(Const.VectorsElementName) + ?.Elements(Const.VectorElementName) + ?.ToArray(); + + if (vectors?.Any() != true) + { + throw new InvalidOperationException($"Unable to get icon vectors: {Environment.NewLine}{iconElement}."); + } + + if (vectors.Length > 2) + { + throw new InvalidOperationException($"Unsupported number of icon vectors: {Environment.NewLine}{iconElement}."); + } + + var svg = default(string); + var svgRTL = default(string); + + foreach (var vector in vectors) + { + if (!bool.TryParse(vector.Attribute(Const.VectorIsRTLAttributeName)?.Value, out var isRTL)) + { + throw new InvalidOperationException( + $"Unable to parse boolean value of attribute '{Const.VectorIsRTLAttributeName}' of icon with id '{iconId}': {Environment.NewLine}{vector}"); + } + + var svgData = vector + .Element(Const.VectorDataElementName) + ?.Element(Const.SvgElementName) + ?.Value; + + if (string.IsNullOrWhiteSpace(svgData)) + { + throw new InvalidOperationException($"Unable to get vector's SVG of icon with id '{iconId}': {Environment.NewLine}{vector}"); + } + + if (isRTL) + { + svgRTL = svgData; + } + else + { + svg = svgData; + } + } + + return new Icon() + { + IsColorfull = isColorfull, + IsAutoRTL = isAutoRTL, + Size = size, + Name = name, + Svg = svg, + SvgRTL = svgRTL + }; + } + + private readonly Regex _iconIdRegex = new("^(\\d+) \\/.*? ([\\w ]+)$"); + private readonly Action _warn; + } +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/XmlIllustrationSource.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/XmlIllustrationSource.cs new file mode 100644 index 0000000..1f7c07c --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/XmlIllustrationSource.cs @@ -0,0 +1,148 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Xml.Linq; +using Kaspirin.UI.Framework.UiKit.Translator.Core.Translation.Illustrations; + +namespace Kaspirin.UI.Framework.UiKit.Translator.Core +{ + internal sealed class XmlIllustrationSource + { + public IEnumerable GetIllustrations(string uiKitContent) + { + var xmlDocument = XDocument.Parse(uiKitContent); + + var illustrationsElement = xmlDocument + .Elements(Const.RootElementName) + .Elements(Const.IllustrationsElementName) + .SingleOrDefault(); + + if (illustrationsElement == null) + { + throw new InvalidOperationException( + $"Unable to find '{Const.IllustrationsElementName}' element inside the file with UI Kit: {Environment.NewLine}{uiKitContent}"); + } + + var illustrationElements = illustrationsElement.Elements(Const.IllustrationElementName).ToArray(); + if (!illustrationElements.Any()) + { + throw new InvalidOperationException( + $"Unable to find '{Const.IllustrationElementName}' elements inside the file with UI Kit: {Environment.NewLine}{uiKitContent}"); + } + + return illustrationElements + .Select(NodeToDto) + .Where(i => i != null); + } + + private Illustration NodeToDto(XElement illustrationElement) + { + var illustrationId = illustrationElement.Attribute(Const.IllustrationIdAttributeName)?.Value; + if (string.IsNullOrWhiteSpace(illustrationId)) + { + throw new InvalidOperationException($"Unable to get illustration id: {Environment.NewLine}{illustrationElement}."); + } + + if (!double.TryParse(illustrationElement.Attribute(Const.IllustrationHeightAttributeName)?.Value, out var height)) + { + throw new InvalidOperationException( + $"Unable to parse double value of attribute '{Const.IllustrationHeightAttributeName}': {Environment.NewLine}{illustrationElement}"); + } + + if (!bool.TryParse(illustrationElement.Attribute(Const.IllustrationIsAutoRTLAttributeName)?.Value, out var isAutoRTL)) + { + throw new InvalidOperationException( + $"Unable to parse boolean value of attribute '{Const.IllustrationIsAutoRTLAttributeName}': {Environment.NewLine}{illustrationElement}"); + } + + var illustrationName = illustrationElement.Attribute(Const.IllustrationNameAttributeName)?.Value; + if (string.IsNullOrWhiteSpace(illustrationName)) + { + throw new InvalidOperationException($"Unable to get illustration name: {Environment.NewLine}{illustrationElement}."); + } + + var product = illustrationElement.Attribute(Const.IllustrationProductAttributeName)?.Value; + if (string.IsNullOrWhiteSpace(product)) + { + throw new InvalidOperationException($"Unable to get illustration product: {Environment.NewLine}{illustrationElement}."); + } + + var scope = illustrationElement.Attribute(Const.IllustrationScopeAttributeName)?.Value; + if (string.IsNullOrWhiteSpace(scope)) + { + throw new InvalidOperationException($"Unable to get illustration scope: {Environment.NewLine}{illustrationElement}."); + } + + if (!double.TryParse(illustrationElement.Attribute(Const.IllustrationWidthAttributeName)?.Value, out var width)) + { + throw new InvalidOperationException( + $"Unable to parse double value of attribute '{Const.IllustrationWidthAttributeName}': {Environment.NewLine}{illustrationElement}"); + } + + var vectors = illustrationElement + .Elements(Const.VectorsElementName) + ?.Elements(Const.VectorElementName) + ?.ToArray(); + + if (vectors?.Any() != true) + { + throw new InvalidOperationException($"Unable to get illustration vectors: {Environment.NewLine}{illustrationElement}."); + } + + if (vectors.Length > 4) + { + throw new InvalidOperationException($"Unsupported number of illustration vectors: {Environment.NewLine}{illustrationElement}."); + } + + var illustrationVectors = new List(); + + foreach (var vector in vectors) + { + if (!bool.TryParse(vector.Attribute(Const.VectorIsRTLAttributeName)?.Value, out var isRTL)) + { + throw new InvalidOperationException( + $"Unable to parse boolean value of attribute '{Const.VectorIsRTLAttributeName}' of vector inside illustration with id '{illustrationId}': {Environment.NewLine}{vector}"); + } + + var theme = vector.Attribute(Const.VectorThemeAttributeName)?.Value; + + var svgData = vector + .Element(Const.VectorDataElementName) + ?.Element(Const.SvgElementName) + ?.Value; + + if (string.IsNullOrWhiteSpace(svgData)) + { + throw new InvalidOperationException($"Unable to get vector's SVG inside illustration with id '{illustrationId}': {Environment.NewLine}{vector}"); + } + + illustrationVectors.Add(new Illustration.IllustrationVector() { IsRTL = isRTL, Theme = theme, Vector = svgData }); + } + + return new Illustration() + { + Height = height, + IsAutoRTL = isAutoRTL, + Name = illustrationName, + Product = product, + Scope = scope, + Vectors = illustrationVectors.ToArray(), + Width = width + }; + } + } +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/XmlPaletteSource.cs b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/XmlPaletteSource.cs new file mode 100644 index 0000000..7ef0d62 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Core/XmlPaletteSource.cs @@ -0,0 +1,72 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using Kaspirin.UI.Framework.UiKit.Translator.Core.Translation.Palettes; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Xml.Linq; + +namespace Kaspirin.UI.Framework.UiKit.Translator.Core +{ + internal sealed class XmlPaletteSource + { + public IEnumerable GetPalettes(string uiKitContent) + { + var xmlDocument = XDocument.Parse(uiKitContent); + + var paletteItemsElement = xmlDocument + .Elements(Const.RootElementName) + .Elements(Const.PalettesElementName) + .SingleOrDefault(); + + if (paletteItemsElement == null) + { + throw new InvalidOperationException($"Unable to find '{Const.PalettesElementName}' element inside XSLT-transformation result: {uiKitContent}"); + } + + var paletteElements = paletteItemsElement.Elements(Const.PaletteElementName).ToArray(); + if (!paletteElements.Any()) + { + throw new InvalidOperationException($"Unable to find '{Const.PaletteElementName}' elements inside XSLT-transformation result: {uiKitContent}"); + } + + var brushesElement = paletteElements.First().Element(Const.BrushesElementName) + ?? throw new InvalidOperationException($"Unable to find '{Const.BrushesElementName}' element inside XSLT-transformation result: {uiKitContent}"); + + var brushesElements = brushesElement.Elements(Const.BrushElementName); + if (!brushesElements.Any()) + { + throw new InvalidOperationException($"Unable to find '{Const.BrushElementName}' elements inside XSLT-transformation result: {uiKitContent}"); + } + + return brushesElements.Select(NodeToDto); + } + + private PaletteItem NodeToDto(XElement paletteBrushElement) + { + var brushId = paletteBrushElement.Attribute(Const.BrushIdAttributeName)?.Value; + if (string.IsNullOrWhiteSpace(brushId)) + { + throw new InvalidOperationException($"Unable to determine id in paletteBrush element: {paletteBrushElement}"); + } + + return new PaletteItem() + { + Id = brushId, + Name = brushId.Replace("-", "").Replace("_", ""), + }; + } + } +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Launcher/Kaspirin.UI.Framework.UiKit.Translator.Launcher.csproj b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Launcher/Kaspirin.UI.Framework.UiKit.Translator.Launcher.csproj new file mode 100644 index 0000000..232d0ad --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Launcher/Kaspirin.UI.Framework.UiKit.Translator.Launcher.csproj @@ -0,0 +1,38 @@ + + + kaspirin.ui.framework.uikit.translator.launcher + + + + + + + + + config.json + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Launcher/config.json b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Launcher/config.json new file mode 100644 index 0000000..789b332 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit.Translator.Launcher/config.json @@ -0,0 +1,27 @@ +{ + "ProductMediaProjectInfoMapping": [ + { + "Key": "Default", + "Value": { + "IllustrationSvgDirectory": "..\\Kaspirin.UI.Framework.UiKit.Media\\Resources\\", + "IllustrationEnumPath": "..\\Kaspirin.UI.Framework.UiKit.Media\\Illustrations\\UIKitIllustrationsGenerated.cs", + "IllustrationMarkupExtensionPath": "..\\Kaspirin.UI.Framework.UiKit.Media\\MarkupExtensions\\UIKitIllustrationExtensionGenerated.cs", + "ProductNamespacePart": "Media" + } + } + ], + "GeneratedStylesPath": "..\\Kaspirin.UI.Framework.UiKit.Styles\\Xaml\\Generated\\StylesGenerated.xaml", + "GeneratedResourcesDirectory": "..\\Kaspirin.UI.Framework.UiKit.Styles\\Resources\\neutral\\dictionaries\\", + "FontEnumPath": "..\\Kaspirin.UI.Framework.UiKit.Styles\\Fonts\\UIKitFontStorage.cs", + "FontNamespacePart": "Styles", + "PaletteDirectory": "..\\Kaspirin.UI.Framework.UiKit.Styles\\Resources\\neutral\\dictionaries\\", + "PaletteEnumPath": "..\\Kaspirin.UI.Framework.UiKit.Styles\\Palette\\UIKitPaletteStorage.cs", + "PaletteNamespacePart": "Styles", + "SvgDirectory": "..\\Kaspirin.UI.Framework.UiKit.Styles\\Resources\\neutral\\images\\svg\\", + "IconSvgDirectory": "..\\Kaspirin.UI.Framework.UiKit\\Resources\\", + "IconEnumPath": "..\\Kaspirin.UI.Framework.UiKit\\Icons\\UIKitIconsGenerated.cs", + "UiKitPath": "..\\..\\figma\\plugin_output\\UI_KIT.xml", + "FileComment": "This file was automatically generated by the 'Kaspirin.UI.Framework.UiKit.Translator'.\r\nCode generated by the 'Kaspirin.UI.Framework.UiKit.Translator' is owned by the owner of the input file used when generating it.\r\nThe following copyright applies to the portions of the 'Kaspirin.UI.Framework.UiKit.Translator' located in this file: Copyright © 2024 AO Kaspersky Lab.", + "FailOnValidationErrors": true, + "FormatXamlFiles": true +} \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit/Accessibility/TextScale/ITextScaleService.cs b/src/framework/Kaspirin.UI.Framework.UiKit/Accessibility/TextScale/ITextScaleService.cs new file mode 100644 index 0000000..26240b3 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit/Accessibility/TextScale/ITextScaleService.cs @@ -0,0 +1,25 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +namespace Kaspirin.UI.Framework.UiKit.Accessibility.TextScale +{ + public interface ITextScaleService + { + bool IsEnabled { get; set; } + + double ScaleFactor { get; } + + event TextScaleChangedDelegate ScaleFactorChanged; + } +} \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit/Accessibility/TextScale/TextScaleBehavior.cs b/src/framework/Kaspirin.UI.Framework.UiKit/Accessibility/TextScale/TextScaleBehavior.cs new file mode 100644 index 0000000..bebe16a --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit/Accessibility/TextScale/TextScaleBehavior.cs @@ -0,0 +1,148 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System.Windows; +using System.Windows.Controls; +using System.Windows.Media; + +using PopupWpf = System.Windows.Controls.Primitives.Popup; + +namespace Kaspirin.UI.Framework.UiKit.Accessibility.TextScale +{ + public sealed class TextScaleBehavior : Behavior + { + public TextScaleBehavior() + { + _textScaleService = ServiceLocator.Instance.GetService(); + _currentScale = OriginScale; + } + + protected override void OnAttached() + { + base.OnAttached(); + + _textScaleService.ScaleFactorChanged -= OnScaleFactorChanged; + _textScaleService.ScaleFactorChanged += OnScaleFactorChanged; + + UpdateLayoutTransform(_textScaleService.ScaleFactor); + } + + protected override void OnDetaching() + { + base.OnDetaching(); + + _textScaleService.ScaleFactorChanged -= OnScaleFactorChanged; + + UpdateLayoutTransform(OriginScale); + } + + protected override void OnAssociatedObjectLoaded() + { + base.OnAssociatedObjectLoaded(); + + _textScaleService.ScaleFactorChanged -= OnScaleFactorChanged; + _textScaleService.ScaleFactorChanged += OnScaleFactorChanged; + + UpdateLayoutTransform(_textScaleService.ScaleFactor); + } + + protected override void OnAssociatedObjectUnloaded() + { + base.OnAssociatedObjectLoaded(); + + _textScaleService.ScaleFactorChanged -= OnScaleFactorChanged; + + UpdateLayoutTransform(OriginScale); + } + + private void OnScaleFactorChanged(TextScaleService sender, TextScaleChangedEventArgs eventArgs) + { + UpdateLayoutTransform(eventArgs.NewScale); + } + + private void UpdateLayoutTransform(double scale) + { + var oldScale = _currentScale; + var newScale = scale; + + if (_currentScale.NearlyEqual(scale)) + { + return; + } + + _currentScale = scale; + + if (AssociatedObject is Window window) + { + ScaleWindow(window, oldScale, newScale); + } + else if (AssociatedObject is PopupWpf popup) + { + ScalePopup(popup, newScale); + } + else if (AssociatedObject is FrameworkElement frameworkElement) + { + ScaleFrameworkElement(frameworkElement, newScale); + } + } + + private void ScaleWindow(Window target, double oldScale, double newScale) + { + target.WhenLoaded(() => + { + WindowScaleHelper.ScaleContentByTextScaleChange(target, newScale); + + var canResize = target.ResizeMode == ResizeMode.CanResize || + target.ResizeMode == ResizeMode.CanResizeWithGrip; + + if (canResize is false) + { + var scaleChangeRatio = newScale / oldScale; + var sizeToContent = target.SizeToContent; + + target.SetCurrentValue(Window.SizeToContentProperty, SizeToContent.Manual); + + WindowScaleHelper.ScaleWindowByTextScaleChange(target, scaleChangeRatio); + + target.SetCurrentValue(Window.SizeToContentProperty, sizeToContent); + } + }); + } + + private void ScaleFrameworkElement(FrameworkElement target, double scale) + { + target.LayoutTransform = (ScaleTransform)new ScaleTransform(scale, scale).GetAsFrozen(); + } + + private void ScalePopup(PopupWpf target, double scale) + { + if (target.Child is FrameworkElement popupChild) + { + var isPopupOpen = popupChild.IsLoaded && target.IsOpen; + var isTransformInherited = popupChild is ToolTip || + popupChild is ContextMenu; + + if (isPopupOpen || isTransformInherited) + { + popupChild.LayoutTransform = (ScaleTransform)new ScaleTransform(scale, scale).GetAsFrozen(); + } + } + } + + private const double OriginScale = 1; + + private readonly ITextScaleService _textScaleService; + private double _currentScale; + } +} \ No newline at end of file diff --git a/src/framework/Kaspirin.UI.Framework.UiKit/Accessibility/TextScale/TextScaleChangedDelegate.cs b/src/framework/Kaspirin.UI.Framework.UiKit/Accessibility/TextScale/TextScaleChangedDelegate.cs new file mode 100644 index 0000000..3596395 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit/Accessibility/TextScale/TextScaleChangedDelegate.cs @@ -0,0 +1,18 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +namespace Kaspirin.UI.Framework.UiKit.Accessibility.TextScale +{ + public delegate void TextScaleChangedDelegate(TextScaleService sender, TextScaleChangedEventArgs e); +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit/Accessibility/TextScale/TextScaleChangedEventArgs.cs b/src/framework/Kaspirin.UI.Framework.UiKit/Accessibility/TextScale/TextScaleChangedEventArgs.cs new file mode 100644 index 0000000..6d1b8fe --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit/Accessibility/TextScale/TextScaleChangedEventArgs.cs @@ -0,0 +1,28 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +namespace Kaspirin.UI.Framework.UiKit.Accessibility.TextScale +{ + public sealed class TextScaleChangedEventArgs + { + public TextScaleChangedEventArgs(double oldScale, double newScale) + { + OldScale = oldScale; + NewScale = newScale; + } + + public double NewScale { get; private set; } + public double OldScale { get; private set; } + } +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit/Accessibility/TextScale/TextScaleService.cs b/src/framework/Kaspirin.UI.Framework.UiKit/Accessibility/TextScale/TextScaleService.cs new file mode 100644 index 0000000..35bc747 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit/Accessibility/TextScale/TextScaleService.cs @@ -0,0 +1,278 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System; +using System.Threading; +using System.Threading.Tasks; +using System.Windows; +using Microsoft.Win32; + +namespace Kaspirin.UI.Framework.UiKit.Accessibility.TextScale +{ + public sealed class TextScaleService : ITextScaleService, IDisposable + { + public const string ScaleFactorRegPath = "HKEY_CURRENT_USER\\" + ScaleFactorSubkey; + public const string ScaleFactorRegValue = "TextScaleFactor"; + + public TextScaleService(IRegistry registry, IRegistryTracker registryTracker, IWinRTUISettings uiSettings) + { + _winRTuiSettings = Guard.EnsureArgumentIsNotNull(uiSettings); + _registry = Guard.EnsureArgumentIsNotNull(registry); + _registryTracker = Guard.EnsureArgumentIsNotNull(registryTracker); + + IsEnabled = true; + } + + public bool IsEnabled + { + get => _isEnabled; + set + { + if (!OperatingSystemInfo.IsWin10OrHigher) + { + _isEnabled = false; + + if (value) + { + _trace.TraceWarning($"Service is unavailable on current OS Version."); + } + } + else + { + _isEnabled = value; + + _trace.TraceInformation($"{nameof(IsEnabled)} is set to {value}."); + + if (_isEnabled) + { + StartTrackScaleChanges(); + } + else + { + StopTrackScaleChanges(); + } + + UpdateScale(); + } + } + } + + public double ScaleFactor { get; private set; } = 1; + + public event TextScaleChangedDelegate? ScaleFactorChanged; + + #region IDisposable + + void IDisposable.Dispose() + { + StopTrackScaleChanges(); + } + + #endregion + + private void UpdateScale() + { + var scale = 1D; + + if (IsEnabled) + { + var systemScale = GetSystemTextScaleFactor(); + if (systemScale > 1) + { + // add 0.07 on each 25% of scale + scale += (Math.Floor(systemScale / 0.25) - 3D) * 0.07; + } + } + + if (ScaleFactor.NotNearlyEqual(scale)) + { + var oldScale = ScaleFactor; + var newScale = scale; + + ScaleFactor = scale; + + _trace.TraceInformation($"ScaleFactor changed to {scale}."); + + Executers.InUiAsync(() => ScaleFactorChanged?.Invoke(this, new TextScaleChangedEventArgs(oldScale, newScale))); + } + } + + private void StartTrackScaleChanges() + { + if (_isTracking) + { + return; + } + + _isTracking = true; + + if (_winRTuiSettings.IsAvailable) + { + StartTrackChangesFromWinRT(); + } + else + { + StartTrackChangesFromRegistry(); + } + } + + private void StopTrackScaleChanges() + { + if (!_isTracking) + { + return; + } + + StopTrackChangesFromWinRT(); + StopTrackChangesFromRegistry(); + + _isTracking = false; + } + + private void StartTrackChangesFromWinRT() + { + _trace.TraceInformation("Starting tracking of scale changes from WinRT API"); + + _winRTuiSettings.TextScaleFactorChanged -= OnTextScaleFactorChangedFromWinRT; + _winRTuiSettings.TextScaleFactorChanged += OnTextScaleFactorChangedFromWinRT; + } + + private void StopTrackChangesFromWinRT() + { + _trace.TraceInformation("Stopping tracking of scale changes from WinRT API"); + + _winRTuiSettings.TextScaleFactorChanged -= OnTextScaleFactorChangedFromWinRT; + } + + private void StartTrackChangesFromRegistry() + { + _trace.TraceInformation("Starting tracking of scale changes from registry"); + + _cancellationTokenSource = new CancellationTokenSource(); + + _trackingTask = _registryTracker.TrackChangesAsync( + ScaleFactorHive, + ScaleFactorView, + ScaleFactorSubkey, + _cancellationTokenSource.Token, + UpdateScale); + } + + private void StopTrackChangesFromRegistry() + { + _trace.TraceInformation("Stopping tracking of scale changes from registry"); + + if (_cancellationTokenSource != null) + { + _cancellationTokenSource.Cancel(); + + if (_trackingTask is not null) + { + var cancellationTokenSource = _cancellationTokenSource; + _cancellationTokenSource = null; + + _trackingTask.ContinueWith(_ => cancellationTokenSource.Dispose()); + _trackingTask = null; + } + else + { + _cancellationTokenSource.Dispose(); + _cancellationTokenSource = null; + } + } + } + + private double GetSystemTextScaleFactor() + { + var scaleFactor = 1D; + var scaleProvided = false; + + if (!scaleProvided) + { + var scaleFactorWinRTValue = GetScaleFactorFromWinRT(); + if (scaleFactorWinRTValue != null) + { + scaleFactor = scaleFactorWinRTValue.Value; + _trace.TraceInformation($"SystemScaleFactor '{scaleFactor}' provided from WinRT."); + + scaleProvided = true; + } + } + + if (!scaleProvided) + { + var scaleFactorRegValue = GetScaleFactorFromRegistry(); + if (scaleFactorRegValue != null) + { + scaleFactor = Convert.ToDouble(scaleFactorRegValue) / DefaultScaleFactorRegValue; + _trace.TraceInformation($"SystemScaleFactor '{scaleFactor}' provided from Registry."); + + scaleProvided = true; + } + } + + if (!scaleProvided) + { + scaleFactor = GetScaleFactorFromSystemFonts(); + _trace.TraceInformation($"SystemScaleFactor '{scaleFactor}' provided from SystemFonts."); + } + + if (scaleFactor < 1) + { + scaleFactor = 1; + } + + return scaleFactor; + } + + private void OnTextScaleFactorChangedFromWinRT(object? sender, EventArgs e) + { + UpdateScale(); + } + + private object? GetScaleFactorFromRegistry() + { + return _registry.GetValue(ScaleFactorRegPath, ScaleFactorRegValue, DefaultScaleFactorRegValue); + } + + private double? GetScaleFactorFromWinRT() + { + return _winRTuiSettings.IsAvailable ? _winRTuiSettings.TextScaleFactor : null; + } + + private double GetScaleFactorFromSystemFonts() + { + return SystemFonts.MessageFontSize / DefaultMessageFontSize; + } + + private static readonly ComponentTracer _trace = ComponentTracer.Get(nameof(TextScaleService)); + + private const int DefaultMessageFontSize = 12; + private const int DefaultScaleFactorRegValue = 100; + + private const RegistryHive ScaleFactorHive = RegistryHive.CurrentUser; + private const RegistryView ScaleFactorView = RegistryView.Default; + private const string ScaleFactorSubkey = "Software\\Microsoft\\Accessibility"; + private const string ScaleChangedPropertyName = "NonClientMetrics"; + + private readonly IWinRTUISettings _winRTuiSettings; + private readonly IRegistry _registry; + private readonly IRegistryTracker _registryTracker; + + private CancellationTokenSource? _cancellationTokenSource; + private Task? _trackingTask; + private bool _isEnabled; + private bool _isTracking; + } +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit/Animation/AnimationDurationHelper.cs b/src/framework/Kaspirin.UI.Framework.UiKit/Animation/AnimationDurationHelper.cs new file mode 100644 index 0000000..fdfd317 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit/Animation/AnimationDurationHelper.cs @@ -0,0 +1,46 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System; +using System.Windows; +using System.Windows.Media.Animation; + +namespace Kaspirin.UI.Framework.UiKit.Animation +{ + public static class AnimationHelper + { + public static Duration CoerceDuration(this Duration duration) + { + return ServiceLocator.Instance.GetService().IsAnimationEnabled + ? duration + : _instant; + } + + public static Duration CoerceDuration(this TimeSpan duration) + { + return ServiceLocator.Instance.GetService().IsAnimationEnabled + ? new Duration(duration) + : _instant; + } + + public static void SetFrameRate(this Storyboard storyboard, AnimationRenderQuality quality = AnimationRenderQuality.Auto) + { + var frameRate = ServiceLocator.Instance.GetService().GetDesiredFrameRate(quality); + + storyboard.SetValue(Timeline.DesiredFrameRateProperty, frameRate); + } + + private static Duration _instant = new(TimeSpan.FromMilliseconds(1)); + } +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit/Animation/AnimationFactory.cs b/src/framework/Kaspirin.UI.Framework.UiKit/Animation/AnimationFactory.cs new file mode 100644 index 0000000..e6d5f28 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit/Animation/AnimationFactory.cs @@ -0,0 +1,124 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System; +using System.Windows.Media.Animation; +using System.Windows.Media; +using System.Windows; + +namespace Kaspirin.UI.Framework.UiKit.Animation +{ + internal static class AnimationFactory + { + internal static AnimationTimeline CreateAnimation( + DependencyObject targetDependencyObject, + DependencyProperty targetDependencyProperty, + int? desiredFrameRate, + AnimationProperties properties, + object value) + { + Guard.ArgumentIsNotNull(targetDependencyObject); + Guard.ArgumentIsNotNull(targetDependencyProperty); + Guard.ArgumentIsNotNull(properties); + Guard.ArgumentIsNotNull(value); + + AnimationTimeline animation; + PropertyPath propertyPath; + + switch (value) + { + case int intValue: + animation = CreateIntAnimation(properties, intValue); + propertyPath = GetAnimationPropertyPath(targetDependencyProperty); + break; + + case double doubleValue: + animation = CreateDoubleAnimation(properties, doubleValue); + propertyPath = GetAnimationPropertyPath(targetDependencyProperty); + break; + + case SolidColorBrush solidColorBrushValue: + animation = CreateColorAnimation(properties, solidColorBrushValue.Clone().Color); + propertyPath = GetAnimationPropertyPath(targetDependencyProperty); + break; + + case Thickness thicknessValue: + animation = CreateThicknessAnimation(properties, thicknessValue); + propertyPath = GetAnimationPropertyPath(targetDependencyProperty); + break; + + default: + throw new NotImplementedException($"Unable to create animation to value '{value}' ({value.GetType().Name})"); + } + + animation.Duration = animation.Duration.CoerceDuration(); + + animation.SetValue(Storyboard.TargetProperty, targetDependencyObject); + animation.SetValue(Storyboard.TargetPropertyProperty, propertyPath); + animation.SetValue(Timeline.DesiredFrameRateProperty, desiredFrameRate); + + animation.Freeze(); + + return animation; + } + + private static Int32Animation CreateIntAnimation(AnimationProperties properties, int value) + => new() + { + BeginTime = properties.Delay, + Duration = properties.Duration, + EasingFunction = properties.Easing, + To = value + }; + + private static DoubleAnimation CreateDoubleAnimation(AnimationProperties properties, double value) + => new() + { + BeginTime = properties.Delay, + Duration = properties.Duration, + EasingFunction = properties.Easing, + To = value + }; + + private static ColorAnimation CreateColorAnimation(AnimationProperties properties, Color value) + => new() + { + BeginTime = properties.Delay, + Duration = properties.Duration, + EasingFunction = properties.Easing, + To = value + }; + + private static ThicknessAnimation CreateThicknessAnimation(AnimationProperties properties, Thickness value) + => new() + { + BeginTime = properties.Delay, + Duration = properties.Duration, + EasingFunction = properties.Easing, + To = value + }; + + private static PropertyPath GetAnimationPropertyPath(DependencyProperty dependencyProperty) + { + if (typeof(TValue) == typeof(SolidColorBrush)) + { + return new PropertyPath($"(0).(1)", dependencyProperty, SolidColorBrush.ColorProperty); + } + else + { + return new PropertyPath(dependencyProperty); + } + } + } +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit/Animation/AnimationProperties.cs b/src/framework/Kaspirin.UI.Framework.UiKit/Animation/AnimationProperties.cs new file mode 100644 index 0000000..8a09a7b --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit/Animation/AnimationProperties.cs @@ -0,0 +1,28 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System; +using System.Windows.Media.Animation; + +namespace Kaspirin.UI.Framework.UiKit.Animation +{ + public sealed class AnimationProperties + { + public TimeSpan Duration { get; set; } + + public TimeSpan Delay { get; set; } + + public IEasingFunction? Easing { get; set; } + } +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit/Animation/AnimationRenderQuality.cs b/src/framework/Kaspirin.UI.Framework.UiKit/Animation/AnimationRenderQuality.cs new file mode 100644 index 0000000..f247e2b --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit/Animation/AnimationRenderQuality.cs @@ -0,0 +1,23 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +namespace Kaspirin.UI.Framework.UiKit.Animation +{ + public enum AnimationRenderQuality + { + Auto, + High, + Low + } +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit/Animation/AnimationSettingsProvider.cs b/src/framework/Kaspirin.UI.Framework.UiKit/Animation/AnimationSettingsProvider.cs new file mode 100644 index 0000000..00046ce --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit/Animation/AnimationSettingsProvider.cs @@ -0,0 +1,182 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System; +using System.Windows.Media; +using System.Windows.Media.Animation; +using Microsoft.Win32; + +namespace Kaspirin.UI.Framework.UiKit.Animation +{ + public sealed class AnimationSettingsProvider : IAnimationSettingsProvider + { + public AnimationSettingsProvider( + IWinRTUISettings winRTUISettings, + ISystemEvents systemEvents) + { + _winRTUISettings = winRTUISettings; + _systemEvents = systemEvents; + + Initialize(); + } + + public event EventHandler AnimationEnabledChanged = (_, _) => { }; + + public event EventHandler Initialized = (_, _) => { }; + + public bool IsAnimationEnabled + { + get => _isAnimationEnabled; + private set + { + if (_isAnimationEnabled == value) + { + return; + } + + _trace.TraceInformation($"Animation state changed from {_isAnimationEnabled} to {value}"); + + _isAnimationEnabled = value; + + AnimationEnabledChanged.Invoke(this, EventArgs.Empty); + } + } + + public bool IsInitialized { get; private set; } + + public AnimationProperties DefaultAnimationProperties => new() + { + Duration = TimeSpan.FromMilliseconds(150), + Delay = TimeSpan.Zero, + Easing = new QuadraticEase() + }; + + public int? GetDesiredFrameRate(AnimationRenderQuality quality = AnimationRenderQuality.Auto) + { + return quality switch + { + AnimationRenderQuality.High => HighFps, + AnimationRenderQuality.Low => LowFps, + _ => null + }; + } + + /// + /// True if DirectX version is greater than or equal to 9.0. + /// + private bool IsHighRenderCapability => GetRenderCapability() >= 0x00020000; + + private void Initialize() + => Executers.InUiAsync(() => + { + _trace.TraceInformation($"Initialization started"); + + SubscribeOnRenderCapabilityChanges(); + SubscribeOnUserPreferenceChanges(); + + UpdateAnimationState(); + + IsInitialized = true; + Initialized.Invoke(this, EventArgs.Empty); + + _trace.TraceInformation($"Initialization finished"); + }); + + private void UpdateAnimationState() + { + if (!IsHighRenderCapability) + { + _trace.TraceInformation($"Animation disabled because of low render capability"); + IsAnimationEnabled = false; + } + else if (_winRTUISettings.IsAvailable) + { + IsAnimationEnabled = GetAnimationEnabledFromWinRT(); + } + else + { + IsAnimationEnabled = GetAnimationEnabledFromSpi(); + } + } + + private bool GetAnimationEnabledFromWinRT() + { + var result = _winRTUISettings.AnimationsEnabled; + + _trace.TraceInformation($"WinRT.AnimationsEnabled = {result}"); + + return result; + } + + private bool GetAnimationEnabledFromSpi() + { + var winApiResult = User32Dll.SystemParametersInfo(SpiType.SPI_GETCLIENTAREAANIMATION, 0, out var uiEffectsEnabled, SpiFlags.None); + + _trace.TraceInformation($"SPI_GETCLIENTAREAANIMATION = {uiEffectsEnabled}, SystemParametersInfo = {winApiResult}"); + + return winApiResult && uiEffectsEnabled; + } + + private void SubscribeOnRenderCapabilityChanges() + { + // Subscribe in UI thread because RenderCapability.Tier property is using Dispatcher object of current thread. + Guard.AssertIsUiThread(); + RenderCapability.TierChanged += OnRenderCapabilityTierChanged; + } + + private void SubscribeOnUserPreferenceChanges() + { + _systemEvents.UserPreferenceChanged += OnUserPreferenceChanged; + } + + private void OnUserPreferenceChanged(object sender, UserPreferenceChangedEventArgs e) + { + _trace.TraceInformation($"UserPreference changed in category {e.Category}"); + + if (e.Category.In(UserPreferenceCategory.General, UserPreferenceCategory.Window)) + { + Executers.InUiAsync(UpdateAnimationState); + } + } + + private void OnRenderCapabilityTierChanged(object? sender, EventArgs e) + { + _trace.TraceInformation($"RenderCapability.Tier changed"); + + Executers.InUiAsync(UpdateAnimationState); + } + + private static int GetRenderCapability() + { + // Getting value in UI thread because RenderCapability.Tier property is using Dispatcher object of current thread. + Guard.AssertIsUiThread(); + + var renderCapability = RenderCapability.Tier; + + _trace.TraceInformation($"RenderCapability.Tier = 0x{renderCapability:x}"); + + return renderCapability; + } + + private bool _isAnimationEnabled; + + private readonly IWinRTUISettings _winRTUISettings; + private readonly ISystemEvents _systemEvents; + + private const int HighFps = 200; + private const int LowFps = 20; + + private static readonly ComponentTracer _trace = ComponentTracer.Get(nameof(AnimationSettingsProvider)); + } +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit/Animation/IAnimationSettingsProvider.cs b/src/framework/Kaspirin.UI.Framework.UiKit/Animation/IAnimationSettingsProvider.cs new file mode 100644 index 0000000..c87bf85 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit/Animation/IAnimationSettingsProvider.cs @@ -0,0 +1,33 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System; + +namespace Kaspirin.UI.Framework.UiKit.Animation +{ + public interface IAnimationSettingsProvider + { + event EventHandler AnimationEnabledChanged; + + event EventHandler Initialized; + + bool IsAnimationEnabled { get; } + + bool IsInitialized { get; } + + AnimationProperties DefaultAnimationProperties { get; } + + int? GetDesiredFrameRate(AnimationRenderQuality quality = AnimationRenderQuality.Auto); + } +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit/Animation/Internals/AnimatedBindingFactory.cs b/src/framework/Kaspirin.UI.Framework.UiKit/Animation/Internals/AnimatedBindingFactory.cs new file mode 100644 index 0000000..0b42470 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit/Animation/Internals/AnimatedBindingFactory.cs @@ -0,0 +1,214 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Windows; +using System.Windows.Data; +using System.Windows.Media.Animation; + +namespace Kaspirin.UI.Framework.UiKit.Animation.Internals +{ + internal sealed class AnimatedBindingFactory + { + public AnimatedBindingFactory(IAnimationSettingsProvider animationSettingsProvider) + { + _animationSettingsProvider = animationSettingsProvider; + } + + public BindingBase CreateBinding( + BindingBase source, + DependencyObject targetObject, + DependencyProperty targetProperty, + AnimationProperties? properties = null, + Action? onCompletedCallback = null) + { + Guard.ArgumentIsNotNull(source); + Guard.ArgumentIsNotNull(targetObject); + Guard.ArgumentIsNotNull(targetProperty); + + return source switch + { + MultiBinding multiBinding => CreateMultiBinding(targetObject, targetProperty, multiBinding, properties, onCompletedCallback), + Binding singleBinding => CreateSingleBinding(targetObject, targetProperty, singleBinding, properties, onCompletedCallback), + _ => throw new InvalidOperationException($"{source.GetType().Name} is not supported"), + }; + } + + private MultiBinding CreateMultiBinding( + DependencyObject targetObject, + DependencyProperty targetProperty, + MultiBinding multiBindingSource, + AnimationProperties? properties, + Action? onCompletedCallback) + { + var binding = new MultiBinding(); + + multiBindingSource.Bindings.OfType().ForEach(b => binding.Bindings.Add(b.Clone())); + + binding.Converter = new CompositeMultiConverter( + multiBindingSource.Converter, + new DelegateConverter(value => Convert(targetObject, targetProperty, value, properties, onCompletedCallback))); + + return binding; + } + + private Binding CreateSingleBinding( + DependencyObject targetObject, + DependencyProperty targetProperty, + Binding singleBindingSource, + AnimationProperties? properties, + Action? onCompletedCallback) + { + var binding = singleBindingSource.Clone(); + + binding.Converter = new CompositeConverter( + singleBindingSource.Converter, + new DelegateConverter(value => Convert(targetObject, targetProperty, value, properties, onCompletedCallback))); + + return binding; + } + + private object? Convert( + DependencyObject targetObject, + DependencyProperty targetProperty, + object? newValue, + AnimationProperties? properties, + Action? onCompletedCallback) + { + var bindingProperties = GetBindingProperties(targetObject, targetProperty); + + try + { + var isFirstTime = !bindingProperties.IsInitialized; + + var isInstant = properties?.Duration == TimeSpan.Zero && + properties?.Delay == TimeSpan.Zero; + + var isUnset = properties == null || + newValue == null || + newValue == DependencyProperty.UnsetValue; + + var skipAnimation = isFirstTime || isInstant || isUnset; + + if (skipAnimation) + { + if (onCompletedCallback != null) + { + Executers.InUiAsync(onCompletedCallback.Invoke); + } + + return newValue is Animatable animatableNewValue && animatableNewValue.IsFrozen + ? animatableNewValue.Clone() + : newValue; + } + + var currentValue = targetObject.GetValue(targetProperty); + + if (AnimatedValueEqualityComparer.Equals(newValue, bindingProperties.AnimatingValue)) + { + return currentValue; + } + + if (!AnimatedValueEqualityComparer.Equals(newValue, currentValue)) + { + targetObject.WhenInitialized(() => StartAnimation(targetObject, targetProperty, newValue!, properties, onCompletedCallback)); + } + + return currentValue; + } + finally + { + if (!bindingProperties.IsInitialized) + { + bindingProperties.IsInitialized = true; + } + } + } + + private void StartAnimation( + DependencyObject targetObject, + DependencyProperty targetProperty, + object value, + AnimationProperties? properties, + Action? onCompletedCallback) + { + var animationProperties = properties ?? _animationSettingsProvider.DefaultAnimationProperties; + var animationFrameRate = _animationSettingsProvider.GetDesiredFrameRate(); + + var bindingProperties = GetBindingProperties(targetObject, targetProperty); + bindingProperties.AnimatingValue = value; + + var animation = AnimationFactory.CreateAnimation( + targetObject, + targetProperty, + animationFrameRate, + animationProperties, + value); + + var storyboard = new Storyboard(); + + if (onCompletedCallback != null) + { + storyboard.Completed += (o, e) => onCompletedCallback.Invoke(); + } + + storyboard.Children.Add(animation); + storyboard.Begin(); + } + + #region AnimatedBindingProperties + + private static AnimatedBindingProperties GetBindingProperties(DependencyObject dependencyObject, DependencyProperty dependencyProperty) + { + var propertiesDictionary = GetAnimatedBindingProperties(dependencyObject); + if (propertiesDictionary is null) + { + propertiesDictionary = new Dictionary(); + SetAnimatedBindingProperties(dependencyObject, propertiesDictionary); + } + + if (!propertiesDictionary.TryGetValue(dependencyProperty, out var properties)) + { + propertiesDictionary.Add(dependencyProperty, properties = new AnimatedBindingProperties()); + } + + return properties; + } + + private static IDictionary? GetAnimatedBindingProperties(DependencyObject obj) + => (IDictionary?)obj.GetValue(_animatedBindingPropertiesProperty); + + private static void SetAnimatedBindingProperties(DependencyObject obj, IDictionary value) + => obj.SetValue(_animatedBindingPropertiesProperty, value); + + private static readonly DependencyProperty _animatedBindingPropertiesProperty = + DependencyProperty.RegisterAttached( + "AnimatedBindingProperties", + typeof(IDictionary), + typeof(AnimatedBindingExtension)); + + private sealed record AnimatedBindingProperties + { + public bool IsInitialized { get; set; } + + public object? AnimatingValue { get; set; } + } + + #endregion + + private readonly IAnimationSettingsProvider _animationSettingsProvider; + } +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit/Animation/Internals/AnimatedValueEqualityComparer.cs b/src/framework/Kaspirin.UI.Framework.UiKit/Animation/Internals/AnimatedValueEqualityComparer.cs new file mode 100644 index 0000000..85dd182 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit/Animation/Internals/AnimatedValueEqualityComparer.cs @@ -0,0 +1,50 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System; +using System.Windows.Media; +using System.Windows; + +namespace Kaspirin.UI.Framework.UiKit.Animation.Internals +{ + internal static class AnimatedValueEqualityComparer + { + public static new bool Equals(object? x, object? y) + { + if (x is null && y is null) + { + return true; + } + + if (x is null || y is null) + { + return false; + } + + switch (x) + { + case int when y is int: + case double when y is double: + case Thickness when y is Thickness: + return x == y; + + case SolidColorBrush xSolidBrush when y is SolidColorBrush ySolidBrush: + return xSolidBrush.Color == ySolidBrush.Color; + + default: + throw new NotImplementedException($"Unable to compare animated values '{x}' ({x.GetType().Name}) and '{y}' ({x.GetType().Name})"); + } + } + } +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit/Animation/Markup/AnimatedBindingExtension.cs b/src/framework/Kaspirin.UI.Framework.UiKit/Animation/Markup/AnimatedBindingExtension.cs new file mode 100644 index 0000000..0f4d378 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit/Animation/Markup/AnimatedBindingExtension.cs @@ -0,0 +1,47 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System; +using System.Windows; +using System.Windows.Data; +using Kaspirin.UI.Framework.UiKit.Animation.Internals; +using Kaspirin.UI.Framework.UiKit.MarkupExtensions; + +namespace Kaspirin.UI.Framework.UiKit.Animation.Markup +{ + public sealed class AnimatedBindingExtension : ExtendedMarkupExtension + { + public AnimatedBindingExtension() + { + _animationSettingsProvider = ServiceLocator.Instance.GetService(); + _animatedBindingFactory = ServiceLocator.Instance.GetService(); + + Properties = _animationSettingsProvider.DefaultAnimationProperties; + } + + public BindingBase? Source { get; set; } + + public AnimationProperties Properties { get; set; } + + protected override object? ProvideForControl(IServiceProvider serviceProvider, DependencyObject targetObject, DependencyProperty targetProperty) + { + Guard.IsNotNull(Source); + + return _animatedBindingFactory.CreateBinding(Source, targetObject, targetProperty, Properties)?.ProvideValue(serviceProvider); + } + + private readonly IAnimationSettingsProvider _animationSettingsProvider; + private readonly AnimatedBindingFactory _animatedBindingFactory; + } +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit/Animation/Markup/AnimationFrameRateExtension.cs b/src/framework/Kaspirin.UI.Framework.UiKit/Animation/Markup/AnimationFrameRateExtension.cs new file mode 100644 index 0000000..945fd96 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit/Animation/Markup/AnimationFrameRateExtension.cs @@ -0,0 +1,27 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System; +using System.Windows.Markup; + +namespace Kaspirin.UI.Framework.UiKit.Animation.Markup +{ + public sealed class AnimationFrameRateExtension : MarkupExtension + { + public AnimationRenderQuality RenderQuality { get; set; } = AnimationRenderQuality.Auto; + + public override object? ProvideValue(IServiceProvider serviceProvider) + => ServiceLocator.Instance.GetService().GetDesiredFrameRate(RenderQuality); + } +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit/Animation/Markup/AnimationPropertiesExtension.cs b/src/framework/Kaspirin.UI.Framework.UiKit/Animation/Markup/AnimationPropertiesExtension.cs new file mode 100644 index 0000000..f278e99 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit/Animation/Markup/AnimationPropertiesExtension.cs @@ -0,0 +1,39 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System; +using System.Windows.Markup; +using System.Windows.Media.Animation; + +namespace Kaspirin.UI.Framework.UiKit.Animation.Markup +{ + public sealed class AnimationPropertiesExtension : MarkupExtension + { + public TimeSpan Duration { get; set; } + + public TimeSpan Delay { get; set; } + + public IEasingFunction? Easing { get; set; } + + public override object ProvideValue(IServiceProvider serviceProvider) + { + return new AnimationProperties() + { + Duration = Duration, + Delay = Delay, + Easing = Easing + }; + } + } +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit/Animation/Markup/Easing/BackEasingExtension.cs b/src/framework/Kaspirin.UI.Framework.UiKit/Animation/Markup/Easing/BackEasingExtension.cs new file mode 100644 index 0000000..4739790 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit/Animation/Markup/Easing/BackEasingExtension.cs @@ -0,0 +1,30 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System.Windows.Media.Animation; + +namespace Kaspirin.UI.Framework.UiKit.Animation.Markup.Easing +{ + public sealed class BackEasingExtension : EasingExtensionBase + { + public double Amplitude { get; set; } + + protected override IEasingFunction CreateEasing() + => new BackEase + { + Amplitude = Amplitude, + EasingMode = Mode + }; + } +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit/Animation/Markup/Easing/BounceEasingExtension.cs b/src/framework/Kaspirin.UI.Framework.UiKit/Animation/Markup/Easing/BounceEasingExtension.cs new file mode 100644 index 0000000..15b0522 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit/Animation/Markup/Easing/BounceEasingExtension.cs @@ -0,0 +1,33 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System.Windows.Media.Animation; + +namespace Kaspirin.UI.Framework.UiKit.Animation.Markup.Easing +{ + public sealed class BounceEasingExtension : EasingExtensionBase + { + public int Bounces { get; set; } + + public double Bounciness { get; set; } + + protected override IEasingFunction CreateEasing() + => new BounceEase + { + Bounces = Bounces, + Bounciness = Bounciness, + EasingMode = Mode + }; + } +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit/Animation/Markup/Easing/CircleEasingExtension.cs b/src/framework/Kaspirin.UI.Framework.UiKit/Animation/Markup/Easing/CircleEasingExtension.cs new file mode 100644 index 0000000..269b6f8 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit/Animation/Markup/Easing/CircleEasingExtension.cs @@ -0,0 +1,24 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System.Windows.Media.Animation; + +namespace Kaspirin.UI.Framework.UiKit.Animation.Markup.Easing +{ + public sealed class CircleEasingExtension : EasingExtensionBase + { + protected override IEasingFunction CreateEasing() + => new CircleEase { EasingMode = Mode }; + } +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit/Animation/Markup/Easing/CubicEasingExtension.cs b/src/framework/Kaspirin.UI.Framework.UiKit/Animation/Markup/Easing/CubicEasingExtension.cs new file mode 100644 index 0000000..50d533a --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit/Animation/Markup/Easing/CubicEasingExtension.cs @@ -0,0 +1,24 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System.Windows.Media.Animation; + +namespace Kaspirin.UI.Framework.UiKit.Animation.Markup.Easing +{ + public sealed class CubicEasingExtension : EasingExtensionBase + { + protected override IEasingFunction CreateEasing() + => new CubicEase { EasingMode = Mode }; + } +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit/Animation/Markup/Easing/EasingExtensionBase.cs b/src/framework/Kaspirin.UI.Framework.UiKit/Animation/Markup/Easing/EasingExtensionBase.cs new file mode 100644 index 0000000..f7ca8f4 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit/Animation/Markup/Easing/EasingExtensionBase.cs @@ -0,0 +1,31 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System; +using System.Windows.Markup; +using System.Windows.Media.Animation; + +namespace Kaspirin.UI.Framework.UiKit.Animation.Markup.Easing +{ + [MarkupExtensionReturnType(typeof(IEasingFunction))] + public abstract class EasingExtensionBase : MarkupExtension + { + public EasingMode Mode { get; set; } + + public sealed override object? ProvideValue(IServiceProvider? serviceProvider) + => CreateEasing(); + + protected abstract IEasingFunction CreateEasing(); + } +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit/Animation/Markup/Easing/ElasticEasingExtension.cs b/src/framework/Kaspirin.UI.Framework.UiKit/Animation/Markup/Easing/ElasticEasingExtension.cs new file mode 100644 index 0000000..edfe09e --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit/Animation/Markup/Easing/ElasticEasingExtension.cs @@ -0,0 +1,33 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System.Windows.Media.Animation; + +namespace Kaspirin.UI.Framework.UiKit.Animation.Markup.Easing +{ + public sealed class ElasticEasingExtension : EasingExtensionBase + { + public int Oscillations { get; set; } + + public double Springiness { get; set; } + + protected override IEasingFunction CreateEasing() + => new ElasticEase + { + Oscillations = Oscillations, + Springiness = Springiness, + EasingMode = Mode + }; + } +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit/Animation/Markup/Easing/ExponentialEasingExtension.cs b/src/framework/Kaspirin.UI.Framework.UiKit/Animation/Markup/Easing/ExponentialEasingExtension.cs new file mode 100644 index 0000000..1b3fe56 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit/Animation/Markup/Easing/ExponentialEasingExtension.cs @@ -0,0 +1,30 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System.Windows.Media.Animation; + +namespace Kaspirin.UI.Framework.UiKit.Animation.Markup.Easing +{ + public sealed class ExponentialEasingExtension : EasingExtensionBase + { + public double Exponent { get; set; } + + protected override IEasingFunction CreateEasing() + => new ExponentialEase + { + Exponent = Exponent, + EasingMode = Mode + }; + } +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit/Animation/Markup/Easing/PowerEasingExtension.cs b/src/framework/Kaspirin.UI.Framework.UiKit/Animation/Markup/Easing/PowerEasingExtension.cs new file mode 100644 index 0000000..bccc444 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit/Animation/Markup/Easing/PowerEasingExtension.cs @@ -0,0 +1,30 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System.Windows.Media.Animation; + +namespace Kaspirin.UI.Framework.UiKit.Animation.Markup.Easing +{ + public sealed class PowerEasingExtension : EasingExtensionBase + { + public double Power { get; set; } + + protected override IEasingFunction CreateEasing() + => new PowerEase + { + Power = Power, + EasingMode = Mode + }; + } +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit/Animation/Markup/Easing/QuadraticEasingExtension.cs b/src/framework/Kaspirin.UI.Framework.UiKit/Animation/Markup/Easing/QuadraticEasingExtension.cs new file mode 100644 index 0000000..209a9e4 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit/Animation/Markup/Easing/QuadraticEasingExtension.cs @@ -0,0 +1,24 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System.Windows.Media.Animation; + +namespace Kaspirin.UI.Framework.UiKit.Animation.Markup.Easing +{ + public sealed class QuadraticEasingExtension : EasingExtensionBase + { + protected override IEasingFunction CreateEasing() + => new QuadraticEase { EasingMode = Mode }; + } +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit/Animation/Markup/Easing/QuarticEasingExtension.cs b/src/framework/Kaspirin.UI.Framework.UiKit/Animation/Markup/Easing/QuarticEasingExtension.cs new file mode 100644 index 0000000..4a25c7c --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit/Animation/Markup/Easing/QuarticEasingExtension.cs @@ -0,0 +1,24 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System.Windows.Media.Animation; + +namespace Kaspirin.UI.Framework.UiKit.Animation.Markup.Easing +{ + public sealed class QuarticEasingExtension : EasingExtensionBase + { + protected override IEasingFunction CreateEasing() + => new QuarticEase { EasingMode = Mode }; + } +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit/Animation/Markup/Easing/QuinticEasingExtension.cs b/src/framework/Kaspirin.UI.Framework.UiKit/Animation/Markup/Easing/QuinticEasingExtension.cs new file mode 100644 index 0000000..ff817a8 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit/Animation/Markup/Easing/QuinticEasingExtension.cs @@ -0,0 +1,24 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System.Windows.Media.Animation; + +namespace Kaspirin.UI.Framework.UiKit.Animation.Markup.Easing +{ + public sealed class QuinticEasingExtension : EasingExtensionBase + { + protected override IEasingFunction CreateEasing() + => new QuinticEase { EasingMode = Mode }; + } +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit/Animation/Markup/Easing/SineEasingExtension.cs b/src/framework/Kaspirin.UI.Framework.UiKit/Animation/Markup/Easing/SineEasingExtension.cs new file mode 100644 index 0000000..2d3674d --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit/Animation/Markup/Easing/SineEasingExtension.cs @@ -0,0 +1,24 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System.Windows.Media.Animation; + +namespace Kaspirin.UI.Framework.UiKit.Animation.Markup.Easing +{ + public sealed class SineEasingExtension : EasingExtensionBase + { + protected override IEasingFunction CreateEasing() + => new SineEase { EasingMode = Mode }; + } +} diff --git a/src/framework/Kaspirin.UI.Framework.UiKit/Controls/Automation/SelectAutomationPeer.cs b/src/framework/Kaspirin.UI.Framework.UiKit/Controls/Automation/SelectAutomationPeer.cs new file mode 100644 index 0000000..54414e0 --- /dev/null +++ b/src/framework/Kaspirin.UI.Framework.UiKit/Controls/Automation/SelectAutomationPeer.cs @@ -0,0 +1,91 @@ +// Copyright © 2024 AO Kaspersky Lab. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System.Windows.Automation; +using System.Windows.Automation.Peers; +using System.Windows.Automation.Provider; + +namespace Kaspirin.UI.Framework.UiKit.Controls.Automation +{ + public class SelectAutomationPeer : SelectorAutomationPeer, IExpandCollapseProvider + { + public SelectAutomationPeer(Select owner) : base(owner) + { } + + protected override ItemAutomationPeer CreateItemAutomationPeer(object item) + { + return new ListBoxItemAutomationPeer(item, this); + } + + protected override AutomationControlType GetAutomationControlTypeCore() + { + return AutomationControlType.ComboBox; + } + + protected override string GetClassNameCore() + { + return nameof(Select); + } + + public override object GetPattern(PatternInterface pattern) + { + object? iface; + + if (pattern == PatternInterface.ExpandCollapse) + { + iface = this; + } + else + { + iface = base.GetPattern(pattern); + } + + return iface; + } + + #region ExpandCollapse + + void IExpandCollapseProvider.Expand() + { + if (!IsEnabled()) + { + throw new ElementNotEnabledException(); + } + + Guard.EnsureIsInstanceOfType(Owner).SetCurrentValue(Select.IsDropDownOpenProperty, false); + } + + ExpandCollapseState IExpandCollapseProvider.ExpandCollapseState + { + get + { + return Guard.EnsureIsInstanceOfType
\n\n=http%3A%2F%2F
\n.setAttribute(Administration= new Array();\r\ndisplay:block;Unfortunately,\"> 
/favicon.ico\">='stylesheet' identification, for example,
  • \ntype=\"submit\" \n(function() {recommendationform action=\"/transformationreconstruction.style.display According to hidden\" name=\"along with thedocument.body.approximately Communicationspost\" action=\"meaning "--Prime Ministercharacteristic \n\ndepends on theUniversity of in contrast to placeholder=\"in the case ofinternational constitutionalstyle=\"border-: function() {Because of the-strict.dtd\">\ncombination of marginwidth=\"createElement(w.attachEvent(src=\"https://aIn particular, align=\"left\" Czech RepublicUnited Kingdomcorrespondenceconcluded that.html\" title=\"(function () {comes from theapplication of\n\nfounder of theattempting to carbon dioxide\n\n
    \nopportunity tocommunications\r\n
    \n\nDepartment of ecclesiasticalthere has beenresulting fromhas never beenthe first timein response toautomatically \n\n
    collection of descended fromsection of theaccept-charsetto be confusedmember of the padding-right:translation ofinterpretation href='http://whether or notThere are alsothere are manya small numberother parts ofimpossible to class=\"buttonlocated in the. However, theand eventuallyAt the end of because of itsrepresents themany countriesfor many yearsearliest knownbecause it waspt\">\r valign=\"top\" inhabitants offollowing year\r\n
    \n\r\n\n\n\r\n\nstyle=\"margin-instead of theintroduced thethe process ofincreasing thedifferences inestimated thatespecially the/div>
    \r\n\r\nenvironmental to prevent thehave been usedespecially forunderstand theis essentiallywere the firstis the largesthave been made\" src=\"http://interpreted assecond half ofcrolling=\"no\" is composed ofII, Holy Romanis expected tohave their owndefined as thetraditionally have differentare often usedto ensure thatagreement withcontaining theare frequentlyinformation onexample is theresulting in a class=\"footerand especiallytype=\"button\" which included>\nafter the deathwith respect tostyle=\"padding:is particularlydisplay:inline; type=\"submit\" is divided into\u00E4\u00B8\u00AD\u00E6\u0096\u0087 (\u00E7\u00AE\u0080\u00E4\u00BD\u0093)responsabilidadadministraci\u00C3\u00B3ninternacionalescorrespondiente\u00E0\u00A4\u0089\u00E0\u00A4\u00AA\u00E0\u00A4\u00AF\u00E0\u00A5\u008B\u00E0\u00A4\u0097\u00E0\u00A4\u00AA\u00E0\u00A5\u0082\u00E0\u00A4\u00B0\u00E0\u00A5\u008D\u00E0\u00A4\u00B5\u00E0\u00A4\u00B9\u00E0\u00A4\u00AE\u00E0\u00A4\u00BE\u00E0\u00A4\u00B0\u00E0\u00A5\u0087\u00E0\u00A4\u00B2\u00E0\u00A5\u008B\u00E0\u00A4\u0097\u00E0\u00A5\u008B\u00E0\u00A4\u0082\u00E0\u00A4\u009A\u00E0\u00A5\u0081\u00E0\u00A4\u00A8\u00E0\u00A4\u00BE\u00E0\u00A4\u00B5\u00E0\u00A4\u00B2\u00E0\u00A5\u0087\u00E0\u00A4\u0095\u00E0\u00A4\u00BF\u00E0\u00A4\u00A8\u00E0\u00A4\u00B8\u00E0\u00A4\u00B0\u00E0\u00A4\u0095\u00E0\u00A4\u00BE\u00E0\u00A4\u00B0\u00E0\u00A4\u00AA\u00E0\u00A5\u0081\u00E0\u00A4\u00B2\u00E0\u00A4\u00BF\u00E0\u00A4\u00B8\u00E0\u00A4\u0096\u00E0\u00A5\u008B\u00E0\u00A4\u009C\u00E0\u00A5\u0087\u00E0\u00A4\u0082\u00E0\u00A4\u009A\u00E0\u00A4\u00BE\u00E0\u00A4\u00B9\u00E0\u00A4\u00BF\u00E0\u00A4\u008F\u00E0\u00A4\u00AD\u00E0\u00A5\u0087\u00E0\u00A4\u009C\u00E0\u00A5\u0087\u00E0\u00A4\u0082\u00E0\u00A4\u00B6\u00E0\u00A4\u00BE\u00E0\u00A4\u00AE\u00E0\u00A4\u00BF\u00E0\u00A4\u00B2\u00E0\u00A4\u00B9\u00E0\u00A4\u00AE\u00E0\u00A4\u00BE\u00E0\u00A4\u00B0\u00E0\u00A5\u0080\u00E0\u00A4\u009C\u00E0\u00A4\u00BE\u00E0\u00A4\u0097\u00E0\u00A4\u00B0\u00E0\u00A4\u00A3\u00E0\u00A4\u00AC\u00E0\u00A4\u00A8\u00E0\u00A4\u00BE\u00E0\u00A4\u00A8\u00E0\u00A5\u0087\u00E0\u00A4\u0095\u00E0\u00A5\u0081\u00E0\u00A4\u00AE\u00E0\u00A4\u00BE\u00E0\u00A4\u00B0\u00E0\u00A4\u00AC\u00E0\u00A5\u008D\u00E0\u00A4\u00B2\u00E0\u00A5\u0089\u00E0\u00A4\u0097\u00E0\u00A4\u00AE\u00E0\u00A4\u00BE\u00E0\u00A4\u00B2\u00E0\u00A4\u00BF\u00E0\u00A4\u0095\u00E0\u00A4\u00AE\u00E0\u00A4\u00B9\u00E0\u00A4\u00BF\u00E0\u00A4\u00B2\u00E0\u00A4\u00BE\u00E0\u00A4\u00AA\u00E0\u00A5\u0083\u00E0\u00A4\u00B7\u00E0\u00A5\u008D\u00E0\u00A4\u00A0\u00E0\u00A4\u00AC\u00E0\u00A4\u00A2\u00E0\u00A4\u00BC\u00E0\u00A4\u00A4\u00E0\u00A5\u0087\u00E0\u00A4\u00AD\u00E0\u00A4\u00BE\u00E0\u00A4\u009C\u00E0\u00A4\u00AA\u00E0\u00A4\u00BE\u00E0\u00A4\u0095\u00E0\u00A5\u008D\u00E0\u00A4\u00B2\u00E0\u00A4\u00BF\u00E0\u00A4\u0095\u00E0\u00A4\u009F\u00E0\u00A5\u008D\u00E0\u00A4\u00B0\u00E0\u00A5\u0087\u00E0\u00A4\u00A8\u00E0\u00A4\u0096\u00E0\u00A4\u00BF\u00E0\u00A4\u00B2\u00E0\u00A4\u00BE\u00E0\u00A4\u00AB\u00E0\u00A4\u00A6\u00E0\u00A5\u008C\u00E0\u00A4\u00B0\u00E0\u00A4\u00BE\u00E0\u00A4\u00A8\u00E0\u00A4\u00AE\u00E0\u00A4\u00BE\u00E0\u00A4\u00AE\u00E0\u00A4\u00B2\u00E0\u00A5\u0087\u00E0\u00A4\u00AE\u00E0\u00A4\u00A4\u00E0\u00A4\u00A6\u00E0\u00A4\u00BE\u00E0\u00A4\u00A8\u00E0\u00A4\u00AC\u00E0\u00A4\u00BE\u00E0\u00A4\u009C\u00E0\u00A4\u00BE\u00E0\u00A4\u00B0\u00E0\u00A4\u00B5\u00E0\u00A4\u00BF\u00E0\u00A4\u0095\u00E0\u00A4\u00BE\u00E0\u00A4\u00B8\u00E0\u00A4\u0095\u00E0\u00A5\u008D\u00E0\u00A4\u00AF\u00E0\u00A5\u008B\u00E0\u00A4\u0082\u00E0\u00A4\u009A\u00E0\u00A4\u00BE\u00E0\u00A4\u00B9\u00E0\u00A4\u00A4\u00E0\u00A5\u0087\u00E0\u00A4\u00AA\u00E0\u00A4\u00B9\u00E0\u00A5\u0081\u00E0\u00A4\u0081\u00E0\u00A4\u009A\u00E0\u00A4\u00AC\u00E0\u00A4\u00A4\u00E0\u00A4\u00BE\u00E0\u00A4\u00AF\u00E0\u00A4\u00BE\u00E0\u00A4\u00B8\u00E0\u00A4\u0082\u00E0\u00A4\u00B5\u00E0\u00A4\u00BE\u00E0\u00A4\u00A6\u00E0\u00A4\u00A6\u00E0\u00A5\u0087\u00E0\u00A4\u0096\u00E0\u00A4\u00A8\u00E0\u00A5\u0087\u00E0\u00A4\u00AA\u00E0\u00A4\u00BF\u00E0\u00A4\u009B\u00E0\u00A4\u00B2\u00E0\u00A5\u0087\u00E0\u00A4\u00B5\u00E0\u00A4\u00BF\u00E0\u00A4\u00B6\u00E0\u00A5\u0087\u00E0\u00A4\u00B7\u00E0\u00A4\u00B0\u00E0\u00A4\u00BE\u00E0\u00A4\u009C\u00E0\u00A5\u008D\u00E0\u00A4\u00AF\u00E0\u00A4\u0089\u00E0\u00A4\u00A4\u00E0\u00A5\u008D\u00E0\u00A4\u00A4\u00E0\u00A4\u00B0\u00E0\u00A4\u00AE\u00E0\u00A5\u0081\u00E0\u00A4\u0082\u00E0\u00A4\u00AC\u00E0\u00A4\u0088\u00E0\u00A4\u00A6\u00E0\u00A5\u008B\u00E0\u00A4\u00A8\u00E0\u00A5\u008B\u00E0\u00A4\u0082\u00E0\u00A4\u0089\u00E0\u00A4\u00AA\u00E0\u00A4\u0095\u00E0\u00A4\u00B0\u00E0\u00A4\u00A3\u00E0\u00A4\u00AA\u00E0\u00A4\u00A2\u00E0\u00A4\u00BC\u00E0\u00A5\u0087\u00E0\u00A4\u0082\u00E0\u00A4\u00B8\u00E0\u00A5\u008D\u00E0\u00A4\u00A5\u00E0\u00A4\u00BF\u00E0\u00A4\u00A4\u00E0\u00A4\u00AB\u00E0\u00A4\u00BF\u00E0\u00A4\u00B2\u00E0\u00A5\u008D\u00E0\u00A4\u00AE\u00E0\u00A4\u00AE\u00E0\u00A5\u0081\u00E0\u00A4\u0096\u00E0\u00A5\u008D\u00E0\u00A4\u00AF\u00E0\u00A4\u0085\u00E0\u00A4\u009A\u00E0\u00A5\u008D\u00E0\u00A4\u009B\u00E0\u00A4\u00BE\u00E0\u00A4\u009B\u00E0\u00A5\u0082\u00E0\u00A4\u009F\u00E0\u00A4\u00A4\u00E0\u00A5\u0080\u00E0\u00A4\u00B8\u00E0\u00A4\u0082\u00E0\u00A4\u0097\u00E0\u00A5\u0080\u00E0\u00A4\u00A4\u00E0\u00A4\u009C\u00E0\u00A4\u00BE\u00E0\u00A4\u008F\u00E0\u00A4\u0097\u00E0\u00A4\u00BE\u00E0\u00A4\u00B5\u00E0\u00A4\u00BF\u00E0\u00A4\u00AD\u00E0\u00A4\u00BE\u00E0\u00A4\u0097\u00E0\u00A4\u0098\u00E0\u00A4\u00A3\u00E0\u00A5\u008D\u00E0\u00A4\u009F\u00E0\u00A5\u0087\u00E0\u00A4\u00A6\u00E0\u00A5\u0082\u00E0\u00A4\u00B8\u00E0\u00A4\u00B0\u00E0\u00A5\u0087\u00E0\u00A4\u00A6\u00E0\u00A4\u00BF\u00E0\u00A4\u00A8\u00E0\u00A5\u008B\u00E0\u00A4\u0082\u00E0\u00A4\u00B9\u00E0\u00A4\u00A4\u00E0\u00A5\u008D\u00E0\u00A4\u00AF\u00E0\u00A4\u00BE\u00E0\u00A4\u00B8\u00E0\u00A5\u0087\u00E0\u00A4\u0095\u00E0\u00A5\u008D\u00E0\u00A4\u00B8\u00E0\u00A4\u0097\u00E0\u00A4\u00BE\u00E0\u00A4\u0082\u00E0\u00A4\u00A7\u00E0\u00A5\u0080\u00E0\u00A4\u00B5\u00E0\u00A4\u00BF\u00E0\u00A4\u00B6\u00E0\u00A5\u008D\u00E0\u00A4\u00B5\u00E0\u00A4\u00B0\u00E0\u00A4\u00BE\u00E0\u00A4\u00A4\u00E0\u00A5\u0087\u00E0\u00A4\u0082\u00E0\u00A4\u00A6\u00E0\u00A5\u0088\u00E0\u00A4\u009F\u00E0\u00A5\u008D\u00E0\u00A4\u00B8\u00E0\u00A4\u00A8\u00E0\u00A4\u0095\u00E0\u00A5\u008D\u00E0\u00A4\u00B6\u00E0\u00A4\u00BE\u00E0\u00A4\u00B8\u00E0\u00A4\u00BE\u00E0\u00A4\u00AE\u00E0\u00A4\u00A8\u00E0\u00A5\u0087\u00E0\u00A4\u0085\u00E0\u00A4\u00A6\u00E0\u00A4\u00BE\u00E0\u00A4\u00B2\u00E0\u00A4\u00A4\u00E0\u00A4\u00AC\u00E0\u00A4\u00BF\u00E0\u00A4\u009C\u00E0\u00A4\u00B2\u00E0\u00A5\u0080\u00E0\u00A4\u00AA\u00E0\u00A5\u0081\u00E0\u00A4\u00B0\u00E0\u00A5\u0082\u00E0\u00A4\u00B7\u00E0\u00A4\u00B9\u00E0\u00A4\u00BF\u00E0\u00A4\u0082\u00E0\u00A4\u00A6\u00E0\u00A5\u0080\u00E0\u00A4\u00AE\u00E0\u00A4\u00BF\u00E0\u00A4\u00A4\u00E0\u00A5\u008D\u00E0\u00A4\u00B0\u00E0\u00A4\u0095\u00E0\u00A4\u00B5\u00E0\u00A4\u00BF\u00E0\u00A4\u00A4\u00E0\u00A4\u00BE\u00E0\u00A4\u00B0\u00E0\u00A5\u0081\u00E0\u00A4\u00AA\u00E0\u00A4\u00AF\u00E0\u00A5\u0087\u00E0\u00A4\u00B8\u00E0\u00A5\u008D\u00E0\u00A4\u00A5\u00E0\u00A4\u00BE\u00E0\u00A4\u00A8\u00E0\u00A4\u0095\u00E0\u00A4\u00B0\u00E0\u00A5\u008B\u00E0\u00A4\u00A1\u00E0\u00A4\u00BC\u00E0\u00A4\u00AE\u00E0\u00A5\u0081\u00E0\u00A4\u0095\u00E0\u00A5\u008D\u00E0\u00A4\u00A4\u00E0\u00A4\u00AF\u00E0\u00A5\u008B\u00E0\u00A4\u009C\u00E0\u00A4\u00A8\u00E0\u00A4\u00BE\u00E0\u00A4\u0095\u00E0\u00A5\u0083\u00E0\u00A4\u00AA\u00E0\u00A4\u00AF\u00E0\u00A4\u00BE\u00E0\u00A4\u00AA\u00E0\u00A5\u008B\u00E0\u00A4\u00B8\u00E0\u00A5\u008D\u00E0\u00A4\u009F\u00E0\u00A4\u0098\u00E0\u00A4\u00B0\u00E0\u00A5\u0087\u00E0\u00A4\u00B2\u00E0\u00A5\u0082\u00E0\u00A4\u0095\u00E0\u00A4\u00BE\u00E0\u00A4\u00B0\u00E0\u00A5\u008D\u00E0\u00A4\u00AF\u00E0\u00A4\u00B5\u00E0\u00A4\u00BF\u00E0\u00A4\u009A\u00E0\u00A4\u00BE\u00E0\u00A4\u00B0\u00E0\u00A4\u00B8\u00E0\u00A5\u0082\u00E0\u00A4\u009A\u00E0\u00A4\u00A8\u00E0\u00A4\u00BE\u00E0\u00A4\u00AE\u00E0\u00A5\u0082\u00E0\u00A4\u00B2\u00E0\u00A5\u008D\u00E0\u00A4\u00AF\u00E0\u00A4\u00A6\u00E0\u00A5\u0087\u00E0\u00A4\u0096\u00E0\u00A5\u0087\u00E0\u00A4\u0082\u00E0\u00A4\u00B9\u00E0\u00A4\u00AE\u00E0\u00A5\u0087\u00E0\u00A4\u00B6\u00E0\u00A4\u00BE\u00E0\u00A4\u00B8\u00E0\u00A5\u008D\u00E0\u00A4\u0095\u00E0\u00A5\u0082\u00E0\u00A4\u00B2\u00E0\u00A4\u00AE\u00E0\u00A5\u0088\u00E0\u00A4\u0082\u00E0\u00A4\u00A8\u00E0\u00A5\u0087\u00E0\u00A4\u00A4\u00E0\u00A5\u0088\u00E0\u00A4\u00AF\u00E0\u00A4\u00BE\u00E0\u00A4\u00B0\u00E0\u00A4\u009C\u00E0\u00A4\u00BF\u00E0\u00A4\u00B8\u00E0\u00A4\u0095\u00E0\u00A5\u0087rss+xml\" title=\"-type\" content=\"title\" content=\"at the same time.js\">\n<\" method=\"post\" vertical-align:t/jquery.min.js\">.click(function( style=\"padding-})();\n\n\n\noverflow:hidden;img src=\"http://addEventListenerresponsible for s.js\">\n/favicon.ico\" />operating system\" style=\"width:1target=\"_blank\">State Universitytext-align:left;\ndocument.write(, including the around the world);\r\n\r\n<\" style=\"height:;overflow:hiddenmore informationan internationala member of the one of the firstcan be found in
    \n\t\t
    \ndisplay: none;\">\" />\nUniversity Pressdominated by theSecond World Wardistribution of style=\"position:the rest of the characterized by rel=\"nofollow\">derives from therather than the a combination ofstyle=\"width:100English-speakingcomputer scienceborder=\"0\" alt=\"the existence ofDemocratic Party\" style=\"margin-For this reason,.js\">\n\tsByTagName(s)[0]js\">\r\n<.js\">\r\nlink rel=\"icon\" ' alt='' class='formation of theversions of the /page>\n \n
    the United States\r\n\n
    \n \" action=\"http://\r\n\r\n\nbeginning of the revealed that thetelevision series\" rel=\"nofollow\"> target=\"_blank\">claiming that thehttp%3A%2F%2Fwww.manifestations ofPrime Minister ofinfluenced by theclass=\"clearfix\">/div>\r\n\r\n\r\nthree-dimensionalChurch of Englandof North Carolinasquare kilometres.addEventListenerdistinct from thecommonly known asPhonetic Alphabetdeclared that thecontrolled by theBenjamin Franklinrole-playing gamethe University ofin Western Europepersonal computerProject Gutenbergregardless of thehas been proposedtogether with the>
  • of the populationofficial language\r\n\r\u00CE\u0095\u00CE\u00BB\u00CE\u00BB\u00CE\u00B7\u00CE\u00BD\u00CE\u00B9\u00CE\u00BA\u00CE\u00AC\ntake advantage ofand, according toattributed to theMicrosoft Windowsthe first centuryunder the controldiv class=\"headershortly after thenotable exceptiontens of thousandsseveral differentaround the world.reaching militaryisolated from theopposition to thethe Old TestamentAfrican Americansinserted into theseparate from themetropolitan areamakes it possibleacknowledged thatarguably the mosttype=\"text/css\">\nthe InternationalAccording to the pe=\"text/css\" />\ncoincide with thetwo-thirds of theDuring this time,during the periodannounced that hethe internationaland more recentlybelieved that theconsciousness andformerly known assurrounded by thefirst appeared inoccasionally usedposition:absolute;\" target=\"_blank\" position:relative;text-align:center;jax/libs/jquery/1.background-color:#type=\"application/anguage\" content=\"e(\"%3Cscript src='\" target=\"_blank\">On the other hand,.jpg|thumb|right|2
    \r\n\r\n\nduring this period
  • closely related tofor the first time;font-weight:bold;input type=\"text\" \r\n<   \">it is possible to Harvard Universitytylesheet\" href=\"/the main characterOxford University name=\"keywords\" cstyle=\"text-align:the United Kingdomfederal government
    destruction of theslightly differentin accordance withtelecommunicationsindicates that theshortly thereafterespecially in the European countriesHowever, there aresrc=\"http://staticsuggested that the\" src=\"http://www.a large number of Telecommunications\" rel=\"nofollow\" tHoly Roman Emperoralmost exclusively\" border=\"0\" alt=\"Secretary of Stateculminating in theCIA World Factbookthe most importantanniversary of thestyle=\"background-
  • \r\n\r\n\r\n\nparticipate in thea strong influencestyle=\"margin-top:represented by thegraduated from theTraditionally, theElement(\"script\");However, since the/div>\n\n
    \n
    \n\t\t
    \nthe motion picture\u00D0\u0091\u00D1\u008A\u00D0\u00BB\u00D0\u00B3\u00D0\u00B0\u00D1\u0080\u00D1\u0081\u00D0\u00BA\u00D0\u00B8\u00D0\u00B1\u00D1\u008A\u00D0\u00BB\u00D0\u00B3\u00D0\u00B0\u00D1\u0080\u00D1\u0081\u00D0\u00BA\u00D0\u00B8\u00D0\u00A4\u00D0\u00B5\u00D0\u00B4\u00D0\u00B5\u00D1\u0080\u00D0\u00B0\u00D1\u0086\u00D0\u00B8\u00D0\u00B8\u00D0\u00BD\u00D0\u00B5\u00D1\u0081\u00D0\u00BA\u00D0\u00BE\u00D0\u00BB\u00D1\u008C\u00D0\u00BA\u00D0\u00BE\u00D1\u0081\u00D0\u00BE\u00D0\u00BE\u00D0\u00B1\u00D1\u0089\u00D0\u00B5\u00D0\u00BD\u00D0\u00B8\u00D0\u00B5\u00D1\u0081\u00D0\u00BE\u00D0\u00BE\u00D0\u00B1\u00D1\u0089\u00D0\u00B5\u00D0\u00BD\u00D0\u00B8\u00D1\u008F\u00D0\u00BF\u00D1\u0080\u00D0\u00BE\u00D0\u00B3\u00D1\u0080\u00D0\u00B0\u00D0\u00BC\u00D0\u00BC\u00D1\u008B\u00D0\u009E\u00D1\u0082\u00D0\u00BF\u00D1\u0080\u00D0\u00B0\u00D0\u00B2\u00D0\u00B8\u00D1\u0082\u00D1\u008C\u00D0\u00B1\u00D0\u00B5\u00D1\u0081\u00D0\u00BF\u00D0\u00BB\u00D0\u00B0\u00D1\u0082\u00D0\u00BD\u00D0\u00BE\u00D0\u00BC\u00D0\u00B0\u00D1\u0082\u00D0\u00B5\u00D1\u0080\u00D0\u00B8\u00D0\u00B0\u00D0\u00BB\u00D1\u008B\u00D0\u00BF\u00D0\u00BE\u00D0\u00B7\u00D0\u00B2\u00D0\u00BE\u00D0\u00BB\u00D1\u008F\u00D0\u00B5\u00D1\u0082\u00D0\u00BF\u00D0\u00BE\u00D1\u0081\u00D0\u00BB\u00D0\u00B5\u00D0\u00B4\u00D0\u00BD\u00D0\u00B8\u00D0\u00B5\u00D1\u0080\u00D0\u00B0\u00D0\u00B7\u00D0\u00BB\u00D0\u00B8\u00D1\u0087\u00D0\u00BD\u00D1\u008B\u00D1\u0085\u00D0\u00BF\u00D1\u0080\u00D0\u00BE\u00D0\u00B4\u00D1\u0083\u00D0\u00BA\u00D1\u0086\u00D0\u00B8\u00D0\u00B8\u00D0\u00BF\u00D1\u0080\u00D0\u00BE\u00D0\u00B3\u00D1\u0080\u00D0\u00B0\u00D0\u00BC\u00D0\u00BC\u00D0\u00B0\u00D0\u00BF\u00D0\u00BE\u00D0\u00BB\u00D0\u00BD\u00D0\u00BE\u00D1\u0081\u00D1\u0082\u00D1\u008C\u00D1\u008E\u00D0\u00BD\u00D0\u00B0\u00D1\u0085\u00D0\u00BE\u00D0\u00B4\u00D0\u00B8\u00D1\u0082\u00D1\u0081\u00D1\u008F\u00D0\u00B8\u00D0\u00B7\u00D0\u00B1\u00D1\u0080\u00D0\u00B0\u00D0\u00BD\u00D0\u00BD\u00D0\u00BE\u00D0\u00B5\u00D0\u00BD\u00D0\u00B0\u00D1\u0081\u00D0\u00B5\u00D0\u00BB\u00D0\u00B5\u00D0\u00BD\u00D0\u00B8\u00D1\u008F\u00D0\u00B8\u00D0\u00B7\u00D0\u00BC\u00D0\u00B5\u00D0\u00BD\u00D0\u00B5\u00D0\u00BD\u00D0\u00B8\u00D1\u008F\u00D0\u00BA\u00D0\u00B0\u00D1\u0082\u00D0\u00B5\u00D0\u00B3\u00D0\u00BE\u00D1\u0080\u00D0\u00B8\u00D0\u00B8\u00D0\u0090\u00D0\u00BB\u00D0\u00B5\u00D0\u00BA\u00D1\u0081\u00D0\u00B0\u00D0\u00BD\u00D0\u00B4\u00D1\u0080\u00E0\u00A4\u00A6\u00E0\u00A5\u008D\u00E0\u00A4\u00B5\u00E0\u00A4\u00BE\u00E0\u00A4\u00B0\u00E0\u00A4\u00BE\u00E0\u00A4\u00AE\u00E0\u00A5\u0088\u00E0\u00A4\u00A8\u00E0\u00A5\u0081\u00E0\u00A4\u0085\u00E0\u00A4\u00B2\u00E0\u00A4\u00AA\u00E0\u00A5\u008D\u00E0\u00A4\u00B0\u00E0\u00A4\u00A6\u00E0\u00A4\u00BE\u00E0\u00A4\u00A8\u00E0\u00A4\u00AD\u00E0\u00A4\u00BE\u00E0\u00A4\u00B0\u00E0\u00A4\u00A4\u00E0\u00A5\u0080\u00E0\u00A4\u00AF\u00E0\u00A4\u0085\u00E0\u00A4\u00A8\u00E0\u00A5\u0081\u00E0\u00A4\u00A6\u00E0\u00A5\u0087\u00E0\u00A4\u00B6\u00E0\u00A4\u00B9\u00E0\u00A4\u00BF\u00E0\u00A4\u00A8\u00E0\u00A5\u008D\u00E0\u00A4\u00A6\u00E0\u00A5\u0080\u00E0\u00A4\u0087\u00E0\u00A4\u0082\u00E0\u00A4\u00A1\u00E0\u00A4\u00BF\u00E0\u00A4\u00AF\u00E0\u00A4\u00BE\u00E0\u00A4\u00A6\u00E0\u00A4\u00BF\u00E0\u00A4\u00B2\u00E0\u00A5\u008D\u00E0\u00A4\u00B2\u00E0\u00A5\u0080\u00E0\u00A4\u0085\u00E0\u00A4\u00A7\u00E0\u00A4\u00BF\u00E0\u00A4\u0095\u00E0\u00A4\u00BE\u00E0\u00A4\u00B0\u00E0\u00A4\u00B5\u00E0\u00A5\u0080\u00E0\u00A4\u00A1\u00E0\u00A4\u00BF\u00E0\u00A4\u00AF\u00E0\u00A5\u008B\u00E0\u00A4\u009A\u00E0\u00A4\u00BF\u00E0\u00A4\u009F\u00E0\u00A5\u008D\u00E0\u00A4\u00A0\u00E0\u00A5\u0087\u00E0\u00A4\u00B8\u00E0\u00A4\u00AE\u00E0\u00A4\u00BE\u00E0\u00A4\u009A\u00E0\u00A4\u00BE\u00E0\u00A4\u00B0\u00E0\u00A4\u009C\u00E0\u00A4\u0082\u00E0\u00A4\u0095\u00E0\u00A5\u008D\u00E0\u00A4\u00B6\u00E0\u00A4\u00A8\u00E0\u00A4\u00A6\u00E0\u00A5\u0081\u00E0\u00A4\u00A8\u00E0\u00A4\u00BF\u00E0\u00A4\u00AF\u00E0\u00A4\u00BE\u00E0\u00A4\u00AA\u00E0\u00A5\u008D\u00E0\u00A4\u00B0\u00E0\u00A4\u00AF\u00E0\u00A5\u008B\u00E0\u00A4\u0097\u00E0\u00A4\u0085\u00E0\u00A4\u00A8\u00E0\u00A5\u0081\u00E0\u00A4\u00B8\u00E0\u00A4\u00BE\u00E0\u00A4\u00B0\u00E0\u00A4\u0091\u00E0\u00A4\u00A8\u00E0\u00A4\u00B2\u00E0\u00A4\u00BE\u00E0\u00A4\u0087\u00E0\u00A4\u00A8\u00E0\u00A4\u00AA\u00E0\u00A4\u00BE\u00E0\u00A4\u00B0\u00E0\u00A5\u008D\u00E0\u00A4\u009F\u00E0\u00A5\u0080\u00E0\u00A4\u00B6\u00E0\u00A4\u00B0\u00E0\u00A5\u008D\u00E0\u00A4\u00A4\u00E0\u00A5\u008B\u00E0\u00A4\u0082\u00E0\u00A4\u00B2\u00E0\u00A5\u008B\u00E0\u00A4\u0095\u00E0\u00A4\u00B8\u00E0\u00A4\u00AD\u00E0\u00A4\u00BE\u00E0\u00A4\u00AB\u00E0\u00A4\u00BC\u00E0\u00A5\u008D\u00E0\u00A4\u00B2\u00E0\u00A5\u0088\u00E0\u00A4\u00B6\u00E0\u00A4\u00B6\u00E0\u00A4\u00B0\u00E0\u00A5\u008D\u00E0\u00A4\u00A4\u00E0\u00A5\u0087\u00E0\u00A4\u0082\u00E0\u00A4\u00AA\u00E0\u00A5\u008D\u00E0\u00A4\u00B0\u00E0\u00A4\u00A6\u00E0\u00A5\u0087\u00E0\u00A4\u00B6\u00E0\u00A4\u00AA\u00E0\u00A5\u008D\u00E0\u00A4\u00B2\u00E0\u00A5\u0087\u00E0\u00A4\u00AF\u00E0\u00A4\u00B0\u00E0\u00A4\u0095\u00E0\u00A5\u0087\u00E0\u00A4\u0082\u00E0\u00A4\u00A6\u00E0\u00A5\u008D\u00E0\u00A4\u00B0\u00E0\u00A4\u00B8\u00E0\u00A5\u008D\u00E0\u00A4\u00A5\u00E0\u00A4\u00BF\u00E0\u00A4\u00A4\u00E0\u00A4\u00BF\u00E0\u00A4\u0089\u00E0\u00A4\u00A4\u00E0\u00A5\u008D\u00E0\u00A4\u00AA\u00E0\u00A4\u00BE\u00E0\u00A4\u00A6\u00E0\u00A4\u0089\u00E0\u00A4\u00A8\u00E0\u00A5\u008D\u00E0\u00A4\u00B9\u00E0\u00A5\u0087\u00E0\u00A4\u0082\u00E0\u00A4\u009A\u00E0\u00A4\u00BF\u00E0\u00A4\u009F\u00E0\u00A5\u008D\u00E0\u00A4\u00A0\u00E0\u00A4\u00BE\u00E0\u00A4\u00AF\u00E0\u00A4\u00BE\u00E0\u00A4\u00A4\u00E0\u00A5\u008D\u00E0\u00A4\u00B0\u00E0\u00A4\u00BE\u00E0\u00A4\u009C\u00E0\u00A5\u008D\u00E0\u00A4\u00AF\u00E0\u00A4\u00BE\u00E0\u00A4\u00A6\u00E0\u00A4\u00BE\u00E0\u00A4\u00AA\u00E0\u00A5\u0081\u00E0\u00A4\u00B0\u00E0\u00A4\u00BE\u00E0\u00A4\u00A8\u00E0\u00A5\u0087\u00E0\u00A4\u009C\u00E0\u00A5\u008B\u00E0\u00A4\u00A1\u00E0\u00A4\u00BC\u00E0\u00A5\u0087\u00E0\u00A4\u0082\u00E0\u00A4\u0085\u00E0\u00A4\u00A8\u00E0\u00A5\u0081\u00E0\u00A4\u00B5\u00E0\u00A4\u00BE\u00E0\u00A4\u00A6\u00E0\u00A4\u00B6\u00E0\u00A5\u008D\u00E0\u00A4\u00B0\u00E0\u00A5\u0087\u00E0\u00A4\u00A3\u00E0\u00A5\u0080\u00E0\u00A4\u00B6\u00E0\u00A4\u00BF\u00E0\u00A4\u0095\u00E0\u00A5\u008D\u00E0\u00A4\u00B7\u00E0\u00A4\u00BE\u00E0\u00A4\u00B8\u00E0\u00A4\u00B0\u00E0\u00A4\u0095\u00E0\u00A4\u00BE\u00E0\u00A4\u00B0\u00E0\u00A5\u0080\u00E0\u00A4\u00B8\u00E0\u00A4\u0082\u00E0\u00A4\u0097\u00E0\u00A5\u008D\u00E0\u00A4\u00B0\u00E0\u00A4\u00B9\u00E0\u00A4\u00AA\u00E0\u00A4\u00B0\u00E0\u00A4\u00BF\u00E0\u00A4\u00A3\u00E0\u00A4\u00BE\u00E0\u00A4\u00AE\u00E0\u00A4\u00AC\u00E0\u00A5\u008D\u00E0\u00A4\u00B0\u00E0\u00A4\u00BE\u00E0\u00A4\u0082\u00E0\u00A4\u00A1\u00E0\u00A4\u00AC\u00E0\u00A4\u009A\u00E0\u00A5\u008D\u00E0\u00A4\u009A\u00E0\u00A5\u008B\u00E0\u00A4\u0082\u00E0\u00A4\u0089\u00E0\u00A4\u00AA\u00E0\u00A4\u00B2\u00E0\u00A4\u00AC\u00E0\u00A5\u008D\u00E0\u00A4\u00A7\u00E0\u00A4\u00AE\u00E0\u00A4\u0082\u00E0\u00A4\u00A4\u00E0\u00A5\u008D\u00E0\u00A4\u00B0\u00E0\u00A5\u0080\u00E0\u00A4\u00B8\u00E0\u00A4\u0082\u00E0\u00A4\u00AA\u00E0\u00A4\u00B0\u00E0\u00A5\u008D\u00E0\u00A4\u0095\u00E0\u00A4\u0089\u00E0\u00A4\u00AE\u00E0\u00A5\u008D\u00E0\u00A4\u00AE\u00E0\u00A5\u0080\u00E0\u00A4\u00A6\u00E0\u00A4\u00AE\u00E0\u00A4\u00BE\u00E0\u00A4\u00A7\u00E0\u00A5\u008D\u00E0\u00A4\u00AF\u00E0\u00A4\u00AE\u00E0\u00A4\u00B8\u00E0\u00A4\u00B9\u00E0\u00A4\u00BE\u00E0\u00A4\u00AF\u00E0\u00A4\u00A4\u00E0\u00A4\u00BE\u00E0\u00A4\u00B6\u00E0\u00A4\u00AC\u00E0\u00A5\u008D\u00E0\u00A4\u00A6\u00E0\u00A5\u008B\u00E0\u00A4\u0082\u00E0\u00A4\u00AE\u00E0\u00A5\u0080\u00E0\u00A4\u00A1\u00E0\u00A4\u00BF\u00E0\u00A4\u00AF\u00E0\u00A4\u00BE\u00E0\u00A4\u0086\u00E0\u00A4\u0088\u00E0\u00A4\u00AA\u00E0\u00A5\u0080\u00E0\u00A4\u008F\u00E0\u00A4\u00B2\u00E0\u00A4\u00AE\u00E0\u00A5\u008B\u00E0\u00A4\u00AC\u00E0\u00A4\u00BE\u00E0\u00A4\u0087\u00E0\u00A4\u00B2\u00E0\u00A4\u00B8\u00E0\u00A4\u0082\u00E0\u00A4\u0096\u00E0\u00A5\u008D\u00E0\u00A4\u00AF\u00E0\u00A4\u00BE\u00E0\u00A4\u0086\u00E0\u00A4\u00AA\u00E0\u00A4\u00B0\u00E0\u00A5\u0087\u00E0\u00A4\u00B6\u00E0\u00A4\u00A8\u00E0\u00A4\u0085\u00E0\u00A4\u00A8\u00E0\u00A5\u0081\u00E0\u00A4\u00AC\u00E0\u00A4\u0082\u00E0\u00A4\u00A7\u00E0\u00A4\u00AC\u00E0\u00A4\u00BE\u00E0\u00A4\u009C\u00E0\u00A4\u00BC\u00E0\u00A4\u00BE\u00E0\u00A4\u00B0\u00E0\u00A4\u00A8\u00E0\u00A4\u00B5\u00E0\u00A5\u0080\u00E0\u00A4\u00A8\u00E0\u00A4\u00A4\u00E0\u00A4\u00AE\u00E0\u00A4\u00AA\u00E0\u00A5\u008D\u00E0\u00A4\u00B0\u00E0\u00A4\u00AE\u00E0\u00A5\u0081\u00E0\u00A4\u0096\u00E0\u00A4\u00AA\u00E0\u00A5\u008D\u00E0\u00A4\u00B0\u00E0\u00A4\u00B6\u00E0\u00A5\u008D\u00E0\u00A4\u00A8\u00E0\u00A4\u00AA\u00E0\u00A4\u00B0\u00E0\u00A4\u00BF\u00E0\u00A4\u00B5\u00E0\u00A4\u00BE\u00E0\u00A4\u00B0\u00E0\u00A4\u00A8\u00E0\u00A5\u0081\u00E0\u00A4\u0095\u00E0\u00A4\u00B8\u00E0\u00A4\u00BE\u00E0\u00A4\u00A8\u00E0\u00A4\u00B8\u00E0\u00A4\u00AE\u00E0\u00A4\u00B0\u00E0\u00A5\u008D\u00E0\u00A4\u00A5\u00E0\u00A4\u00A8\u00E0\u00A4\u0086\u00E0\u00A4\u00AF\u00E0\u00A5\u008B\u00E0\u00A4\u009C\u00E0\u00A4\u00BF\u00E0\u00A4\u00A4\u00E0\u00A4\u00B8\u00E0\u00A5\u008B\u00E0\u00A4\u00AE\u00E0\u00A4\u00B5\u00E0\u00A4\u00BE\u00E0\u00A4\u00B0\u00D8\u00A7\u00D9\u0084\u00D9\u0085\u00D8\u00B4\u00D8\u00A7\u00D8\u00B1\u00D9\u0083\u00D8\u00A7\u00D8\u00AA\u00D8\u00A7\u00D9\u0084\u00D9\u0085\u00D9\u0086\u00D8\u00AA\u00D8\u00AF\u00D9\u008A\u00D8\u00A7\u00D8\u00AA\u00D8\u00A7\u00D9\u0084\u00D9\u0083\u00D9\u0085\u00D8\u00A8\u00D9\u008A\u00D9\u0088\u00D8\u00AA\u00D8\u00B1\u00D8\u00A7\u00D9\u0084\u00D9\u0085\u00D8\u00B4\u00D8\u00A7\u00D9\u0087\u00D8\u00AF\u00D8\u00A7\u00D8\u00AA\u00D8\u00B9\u00D8\u00AF\u00D8\u00AF\u00D8\u00A7\u00D9\u0084\u00D8\u00B2\u00D9\u0088\u00D8\u00A7\u00D8\u00B1\u00D8\u00B9\u00D8\u00AF\u00D8\u00AF\u00D8\u00A7\u00D9\u0084\u00D8\u00B1\u00D8\u00AF\u00D9\u0088\u00D8\u00AF\u00D8\u00A7\u00D9\u0084\u00D8\u00A5\u00D8\u00B3\u00D9\u0084\u00D8\u00A7\u00D9\u0085\u00D9\u008A\u00D8\u00A9\u00D8\u00A7\u00D9\u0084\u00D9\u0081\u00D9\u0088\u00D8\u00AA\u00D9\u0088\u00D8\u00B4\u00D9\u0088\u00D8\u00A8\u00D8\u00A7\u00D9\u0084\u00D9\u0085\u00D8\u00B3\u00D8\u00A7\u00D8\u00A8\u00D9\u0082\u00D8\u00A7\u00D8\u00AA\u00D8\u00A7\u00D9\u0084\u00D9\u0085\u00D8\u00B9\u00D9\u0084\u00D9\u0088\u00D9\u0085\u00D8\u00A7\u00D8\u00AA\u00D8\u00A7\u00D9\u0084\u00D9\u0085\u00D8\u00B3\u00D9\u0084\u00D8\u00B3\u00D9\u0084\u00D8\u00A7\u00D8\u00AA\u00D8\u00A7\u00D9\u0084\u00D8\u00AC\u00D8\u00B1\u00D8\u00A7\u00D9\u0081\u00D9\u008A\u00D9\u0083\u00D8\u00B3\u00D8\u00A7\u00D9\u0084\u00D8\u00A7\u00D8\u00B3\u00D9\u0084\u00D8\u00A7\u00D9\u0085\u00D9\u008A\u00D8\u00A9\u00D8\u00A7\u00D9\u0084\u00D8\u00A7\u00D8\u00AA\u00D8\u00B5\u00D8\u00A7\u00D9\u0084\u00D8\u00A7\u00D8\u00AAkeywords\" content=\"w3.org/1999/xhtml\">
    \n
    \n
    \r\ndistinction between/\" target=\"_blank\">\nw.addEventListener?action=\"http://www.icon\" href=\"http:// style=\"background:type=\"text/css\" />\nmeta property=\"og:t\n\n\n\r\n\n\r\n\n
    \n
    \n
    type=\"text/css\" />\ninterchangeably withmore closely relatedsocial and politicalthat would otherwiseperpendicular to thestyle type=\"text/csstype=\"submit\" name=\"families residing indeveloping countriescomputer programmingeconomic developmentdetermination of thefor more informationon several occasionsportugu\u00C3\u00AAs (Europeu)\u00D0\u00A3\u00D0\u00BA\u00D1\u0080\u00D0\u00B0\u00D1\u0097\u00D0\u00BD\u00D1\u0081\u00D1\u008C\u00D0\u00BA\u00D0\u00B0\u00D1\u0083\u00D0\u00BA\u00D1\u0080\u00D0\u00B0\u00D1\u0097\u00D0\u00BD\u00D1\u0081\u00D1\u008C\u00D0\u00BA\u00D0\u00B0\u00D0\u00A0\u00D0\u00BE\u00D1\u0081\u00D1\u0081\u00D0\u00B8\u00D0\u00B9\u00D1\u0081\u00D0\u00BA\u00D0\u00BE\u00D0\u00B9\u00D0\u00BC\u00D0\u00B0\u00D1\u0082\u00D0\u00B5\u00D1\u0080\u00D0\u00B8\u00D0\u00B0\u00D0\u00BB\u00D0\u00BE\u00D0\u00B2\u00D0\u00B8\u00D0\u00BD\u00D1\u0084\u00D0\u00BE\u00D1\u0080\u00D0\u00BC\u00D0\u00B0\u00D1\u0086\u00D0\u00B8\u00D0\u00B8\u00D1\u0083\u00D0\u00BF\u00D1\u0080\u00D0\u00B0\u00D0\u00B2\u00D0\u00BB\u00D0\u00B5\u00D0\u00BD\u00D0\u00B8\u00D1\u008F\u00D0\u00BD\u00D0\u00B5\u00D0\u00BE\u00D0\u00B1\u00D1\u0085\u00D0\u00BE\u00D0\u00B4\u00D0\u00B8\u00D0\u00BC\u00D0\u00BE\u00D0\u00B8\u00D0\u00BD\u00D1\u0084\u00D0\u00BE\u00D1\u0080\u00D0\u00BC\u00D0\u00B0\u00D1\u0086\u00D0\u00B8\u00D1\u008F\u00D0\u0098\u00D0\u00BD\u00D1\u0084\u00D0\u00BE\u00D1\u0080\u00D0\u00BC\u00D0\u00B0\u00D1\u0086\u00D0\u00B8\u00D1\u008F\u00D0\u00A0\u00D0\u00B5\u00D1\u0081\u00D0\u00BF\u00D1\u0083\u00D0\u00B1\u00D0\u00BB\u00D0\u00B8\u00D0\u00BA\u00D0\u00B8\u00D0\u00BA\u00D0\u00BE\u00D0\u00BB\u00D0\u00B8\u00D1\u0087\u00D0\u00B5\u00D1\u0081\u00D1\u0082\u00D0\u00B2\u00D0\u00BE\u00D0\u00B8\u00D0\u00BD\u00D1\u0084\u00D0\u00BE\u00D1\u0080\u00D0\u00BC\u00D0\u00B0\u00D1\u0086\u00D0\u00B8\u00D1\u008E\u00D1\u0082\u00D0\u00B5\u00D1\u0080\u00D1\u0080\u00D0\u00B8\u00D1\u0082\u00D0\u00BE\u00D1\u0080\u00D0\u00B8\u00D0\u00B8\u00D0\u00B4\u00D0\u00BE\u00D1\u0081\u00D1\u0082\u00D0\u00B0\u00D1\u0082\u00D0\u00BE\u00D1\u0087\u00D0\u00BD\u00D0\u00BE\u00D8\u00A7\u00D9\u0084\u00D9\u0085\u00D8\u00AA\u00D9\u0088\u00D8\u00A7\u00D8\u00AC\u00D8\u00AF\u00D9\u0088\u00D9\u0086\u00D8\u00A7\u00D9\u0084\u00D8\u00A7\u00D8\u00B4\u00D8\u00AA\u00D8\u00B1\u00D8\u00A7\u00D9\u0083\u00D8\u00A7\u00D8\u00AA\u00D8\u00A7\u00D9\u0084\u00D8\u00A7\u00D9\u0082\u00D8\u00AA\u00D8\u00B1\u00D8\u00A7\u00D8\u00AD\u00D8\u00A7\u00D8\u00AAhtml; charset=UTF-8\" setTimeout(function()display:inline-block;\n
    \n
    \nestablishment of the