├── .editorconfig ├── .github ├── FUNDING.yml └── workflows │ └── build.yml ├── .gitignore ├── .gitmodules ├── .vscode ├── launch.json └── tasks.json ├── Documentation ├── Icon.png ├── Icon.sketch ├── IconHD.png ├── MeasureText.html ├── OouiFormsStatus.md └── OouiHistory.md ├── LICENSE ├── Ooui.AspNetCore ├── ElementResult.cs ├── Ooui.AspNetCore.csproj ├── OouiMiddlewareExtensions.cs ├── TagHelpers │ └── OouiTagHelper.cs └── WebSocketHandler.cs ├── Ooui.Forms ├── ActionSheet.cs ├── Cells │ ├── CellElement.cs │ ├── CellRenderer.cs │ ├── EntryCellElement.cs │ ├── EntryCellRenderer.cs │ ├── ImageCellElement.cs │ ├── ImageCellRenderer.cs │ ├── SwitchCellElement.cs │ ├── SwitchCellRenderer.cs │ ├── TextCellElement.cs │ ├── TextCellRenderer.cs │ ├── ViewCellElement.cs │ └── ViewCellRenderer.cs ├── Controls │ ├── LinkLabel.cs │ └── LinkView.cs ├── DisplayAlert.cs ├── ElementChangedEventArgs.cs ├── EventTracker.cs ├── Exports.cs ├── Extensions │ ├── ColorExtensions.cs │ ├── ElementExtensions.cs │ └── FontExtensions.cs ├── Forms.cs ├── IVisualElementRenderer.cs ├── LocalIsolatedStorageFile.cs ├── Ooui.Forms.csproj ├── OouiTheme.cs ├── PageExtensions.cs ├── Platform.cs ├── PlatformEffect.cs ├── PlatformRenderer.cs ├── RendererPool.cs ├── Renderers │ ├── ActivityIndicatorRenderer.cs │ ├── BoxRenderer.cs │ ├── ButtonRenderer.cs │ ├── DatePickerRenderer.cs │ ├── DefaultRenderer.cs │ ├── EditorRenderer.cs │ ├── EntryRenderer.cs │ ├── FrameRenderer.cs │ ├── ImageRenderer.cs │ ├── LabelRenderer.cs │ ├── LinkLabelRenderer.cs │ ├── LinkViewRenderer.cs │ ├── ListViewRenderer.cs │ ├── NavigationPageRenderer.cs │ ├── PickerRenderer.cs │ ├── ProgressBarRenderer.cs │ ├── ScrollViewRenderer.cs │ ├── SearchBarRenderer.cs │ ├── SliderRenderer.cs │ ├── SwitchRenderer.cs │ ├── TimePickerRenderer.cs │ ├── ViewRenderer.cs │ └── WebViewRenderer.cs ├── ResourcesProvider.cs ├── VisualElementPackager.cs ├── VisualElementRenderer.cs └── VisualElementTracker.cs ├── Ooui.Wasm.Build.Tasks ├── BuildDistTask.cs ├── Ooui.Wasm.Build.Tasks.csproj └── README.md ├── Ooui.Wasm ├── Makefile ├── Ooui.Wasm.nuspec └── Ooui.Wasm.targets ├── Ooui.sln ├── Ooui ├── Anchor.cs ├── Body.cs ├── Button.cs ├── Canvas.cs ├── CanvasRenderingContext2D.cs ├── Client.js ├── Color.cs ├── Colors.cs ├── Div.cs ├── Document.cs ├── Element.cs ├── EventTarget.cs ├── Form.cs ├── FormControl.cs ├── Heading.cs ├── Iframe.cs ├── Image.cs ├── Input.cs ├── JsonConvert.cs ├── Label.cs ├── List.cs ├── ListItem.cs ├── Message.cs ├── Node.cs ├── Ooui.csproj ├── Option.cs ├── Paragraph.cs ├── Platform.cs ├── PreserveAttribute.cs ├── Select.cs ├── Session.cs ├── Span.cs ├── Style.cs ├── TextArea.cs ├── TextInput.cs ├── TextNode.cs ├── UI.cs ├── Utilities.cs ├── WebAssemblySession.cs ├── WebSocketSession.cs ├── Window.cs └── Xamarin.Forms.Internals.Crc64.cs ├── PlatformSamples └── AspNetCoreMvc │ ├── .bowerrc │ ├── AspNetCoreMvc.csproj │ ├── Controllers │ ├── HomeController.cs │ └── SamplesController.cs │ ├── Models │ └── ErrorViewModel.cs │ ├── Program.cs │ ├── Properties │ └── launchSettings.json │ ├── Startup.cs │ ├── Views │ ├── Home │ │ ├── About.cshtml │ │ ├── Contact.cshtml │ │ └── Index.cshtml │ ├── Shared │ │ ├── Error.cshtml │ │ ├── _Layout.cshtml │ │ └── _ValidationScriptsPartial.cshtml │ ├── _ViewImports.cshtml │ └── _ViewStart.cshtml │ ├── appsettings.Development.json │ ├── appsettings.json │ ├── bower.json │ ├── bundleconfig.json │ └── wwwroot │ ├── css │ ├── site.css │ └── site.min.css │ ├── favicon.ico │ ├── images │ └── Icon.png │ ├── js │ ├── site.js │ └── site.min.js │ └── lib │ ├── bootstrap │ ├── .bower.json │ ├── LICENSE │ └── dist │ │ ├── css │ │ ├── bootstrap-theme.css │ │ ├── bootstrap-theme.css.map │ │ ├── bootstrap-theme.min.css │ │ ├── bootstrap-theme.min.css.map │ │ ├── bootstrap.css │ │ ├── bootstrap.css.map │ │ ├── bootstrap.min.css │ │ └── bootstrap.min.css.map │ │ ├── fonts │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.svg │ │ ├── glyphicons-halflings-regular.ttf │ │ ├── glyphicons-halflings-regular.woff │ │ └── glyphicons-halflings-regular.woff2 │ │ └── js │ │ ├── bootstrap.js │ │ ├── bootstrap.min.js │ │ └── npm.js │ ├── jquery-validation-unobtrusive │ ├── .bower.json │ ├── jquery.validate.unobtrusive.js │ └── jquery.validate.unobtrusive.min.js │ ├── jquery-validation │ ├── .bower.json │ ├── LICENSE.md │ └── dist │ │ ├── additional-methods.js │ │ ├── additional-methods.min.js │ │ ├── jquery.validate.js │ │ └── jquery.validate.min.js │ └── jquery │ ├── .bower.json │ ├── LICENSE.txt │ └── dist │ ├── jquery.js │ ├── jquery.min.js │ └── jquery.min.map ├── PlatformTests ├── AndroidTests │ ├── AndroidTests.csproj │ ├── Assets │ │ └── AboutAssets.txt │ ├── MainActivity.cs │ ├── PresentTests.cs │ ├── Properties │ │ ├── AndroidManifest.xml │ │ └── AssemblyInfo.cs │ ├── Resources │ │ ├── AboutResources.txt │ │ ├── Resource.designer.cs │ │ ├── mipmap-hdpi │ │ │ └── Icon.png │ │ ├── mipmap-mdpi │ │ │ └── Icon.png │ │ ├── mipmap-xhdpi │ │ │ └── Icon.png │ │ ├── mipmap-xxhdpi │ │ │ └── Icon.png │ │ └── mipmap-xxxhdpi │ │ │ └── Icon.png │ └── packages.config ├── PlatformTests.sln └── iOSTests │ ├── Entitlements.plist │ ├── Info.plist │ ├── LaunchScreen.storyboard │ ├── Main.cs │ ├── PresentTests.cs │ ├── UnitTestAppDelegate.cs │ ├── iOSTests.csproj │ └── packages.config ├── README.md ├── Samples ├── BoxViewClockSample.cs ├── BugSweeper │ ├── App.cs │ ├── Board.cs │ ├── BugSweeperPage.xaml │ ├── BugSweeperPage.xaml.cs │ ├── Images │ │ ├── RedBug.png │ │ └── Xamarin120.png │ └── Tile.cs ├── BugSweeperSample.cs ├── ButtonSample.cs ├── ButtonXamlPage.xaml ├── ButtonXamlPage.xaml.cs ├── ButtonXamlSample.cs ├── DisplayAlertPage.xaml ├── DisplayAlertPage.xaml.cs ├── DisplayAlertSample.cs ├── DotMatrixClock │ ├── DotMatrixClockPage.cs │ └── DotMatrixClockPage.xaml ├── DotMatrixClockSample.cs ├── DrawSample.cs ├── EditorSample.cs ├── FilesSample.cs ├── ISample.cs ├── ListView │ ├── RefreshListView.xaml │ ├── RefreshListView.xaml.cs │ └── RefreshListViewModel.cs ├── ListViewSample.cs ├── Monkeys │ ├── Images │ │ ├── Baboon.jpg │ │ ├── BlueMonkey.jpg │ │ ├── Capuchin.jpg │ │ ├── GoldenLionTamarin.jpg │ │ ├── Howler.jpg │ │ └── Squirrel.jpg │ ├── Monkey.cs │ ├── MonkeyHelper.cs │ ├── MonkeysView.xaml │ ├── MonkeysView.xaml.cs │ └── MonkeysViewModel.cs ├── MonkeysSample.cs ├── Navigation │ ├── NavigationFirstPage.xaml │ ├── NavigationFirstPage.xaml.cs │ ├── NavigationSecondPage.xaml │ ├── NavigationSecondPage.xaml.cs │ ├── NavigationThirdPage.xaml │ └── NavigationThirdPage.xaml.cs ├── NavigationSample.cs ├── PickerSample.cs ├── Program.cs ├── RefreshListViewSample.cs ├── SamplePicker.cs ├── Samples.csproj ├── SearchBarSample.cs ├── SliderSample.cs ├── SwitchErrorSample.cs ├── TimePickerSample.cs ├── TipCalc │ ├── DoubleRoundingConverter.cs │ ├── DoubleToStringConverter.cs │ ├── TipCalcModel.cs │ ├── TipCalcPage.xaml │ └── TipCalcPage.xaml.cs ├── TipCalcSample.cs ├── TodoSample.cs ├── WeatherApp │ ├── Core.cs │ ├── DataService.cs │ ├── Weather.cs │ ├── WeatherPage.xaml │ └── WeatherPage.xaml.cs ├── WeatherAppSample.cs ├── WebViewSample.cs ├── WrappingTextSample.cs ├── XamlPreviewPageSample.cs ├── Xuzzle │ ├── XuzzlePage.cs │ └── XuzzleSquare.cs └── XuzzleSample.cs ├── Tests ├── ButtonTests.cs ├── CanvasTests.cs ├── EventTargetStressTests.cs ├── EventTargetTests.cs ├── InputTests.cs ├── JsonTests.cs ├── MessageSendTests.cs ├── NodeTests.cs ├── StyleTests.cs ├── Tests.csproj ├── UITests.cs ├── WindowTests.cs └── WriteHtmlTests.cs └── ooui.service /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: praeclarum 2 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: Build 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | pull_request: 7 | branches: [ master ] 8 | 9 | jobs: 10 | build: 11 | 12 | runs-on: ubuntu-latest 13 | 14 | steps: 15 | - name: Checkout 16 | uses: actions/checkout@v2 17 | - name: Checkout submodules 18 | run: | 19 | git submodule sync 20 | git submodule update --init --recursive 21 | - name: Update Versions 22 | env: 23 | VERSION_PREFIX: 0.14 24 | VERSION_SUFFIX: ${{github.run_number}} 25 | run: | 26 | VERSION=$VERSION_PREFIX.$VERSION_SUFFIX 27 | sed -ibak "s:// Ooui v1.0.0:// Ooui v$VERSION:g" Ooui/Client.js 28 | sed -ibak "s:1.0.0:$VERSION:g" Ooui/Ooui.csproj 29 | sed -ibak "s:1.0.0:$VERSION:g" Ooui.AspNetCore/Ooui.AspNetCore.csproj 30 | sed -ibak "s:1.0.0:$VERSION:g" Ooui.Forms/Ooui.Forms.csproj 31 | sed -ibak "s:version=\"1.0.0\":version=\"$VERSION\":g" Ooui.Wasm/Ooui.Wasm.nuspec 32 | sed -ibak2 "s:1.0.0:$VERSION:g" Ooui.Wasm/Ooui.Wasm.nuspec 33 | cat Ooui.Wasm/Ooui.Wasm.nuspec 34 | - name: Setup .NET 35 | uses: actions/setup-dotnet@v1 36 | with: 37 | dotnet-version: 5.0.x 38 | - name: Restore dependencies 39 | run: dotnet restore 40 | - name: Build 41 | run: dotnet build -c Release --no-restore 42 | - name: Test 43 | run: dotnet test -c Release --no-build --verbosity normal 44 | - name: Package 45 | run: | 46 | mkdir PackageOut 47 | cd Ooui 48 | dotnet pack --include-symbols --no-build -c Release -v normal -o ../PackageOut 49 | cd ../Ooui.AspNetCore 50 | dotnet pack --include-symbols --no-build -c Release -v normal -o ../PackageOut 51 | cd ../Ooui.Forms 52 | dotnet pack --include-symbols --no-build -c Release -v normal -o ../PackageOut 53 | cd ../Ooui.Wasm 54 | nuget pack -OutputDirectory ../PackageOut 55 | - name: Upload Packages 56 | uses: actions/upload-artifact@master 57 | with: 58 | path: PackageOut 59 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # Wasm SDK 3 | /Ooui.Wasm/*.nupkg 4 | /Ooui.Wasm.Test 5 | /Ooui.Wasm.Old 6 | 7 | # Social media files 8 | /Media 9 | 10 | # Autosave files 11 | *~ 12 | .vs/ 13 | 14 | # build 15 | [Oo]bj/ 16 | [Bb]in/ 17 | packages/ 18 | TestResults/ 19 | 20 | # globs 21 | Makefile.in 22 | *.DS_Store 23 | *.sln.cache 24 | *.suo 25 | *.cache 26 | *.pidb 27 | *.userprefs 28 | *.usertasks 29 | config.log 30 | config.make 31 | config.status 32 | aclocal.m4 33 | install-sh 34 | autom4te.cache/ 35 | *.user 36 | *.tar.gz 37 | tarballs/ 38 | test-results/ 39 | Thumbs.db 40 | 41 | # Mac bundle stuff 42 | *.dmg 43 | *.app 44 | 45 | # resharper 46 | *_Resharper.* 47 | *.Resharper 48 | 49 | # dotCover 50 | *.dotCover 51 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "Ooui.Wasm.Build.Tasks/linker"] 2 | path = Ooui.Wasm.Build.Tasks/linker 3 | url = https://github.com/mono/linker.git 4 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to find out which attributes exist for C# debugging 3 | // Use hover for the description of the existing attributes 4 | // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": ".NET Core Launch (console)", 9 | "type": "coreclr", 10 | "request": "launch", 11 | "preLaunchTask": "build", 12 | // If you have changed target frameworks, make sure to update the program path. 13 | "program": "${workspaceRoot}/Samples/bin/Debug/netcoreapp2.0/Samples.dll", 14 | "args": [], 15 | "cwd": "${workspaceRoot}/Samples", 16 | // For more information about the 'console' field, see https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md#console-terminal-window 17 | "console": "internalConsole", 18 | "stopAtEntry": false, 19 | "internalConsoleOptions": "openOnSessionStart" 20 | }, 21 | { 22 | "name": ".NET Core Attach", 23 | "type": "coreclr", 24 | "request": "attach", 25 | "processId": "${command:pickProcess}" 26 | } 27 | ] 28 | } -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.1.0", 3 | "command": "dotnet", 4 | "isShellCommand": true, 5 | "args": [], 6 | "tasks": [ 7 | { 8 | "taskName": "build", 9 | "args": [ 10 | "${workspaceRoot}/Ooui.sln" 11 | ], 12 | "isBuildCommand": true, 13 | "problemMatcher": "$msCompile" 14 | }, 15 | { 16 | "taskName": "test", 17 | "args": [ 18 | "${workspaceRoot}/Tests/Tests.csproj" 19 | ], 20 | "isTestCommand": true, 21 | "showOutput": "silent", 22 | "problemMatcher": { 23 | "owner": "external", 24 | "fileLocation": "absolute", 25 | "severity": "error", 26 | "pattern": [ 27 | { 28 | "regexp": "^Error Message:\\s*$" 29 | }, 30 | { 31 | "regexp": "^\\s*(.*)$", 32 | "message": 1 33 | }, 34 | { 35 | "regexp": "^Stack Trace:\\s*$" 36 | }, 37 | { 38 | "regexp": "^\\s*at (.*\\(\\)) in (.*):line (\\d+)$", 39 | "file": 2, 40 | "location": 3 41 | } 42 | ] 43 | } 44 | } 45 | ] 46 | } -------------------------------------------------------------------------------- /Documentation/Icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praeclarum/Ooui/d3a9b9ddf08e9b09eaeac26d2a360969e1c985ec/Documentation/Icon.png -------------------------------------------------------------------------------- /Documentation/Icon.sketch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praeclarum/Ooui/d3a9b9ddf08e9b09eaeac26d2a360969e1c985ec/Documentation/Icon.sketch -------------------------------------------------------------------------------- /Documentation/IconHD.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/praeclarum/Ooui/d3a9b9ddf08e9b09eaeac26d2a360969e1c985ec/Documentation/IconHD.png -------------------------------------------------------------------------------- /Documentation/MeasureText.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) Krueger Systems, Inc. 2 | 3 | All rights reserved. 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 | -------------------------------------------------------------------------------- /Ooui.AspNetCore/ElementResult.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Text; 3 | using System.Threading.Tasks; 4 | using Microsoft.AspNetCore.Http; 5 | using Microsoft.AspNetCore.Mvc; 6 | using Microsoft.Extensions.Logging; 7 | 8 | namespace Ooui.AspNetCore 9 | { 10 | public class ElementResult : ActionResult 11 | { 12 | readonly Element element; 13 | readonly string title; 14 | readonly bool disposeAfterSession; 15 | readonly ILogger logger; 16 | 17 | public ElementResult (Element element, string title = "", bool disposeAfterSession = true, ILogger logger = null) 18 | { 19 | this.logger = logger; 20 | this.element = element; 21 | this.title = title; 22 | this.disposeAfterSession = disposeAfterSession; 23 | } 24 | 25 | public override async Task ExecuteResultAsync (ActionContext context) 26 | { 27 | var response = context.HttpContext.Response; 28 | response.StatusCode = 200; 29 | response.ContentType = "text/html; charset=utf-8"; 30 | response.Headers["Cache-Control"] = "no-cache, no-store, must-revalidate"; 31 | 32 | if (element.WantsFullScreen) { 33 | element.Style.Width = GetCookieDouble (context.HttpContext.Request.Cookies, "oouiWindowWidth", 32, 640, 10000); 34 | element.Style.Height = GetCookieDouble (context.HttpContext.Request.Cookies, "oouiWindowHeight", 24, 480, 10000); 35 | } 36 | 37 | var sessionId = WebSocketHandler.BeginSession (context.HttpContext, element, disposeAfterSession, logger); 38 | var initialHtml = element.OuterHtml; 39 | var html = UI.RenderTemplate (WebSocketHandler.WebSocketPath + "?id=" + sessionId, title: title, initialHtml: initialHtml); 40 | var htmlBytes = Encoding.UTF8.GetBytes (html); 41 | response.ContentLength = htmlBytes.Length; 42 | using (var s = response.Body) { 43 | await s.WriteAsync (htmlBytes, 0, htmlBytes.Length).ConfigureAwait (false); 44 | } 45 | } 46 | 47 | static double GetCookieDouble (IRequestCookieCollection cookies, string key, double min, double def, double max) 48 | { 49 | if (cookies.TryGetValue (key, out var s)) { 50 | if (double.TryParse (s, out var d)) { 51 | if (d < min) return min; 52 | if (d > max) return max; 53 | return d; 54 | } 55 | return def; 56 | } 57 | else { 58 | return def; 59 | } 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /Ooui.AspNetCore/Ooui.AspNetCore.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1.0.0 5 | praeclarum 6 | ASP.NET Core MVC extensions to make working with Ooui easy. 7 | Ooui;UI;CrossPlatform;ASP.NET 8 | Icon.png 9 | https://github.com/praeclarum/Ooui 10 | MIT 11 | https://github.com/praeclarum/Ooui.git 12 | netstandard2.0 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Ooui.AspNetCore/TagHelpers/OouiTagHelper.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Razor.TagHelpers; 2 | 3 | namespace Ooui.AspNetCore.TagHelpers 4 | { 5 | public class OouiTagHelper : TagHelper 6 | { 7 | public Ooui.Element Element { get; set; } 8 | 9 | public override void Process (TagHelperContext context, TagHelperOutput output) 10 | { 11 | output.TagName = "div"; 12 | output.TagMode = TagMode.StartTagAndEndTag; 13 | output.Content.SetHtmlContent (Element.OuterHtml); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Ooui.Forms/ActionSheet.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Xamarin.Forms.Internals; 4 | 5 | namespace Ooui.Forms 6 | { 7 | public class ActionSheet 8 | { 9 | private readonly Button _cancelButton; 10 | private readonly List