diff --git a/.build.ps1 b/.build.ps1 index 071fef5a..e56e47ee 100644 --- a/.build.ps1 +++ b/.build.ps1 @@ -12,9 +12,9 @@ $src_path = './pode_modules' #> $Versions = @{ - MkDocs = '1.2.3' - MkDocsTheme = '8.1.2' - PlatyPS = '0.14.0' + MkDocs = '1.4.2' + MkDocsTheme = '9.0.2' + PlatyPS = '0.14.2' } <# @@ -152,7 +152,7 @@ task MoveLibs { # chart.js New-Item -Path "$($libs_path)/chartjs" -ItemType Directory -Force | Out-Null - Copy-Item -Path "$($src_path)/chart.js/dist/chart.min.js" -Destination "$($libs_path)/chartjs/" -Force + Copy-Item -Path "$($src_path)/chart.js/dist/chart.umd.js*" -Destination "$($libs_path)/chartjs/" -Force # mdi fonts - icons New-Item -Path "$($libs_path)/mdi-font/css" -ItemType Directory -Force | Out-Null @@ -257,6 +257,9 @@ task MoveLibs { Copy-Item -Path "$($src_path)/monaco-editor/min/vs/language/$($_)/*.*" -Destination "$($libs_path)/vs/language/$($_)/" -Force } + New-Item -Path "$($libs_path)/vs/base/common/worker" -ItemType Directory -Force | Out-Null + Copy-Item -Path "$($src_path)/monaco-editor/min/vs/base/common/worker/simpleWorker.nls.js" -Destination "$($libs_path)/vs/base/common/worker/" -Force + $vs_maps_path = "$($dest_path)/min-maps/vs" if (Test-Path $vs_maps_path) { Remove-Item -Path $vs_maps_path -Recurse -Force | Out-Null @@ -264,10 +267,12 @@ task MoveLibs { New-Item -Path "$($vs_maps_path)/editor" -ItemType Directory -Force | Out-Null New-Item -Path "$($vs_maps_path)/base/worker" -ItemType Directory -Force | Out-Null + New-Item -Path "$($vs_maps_path)/base/common/worker" -ItemType Directory -Force | Out-Null Copy-Item -Path "$($src_path)/monaco-editor/min-maps/vs/loader.js.map" -Destination $vs_maps_path -Force Copy-Item -Path "$($src_path)/monaco-editor/min-maps/vs/editor/*.*" -Destination "$($vs_maps_path)/editor/" -Force Copy-Item -Path "$($src_path)/monaco-editor/min-maps/vs/base/worker/*.*" -Destination "$($vs_maps_path)/base/worker/" -Force + Copy-Item -Path "$($src_path)/monaco-editor/min-maps/vs/base/common/worker/simpleWorker.nls.js*" -Destination "$($vs_maps_path)/base/common/worker/" -Force } diff --git a/.gitignore b/.gitignore index e806dba4..c406efee 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ docs/[Ff]unctions/ examples/state.json examples/docs.ps1 examples/issue-* +examples/issues/ pkg/ yarn.lock min-maps/ diff --git a/Dockerfile b/Dockerfile index 21897004..c258f6fa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM badgerati/pode:2.7.2 +FROM badgerati/pode:2.8.0 LABEL maintainer="Matthew Kelly (Badgerati)" RUN mkdir -p /usr/local/share/powershell/Modules/Pode.Web COPY ./src/ /usr/local/share/powershell/Modules/Pode.Web \ No newline at end of file diff --git a/alpine.dockerfile b/alpine.dockerfile index eaa4be5f..c7612cef 100644 --- a/alpine.dockerfile +++ b/alpine.dockerfile @@ -1,4 +1,4 @@ -FROM badgerati/pode:2.7.2-alpine +FROM badgerati/pode:2.8.0-alpine LABEL maintainer="Matthew Kelly (Badgerati)" RUN mkdir -p /usr/local/share/powershell/Modules/Pode.Web COPY ./src/ /usr/local/share/powershell/Modules/Pode.Web \ No newline at end of file diff --git a/arm32.dockerfile b/arm32.dockerfile index 25b2441f..77d17036 100644 --- a/arm32.dockerfile +++ b/arm32.dockerfile @@ -1,4 +1,4 @@ -FROM badgerati/pode:2.7.2-arm32 +FROM badgerati/pode:2.8.0-arm32 LABEL maintainer="Matthew Kelly (Badgerati)" RUN mkdir -p /usr/local/share/powershell/Modules/Pode.Web COPY ./src/ /usr/local/share/powershell/Modules/Pode.Web \ No newline at end of file diff --git a/docs/Getting-Started/Installation.md b/docs/Getting-Started/Installation.md index bc746fe3..1c07bcfa 100644 --- a/docs/Getting-Started/Installation.md +++ b/docs/Getting-Started/Installation.md @@ -34,7 +34,7 @@ Install-Module -Name Pode.Web [![Docker](https://img.shields.io/docker/stars/badgerati/pode.web.svg?label=Stars)](https://hub.docker.com/r/badgerati/pode.web/) [![Docker](https://img.shields.io/docker/pulls/badgerati/pode.web.svg?label=Pulls)](https://hub.docker.com/r/badgerati/pode.web/) -Like Pode, Pode.Web also has Docker images available. The images use Pode v2.7.2 on either an Ubuntu Focal image (default), an Alpine image, or an ARM32 image (for Raspberry Pis). +Like Pode, Pode.Web also has Docker images available. The images use Pode v2.8.0 on either an Ubuntu Focal image (default), an Alpine image, or an ARM32 image (for Raspberry Pis). * To pull down the latest Pode.Web image you can do: diff --git a/docs/Hosting/Docker.md b/docs/Hosting/Docker.md index 43260f5b..831f5d2c 100644 --- a/docs/Hosting/Docker.md +++ b/docs/Hosting/Docker.md @@ -2,7 +2,7 @@ Pode.Web has a Docker image that you can use to host your server, for instructions on pulling these images you can [look here](../../Getting-Started/Installation). -The images use Pode v2.7.2 on either an Ubuntu Focal (default), Alpine, or ARM32 image. +The images use Pode v2.8.0 on either an Ubuntu Focal (default), Alpine, or ARM32 image. ## Images @@ -11,7 +11,7 @@ The images use Pode v2.7.2 on either an Ubuntu Focal (default), Alpine, or ARM32 ### Default -The default Pode.Web image is an Ubuntu Focal image with Pode v2.7.2 and Pode.Web installed. An example of using this image in your Dockerfile could be as follows: +The default Pode.Web image is an Ubuntu Focal image with Pode v2.8.0 and Pode.Web installed. An example of using this image in your Dockerfile could be as follows: ```dockerfile # pull down the pode image diff --git a/docs/Tutorials/ClassAndStyles.md b/docs/Tutorials/ClassAndStyles.md index 1fa24644..cc093bc4 100644 --- a/docs/Tutorials/ClassAndStyles.md +++ b/docs/Tutorials/ClassAndStyles.md @@ -22,7 +22,7 @@ Then you could create some `/public/my-styles.css` file with the following, to s and import it via: `Import-PodeWebStylesheet -Url '/my-styles.css'`. -or, you can create some JavaScript file at `/public/my-scritps.js` with an event to write to console on keyup. jQuery works here, as Pode.Web uses jQuery. Also, we have to reference the class then the input control, as the class is at the paraent level of the textbox element; this allows for more fine grained control of a component as a whole - such as a textbox's labels, divs, spans, etc. +or, you can create some JavaScript file at `/public/my-scripts.js` with an event to write to console on keyup. jQuery works here, as Pode.Web uses jQuery. Also, we have to reference the class then the input control, as the class is at the paraent level of the textbox element; this allows for more fine grained control of a component as a whole - such as a textbox's labels, divs, spans, etc. ```js $('.my-custom-textbox input').off('keyup').on('keyup', (e) => { diff --git a/docs/Tutorials/Elements/Icon.md b/docs/Tutorials/Elements/Icon.md index 977a7bc0..866bc3e8 100644 --- a/docs/Tutorials/Elements/Icon.md +++ b/docs/Tutorials/Elements/Icon.md @@ -9,9 +9,9 @@ The icon element will render a [Material Design Icon](https://materialdesignicon ```powershell New-PodeWebCard -Content @( New-PodeWebText -Value 'Here is an icon: ' - New-PodeWebIcon -Name 'alert-triange' -Colour 'yellow' + New-PodeWebIcon -Name 'alert' -Colour 'yellow' New-PodeWebText -Value ', and look another one!: ' - New-PodeWebIcon -Name 'smile' -Colour '#00CC00' + New-PodeWebIcon -Name 'emoticon-happy' -Colour '#00CC00' ) ``` diff --git a/docs/Tutorials/Outputs/Accordion.md b/docs/Tutorials/Outputs/Accordion.md index 045e12e8..1ed3660c 100644 --- a/docs/Tutorials/Outputs/Accordion.md +++ b/docs/Tutorials/Outputs/Accordion.md @@ -7,7 +7,7 @@ This page details the output actions available to control an Accordion layout. You can change the current active accordion bellow by using [`Move-PodeWebAccordion`](../../../Functions/Outputs/Move-PodeWebAccordion). This will make the specified bellow become the active one, and collapse the others. ```powershell -New-PodeWebAccordion -Items @( +New-PodeWebAccordion -Bellows @( New-PodeWebBellow -Name 'Item 1' -Content @( New-PodeWebButton -Name 'Next' -Id 'next_1' -ScriptBlock { Move-PodeWebAccordion -Name 'Item 2' diff --git a/docs/release-notes.md b/docs/release-notes.md index 8c2a3ce7..e5d1d407 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -1,5 +1,30 @@ # Release Notes +## v0.8.3 + +```plain +### Bugs +* #380: Fixes a bug where you couldn't hit the enter key in multiline textboxes in a modal +* #384: Fixes a double encoding issue which rendered Page names incorrectly (thanks @ili101!) +* #392: Fixes `New-PodeWebTextbox` with `-NoForm` to we can create wider textboxes (thanks @ili101!) +* #413: Fixes `Update-PodeWebTextbox` to work with Date types +* #423: Fixes line charts back to being curved lines and filled areas +* #430: Temporary fix for showing the back button pages when there is no query string + +### Packaging +* #378: Bumps highlightjs to 11.7.0 +* #383: Bumps material design icons to 7.1.96 +* #388: Bumps jquery to 3.6.3 +* #414: Bumps chart.js to 4.2.1 +* #418: Bumps Pode in Dockerfiles to 2.8.0 +* #419: Bumps mkdocs and material theme +* #420: Bumps monaco to 0.36.0 + +### Documentation +* #397: Fixes a typo in the Class and Styles docs (thanks @fatherofinvention!) +* #402: Fixes a typo in the Accordion docs (thanks @fatherofinvention!) +``` + ## v0.8.2 ```plain diff --git a/mkdocs.yml b/mkdocs.yml index 950234b1..7b4bf490 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -10,6 +10,8 @@ theme: - navigation.tabs.sticky - navigation.tracking - navigation.top + - content.copy.code + - content.action.edit font: text: Fira Sans code: Fira Code diff --git a/package.json b/package.json index e2312ee4..ea286cdb 100644 --- a/package.json +++ b/package.json @@ -5,15 +5,15 @@ "author": "Matthew Kelly ", "license": "MIT", "dependencies": { - "jquery": "3.6.1", + "jquery": "3.6.3", "jquery-ui-dist": "1.13.2", "popper.js": "1.16.1", "bootstrap": "4.6.1", "bs-stepper": "1.7.0", - "@mdi/font": "7.0.96", - "chart.js": "3.9.1", - "@highlightjs/cdn-assets": "11.6.0", - "monaco-editor": "0.34.1", + "@mdi/font": "7.1.96", + "chart.js": "4.2.1", + "@highlightjs/cdn-assets": "11.7.0", + "monaco-editor": "0.36.0", "moment": "2.29.4" } } diff --git a/src/Pode.Web.psd1 b/src/Pode.Web.psd1 index e8eeb606..20daf2ee 100644 --- a/src/Pode.Web.psd1 +++ b/src/Pode.Web.psd1 @@ -11,7 +11,7 @@ RootModule = 'Pode.Web.psm1' # Version number of this module. - ModuleVersion = '0.8.2' + ModuleVersion = '0.8.3' # ID used to uniquely identify this module GUID = '5c6cae5a-8e62-48a4-c2e5-7511ffe2d439' diff --git a/src/Public/Outputs.ps1 b/src/Public/Outputs.ps1 index 0a451c94..adfc0f39 100644 --- a/src/Public/Outputs.ps1 +++ b/src/Public/Outputs.ps1 @@ -530,7 +530,7 @@ function Out-PodeWebTextbox end { if (!$AsJson) { - $items = ($items | Out-String) + $items = ($items | Out-String -NoNewline) } if ($Size -le 0) { @@ -585,7 +585,7 @@ function Update-PodeWebTextbox end { if (!$AsJson) { - $items = ($items | Out-String) + $items = ($items | Out-String -NoNewline) } return @{ diff --git a/src/Public/Pages.ps1 b/src/Public/Pages.ps1 index 741fb8b1..f45f337b 100644 --- a/src/Public/Pages.ps1 +++ b/src/Public/Pages.ps1 @@ -477,6 +477,9 @@ function Add-PodeWebPage if (!$global:PageData.NoBackArrow) { $global:PageData.ShowBack = (($null -ne $WebEvent.Query) -and ($WebEvent.Query.Count -gt 0)) + if ($global:PageData.ShowBack -and ($WebEvent.Query.Count -eq 1) -and ($WebEvent.Query.ContainsKey(''))) { + $global:PageData.ShowBack = $false + } } else { $global:PageData.ShowBack = $false diff --git a/src/Templates/Public/scripts/default.js b/src/Templates/Public/scripts/default.js index d53a6190..f4d1085c 100644 --- a/src/Templates/Public/scripts/default.js +++ b/src/Templates/Public/scripts/default.js @@ -1577,7 +1577,7 @@ function bindFormSubmits() { // show the spinner showSpinner(form); $('.alert').remove(); - + // remove validation errors removeValidationErrors(form); }); @@ -1599,7 +1599,7 @@ function bindFormResets() { function bindModalSubmits() { $("div.modal-content form.pode-form").off('keypress').on('keypress', function(e) { - if (!isEnterKey(e)) { + if (!isEnterKey(e) || testTagName(e.target, 'textarea')) { return; } @@ -2863,7 +2863,7 @@ function updateButton(action) { setTitle(btn, action.DisplayName); } else { - btn.find('span.pode-text').text(action.DisplayName); + btn.find('span.pode-text').text(decodeHTML(action.DisplayName)); } } @@ -3019,7 +3019,7 @@ function actionValidation(action, sender) { } var validationId = `div#${$(input).attr('id')}_validation`; - $(validationId).text(action.Message); + $(validationId).text(decodeHTML(action.Message)); setValidationError(input); } @@ -3658,6 +3658,8 @@ function createTheChart(canvas, action, sender) { yAxises[key].backgroundColor = palette[index % palette.length].replace('1.0)', '0.2)'); yAxises[key].borderColor = palette[index % palette.length]; yAxises[key].borderWidth = 3; + yAxises[key].fill = true; + yAxises[key].tension = 0.4; axesOpts.x = getChartAxesColours(theme, canvas, 'x'); axesOpts.y = getChartAxesColours(theme, canvas, 'y'); break; diff --git a/src/Templates/Views/elements/textbox.pode b/src/Templates/Views/elements/textbox.pode index 921e1b32..4aeb59f5 100644 --- a/src/Templates/Views/elements/textbox.pode +++ b/src/Templates/Views/elements/textbox.pode @@ -1,11 +1,8 @@ $( $controlDivClass = 'form-group row' - if ($data.DynamicLabel) { + if ($data.NoForm -or $data.DynamicLabel) { $controlDivClass = [string]::Empty } - if ($data.NoForm) { - $controlDivClass = 'no-form' - } "
" ) @@ -13,7 +10,7 @@ $( $(if (!$data.NoForm -and !$data.DynamicLabel) { "" }) -
+
$( $element = [string]::Empty diff --git a/src/Templates/Views/index.pode b/src/Templates/Views/index.pode index a32f1dea..3b36591c 100644 --- a/src/Templates/Views/index.pode +++ b/src/Templates/Views/index.pode @@ -182,7 +182,7 @@
- $([System.Net.WebUtility]::HtmlEncode($page.DisplayName)) + $($page.DisplayName)
" diff --git a/src/Templates/Views/shared/scripts.pode b/src/Templates/Views/shared/scripts.pode index 1e057c40..84d81547 100644 --- a/src/Templates/Views/shared/scripts.pode +++ b/src/Templates/Views/shared/scripts.pode @@ -4,7 +4,7 @@ - +