import { jsx as _jsx } from "react/jsx-runtime";
/**
 * Registry for placeholder input types
 */
class PlaceholderInputTypeRegistry {
    types = new Map();
    /**
     * Register a new placeholder input type
     */
    register(config) {
        this.types.set(config.type.toLowerCase(), config);
    }
    /**
     * Get a registered placeholder input type configuration
     */
    get(type) {
        return this.types.get(type.toLowerCase());
    }
    /**
     * Check if a type is registered
     */
    has(type) {
        return this.types.has(type.toLowerCase());
    }
}
// Create singleton instance
export const placeholderInputTypeRegistry = new PlaceholderInputTypeRegistry();
/**
 * Default text input component for placeholders
 */
const TextInput = ({ placeholder, value, onChange, onKeyDown, inputRef, autoFocus, }) => {
    return (_jsx("input", { ref: inputRef, type: "text", value: value, onChange: (e) => onChange(e.target.value), onKeyDown: onKeyDown, placeholder: placeholder.name, autoFocus: autoFocus, className: "inline-block h-7 min-w-[80px] max-w-[200px] align-middle rounded border border-blue-400 bg-blue-50 px-2 text-xs leading-5 outline-none transition-all duration-300 focus:border-blue-600 focus:bg-blue-100 focus:shadow-[0_0_12px_-3px_rgba(59,130,246,0.3)] focus:outline-none placeholder:text-blue-400", style: {
            width: `${Math.max(80, (value?.length || placeholder.name.length) * 7 + 20)}px`,
        } }));
};
// Register default text type
placeholderInputTypeRegistry.register({
    type: "text",
    component: TextInput,
});
// Import and register item selector (dynamic import to avoid circular dependencies)
import("./PlaceholderItemSelector").then((module) => {
    placeholderInputTypeRegistry.register({
        type: "item",
        component: module.PlaceholderItemSelector,
    });
});
//# sourceMappingURL=PlaceholderInputTypes.js.map