feat(gallery): add public templates gallery frontend (Tasks 4 & 5)

Add types, API client, page component, card components, detail modal,
and /templates route for the public templates gallery. Uses raw fetch()
for unauthenticated access, glass-card design system, and URL-synced
filters with debounced search.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-19 19:18:58 +00:00
parent bacdb9d466
commit 2b657fc4ac
9 changed files with 1089 additions and 0 deletions

View File

@@ -94,3 +94,4 @@ export type {
export * from './scripts'
export * from './integrations'
export * from './notification'
export type * from './public-templates'

View File

@@ -0,0 +1,60 @@
export interface PublicFlowTemplate {
id: string
name: string
description: string | null
category: string | null
tree_type: string
step_count: number
usage_count: number
success_rate: number | null
tags: string[]
preview_structure: Record<string, unknown> | null
created_at: string
}
export interface PublicScriptTemplate {
id: string
name: string
description: string | null
category_name: string | null
category_icon: string | null
complexity: string | null
tags: string[]
parameter_count: number
requires_elevation: boolean
requires_modules: string[]
usage_count: number
is_verified: boolean
created_at: string
}
export interface PublicGalleryResponse {
flow_templates: PublicFlowTemplate[]
script_templates: PublicScriptTemplate[]
total_flows: number
total_scripts: number
categories: string[]
domains: string[]
}
export interface PublicFlowDetail extends PublicFlowTemplate {}
export interface PublicScriptDetail {
id: string
name: string
description: string | null
category_name: string | null
complexity: string | null
tags: string[]
parameters: Array<{ name: string; description: string; type: string }>
requires_elevation: boolean
requires_modules: string[]
usage_count: number
is_verified: boolean
created_at: string
}
export interface GalleryCategory {
name: string
count: number
}