import { AccountMenuItem, PageSelectorItemInput, PillNavItemInput, SidebarToolSection, TopBarSettingsConfig, TopBarVariant } from '../types'; import { FormEnhancements, FormSchema } from '../types/form-builder'; import { ControlComponentBinding, ControlComponentBindingsById, ControlModel, ControlModelBinding, ControlSchema, ControlWorkspaceOptions } from './useControlSchema'; /** * Scoped-slot payload shared by PluginWorkspaceView's `default`, `topbar`, and `sidebar` * slots: the resolved active view plus the values and component bindings/props derived * from the compact control schema. WorkspaceControlsInternal renders a component's default * slot bound to exactly this shape. */ export interface PluginWorkspaceControlsModel { /** Currently resolved workspace view id. */ activeView: string; /** Sets the active view, updating any uncontrolled state and emitting `update:activeView`. */ setActiveView: (viewId: string) => void; /** Current control values, shared between the auto-rendered sidebar form and the default slot. */ values: Record; /** Ordered SDK component bindings resolved from the current control values. */ componentBindings: ControlComponentBinding[]; /** SDK component bindings resolved from the current control values, keyed by binding id. */ componentBindingsById: ControlComponentBindingsById; /** Flat component props resolved from the current control values. */ componentProps: Record; /** Named component prop mappings resolved from the current control values. */ componentPropsById: Record>; } /** * Resolved AppLayout + AppTopBar configuration consumed by WorkspaceShellInternal: top bar * chrome and navigation, plus the AppLayout layout/collapse props that own the responsive * mobile sidebar toggle. */ export interface PluginWorkspaceShellModel { /** AppLayout sidebar position. */ sidebarPosition: 'left' | 'right'; /** AppLayout sidebar width, forwarded so the layout can reserve space before AppSidebar mounts. */ sidebarWidth?: string; /** AppLayout floating style. */ floating: boolean; /** Convert the sidebar into an SDK-owned mobile overlay below the AppLayout breakpoint. */ responsiveSidebar: boolean; /** Accessible label for the mobile sidebar toggle. */ sidebarToggleLabel: string; /** Accessible label used when the mobile sidebar is open. */ sidebarCloseLabel: string; /** Whether AppLayout should render a `#sidebar` template at all. */ hasSidebarSurface: boolean; /** 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. */ pageSelector?: PageSelectorItemInput[]; /** Resolved active page selector id. */ currentPageSelectorId: string; /** Resolved centered pill navigation, generated from the control schema when omitted. */ pillNav?: PillNavItemInput[]; /** Resolved active centered pill id. */ 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; /** Names of AppTopBar passthrough slots the caller actually provided. */ topBarSlotNames: string[]; /** Scoped-slot payload exposed to the `topbar` override slot. */ controls: PluginWorkspaceControlsModel; } /** * Resolved AppSidebar configuration consumed by WorkspaceSidebarInternal: sidebar chrome, * panels/forms, collapse behavior, and the compact control-schema props that drive * AppSidebar's auto-generated form. */ export interface PluginWorkspaceSidebarModel { /** Sidebar chrome title. */ title?: string; /** Sidebar chrome subtitle. */ subtitle?: string; /** Optional compact badge/count rendered in the sidebar header. */ badge?: string | number; /** Map of view IDs to sidebar tool sections. */ panels: Record; /** Resolved active view, used to pick which panels/forms render. */ activeView: string; /** AppSidebar floating style (always false: PluginWorkspaceView docks the sidebar inside AppLayout). */ floating: boolean; /** Compact AppSidebar density. */ dense: boolean; /** Sidebar CSS width. */ width?: string; /** Sidebar position, mirrors the shell's `sidebarPosition`. */ side: 'left' | 'right'; /** Optional FormBuilder schemas keyed by section ID. */ forms: Record; /** DOM id for the AppSidebar scrollable content area. */ contentId?: string; /** Render the sidebar shell even when no panel matches the active view. */ showWhenEmpty: boolean; /** Optional compact control model for the generated sidebar form. */ model?: ControlModel | ControlModelBinding; /** Compact control schema for the generated sidebar form. */ controlSchema?: ControlSchema; /** Options passed to compact control schema generation. */ controlOptions: ControlWorkspaceOptions; /** Shared values for the auto-rendered sidebar form. */ values: Record; /** Runtime FormBuilder enhancements for the auto-rendered sidebar form. */ formEnhancements?: FormEnhancements>; /** Show submit/cancel actions inside the auto-rendered sidebar form. */ showFormActions: boolean; /** Loading/saving state for the auto-rendered sidebar form. */ formLoading: boolean; /** Disabled state for the auto-rendered sidebar form. */ formDisabled: boolean; /** Readonly state for the auto-rendered sidebar form. */ formReadonly: boolean; /** Size passed to the auto-rendered sidebar form. */ formSize: 'sm' | 'md' | 'lg'; /** Show a built-in collapse/expand button in the sidebar chrome. */ collapsible?: boolean; /** Controlled sidebar collapsed state. */ collapsed?: boolean; /** Initial sidebar collapsed state when uncontrolled. */ defaultCollapsed: boolean; /** Sidebar width when collapsed. */ collapsedWidth: string; /** Accessible label for the sidebar collapse action. */ collapseButtonLabel: string; /** Accessible label for the sidebar expand action. */ expandButtonLabel: string; /** Names of AppSidebar passthrough slots the caller actually provided. */ slotNames: string[]; }