commit dbc3cf729e061c75fb2563fa037e7396532a767a Author: Andreas Schneider Date: Mon Jun 29 20:03:44 2026 +0200 🎉 Bootstrap extension diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..eb3ae20 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +node_modules +vicinae-env.d.ts diff --git a/README.md b/README.md new file mode 100644 index 0000000..49bffdb --- /dev/null +++ b/README.md @@ -0,0 +1,15 @@ +# Vicinae Extension + +Congratulations on generating your new Vicinae extension! + +You can install the required dependencies and run your extension in development mode like so: + +```bash +npm install +npm run dev +``` +If you want to build the production bundle, simply run: + +```bash +npm run build +``` diff --git a/assets/extension_icon.png b/assets/extension_icon.png new file mode 100644 index 0000000..cf29a7b Binary files /dev/null and b/assets/extension_icon.png differ diff --git a/package.json b/package.json new file mode 100644 index 0000000..edb9078 --- /dev/null +++ b/package.json @@ -0,0 +1,35 @@ +{ + "$schema": "https://raw.githubusercontent.com/vicinaehq/vicinae/refs/heads/main/extra/schemas/extension.json", + "name": "gitmoji", + "title": "gitmoji", + "description": "Search and copy gitmojis to clipboard", + "categories": [], + "license": "MIT", + "author": "aksdb", + "contributors": [], + "pastContributors": [], + "icon": "extension_icon.png", + "commands": [ + { + "name": "gitmoji", + "title": "gitmoji", + "subtitle": "gitmoji", + "description": "Search and copy gitmojis to clipboard", + "mode": "view" + } + ], + "preferences": [], + "scripts": { + "build": "vici build", + "dev": "vici develop", + "format": "biome format --write src", + "lint": "vici lint" + }, + "dependencies": { + "@vicinae/api": "^0.22.0" + }, + "devDependencies": { + "typescript": "^5.9.2", + "@biomejs/biome": "2.3.2" + } +} diff --git a/src/gitmoji.tsx b/src/gitmoji.tsx new file mode 100644 index 0000000..c682a87 --- /dev/null +++ b/src/gitmoji.tsx @@ -0,0 +1,214 @@ +import { + Action, + ActionPanel, + Icon, + List, + showToast, + Toast, +} from "@vicinae/api"; + +export default function SimpleList() { + return ( + + + {fruits.map((fruit) => ( + + + { + const toast = await showToast( + Toast.Style.Success, + "title", + "selected successfully", + ); + setTimeout(() => toast.hide(), 500); + }} + /> + + showToast({ title: "Hello from custom action" }) + } + /> + + {/* Sub Menu */} + + showToast({ title: `More actions for ${fruit.name}` }) + } + > + {/* Sections inside Sub Menu */} + + {/* Sub Menu inside Section */} + + {["Breakfast boost", "Green refresh"].map((recipe) => ( + + showToast({ + title: `${recipe} smoothie recipe selected with fruit ${fruit.name}`, + }) + } + /> + ))} + + + {/* Multiple Sub Menus in a Section */} + + {["Fruit skewer", "Yogurt parfait"].map((recipe) => ( + + showToast({ + title: `${recipe} snack recipe selected with fruit ${fruit.name}`, + }) + } + /> + ))} + + + + {/* Regular action in a Sub Menu */} + + + showToast({ + title: `Random ${fruit.name} fact: ${randomFact(fruit.name)}`, + }) + } + /> + + + + } + /> + ))} + + + ); +} + +type Fruit = { + emoji: string; + name: string; + keywords: string[]; +}; + +const fruits: Fruit[] = [ + { + emoji: "🍎", + name: "Apple", + keywords: ["red", "crisp", "sweet", "orchard", "healthy"], + }, + { + emoji: "🍊", + name: "Orange", + keywords: ["citrus", "vitamin C", "juicy", "tangy", "breakfast"], + }, + { + emoji: "🍌", + name: "Banana", + keywords: ["yellow", "potassium", "smoothie", "energy", "tropical"], + }, + { + emoji: "🍉", + name: "Watermelon", + keywords: ["summer", "refreshing", "hydrating", "seeds", "picnic"], + }, + { + emoji: "🍇", + name: "Grapes", + keywords: ["wine", "cluster", "sweet", "purple", "vineyard"], + }, + { + emoji: "🍓", + name: "Strawberry", + keywords: ["berry", "jam", "dessert", "romantic", "garden"], + }, + { + emoji: "🍍", + name: "Pineapple", + keywords: ["tropical", "spiky", "Hawaiian", "sweet", "vacation"], + }, + { + emoji: "🥭", + name: "Mango", + keywords: ["tropical", "creamy", "exotic", "Indian", "smoothie"], + }, + { + emoji: "🍑", + name: "Peach", + keywords: ["fuzzy", "summer", "pit", "Georgia", "cobbler"], + }, + { + emoji: "🍐", + name: "Pear", + keywords: ["teardrop", "autumn", "crisp", "Bartlett", "elegant"], + }, + { + emoji: "🥝", + name: "Kiwi", + keywords: ["fuzzy", "green", "tangy", "New Zealand", "exotic"], + }, + { + emoji: "🍒", + name: "Cherries", + keywords: ["red", "pit", "pie", "sweet", "Michigan"], + }, + { + emoji: "🫐", + name: "Blueberries", + keywords: ["antioxidants", "pancakes", "muffin", "Maine", "superfood"], + }, + { + emoji: "🥥", + name: "Coconut", + keywords: ["tropical", "milk", "hard shell", "palm tree", "island"], + }, + { + emoji: "🍋", + name: "Lemon", + keywords: ["sour", "citrus", "yellow", "zest", "cooking"], + }, + { + emoji: "🍈", + name: "Melon", + keywords: ["cantaloupe", "orange", "sweet", "breakfast", "honeydew"], + }, + { + emoji: "🍏", + name: "Green Apple", + keywords: ["tart", "Granny Smith", "baking", "crisp", "sour"], + }, +]; + +const randomFact = (fruitName: string) => { + const facts = [ + (name: string) => `${name} are tasty!`, + (name: string) => `People love ${name.toLowerCase()}s.`, + (name: string) => `${name}s are cool.`, + ]; + + return facts[Math.floor(Math.random() * facts.length)](fruitName); +}; diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..8d9b6bb --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,18 @@ +{ + "$schema": "https://json.schemastore.org/tsconfig", + "display": "Node 16", + "include": ["src/**/*"], + "compilerOptions": { + //"lib": ["es2020"], + "module": "commonjs", + "target": "es2020", + "strict": true, + "isolatedModules": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "resolveJsonModule": true, + "jsx": "react-jsx", + "types": ["node"] + } +}