diff --git a/.github/actions/spell-check/expect.txt b/.github/actions/spell-check/expect.txt index 5903cb8599..6abd11b4e2 100644 --- a/.github/actions/spell-check/expect.txt +++ b/.github/actions/spell-check/expect.txt @@ -69,11 +69,9 @@ AQS ARandom ARCHITEW ARemapped -ari ARPINSTALLLOCATION ARPPRODUCTICON ARRAYSIZE -arw asf AShortcut ASingle @@ -151,6 +149,7 @@ CALG callbackptr calpwstr Cangjie +caniuse CANRENAME CAPTUREBLT CAPTURECHANGED @@ -260,7 +259,6 @@ critsec Crossdevice CRSEL crx -crw CSearch CSettings cso @@ -302,8 +300,8 @@ DCOM dcommon dcomp DComposition -dcr -dcs +DCR +DCs ddd DDEIf DDevice @@ -373,7 +371,6 @@ DRAWCLIPBOARD DRAWFRAME drawingcolor dreamsofameaningfullife -drf drivedetectionwarning dshow DSTINVERT @@ -417,7 +414,6 @@ editkeyboardwindow EDITSHORTCUTS editshortcutswindow EFile -eip ekus emmintrin Emoji @@ -591,7 +587,7 @@ Hiberboot HIBYTE hicon HIDEWINDOW -hif +Hif HIMAGELIST himl hinst @@ -668,7 +664,6 @@ IGNOREUNKNOWN IGraphics iid Iindex -iiq IJson Ijwhost IKs @@ -733,15 +728,14 @@ ith ITHUMBNAIL IUI IUnknown +IUse IWbem IWeb IWIC iwr IYUV -jfi jfif jgeosdfsdsgmkedfgdfgdfgbkmhcgcflmi -jif jjw jobject jpe @@ -750,7 +744,6 @@ Jsons jsonval junja jxr -kdc keybd KEYBDDATA KEYBDINPUT @@ -875,7 +868,6 @@ MAXIMIZEBOX MAXSHORTCUTSIZE maxversiontested MBR -mdc MDICHILD MDL mdtext @@ -883,7 +875,6 @@ mdtxt mdwn MEDIASUBTYPE mediatype -mef MENUITEMINFO MENUITEMINFOW MERGECOPY @@ -941,7 +932,6 @@ mpmc MRM MRT mru -mrw msc mscorlib msdata @@ -1064,7 +1054,6 @@ NOZORDER NPH npmjs NResize -nrw nsunt NTAPI ntdll @@ -1094,7 +1083,6 @@ opensource openxmlformats OPTIMIZEFORINVOKE ORAW -ori ORPHANEDDIALOGTITLE ORSCANS oss @@ -1273,7 +1261,6 @@ QUERYENDSESSION QUERYOPEN QUEUESYNC QUNS -raf RAII RAlt Rasterize @@ -1377,8 +1364,6 @@ runtimes ruuid rvm rwin -rwl -rwz sacl safeprojectname SAMEKEYPREVIOUSLYMAPPED @@ -1513,7 +1498,6 @@ Srch SRCINVERT SRCPAINT SResize -srf srme srre srw @@ -1588,6 +1572,8 @@ SYSLIB SYSMENU SYSTEMAPPS SYSTEMTIME +SYSTEMWOW +tailwindcss tapp TApplication TApplied diff --git a/.pipelines/ESRPSigning_core.json b/.pipelines/ESRPSigning_core.json index 5319bdc55f..e1f0101fa2 100644 --- a/.pipelines/ESRPSigning_core.json +++ b/.pipelines/ESRPSigning_core.json @@ -201,6 +201,7 @@ "PowerToys.WorkspacesLauncherUI.exe", "PowerToys.WorkspacesLauncherUI.dll", "PowerToys.WorkspacesModuleInterface.dll", + "PowerToys.WorkspacesCsharpLibrary.dll", "WinUI3Apps\\PowerToys.RegistryPreviewExt.dll", "WinUI3Apps\\PowerToys.RegistryPreviewUILib.dll", diff --git a/doc/thirdPartyRunPlugins.md b/doc/thirdPartyRunPlugins.md index bd179eea25..a8136ec623 100644 --- a/doc/thirdPartyRunPlugins.md +++ b/doc/thirdPartyRunPlugins.md @@ -39,6 +39,8 @@ Contact the developers of a plugin directly for assistance with a specific plugi | [GitHubRepo](https://github.com/8LWXpg/PowerToysRun-GitHubRepo) | [8LWXpg](https://github.com/8LWXpg) | Search and open GitHub repositories | | [ProcessKiller](https://github.com/8LWXpg/PowerToysRun-ProcessKiller) | [8LWXpg](https://github.com/8LWXpg) | Search and kill processes | | [ChatGPT](https://github.com/ferraridavide/ChatGPTPowerToys) | [ferraridavide](https://github.com/ferraridavide) | Ask a question to ChatGPT | +| [CanIUse](https://github.com/skttl/ptrun-caniuse) | [skttl](https://github.com/skttl) | Look up browser feature support with caniuse.com | +| [TailwindCSS](https://github.com/skttl/ptrun-tailwindcss) | [skttl](https://github.com/skttl) | Search the documentation of TailwindCSS | ## Extending software plugins diff --git a/src/Monaco/monacoSpecialLanguages.js b/src/Monaco/monacoSpecialLanguages.js index c213f617bb..e237c404f0 100644 --- a/src/Monaco/monacoSpecialLanguages.js +++ b/src/Monaco/monacoSpecialLanguages.js @@ -7,7 +7,7 @@ export async function registerAdditionalLanguages(monaco){ await languageDefinitions(); registerAdditionalLanguage("cppExt", [".ino", ".pde"], "cpp", monaco) registerAdditionalLanguage("xmlExt", [".wsdl", ".csproj", ".vcxproj", ".vbproj", ".fsproj"], "xml", monaco) - registerAdditionalLanguage("txtExt", [".sln", ".log", ".vsconfig", ".env", ".srt"], "txt", monaco) + registerAdditionalLanguage("txtExt", [".sln", ".log", ".vsconfig", ".env", ".srt", ".ahk"], "txt", monaco) registerAdditionalLanguage("razorExt", [".razor"], "razor", monaco) registerAdditionalLanguage("vbExt", [".vbs"], "vb", monaco) registerAdditionalLanguage("iniExt", [".inf", ".gitconfig", ".gitattributes", ".editorconfig"], "ini", monaco) diff --git a/src/Monaco/monaco_languages.json b/src/Monaco/monaco_languages.json index 28fa3c98b4..7cdb5ae252 100644 --- a/src/Monaco/monaco_languages.json +++ b/src/Monaco/monaco_languages.json @@ -1 +1 @@ -{"list":[{"id":"plaintext","extensions":[".txt"],"aliases":["Plain Text","text"],"mimetypes":["text/plain"]},{"id":"abap","extensions":[".abap"],"aliases":["abap","ABAP"]},{"id":"apex","extensions":[".cls"],"aliases":["Apex","apex"],"mimetypes":["text/x-apex-source","text/x-apex"]},{"id":"azcli","extensions":[".azcli"],"aliases":["Azure CLI","azcli"]},{"id":"bat","extensions":[".bat",".cmd"],"aliases":["Batch","bat"]},{"id":"bicep","extensions":[".bicep"],"aliases":["Bicep"]},{"id":"cameligo","extensions":[".mligo"],"aliases":["Cameligo"]},{"id":"clojure","extensions":[".clj",".cljs",".cljc",".edn"],"aliases":["clojure","Clojure"]},{"id":"coffeescript","extensions":[".coffee"],"aliases":["CoffeeScript","coffeescript","coffee"],"mimetypes":["text/x-coffeescript","text/coffeescript"]},{"id":"c","extensions":[".c",".h"],"aliases":["C","c"]},{"id":"cpp","extensions":[".cpp",".cc",".cxx",".hpp",".hh",".hxx"],"aliases":["C++","Cpp","cpp"]},{"id":"csharp","extensions":[".cs",".csx",".cake"],"aliases":["C#","csharp"]},{"id":"csp","extensions":[],"aliases":["CSP","csp"]},{"id":"css","extensions":[".css"],"aliases":["CSS","css"],"mimetypes":["text/css"]},{"id":"cypher","extensions":[".cypher",".cyp"],"aliases":["Cypher","OpenCypher"]},{"id":"dart","extensions":[".dart"],"aliases":["Dart","dart"],"mimetypes":["text/x-dart-source","text/x-dart"]},{"id":"dockerfile","extensions":[".dockerfile"],"filenames":["Dockerfile"],"aliases":["Dockerfile"]},{"id":"ecl","extensions":[".ecl"],"aliases":["ECL","Ecl","ecl"]},{"id":"elixir","extensions":[".ex",".exs"],"aliases":["Elixir","elixir","ex"]},{"id":"flow9","extensions":[".flow"],"aliases":["Flow9","Flow","flow9","flow"]},{"id":"fsharp","extensions":[".fs",".fsi",".ml",".mli",".fsx",".fsscript"],"aliases":["F#","FSharp","fsharp"]},{"id":"freemarker2","extensions":[".ftl",".ftlh",".ftlx"],"aliases":["FreeMarker2","Apache FreeMarker2"]},{"id":"freemarker2.tag-angle.interpolation-dollar","aliases":["FreeMarker2 (Angle/Dollar)","Apache FreeMarker2 (Angle/Dollar)"]},{"id":"freemarker2.tag-bracket.interpolation-dollar","aliases":["FreeMarker2 (Bracket/Dollar)","Apache FreeMarker2 (Bracket/Dollar)"]},{"id":"freemarker2.tag-angle.interpolation-bracket","aliases":["FreeMarker2 (Angle/Bracket)","Apache FreeMarker2 (Angle/Bracket)"]},{"id":"freemarker2.tag-bracket.interpolation-bracket","aliases":["FreeMarker2 (Bracket/Bracket)","Apache FreeMarker2 (Bracket/Bracket)"]},{"id":"freemarker2.tag-auto.interpolation-dollar","aliases":["FreeMarker2 (Auto/Dollar)","Apache FreeMarker2 (Auto/Dollar)"]},{"id":"freemarker2.tag-auto.interpolation-bracket","aliases":["FreeMarker2 (Auto/Bracket)","Apache FreeMarker2 (Auto/Bracket)"]},{"id":"go","extensions":[".go"],"aliases":["Go"]},{"id":"graphql","extensions":[".graphql",".gql"],"aliases":["GraphQL","graphql","gql"],"mimetypes":["application/graphql"]},{"id":"handlebars","extensions":[".handlebars",".hbs"],"aliases":["Handlebars","handlebars","hbs"],"mimetypes":["text/x-handlebars-template"]},{"id":"hcl","extensions":[".tf",".tfvars",".hcl"],"aliases":["Terraform","tf","HCL","hcl"]},{"id":"html","extensions":[".html",".htm",".shtml",".xhtml",".mdoc",".jsp",".asp",".aspx",".jshtm"],"aliases":["HTML","htm","html","xhtml"],"mimetypes":["text/html","text/x-jshtm","text/template","text/ng-template"]},{"id":"ini","extensions":[".ini",".properties",".gitconfig"],"filenames":["config",".gitattributes",".gitconfig",".editorconfig"],"aliases":["Ini","ini"]},{"id":"java","extensions":[".java",".jav"],"aliases":["Java","java"],"mimetypes":["text/x-java-source","text/x-java"]},{"id":"javascript","extensions":[".js",".es6",".jsx",".mjs",".cjs"],"firstLine":"^#!.*\\bnode","filenames":["jakefile"],"aliases":["JavaScript","javascript","js"],"mimetypes":["text/javascript"]},{"id":"julia","extensions":[".jl"],"aliases":["julia","Julia"]},{"id":"kotlin","extensions":[".kt",".kts"],"aliases":["Kotlin","kotlin"],"mimetypes":["text/x-kotlin-source","text/x-kotlin"]},{"id":"less","extensions":[".less"],"aliases":["Less","less"],"mimetypes":["text/x-less","text/less"]},{"id":"lexon","extensions":[".lex"],"aliases":["Lexon"]},{"id":"lua","extensions":[".lua"],"aliases":["Lua","lua"]},{"id":"liquid","extensions":[".liquid",".html.liquid"],"aliases":["Liquid","liquid"],"mimetypes":["application/liquid"]},{"id":"m3","extensions":[".m3",".i3",".mg",".ig"],"aliases":["Modula-3","Modula3","modula3","m3"]},{"id":"markdown","extensions":[".md",".markdown",".mdown",".mkdn",".mkd",".mdwn",".mdtxt",".mdtext"],"aliases":["Markdown","markdown"]},{"id":"mdx","extensions":[".mdx"],"aliases":["MDX","mdx"]},{"id":"mips","extensions":[".s"],"aliases":["MIPS","MIPS-V"],"mimetypes":["text/x-mips","text/mips","text/plaintext"]},{"id":"msdax","extensions":[".dax",".msdax"],"aliases":["DAX","MSDAX"]},{"id":"mysql","extensions":[],"aliases":["MySQL","mysql"]},{"id":"objective-c","extensions":[".m"],"aliases":["Objective-C"]},{"id":"pascal","extensions":[".pas",".p",".pp"],"aliases":["Pascal","pas"],"mimetypes":["text/x-pascal-source","text/x-pascal"]},{"id":"pascaligo","extensions":[".ligo"],"aliases":["Pascaligo","ligo"]},{"id":"perl","extensions":[".pl",".pm"],"aliases":["Perl","pl"]},{"id":"pgsql","extensions":[],"aliases":["PostgreSQL","postgres","pg","postgre"]},{"id":"php","extensions":[".php",".php4",".php5",".phtml",".ctp"],"aliases":["PHP","php"],"mimetypes":["application/x-php"]},{"id":"pla","extensions":[".pla"]},{"id":"postiats","extensions":[".dats",".sats",".hats"],"aliases":["ATS","ATS/Postiats"]},{"id":"powerquery","extensions":[".pq",".pqm"],"aliases":["PQ","M","Power Query","Power Query M"]},{"id":"powershell","extensions":[".ps1",".psm1",".psd1"],"aliases":["PowerShell","powershell","ps","ps1"]},{"id":"proto","extensions":[".proto"],"aliases":["protobuf","Protocol Buffers"]},{"id":"pug","extensions":[".jade",".pug"],"aliases":["Pug","Jade","jade"]},{"id":"python","extensions":[".py",".rpy",".pyw",".cpy",".gyp",".gypi"],"aliases":["Python","py"],"firstLine":"^#!/.*\\bpython[0-9.-]*\\b"},{"id":"qsharp","extensions":[".qs"],"aliases":["Q#","qsharp"]},{"id":"r","extensions":[".r",".rhistory",".rmd",".rprofile",".rt"],"aliases":["R","r"]},{"id":"razor","extensions":[".cshtml"],"aliases":["Razor","razor"],"mimetypes":["text/x-cshtml"]},{"id":"redis","extensions":[".redis"],"aliases":["redis"]},{"id":"redshift","extensions":[],"aliases":["Redshift","redshift"]},{"id":"restructuredtext","extensions":[".rst"],"aliases":["reStructuredText","restructuredtext"]},{"id":"ruby","extensions":[".rb",".rbx",".rjs",".gemspec",".pp"],"filenames":["rakefile","Gemfile"],"aliases":["Ruby","rb"]},{"id":"rust","extensions":[".rs",".rlib"],"aliases":["Rust","rust"]},{"id":"sb","extensions":[".sb"],"aliases":["Small Basic","sb"]},{"id":"scala","extensions":[".scala",".sc",".sbt"],"aliases":["Scala","scala","SBT","Sbt","sbt","Dotty","dotty"],"mimetypes":["text/x-scala-source","text/x-scala","text/x-sbt","text/x-dotty"]},{"id":"scheme","extensions":[".scm",".ss",".sch",".rkt"],"aliases":["scheme","Scheme"]},{"id":"scss","extensions":[".scss"],"aliases":["Sass","sass","scss"],"mimetypes":["text/x-scss","text/scss"]},{"id":"shell","extensions":[".sh",".bash"],"aliases":["Shell","sh"]},{"id":"sol","extensions":[".sol"],"aliases":["sol","solidity","Solidity"]},{"id":"aes","extensions":[".aes"],"aliases":["aes","sophia","Sophia"]},{"id":"sparql","extensions":[".rq"],"aliases":["sparql","SPARQL"]},{"id":"sql","extensions":[".sql"],"aliases":["SQL"]},{"id":"st","extensions":[".st",".iecst",".iecplc",".lc3lib",".TcPOU",".TcDUT",".TcGVL",".TcIO"],"aliases":["StructuredText","scl","stl"]},{"id":"swift","aliases":["Swift","swift"],"extensions":[".swift"],"mimetypes":["text/swift"]},{"id":"systemverilog","extensions":[".sv",".svh"],"aliases":["SV","sv","SystemVerilog","systemverilog"]},{"id":"verilog","extensions":[".v",".vh"],"aliases":["V","v","Verilog","verilog"]},{"id":"tcl","extensions":[".tcl"],"aliases":["tcl","Tcl","tcltk","TclTk","tcl/tk","Tcl/Tk"]},{"id":"twig","extensions":[".twig"],"aliases":["Twig","twig"],"mimetypes":["text/x-twig"]},{"id":"typescript","extensions":[".ts",".tsx",".cts",".mts"],"aliases":["TypeScript","ts","typescript"],"mimetypes":["text/typescript"]},{"id":"vb","extensions":[".vb"],"aliases":["Visual Basic","vb"]},{"id":"wgsl","extensions":[".wgsl"],"aliases":["WebGPU Shading Language","WGSL","wgsl"]},{"id":"xml","extensions":[".xml",".xsd",".dtd",".ascx",".csproj",".config",".props",".targets",".wxi",".wxl",".wxs",".xaml",".svg",".svgz",".opf",".xslt",".xsl"],"firstLine":"(\\<\\?xml.*)|(\\ _monacoDirectory = new(GetRuntimeMonacoDirectory); - public static string GetRuntimeMonacoDirectory() + /// + /// Gets the path of the Monaco assets folder. + /// + public static string MonacoDirectory => _monacoDirectory.Value; + + private static string GetRuntimeMonacoDirectory() { - string codeBase = Assembly.GetExecutingAssembly().Location; - string path = Path.GetFullPath(Path.Combine(Path.GetDirectoryName(codeBase) ?? string.Empty, "Assets", "Monaco")); - if (Path.Exists(path)) - { - return path; - } - else - { - // We're likely in WinUI3Apps directory and need to go back to the base directory. - return Path.GetFullPath(Path.Combine(Path.GetDirectoryName(codeBase) ?? string.Empty, "..", "Assets", "Monaco")); - } - } + string exePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ?? string.Empty; - public static string MonacoDirectory - { - get + // If the executable is within "WinUI3Apps", correct the path first. + if (Path.GetFileName(exePath) == "WinUI3Apps") { - if (string.IsNullOrEmpty(_monacoDirectory)) - { - _monacoDirectory = GetRuntimeMonacoDirectory(); - } - - return _monacoDirectory; + exePath = Path.Combine(exePath, ".."); } + + string monacoPath = Path.Combine(exePath, "Assets", "Monaco"); + + return Directory.Exists(monacoPath) ? + monacoPath : + throw new DirectoryNotFoundException($"Monaco assets directory not found at {monacoPath}"); } public static JsonDocument GetLanguages() diff --git a/src/modules/peek/Peek.FilePreviewer/Previewers/MediaPreviewer/ImagePreviewer.cs b/src/modules/peek/Peek.FilePreviewer/Previewers/MediaPreviewer/ImagePreviewer.cs index 9698e43f5a..47e488c4d3 100644 --- a/src/modules/peek/Peek.FilePreviewer/Previewers/MediaPreviewer/ImagePreviewer.cs +++ b/src/modules/peek/Peek.FilePreviewer/Previewers/MediaPreviewer/ImagePreviewer.cs @@ -5,6 +5,7 @@ using System; using System.Collections.Generic; using System.IO; +using System.Linq; using System.Threading; using System.Threading.Tasks; @@ -22,6 +23,7 @@ using Peek.FilePreviewer.Models; using Peek.FilePreviewer.Previewers.Helpers; using Peek.FilePreviewer.Previewers.Interfaces; using Windows.Foundation; +using Windows.Graphics.Imaging; namespace Peek.FilePreviewer.Previewers { @@ -58,6 +60,12 @@ namespace Peek.FilePreviewer.Previewers private DispatcherQueue Dispatcher { get; } + private static readonly HashSet _supportedFileTypes = + BitmapDecoder.GetDecoderInformationEnumerator() + .SelectMany(di => di.FileExtensions) + .Union([".svg", ".qoi"]) + .ToHashSet(StringComparer.OrdinalIgnoreCase); + public static bool IsItemSupported(IFileSystemItem item) { return _supportedFileTypes.Contains(item.Extension); @@ -199,74 +207,5 @@ namespace Peek.FilePreviewer.Previewers }); }); } - - private static readonly HashSet _supportedFileTypes = new HashSet - { - // Image types - ".bmp", - ".gif", - ".jpg", - ".jfif", - ".jfi", - ".jif", - ".jpeg", - ".jpe", - ".png", - ".tif", // very slow for large files: no thumbnail? - ".tiff", // NEED TO TEST - ".dib", // NEED TO TEST - ".heic", - ".heif", - ".hif", // NEED TO TEST - ".avif", // NEED TO TEST - ".jxr", - ".wdp", - ".ico", // NEED TO TEST - ".thumb", // NEED TO TEST - ".webp", - - // Raw types - ".arw", - ".cr2", - ".crw", - ".erf", - ".kdc", // NEED TO TEST - ".mrw", - ".nef", - ".nrw", - ".orf", - ".pef", - ".raf", - ".raw", - ".rw2", - ".rwl", - ".sr2", - ".srw", - ".srf", - ".dcs", // NEED TO TEST - ".dcr", - ".drf", // NEED TO TEST - ".k25", - ".3fr", - ".ari", // NEED TO TEST - ".bay", // NEED TO TEST - ".cap", // NEED TO TEST - ".iiq", - ".eip", // NEED TO TEST - ".fff", - ".mef", - - // ".mdc", // Crashes in GetFullBitmapFromPathAsync - ".mos", - ".R3D", - ".rwz", // NEED TO TEST - ".x3f", - ".ori", - ".cr3", - - ".svg", - - ".qoi", - }; } } diff --git a/src/modules/peek/Peek.FilePreviewer/Previewers/WebBrowserPreviewer/Helpers/MonacoHelper.cs b/src/modules/peek/Peek.FilePreviewer/Previewers/WebBrowserPreviewer/Helpers/MonacoHelper.cs index f930a01772..274ac4ec33 100644 --- a/src/modules/peek/Peek.FilePreviewer/Previewers/WebBrowserPreviewer/Helpers/MonacoHelper.cs +++ b/src/modules/peek/Peek.FilePreviewer/Previewers/WebBrowserPreviewer/Helpers/MonacoHelper.cs @@ -20,10 +20,11 @@ namespace Peek.FilePreviewer.Previewers public static HashSet GetExtensions() { - HashSet set = new HashSet(); + HashSet set = []; + try { - JsonDocument languageListDocument = Microsoft.PowerToys.FilePreviewCommon.MonacoHelper.GetLanguages(); + using JsonDocument languageListDocument = Microsoft.PowerToys.FilePreviewCommon.MonacoHelper.GetLanguages(); JsonElement languageList = languageListDocument.RootElement.GetProperty("list"); foreach (JsonElement e in languageList.EnumerateArray()) {