mirror of
https://github.com/placeholder-soft/web.git
synced 2026-04-28 19:05:28 +08:00
* Install fetch event source to handle SSEs * Add docs chatbot modal UI. * Update Modal and Icon components. * Add no scroll class. * Add DocChat component. * Installed fetch event source. * Add light theme styles. Clean up code. * Remove unneeded React import. * Adjust copy as deployment test change. * Undo test changes. * Add Mendable URLs to CSP. * Add markdown rendering support for chatbot responses. * Yarn lock update. * Adjust modal layout spacing. * Fix chatbot modal styling for mobile screens. * Add UI for rating bot responses. * Temporarily disable response rating feature. * Add server API endpoint for processing Base GPT response rating requests. * Update csp for new API version. * Add CCA events for GPT interactions. Fix id data types. * Swap in prod client-side API keys. * Use session storage for conversation data. * Swap in prod client-side API keys. * Remove unneeded log. * Simplify state updates. * Replace dangerouslySetInnerHTML with useRef innerHTML. * Updated yarn.lock * Swap in test API key for dev. * Fix typo. * Swap in prod client-side key. * Temporarily remove sources. Adjust scroll behavior. Adjust modal close handler. Update API keys.
81 lines
1.7 KiB
TypeScript
81 lines
1.7 KiB
TypeScript
/* eslint-disable @typescript-eslint/triple-slash-reference */
|
|
|
|
/// <reference types="@docusaurus/module-type-aliases" />
|
|
/// <reference types="@docusaurus/plugin-content-blog" />
|
|
/// <reference types="@docusaurus/plugin-content-pages" />
|
|
|
|
enum ComponentType {
|
|
unknown = 'unknown',
|
|
banner = 'banner',
|
|
button = 'button',
|
|
card = 'card',
|
|
chart = 'chart',
|
|
content_script = 'content_script',
|
|
dropdown = 'dropdown',
|
|
link = 'link',
|
|
page = 'page',
|
|
modal = 'modal',
|
|
table = 'table',
|
|
search_bar = 'search_bar',
|
|
service_worker = 'service_worker',
|
|
text = 'text',
|
|
text_input = 'text_input',
|
|
tray = 'tray',
|
|
checkbox = 'checkbox',
|
|
icon = 'icon',
|
|
}
|
|
|
|
enum ActionType {
|
|
unknown = 'unknown',
|
|
blur = 'blur',
|
|
click = 'click',
|
|
change = 'change',
|
|
dismiss = 'dismiss',
|
|
focus = 'focus',
|
|
hover = 'hover',
|
|
select = 'select',
|
|
measurement = 'measurement',
|
|
move = 'move',
|
|
process = 'process',
|
|
render = 'render',
|
|
scroll = 'scroll',
|
|
view = 'view',
|
|
search = 'search',
|
|
keyPress = 'keyPress',
|
|
}
|
|
|
|
enum AnalyticsEventImportance {
|
|
low = 'low',
|
|
high = 'high',
|
|
}
|
|
|
|
type CCAEventData = {
|
|
// Standard Attributes
|
|
action: ActionType;
|
|
component_type: ComponentType;
|
|
// Custom Attributes
|
|
doc_helpful?: boolean;
|
|
doc_feedback_reason?: string | null;
|
|
page_path?: string;
|
|
conversation_id?: number;
|
|
message_id?: number;
|
|
response_helpful?: boolean;
|
|
};
|
|
|
|
export type LogEvent = (
|
|
eventName: string,
|
|
eventData: CCAEventData,
|
|
importance?: AnalyticsEventImportance,
|
|
) => void;
|
|
|
|
declare global {
|
|
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
|
|
interface Window {
|
|
ClientAnalytics?: {
|
|
logEvent: LogEvent;
|
|
ActionType: typeof ActionType;
|
|
ComponentType: typeof ComponentType;
|
|
};
|
|
}
|
|
}
|