├── images ├── diff.png └── image.png ├── UniversalDashboard.Monaco ├── Components │ ├── index.js │ └── monaco.jsx ├── Tests │ ├── monaco.tests.ps1 │ └── driver.ps1 ├── .babelrc ├── package.json ├── .gitignore ├── webpack.config.js ├── build.ps1 ├── UniversalDashboard.CodeEditor.psm1 └── monaco.bom.xml ├── LICENSE └── README.md /images/diff.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ironmansoftware/ud-codeeditor/HEAD/images/diff.png -------------------------------------------------------------------------------- /images/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ironmansoftware/ud-codeeditor/HEAD/images/image.png -------------------------------------------------------------------------------- /UniversalDashboard.Monaco/Components/index.js: -------------------------------------------------------------------------------- 1 | 2 | import UDMonacoEditor from './monaco'; 3 | UniversalDashboard.register("ud-monaco", UDMonacoEditor); -------------------------------------------------------------------------------- /UniversalDashboard.Monaco/Tests/monaco.tests.ps1: -------------------------------------------------------------------------------- 1 | Describe "Editor" { 2 | Context "Editor" { 3 | Set-TestDashboard { 4 | New-UDCodeEditor -Id 'editor2' -Language 'powershell' -Theme vs-dark -Code "Get-Process" -ReadOnly -AutoSize 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /UniversalDashboard.Monaco/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets" : [ 3 | [ 4 | "@babel/preset-env", { 5 | "targets":{ 6 | "browsers":[ 7 | ">0.5%", 8 | "not dead" 9 | ] 10 | } 11 | } 12 | ], 13 | "@babel/preset-react" 14 | ], 15 | "plugins": [ 16 | "@babel/plugin-proposal-class-properties", 17 | "@babel/plugin-syntax-dynamic-import" 18 | ] 19 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2020 Ironman Software, LLC 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. -------------------------------------------------------------------------------- /UniversalDashboard.Monaco/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ud-monaco", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1", 8 | "build": "webpack -p --env production", 9 | "dev": "webpack-dev-server --config webpack.config.js -p --env development" 10 | }, 11 | "author": "", 12 | "license": "ISC", 13 | "dependencies": { 14 | "monaco-editor": "^0.17.1", 15 | "react-monaco-editor": "0.30.1", 16 | "react-resize-detector": "^4.2.0" 17 | }, 18 | "devDependencies": { 19 | "@babel/core": "7.1.2", 20 | "@babel/plugin-proposal-class-properties": "^7.1.0", 21 | "@babel/plugin-syntax-dynamic-import": "^7.0.0", 22 | "@babel/polyfill": "^7.0.0", 23 | "@babel/preset-env": "7.1.0", 24 | "@babel/preset-react": "7.0.0", 25 | "babel-loader": "8.0.4", 26 | "css-loader": "^0.28.7", 27 | "file-loader": "2.0.0", 28 | "monaco-editor-webpack-plugin": "1.7.0", 29 | "style-loader": "0.23.1", 30 | "uglifyjs-webpack-plugin": "0.4.6", 31 | "webpack": "4.21.0", 32 | "webpack-cli": "^3.3.10", 33 | "webpack-dev-server": "3.1.11" 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /UniversalDashboard.Monaco/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | 8 | # Runtime data 9 | pids 10 | *.pid 11 | *.seed 12 | *.pid.lock 13 | 14 | # Directory for instrumented libs generated by jscoverage/JSCover 15 | lib-cov 16 | 17 | # Coverage directory used by tools like istanbul 18 | coverage 19 | 20 | # nyc test coverage 21 | .nyc_output 22 | 23 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 24 | .grunt 25 | 26 | # Bower dependency directory (https://bower.io/) 27 | bower_components 28 | 29 | # node-waf configuration 30 | .lock-wscript 31 | 32 | # Compiled binary addons (http://nodejs.org/api/addons.html) 33 | build/Release 34 | 35 | # Dependency directories 36 | node_modules/ 37 | jspm_packages/ 38 | 39 | # Typescript v1 declaration files 40 | typings/ 41 | 42 | # Optional npm cache directory 43 | .npm 44 | 45 | # Optional eslint cache 46 | .eslintcache 47 | 48 | # Optional REPL history 49 | .node_repl_history 50 | 51 | # Output of 'npm pack' 52 | *.tgz 53 | 54 | # Yarn Integrity file 55 | .yarn-integrity 56 | 57 | # dotenv environment variables file 58 | .env 59 | 60 | public/ 61 | output/ 62 | 63 | classes/bin 64 | classes/obj -------------------------------------------------------------------------------- /UniversalDashboard.Monaco/webpack.config.js: -------------------------------------------------------------------------------- 1 | var webpack = require('webpack'); 2 | var path = require('path'); 3 | const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin'); 4 | 5 | var BUILD_DIR = path.resolve(__dirname, 'public'); 6 | var SRC_DIR = path.resolve(__dirname); 7 | var APP_DIR = path.resolve(__dirname, 'src/app'); 8 | 9 | module.exports = (env) => { 10 | const isDev = env == 'development' || env == 'isolated'; 11 | 12 | return { 13 | entry: { 14 | 'index' : __dirname + '/components/index.js' 15 | }, 16 | output: { 17 | path: BUILD_DIR, 18 | filename: isDev ? 'monaco.[name].bundle.js' : '[name].[hash].bundle.js', 19 | sourceMapFilename: '[name].[hash].bundle.map', 20 | publicPath: "/", 21 | library: 'udmonaco', 22 | libraryTarget: 'var' 23 | }, 24 | module : { 25 | rules : [ 26 | { test: /\.css$/, loader: "style-loader!css-loader" }, 27 | { test: /\.(js|jsx)$/, exclude: [/node_modules/, /public/], loader: 'babel-loader'}, 28 | { test: /\.(eot|ttf|woff2?|otf|svg|png)$/, loader:'file-loader', options: { 29 | name: '[name].[ext]' 30 | } } 31 | ] 32 | }, 33 | externals: { 34 | UniversalDashboard: 'UniversalDashboard', 35 | $: "$", 36 | 'react': 'react', 37 | 'react-dom': 'reactdom' 38 | }, 39 | resolve: { 40 | extensions: ['.json', '.js', '.jsx'] 41 | }, 42 | devtool: 'source-map', 43 | devServer: { 44 | disableHostCheck: true, 45 | historyApiFallback: true, 46 | port: 10000, 47 | // hot: true, 48 | compress:true, 49 | publicPath: '/', 50 | stats: "minimal" 51 | }, 52 | plugins: [ 53 | new MonacoWebpackPlugin() 54 | ] 55 | }; 56 | } 57 | 58 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Universal Dashboard Code Editor 2 | 3 | Code editor control for [Universal Dashboard](https://github.com/ironmansoftware/universal-dashboard) based on [Monaco](https://microsoft.github.io/monaco-editor/). 4 | 5 | ![](./images/image.png) 6 | 7 | # Installation 8 | 9 | ``` 10 | Install-Module UniversalDashboard.CodeEditor 11 | ``` 12 | 13 | # Examples 14 | 15 | ## Creating an editor 16 | 17 | ``` 18 | New-UDCodeEditor -Language 'powershell' -Height '100ch' -Width '100ch' -Code 'Start-Process' 19 | ``` 20 | 21 | ## Readonly Editor 22 | 23 | ``` 24 | New-UDCodeEditor -Language 'powershell' -Height '100ch' -Width '100ch' -Theme vs-dark -Code "Get-Process" -ReadOnly 25 | ``` 26 | 27 | ## Adding Content 28 | 29 | ``` 30 | New-UDCodeEditor -Id 'editor' -Language 'powershell' -Height '100ch' -Width '100ch' -Theme vs-dark -Code "Get-Process" -ReadOnly 31 | New-UDButton -Text 'Add Text' -OnClick { 32 | Add-UDElement -ParentId 'editor' -Content { 33 | 'Get-Process' 34 | } 35 | } 36 | ``` 37 | 38 | ## Getting Content 39 | 40 | ``` 41 | New-UDCodeEditor -Id 'editor' -Language 'powershell' -Height '100ch' -Width '100ch' -Theme vs-dark 42 | New-UDButton -Text "Get Text" -OnClick { 43 | Show-UDToast -Message (Get-UDElement -Id 'editor').Attributes["code"] 44 | } 45 | ``` 46 | 47 | ## Setting Content 48 | 49 | ``` 50 | New-UDCodeEditor -Id 'editor' -Language 'powershell' -Height '100ch' -Width '100ch' -Theme vs-dark 51 | New-UDButton -Text "Set Text" -OnClick { 52 | Set-UDElement -Id 'editor' -Attributes @{ 53 | code = 'Get-Service' 54 | } 55 | } 56 | ``` 57 | 58 | ## Diff Support 59 | 60 | ``` 61 | New-UDCodeEditor -Id 'editor2' -Language 'powershell' -Theme vs-dark -Code "Get-Process" -ReadOnly -Height '500px' -Original 'Start-Process' 62 | ``` 63 | 64 | ![](./images/diff.png) -------------------------------------------------------------------------------- /UniversalDashboard.Monaco/build.ps1: -------------------------------------------------------------------------------- 1 | $BuildFolder = $PSScriptRoot 2 | 3 | $powerShellGet = Import-Module PowerShellGet -PassThru -ErrorAction Ignore 4 | if ($powerShellGet.Version -lt ([Version]'1.6.0')) { 5 | Install-Module PowerShellGet -Scope CurrentUser -Force -AllowClobber 6 | Import-Module PowerShellGet -Force 7 | } 8 | 9 | Set-Location $BuildFolder 10 | 11 | $OutputPath = "$BuildFolder\output\UniversalDashboard.CodeEditor" 12 | 13 | Remove-Item -Path $OutputPath -Force -ErrorAction SilentlyContinue -Recurse 14 | Remove-Item -Path "$BuildFolder\public" -Force -ErrorAction SilentlyContinue -Recurse 15 | 16 | New-Item -Path $OutputPath -ItemType Directory 17 | 18 | & cyclonedx-bom -o monaco.bom.xml 19 | npm install 20 | npm run build 21 | 22 | Copy-Item $BuildFolder\public\*.* $OutputPath 23 | Copy-Item $BuildFolder\UniversalDashboard.CodeEditor.psm1 $OutputPath 24 | 25 | $Version = "1.0.2" 26 | 27 | $manifestParameters = @{ 28 | Path = "$OutputPath\UniversalDashboard.CodeEditor.psd1" 29 | Author = "Adam Driscoll" 30 | CompanyName = "Ironman Software, LLC" 31 | Copyright = "2019 Ironman Software, LLC" 32 | RootModule = "UniversalDashboard.CodeEditor.psm1" 33 | Description = "Code editor control for Universal Dashboard." 34 | ModuleVersion = $version 35 | Tags = @("universaldashboard", "monaco", 'code', 'ud-control') 36 | ReleaseNotes = "Open sourced control." 37 | FunctionsToExport = @( 38 | "New-UDCodeEditor" 39 | ) 40 | RequiredModules = @() 41 | ProjectUri = "https://github.com/ironmansoftware/ud-codeeditor" 42 | IconUri = 'https://raw.githubusercontent.com/ironmansoftware/universal-dashboard/master/images/logo.png' 43 | } 44 | 45 | New-ModuleManifest @manifestParameters 46 | 47 | if ($prerelease -ne $null) { 48 | Update-ModuleManifest -Path "$OutputPath\UniversalDashboard.CodeEditor.psd1" -Prerelease $prerelease 49 | } -------------------------------------------------------------------------------- /UniversalDashboard.Monaco/Tests/driver.ps1: -------------------------------------------------------------------------------- 1 | param( 2 | [Switch]$NoClose, 3 | [Switch]$OutputTestResultXml, 4 | [string]$Control = 'monaco' 5 | ) 6 | 7 | Import-Module (Join-Path $PSScriptRoot "../../Selenium/Selenium.psm1") -Force 8 | Import-Module UniversalDashboard 9 | Import-Module (Join-Path $PSScriptRoot "../output/UniversalDashboard.CodeEditor/UniversalDashboard.CodeEditor.psd1") -Force 10 | 11 | $Tests = Get-ChildItem $PSScriptRoot -Filter "*.tests.ps1" 12 | 13 | $Dashboard = New-UDDashboard -Title "Test" -Content {} 14 | $Server = Start-UDDashboard -Port 10001 -Dashboard $Dashboard 15 | $Driver = Start-SeFirefox 16 | Enter-SeUrl -Url "http://localhost:10001" -Driver $Driver 17 | 18 | function Set-TestData { 19 | param($Data) 20 | 21 | $StateCollection.Add($Data) 22 | } 23 | 24 | function Get-TestData { 25 | $Data = $null 26 | if ($Global:StateCollection.TryTake([ref]$Data, 5000)) { 27 | $Data 28 | } 29 | else { 30 | throw "Retreiving data timed out (5000ms)." 31 | } 32 | } 33 | 34 | function Set-TestDashboard { 35 | param( 36 | [ScriptBlock]$Content 37 | ) 38 | 39 | $Global:StateCollection = New-Object -TypeName 'System.Collections.Concurrent.BlockingCollection[object]' 40 | 41 | $ScriptRoot = $PSScriptRoot 42 | $Dashboard = New-UDDashboard -Content $Content -Title "TEST" -EndpointInitialization (New-UDEndpointInitialization -Variable @("StateCollection", "ScriptRoot") -Function @("Set-TestData", "New-UDMapRasterLayer", "New-UDMapMarker", "New-UDMapIcon", "New-UDMapPopup", "New-UDMapVectorLayer", "New-UDMapLayerControl", "New-UDMapBaseLayer", "New-UDMapOverlay", "New-UDMapFeatureGroup", "ConvertFrom-GeoJson", "New-UDMapHeatmapLayer", "New-UDMapMarkerClusterLayer")) 43 | $Server.DashboardService.SetDashboard($Dashboard) 44 | Enter-SeUrl -Url "http://localhost:10001" -Driver $Driver 45 | } 46 | 47 | 48 | if ($OutputTestResultXml) { 49 | $OutputPath = "$PSScriptRoot\test-results" 50 | Remove-Item $OutputPath -Recurse -ErrorAction SilentlyContinue -Force 51 | New-Item -Path $OutputPath -ItemType Directory 52 | 53 | Push-Location $PSScriptRoot 54 | Invoke-Pester -OutputFile (Join-Path $OutputPath "TEST-Materialize.xml") -OutputFormat NUnitXml 55 | Pop-Location 56 | } else { 57 | $Tests | Where-Object { $_.Name.Contains($Control) } | ForEach-Object { 58 | . $_.FullName 59 | } 60 | } 61 | 62 | if (-not $NoClose) 63 | { 64 | Stop-UDDashboard -Port 10001 65 | Stop-SeDriver $Driver 66 | } 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /UniversalDashboard.Monaco/Components/monaco.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import MonacoEditor, { MonacoDiffEditor } from 'react-monaco-editor'; 3 | import ReactResizeDetector from 'react-resize-detector'; 4 | 5 | export default class UDMonacoEditor extends React.Component { 6 | 7 | constructor(props) { 8 | super(props); 9 | 10 | this.state = { 11 | code: props.code 12 | } 13 | } 14 | 15 | 16 | 17 | onIncomingEvent(eventName, event) { 18 | if (event.type === "setState") { 19 | this.setState({...event.state.attributes}) 20 | } 21 | else if (event.type === "addElement") { 22 | var code = this.state.code; 23 | code += event.elements; 24 | this.setState({ 25 | code 26 | }) 27 | } 28 | else if (event.type === "requestState") { 29 | UniversalDashboard.post(`/api/internal/component/element/sessionState/${event.requestId}`, { 30 | attributes: { 31 | code: this.state.code 32 | } 33 | }); 34 | } 35 | } 36 | 37 | onChange(newValue) { 38 | this.setState({ 39 | code: newValue 40 | }); 41 | } 42 | 43 | componentWillMount() { 44 | this.pubSubToken = UniversalDashboard.subscribe(this.props.id, this.onIncomingEvent.bind(this)); 45 | } 46 | 47 | componentWillUnmount() { 48 | UniversalDashboard.unsubscribe(this.pubSubToken); 49 | } 50 | 51 | editorDidMount(editor, monaco) { 52 | this.editor = editor; 53 | } 54 | 55 | onResize() 56 | { 57 | if (this.editor) { 58 | this.editor.layout(); 59 | } 60 | } 61 | 62 | render() { 63 | 64 | var control = this.props.original ? 65 | 66 | : 76 | 77 | ; 86 | 87 | if (this.props.autosize) 88 | { 89 | return ( 90 | 91 | {control} 92 | 93 | ) 94 | } 95 | 96 | return control; 97 | } 98 | } -------------------------------------------------------------------------------- /UniversalDashboard.Monaco/UniversalDashboard.CodeEditor.psm1: -------------------------------------------------------------------------------- 1 | $IndexJs = Get-ChildItem "$PSScriptRoot\index.*.bundle.js" 2 | $JsFiles = Get-ChildItem "$PSScriptRoot\*.js" 3 | $Maps = Get-ChildItem "$PSScriptRoot\*.map" 4 | $Pngs = Get-ChildItem "$PSScriptRoot\*.png" 5 | 6 | $Script:MonacoAssetId = [UniversalDashboard.Services.AssetService]::Instance.RegisterAsset($IndexJs.FullName) 7 | 8 | foreach($item in $JsFiles) 9 | { 10 | [UniversalDashboard.Services.AssetService]::Instance.RegisterAsset($item.FullName) | Out-Null 11 | } 12 | 13 | foreach($item in $Maps) 14 | { 15 | [UniversalDashboard.Services.AssetService]::Instance.RegisterAsset($item.FullName) | Out-Null 16 | } 17 | 18 | $Pngs = Get-ChildItem "$PSScriptRoot\*.png" 19 | foreach($item in $Pngs) 20 | { 21 | [UniversalDashboard.Services.AssetService]::Instance.RegisterAsset($item.FullName) | Out-Null 22 | } 23 | 24 | 25 | function script:New-UDCodeEditor { 26 | <# 27 | .SYNOPSIS 28 | Creates a new Monaco code editor control. 29 | 30 | .DESCRIPTION 31 | Creates a new Monaco code editor control. 32 | 33 | .PARAMETER Id 34 | The ID of this editor 35 | 36 | .PARAMETER Language 37 | The language to use for syntax highlighting. 38 | 39 | .PARAMETER Height 40 | The height of the editor. 41 | 42 | .PARAMETER Width 43 | The width of the editor. 44 | 45 | .PARAMETER HideCodeLens 46 | Hides code lens within th editor. 47 | 48 | .PARAMETER DisableCodeFolding 49 | Disables code folding. 50 | 51 | .PARAMETER FormatOnPaste 52 | Formats on paste. 53 | 54 | .PARAMETER GlyphMargin 55 | Seconds the size of the glyph margin 56 | 57 | .PARAMETER DisableLineNumbers 58 | Disables line numbers 59 | 60 | .PARAMETER DisableLinks 61 | Disables automatically highlighting links. 62 | 63 | .PARAMETER DisableBracketMatching 64 | Disables bracket matching. 65 | 66 | .PARAMETER MouseWheelScrollSensitivity 67 | Sets the mouse wheel scroll sensitivity. 68 | 69 | .PARAMETER MouseWheelZoom 70 | Enables Ctrl+Scroll zooming. 71 | 72 | .PARAMETER ReadOnly 73 | Sets the editor to readonly. 74 | 75 | .PARAMETER RenderControlCharacters 76 | Enables rendering of control characters. 77 | 78 | .PARAMETER ShowFoldingControls 79 | Controls how to show the folding controls. 80 | 81 | .PARAMETER SmoothScrolling 82 | Enables smooth scrolling. 83 | 84 | .PARAMETER Theme 85 | Selects the theme. The default is the 'vs' theme. 86 | 87 | .PARAMETER Code 88 | The code to show in the editor. 89 | 90 | .EXAMPLE 91 | New-UDCodeEditor -Code 'Get-Process' -Theme 'vs-dark' -Language 'powershell' -Readonly 92 | 93 | Creates a readonly code editor with PowerShell script. 94 | #> 95 | 96 | param( 97 | [Parameter()] 98 | [string]$Id = (New-Guid).ToString(), 99 | [Parameter()] 100 | [ValidateSet('apex', 'azcli', 'bat', 'clojure', 'coffee', 'cpp', 'csharp', 'csp', 'css', 'dockerfile', 'fsharp', 'go', 'handlebars', 'html', 'ini', 'java', 'javascript', 'json', 'less', 'lua', 'markdown', 'msdax', 'mysql', 'objective', 'perl', 'pgsql', 'php', 'postiats', 'powerquery', 'powershell', 'pug', 'python', 'r', 'razor', 'redis', 'redshift', 'ruby', 'rust', 'sb', 'scheme', 'scss', 'shell', 'solidity', 'sql', 'st', 'swift', 'typescript', 'vb', 'xml', 'yaml')] 101 | [string]$Language, 102 | [Parameter()] 103 | [string]$Height, 104 | [Parameter()] 105 | [string]$Width, 106 | [Parameter()] 107 | [Switch]$HideCodeLens, 108 | [Parameter()] 109 | [Switch]$DisableCodeFolding, 110 | [Parameter()] 111 | [Switch]$FormatOnPaste, 112 | [Parameter()] 113 | [Switch]$GlyphMargin, 114 | [Parameter()] 115 | [Switch]$DisableLineNumbers, 116 | [Parameter()] 117 | [Switch]$DisableLinks, 118 | [Parameter()] 119 | [Switch]$DisableBracketMatching, 120 | [Parameter()] 121 | [int]$MouseWheelScrollSensitivity = 1, 122 | [Parameter()] 123 | [Switch]$MouseWheelZoom, 124 | [Parameter()] 125 | [Switch]$ReadOnly, 126 | [Parameter()] 127 | [Switch]$RenderControlCharacters, 128 | [Parameter()] 129 | [ValidateSet("always", "mouseover")] 130 | [string]$ShowFoldingControls = "mouseover", 131 | [Parameter()] 132 | [Switch]$SmoothScrolling, 133 | [Parameter()] 134 | [ValidateSet("vs", "vs-dark", "hc-black")] 135 | [string]$Theme = 'vs', 136 | [Parameter()] 137 | [string]$Code, 138 | [Parameter()] 139 | [string]$Original, 140 | [Parameter()] 141 | [Switch]$Autosize 142 | ) 143 | 144 | End { 145 | 146 | # if ($Endpoint -is [scriptblock]) { 147 | # $Endpoint = New-UDEndpoint -Endpoint $Endpoint -Id $Id 148 | # } 149 | # elseif ($Endpoint -isnot [UniversalDashboard.Models.Endpoint]) { 150 | # throw "Endpoint must be a script block or UDEndpoint" 151 | # } 152 | 153 | @{ 154 | assetId = $MonacoAssetId 155 | isPlugin = $true 156 | type = "ud-monaco" 157 | id = $Id 158 | 159 | height = $Height 160 | width = $Width 161 | language = $Language 162 | codeLens = -not $HideCodeLens.IsPresent 163 | folding = -not $DisableCodeFolding.IsPresent 164 | formatOnPaste = $FormatOnPaste.IsPresent 165 | glyphMargin = $GlyphMargin.IsPresent 166 | lineNumbers = if ($DisableLineNumbers.IsPresent) { "off" } else { "on" } 167 | links = -not $DisableLinks.IsPresent 168 | matchBrackets = -not $DisableBracketMatching.IsPresent 169 | mouseWheelScrollSensitivity = $MouseWheelScrollSensitivity 170 | mouseWheelZoom = $MouseWheelZoom.IsPresent 171 | readOnly = $ReadOnly.IsPresent 172 | renderControlCharacters = $RenderControlCharacters.IsPresent 173 | showFoldingControls = $ShowFoldingControls 174 | smoothScrolling = $SmoothScrolling.IsPresent 175 | theme = $Theme 176 | code = $Code 177 | original = $Original 178 | autosize = $Autosize.IsPresent 179 | } 180 | } 181 | } -------------------------------------------------------------------------------- /UniversalDashboard.Monaco/monaco.bom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | monaco-editor 6 | 0.17.1 7 | 8 | 9 | 10 | 11 | 2407349ad5bb35e3bed12c0f45c7647c36d62e092a2fd59f3f535ba4ff703404ac5baa16aa066a3485ade2d7b29868d92174c4971ddd9d0994607995ac9ec7c4 12 | 13 | 14 | 15 | MIT 16 | 17 | 40 | 41 | 42 | 43 | pkg:npm/monaco-editor@0.17.1 44 | 45 | 46 | https://github.com/Microsoft/monaco-editor#readme 47 | 48 | 49 | https://github.com/Microsoft/monaco-editor/issues 50 | 51 | 52 | git+https://github.com/Microsoft/monaco-editor.git 53 | 54 | 55 | 56 | 57 | react-monaco-editor 58 | 0.30.1 59 | 60 | 61 | 62 | 63 | deefe8982d191884a27af7454df86147c2f7891c42ad3877f5a883e6079df36346168e027c4c515a88ff4010e9fe35d2fd484d6aead4b2b9d1d6bf92126ae3bb 64 | 65 | 66 | 67 | MIT 68 | 69 | 92 | 93 | 94 | 95 | pkg:npm/react-monaco-editor@0.30.1 96 | 97 | 98 | https://github.com/react-monaco-editor/react-monaco-editor 99 | 100 | 101 | https://github.com/react-monaco-editor/react-monaco-editor/issues 102 | 103 | 104 | git+https://github.com/react-monaco-editor/react-monaco-editor.git 105 | 106 | 107 | 108 | 109 | types 110 | react 111 | 16.9.2 112 | 113 | 114 | 115 | 116 | 8d83f62d6c2587e153a8677dbfbca750a6738e3f7c4fcc7b61c973e3bf507518477ee5bdc90fb48e39c3df5797497bad981a69a63e4f60d2d82d17e7649bdc7e 117 | 118 | 119 | 120 | MIT 121 | 122 | 145 | 146 | 147 | 148 | pkg:npm/%40types/react@16.9.2 149 | 150 | 151 | https://github.com/DefinitelyTyped/DefinitelyTyped#readme 152 | 153 | 154 | https://github.com/DefinitelyTyped/DefinitelyTyped/issues 155 | 156 | 157 | git+https://github.com/DefinitelyTyped/DefinitelyTyped.git 158 | 159 | 160 | 161 | 162 | types 163 | prop-types 164 | 15.7.1 165 | 166 | 167 | 168 | 169 | 085ce7f6274e1291eb81dc3c26ca1391a0c3c915a4d63af3215f1d8f3720a6ad32f6d1b80789454fe371879d835690d757e9f8f8d3cdbfb3350e3e6e329e9716 170 | 171 | 172 | 173 | MIT 174 | 175 | 198 | 199 | 200 | 201 | pkg:npm/%40types/prop-types@15.7.1 202 | 203 | 204 | https://github.com/DefinitelyTyped/DefinitelyTyped#readme 205 | 206 | 207 | https://github.com/DefinitelyTyped/DefinitelyTyped/issues 208 | 209 | 210 | git+https://github.com/DefinitelyTyped/DefinitelyTyped.git 211 | 212 | 213 | 214 | 215 | csstype 216 | 2.6.6 217 | 218 | 219 | 220 | 221 | 46915b406504ef88b23e0bebe3a53db75c6840133c4f804bf12c6b37ae8b7b6c5800f49a0c924a7b3b55ddac2e82eb1bde0dc6f622fc4ad9a40415e171b6d786 222 | 223 | 224 | 225 | MIT 226 | 227 | 248 | 249 | 250 | 251 | pkg:npm/csstype@2.6.6 252 | 253 | 254 | https://github.com/frenic/csstype#readme 255 | 256 | 257 | https://github.com/frenic/csstype/issues 258 | 259 | 260 | git+https://github.com/frenic/csstype.git 261 | 262 | 263 | 264 | 265 | prop-types 266 | 15.7.2 267 | 268 | 269 | 270 | 271 | f1042291d1fbfff476beeac8252bad675b261d84dc2e945610e9479f37161e6058ace194cac2b04acac2f3d0428858f709badf27f9d715d25ea4e56b6351821d 272 | 273 | 274 | 275 | MIT 276 | 277 | 300 | 301 | 302 | 303 | pkg:npm/prop-types@15.7.2 304 | 305 | 306 | https://facebook.github.io/react/ 307 | 308 | 309 | https://github.com/facebook/prop-types/issues 310 | 311 | 312 | git+https://github.com/facebook/prop-types.git 313 | 314 | 315 | 316 | 317 | loose-envify 318 | 1.4.0 319 | 320 | 321 | 322 | 323 | 972bb13c6aff59f86b95e9b608bfd472751cd7372a280226043cee918ed8e45ff242235d928ebe7d12debe5c351e03324b0edfeb5d54218e34f04b71452a0add 324 | 325 | 326 | 327 | MIT 328 | 329 | 333 | 334 | Permission is hereby granted, free of charge, to any person obtaining a copy 335 | of this software and associated documentation files (the "Software"), to deal 336 | in the Software without restriction, including without limitation the rights 337 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 338 | copies of the Software, and to permit persons to whom the Software is 339 | furnished to do so, subject to the following conditions: 340 | 341 | The above copyright notice and this permission notice shall be included in 342 | all copies or substantial portions of the Software. 343 | 344 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 345 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 346 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 347 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 348 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 349 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 350 | THE SOFTWARE. 351 | ]]> 352 | 353 | 354 | 355 | pkg:npm/loose-envify@1.4.0 356 | 357 | 358 | https://github.com/zertosh/loose-envify 359 | 360 | 361 | https://github.com/zertosh/loose-envify/issues 362 | 363 | 364 | git://github.com/zertosh/loose-envify.git 365 | 366 | 367 | 368 | 369 | js-tokens 370 | 4.0.0 371 | 372 | 373 | 374 | 375 | 45d2547e5704ddc5332a232a420b02bb4e853eef5474824ed1b7986cf84737893a6a9809b627dca02b53f5b7313a9601b690f690233a49bce0e026aeb16fcf29 376 | 377 | 378 | 379 | MIT 380 | 381 | 404 | 405 | 406 | 407 | pkg:npm/js-tokens@4.0.0 408 | 409 | 410 | https://github.com/lydell/js-tokens#readme 411 | 412 | 413 | https://github.com/lydell/js-tokens/issues 414 | 415 | 416 | git+https://github.com/lydell/js-tokens.git 417 | 418 | 419 | 420 | 421 | object-assign 422 | 4.1.1 423 | 424 | 425 | 426 | 427 | 2109adc7965887cfc05cbbd442cac8bfbb360863 428 | 429 | 430 | 431 | MIT 432 | 433 | (sindresorhus.com) 437 | 438 | Permission is hereby granted, free of charge, to any person obtaining a copy 439 | of this software and associated documentation files (the "Software"), to deal 440 | in the Software without restriction, including without limitation the rights 441 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 442 | copies of the Software, and to permit persons to whom the Software is 443 | furnished to do so, subject to the following conditions: 444 | 445 | The above copyright notice and this permission notice shall be included in 446 | all copies or substantial portions of the Software. 447 | 448 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 449 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 450 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 451 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 452 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 453 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 454 | THE SOFTWARE. 455 | ]]> 456 | 457 | 458 | 459 | pkg:npm/object-assign@4.1.1 460 | 461 | 462 | https://github.com/sindresorhus/object-assign#readme 463 | 464 | 465 | https://github.com/sindresorhus/object-assign/issues 466 | 467 | 468 | git+https://github.com/sindresorhus/object-assign.git 469 | 470 | 471 | 472 | 473 | react-is 474 | 16.8.6 475 | 476 | 477 | 478 | 479 | 6949376c77d9d9b45254515b6de552e22fa534f66bdff58ce634f6279a26515575cf372cd6701a7f7979d5cb40e4516f0916e1ac7d1b740b1145075d14964fb4 480 | 481 | 482 | 483 | MIT 484 | 485 | 508 | 509 | 510 | 511 | pkg:npm/react-is@16.8.6 512 | 513 | 514 | https://reactjs.org/ 515 | 516 | 517 | https://github.com/facebook/react/issues 518 | 519 | 520 | git+https://github.com/facebook/react.git 521 | 522 | 523 | 524 | 525 | react-resize-detector 526 | 4.2.0 527 | 528 | 529 | 530 | 531 | 02d39a348c6cd3276e6bbb44a20957477f74dbf11d9488fd3d70eed598f4ba0d950149e44908e0b8b1b3686fcde825cb3a125271c4ec5026718cb6b2435984f5 532 | 533 | 534 | 535 | MIT 536 | 537 | 559 | 560 | 561 | 562 | pkg:npm/react-resize-detector@4.2.0 563 | 564 | 565 | https://github.com/maslianok/react-resize-detector 566 | 567 | 568 | https://github.com/maslianok/react-resize-detector/issues 569 | 570 | 571 | git+https://github.com/maslianok/react-resize-detector.git 572 | 573 | 574 | 575 | 576 | lodash 577 | 4.17.11 578 | 579 | 580 | 581 | 582 | 7102a1f22828e5052167b960dfc0d8580c4cbe3480286d00f3019256298fd3b4885042b650ef9aad244a6d1656b5e94cb4de55d07930879af23ada3f4ac85822 583 | 584 | 585 | 586 | MIT 587 | 588 | 590 | 591 | Based on Underscore.js, copyright Jeremy Ashkenas, 592 | DocumentCloud and Investigative Reporters & Editors 593 | 594 | This software consists of voluntary contributions made by many 595 | individuals. For exact contribution history, see the revision history 596 | available at https://github.com/lodash/lodash 597 | 598 | The following license applies to all parts of this software except as 599 | documented below: 600 | 601 | ==== 602 | 603 | Permission is hereby granted, free of charge, to any person obtaining 604 | a copy of this software and associated documentation files (the 605 | "Software"), to deal in the Software without restriction, including 606 | without limitation the rights to use, copy, modify, merge, publish, 607 | distribute, sublicense, and/or sell copies of the Software, and to 608 | permit persons to whom the Software is furnished to do so, subject to 609 | the following conditions: 610 | 611 | The above copyright notice and this permission notice shall be 612 | included in all copies or substantial portions of the Software. 613 | 614 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 615 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 616 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 617 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 618 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 619 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 620 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 621 | 622 | ==== 623 | 624 | Copyright and related rights for sample code are waived via CC0. Sample 625 | code is defined as all source code displayed within the prose of the 626 | documentation. 627 | 628 | CC0: http://creativecommons.org/publicdomain/zero/1.0/ 629 | 630 | ==== 631 | 632 | Files located in the node_modules and vendor directories are externally 633 | maintained libraries used by this software which have their own 634 | licenses; we recommend you read them, as their terms may differ from the 635 | terms above. 636 | ]]> 637 | 638 | 639 | 640 | pkg:npm/lodash@4.17.11 641 | 642 | 643 | https://lodash.com/ 644 | 645 | 646 | https://github.com/lodash/lodash/issues 647 | 648 | 649 | git+https://github.com/lodash/lodash.git 650 | 651 | 652 | 653 | 654 | lodash-es 655 | 4.17.15 656 | 657 | 658 | 659 | 660 | ae5adcdf2537f8934ea59f738f9a50b719f1d931e6bd1ca4c0be17971a1af08f651c19556dbc8f860c8f322a31559e0dab2c5a555b5a267cecc8e89d408872c9 661 | 662 | 663 | 664 | MIT 665 | 666 | 668 | 669 | Based on Underscore.js, copyright Jeremy Ashkenas, 670 | DocumentCloud and Investigative Reporters & Editors 671 | 672 | This software consists of voluntary contributions made by many 673 | individuals. For exact contribution history, see the revision history 674 | available at https://github.com/lodash/lodash 675 | 676 | The following license applies to all parts of this software except as 677 | documented below: 678 | 679 | ==== 680 | 681 | Permission is hereby granted, free of charge, to any person obtaining 682 | a copy of this software and associated documentation files (the 683 | "Software"), to deal in the Software without restriction, including 684 | without limitation the rights to use, copy, modify, merge, publish, 685 | distribute, sublicense, and/or sell copies of the Software, and to 686 | permit persons to whom the Software is furnished to do so, subject to 687 | the following conditions: 688 | 689 | The above copyright notice and this permission notice shall be 690 | included in all copies or substantial portions of the Software. 691 | 692 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 693 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 694 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 695 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 696 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 697 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 698 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 699 | 700 | ==== 701 | 702 | Copyright and related rights for sample code are waived via CC0. Sample 703 | code is defined as all source code displayed within the prose of the 704 | documentation. 705 | 706 | CC0: http://creativecommons.org/publicdomain/zero/1.0/ 707 | 708 | ==== 709 | 710 | Files located in the node_modules and vendor directories are externally 711 | maintained libraries used by this software which have their own 712 | licenses; we recommend you read them, as their terms may differ from the 713 | terms above. 714 | ]]> 715 | 716 | 717 | 718 | pkg:npm/lodash-es@4.17.15 719 | 720 | 721 | https://lodash.com/custom-builds 722 | 723 | 724 | https://github.com/lodash/lodash-cli/issues 725 | 726 | 727 | git+https://github.com/lodash/lodash.git 728 | 729 | 730 | 731 | 732 | raf-schd 733 | 4.0.2 734 | 735 | 736 | 737 | 738 | 56194c6661b2e80ea1ae42561cb3531a5e60b603149bec5f1b36bac1bc2713dd78c9e43961b9b5f2f80cef7e116613207f0e2d69c52b5ac786665a54aeb6a411 739 | 740 | 741 | 742 | MIT 743 | 744 | 745 | pkg:npm/raf-schd@4.0.2 746 | 747 | 748 | https://github.com/alexreardon/raf-schd#readme 749 | 750 | 751 | https://github.com/alexreardon/raf-schd/issues 752 | 753 | 754 | git+https://github.com/alexreardon/raf-schd.git 755 | 756 | 757 | 758 | 759 | resize-observer-polyfill 760 | 1.5.1 761 | 762 | 763 | 764 | 765 | 2f066ba2d7473a8d769d0b99947126b6e5dda86a0e0f43a16b1a2968d1715b3227a4481a2d6a15b8031b4f38b1ba8b02c769c41b9f278335b7bf1756a3122076 766 | 767 | 768 | 769 | MIT 770 | 771 | 794 | 795 | 796 | 797 | pkg:npm/resize-observer-polyfill@1.5.1 798 | 799 | 800 | https://github.com/que-etc/resize-observer-polyfill 801 | 802 | 803 | https://github.com/que-etc/resize-observer-polyfill/issues 804 | 805 | 806 | git+https://github.com/que-etc/resize-observer-polyfill.git 807 | 808 | 809 | 810 | 811 | --------------------------------------------------------------------------------