import type { AttachOptions, ColorScheme } from './types'; /** * FeedbackWidget manages individual feedback UI components */ export declare class FeedbackWidget { private targetElement; private originalText; private apiKey; private options; private isExpanded; private selectedFeedback; private selectedType; private useShadowDOM; private container; private shadowRoot; private trigger; private optionsPanel; private selectedIconContainer; private statusRegion; private feedbackButtons; private wrapper; private isInputElement; private debounceTimer; private boundInputHandler; private boundBlurHandler; private widgetStyle; private colorScheme; private placementVertical; private placementHorizontal; private isShowingExplanation; private isShowingSummary; private explanationText; private explanationDebounceTimer; private explanationContainer; private explanationSample; private highlightSource; private hasNotifiedFirstInteraction; constructor(targetElement: HTMLElement, originalText: string, apiKey: string, options?: AttachOptions); /** * Check if Shadow DOM is supported */ private supportsShadowDOM; /** * Initialize the widget */ private init; /** * Wrap an input/textarea element with a container for the widget */ private wrapInputElement; /** * Get the effective color scheme class (resolves 'system' to actual preference) */ private getColorSchemeClass; /** * Get the placement CSS classes based on configuration */ private getPlacementClasses; /** * Render the widget HTML and attach events */ private render; /** * Attach event listeners to widget elements */ private attachEvents; /** * Handle keyboard navigation within the options panel */ private handleKeyboardNavigation; /** * Toggle the options panel visibility */ private toggleOptions; /** * Notify parent of first interaction (triggers auto-highlight removal for all widgets) */ private notifyFirstInteraction; /** * Show summary view of existing feedback */ private showFeedbackSummary; /** * Handle feedback change in summary view */ private handleSummaryFeedbackChange; /** * Close the summary UI */ private closeSummaryUI; /** * Hide the options panel */ private hideOptions; /** * Remove the pulsating highlight effect * For explicit highlights (attribute), this removes both class and attribute * For auto highlights, the attribute was never there so only class is removed */ private removeHighlight; /** * Remove auto-highlight (called by parent when first interaction occurs on any widget) * Only removes highlight if it was auto-applied, not explicit */ removeAutoHighlight(): void; /** * Announce a message to screen readers via aria-live region */ private announce; /** * Handle feedback selection */ private handleFeedback; /** * Determine whether to show the explanation prompt after feedback * Priority: element attribute (float 0-1) > instance sample rate */ private shouldShowExplanation; /** * Show the explanation textarea UI after feedback selection */ private showExplanationUI; /** * Handle explanation textarea input with debouncing */ private handleExplanationInput; /** * Handle explanation textarea blur - send immediately but don't close * (closing is handled by document click handler or X button) */ private handleExplanationBlur; /** * Handle explicit submit button click - send explanation and close UI */ private handleExplanationSubmit; /** * Send explanation to the API */ private sendExplanation; /** * Close the explanation UI and restore normal state */ private closeExplanationUI; /** * Send feedback to the API (creates new or updates existing) */ private sendFeedback; /** * Set up monitoring for input/textarea value changes */ private setupInputMonitoring; /** * Handle input changes with debouncing */ private handleInputChange; /** * Handle blur event - send immediately without debounce */ private handleInputBlur; /** * Send revised output to the API */ private sendRevisedOutput; /** * Update the color scheme dynamically * @param colorScheme - The new color scheme ('light', 'dark', or 'system') */ setColorScheme(colorScheme: ColorScheme): void; /** * Remove the widget from the DOM and clean up event listeners */ destroy(): void; } //# sourceMappingURL=feedback-widget.d.ts.map