11import { ToolOrientation , ToolMetadata } from '../../ToolController_/types/tool' ;
2- import { PanelPosition , PanelState , PanelLayoutType } from './layout' ;
2+ import {
3+ PanelPosition ,
4+ EdgePanelPosition ,
5+ FloatPanelPosition ,
6+ PanelState ,
7+ PanelLayoutType ,
8+ } from './layout' ;
39
410/**
511 * Panel size configuration.
@@ -98,7 +104,8 @@ export interface PanelCapabilities {
98104
99105 /**
100106 * Whether this panel can be resized by the user via drag handles.
101- * Default: false
107+ * Default: false. Not supported on floating panels — dragging happens
108+ * via move handles instead, so this must be false/omitted there.
102109 */
103110 resizable ?: boolean ;
104111
@@ -116,29 +123,16 @@ export interface PanelCapabilities {
116123}
117124
118125/**
119- * Complete configuration for a panel region.
120- * Defines behavior, constraints, and appearance .
126+ * Fields shared by every panel, regardless of whether it's an edge or
127+ * floating panel .
121128 */
122- export interface PanelConfig {
129+ interface BasePanelConfig {
123130 /** Unique identifier for this panel */
124131 id : string ;
125132
126133 /** Display title for the panel */
127134 title ?: string ;
128135
129- /** Which region this panel occupies */
130- position : PanelPosition ;
131-
132- /**
133- * Layout priority for space allocation.
134- * Lower numbers claim viewport space first.
135- * Example: top=0, right=1, bottom=2, left=3
136- */
137- priority : PanelPriority ;
138-
139- /** How tools are laid out when panel is in 'expanded' state */
140- layoutType : PanelLayoutType ;
141-
142136 /** Which states are allowed and what the default state is */
143137 stateConstraints : PanelStateConstraints ;
144138
@@ -168,6 +162,56 @@ export interface PanelConfig {
168162 panelTools ?: string [ ] ;
169163}
170164
165+ /**
166+ * Configuration for an edge panel (top/left/right/bottom).
167+ * Edge panels compete for viewport space, so `priority` (stacking/allocation
168+ * order) and `layoutType` (how multiple tools are arranged) are required.
169+ */
170+ export interface EdgePanelConfig extends BasePanelConfig {
171+ /** Which edge region this panel occupies */
172+ position : EdgePanelPosition ;
173+
174+ /**
175+ * Layout priority for space allocation.
176+ * Lower numbers claim viewport space first.
177+ * Example: top=0, right=1, bottom=2, left=3
178+ */
179+ priority : PanelPriority ;
180+
181+ /** How tools are laid out when panel is in 'expanded' state */
182+ layoutType : PanelLayoutType ;
183+ }
184+
185+ /**
186+ * Configuration for a floating panel, rendered as an overlay inside the
187+ * center map area. Floats don't compete for edge viewport space, so
188+ * `priority` and `layoutType` are optional, and drag-resize isn't supported.
189+ */
190+ export interface FloatPanelConfig extends BasePanelConfig {
191+ /** Which float zone this panel occupies */
192+ position : FloatPanelPosition ;
193+
194+ /**
195+ * Not used for float layout/rendering, but still affects fallback tool
196+ * assignment: ToolControllerModern_._findPanel picks the first compatible
197+ * panel from the combined edge+float priority order, so a low priority
198+ * here can out-rank an edge panel for an unassigned tool.
199+ */
200+ priority ?: PanelPriority ;
201+
202+ /** Accepted but inert for floats — _renderFloatRegions always stacks tools regardless of this value */
203+ layoutType ?: PanelLayoutType ;
204+
205+ /** Floats can't be drag-resized; `resizable` must be false/omitted */
206+ capabilities ?: Omit < PanelCapabilities , 'resizable' > & { resizable ?: false } ;
207+ }
208+
209+ /**
210+ * Complete configuration for a panel region.
211+ * Defines behavior, constraints, and appearance.
212+ */
213+ export type PanelConfig = EdgePanelConfig | FloatPanelConfig ;
214+
171215/**
172216 * Runtime state object for an active panel.
173217 * Tracks current state, configuration, and associated tools.
0 commit comments