Compare commits

...

3 commits

Author SHA1 Message Date
086a9791d6
refactor(tailwindcss): cleanup
All checks were successful
Actions / Build Plugins (pull_request) Successful in 39s
2024-12-28 12:47:00 -05:00
cd2a37c679
chore(tailwindcss): add icon to gauntlet ui 2024-12-28 12:46:47 -05:00
8aaab98785
refactor(utils): log urls opened by open-url.open() to console 2024-12-28 12:46:36 -05:00
3 changed files with 4 additions and 14 deletions

View file

@ -14,6 +14,7 @@ Repository: https://www.coastalcommits.com/cswimr/cswimr-gauntlet-plugins
id = 'tailwindcss-search-documentation'
name = 'Search TailwindCSS Documentation'
path = 'src/tailwindcss/src/search-documentation.tsx'
icon = 'tailwindcss/list-icon.png'
type = 'view'
description = """
Search TailwindCSS documentation from Gauntlet!

View file

@ -1,7 +1,6 @@
import { List } from "@project-gauntlet/api/components";
import React, { ReactElement, useState } from "react";
import documentation from "./documentation/tailwind-css";
import { Clipboard } from "@project-gauntlet/api/helpers";
import open from "../../../utils/open-url";
// @ts-expect-error gauntlet uses deno and not node
@ -11,24 +10,13 @@ const denoCore: DenoCore = Deno[Deno.internal].core;
export default function SearchDocumentation(): ReactElement {
const [searchText, setSearchText] = useState<string | undefined>("");
//TODO - Migrate this to an Action, so that we can also have a copy to clipboard feature
const onClick = async (url: string) => {
await open(url);
//await Clipboard.writeText(url);
};
return (
<List
// actions={
// <ActionPanel>
// <Action
// label="Copy URL to Clipboard"
// onAction={async () => {
// await Clipboard.writeText(item.url);
// }}
// />
// </ActionPanel>
// }
>
<List>
<List.SearchBar
placeholder={"Search TailwindCSS Documentation..."}
value={searchText}

View file

@ -22,6 +22,7 @@ const open = async (url: string) => {
// Yes, this function uses Deno. Yes, this repository uses Node.js for tooling.
// Gauntlet runs loaded plugins in a Deno runtime, so this works fine.
// Hop off Copilot I know this isn't using Node.js APIs
console.log("Opening URL:", url);
const platform = Deno.build.os;
const cmd = getOpenCommand(platform);
const process = new Deno.Command(cmd, {