// Copyright: © 2026 TWWIM UG. All rights reserved. (www.twwim.com) /** * Plugin-settings page shared constants and form-state alias. * * @layer Presentation */ import type { PluginSettingsResponse } from '@archer/api-interface'; export type FormState = PluginSettingsResponse; /** Default form state for first-time configuration (no server record yet). */ export const DEFAULT_FORM: FormState = { visibility: { enabled: true, enabledOnMobile: true, enabledOnWeb: true, }, snippet: { theme: 'default', dock: 'middle-right', uiCacheTTL: 3600, scenario: null, domIndexer: false, deploymentTarget: null, }, attention: { enabled: true, welcome: { enabled: true, messages: { en: [], de: [] }, delaySeconds: 5, holdSeconds: 6, }, idle: { enabled: true, messages: { en: [], de: [] }, minIntervalSeconds: 60, maxIntervalSeconds: 180, displaySeconds: 5, }, }, }; /** Locales surfaced in the editor. Schema accepts any 2-letter ISO; UX caps to EN/DE for now. */ export const LOCALES: ReadonlyArray<{ code: 'en' | 'de'; labelKey: string }> = [ { code: 'en', labelKey: 'tenants.pluginSettings.localeEnglish' }, { code: 'de', labelKey: 'tenants.pluginSettings.localeGerman' }, ]; /** Dock positions surfaced in the snippet editor. Mirrors domain `DOCK_POSITIONS`. */ export const DOCK_OPTIONS: ReadonlyArray = [ 'bottom-right', 'bottom-left', 'bottom-center', 'top-right', 'top-left', 'top-center', 'middle-right', 'middle-left', 'right-center', 'left-center', ]; /** Translation function signature mirrored from TranslationProvider for prop typing. */ export type TFunction = ( key: string, variables?: Record, ) => string;