From cb8755f59e82e2da649ec1660c2857feb9b9cb23 Mon Sep 17 00:00:00 2001 From: Santhosh Janardhanan Date: Sun, 12 Apr 2026 23:04:23 -0400 Subject: [PATCH] chore: reformat styles.ts and enrich GoT prompt modifiers with character references --- src/lib/styles.ts | 254 +++++++++++++++++++++++++++++++++++++--------- 1 file changed, 204 insertions(+), 50 deletions(-) diff --git a/src/lib/styles.ts b/src/lib/styles.ts index 4912554..88d734e 100644 --- a/src/lib/styles.ts +++ b/src/lib/styles.ts @@ -1,73 +1,227 @@ -import type { Style, StyleCategory } from './types'; +import type { Style, StyleCategory } from "./types"; export const categories: StyleCategory[] = [ - { id: 'general', label: 'General', emoji: '🎭' }, - { id: 'british', label: 'British Slang', emoji: 'πŸ‡¬πŸ‡§' }, - { id: 'american', label: 'American Slang', emoji: 'πŸ‡ΊπŸ‡Έ' }, - { id: 'fun', label: 'Fun', emoji: 'πŸ΄β€β˜ οΈ' }, - { id: 'got', label: 'Game of Thrones', emoji: 'πŸ‰' }, - { id: 'dystopian', label: 'Dystopian', emoji: 'πŸ“°' } + { id: "general", label: "General", emoji: "🎭" }, + { id: "british", label: "British Slang", emoji: "πŸ‡¬πŸ‡§" }, + { id: "american", label: "American Slang", emoji: "πŸ‡ΊπŸ‡Έ" }, + { id: "fun", label: "Fun", emoji: "πŸ΄β€β˜ οΈ" }, + { id: "got", label: "Game of Thrones", emoji: "πŸ‰" }, + { id: "dystopian", label: "Dystopian", emoji: "πŸ“°" }, ]; export const styles: Style[] = [ - // General - { id: 'sarcastic', label: 'Sarcastic', categoryId: 'general', promptModifier: 'Rewrite in a sarcastic, snarky tone with biting wit' }, - { id: 'formal', label: 'Formal', categoryId: 'general', promptModifier: 'Rewrite in a highly formal, professional tone' }, - { id: 'casual', label: 'Casual', categoryId: 'general', promptModifier: 'Rewrite in a laid-back, casual conversational tone' }, - { id: 'academic', label: 'Academic', categoryId: 'general', promptModifier: 'Rewrite in an academic, scholarly tone with precise language' }, - { id: 'poetic', label: 'Poetic', categoryId: 'general', promptModifier: 'Rewrite in a poetic, lyrical style with imagery and rhythm' }, - { id: 'passive-aggressive', label: 'Passive-Aggressive', categoryId: 'general', promptModifier: 'Rewrite in a passive-aggressive tone with backhanded compliments' }, + // General + { + id: "sarcastic", + label: "Sarcastic", + categoryId: "general", + promptModifier: "Rewrite in a sarcastic, snarky tone with biting wit", + }, + { + id: "formal", + label: "Formal", + categoryId: "general", + promptModifier: "Rewrite in a highly formal, professional tone", + }, + { + id: "casual", + label: "Casual", + categoryId: "general", + promptModifier: "Rewrite in a laid-back, casual conversational tone", + }, + { + id: "academic", + label: "Academic", + categoryId: "general", + promptModifier: + "Rewrite in an academic, scholarly tone with precise language", + }, + { + id: "poetic", + label: "Poetic", + categoryId: "general", + promptModifier: + "Rewrite in a poetic, lyrical style with imagery and rhythm", + }, + { + id: "passive-aggressive", + label: "Passive-Aggressive", + categoryId: "general", + promptModifier: + "Rewrite in a passive-aggressive tone with backhanded compliments", + }, - // British Slang - { id: 'british-polite', label: 'Polite (British)', categoryId: 'british', promptModifier: 'Rewrite in polite British English with understated courtesy' }, - { id: 'british-formal', label: 'Formal (British)', categoryId: 'british', promptModifier: 'Rewrite in formal British English with proper stiff-upper-lip expression' }, - { id: 'british-witty', label: 'Witty (British)', categoryId: 'british', promptModifier: 'Rewrite in witty British style with dry humor and clever wordplay' }, - { id: 'british-gentlemanly', label: 'Gentlemanly', categoryId: 'british', promptModifier: 'Rewrite as a proper British gentleman would speak' }, - { id: 'british-upper-class', label: 'Upper Class', categoryId: 'british', promptModifier: 'Rewrite in the manner of British upper-class speech with RP accent sensibilities' }, - { id: 'british-royal', label: 'Royal', categoryId: 'british', promptModifier: 'Rewrite as if speaking with royal British formality and majesty' }, - { id: 'british-victorian', label: 'Victorian', categoryId: 'british', promptModifier: 'Rewrite in Victorian-era British English with archaic formality' }, - { id: 'british-downton', label: 'Downton Abbey', categoryId: 'british', promptModifier: 'Rewrite in the style of Downton Abbey characters' }, + // British Slang + { + id: "british-polite", + label: "Polite (British)", + categoryId: "british", + promptModifier: + "Rewrite in polite British English with understated courtesy", + }, + { + id: "british-formal", + label: "Formal (British)", + categoryId: "british", + promptModifier: + "Rewrite in formal British English with proper stiff-upper-lip expression", + }, + { + id: "british-witty", + label: "Witty (British)", + categoryId: "british", + promptModifier: + "Rewrite in witty British style with dry humor and clever wordplay", + }, + { + id: "british-gentlemanly", + label: "Gentlemanly", + categoryId: "british", + promptModifier: "Rewrite as a proper British gentleman would speak", + }, + { + id: "british-upper-class", + label: "Upper Class", + categoryId: "british", + promptModifier: + "Rewrite in the manner of British upper-class speech with RP accent sensibilities", + }, + { + id: "british-royal", + label: "Royal", + categoryId: "british", + promptModifier: + "Rewrite as if speaking with royal British formality and majesty", + }, + { + id: "british-victorian", + label: "Victorian", + categoryId: "british", + promptModifier: + "Rewrite in Victorian-era British English with archaic formality", + }, + { + id: "british-downton", + label: "Downton Abbey", + categoryId: "british", + promptModifier: "Rewrite in the style of Downton Abbey characters", + }, - // American Slang - { id: 'american-new-yorker', label: 'New Yorker', categoryId: 'american', promptModifier: 'Rewrite in a New York City style with directness and local flavor' }, - { id: 'american-black-slang', label: 'Black American Slang', categoryId: 'american', promptModifier: 'Rewrite in Black American Vernacular English (AAVE) with cultural flair' }, - { id: 'american-southern', label: 'Southern', categoryId: 'american', promptModifier: 'Rewrite with Southern American charm and hospitality' }, - { id: 'american-redneck', label: 'Redneck', categoryId: 'american', promptModifier: 'Rewrite in a rural American redneck style with country twang' }, + // American Slang + { + id: "american-new-yorker", + label: "New Yorker", + categoryId: "american", + promptModifier: + "Rewrite in a New York City style with directness and local flavor", + }, + { + id: "american-black-slang", + label: "Black American Slang", + categoryId: "american", + promptModifier: + "Rewrite in Black American Vernacular English (AAVE) with cultural flair", + }, + { + id: "american-southern", + label: "Southern", + categoryId: "american", + promptModifier: "Rewrite with Southern American charm and hospitality", + }, + { + id: "american-redneck", + label: "Redneck", + categoryId: "american", + promptModifier: + "Rewrite in a rural American redneck style with country twang", + }, - // Fun - { id: 'pirate', label: 'Pirate', categoryId: 'fun', promptModifier: 'Rewrite like a pirate with arrrs and nautical terms' }, - { id: 'shakespearean', label: 'Shakespearean', categoryId: 'fun', promptModifier: 'Rewrite in Shakespearean English with thee, thou, and poetic flourish' }, - { id: 'gen-z', label: 'Gen Z Slang', categoryId: 'fun', promptModifier: 'Rewrite in Gen Z slang with no cap, fr, and modern internet vernacular' }, + // Fun + { + id: "pirate", + label: "Pirate", + categoryId: "fun", + promptModifier: "Rewrite like a pirate with arrrs and nautical terms", + }, + { + id: "shakespearean", + label: "Shakespearean", + categoryId: "fun", + promptModifier: + "Rewrite in Shakespearean English with thee, thou, and poetic flourish", + }, + { + id: "gen-z", + label: "Gen Z Slang", + categoryId: "fun", + promptModifier: + "Rewrite in Gen Z slang with no cap, fr, and modern internet vernacular", + }, - // Game of Thrones - { id: 'got-kings-landing', label: "King's Landing", categoryId: 'got', promptModifier: 'Rewrite as a scheming noble from Kings Landing would speak' }, - { id: 'got-wildlings', label: 'Wildlings', categoryId: 'got', promptModifier: 'Rewrite in the rough, free-spirited manner of the Free Folk wildlings' }, - { id: 'got-winterfell', label: 'Winterfell', categoryId: 'got', promptModifier: 'Rewrite with the honor-bound stoicism of a Stark from Winterfell' }, + // Game of Thrones + { + id: "got-kings-landing", + label: "King's Landing", + categoryId: "got", + promptModifier: + "Rewrite as Cersi, Tywin, Tyrion or a scheming noble from Kings Landing would speak", + }, + { + id: "got-wildlings", + label: "Wildlings", + categoryId: "got", + promptModifier: + "Rewrite in the rough, free-spirited manner of the Free Folk wildlings, like how Ygritte talks", + }, + { + id: "got-winterfell", + label: "Winterfell", + categoryId: "got", + promptModifier: + "Rewrite with the honor-bound stoicism of a Stark from Winterfell", + }, - // Dystopian - { id: 'newspeak', label: 'Newspeak (Orwellian)', categoryId: 'dystopian', promptModifier: 'Rewrite in Orwellian Newspeak, minimizing vocabulary and thought as the Party demands' } + // Dystopian + { + id: "newspeak", + label: "Newspeak (Orwellian)", + categoryId: "dystopian", + promptModifier: + "Rewrite in Orwellian Newspeak, minimizing vocabulary and thought as the Party demands", + }, ]; -export const intensityMap: Record = { - 1: { label: 'Subtle', instruction: 'lightly hint at a {style} tone' }, - 2: { label: 'Moderate', instruction: 'rewrite with a {style} tone' }, - 3: { label: 'Strong', instruction: 'rewrite strongly in a {style} style' }, - 4: { label: 'Heavy', instruction: 'rewrite completely in {style} β€” fully commit to the voice' }, - 5: { label: 'Maximum', instruction: 'go absolutely all-out {style} β€” no restraint' } +export const intensityMap: Record< + number, + { label: string; instruction: string } +> = { + 1: { label: "Subtle", instruction: "lightly hint at a {style} tone" }, + 2: { label: "Moderate", instruction: "rewrite with a {style} tone" }, + 3: { label: "Strong", instruction: "rewrite strongly in a {style} style" }, + 4: { + label: "Heavy", + instruction: "rewrite completely in {style} β€” fully commit to the voice", + }, + 5: { + label: "Maximum", + instruction: "go absolutely all-out {style} β€” no restraint", + }, }; export function getStylesByCategory(categoryId: string): Style[] { - return styles.filter((s) => s.categoryId === categoryId); + return styles.filter((s) => s.categoryId === categoryId); } export function getStyleById(styleId: string): Style | undefined { - return styles.find((s) => s.id === styleId); + return styles.find((s) => s.id === styleId); } export function getCategoryById(categoryId: string): StyleCategory | undefined { - return categories.find((c) => c.id === categoryId); + return categories.find((c) => c.id === categoryId); } -export function getIntensityConfig(intensity: number): { label: string; instruction: string } | undefined { - return intensityMap[intensity]; -} \ No newline at end of file +export function getIntensityConfig( + intensity: number, +): { label: string; instruction: string } | undefined { + return intensityMap[intensity]; +}