UNPKG

makelabs

Version:

Component tagging toolkit for visual editing

62 lines (57 loc) 1.59 kB
import { Plugin } from 'vite'; interface MakeLabsConfig { /** * File extensions to process * @default ['.jsx', '.tsx'] */ include?: string[]; /** * Elements to exclude from tagging * @default ['Fragment', 'React.Fragment'] */ excludeElements?: string[]; /** * Whether to exclude Three.js Fiber elements * @default true */ excludeThreeFiber?: boolean; /** * Whether to exclude Drei elements * @default true */ excludeDrei?: boolean; /** * Custom element names to exclude * @default [] */ customExcludes?: string[]; /** * Whether to generate Tailwind config JSON * @default false */ generateTailwindConfig?: boolean; /** * Path to Tailwind config file * @default './tailwind.config.ts' */ tailwindConfigPath?: string; /** * Output path for Tailwind JSON config * @default './src/tailwind.config.ml.json' */ tailwindOutputPath?: string; } interface ComponentStats { totalFiles: number; processedFiles: number; totalElements: number; } declare function findProjectRoot(startPath?: string): string; declare function shouldTagElement(elementName: string, config?: { excludeElements?: string[]; excludeThreeFiber?: boolean; excludeDrei?: boolean; customExcludes?: string[]; }): boolean; declare function visualEditorPlugin(userConfig?: MakeLabsConfig): Plugin; export { type ComponentStats, type MakeLabsConfig, findProjectRoot, shouldTagElement, visualEditorPlugin as viteTagger };