@principal-ade/panel-layouts 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +466 -0
- package/dist/index.d.ts +580 -0
- package/dist/index.esm.js +767 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/package.json +86 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,580 @@
|
|
|
1
|
+
import { AnimatedResizableLayout } from '@a24z/panels';
|
|
2
|
+
import { AnimatedResizableLayoutProps } from '@a24z/panels';
|
|
3
|
+
import { AnimatedVerticalLayout } from '@a24z/panels';
|
|
4
|
+
import { AnimatedVerticalLayoutProps } from '@a24z/panels';
|
|
5
|
+
import { AnimationConfig } from '@a24z/panels';
|
|
6
|
+
import { CollapseButtonConfig } from '@a24z/panels';
|
|
7
|
+
import { CollapsibleSide } from '@a24z/panels';
|
|
8
|
+
import { ConfigurablePanelLayout } from '@a24z/panels';
|
|
9
|
+
import { ConfigurablePanelLayoutProps } from '@a24z/panels';
|
|
10
|
+
import { mapThemeToPanelVars } from '@a24z/panels';
|
|
11
|
+
import { mapThemeToTabVars } from '@a24z/panels';
|
|
12
|
+
import { PanelCallbacks } from '@a24z/panels';
|
|
13
|
+
import { PanelConfigurator } from '@a24z/panels';
|
|
14
|
+
import { PanelConfiguratorProps } from '@a24z/panels';
|
|
15
|
+
import { PanelDefinition } from '@a24z/panels';
|
|
16
|
+
import { PanelDefinitionWithContent } from '@a24z/panels';
|
|
17
|
+
import { PanelGroup } from '@a24z/panels';
|
|
18
|
+
import { PanelLayout } from '@a24z/panels';
|
|
19
|
+
import { PanelOrientation } from '@a24z/panels';
|
|
20
|
+
import { PanelSlot } from '@a24z/panels';
|
|
21
|
+
import { SnapCarousel } from '@a24z/panels';
|
|
22
|
+
import { SnapCarouselProps } from '@a24z/panels';
|
|
23
|
+
import { SnapCarouselRef } from '@a24z/panels';
|
|
24
|
+
import { TabGroup } from '@a24z/panels';
|
|
25
|
+
import { TabGroupProps } from '@a24z/panels';
|
|
26
|
+
import { TabsConfig } from '@a24z/panels';
|
|
27
|
+
import { Theme } from '@a24z/panels';
|
|
28
|
+
import { ThemeMode } from '@a24z/panels';
|
|
29
|
+
import { ThreePanelLayout } from '@a24z/panels';
|
|
30
|
+
import { ThreePanelLayoutProps } from '@a24z/panels';
|
|
31
|
+
import { TilesConfig } from '@a24z/panels';
|
|
32
|
+
import { useLocalStorage } from '@a24z/panels';
|
|
33
|
+
import { useMediaQuery } from '@a24z/panels';
|
|
34
|
+
|
|
35
|
+
export { AnimatedResizableLayout }
|
|
36
|
+
|
|
37
|
+
export { AnimatedResizableLayoutProps }
|
|
38
|
+
|
|
39
|
+
export { AnimatedVerticalLayout }
|
|
40
|
+
|
|
41
|
+
export { AnimatedVerticalLayoutProps }
|
|
42
|
+
|
|
43
|
+
export { AnimationConfig }
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Built-in workspace IDs
|
|
47
|
+
*/
|
|
48
|
+
export declare type BuiltInWorkspaceId = 'project-management' | 'code-review' | 'documentation' | 'agent-work' | 'quality-check' | 'drawing' | 'old-school' | 'principal-office';
|
|
49
|
+
|
|
50
|
+
export { CollapseButtonConfig }
|
|
51
|
+
|
|
52
|
+
export { CollapsibleSide }
|
|
53
|
+
|
|
54
|
+
export { ConfigurablePanelLayout }
|
|
55
|
+
|
|
56
|
+
export { ConfigurablePanelLayoutProps }
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Options for creating a new workspace
|
|
60
|
+
*/
|
|
61
|
+
export declare interface CreateWorkspaceOptions {
|
|
62
|
+
name: string;
|
|
63
|
+
layout: PanelLayout;
|
|
64
|
+
description?: string;
|
|
65
|
+
defaultSizes?: {
|
|
66
|
+
left: number;
|
|
67
|
+
middle: number;
|
|
68
|
+
right: number;
|
|
69
|
+
};
|
|
70
|
+
defaultCollapsed?: {
|
|
71
|
+
left?: boolean;
|
|
72
|
+
right?: boolean;
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Default localStorage-based persistence adapter for web applications
|
|
78
|
+
*/
|
|
79
|
+
export declare class LocalStoragePersistenceAdapter implements PersistenceAdapter {
|
|
80
|
+
private storageKey;
|
|
81
|
+
load(viewKey: string): Promise<any>;
|
|
82
|
+
save(viewKey: string, state: {
|
|
83
|
+
sizes: PanelSizes | TwoPanelSizes;
|
|
84
|
+
}): Promise<void>;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export declare class LocalStorageWorkspaceAdapter implements WorkspaceStorageAdapter {
|
|
88
|
+
private readonly PRESETS_KEY;
|
|
89
|
+
private readonly REPO_STATE_PREFIX;
|
|
90
|
+
/**
|
|
91
|
+
* Load all user-created workspace presets
|
|
92
|
+
*/
|
|
93
|
+
loadWorkspacePresets(): Promise<Record<string, WorkspaceLayout>>;
|
|
94
|
+
/**
|
|
95
|
+
* Save workspace presets
|
|
96
|
+
*/
|
|
97
|
+
saveWorkspacePresets(presets: Record<string, WorkspaceLayout>): Promise<void>;
|
|
98
|
+
/**
|
|
99
|
+
* Load repository-specific workspace state
|
|
100
|
+
*/
|
|
101
|
+
loadRepositoryState(repositoryKey: string): Promise<RepositoryWorkspaceState | null>;
|
|
102
|
+
/**
|
|
103
|
+
* Save repository-specific workspace state
|
|
104
|
+
*/
|
|
105
|
+
saveRepositoryState(repositoryKey: string, state: RepositoryWorkspaceState): Promise<void>;
|
|
106
|
+
/**
|
|
107
|
+
* Load all repository states
|
|
108
|
+
*/
|
|
109
|
+
loadAllRepositoryStates(): Promise<Record<string, RepositoryWorkspaceState>>;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export { mapThemeToPanelVars }
|
|
113
|
+
|
|
114
|
+
export { mapThemeToTabVars }
|
|
115
|
+
|
|
116
|
+
export { PanelCallbacks }
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Collapsed state for panels
|
|
120
|
+
*/
|
|
121
|
+
export declare interface PanelCollapsed {
|
|
122
|
+
left?: boolean;
|
|
123
|
+
right?: boolean;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export { PanelConfigurator }
|
|
127
|
+
|
|
128
|
+
export { PanelConfiguratorProps }
|
|
129
|
+
|
|
130
|
+
export { PanelDefinition }
|
|
131
|
+
|
|
132
|
+
export { PanelDefinitionWithContent }
|
|
133
|
+
|
|
134
|
+
export { PanelGroup }
|
|
135
|
+
|
|
136
|
+
export { PanelLayout }
|
|
137
|
+
|
|
138
|
+
export { PanelOrientation }
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Union type for panel persistence return types
|
|
142
|
+
*/
|
|
143
|
+
export declare type PanelPersistence = ThreePanelPersistence | TwoPanelPersistence;
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Persistence type definitions
|
|
147
|
+
* These types define how panel layouts are persisted and restored
|
|
148
|
+
*/
|
|
149
|
+
/**
|
|
150
|
+
* Panel sizes for a three-panel layout
|
|
151
|
+
*/
|
|
152
|
+
export declare interface PanelSizes {
|
|
153
|
+
left: number;
|
|
154
|
+
middle: number;
|
|
155
|
+
right: number;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export { PanelSlot }
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Storage adapter interface for persisting panel state
|
|
162
|
+
* Implementations can use localStorage, Electron IPC, or remote storage
|
|
163
|
+
*/
|
|
164
|
+
export declare interface PersistenceAdapter {
|
|
165
|
+
/** Load saved panel layout state for a given view */
|
|
166
|
+
load(viewKey: string): Promise<{
|
|
167
|
+
sizes?: PanelSizes | TwoPanelSizes;
|
|
168
|
+
collapsed?: PanelCollapsed | {
|
|
169
|
+
left?: boolean;
|
|
170
|
+
};
|
|
171
|
+
} | null>;
|
|
172
|
+
/** Save panel layout state for a given view */
|
|
173
|
+
save(viewKey: string, state: {
|
|
174
|
+
sizes: PanelSizes | TwoPanelSizes;
|
|
175
|
+
collapsed?: PanelCollapsed | {
|
|
176
|
+
left?: boolean;
|
|
177
|
+
};
|
|
178
|
+
}): Promise<void>;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Repository-specific workspace state
|
|
183
|
+
* Tracks which workspace is active and current panel configuration for a repository
|
|
184
|
+
*/
|
|
185
|
+
export declare interface RepositoryWorkspaceState {
|
|
186
|
+
/** ID of the active workspace, or null for custom layout */
|
|
187
|
+
workspaceId: string | null;
|
|
188
|
+
/** Custom layout (only used when workspaceId is null) */
|
|
189
|
+
layout?: PanelLayout;
|
|
190
|
+
/** Current panel sizes */
|
|
191
|
+
sizes: {
|
|
192
|
+
left: number;
|
|
193
|
+
middle: number;
|
|
194
|
+
right: number;
|
|
195
|
+
};
|
|
196
|
+
/** Current collapsed state */
|
|
197
|
+
collapsed: {
|
|
198
|
+
left?: boolean;
|
|
199
|
+
right?: boolean;
|
|
200
|
+
};
|
|
201
|
+
/** Active panels in each section (for tab groups) */
|
|
202
|
+
activePanels?: {
|
|
203
|
+
left?: string;
|
|
204
|
+
middle?: string;
|
|
205
|
+
right?: string;
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
export { SnapCarousel }
|
|
210
|
+
|
|
211
|
+
export { SnapCarouselProps }
|
|
212
|
+
|
|
213
|
+
export { SnapCarouselRef }
|
|
214
|
+
|
|
215
|
+
export { TabGroup }
|
|
216
|
+
|
|
217
|
+
export { TabGroupProps }
|
|
218
|
+
|
|
219
|
+
export { TabsConfig }
|
|
220
|
+
|
|
221
|
+
export { Theme }
|
|
222
|
+
|
|
223
|
+
export { ThemeMode }
|
|
224
|
+
|
|
225
|
+
export { ThreePanelLayout }
|
|
226
|
+
|
|
227
|
+
export { ThreePanelLayoutProps }
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Return type for the usePanelPersistence hook (three-panel variant)
|
|
231
|
+
*/
|
|
232
|
+
export declare interface ThreePanelPersistence {
|
|
233
|
+
type: 'three-panel';
|
|
234
|
+
sizes: PanelSizes;
|
|
235
|
+
collapsed: PanelCollapsed;
|
|
236
|
+
handlePanelResize: (sizes: PanelSizes) => void;
|
|
237
|
+
handleLeftCollapseComplete: () => Promise<void>;
|
|
238
|
+
handleLeftExpandComplete: () => Promise<void>;
|
|
239
|
+
handleRightCollapseComplete: () => Promise<void>;
|
|
240
|
+
handleRightExpandComplete: () => Promise<void>;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
export { TilesConfig }
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* Return type for the usePanelPersistence hook (two-panel variant)
|
|
247
|
+
*/
|
|
248
|
+
export declare interface TwoPanelPersistence {
|
|
249
|
+
type: 'two-panel';
|
|
250
|
+
sizes: TwoPanelSizes;
|
|
251
|
+
collapsed: {
|
|
252
|
+
left?: boolean;
|
|
253
|
+
};
|
|
254
|
+
handlePanelResize: (sizes: TwoPanelSizes) => void;
|
|
255
|
+
handleLeftCollapseComplete: () => Promise<void>;
|
|
256
|
+
handleLeftExpandComplete: () => Promise<void>;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* Panel sizes for a two-panel layout
|
|
261
|
+
*/
|
|
262
|
+
export declare interface TwoPanelSizes {
|
|
263
|
+
left: number;
|
|
264
|
+
right: number;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Options for updating an existing workspace
|
|
269
|
+
*/
|
|
270
|
+
export declare interface UpdateWorkspaceOptions {
|
|
271
|
+
name?: string;
|
|
272
|
+
description?: string;
|
|
273
|
+
layout?: PanelLayout;
|
|
274
|
+
defaultSizes?: {
|
|
275
|
+
left: number;
|
|
276
|
+
middle: number;
|
|
277
|
+
right: number;
|
|
278
|
+
};
|
|
279
|
+
defaultCollapsed?: {
|
|
280
|
+
left?: boolean;
|
|
281
|
+
right?: boolean;
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
export { useLocalStorage }
|
|
286
|
+
|
|
287
|
+
export { useMediaQuery }
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* Hook for persisting panel layouts across sessions
|
|
291
|
+
*
|
|
292
|
+
* Manages panel sizes and collapsed states with automatic debounced saving.
|
|
293
|
+
* Supports both 2-panel and 3-panel layouts.
|
|
294
|
+
*
|
|
295
|
+
* @param options - Configuration options for persistence
|
|
296
|
+
* @returns Panel state and handlers for resizing and collapsing
|
|
297
|
+
*
|
|
298
|
+
* @example
|
|
299
|
+
* ```tsx
|
|
300
|
+
* const persistence = usePanelPersistence({
|
|
301
|
+
* viewKey: 'my-app',
|
|
302
|
+
* defaultSizes: { left: 30, middle: 70, right: 0 },
|
|
303
|
+
* collapsed: { left: false, right: true },
|
|
304
|
+
* panelType: 'three-panel',
|
|
305
|
+
* });
|
|
306
|
+
*
|
|
307
|
+
* <ConfigurablePanelLayout
|
|
308
|
+
* {...otherProps}
|
|
309
|
+
* defaultSizes={persistence.sizes}
|
|
310
|
+
* collapsed={persistence.collapsed}
|
|
311
|
+
* onPanelResize={persistence.handlePanelResize}
|
|
312
|
+
* />
|
|
313
|
+
* ```
|
|
314
|
+
*/
|
|
315
|
+
export declare function usePanelPersistence(options: UsePanelPersistenceOptions): PanelPersistence;
|
|
316
|
+
|
|
317
|
+
/**
|
|
318
|
+
* Configuration options for the usePanelPersistence hook
|
|
319
|
+
*/
|
|
320
|
+
export declare interface UsePanelPersistenceOptions {
|
|
321
|
+
/** Unique key for this view's persistence (e.g., 'feedView', 'codeReview') */
|
|
322
|
+
viewKey: string;
|
|
323
|
+
/** Default panel sizes to use if no saved state exists */
|
|
324
|
+
defaultSizes: PanelSizes | TwoPanelSizes;
|
|
325
|
+
/** Initial collapsed state for panels */
|
|
326
|
+
collapsed: PanelCollapsed | {
|
|
327
|
+
left?: boolean;
|
|
328
|
+
};
|
|
329
|
+
/** Whether this is a two-panel or three-panel layout */
|
|
330
|
+
panelType: 'three-panel' | 'two-panel';
|
|
331
|
+
/** Optional persistence adapter (defaults to localStorage) */
|
|
332
|
+
adapter?: PersistenceAdapter;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
export declare function useWorkspace(options?: UseWorkspaceOptions): UseWorkspaceReturn;
|
|
336
|
+
|
|
337
|
+
export declare interface UseWorkspaceOptions {
|
|
338
|
+
/**
|
|
339
|
+
* Optional repository key for repository-specific state
|
|
340
|
+
* If provided, the hook will manage repository state
|
|
341
|
+
*/
|
|
342
|
+
repositoryKey?: string;
|
|
343
|
+
/**
|
|
344
|
+
* Auto-initialize repository state if it doesn't exist
|
|
345
|
+
*/
|
|
346
|
+
autoInitialize?: boolean;
|
|
347
|
+
/**
|
|
348
|
+
* Default workspace to use for auto-initialization
|
|
349
|
+
*/
|
|
350
|
+
defaultWorkspaceId?: string;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
export declare interface UseWorkspaceReturn {
|
|
354
|
+
/**
|
|
355
|
+
* All available workspaces (built-in + user-created)
|
|
356
|
+
*/
|
|
357
|
+
workspaces: Record<string, WorkspaceLayout>;
|
|
358
|
+
/**
|
|
359
|
+
* Current repository state (if repositoryKey provided)
|
|
360
|
+
*/
|
|
361
|
+
repositoryState: RepositoryWorkspaceState | null;
|
|
362
|
+
/**
|
|
363
|
+
* Current active workspace (if repositoryKey provided)
|
|
364
|
+
*/
|
|
365
|
+
activeWorkspace: WorkspaceLayout | null;
|
|
366
|
+
/**
|
|
367
|
+
* Loading state
|
|
368
|
+
*/
|
|
369
|
+
loading: boolean;
|
|
370
|
+
/**
|
|
371
|
+
* Error state
|
|
372
|
+
*/
|
|
373
|
+
error: Error | null;
|
|
374
|
+
/**
|
|
375
|
+
* Get a specific workspace by ID
|
|
376
|
+
*/
|
|
377
|
+
getWorkspace: (id: string) => Promise<WorkspaceLayout | null>;
|
|
378
|
+
/**
|
|
379
|
+
* Create a new workspace
|
|
380
|
+
*/
|
|
381
|
+
createWorkspace: (options: CreateWorkspaceOptions) => Promise<WorkspaceLayout>;
|
|
382
|
+
/**
|
|
383
|
+
* Update an existing workspace
|
|
384
|
+
*/
|
|
385
|
+
updateWorkspace: (id: string, updates: UpdateWorkspaceOptions) => Promise<WorkspaceLayout | null>;
|
|
386
|
+
/**
|
|
387
|
+
* Delete a workspace
|
|
388
|
+
*/
|
|
389
|
+
deleteWorkspace: (id: string) => Promise<boolean>;
|
|
390
|
+
/**
|
|
391
|
+
* Apply a workspace to the current repository
|
|
392
|
+
*/
|
|
393
|
+
applyWorkspace: (workspaceId: string) => Promise<void>;
|
|
394
|
+
/**
|
|
395
|
+
* Update repository sizes
|
|
396
|
+
*/
|
|
397
|
+
updateSizes: (sizes: {
|
|
398
|
+
left: number;
|
|
399
|
+
middle: number;
|
|
400
|
+
right: number;
|
|
401
|
+
}) => Promise<void>;
|
|
402
|
+
/**
|
|
403
|
+
* Update repository collapsed state
|
|
404
|
+
*/
|
|
405
|
+
updateCollapsed: (collapsed: {
|
|
406
|
+
left?: boolean;
|
|
407
|
+
right?: boolean;
|
|
408
|
+
}) => Promise<void>;
|
|
409
|
+
/**
|
|
410
|
+
* Reset repository to workspace defaults
|
|
411
|
+
*/
|
|
412
|
+
resetToDefaults: () => Promise<void>;
|
|
413
|
+
/**
|
|
414
|
+
* Refresh workspace data
|
|
415
|
+
*/
|
|
416
|
+
refresh: () => Promise<void>;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
/**
|
|
420
|
+
* WorkspaceLayout - A saved panel configuration preset
|
|
421
|
+
*/
|
|
422
|
+
export declare interface WorkspaceLayout {
|
|
423
|
+
/** Unique identifier for the workspace */
|
|
424
|
+
id: string;
|
|
425
|
+
/** Display name for the workspace */
|
|
426
|
+
name: string;
|
|
427
|
+
/** Optional description of the workspace's purpose */
|
|
428
|
+
description?: string;
|
|
429
|
+
/** Panel layout configuration */
|
|
430
|
+
layout: PanelLayout;
|
|
431
|
+
/** Default panel sizes (percentages) */
|
|
432
|
+
defaultSizes?: {
|
|
433
|
+
left: number;
|
|
434
|
+
middle: number;
|
|
435
|
+
right: number;
|
|
436
|
+
};
|
|
437
|
+
/** Default collapsed state for panels */
|
|
438
|
+
defaultCollapsed?: {
|
|
439
|
+
left?: boolean;
|
|
440
|
+
right?: boolean;
|
|
441
|
+
};
|
|
442
|
+
/** Creation timestamp */
|
|
443
|
+
createdAt: number;
|
|
444
|
+
/** Last update timestamp */
|
|
445
|
+
updatedAt: number;
|
|
446
|
+
/** Whether this is a built-in workspace (cannot be modified/deleted) */
|
|
447
|
+
isBuiltIn?: boolean;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
export declare class WorkspaceLayoutService {
|
|
451
|
+
private static adapter;
|
|
452
|
+
/**
|
|
453
|
+
* Configure a custom storage adapter (for Electron IPC or remote storage)
|
|
454
|
+
*/
|
|
455
|
+
static setAdapter(adapter: WorkspaceStorageAdapter): void;
|
|
456
|
+
/**
|
|
457
|
+
* Get all workspace layouts (including built-in)
|
|
458
|
+
*/
|
|
459
|
+
static getWorkspaceLayouts(): Promise<Record<string, WorkspaceLayout>>;
|
|
460
|
+
/**
|
|
461
|
+
* Get a specific workspace layout by ID
|
|
462
|
+
*/
|
|
463
|
+
static getWorkspaceLayout(id: string): Promise<WorkspaceLayout | null>;
|
|
464
|
+
/**
|
|
465
|
+
* Create a new workspace layout
|
|
466
|
+
*/
|
|
467
|
+
static createWorkspaceLayout(options: CreateWorkspaceOptions): Promise<WorkspaceLayout>;
|
|
468
|
+
/**
|
|
469
|
+
* Update an existing workspace layout
|
|
470
|
+
*/
|
|
471
|
+
static updateWorkspaceLayout(id: string, updates: UpdateWorkspaceOptions): Promise<WorkspaceLayout | null>;
|
|
472
|
+
/**
|
|
473
|
+
* Delete a workspace layout
|
|
474
|
+
*/
|
|
475
|
+
static deleteWorkspaceLayout(id: string): Promise<boolean>;
|
|
476
|
+
/**
|
|
477
|
+
* Get repository state (which workspace + current sizes/collapsed)
|
|
478
|
+
*/
|
|
479
|
+
static getRepositoryState(repositoryKey: string): Promise<RepositoryWorkspaceState | null>;
|
|
480
|
+
/**
|
|
481
|
+
* Set repository state (which workspace + current sizes/collapsed/layout)
|
|
482
|
+
*/
|
|
483
|
+
static setRepositoryState(repositoryKey: string, state: RepositoryWorkspaceState): Promise<void>;
|
|
484
|
+
/**
|
|
485
|
+
* Update only sizes in repository state
|
|
486
|
+
*/
|
|
487
|
+
static updateRepositorySizes(repositoryKey: string, sizes: {
|
|
488
|
+
left: number;
|
|
489
|
+
middle: number;
|
|
490
|
+
right: number;
|
|
491
|
+
}): Promise<void>;
|
|
492
|
+
/**
|
|
493
|
+
* Update only collapsed state in repository state
|
|
494
|
+
*/
|
|
495
|
+
static updateRepositoryCollapsed(repositoryKey: string, collapsed: {
|
|
496
|
+
left?: boolean;
|
|
497
|
+
right?: boolean;
|
|
498
|
+
}): Promise<void>;
|
|
499
|
+
/**
|
|
500
|
+
* Check if repository state differs from workspace defaults
|
|
501
|
+
*/
|
|
502
|
+
static hasStateDeviation(repoState: {
|
|
503
|
+
workspaceId: string | null;
|
|
504
|
+
sizes: {
|
|
505
|
+
left: number;
|
|
506
|
+
middle: number;
|
|
507
|
+
right: number;
|
|
508
|
+
};
|
|
509
|
+
collapsed: {
|
|
510
|
+
left?: boolean;
|
|
511
|
+
right?: boolean;
|
|
512
|
+
};
|
|
513
|
+
}, workspace: WorkspaceLayout): {
|
|
514
|
+
hasSizeDeviation: boolean;
|
|
515
|
+
hasCollapsedDeviation: boolean;
|
|
516
|
+
};
|
|
517
|
+
/**
|
|
518
|
+
* Update workspace defaults from repository state
|
|
519
|
+
*/
|
|
520
|
+
static updateWorkspaceFromRepositoryState(workspaceId: string, repositoryKey: string): Promise<void>;
|
|
521
|
+
/**
|
|
522
|
+
* Reset repository state to workspace defaults
|
|
523
|
+
*/
|
|
524
|
+
static resetRepositoryToWorkspaceDefaults(repositoryKey: string, workspaceId: string): Promise<void>;
|
|
525
|
+
/**
|
|
526
|
+
* Check if a layout matches a workspace layout
|
|
527
|
+
*/
|
|
528
|
+
static isLayoutMatchingWorkspace(layout: PanelLayout, workspace: WorkspaceLayout): boolean;
|
|
529
|
+
/**
|
|
530
|
+
* Find workspace ID that matches the given layout
|
|
531
|
+
*/
|
|
532
|
+
static findMatchingWorkspace(layout: PanelLayout): Promise<string | null>;
|
|
533
|
+
/**
|
|
534
|
+
* Deep comparison of two panel layouts
|
|
535
|
+
*/
|
|
536
|
+
private static areLayoutsEqual;
|
|
537
|
+
/**
|
|
538
|
+
* Generate a unique ID from a workspace name
|
|
539
|
+
*/
|
|
540
|
+
private static generateWorkspaceId;
|
|
541
|
+
/**
|
|
542
|
+
* Get built-in workspace layouts
|
|
543
|
+
*/
|
|
544
|
+
static getBuiltInWorkspaceLayouts(): Record<string, WorkspaceLayout>;
|
|
545
|
+
/**
|
|
546
|
+
* Initialize workspace layouts with built-in defaults if none exist
|
|
547
|
+
*/
|
|
548
|
+
static initializeWorkspaceLayouts(): Promise<void>;
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
export declare type WorkspacePreset = WorkspaceLayout;
|
|
552
|
+
|
|
553
|
+
/**
|
|
554
|
+
* Storage interface for workspace data
|
|
555
|
+
* Implementations can use localStorage, Electron IPC, or remote storage
|
|
556
|
+
*/
|
|
557
|
+
export declare interface WorkspaceStorageAdapter {
|
|
558
|
+
/**
|
|
559
|
+
* Load all user-created workspace presets
|
|
560
|
+
*/
|
|
561
|
+
loadWorkspacePresets(): Promise<Record<string, WorkspaceLayout>>;
|
|
562
|
+
/**
|
|
563
|
+
* Save workspace presets
|
|
564
|
+
*/
|
|
565
|
+
saveWorkspacePresets(presets: Record<string, WorkspaceLayout>): Promise<void>;
|
|
566
|
+
/**
|
|
567
|
+
* Load repository-specific workspace state
|
|
568
|
+
*/
|
|
569
|
+
loadRepositoryState(repositoryKey: string): Promise<RepositoryWorkspaceState | null>;
|
|
570
|
+
/**
|
|
571
|
+
* Save repository-specific workspace state
|
|
572
|
+
*/
|
|
573
|
+
saveRepositoryState(repositoryKey: string, state: RepositoryWorkspaceState): Promise<void>;
|
|
574
|
+
/**
|
|
575
|
+
* Load all repository states
|
|
576
|
+
*/
|
|
577
|
+
loadAllRepositoryStates(): Promise<Record<string, RepositoryWorkspaceState>>;
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
export { }
|