import type { AccountMenuItem, ExperimentSummary, PageSelectorItem, PageSelectorItemInput, PillNavItem, PillNavItemInput, PillNavOption, SidebarToolSection, TopBarSettingsConfig, TopBarVariant, } from '../types' import type { FormEnhancements, FormSchema } from '../types/form-builder' import type { ControlComponentBinding, ControlComponentBindingsById, ControlComponentBindingsConfig, ControlComponentPropsByIdMap, ControlComponentPropsMap, ControlModel, ControlModelBinding, ControlSchema, ControlWorkspaceOptions, } from '../composables/useControlSchema' export type PluginWorkspaceSidebarVariant = 'default' | 'analysis' export interface PluginWorkspaceViewProps { /** App or plugin title shown in the top bar. */ title?: string /** Secondary copy shown under the title. */ subtitle?: string /** Top bar visual treatment. */ topBarVariant?: TopBarVariant /** Home link used by the top bar brand icon. */ homePath?: string /** Show the default MINT logo when no icon/logo slot is provided. */ showLogo?: boolean /** Preferred route-level page selector entries. Pass [] to suppress integrated platform fallback. */ pageSelector?: PageSelectorItemInput[] /** Active page selector id. Defaults to activeView. */ currentPageSelectorId?: string /** Preferred centered navigation for local modes inside the current route. */ pillNav?: PillNavItemInput[] /** Active centered pill id. Defaults to activeView. */ currentPillId?: string /** Show the theme toggle button. */ showThemeToggle?: boolean /** Show the settings button and modal. */ showSettings?: boolean /** Built-in settings modal configuration. */ settingsConfig?: TopBarSettingsConfig /** Show the standalone badge when not integrated into the platform. */ showStandaloneLabel?: boolean /** Custom standalone badge label. */ standaloneLabel?: string /** Account dropdown entries. */ accountMenu?: AccountMenuItem[] /** Show the notifications icon button. */ showNotifications?: boolean /** Draw a notification dot on the notifications icon. */ hasNotificationDot?: boolean /** Show the admin shortcut. */ showAdmin?: boolean /** Route used by the admin shortcut. */ adminPath?: string /** Account display name. */ userName?: string /** Explicit account avatar initial. */ userInitial?: string /** Account email shown in the avatar menu. */ userEmail?: string /** Enable the built-in AppTopBar experiment popover and selector flow. The current experiment comes from the shared experiment store, not from a prop. Keep this comment on one line — the docs extractor drops multi-line JSDoc. */ experimentShell?: boolean /** Save handler used by the AppTopBar experiment chip. Return a message to flash success. */ experimentSave?: () => string | null | Promise /** Disable the experiment save action. */ experimentSaveDisabled?: boolean /** Tooltip shown when the experiment save action is disabled. */ experimentSaveDisabledMessage?: string /** Active workspace view used by top bar navigation and sidebar panels. */ activeView?: string /** Initial active view when activeView is uncontrolled. */ defaultActiveView?: string /** Map of view IDs to sidebar tool sections. */ panels?: Record /** Optional FormBuilder schemas keyed by section ID. */ forms?: Record /** Sidebar chrome title. */ sidebarTitle?: string /** Sidebar chrome subtitle. */ sidebarSubtitle?: string /** Optional compact badge/count rendered in the sidebar header. */ sidebarBadge?: string | number /** @deprecated No-op, removed in MINT 1.4. AppSidebar has one look now; the former `analysis` preset is the default. */ sidebarVariant?: PluginWorkspaceSidebarVariant /** Sidebar CSS width. Defaults to AppSidebar's width. */ sidebarWidth?: string /** Sidebar position in AppLayout. */ sidebarPosition?: 'left' | 'right' /** Convert the sidebar into an SDK-owned mobile overlay below the AppLayout breakpoint. */ responsiveSidebar?: boolean /** Render the sidebar shell even when no panel matches the active view. */ showSidebarWhenEmpty?: boolean /** Disable the built-in sidebar surface entirely. */ showSidebar?: boolean /** DOM id for the AppSidebar scrollable content area. Use with route/tab-owned Teleport sidebars. */ sidebarContentId?: string /** Compact AppSidebar density. */ dense?: boolean /** Show a built-in collapse/expand button in the sidebar chrome. Defaults to true. */ sidebarCollapsible?: boolean /** Sidebar width when collapsed. */ sidebarCollapsedWidth?: string /** Accessible label for the sidebar collapse action. */ sidebarCollapseButtonLabel?: string /** Accessible label for the sidebar expand action. */ sidebarExpandButtonLabel?: string /** Floating AppLayout style. */ floating?: boolean /** Optional compact control model for generated sidebar forms. */ model?: ControlModel | ControlModelBinding /** Compact control schema for generated sidebar forms. */ controls?: ControlSchema /** Options passed to compact control schema generation. */ controlOptions?: ControlWorkspaceOptions /** Optional SDK component bindings exposed to the default slot with resolved props. */ componentBindings?: ControlComponentBindingsConfig /** Optional mapping from workspace values to component props exposed to the default slot. */ componentProps?: ControlComponentPropsMap /** Optional named mappings from workspace values to component props exposed to the default slot. */ componentPropsById?: ControlComponentPropsByIdMap /** Shared values for auto-rendered sidebar forms. Supports default v-model. */ modelValue?: Record /** Shared values for auto-rendered sidebar forms. */ values?: Record /** Runtime FormBuilder enhancements for auto-rendered sidebar forms. */ formEnhancements?: FormEnhancements> /** Show submit/cancel actions inside auto-rendered sidebar forms. */ showFormActions?: boolean /** Loading/saving state for auto-rendered sidebar forms. */ formLoading?: boolean /** Disabled state for auto-rendered sidebar forms. */ formDisabled?: boolean /** Readonly state for auto-rendered sidebar forms. */ formReadonly?: boolean /** Size passed to auto-rendered sidebar forms. */ formSize?: 'sm' | 'md' | 'lg' /** Controlled sidebar collapsed state. */ sidebarCollapsed?: boolean /** Initial sidebar collapsed state when uncontrolled. */ defaultSidebarCollapsed?: boolean /** Accessible label for the mobile sidebar toggle. */ sidebarToggleLabel?: string /** Accessible label used when the mobile sidebar is open. */ sidebarCloseLabel?: string } /** * Event map for PluginWorkspaceView, shared with the {@link usePluginWorkspace} composable * so its internal pieces can emit through the exact same typed contract as the public component. */ export interface PluginWorkspaceViewEmits { 'update:activeView': [value: string] 'page-selector-select': [page: PageSelectorItem] 'pill-select': [item: PillNavItem] 'pill-option-select': [option: PillNavOption, item: PillNavItem] 'account-menu-select': [item: AccountMenuItem] 'sign-out': [] 'notifications-click': [] 'settings-values-change': [data: Record] 'admin-click': [] 'experiment-select': [experiment: ExperimentSummary] 'experiment-detach': [] 'update:modelValue': [values: Record] 'update:values': [values: Record] 'update:sidebarCollapsed': [value: boolean] 'update:toggle': [sectionId: string, value: boolean] 'section-action': [sectionId: string, actionId: string] 'form-submit': [sectionId: string, values: Record] 'form-cancel': [sectionId: string] } /** Typed `emit` function shape produced by `defineEmits()`. */ export type PluginWorkspaceViewEmit = ( event: K, ...args: PluginWorkspaceViewEmits[K] ) => void export interface PluginWorkspaceSlotProps { activeView: string setActiveView: (viewId: string) => void values: Record componentBindings: ControlComponentBinding[] componentBindingsById: ControlComponentBindingsById componentProps: Record componentPropsById: Record> } export type PluginWorkspaceForwardedSlotProps = Record