├── .editorconfig ├── .gitattributes ├── .gitignore ├── Blazor.Extensions.OfficeUiFabric.sln ├── Directory.Build.props ├── Directory.Build.targets ├── LICENSE ├── README.md ├── samples ├── Blazor.OfficeUiFabric.Samples.Client │ ├── App.cshtml │ ├── Blazor.OfficeUiFabric.Samples.Client.csproj │ ├── Pages │ │ ├── Counter.cshtml │ │ ├── FetchData.cshtml │ │ ├── Index.cshtml │ │ └── _ViewImports.cshtml │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── Shared │ │ ├── MainLayout.cshtml │ │ ├── NavMenu.cshtml │ │ └── SurveyPrompt.cshtml │ ├── Startup.cs │ ├── _ViewImports.cshtml │ └── wwwroot │ │ ├── css │ │ ├── bootstrap │ │ │ ├── bootstrap.min.css │ │ │ └── bootstrap.min.css.map │ │ ├── open-iconic │ │ │ ├── FONT-LICENSE │ │ │ ├── ICON-LICENSE │ │ │ ├── README.md │ │ │ └── font │ │ │ │ ├── css │ │ │ │ └── open-iconic-bootstrap.min.css │ │ │ │ └── fonts │ │ │ │ ├── open-iconic.eot │ │ │ │ ├── open-iconic.otf │ │ │ │ ├── open-iconic.svg │ │ │ │ ├── open-iconic.ttf │ │ │ │ └── open-iconic.woff │ │ └── site.css │ │ └── index.html ├── Blazor.OfficeUiFabric.Samples.Server │ ├── Blazor.OfficeUiFabric.Samples.Server.csproj │ ├── Controllers │ │ └── SampleDataController.cs │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ └── Startup.cs ├── Blazor.OfficeUiFabric.Samples.Shared │ ├── Blazor.OfficeUiFabric.Samples.Shared.csproj │ └── WeatherForecast.cs ├── CreateElement │ ├── .gitignore │ ├── CreateElement.csproj │ ├── Makefile │ ├── Program.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── README.md │ └── index.html ├── DOMElement │ ├── .gitignore │ ├── DOMElement.cs │ ├── DOMElement.csproj │ ├── ElementTinkerer.cs │ ├── Makefile │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── README.md │ ├── index.html │ └── sections │ │ ├── section1.html │ │ └── section2.html ├── DOMTree │ ├── .gitignore │ ├── DOMInfo.cs │ ├── DOMTree.cs │ ├── DOMTree.csproj │ ├── Makefile │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── README.md │ └── index.html ├── DragNDrop │ ├── .gitignore │ ├── DragNDrop.csproj │ ├── Dragger.cs │ ├── Makefile │ ├── Program.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── README.md │ └── index.html ├── Forms │ ├── .gitignore │ ├── DemoButtons.cs │ ├── Forms.csproj │ ├── LinkImports.cs │ ├── Makefile │ ├── Nav.cs │ ├── Program.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── README.md │ ├── assets │ │ ├── css │ │ │ ├── about.css │ │ │ ├── demo.css │ │ │ ├── fonts │ │ │ │ ├── SourceCodePro-Regular.ttf │ │ │ │ ├── SourceSansPro-Black.otf │ │ │ │ ├── SourceSansPro-BlackIt.otf │ │ │ │ ├── SourceSansPro-Bold.otf │ │ │ │ ├── SourceSansPro-BoldIt.otf │ │ │ │ ├── SourceSansPro-ExtraLight.otf │ │ │ │ ├── SourceSansPro-ExtraLightIt.otf │ │ │ │ ├── SourceSansPro-It.otf │ │ │ │ ├── SourceSansPro-Light.otf │ │ │ │ ├── SourceSansPro-LightIt.otf │ │ │ │ ├── SourceSansPro-Regular.otf │ │ │ │ ├── SourceSansPro-Semibold.otf │ │ │ │ └── SourceSansPro-SemiboldIt.otf │ │ │ ├── global.css │ │ │ ├── nativize.css │ │ │ ├── nav.css │ │ │ ├── section.css │ │ │ └── variables.css │ │ └── img │ │ │ └── loader.gif │ ├── index.html │ └── sections │ │ ├── about.html │ │ └── firstform.html ├── Hello │ ├── .gitignore │ ├── Hello.cs │ ├── Hello.csproj │ ├── Makefile │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── README.md │ └── index.html ├── Hello1 │ ├── .gitignore │ ├── Hello.cs │ ├── Hello1.csproj │ ├── Makefile │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── README.md │ └── index.html ├── HelloElectron │ ├── .gitignore │ ├── LICENSE.md │ ├── README.md │ ├── index.html │ ├── main.js │ ├── package-lock.json │ ├── package.json │ ├── renderer.js │ ├── sample_module_node.js │ └── src │ │ ├── HelloElectron.csproj │ │ ├── Makefile │ │ ├── Program.cs │ │ └── Properties │ │ └── AssemblyInfo.cs ├── global.json └── sample_module.js ├── src ├── Blazor.Extensions.MergeStyles.BuildTools │ ├── Blazor.Extensions.MergeStyles.BuildTools.csproj │ ├── Cli │ │ ├── Commands │ │ │ ├── CheckToolCommand.cs │ │ │ └── EmitCsharpClassesCommand.cs │ │ ├── ICommand.cs │ │ ├── Models │ │ │ ├── TransformFile.cs │ │ │ ├── TransformOptions.cs │ │ │ └── TransmormationRule.cs │ │ └── StartCommand.cs │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── ReferenceFromSource.props │ └── tools │ │ ├── Blazor.Extensions.MergeStyles.BuildTools.deps.json │ │ ├── Blazor.Extensions.MergeStyles.BuildTools.dll │ │ ├── Blazor.Extensions.MergeStyles.BuildTools.dll.config │ │ ├── Blazor.Extensions.MergeStyles.BuildTools.runtimeconfig.dev.json │ │ └── Blazor.Extensions.MergeStyles.BuildTools.runtimeconfig.json ├── Blazor.Extensions.MergeStyles.Core │ ├── Blazor.Extensions.MergeStyles.Core.csproj │ ├── Blazor.Extensions.MergeStyles.Core2.csproj │ ├── CssValue.cs │ ├── Extensions │ │ ├── CollectionsExtensions.cs │ │ ├── CommonExtensions.cs │ │ └── DictionaryExtensions.cs │ ├── GlobalSuppressions.cs │ ├── IFontFace.cs │ ├── IRawFontStyle.cs │ ├── IStyleSet.cs │ ├── Keyframes.cs │ ├── NotParseAttribute.cs │ ├── RawStyleBase.cs │ ├── Serialization │ │ ├── AlignContentConverter.cs │ │ ├── AlignItemsConverter.cs │ │ ├── AlignSelfConverter.cs │ │ ├── AnimationFillModeConverter.cs │ │ ├── BackgroundAttachmentConverter.cs │ │ ├── BackgroundClipConverter.cs │ │ ├── BoxSizingConverter.cs │ │ ├── ColumnCountConverter.cs │ │ ├── ColumnCountEnumConverter.cs │ │ ├── Converter.cs │ │ ├── CssValueConverter.cs │ │ ├── FillOpacityConverter.cs │ │ ├── FlexDirectionConverter.cs │ │ ├── FlexWrapConverter.cs │ │ ├── FontSizeAdjustEnumConverter.cs │ │ ├── FontSizeAdjustUnionConverter.cs │ │ ├── FontSmoothingConverter.cs │ │ ├── FontStretchConverter.cs │ │ ├── FontStyleConverter.cs │ │ ├── IFontWeightEnumConverter.cs │ │ ├── IFontWeightUnionConverter.cs │ │ ├── IcssRuleEnumConverter.cs │ │ ├── JustifyContentConverter.cs │ │ ├── MergeStylesJson.cs │ │ ├── OverflowConverter.cs │ │ ├── OverflowWrapConverter.cs │ │ ├── PositionConverter.cs │ │ ├── ResizeConverter.cs │ │ ├── UserSelectConverter.cs │ │ └── WebkitOverflowScrollingConverter.cs │ ├── Style.cs │ ├── StyleBase.cs │ └── StyleSet.cs ├── Blazor.Extensions.MergeStyles.JS │ ├── .gitignore │ ├── Blazor.Extensions.MergeStyles.JS.csproj │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── Initialize.ts │ │ ├── Stylesheet.ts │ │ ├── VendorSettings.ts │ │ ├── dotnet.d.ts │ │ └── transforms │ │ │ └── rtlifyRules.ts │ ├── tsconfig.json │ └── webpack.config.js ├── Blazor.Extensions.MergeStyles │ ├── Blazor.Extensions.MergeStyles.csproj │ ├── Extensions │ │ ├── JSRuntimeExtensions.cs │ │ └── ServiceCollectionExtensions.cs │ ├── IStyleEngine.cs │ ├── InjectionMode.cs │ ├── Properties │ │ └── launchSettings.json │ ├── Registration.cs │ ├── RuleSet.cs │ ├── StyleEngine.cs │ ├── StyleRuleInsertEventHandler.cs │ ├── StyleSheetConfig.cs │ ├── Stylesheet.cs │ ├── Transforms │ │ └── TransformationsRules.cs │ └── VendorSettings.cs ├── Blazor.OfficeUiFabric.Styling │ ├── AnimationStyles.cs │ ├── AnimationVariables.cs │ ├── Blazor.OfficeUiFabric.Styling.csproj │ ├── CommonStyles.cs │ ├── Extensions │ │ ├── BlarozApplicationBuilderExtenions.cs │ │ ├── ObjectExtenions.cs │ │ ├── SerializeExtensons.cs │ │ └── ServiceCollectionExtensions.cs │ ├── FabricConfig.cs │ ├── Fonts │ │ ├── FontEngine.cs │ │ ├── FontFamilies.cs │ │ ├── FontSizes.cs │ │ ├── FontStyles.cs │ │ ├── FontType.cs │ │ ├── FontTypes.cs │ │ ├── FontWeights.cs │ │ ├── IFontEngine.cs │ │ ├── LocalizedFontFamilies.cs │ │ ├── LocalizedFontNames.cs │ │ └── Typography.cs │ ├── GeneralStyles.cs │ ├── GlobalSuppressions.cs │ ├── IFabricConfig.cs │ ├── Palette.cs │ ├── SemanticColors.cs │ ├── Themes │ │ ├── ClearStyleOptions.cs │ │ ├── ILoadThemeStyle.cs │ │ ├── LoadThemeStyle.cs │ │ ├── Measurement.cs │ │ ├── Mode.cs │ │ ├── RunState.cs │ │ ├── StyleRecord.cs │ │ ├── Theme.cs │ │ ├── ThemeState.cs │ │ └── ThemingInstruction.cs │ ├── ThemingEngine.cs │ └── ZIndexes.cs ├── Blazor.OfficeUiFabric.Utilities │ ├── Blazor.OfficeUiFabric.Utilities.csproj │ ├── ExpandableObject.cs │ └── KeyCodes.cs ├── Blazor.OfficeUiFabric │ ├── Blazor.OfficeUiFabric.csproj │ ├── Component1.cshtml │ ├── Components │ │ ├── Buttons │ │ │ ├── BaseButton.cshtml │ │ │ ├── BaseButtonBase.cs │ │ │ ├── ButtonStyles.cs │ │ │ ├── ButtonType.cs │ │ │ ├── DefaultButton.cs │ │ │ ├── DefaultButton.style.cs │ │ │ └── ElementType.cs │ │ ├── Icons │ │ │ ├── IconBase.cshtml │ │ │ ├── IconBaseBase.cs │ │ │ └── IconType.cs │ │ └── Images │ │ │ ├── Image.cshtml │ │ │ ├── ImageBase.cs │ │ │ ├── ImageConvertStyle.cs │ │ │ ├── ImageFit.cs │ │ │ ├── ImageLoadState.cs │ │ │ ├── ImageStyles.cs │ │ │ └── ImateTypes.cs │ ├── ExampleJsInterop.cs │ ├── Properties │ │ └── launchSettings.json │ ├── _ViewImports.cshtml │ └── content │ │ ├── background.png │ │ ├── exampleJsInterop.js │ │ └── styles.css └── Mono.WebAssembly.Browser │ ├── .gitignore │ ├── ClrFuncReflectionWrap.cs │ ├── DOM │ ├── Attr.cs │ ├── BarProp.cs │ ├── CDATASection.cs │ ├── CharacterData.cs │ ├── Comment.cs │ ├── DOMEventArgs.cs │ ├── DOMEventHandler.cs │ ├── DOMSettableTokenList.cs │ ├── DOMTokenList.cs │ ├── DataTransfer.cs │ ├── DataTransferItem.cs │ ├── DataTransferItemList.cs │ ├── Document.CreateElement.cs │ ├── Document.cs │ ├── DocumentFragment.cs │ ├── DocumentType.cs │ ├── Element.AttributeAndStyle.cs │ ├── Element.cs │ ├── Enums │ │ ├── DropEffect.cs │ │ ├── EffectAllowed.cs │ │ ├── InputElementType.cs │ │ ├── InsertPosition.cs │ │ ├── ScrollRestoration.cs │ │ └── VisibilityState.cs │ ├── EventTarget.Convert.cs │ ├── EventTarget.DispatchEvent.cs │ ├── EventTarget.cs │ ├── Events │ │ ├── ClipboardEvent.cs │ │ ├── DragEvent.cs │ │ ├── Event.cs │ │ ├── FocusEvent.cs │ │ ├── KeyboardEvent.cs │ │ ├── MouseEvent.cs │ │ ├── PointerEvent.cs │ │ ├── UIEvent.cs │ │ └── WheelEvent.cs │ ├── ExportAttribute.cs │ ├── Extensions.cs │ ├── HTMLAnchorElement.cs │ ├── HTMLAppletElement.cs │ ├── HTMLAreaElement.cs │ ├── HTMLAreasCollection.cs │ ├── HTMLBRElement.cs │ ├── HTMLBaseElement.cs │ ├── HTMLBaseFontElement.cs │ ├── HTMLBodyElement.cs │ ├── HTMLButtonElement.cs │ ├── HTMLCollection.cs │ ├── HTMLCollectionOf.cs │ ├── HTMLDListElement.cs │ ├── HTMLDataElement.cs │ ├── HTMLDataListElement.cs │ ├── HTMLDirectoryElement.cs │ ├── HTMLDivElement.cs │ ├── HTMLElement.cs │ ├── HTMLEmbedElement.cs │ ├── HTMLFieldSetElement.cs │ ├── HTMLFontElement.cs │ ├── HTMLFormControlsCollection.cs │ ├── HTMLFormElement.cs │ ├── HTMLFrameElement.cs │ ├── HTMLFrameSetElement.cs │ ├── HTMLHRElement.cs │ ├── HTMLHeadElement.cs │ ├── HTMLHeadingElement.cs │ ├── HTMLHtmlElement.cs │ ├── HTMLIFrameElement.cs │ ├── HTMLImageElement.cs │ ├── HTMLInputElement.cs │ ├── HTMLLIElement.cs │ ├── HTMLLabelElement.cs │ ├── HTMLLegendElement.cs │ ├── HTMLLinkElement.cs │ ├── HTMLMapElement.cs │ ├── HTMLMarqueeElement.cs │ ├── HTMLMenuElement.cs │ ├── HTMLMetaElement.cs │ ├── HTMLMeterElement.cs │ ├── HTMLModElement.cs │ ├── HTMLOListElement.cs │ ├── HTMLObjectElement.cs │ ├── HTMLOptGroupElement.cs │ ├── HTMLOptionElement.cs │ ├── HTMLOptionsCollection.cs │ ├── HTMLOutputElement.cs │ ├── HTMLPage.cs │ ├── HTMLParagraphElement.cs │ ├── HTMLParamElement.cs │ ├── HTMLPictureElement.cs │ ├── HTMLPreElement.cs │ ├── HTMLProgressElement.cs │ ├── HTMLQuoteElement.cs │ ├── HTMLScriptElement.cs │ ├── HTMLSelectElement.cs │ ├── HTMLSourceElement.cs │ ├── HTMLSpanElement.cs │ ├── HTMLStyleElement.cs │ ├── HTMLTableCaptionElement.cs │ ├── HTMLTableCellElement.cs │ ├── HTMLTableColElement.cs │ ├── HTMLTableDataCellElement.cs │ ├── HTMLTableElement.cs │ ├── HTMLTableHeaderCellElement.cs │ ├── HTMLTableRowElement.cs │ ├── HTMLTableSectionElement.cs │ ├── HTMLTemplateElement.cs │ ├── HTMLTextAreaElement.cs │ ├── HTMLTimeElement.cs │ ├── HTMLTitleElement.cs │ ├── HTMLTrackElement.cs │ ├── HTMLUListElement.cs │ ├── HTMLUnknownElement.cs │ ├── History.cs │ ├── Interfaces.cs │ ├── JSObject.cs │ ├── Location.cs │ ├── NamedNodeMap.cs │ ├── Node.cs │ ├── NodeList.cs │ ├── NodeListOf.cs │ ├── Performance.cs │ ├── PerformanceNavigation.cs │ ├── PerformanceTiming.cs │ ├── Strings.cs │ ├── StyleSheet.cs │ ├── Text.cs │ ├── URL.cs │ ├── URLSearchParams.cs │ ├── ValidityState.cs │ ├── WebKitPoint.cs │ └── Window.cs │ ├── GlobalSuppressions.cs │ ├── MiniJSON.cs │ ├── Mono.WebAssembly.Browser.csproj │ ├── Runtime.cs │ ├── RuntimeEventManager.cs │ └── RuntimeUtilities.cs └── tests ├── Blazor.Extensions.MergeStyles.Tests ├── BaseTest.cs ├── Blazor.Extensions.MergeStyles.Tests.csproj ├── CssValueTest.cs ├── Extensions │ └── CollectionAssertExtensions.cs ├── GlobalSuppressions.cs ├── JSRuntimeFake.cs ├── KeyframesTest.cs ├── MergeStyleSetsTest.cs ├── MergeStylesTest.cs ├── ServerTest.cs ├── StyleEngineTest.cs ├── StyleSetFake.cs ├── StyleTest.cs ├── StylesheetTest.cs ├── StylesheetUtilTest.cs └── Transformations │ ├── KebabRulesTest.cs │ ├── PrefixRulesTest.cs │ ├── ProvideUnitsTest.cs │ ├── RtlifyRulesTests.cs │ └── rtlfyrulesdata.json └── Blazor.OfficeUiFabric.Styling.Tests ├── Blazor.OfficeUiFabric.Styling.Tests.csproj ├── Fonts └── FontEngineTest.cs ├── Resources └── font-en.json └── ThemingEngineTest.cs /Directory.Build.targets: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(Version). Commit Hash: $(GitHeadSha) 5 | 6 | 7 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Blazor Extensions 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Blazor Extensions 2 | Blazor Extensions is a set of packages with the goal of adding useful features to Blazor. 3 | 4 | # Blazor.Extensions.OfficeUiFabric 5 | Microsoft Office Fabric UI port for Blazor 6 | 7 | # Contributors 8 | 9 | The following people are the maintainers of the Blazor Extensions projects: 10 | 11 | - [Daniel Meza](https://github.com/danielmeza) 12 | -------------------------------------------------------------------------------- /samples/Blazor.OfficeUiFabric.Samples.Client/App.cshtml: -------------------------------------------------------------------------------- 1 |  5 | 6 | -------------------------------------------------------------------------------- /samples/Blazor.OfficeUiFabric.Samples.Client/Blazor.OfficeUiFabric.Samples.Client.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0 5 | Exe 6 | 7.3 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /samples/Blazor.OfficeUiFabric.Samples.Client/Pages/Counter.cshtml: -------------------------------------------------------------------------------- 1 | @page "/counter" 2 | 3 |

