Preview Handler for developer files (#15138)

* Create Readme.md

* Update Readme.md

* Rebased to master

* started integrating

* Resolve merge conflict

* Fixed merge conflict

* Edited expect.txt

* Tried implementig interfaces

* Push

* Push

* push

* push

* Deleted no longer used files

* push

* push

* Thanks @jaimecbernando for helping

* can load via url

* getting stuff semi stubbed out

* full render without passing vars

* making sure we clearly label the file was us

* push

* push

* push (does not work)

* Push

* push

* Added file size limit of 3 Kilobyte in standalone App (MoncaoPreview)

* Added monacosrc to excludes.txt (spell checker)

* Fixed XAMLHost loading issue and changed namespace of Settings.cs

* push

* Restructred some code in MonacoPreviewHandler  (not functional)

* MonacoPreview changes:

Added maximal file size and error message as values in Settings.cs
Increased maxFileSize to 10 KB
Renamed variables and formed code according to style guidelines
Added many comments
Deleted usused code
Added unimplemented(?) NavigationStarted method to prevent navigation in WebView
Fixed scrollbar issues (Not beautiful, but still better)
Removed never seen laoding window
Added some debug information as well as some Exceptions.

MonacoPreviewHandler Changes:

Changed order of code executions (still not usable)

* Push

* Push

* Push

* push

* Oh my god, it works

* Added loading screen and resize

* Added some comments, changed variable names and integrated some stuff from MonacoPreview to MonacoPreviewHandler;

* Monaco Preview Handler:
* Removed accessibilityhelpurl
* Made background of loading screen like theme selected
* dev tools open now in Debug mode automatically
* Fixed error message for too big file size

* push

* Fixed a tiny bug

* Updated a NuGet Pasckage

* Removed some to-do points in FileHandler.cs and added them to #14957

* Removed some to-do points in FileHandler.cs and added them to #14957.

Supressed a warning and styled a function better in PrebiewHandlerCommon

* Fixed 2 comment typos and a font that didn't load. (Sadly his required enable CORS again :( )

* Removed old standalone project

* Removed old unused files & rebase to master #1

* Deleted everything from the monaco source code expect the minified version

* Push

* Added summary of all functions. Restructred/simplified/clarified some code.

* Added resources

* Update bug_report.yml

* Update translation_issue.yml

* Update expect.txt

* Update ProofOfConcept/MonacoPreview/monacoPreviewHandler/index.html

Co-authored-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* Update ProofOfConcept/MonacoPreview/monacoPreviewHandler/MonacoPreviewHandlerControl.cs

Co-authored-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* Update ProofOfConcept/MonacoPreview/monacoPreviewHandler/Resources.resx

Co-authored-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* Added some additional file types

* Added additional file types

* Moved to a json file for the available languages and some other changes

* Added error message when WebView2 is not installed

* Remoing throw error

* Update expect.txt

* Update excludes.txt

* Update excludes.txt

* Integrate Monaco preview handler into PowerToys

* Update excludes.txt

* Ignore .svg extension

* Update signing list

* Update signing list #2

* Changed monaco string

* fix

* Fixed wrong JSON field and changed date of Copyright

* Added check if WebView is installed

* Added error when webview2 is not installed

* Increased file size limit to 50kb

* Added new file generator for languages.json

* Remove unvisible symbol at the beggining of the file

* Regenerate resx file

* Update MonacoPreviewHandler.csproj

* tweaking script to ignore 1.0 check on theme dll

* Update src/modules/previewpane/MonacoPreviewHandler/Properties/Resources.resx

Co-authored-by: Franky Chen <franky920920+gpg@gmail.com>

* Update src/modules/previewpane/MonacoPreviewHandler/MonacoPreviewHandlerControl.cs

Co-authored-by: Franky Chen <franky920920+gpg@gmail.com>

* Update src/modules/previewpane/MonacoPreviewHandler/MonacoPreviewHandlerControl.cs

Co-authored-by: Franky Chen <franky920920+gpg@gmail.com>

* Update src/settings-ui/Settings.UI/Strings/en-us/Resources.resw

Co-authored-by: Franky Chen <franky920920+gpg@gmail.com>

* Update excludes.txt

* Update src/modules/previewpane/powerpreview/Resources.resx

Co-authored-by: Franky Chen <franky920920+gpg@gmail.com>

* Check and install WebView2 if needed

* Run spellcheck script

* Update ESRPSigning_core.json

adding font

* Update versionAndSignCheck.ps1

adding fonts to verify

* Adding in Monaco usage

* Update NOTICE.md

* Update ESRPSigning_core.json

* expect.txt update

* Use Common.UI/ThemeManager.cs

* No user facing strings should reference Monaco

* Fix build error

* monaco devdocs (#15691)

* Create update-monaco-editor.md

* Update and rename update-monaco-editor.md to readme.md

* Update doc/devdocs/modules/powerpreview/monaco/readme.md

Co-authored-by: Heiko <61519853+htcfreek@users.noreply.github.com>

* Update doc/devdocs/modules/powerpreview/monaco/readme.md

Co-authored-by: Heiko <61519853+htcfreek@users.noreply.github.com>

* Update doc/devdocs/modules/powerpreview/monaco/readme.md

Co-authored-by: Heiko <61519853+htcfreek@users.noreply.github.com>

* Update readme.md

* Update readme.md

Co-authored-by: Heiko <61519853+htcfreek@users.noreply.github.com>

* Fix WebView installer condition

* Using system.text.json

* Update ESRPSigning_core.json

* Remove Newtonsoft.Json.dll from installer

* Revert "WinUI bump (#15707)"

This reverts commit b6a207c4b6.

* Revert "Update Settings.UI.csproj (#15704)"

This reverts commit 1a25dacc73.

Co-authored-by: Clint Rutkas <clint@rutkas.com>
Co-authored-by: Aaron Junker <aaron.junker@sus.schulen-stadtsh.ch>
Co-authored-by: Clint Rutkas <crutkas@microsoft.com>
Co-authored-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Co-authored-by: Stefan Markovic <stefan@janeasystems.com>
Co-authored-by: Franky Chen <franky920920+gpg@gmail.com>
Co-authored-by: Heiko <61519853+htcfreek@users.noreply.github.com>
This commit is contained in:
Aaron Junker
2022-01-25 21:02:10 +01:00
committed by GitHub
parent f9434ac812
commit 39b98dab3b
126 changed files with 3713 additions and 35 deletions

View File

@@ -22,6 +22,7 @@
<util:FileSearch Variable="HasDotnet3122" Path="[ProgramFiles64Folder]dotnet\shared\Microsoft.WindowsDesktop.App\3.1.22\System.Xaml.dll" Result="exists" />
<util:FileSearch Variable="HasDotnet5013" Path="[ProgramFiles64Folder]dotnet\shared\Microsoft.WindowsDesktop.App\5.0.13\System.Xaml.dll" Result="exists" />
<util:RegistrySearch Variable="HasWebView2" Root="HKLM" Key="SOFTWARE\WOW6432Node\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}" Result="exists" />
<Variable Name="InstallFolder" Type="string" Value="[ProgramFiles64Folder]PowerToys" bal:Overridable="yes"/>
@@ -74,6 +75,24 @@
Version="5.0.13.30717"
Hash="EB5506CEBB3DD1CEC78F7F8131F87A2C5F665B40" />
</ExePackage>
<ExePackage
Name="MicrosoftEdgeWebview2Setup.exe"
Compressed="no"
Id="WebView2"
DetectCondition="HasWebView2"
DownloadUrl="https://go.microsoft.com/fwlink/p/?LinkId=2124703"
InstallCommand="/silent /install"
RepairCommand="/repair /passive"
Permanent="yes"
PerMachine="yes"
UninstallCommand="/silent /uninstall">
<RemotePayload
Description="Microsoft Edge WebView2"
ProductName="Microsoft Edge WebView2"
Size="1839936"
Version="1.3.153.57"
Hash="425CFFDAFADA1CCB9CE0825B43CD69C163C1400E" />
</ExePackage>
<MsiPackage
SourceFile="x64\Release\PowerToysSetup-$(var.Version)-x64.msi"
Compressed="yes"

View File

@@ -3,7 +3,7 @@
<Import Project="..\packages\WiX.3.11.2\build\wix.props" Condition="Exists('..\packages\WiX.3.11.2\build\wix.props')" />
<Import Project="..\..\src\Version.props" />
<PropertyGroup>
<DefineConstants>Version=$(Version)</DefineConstants>
<DefineConstants>Version=$(Version);MonacoSRCHarvestPath=$(ProjectDir)..\..\x64\$(Configuration)\modules\FileExplorerPreview\monacoSRC</DefineConstants>
<Name>PowerToysInstaller</Name>
</PropertyGroup>
<PropertyGroup>
@@ -35,6 +35,7 @@
<Compile Include="CustomDialogs\PTLicenseDlg.wxs" />
<Compile Include="CustomDialogs\WixUI_PTInstallDir.wxs" />
<Compile Include="Product.wxs" />
<Compile Include="MonacoSRC.wxs" />
</ItemGroup>
<ItemGroup>
<WixExtension Include="WixUtilExtension">
@@ -96,4 +97,16 @@ call "..\..\publish.cmd"
<Target Name="AfterBuild">
</Target>
-->
<Target Name="BeforeBuild">
<HeatDirectory Directory="..\..\src\modules\previewpane\MonacoPreviewHandler\monacoSRC"
PreprocessorVariable="var.MonacoSRCHarvestPath"
OutputFile="MonacoSRC.wxs"
ComponentGroupName="MonacoSRCHeatGenerated"
DirectoryRefId="MonacoPreviewHandlerMonacoSRCFolder"
AutogenerateGuids="true"
ToolPath="$(WixToolPath)"
SuppressFragments="true"
SuppressRegistry="true"
SuppressRootDirectory="true" />
</Target>
</Project>

View File

@@ -54,6 +54,7 @@
<ComponentGroupRef Id="ResourcesComponents" />
<ComponentGroupRef Id="LauncherComponents" />
<ComponentGroupRef Id="ToolComponents" />
<ComponentGroupRef Id="MonacoSRCHeatGenerated" />
</Feature>
<SetProperty Id="ARPINSTALLLOCATION" Value="[INSTALLFOLDER]" After="CostFinalize" />
@@ -127,7 +128,7 @@
<Custom Action="TelemetryLogUninstallSuccess" After="InstallFinalize">
Installed and (NOT UPGRADINGPRODUCTCODE) AND (REMOVE="ALL")
</Custom>
<Custom Action="UnApplyModulesRegistryChangeSets" Before="InstallFinalize">
<Custom Action="UnApplyModulesRegistryChangeSets" Before="RemoveFiles">
Installed AND (REMOVE="ALL")
</Custom>
@@ -308,7 +309,14 @@
<Directory Id="VideoConferenceInstallFolder" Name="$(var.VideoConferenceProjectName)">
<Directory Id="VideoConferenceIconsFolder" Name="Icons" />
</Directory>
<Directory Id="FileExplorerPreviewInstallFolder" Name="FileExplorerPreview" />
<Directory Id="FileExplorerPreviewInstallFolder" Name="FileExplorerPreview">
<Directory Id="MonacoPreviewHandlerMonacoSRCFolder" Name="monacoSRC" />
<Directory Id="MonacoPreviewHandlerRuntimesFolder" Name="runtimes">
<Directory Id="MonacoPreviewHandlerRuntimesWinX64Folder" Name="win-x64">
<Directory Id="MonacoPreviewHandlerRuntimesWinX64NativeFolder" Name="native" />
</Directory>
</Directory>
</Directory>
<Directory Id="FancyZonesInstallFolder" Name="$(var.FancyZonesProjectName)" />
<Directory Id="AwakeInstallFolder" Name="$(var.AwakeProjectName)">
<Directory Id="AwakeImagesFolder" Name="Images" />
@@ -836,6 +844,7 @@
<!-- File to include common library used by preview handlers -->
<File Source="$(var.BinX64Dir)modules\FileExplorerPreview\PowerToys.PreviewHandlerCommon.dll" />
<File Source="$(var.BinX64Dir)modules\FileExplorerPreview\PowerToys.PreviewHandlerCommon.deps.json" />
<File Source="$(var.BinX64Dir)modules\FileExplorerPreview\PowerToys.ManagedCommon.dll" />
<File Source="$(var.BinX64Dir)modules\FileExplorerPreview\PowerToys.ManagedTelemetry.dll" />
<!-- File to include dll for Svg Preview Handler -->
<File Source="$(var.BinX64Dir)modules\FileExplorerPreview\PowerToys.SvgPreviewHandler.dll" />
@@ -855,6 +864,19 @@
<File Source="$(var.BinX64Dir)modules\FileExplorerPreview\Markdig.Signed.dll" />
<File Source="$(var.BinX64Dir)modules\FileExplorerPreview\HtmlAgilityPack.dll" />
<File Id="FileExplorerPreview_System.IO.Abstractions.dll" Source="$(var.BinX64Dir)modules\FileExplorerPreview\System.IO.Abstractions.dll" />
<!-- Files to include dll's for Monaco Preview Handler and it's dependencies -->
<File Source="$(var.BinX64Dir)modules\FileExplorerPreview\languages.json" />
<File Source="$(var.BinX64Dir)modules\FileExplorerPreview\PowerToys.Common.UI.dll" />
<File Source="$(var.BinX64Dir)modules\FileExplorerPreview\PowerToys.MonacoPreviewHandler.dll" />
<File Source="$(var.BinX64Dir)modules\FileExplorerPreview\PowerToys.MonacoPreviewHandler.comhost.dll" />
<File Source="$(var.BinX64Dir)modules\FileExplorerPreview\PowerToys.MonacoPreviewHandler.runtimeconfig.json" />
<File Source="$(var.BinX64Dir)modules\FileExplorerPreview\PowerToys.MonacoPreviewHandler.deps.json" />
<File Id="FileExplorerPreview_ControlzEx.dll" Source="$(var.BinX64Dir)modules\FileExplorerPreview\ControlzEx.dll" />
<File Source="$(var.BinX64Dir)modules\FileExplorerPreview\Microsoft.Web.WebView2.Core.dll" />
<File Source="$(var.BinX64Dir)modules\FileExplorerPreview\Microsoft.Web.WebView2.WinForms.dll" />
<File Source="$(var.BinX64Dir)modules\FileExplorerPreview\Microsoft.Web.WebView2.Wpf.dll" />
<File Source="$(var.BinX64Dir)modules\FileExplorerPreview\System.Runtime.WindowsRuntime.dll" />
<File Source="$(var.BinX64Dir)modules\FileExplorerPreview\index.html" />
<!-- File to include dll for Pdf Preview Handler -->
<File Source="$(var.BinX64Dir)modules\FileExplorerPreview\PowerToys.PdfPreviewHandler.dll" />
<File Source="$(var.BinX64Dir)modules\FileExplorerPreview\PowerToys.PdfPreviewHandler.comhost.dll" />
@@ -886,6 +908,11 @@
<File Source="$(var.BinX64Dir)modules\FileExplorerPreview\HelixToolkit.Core.Wpf.dll" />
</Component>
</DirectoryRef>
<DirectoryRef Id="MonacoPreviewHandlerRuntimesWinX64NativeFolder" FileSource="$(var.BinX64Dir)modules\FileExplorerPreview\runtimes\win-x64\native">
<Component Id="MonacoPreviewHandlerRuntimesWinX64NativeLibs" Guid="A867098B-5F8B-491B-A7DC-51F0907B570F" Win64="yes">
<File Id="MonacoPreviewHandler_WebView2Loader" Source="$(var.BinX64Dir)modules\FileExplorerPreview\runtimes\win-x64\native\WebView2Loader.dll" />
</Component>
</DirectoryRef>
<!-- AlwaysOnTop -->
<DirectoryRef Id="AlwaysOnTopInstallFolder" FileSource="$(var.BinX64Dir)modules\$(var.AlwaysOnTopProjectName)">
@@ -1042,6 +1069,7 @@
<ComponentRef Id="Module_ImageResizer" />
<ComponentRef Id="Module_ImageResizer_Registry" />
<ComponentRef Id="Module_PowerPreview" />
<ComponentRef Id="MonacoPreviewHandlerRuntimesWinX64NativeLibs" />
<ComponentRef Id="Module_PowerPreview_Registry" />
<ComponentRef Id="Module_KeyboardManager" />
<ComponentRef Id="Module_KeyboardManager_Editor" />