Counter

4 | 5 |

Current count: @currentCount

6 | 7 | 8 | 9 | @functions { 10 | int currentCount = 0; 11 | 12 | void IncrementCount() 13 | { 14 | currentCount++; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /samples/Blazor.OfficeUiFabric.Samples.Client/Pages/FetchData.cshtml: -------------------------------------------------------------------------------- 1 | @using Blazor.OfficeUiFabric.Samples.Shared 2 | @page "/fetchdata" 3 | @inject HttpClient Http 4 | 5 |

Weather forecast

6 | 7 |

This component demonstrates fetching data from the server.

8 | 9 | @if (forecasts == null) 10 | { 11 |

Loading...

12 | } 13 | else 14 | { 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | @foreach (var forecast in forecasts) 26 | { 27 | 28 | 29 | 30 | 31 | 32 | 33 | } 34 | 35 |
DateTemp. (C)Temp. (F)Summary
@forecast.Date.ToShortDateString()@forecast.TemperatureC@forecast.TemperatureF@forecast.Summary
36 | } 37 | 38 | @functions { 39 | WeatherForecast[] forecasts; 40 | 41 | protected override async Task OnInitAsync() 42 | { 43 | forecasts = await Http.GetJsonAsync("api/SampleData/WeatherForecasts"); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /samples/Blazor.OfficeUiFabric.Samples.Client/Pages/Index.cshtml: -------------------------------------------------------------------------------- 1 | @page "/" 2 | 3 |

Hello, world!

4 | 5 | Welcome to your new app. 6 | 7 | 8 | 9 | 10 | 11 | @functions { 12 | void addButton() 13 | { 14 | 15 | 16 | } 17 | } -------------------------------------------------------------------------------- /samples/Blazor.OfficeUiFabric.Samples.Client/Pages/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @layout MainLayout 2 | -------------------------------------------------------------------------------- /samples/Blazor.OfficeUiFabric.Samples.Client/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Blazor.Hosting; 2 | using Microsoft.JSInterop; 3 | using Mono.WebAssembly.Browser.DOM; 4 | using System; 5 | using System.Threading; 6 | using System.Threading.Tasks; 7 | 8 | namespace Blazor.OfficeUiFabric.Samples.Client 9 | { 10 | public class Program 11 | { 12 | public static void Main(string[] args) 13 | { 14 | 15 | 16 | CreateHostBuilder(args).Build().Run(); 17 | 18 | } 19 | 20 | 21 | 22 | public static IWebAssemblyHostBuilder CreateHostBuilder(string[] args) => 23 | BlazorWebAssemblyHost.CreateDefaultBuilder() 24 | .UseBlazorStartup(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /samples/Blazor.OfficeUiFabric.Samples.Client/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:3709/", 7 | "sslPort": 0 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "Blazor.OfficeUiFabric.Samples.Client": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "environmentVariables": { 22 | "ASPNETCORE_ENVIRONMENT": "Development" 23 | }, 24 | "applicationUrl": "http://localhost:3710/" 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /samples/Blazor.OfficeUiFabric.Samples.Client/Shared/MainLayout.cshtml: -------------------------------------------------------------------------------- 1 | @inherits BlazorLayoutComponent 2 | 3 | 6 | 7 |
8 |
9 | About 10 |
11 | 12 |
13 | @Body 14 |
15 |
16 | -------------------------------------------------------------------------------- /samples/Blazor.OfficeUiFabric.Samples.Client/Shared/NavMenu.cshtml: -------------------------------------------------------------------------------- 1 |  7 | 8 |
9 | 26 |
27 | 28 | @functions { 29 | bool collapseNavMenu = true; 30 | 31 | void ToggleNavMenu() 32 | { 33 | collapseNavMenu = !collapseNavMenu; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /samples/Blazor.OfficeUiFabric.Samples.Client/Shared/SurveyPrompt.cshtml: -------------------------------------------------------------------------------- 1 |  11 | 12 | @functions { 13 | [Parameter] 14 | string Title { get; set; } // Demonstrates how a parent component can supply parameters 15 | } 16 | -------------------------------------------------------------------------------- /samples/Blazor.OfficeUiFabric.Samples.Client/Startup.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Blazor.Builder; 2 | using Microsoft.Extensions.DependencyInjection; 3 | 4 | namespace Blazor.OfficeUiFabric.Samples.Client 5 | { 6 | public class Startup 7 | { 8 | public void ConfigureServices(IServiceCollection services) 9 | { 10 | } 11 | 12 | public void Configure(IBlazorApplicationBuilder app) 13 | { 14 | app.AddComponent("app"); 15 | 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /samples/Blazor.OfficeUiFabric.Samples.Client/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using Microsoft.AspNetCore.Blazor.Layouts 3 | @using Microsoft.AspNetCore.Blazor.Routing 4 | @using Microsoft.JSInterop 5 | @using Blazor.OfficeUiFabric.Samples.Client 6 | @using Blazor.OfficeUiFabric.Samples.Client.Shared 7 | @using Mono.WebAssembly.Browser.DOM -------------------------------------------------------------------------------- /samples/Blazor.OfficeUiFabric.Samples.Client/wwwroot/css/open-iconic/ICON-LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Waybury 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /samples/Blazor.OfficeUiFabric.Samples.Client/wwwroot/css/open-iconic/font/fonts/open-iconic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlazorExtensions/BlazorOfficeUIFabric/fdfa5aa0323ecaf609d7cab556f99c517ddf38bb/samples/Blazor.OfficeUiFabric.Samples.Client/wwwroot/css/open-iconic/font/fonts/open-iconic.eot -------------------------------------------------------------------------------- /samples/Blazor.OfficeUiFabric.Samples.Client/wwwroot/css/open-iconic/font/fonts/open-iconic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlazorExtensions/BlazorOfficeUIFabric/fdfa5aa0323ecaf609d7cab556f99c517ddf38bb/samples/Blazor.OfficeUiFabric.Samples.Client/wwwroot/css/open-iconic/font/fonts/open-iconic.otf -------------------------------------------------------------------------------- /samples/Blazor.OfficeUiFabric.Samples.Client/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlazorExtensions/BlazorOfficeUIFabric/fdfa5aa0323ecaf609d7cab556f99c517ddf38bb/samples/Blazor.OfficeUiFabric.Samples.Client/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf -------------------------------------------------------------------------------- /samples/Blazor.OfficeUiFabric.Samples.Client/wwwroot/css/open-iconic/font/fonts/open-iconic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlazorExtensions/BlazorOfficeUIFabric/fdfa5aa0323ecaf609d7cab556f99c517ddf38bb/samples/Blazor.OfficeUiFabric.Samples.Client/wwwroot/css/open-iconic/font/fonts/open-iconic.woff -------------------------------------------------------------------------------- /samples/Blazor.OfficeUiFabric.Samples.Client/wwwroot/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Blazor.OfficeUiFabric.Samples 7 | 8 | 9 | 10 | 11 | 12 | Loading... 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /samples/Blazor.OfficeUiFabric.Samples.Server/Blazor.OfficeUiFabric.Samples.Server.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.1 5 | 7.3 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /samples/Blazor.OfficeUiFabric.Samples.Server/Controllers/SampleDataController.cs: -------------------------------------------------------------------------------- 1 | using Blazor.OfficeUiFabric.Samples.Shared; 2 | using Microsoft.AspNetCore.Mvc; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Threading.Tasks; 7 | 8 | namespace Blazor.OfficeUiFabric.Samples.Server.Controllers 9 | { 10 | [Route("api/[controller]")] 11 | public class SampleDataController : Controller 12 | { 13 | private static string[] Summaries = new[] 14 | { 15 | "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" 16 | }; 17 | 18 | [HttpGet("[action]")] 19 | public IEnumerable WeatherForecasts() 20 | { 21 | var rng = new Random(); 22 | return Enumerable.Range(1, 5).Select(index => new WeatherForecast 23 | { 24 | Date = DateTime.Now.AddDays(index), 25 | TemperatureC = rng.Next(-20, 55), 26 | Summary = Summaries[rng.Next(Summaries.Length)] 27 | }); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /samples/Blazor.OfficeUiFabric.Samples.Server/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore; 2 | using Microsoft.AspNetCore.Hosting; 3 | using Microsoft.Extensions.Configuration; 4 | 5 | namespace Blazor.OfficeUiFabric.Samples.Server 6 | { 7 | public class Program 8 | { 9 | public static void Main(string[] args) 10 | { 11 | BuildWebHost(args).Run(); 12 | } 13 | 14 | public static IWebHost BuildWebHost(string[] args) => 15 | WebHost.CreateDefaultBuilder(args) 16 | .UseConfiguration(new ConfigurationBuilder() 17 | .AddCommandLine(args) 18 | .Build()) 19 | .UseStartup() 20 | .Build(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /samples/Blazor.OfficeUiFabric.Samples.Server/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:3707/", 7 | "sslPort": 0 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "Blazor.OfficeUiFabric.Samples.Server": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "environmentVariables": { 22 | "ASPNETCORE_ENVIRONMENT": "Development" 23 | }, 24 | "applicationUrl": "http://localhost:3708/" 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /samples/Blazor.OfficeUiFabric.Samples.Shared/Blazor.OfficeUiFabric.Samples.Shared.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | 7.3 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /samples/Blazor.OfficeUiFabric.Samples.Shared/WeatherForecast.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Blazor.OfficeUiFabric.Samples.Shared 6 | { 7 | public class WeatherForecast 8 | { 9 | public DateTime Date { get; set; } 10 | public int TemperatureC { get; set; } 11 | public string Summary { get; set; } 12 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /samples/CreateElement/.gitignore: -------------------------------------------------------------------------------- 1 | bin 2 | obj 3 | managed 4 | publish -------------------------------------------------------------------------------- /samples/CreateElement/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Mono.WebAssembly.Browser.DOM; 3 | 4 | namespace CreateElement 5 | { 6 | class MainClass 7 | { 8 | public static void Main(string[] args) 9 | { 10 | var document = new Document(); 11 | 12 | // Create a new div element 13 | var newDiv = document.CreateElement(); 14 | 15 | // and give it some content 16 | var newContent = document.CreateTextNode("Hi there and greetings!"); 17 | 18 | // add the text node to the newly created div 19 | newDiv.AppendChild(newContent); 20 | 21 | // add the newly created element and its content into the DOM 22 | var currentDiv = document.GetElementById("div1"); 23 | 24 | document.Body.InsertBefore(newDiv, currentDiv); 25 | 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /samples/CreateElement/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | 4 | // Information about this assembly is defined by the following attributes. 5 | // Change them to the values specific to your project. 6 | 7 | [assembly: AssemblyTitle("CreateElement")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("")] 12 | [assembly: AssemblyCopyright("${AuthorCopyright}")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". 17 | // The form "{Major}.{Minor}.*" will automatically update the build and revision, 18 | // and "{Major}.{Minor}.{Build}.*" will update just the revision. 19 | 20 | [assembly: AssemblyVersion("1.0.*")] 21 | 22 | // The following attributes are used to specify the signing key for the assembly, 23 | // if desired. See the Mono documentation for more information about signing. 24 | 25 | //[assembly: AssemblyDelaySign(false)] 26 | //[assembly: AssemblyKeyFile("")] 27 | -------------------------------------------------------------------------------- /samples/CreateElement/README.md: -------------------------------------------------------------------------------- 1 | # CreateElement 2 | 3 | This creates a new
and inserts it before the element with the ID "div1". 4 | 5 | ## Features 6 | 7 | - Use of `CreateElement` 8 | - Use of `CreateTextNode` 9 | - Use of `AppendChild` and `InsertBefore` 10 | 11 | ## Prerequisits 12 | 13 | A built `Mono.WebAssembly.DOM` assembly. 14 | 15 | ## Building 16 | 17 | Right now the following targets are available: 18 | 19 | - build: Sets up the libraries, copies the binaries required from the dom-wasm directory and then builds the sample CreateElement. 20 | - clean: Cleans up the libraries so that the build will rebuild all targets. 21 | 22 | ``` 23 | $ make build 24 | ``` 25 | 26 | When the sample code is finished building all the required code to run the sample is made available in the `publish` directory. 27 | 28 | Once that's done, Start a web server from the `publish` directory: 29 | 30 | ``` 31 | publish$ python -m SimpleHTTPServer 32 | ``` 33 | 34 | Unfortunately, the above http server doesn't give wasm binaries the right mime type, which disables WebAssembly stream compilation. 35 | The included `server.py` script from the `wasm` directory solves this and can be used instead. 36 | 37 | ``` 38 | publish$ python server.py 39 | ``` 40 | 41 | 42 | Go to `locahost:8000/index.html` and it should work. 43 | 44 | 45 | -------------------------------------------------------------------------------- /samples/CreateElement/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ||Working with elements|| 5 | 6 | 7 |
The text above has been created dynamically.
8 | 9 | 10 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /samples/DOMElement/.gitignore: -------------------------------------------------------------------------------- 1 | bin 2 | obj 3 | managed 4 | publish -------------------------------------------------------------------------------- /samples/DOMElement/DOMElement.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DOMElement 4 | { 5 | public class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | var watch = System.Diagnostics.Stopwatch.StartNew(); 10 | 11 | var domInfo = new ElementTinkerer(); 12 | 13 | domInfo.Invoke(null); 14 | 15 | watch.Stop(); 16 | var elapsedMs = watch.ElapsedMilliseconds; 17 | System.Console.WriteLine($"elapsedMs: {elapsedMs}"); 18 | 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /samples/DOMElement/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | 4 | // Information about this assembly is defined by the following attributes. 5 | // Change them to the values specific to your project. 6 | 7 | [assembly: AssemblyTitle("Hello")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("")] 12 | [assembly: AssemblyCopyright("${AuthorCopyright}")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". 17 | // The form "{Major}.{Minor}.*" will automatically update the build and revision, 18 | // and "{Major}.{Minor}.{Build}.*" will update just the revision. 19 | 20 | [assembly: AssemblyVersion("1.0.*")] 21 | 22 | // The following attributes are used to specify the signing key for the assembly, 23 | // if desired. See the Mono documentation for more information about signing. 24 | 25 | //[assembly: AssemblyDelaySign(false)] 26 | //[assembly: AssemblyKeyFile("")] 27 | -------------------------------------------------------------------------------- /samples/DOMElement/sections/section1.html: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /samples/DOMElement/sections/section2.html: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /samples/DOMTree/.gitignore: -------------------------------------------------------------------------------- 1 | bin 2 | obj 3 | managed 4 | publish -------------------------------------------------------------------------------- /samples/DOMTree/DOMTree.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DOMTree 4 | { 5 | public class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | var watch = System.Diagnostics.Stopwatch.StartNew(); 10 | 11 | var domInfo = new DOMInfo(); 12 | 13 | domInfo.Invoke(null); 14 | 15 | watch.Stop(); 16 | var elapsedMs = watch.ElapsedMilliseconds; 17 | System.Console.WriteLine($"elapsedMs: {elapsedMs}"); 18 | 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /samples/DOMTree/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | 4 | // Information about this assembly is defined by the following attributes. 5 | // Change them to the values specific to your project. 6 | 7 | [assembly: AssemblyTitle("Hello")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("")] 12 | [assembly: AssemblyCopyright("${AuthorCopyright}")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". 17 | // The form "{Major}.{Minor}.*" will automatically update the build and revision, 18 | // and "{Major}.{Minor}.{Build}.*" will update just the revision. 19 | 20 | [assembly: AssemblyVersion("1.0.*")] 21 | 22 | // The following attributes are used to specify the signing key for the assembly, 23 | // if desired. See the Mono documentation for more information about signing. 24 | 25 | //[assembly: AssemblyDelaySign(false)] 26 | //[assembly: AssemblyKeyFile("")] 27 | -------------------------------------------------------------------------------- /samples/DOMTree/README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | # HTMLDocument DOM Traversal 5 | 6 | Shows the traversal of the page DOM document. 7 | 8 | The output can be seen from the Developer Tools console. 9 | 10 | ## Prerequisits 11 | 12 | A built `Mono.WebAssembly.DOM` assembly. 13 | 14 | ## Building 15 | 16 | Right now the following targets are available: 17 | 18 | - build: Sets up the libraries, copies the binaries required and then builds the sample DOMTree sources. 19 | - clean: Cleans up the libraries so that the build will rebuild all targets. 20 | 21 | ``` 22 | $ make build 23 | ``` 24 | 25 | When the sample code is finished building all the required code to run the sample is made available in the `publish` directory. 26 | 27 | Once that's done, Start a web server from the `publish` directory: 28 | 29 | ``` 30 | publish$ python -m SimpleHTTPServer 31 | ``` 32 | 33 | Unfortunately, the above http server doesn't give wasm binaries the right mime type, which disables WebAssembly stream compilation. 34 | The included `server.py` script from the `wasm` directory solves this and can be used instead. 35 | 36 | ``` 37 | publish$ python server.py 38 | ``` 39 | 40 | 41 | Go to `locahost:8000/index.html` and it should work. 42 | -------------------------------------------------------------------------------- /samples/DOMTree/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | DOMTree 6 | 17 | 18 | 19 |

DOMTree

20 | 21 | This is the DOMTree Example. (See developer console for output.) 22 | 23 | 24 | 25 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /samples/DragNDrop/.gitignore: -------------------------------------------------------------------------------- 1 | bin 2 | obj 3 | managed 4 | publish -------------------------------------------------------------------------------- /samples/DragNDrop/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DragNDrop 4 | { 5 | class MainClass 6 | { 7 | public static void Main(string[] args) 8 | { 9 | var dragger = new Dragger(); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /samples/DragNDrop/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | 4 | // Information about this assembly is defined by the following attributes. 5 | // Change them to the values specific to your project. 6 | 7 | [assembly: AssemblyTitle("DragNDrop")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("")] 12 | [assembly: AssemblyCopyright("${AuthorCopyright}")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". 17 | // The form "{Major}.{Minor}.*" will automatically update the build and revision, 18 | // and "{Major}.{Minor}.{Build}.*" will update just the revision. 19 | 20 | [assembly: AssemblyVersion("1.0.*")] 21 | 22 | // The following attributes are used to specify the signing key for the assembly, 23 | // if desired. See the Mono documentation for more information about signing. 24 | 25 | //[assembly: AssemblyDelaySign(false)] 26 | //[assembly: AssemblyKeyFile("")] 27 | -------------------------------------------------------------------------------- /samples/DragNDrop/README.md: -------------------------------------------------------------------------------- 1 | # CreateElement 2 | 3 | This creates a new
and inserts it before the element with the ID "div1". 4 | 5 | ## Features 6 | 7 | - Use of `CreateElement` 8 | - Use of `CreateTextNode` 9 | - Use of `AppendChild` and `InsertBefore` 10 | 11 | ## Prerequisits 12 | 13 | A built `Mono.WebAssembly.DOM` assembly. 14 | 15 | ## Building 16 | 17 | Right now the following targets are available: 18 | 19 | - build: Sets up the libraries, copies the binaries required from the dom-wasm directory and then builds the sample CreateElement. 20 | - clean: Cleans up the libraries so that the build will rebuild all targets. 21 | 22 | ``` 23 | $ make build 24 | ``` 25 | 26 | When the sample code is finished building all the required code to run the sample is made available in the `publish` directory. 27 | 28 | Once that's done, Start a web server from the `publish` directory: 29 | 30 | ``` 31 | publish$ python -m SimpleHTTPServer 32 | ``` 33 | 34 | Unfortunately, the above http server doesn't give wasm binaries the right mime type, which disables WebAssembly stream compilation. 35 | The included `server.py` script from the `wasm` directory solves this and can be used instead. 36 | 37 | ``` 38 | publish$ python server.py 39 | ``` 40 | 41 | 42 | Go to `locahost:8000/index.html` and it should work. 43 | 44 | 45 | -------------------------------------------------------------------------------- /samples/Forms/.gitignore: -------------------------------------------------------------------------------- 1 | bin 2 | obj 3 | managed 4 | publish -------------------------------------------------------------------------------- /samples/Forms/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Mono.WebAssembly.Browser.DOM; 3 | 4 | namespace Forms 5 | { 6 | class MainClass 7 | { 8 | public static void Main(string[] args) 9 | { 10 | 11 | // Get a reference to the body element. 12 | var document = HTMLPage.Document; 13 | 14 | // Hide the loading label 15 | document.GetElementById("loading").Remove(); 16 | 17 | // For cross browser support we can not use HTMLLinkElement Import 18 | // so the divs are within the code itself. 19 | LinkImports.Imports(document); 20 | 21 | Nav.Initialize(document); 22 | DemoButtons.Initialize(document); 23 | 24 | } 25 | 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /samples/Forms/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | 4 | // Information about this assembly is defined by the following attributes. 5 | // Change them to the values specific to your project. 6 | 7 | [assembly: AssemblyTitle("Forms")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("")] 12 | [assembly: AssemblyCopyright("${AuthorCopyright}")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". 17 | // The form "{Major}.{Minor}.*" will automatically update the build and revision, 18 | // and "{Major}.{Minor}.{Build}.*" will update just the revision. 19 | 20 | [assembly: AssemblyVersion("1.0.*")] 21 | 22 | // The following attributes are used to specify the signing key for the assembly, 23 | // if desired. See the Mono documentation for more information about signing. 24 | 25 | //[assembly: AssemblyDelaySign(false)] 26 | //[assembly: AssemblyKeyFile("")] 27 | -------------------------------------------------------------------------------- /samples/Forms/README.md: -------------------------------------------------------------------------------- 1 | # Forms API Demo 2 | 3 | This is a web app with sample code to demonstrate the DOM HTMLFormElement interface through C#. 4 | 5 | The main rendering is controlled by C# code and the only JavaScript used in the application is for loading the Mono WASM Runtime. 6 | 7 | ## Prerequisits 8 | 9 | A built `Mono.WebAssembly.DOM` assembly. 10 | 11 | ## Building 12 | 13 | Right now the following targets are available: 14 | 15 | - build: Sets up the libraries, copies the binaries required from the wasm-dom directory and then builds the sample Forms. 16 | - clean: Cleans up the libraries so that the build will rebuild all targets. 17 | 18 | ``` 19 | $ make build 20 | ``` 21 | 22 | When the sample code is finished building all the required code to run the sample is made available in the `publish` directory. 23 | 24 | Once that's done, Start a web server from the `publish` directory: 25 | 26 | ``` 27 | publish$ python -m SimpleHTTPServer 28 | ``` 29 | 30 | Unfortunately, the above http server doesn't give wasm binaries the right mime type, which disables WebAssembly stream compilation. 31 | The included `server.py` script from the `publish` directory solves this and can be used instead. 32 | 33 | ``` 34 | publish$ python server.py 35 | ``` 36 | 37 | 38 | Go to `locahost:8000/index.html` and it should work. 39 | 40 | 41 | -------------------------------------------------------------------------------- /samples/Forms/assets/css/fonts/SourceCodePro-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlazorExtensions/BlazorOfficeUIFabric/fdfa5aa0323ecaf609d7cab556f99c517ddf38bb/samples/Forms/assets/css/fonts/SourceCodePro-Regular.ttf -------------------------------------------------------------------------------- /samples/Forms/assets/css/fonts/SourceSansPro-Black.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlazorExtensions/BlazorOfficeUIFabric/fdfa5aa0323ecaf609d7cab556f99c517ddf38bb/samples/Forms/assets/css/fonts/SourceSansPro-Black.otf -------------------------------------------------------------------------------- /samples/Forms/assets/css/fonts/SourceSansPro-BlackIt.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlazorExtensions/BlazorOfficeUIFabric/fdfa5aa0323ecaf609d7cab556f99c517ddf38bb/samples/Forms/assets/css/fonts/SourceSansPro-BlackIt.otf -------------------------------------------------------------------------------- /samples/Forms/assets/css/fonts/SourceSansPro-Bold.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlazorExtensions/BlazorOfficeUIFabric/fdfa5aa0323ecaf609d7cab556f99c517ddf38bb/samples/Forms/assets/css/fonts/SourceSansPro-Bold.otf -------------------------------------------------------------------------------- /samples/Forms/assets/css/fonts/SourceSansPro-BoldIt.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlazorExtensions/BlazorOfficeUIFabric/fdfa5aa0323ecaf609d7cab556f99c517ddf38bb/samples/Forms/assets/css/fonts/SourceSansPro-BoldIt.otf -------------------------------------------------------------------------------- /samples/Forms/assets/css/fonts/SourceSansPro-ExtraLight.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlazorExtensions/BlazorOfficeUIFabric/fdfa5aa0323ecaf609d7cab556f99c517ddf38bb/samples/Forms/assets/css/fonts/SourceSansPro-ExtraLight.otf -------------------------------------------------------------------------------- /samples/Forms/assets/css/fonts/SourceSansPro-ExtraLightIt.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlazorExtensions/BlazorOfficeUIFabric/fdfa5aa0323ecaf609d7cab556f99c517ddf38bb/samples/Forms/assets/css/fonts/SourceSansPro-ExtraLightIt.otf -------------------------------------------------------------------------------- /samples/Forms/assets/css/fonts/SourceSansPro-It.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlazorExtensions/BlazorOfficeUIFabric/fdfa5aa0323ecaf609d7cab556f99c517ddf38bb/samples/Forms/assets/css/fonts/SourceSansPro-It.otf -------------------------------------------------------------------------------- /samples/Forms/assets/css/fonts/SourceSansPro-Light.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlazorExtensions/BlazorOfficeUIFabric/fdfa5aa0323ecaf609d7cab556f99c517ddf38bb/samples/Forms/assets/css/fonts/SourceSansPro-Light.otf -------------------------------------------------------------------------------- /samples/Forms/assets/css/fonts/SourceSansPro-LightIt.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlazorExtensions/BlazorOfficeUIFabric/fdfa5aa0323ecaf609d7cab556f99c517ddf38bb/samples/Forms/assets/css/fonts/SourceSansPro-LightIt.otf -------------------------------------------------------------------------------- /samples/Forms/assets/css/fonts/SourceSansPro-Regular.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlazorExtensions/BlazorOfficeUIFabric/fdfa5aa0323ecaf609d7cab556f99c517ddf38bb/samples/Forms/assets/css/fonts/SourceSansPro-Regular.otf -------------------------------------------------------------------------------- /samples/Forms/assets/css/fonts/SourceSansPro-Semibold.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlazorExtensions/BlazorOfficeUIFabric/fdfa5aa0323ecaf609d7cab556f99c517ddf38bb/samples/Forms/assets/css/fonts/SourceSansPro-Semibold.otf -------------------------------------------------------------------------------- /samples/Forms/assets/css/fonts/SourceSansPro-SemiboldIt.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlazorExtensions/BlazorOfficeUIFabric/fdfa5aa0323ecaf609d7cab556f99c517ddf38bb/samples/Forms/assets/css/fonts/SourceSansPro-SemiboldIt.otf -------------------------------------------------------------------------------- /samples/Forms/assets/css/nativize.css: -------------------------------------------------------------------------------- 1 | /* 2 | ** nativize.css 3 | ** Makes the UI feel more native 4 | */ 5 | 6 | html { 7 | font-family: sans-serif; 8 | -webkit-user-select: none; /* disable selection */ 9 | -webkit-user-drag: none; /* disable dragging */ 10 | cursor: default; /* use default cursor */ 11 | } 12 | 13 | body { 14 | margin: 0; /* remove default margin */ 15 | } 16 | 17 | 18 | /* enable text selection */ 19 | 20 | .is-selectable, 21 | pre, 22 | code { 23 | -webkit-user-select: auto; 24 | cursor: auto; 25 | } 26 | 27 | 28 | /* Buttons and links */ 29 | 30 | button{ 31 | cursor: default; 32 | } 33 | 34 | /* Internal links */ 35 | a { 36 | cursor: pointer; 37 | text-decoration: none; 38 | border-bottom: 1px dashed; 39 | outline: none; 40 | } 41 | 42 | /* New window (target) + external links */ 43 | a[target], 44 | a[href^="https://"], 45 | a[href^="http://"] { 46 | border-bottom: 1px solid; 47 | } 48 | 49 | a:hover, 50 | a:focus { 51 | border-bottom: none; 52 | } 53 | 54 | 55 | /* Images */ 56 | 57 | img { 58 | -webkit-user-drag: none; /* disable dragging */ 59 | } 60 | -------------------------------------------------------------------------------- /samples/Forms/assets/css/section.css: -------------------------------------------------------------------------------- 1 | /* Section ------------------ */ 2 | 3 | .section { 4 | position: absolute; 5 | top: 0; 6 | left: 0; 7 | right: 0; 8 | bottom: 0; 9 | overflow-x: hidden; 10 | overflow-y: auto; 11 | color: var(--color-accent); 12 | 13 | /* Hide */ 14 | pointer-events: none; 15 | visibility: hidden; 16 | opacity: 0; 17 | transform: translateX(-20px); 18 | transition: visibility 0s .12s linear , opacity .12s ease-in, transform .12s ease-in; 19 | } 20 | .section.is-shown { 21 | pointer-events: auto; 22 | visibility: visible; 23 | opacity: 1; 24 | transform: translateX(0); 25 | transition: visibility 0s 0s linear , opacity .36s ease-out, transform .36s ease-out; 26 | } 27 | 28 | .section h3, 29 | .section p { 30 | color: var(--color); 31 | } 32 | 33 | .section-wrapper { 34 | position: relative; 35 | max-width: 740px; 36 | margin: 0 auto; 37 | padding: 2rem 2rem 1rem 2rem; 38 | border-bottom: 1px solid var(--color-border); 39 | } 40 | @media (min-width: 940px) { 41 | .section-wrapper { 42 | padding-top: 4rem; 43 | } 44 | } 45 | 46 | .section-icon { 47 | width: 32px; 48 | height: 32px; 49 | vertical-align: middle; 50 | margin-right: .5em; 51 | } 52 | -------------------------------------------------------------------------------- /samples/Forms/assets/css/variables.css: -------------------------------------------------------------------------------- 1 | 2 | /* Custom Properties */ 3 | 4 | :root { 5 | --color: hsl(0,0%,22%); 6 | --color-subtle: hsl(0,0%,44%); 7 | --color-strong: hsl(0,0%,11%); 8 | --color-link: hsl(0,0%,22%); 9 | 10 | --color-border: hsl(0,0%,88%); 11 | --color-bg: hsl(0,0%,96%); 12 | 13 | --color-accent: black; /* Fallback */ 14 | } 15 | 16 | 17 | /* Category Colors */ 18 | 19 | .u-category-windows { --color-accent: hsl(116, 30%, 36%); } 20 | .u-category-menu { --color-accent: hsl(194, 60%, 36%); } 21 | .u-category-native-ui { --color-accent: hsl(222, 53%, 50%); } 22 | .u-category-communication { --color-accent: hsl(285, 47%, 46%); } 23 | .u-category-system { --color-accent: hsl(330, 65%, 48%); } 24 | .u-category-media { --color-accent: hsl( 36, 77%, 34%); } 25 | .u-category-first-form { --color-accent: hsl(116, 30%, 36%); } 26 | -------------------------------------------------------------------------------- /samples/Forms/assets/img/loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlazorExtensions/BlazorOfficeUIFabric/fdfa5aa0323ecaf609d7cab556f99c517ddf38bb/samples/Forms/assets/img/loader.gif -------------------------------------------------------------------------------- /samples/Hello/.gitignore: -------------------------------------------------------------------------------- 1 | bin 2 | obj 3 | managed 4 | publish -------------------------------------------------------------------------------- /samples/Hello/Hello.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | using Mono.WebAssembly.Browser.DOM; 4 | 5 | 6 | namespace Hello 7 | { 8 | public class Program 9 | { 10 | static void Main(string[] args) 11 | { 12 | var watch = System.Diagnostics.Stopwatch.StartNew(); 13 | 14 | System.Console.WriteLine("hello world from Invoke!"); 15 | 16 | var window = HTMLPage.Window; 17 | System.Console.WriteLine($"window = {window}"); 18 | 19 | if (args != null) 20 | window.Alert(args); 21 | 22 | watch.Stop(); 23 | var elapsedMs = watch.ElapsedMilliseconds; 24 | System.Console.WriteLine($"elapsedMs: {elapsedMs}"); 25 | 26 | } 27 | 28 | 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /samples/Hello/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | 4 | // Information about this assembly is defined by the following attributes. 5 | // Change them to the values specific to your project. 6 | 7 | [assembly: AssemblyTitle("Hello")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("")] 12 | [assembly: AssemblyCopyright("${AuthorCopyright}")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". 17 | // The form "{Major}.{Minor}.*" will automatically update the build and revision, 18 | // and "{Major}.{Minor}.{Build}.*" will update just the revision. 19 | 20 | [assembly: AssemblyVersion("1.0.*")] 21 | 22 | // The following attributes are used to specify the signing key for the assembly, 23 | // if desired. See the Mono documentation for more information about signing. 24 | 25 | //[assembly: AssemblyDelaySign(false)] 26 | //[assembly: AssemblyKeyFile("")] 27 | -------------------------------------------------------------------------------- /samples/Hello/README.md: -------------------------------------------------------------------------------- 1 | # Hello 2 | 3 | This is a very simple test that uses the `Window.Alert()` to display an alert message. 4 | 5 | `Window.Prompt` and `Window.Confirm` are also available if you would like to try them out. 6 | 7 | ## Prerequisits 8 | 9 | A built `Mono.WebAssembly.DOM` assembly. 10 | 11 | ## Building 12 | 13 | Right now the following targets are available: 14 | 15 | - build: Sets up the libraries, copies the binaries required from the dom-wasm directory and then builds the sample hello.cs. 16 | - clean: Cleans up the libraries so that the build will rebuild all targets. 17 | 18 | ``` 19 | $ make build 20 | ``` 21 | 22 | When the sample code is finished building all the required code to run the sample is made available in the `publish` directory. 23 | 24 | Once that's done, Start a web server from the `publish` directory: 25 | 26 | ``` 27 | publish$ python -m SimpleHTTPServer 28 | ``` 29 | 30 | Unfortunately, the above http server doesn't give wasm binaries the right mime type, which disables WebAssembly stream compilation. 31 | The included `server.py` script from the `wasm` directory solves this and can be used instead. 32 | 33 | ``` 34 | publish$ python server.py 35 | ``` 36 | 37 | 38 | Go to `locahost:8000/index.html` and it should work. 39 | 40 | 41 | -------------------------------------------------------------------------------- /samples/Hello/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | WebAssembly Hello Example 5 | 6 | 7 | 8 | 9 | 10 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /samples/Hello1/.gitignore: -------------------------------------------------------------------------------- 1 | bin 2 | obj 3 | managed 4 | publish -------------------------------------------------------------------------------- /samples/Hello1/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | 4 | // Information about this assembly is defined by the following attributes. 5 | // Change them to the values specific to your project. 6 | 7 | [assembly: AssemblyTitle("Hello")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("")] 12 | [assembly: AssemblyCopyright("${AuthorCopyright}")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". 17 | // The form "{Major}.{Minor}.*" will automatically update the build and revision, 18 | // and "{Major}.{Minor}.{Build}.*" will update just the revision. 19 | 20 | [assembly: AssemblyVersion("1.0.*")] 21 | 22 | // The following attributes are used to specify the signing key for the assembly, 23 | // if desired. See the Mono documentation for more information about signing. 24 | 25 | //[assembly: AssemblyDelaySign(false)] 26 | //[assembly: AssemblyKeyFile("")] 27 | -------------------------------------------------------------------------------- /samples/Hello1/README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | # Hello1 5 | 6 | This is a very simple test right now. 7 | 8 | ## Prerequisits 9 | 10 | A built `Mono.WebAssembly.DOM` assembly. 11 | 12 | # Building 13 | 14 | Right now the following targets are available: 15 | 16 | - build: Sets up the libraries, copies the binaries required from the dom-wasm directory and then builds the sample hello.cs. 17 | - clean: Cleans up the libraries so that the build will rebuild all targets. 18 | 19 | ``` 20 | $ make build 21 | ``` 22 | 23 | When the sample code is finished building all the required code to run the sample is made available in the `publish` directory. 24 | 25 | Once that's done, Start a web server from the `publish` directory: 26 | 27 | ``` 28 | publish$ python -m SimpleHTTPServer 29 | ``` 30 | 31 | Unfortunately, the above http server doesn't give wasm binaries the right mime type, which disables WebAssembly stream compilation. 32 | The included `server.py` script from the `wasm` directory solves this and can be used instead. 33 | 34 | ``` 35 | publish$ python server.py 36 | ``` 37 | 38 | 39 | Go to `locahost:8000/index.html` and it should work. 40 | 41 | 42 | -------------------------------------------------------------------------------- /samples/Hello1/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | WebAssembly Hello1 Example 5 | 6 | 7 | 8 | 9 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /samples/HelloElectron/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | bin 3 | obj 4 | managed 5 | publish -------------------------------------------------------------------------------- /samples/HelloElectron/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "electron-quick-start", 3 | "version": "1.0.0", 4 | "description": "A minimal Electron application", 5 | "main": "main.js", 6 | "scripts": { 7 | "start": "electron ." 8 | }, 9 | "repository": "https://github.com/electron/electron-quick-start", 10 | "keywords": [ 11 | "Electron", 12 | "quick", 13 | "start", 14 | "tutorial", 15 | "demo" 16 | ], 17 | "author": "GitHub", 18 | "license": "CC0-1.0", 19 | "devDependencies": { 20 | "electron": "^1.8.4" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /samples/HelloElectron/renderer.js: -------------------------------------------------------------------------------- 1 | // This file is required by the index.html file and will 2 | // be executed in the renderer process for that window. 3 | // All of the Node.js APIs are available in this process. 4 | -------------------------------------------------------------------------------- /samples/HelloElectron/src/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | 4 | // Information about this assembly is defined by the following attributes. 5 | // Change them to the values specific to your project. 6 | 7 | [assembly: AssemblyTitle("HelloElectron")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("")] 12 | [assembly: AssemblyCopyright("${AuthorCopyright}")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". 17 | // The form "{Major}.{Minor}.*" will automatically update the build and revision, 18 | // and "{Major}.{Minor}.{Build}.*" will update just the revision. 19 | 20 | [assembly: AssemblyVersion("1.0.*")] 21 | 22 | // The following attributes are used to specify the signing key for the assembly, 23 | // if desired. See the Mono documentation for more information about signing. 24 | 25 | //[assembly: AssemblyDelaySign(false)] 26 | //[assembly: AssemblyKeyFile("")] 27 | -------------------------------------------------------------------------------- /samples/global.json: -------------------------------------------------------------------------------- 1 | { 2 | "sdk": { 3 | "version": "2.1.300" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /src/Blazor.Extensions.MergeStyles.BuildTools/Blazor.Extensions.MergeStyles.BuildTools.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.1 5 | Exe 6 | tools 7 | false 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/Blazor.Extensions.MergeStyles.BuildTools/Cli/ICommand.cs: -------------------------------------------------------------------------------- 1 | using McMaster.Extensions.CommandLineUtils; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace Blazor.Extensions.MergeStyles.BuildTools 9 | { 10 | public interface ICommandAsync 11 | { 12 | /// 13 | /// Execute the command async 14 | /// 15 | /// 16 | /// 17 | Task OnExecuteAsync(CommandLineApplication app); 18 | 19 | 20 | } 21 | public interface ICommand 22 | { 23 | /// 24 | /// Execute the command 25 | /// 26 | /// 27 | /// 28 | int OnExecute(CommandLineApplication app); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/Blazor.Extensions.MergeStyles.BuildTools/Cli/Models/TransformFile.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace Blazor.Extensions.MergeStyles.BuildTools.Models 9 | { 10 | public class TransformFile 11 | { 12 | public TransformFile() 13 | { 14 | this.Rules = new List(); 15 | } 16 | /// 17 | /// The relative source path 18 | /// 19 | public string Src { get; set; } 20 | 21 | /// 22 | /// A collection of TransformationRules to be executed 23 | /// 24 | public ICollection Rules { get; set; } 25 | 26 | /// 27 | /// The ouput name for the Class.cs 28 | /// 29 | /// 30 | [JsonProperty("className")] 31 | public string Name { get; set; } 32 | 33 | public string Density { get; set; } = "normal"; 34 | 35 | public int CsharpVersion { get; set; } = 6; 36 | 37 | public string ArrayType { get; set; } = "list"; 38 | 39 | public string Features { get; set; } = "complete"; 40 | 41 | public string ClassName => this.Name ?? this.Src.Replace(".ts", ".cs"); 42 | 43 | public string SchemaPath => this.Src.Replace(".ts", ".json"); 44 | 45 | public bool Validate() 46 | { 47 | return this.ClassName.EndsWith(".cs"); 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/Blazor.Extensions.MergeStyles.BuildTools/Cli/Models/TransformOptions.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace Blazor.Extensions.MergeStyles.BuildTools.Models 9 | { 10 | public class TransformOptions 11 | { 12 | public TransformOptions() 13 | { 14 | this.Files = new List(); 15 | this.Rules = new List(); 16 | } 17 | [JsonProperty("src", Required = Required.DisallowNull)] 18 | public string Source { get; set; } 19 | 20 | [JsonProperty("namespace", Required = Required.DisallowNull)] 21 | public string Namespace { get; set; } 22 | 23 | public ICollection Files { get; set; } 24 | 25 | public ICollection Rules { get; set; } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Blazor.Extensions.MergeStyles.BuildTools/Cli/Models/TransmormationRule.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Blazor.Extensions.MergeStyles.BuildTools.Models 8 | { 9 | /// 10 | /// Represent a regex transformation rule 11 | /// 12 | public class TransformationRule 13 | { 14 | /// 15 | /// The regex expression patther 16 | /// 17 | public string Pattern { get; set; } 18 | 19 | /// 20 | /// The value to be replaced 21 | /// 22 | public string Value { get; set; } 23 | 24 | public override string ToString() 25 | { 26 | return $"pattern = {this.Pattern}, value = {this.Value}"; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Blazor.Extensions.MergeStyles.BuildTools/Cli/StartCommand.cs: -------------------------------------------------------------------------------- 1 | using McMaster.Extensions.CommandLineUtils; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace Blazor.Extensions.MergeStyles.BuildTools 9 | { 10 | 11 | [Command(Description = "MergeStyle command CLI", ThrowOnUnexpectedArgument = false)] 12 | [Subcommand("checktool", typeof(CheckToolCommand))] 13 | [Subcommand("transform", typeof(TransformCommand))] 14 | public class StartCommand : ICommand 15 | { 16 | 17 | public int OnExecute(CommandLineApplication app) 18 | { 19 | Console.WriteLine($"Not valid argument provide"); 20 | app.ShowHelp(); 21 | return 0; 22 | 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/Blazor.Extensions.MergeStyles.BuildTools/Program.cs: -------------------------------------------------------------------------------- 1 | using McMaster.Extensions.CommandLineUtils; 2 | using Microsoft.Extensions.Hosting; 3 | using Microsoft.Extensions.Logging.Abstractions; 4 | using Microsoft.Extensions.Logging; 5 | using Microsoft.Extensions.Configuration; 6 | using System; 7 | using Microsoft.Extensions.DependencyInjection; 8 | 9 | namespace Blazor.Extensions.MergeStyles.BuildTools 10 | { 11 | class Program 12 | { 13 | static void Main(string[] args) 14 | { 15 | var host = new HostBuilder() 16 | .ConfigureServices(services => 17 | { 18 | services.AddHttpClient(); 19 | }) 20 | .Build(); 21 | 22 | 23 | var app = new CommandLineApplication(); 24 | app.Conventions 25 | .UseDefaultConventions() 26 | .UseConstructorInjection(host.Services); 27 | 28 | app.Execute(args); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/Blazor.Extensions.MergeStyles.BuildTools/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "Blazor.Extensions.MergeStyles.BuildTools": { 4 | "commandName": "Project", 5 | "commandLineArgs": "checknodejs -v 8.1.4" 6 | }, 7 | "dotnet": { 8 | "commandName": "Project" 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /src/Blazor.Extensions.MergeStyles.BuildTools/ReferenceFromSource.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | dotnet "$(MSBuildThisFileDirectory)tools/Blazor.Extensions.MergeStyles.BuildTools.dll" 4 | 5 | 6 | 7 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/Blazor.Extensions.MergeStyles.BuildTools/tools/Blazor.Extensions.MergeStyles.BuildTools.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlazorExtensions/BlazorOfficeUIFabric/fdfa5aa0323ecaf609d7cab556f99c517ddf38bb/src/Blazor.Extensions.MergeStyles.BuildTools/tools/Blazor.Extensions.MergeStyles.BuildTools.dll -------------------------------------------------------------------------------- /src/Blazor.Extensions.MergeStyles.BuildTools/tools/Blazor.Extensions.MergeStyles.BuildTools.runtimeconfig.dev.json: -------------------------------------------------------------------------------- 1 | { 2 | "runtimeOptions": { 3 | "additionalProbingPaths": [ 4 | "C:\\Users\\DANIEL-DELL-66230\\.dotnet\\store\\|arch|\\|tfm|", 5 | "C:\\Users\\DANIEL-DELL-66230\\.nuget\\packages", 6 | "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder" 7 | ] 8 | } 9 | } -------------------------------------------------------------------------------- /src/Blazor.Extensions.MergeStyles.BuildTools/tools/Blazor.Extensions.MergeStyles.BuildTools.runtimeconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "runtimeOptions": { 3 | "tfm": "netcoreapp2.1", 4 | "framework": { 5 | "name": "Microsoft.NETCore.App", 6 | "version": "2.1.0" 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /src/Blazor.Extensions.MergeStyles.Core/Blazor.Extensions.MergeStyles.Core.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | netstandard2.0 4 | 5 | https://dotnet.myget.org/f/blazor-dev/api/v3/index.json; 6 | 7 | 7.3 8 | Blazor.Extensions.MergeStyles 9 | 2.9 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/Blazor.Extensions.MergeStyles.Core/Blazor.Extensions.MergeStyles.Core2.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | 6 | https://dotnet.myget.org/f/blazor-dev/api/v3/index.json; 7 | 8 | 7.3 9 | Library 10 | true 11 | ${DefaultItemExcludes};node_modules\** 12 | Blazor.Extensions.MergeStyles 13 | 2.9 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/Blazor.Extensions.MergeStyles.Core/Extensions/CollectionsExtensions.cs: -------------------------------------------------------------------------------- 1 | 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Text.RegularExpressions; 7 | using System.Threading.Tasks; 8 | 9 | namespace System.Collections.Generic 10 | { 11 | public static class CollectionsExtensions 12 | { 13 | public static string Join(this IEnumerable enumeration, string separator) 14 | { 15 | return string.Join(separator, enumeration); 16 | } 17 | 18 | public static void Add(this ICollection collection, params T[] args) 19 | { 20 | foreach (var item in args) 21 | collection.Add(item); 22 | } 23 | 24 | public static List Splice(this List source, int index, int count, params T[] args) 25 | { 26 | var items = source.GetRange(index, count); 27 | source.RemoveRange(index, count); 28 | if (args.Length > 0) 29 | source.InsertRange(index, args); 30 | return items; 31 | } 32 | 33 | 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/Blazor.Extensions.MergeStyles.Core/Extensions/CommonExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Text.RegularExpressions; 6 | using System.Threading.Tasks; 7 | 8 | namespace Blazor.Extensions.MergeStyles.Extensions 9 | { 10 | public static class CommonExtensions 11 | { 12 | public static string Replace(this string target, Regex pattern, string value) => pattern.Replace(target, value); 13 | public static int ParseInt(this string input) 14 | { 15 | foreach (Match match in Regex.Matches(input, @"^(-?\d+)", RegexOptions.Compiled)) 16 | { 17 | return int.Parse(match.Value); 18 | } 19 | 20 | throw new InvalidOperationException($"The string {input} is not and integer or not contains any integer part"); 21 | } 22 | 23 | public static string ToCamelCase(this string value) => char.ToLowerInvariant(value[0]) + value.Substring(1); 24 | 25 | public static string FirstUpper(this string value) => char.ToUpperInvariant(value[0]) + value.Substring(1); 26 | 27 | 28 | public static string Kebab(this string value) 29 | { 30 | return Regex 31 | .Replace(value.ToCamelCase(), @"([A-Z])", "-$1", RegexOptions.Compiled) 32 | .Trim() 33 | .ToLower(); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/Blazor.Extensions.MergeStyles.Core/Extensions/DictionaryExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Blazor.Extensions.MergeStyles.Extensions 8 | { 9 | public static class DictionaryExtensions 10 | { 11 | public static void AddOrUpdate(this IDictionary dic, TKey key, TValue value) 12 | { 13 | if (dic.ContainsKey(key)) 14 | dic[key] = value; 15 | else 16 | dic.Add(key, value); 17 | 18 | } 19 | public static bool AreEquals(this IDictionary x, IDictionary y) 20 | { 21 | // early-exit checks 22 | if (null == y) 23 | return null == x; 24 | if (null == x) 25 | return false; 26 | if (object.ReferenceEquals(x, y)) 27 | return true; 28 | if (x.Count != y.Count) 29 | return false; 30 | 31 | // check keys are the same 32 | foreach (TKey k in x.Keys) 33 | if (!y.ContainsKey(k)) 34 | return false; 35 | 36 | // check values are the same 37 | foreach (TKey k in x.Keys) 38 | if (!x[k].Equals(y[k])) 39 | return false; 40 | 41 | return true; 42 | } 43 | 44 | 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/Blazor.Extensions.MergeStyles.Core/IStyleSet.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace Blazor.Extensions.MergeStyles 5 | { 6 | public interface IStyleSet :IStyleSet 7 | { 8 | 9 | 10 | 11 | } 12 | 13 | public interface IStyleSet 14 | { 15 | Dictionary SubComponentStyles { get; set; } 16 | 17 | void AddStyle(string key, Style styleSet); 18 | } 19 | } -------------------------------------------------------------------------------- /src/Blazor.Extensions.MergeStyles.Core/Keyframes.cs: -------------------------------------------------------------------------------- 1 | using Blazor.Extensions.MergeStyles.Extensions; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace Blazor.Extensions.MergeStyles 9 | { 10 | public class Keyframes : Dictionary 11 | { 12 | public Keyframes() 13 | { 14 | 15 | } 16 | public Style From 17 | { 18 | get 19 | { 20 | Style value; 21 | this.TryGetValue("from", out value); 22 | return value; 23 | } 24 | set 25 | { 26 | 27 | this["from"] = value; 28 | } 29 | } 30 | 31 | public Style To 32 | { 33 | get 34 | { 35 | Style value; 36 | this.TryGetValue("to", out value); 37 | return value; 38 | } 39 | set 40 | { 41 | this["to"] = value; 42 | } 43 | } 44 | 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/Blazor.Extensions.MergeStyles.Core/NotParseAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Blazor.Extensions.MergeStyles 8 | { 9 | [AttributeUsage(AttributeTargets.Property, AllowMultiple = false)] 10 | public class NotParseAttribute : Attribute 11 | { 12 | 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/Blazor.Extensions.MergeStyles.Core/Serialization/MergeStylesJson.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Newtonsoft.Json.Converters; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Globalization; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace Blazor.Extensions.MergeStyles 11 | { 12 | public static partial class Serialize 13 | { 14 | public static string ToJson(this CssRule self) => JsonConvert.SerializeObject(self, Blazor.Extensions.MergeStyles.RawConverter.Settings); 15 | public static string ToJson(this string self) => JsonConvert.SerializeObject(self, Blazor.Extensions.MergeStyles.RawConverter.Settings); 16 | public static string ToJson(this object self) => JsonConvert.SerializeObject(self, Blazor.Extensions.MergeStyles.RawConverter.Settings); 17 | public static string ToJson(this IRawFontStyle self) => JsonConvert.SerializeObject(self, Blazor.Extensions.MergeStyles.RawConverter.Settings); 18 | public static string ToJson(this FontFace self) => JsonConvert.SerializeObject(self, Blazor.Extensions.MergeStyles.RawConverter.Settings); 19 | public static string ToJson(this RawStyleBase self) => JsonConvert.SerializeObject(self, Blazor.Extensions.MergeStyles.RawConverter.Settings); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/Blazor.Extensions.MergeStyles.JS/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | dist/ 3 | -------------------------------------------------------------------------------- /src/Blazor.Extensions.MergeStyles.JS/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "blazor.extensions.signalr", 3 | "version": "0.0.1", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "build:debug": "webpack-cli --mode development", 8 | "build:production": "webpack-cli --mode production", 9 | "test": "echo \"Error: no test specified\" && exit 1" 10 | }, 11 | "devDependencies": { 12 | "@types/emscripten": "0.0.31", 13 | "webpack": "^4.16.0", 14 | "webpack-cli": "^3.0.8", 15 | "typescript": "^2.9.2", 16 | "ts-loader": "^4.4.2" 17 | }, 18 | "dependencies": { 19 | "@uifabric/merge-styles": "^6.6.0" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/Blazor.Extensions.MergeStyles.JS/src/Initialize.ts: -------------------------------------------------------------------------------- 1 | import { Stylesheet } from "./Stylesheet"; 2 | import { getVendorSettings } from "./VendorSettings"; 3 | import { getRTL } from "./transforms/rtlifyRules"; 4 | 5 | 6 | namespace BlazorExtensions.MergeStyle { 7 | export var StyleSheet = new StyleSheet(); 8 | export var GetVendorSettings = getVendorSettings; 9 | export var GetRTL = getRTL; 10 | } 11 | var t = []; 12 | window["BlazorExtensions.MergeStyes"] = BlazorExtensions.MergeStyle; 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/Blazor.Extensions.MergeStyles.JS/src/VendorSettings.ts: -------------------------------------------------------------------------------- 1 | 2 | export interface IVendorSettings { 3 | isWebkit?: boolean; 4 | isMoz?: boolean; 5 | isMs?: boolean; 6 | isOpera?: boolean; 7 | } 8 | 9 | let _vendorSettings: IVendorSettings | undefined; 10 | let _vendorSettingsRef: DotNetReferenceType; 11 | export function getVendorSettings(): IVendorSettings { 12 | if (!_vendorSettings) { 13 | const doc = typeof document !== 'undefined' ? document : undefined; 14 | const nav = typeof navigator !== 'undefined' ? navigator : undefined; 15 | const userAgent = nav ? nav.userAgent.toLowerCase() : undefined; 16 | 17 | parseInt("",) 18 | if (!doc) { 19 | _vendorSettings = { 20 | isWebkit: true, 21 | isMoz: true, 22 | isOpera: true, 23 | isMs: true 24 | }; 25 | } else { 26 | _vendorSettings = { 27 | isWebkit: !!(doc && 'WebkitAppearance' in doc.documentElement.style), 28 | isMoz: !!(userAgent && userAgent.indexOf('firefox') > -1), 29 | isOpera: !!(userAgent && userAgent.indexOf('opera') > -1), 30 | isMs: !!(nav && (/rv:11.0/i.test(nav.userAgent) || /Edge\/\d./i.test(navigator.userAgent))) 31 | }; 32 | } 33 | } 34 | 35 | return _vendorSettings; 36 | } 37 | 38 | /** 39 | * Sets the vendor settings for prefixing and vendor specific operations. 40 | */ 41 | export function setVendorSettings(vendorSettings?: IVendorSettings): void { 42 | _vendorSettings = vendorSettings; 43 | } 44 | -------------------------------------------------------------------------------- /src/Blazor.Extensions.MergeStyles.JS/src/dotnet.d.ts: -------------------------------------------------------------------------------- 1 | interface DotNetType { 2 | invokeMethod(assemblyName: string, methodIdentifier: string, ...args: any[]): T; 3 | invokeMethodAsync(assemblyName: string, methodIdentifier: string, ...args: any[]): Promise; 4 | } 5 | 6 | interface DotNetReferenceType { 7 | 8 | invokeMethod(methodIdentifier: string, ...args: any[]): T; 9 | invokeMethodAsync(methodIdentifier: string, ...args: any[]): Promise; 10 | } 11 | 12 | 13 | declare var DotNet: DotNetType; 14 | -------------------------------------------------------------------------------- /src/Blazor.Extensions.MergeStyles.JS/src/transforms/rtlifyRules.ts: -------------------------------------------------------------------------------- 1 | 2 | export function getRTL() { 3 | return typeof document !== 'undefined' && 4 | !!document.documentElement && 5 | document.documentElement.getAttribute('dir') === 'rtl'; 6 | } 7 | -------------------------------------------------------------------------------- /src/Blazor.Extensions.MergeStyles.JS/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "noImplicitAny": false, 4 | "noEmitOnError": true, 5 | "removeComments": false, 6 | "sourceMap": true, 7 | "target": "es5", 8 | "lib": ["es2015", "dom"], 9 | "strict": true 10 | }, 11 | "exclude": [ 12 | "node_modules" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /src/Blazor.Extensions.MergeStyles.JS/webpack.config.js: -------------------------------------------------------------------------------- 1 | const path = require("path"); 2 | const webpack = require("webpack"); 3 | 4 | module.exports = { 5 | mode: 'production', 6 | resolve: { 7 | extensions: [".ts", ".js"] 8 | }, 9 | devtool: "inline-source-map", 10 | module: { 11 | rules: [ 12 | { 13 | test: /\.ts?$/, 14 | loader: "ts-loader" 15 | } 16 | ] 17 | }, 18 | entry: { 19 | "blazor.extensions.merge-styles": "./src/Initialize.ts" 20 | }, 21 | output: { 22 | path: path.join(__dirname, "/dist"), 23 | filename: "[name].js" 24 | } 25 | }; 26 | -------------------------------------------------------------------------------- /src/Blazor.Extensions.MergeStyles/Blazor.Extensions.MergeStyles.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | 7.3 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/Blazor.Extensions.MergeStyles/Extensions/ServiceCollectionExtensions.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.DependencyInjection; 2 | using Microsoft.JSInterop; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace Blazor.Extensions.MergeStyles.Extensions 10 | { 11 | public static class ServiceCollectionExtensions 12 | { 13 | static StyleSheetConfig styleCofnig = new StyleSheetConfig(); 14 | public static IServiceCollection AddMergeStyles(this IServiceCollection services, Action action) 15 | { 16 | 17 | if (!services.Any(a => a.ServiceType == typeof(IJSRuntime))) 18 | { 19 | services.AddSingleton(provider => JSRuntime.Current); 20 | } 21 | 22 | services.AddSingleton(provider => new Stylesheet(styleCofnig, provider.GetService())); 23 | services.AddSingleton(); 24 | return services; 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/Blazor.Extensions.MergeStyles/IStyleEngine.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Threading.Tasks; 4 | 5 | namespace Blazor.Extensions.MergeStyles 6 | { 7 | public interface IStyleEngine 8 | { 9 | Task ApplyRegistration(Registration registration, IDictionary classMap = null); 10 | T ConcatStyleSet(params StyleSet[] args) where T : StyleSet, new(); 11 | Task ExtractRules(Style[] args, RuleSet rules = null, string currentSelector = "&"); 12 | Task<(List, List