@pstdio/workbench 0.44.0-nightly.20261018030230 → 0.44.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.
Files changed (30) hide show
  1. package/dist/extensions.d.ts +163 -1040
  2. package/dist/extensions.js +1194 -808
  3. package/dist/extensions.js.map +1 -1
  4. package/dist/{file-renderer-view-BsLjjvTU.js → file-renderer-view-C5dyoQQW.js} +211 -214
  5. package/dist/file-renderer-view-C5dyoQQW.js.map +1 -0
  6. package/dist/{index-JZ3eu6uE.d.ts → index-8x-QT7wg.d.ts} +1992 -533
  7. package/dist/index.d.ts +1 -1
  8. package/dist/index.js +2041 -2003
  9. package/dist/index.js.map +1 -1
  10. package/dist/{kanban-presentation-CmFF6y9I.d.ts → kanban-presentation-pexk_oCY.d.ts} +1 -1
  11. package/dist/layout-tab-presentation-Bz6EgFEa.js +15 -0
  12. package/dist/layout-tab-presentation-Bz6EgFEa.js.map +1 -0
  13. package/dist/{navigation-tree-registry-CIwRvLFJ.js → navigation-tree-registry-C5l3eO3n.js} +2 -2
  14. package/dist/{navigation-tree-registry-CIwRvLFJ.js.map → navigation-tree-registry-C5l3eO3n.js.map} +1 -1
  15. package/dist/react-C-HbdPSw.js +8881 -0
  16. package/dist/react-C-HbdPSw.js.map +1 -0
  17. package/dist/react.d.ts +75 -29
  18. package/dist/react.js +2 -2
  19. package/dist/storage.d.ts +3 -2
  20. package/dist/storage.js +142 -123
  21. package/dist/storage.js.map +1 -1
  22. package/dist/webview-runtime.js +1 -1
  23. package/dist/workbench-renderers-Bz_dLyHW.js +4775 -0
  24. package/dist/workbench-renderers-Bz_dLyHW.js.map +1 -0
  25. package/package.json +3 -3
  26. package/dist/file-renderer-view-BsLjjvTU.js.map +0 -1
  27. package/dist/react-B3WmSI5Y.js +0 -11192
  28. package/dist/react-B3WmSI5Y.js.map +0 -1
  29. package/dist/workbench-renderers-Bj4sazP5.js +0 -976
  30. package/dist/workbench-renderers-Bj4sazP5.js.map +0 -1
package/dist/react.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { Ct as PreferenceRegistry, Dt as PreferenceValue, Fi as CommandParamDescriptor, Fr as TreeAction, Gt as KeybindingSequence, I as WorkbenchModuleContribution, Ii as CommandParamOption, Jr as MenuPath, K as ThemePreferenceOption$1, Kr as WorkbenchPanelRenderInput, Li as CommandParamSchema, M as WorkbenchCore, N as WorkbenchCoreContributionContext, Ni as Command, Qr as WorkbenchFocusRegionId, Qt as WorkbenchTerminalController, St as PreferencePropertySchema, Tt as PreferenceScope, Xr as RegisteredMenuItem, Z as WorkbenchStatusRegistry, bi as WorkbenchRegion$1, ei as RegisteredPlaceholderContribution, er as RegisteredDataTableRendererContribution, ga as WorkbenchStore, ha as Disposable, hi as WorkbenchWidgetPlacement, ii as WorkbenchPanelInstance, qi as ResourceRef$1, ti as RegisteredWidgetContribution, zi as WorkbenchCommandExecutionContext } from "./index-JZ3eu6uE.js";
2
- import { a as ReactResourceContextAction, i as ReactKanbanRendererContribution, n as ReactAttributesSource, r as ReactBoardColumnConfig, t as ReactAttributeDescriptor } from "./kanban-presentation-CmFF6y9I.js";
1
+ import { $n as RegisteredDataTableRendererContribution, Et as PreferenceValue, F as WorkbenchModuleContribution, G as ThemePreferenceOption$1, Gr as WorkbenchPanelRenderInput, M as WorkbenchCoreContributionContext, Pr as TreeAction, Ri as NavigationTarget$1, St as PreferenceRegistry, Ui as RegisteredPlaceholderContribution, Wi as RegisteredWidgetContribution, Wt as KeybindingSequence, X as WorkbenchStatusRegistry, Yr as RegisteredMenuItem, Zr as WorkbenchFocusRegionId, Zt as WorkbenchTerminalController, ai as CommandParamSchema, ca as WorkbenchPanelRegion, fa as WorkbenchStore, hi as ResourceRef$1, ia as WorkbenchWidgetPlacement, ii as CommandParamOption, j as WorkbenchCore, la as WorkbenchRegion$1, pa as Disposable, qi as WorkbenchPanelInstance, qr as MenuPath, ri as CommandParamDescriptor, si as WorkbenchCommandExecutionContext, ti as Command, wt as PreferenceScope, xt as PreferencePropertySchema } from "./index-8x-QT7wg.js";
2
+ import { a as ReactResourceContextAction, i as ReactKanbanRendererContribution, n as ReactAttributesSource, r as ReactBoardColumnConfig, t as ReactAttributeDescriptor } from "./kanban-presentation-pexk_oCY.js";
3
3
  import { ResourceAnchor, ResourceAnchorPage, ResourceAnchorQuery, ResourceRef } from "@pstdio/sdk/extensions";
4
4
  import { ReactNode } from "react";
5
5
  import { FileIconThemePreferenceOption, ResourceContextAction, ThemePreference, ThemePreferenceOption, ThemePreferenceStorage } from "@pstdio/ui";
@@ -25,7 +25,7 @@ interface CommandParamEntry extends CommandParamDescriptor {
25
25
  export declare const isCommandFilesParamValue: (value: unknown) => value is CommandFilesParamValue;
26
26
  export declare const createCommandFilesParamValue: (input?: Partial<CommandFilesParamValue>) => CommandFilesParamValue;
27
27
  export declare const listCommandParamEntries: (params: CommandParamSchema | undefined) => CommandParamEntry[];
28
- export declare const buildCommandParamInitialValues: (params: CommandParamSchema | undefined, baseArgs?: unknown, context?: WorkbenchCommandExecutionContext) => Record<string, CommandParamValue>;
28
+ export declare const buildCommandParamInitialValues: (params: CommandParamSchema | undefined, baseArgs?: unknown, context?: WorkbenchCommandExecutionContext, mutation?: Command["resourceMutation"]) => Record<string, CommandParamValue>;
29
29
  export declare const normalizeCommandParamValues: (params: CommandParamSchema | undefined, values: Record<string, CommandParamValue>) => Record<string, unknown>;
30
30
  //#endregion
31
31
  //#region src/react/command-palette/command-option-resolver.d.ts
@@ -160,9 +160,65 @@ interface WorkbenchMenuItemContext {
160
160
  }
161
161
  export declare const listWorkbenchMenuItems: (workbench: WorkbenchCore, menuPath: MenuPath, context?: WorkbenchMenuItemContext) => WorkbenchMenuItem[];
162
162
  //#endregion
163
+ //#region src/react/renderers/tree/tree-actions.d.ts
164
+ interface TreeActionParamsRequest {
165
+ request: CommandParamsRequest;
166
+ run: (args: unknown) => Promise<void>;
167
+ }
168
+ interface CreateTreeContextMenuItemsInput {
169
+ actions?: TreeAction[];
170
+ menuPath?: MenuPath;
171
+ workbench: WorkbenchCoreContributionContext;
172
+ context?: WorkbenchCommandExecutionContext;
173
+ onCommandError?: (error: unknown) => void;
174
+ onRequestParams?: (request: TreeActionParamsRequest) => void;
175
+ }
176
+ export declare const createTreeContextMenuItems: (input: CreateTreeContextMenuItemsInput) => import("@pstdio/ui").ListRowActionMenuItem[];
177
+ //#endregion
178
+ //#region src/react/menus/command-menu-items.d.ts
179
+ interface CreateMenuItemsInput {
180
+ workbench: WorkbenchCoreContributionContext;
181
+ menuPath: MenuPath;
182
+ context?: WorkbenchCommandExecutionContext;
183
+ onCommandError?: (error: unknown) => void;
184
+ onRequestParams?: (request: TreeActionParamsRequest) => void;
185
+ }
186
+ //#endregion
163
187
  //#region src/react/menus/resource-actions.d.ts
164
- export declare const createWorkbenchResourceActions: (workbench: WorkbenchCoreContributionContext, resource: ResourceRef$1) => ResourceContextAction[];
165
- export declare const useWorkbenchResourceActionResolver: (workbench: WorkbenchCoreContributionContext) => (resource: ResourceRef$1) => ResourceContextAction[];
188
+ export declare const createWorkbenchResourceActions: (workbench: WorkbenchCoreContributionContext, subject: ResourceRef$1, options?: Pick<CreateMenuItemsInput, "onRequestParams" | "onCommandError">) => {
189
+ group: {
190
+ id: string;
191
+ label?: string;
192
+ };
193
+ key: string;
194
+ label: string;
195
+ commandId?: string;
196
+ isSelected?: boolean;
197
+ onClick?: () => Promise<void> | void;
198
+ items?: ResourceContextAction[];
199
+ isDisabled?: boolean;
200
+ icon?: import("react").ReactNode;
201
+ endContent?: import("react").ReactNode;
202
+ separatorBefore?: boolean;
203
+ closeOnSelect?: boolean;
204
+ }[];
205
+ export declare const useWorkbenchResourceActionResolver: (workbench: WorkbenchCoreContributionContext) => (resource: ResourceRef$1) => {
206
+ group: {
207
+ id: string;
208
+ label?: string;
209
+ };
210
+ key: string;
211
+ label: string;
212
+ commandId?: string;
213
+ isSelected?: boolean;
214
+ onClick?: () => Promise<void> | void;
215
+ items?: ResourceContextAction[];
216
+ isDisabled?: boolean;
217
+ icon?: import("react").ReactNode;
218
+ endContent?: import("react").ReactNode;
219
+ separatorBefore?: boolean;
220
+ closeOnSelect?: boolean;
221
+ }[];
166
222
  //#endregion
167
223
  //#region src/react/notifications/notification-host.d.ts
168
224
  interface WorkbenchNotificationHostProps {
@@ -233,21 +289,6 @@ interface WorkbenchPreferencesFormProps {
233
289
  }
234
290
  export declare const WorkbenchPreferencesForm: (props: WorkbenchPreferencesFormProps) => import("react/jsx-runtime").JSX.Element;
235
291
  //#endregion
236
- //#region src/react/renderers/tree/tree-actions.d.ts
237
- interface TreeActionParamsRequest {
238
- request: CommandParamsRequest;
239
- run: (args: unknown) => Promise<void>;
240
- }
241
- interface CreateTreeContextMenuItemsInput {
242
- actions?: TreeAction[];
243
- menuPath?: MenuPath;
244
- workbench: WorkbenchCoreContributionContext;
245
- context?: WorkbenchCommandExecutionContext;
246
- onCommandError?: (error: unknown) => void;
247
- onRequestParams?: (request: TreeActionParamsRequest) => void;
248
- }
249
- export declare const createTreeContextMenuItems: (input: CreateTreeContextMenuItemsInput) => import("@pstdio/ui").ListRowActionMenuItem[];
250
- //#endregion
251
292
  //#region src/react/renderers/tree/tree-view.d.ts
252
293
  interface WorkbenchTreeViewProps {
253
294
  readOwnerKey?: string;
@@ -273,6 +314,7 @@ export declare const WorkbenchConnectionProvider: (props: WorkbenchConnectionPro
273
314
  //#region src/react/resource-links/resource-links-types.d.ts
274
315
  interface ResourceLinkCandidate {
275
316
  resource: ResourceRef;
317
+ target?: NavigationTarget$1;
276
318
  description?: string;
277
319
  open?: () => void | Promise<void>;
278
320
  }
@@ -285,14 +327,6 @@ interface ResourceLinksService {
285
327
  subscribe(listener: () => void): () => void;
286
328
  }
287
329
  //#endregion
288
- //#region src/react/resource-links/related-resources.d.ts
289
- interface RelatedResourcesProps {
290
- resource: ResourceRef;
291
- service: ResourceLinksService;
292
- onClose(): void;
293
- }
294
- export declare const RelatedResources: (props: RelatedResourcesProps) => import("react/jsx-runtime").JSX.Element;
295
- //#endregion
296
330
  //#region src/react/resource-links/resource-links-module.d.ts
297
331
  interface WorkbenchResourceLinksOptions {
298
332
  canonicalize(resource: ResourceRef): ResourceRef | undefined;
@@ -303,9 +337,20 @@ export declare const createWorkbenchResourceLinksModule: (options: WorkbenchReso
303
337
  id: string;
304
338
  activate(ctx: WorkbenchCoreContributionContext): {
305
339
  dispose: () => void;
306
- };
340
+ }[];
307
341
  };
308
342
  //#endregion
343
+ //#region src/react/resource-links/related-resource-previews.d.ts
344
+ export declare const openRelatedResourcesPreference = "workbench.openRelatedResources";
345
+ //#endregion
346
+ //#region src/react/resource-links/related-resources.d.ts
347
+ interface RelatedResourcesProps {
348
+ resource: ResourceRef;
349
+ service: ResourceLinksService;
350
+ onClose(): void;
351
+ }
352
+ export declare const RelatedResources: (props: RelatedResourcesProps) => import("react/jsx-runtime").JSX.Element;
353
+ //#endregion
309
354
  //#region src/react/settings/settings-resources.d.ts
310
355
  export declare const WORKBENCH_SETTINGS_OPEN_COMMAND_ID = "workbench.settings.open";
311
356
  //#endregion
@@ -365,6 +410,7 @@ export declare const WORKBENCH_TERMINAL_PANEL_SIZE: {
365
410
  interface OpenWorkbenchTerminalOptions {
366
411
  resource?: ResourceRef$1;
367
412
  reveal?: boolean;
413
+ region?: WorkbenchPanelRegion;
368
414
  }
369
415
  export declare const openWorkbenchTerminal: (ctx: WorkbenchCoreContributionContext, input?: OpenWorkbenchTerminalOptions) => WorkbenchPanelInstance;
370
416
  /**
package/dist/react.js CHANGED
@@ -1,2 +1,2 @@
1
- import { $ as e, A as t, B as n, C as r, D as i, E as a, F as o, G as s, H as c, I as l, J as u, K as d, L as f, M as p, N as m, O as h, P as g, Q as _, R as v, S as y, T as b, U as x, V as S, W as C, X as w, Y as T, Z as E, _ as D, at as O, b as k, ct as A, d as j, dt as M, et as N, f as P, ft as F, g as I, h as L, i as R, it as z, j as B, k as V, lt as H, m as U, n as W, nt as G, ot as K, p as q, q as J, r as Y, rt as X, st as Z, t as Q, tt as $, ut as ee, v as te, w as ne, x as re, y as ie } from "./react-B3WmSI5Y.js";
2
- export { z as CommandOptionStatus, $ as CommandParamField, p as RelatedResources, b as WORKBENCH_SETTINGS_NAV_WIDGET_ID, V as WORKBENCH_SETTINGS_OPEN_COMMAND_ID, a as WORKBENCH_SETTINGS_PANEL_WIDGET_ID, i as WORKBENCH_SETTINGS_WIDGET_ID, L as WORKBENCH_TERMINAL_OPEN_COMMAND_ID, I as WORKBENCH_TERMINAL_PANEL_SIZE, D as WORKBENCH_TERMINAL_WIDGET_ID, R as Workbench, r as WorkbenchAttachedSidePanel, O as WorkbenchBreadcrumbView, e as WorkbenchCommandPalette, v as WorkbenchConnectionProvider, f as WorkbenchDataTableView, ne as WorkbenchFloatingSidePanel, _ as WorkbenchFocusRegion, w as WorkbenchHeaderActions, F as WorkbenchIcon, J as WorkbenchKeybindingDispatcher, Q as WorkbenchModuleHost, x as WorkbenchNotificationHost, j as WorkbenchOverlayLayer, g as WorkbenchPreferencesForm, S as WorkbenchRegion, n as WorkbenchRegionTabs, k as WorkbenchTerminalPanel, q as WorkbenchThemeProvider, P as WorkbenchThemeScope, m as WorkbenchTreeView, c as WorkbenchWidgetHost, y as WorkflowStatusSettings, Z as buildCommandParamInitialValues, G as commandParamName, A as createCommandFilesParamValue, re as createControllerTerminalBridge, d as createTreeContextMenuItems, u as createWorkbenchHotkeyRegistrations, C as createWorkbenchResourceActions, t as createWorkbenchResourceLinksModule, h as createWorkbenchSettingsModule, te as createWorkbenchTerminalModule, W as disposeWorkbenchModuleHostRegistrations, H as isCommandFilesParamValue, ee as listCommandParamEntries, E as listWorkbenchMenuItems, M as normalizeCommandParamValues, T as normalizeWorkbenchKeybinding, ie as openWorkbenchTerminal, o as paramValueToPreference, l as preferenceSchemaToParams, X as readCommandParamValue, B as resourceLinksCommandId, Y as syncWorkbenchModuleHostRegistrations, N as useCommandOptions, s as useWorkbenchResourceActionResolver, K as useWorkbenchStore, U as useWorkbenchThemePreferences };
1
+ import { $ as e, A as t, B as n, C as r, D as i, E as a, F as o, G as s, H as c, I as l, J as u, K as d, L as f, M as p, N as m, O as h, P as g, Q as _, R as v, S as y, T as b, U as x, W as S, X as C, Y as w, Z as T, _ as E, at as D, b as O, ct as k, d as A, dt as j, et as M, f as N, ft as P, g as F, h as I, i as L, it as R, j as z, k as B, lt as V, m as H, n as U, nt as W, ot as G, p as K, pt as q, q as J, r as Y, rt as X, st as Z, t as Q, tt as $, ut as ee, v as te, w as ne, x as re, y as ie, z as ae } from "./react-C-HbdPSw.js";
2
+ export { X as CommandOptionStatus, M as CommandParamField, p as RelatedResources, b as WORKBENCH_SETTINGS_NAV_WIDGET_ID, B as WORKBENCH_SETTINGS_OPEN_COMMAND_ID, a as WORKBENCH_SETTINGS_PANEL_WIDGET_ID, i as WORKBENCH_SETTINGS_WIDGET_ID, I as WORKBENCH_TERMINAL_OPEN_COMMAND_ID, F as WORKBENCH_TERMINAL_PANEL_SIZE, E as WORKBENCH_TERMINAL_WIDGET_ID, L as Workbench, r as WorkbenchAttachedSidePanel, R as WorkbenchBreadcrumbView, _ as WorkbenchCommandPalette, n as WorkbenchConnectionProvider, v as WorkbenchDataTableView, ne as WorkbenchFloatingSidePanel, T as WorkbenchFocusRegion, w as WorkbenchHeaderActions, Z as WorkbenchIcon, d as WorkbenchKeybindingDispatcher, Q as WorkbenchModuleHost, s as WorkbenchNotificationHost, A as WorkbenchOverlayLayer, o as WorkbenchPreferencesForm, x as WorkbenchRegion, c as WorkbenchRegionTabs, O as WorkbenchTerminalPanel, K as WorkbenchThemeProvider, N as WorkbenchThemeScope, g as WorkbenchTreeView, S as WorkbenchWidgetHost, y as WorkflowStatusSettings, k as buildCommandParamInitialValues, $ as commandParamName, V as createCommandFilesParamValue, re as createControllerTerminalBridge, ae as createTreeContextMenuItems, J as createWorkbenchHotkeyRegistrations, D as createWorkbenchResourceActions, t as createWorkbenchResourceLinksModule, h as createWorkbenchSettingsModule, te as createWorkbenchTerminalModule, U as disposeWorkbenchModuleHostRegistrations, ee as isCommandFilesParamValue, j as listCommandParamEntries, C as listWorkbenchMenuItems, P as normalizeCommandParamValues, u as normalizeWorkbenchKeybinding, m as openRelatedResourcesPreference, ie as openWorkbenchTerminal, l as paramValueToPreference, f as preferenceSchemaToParams, W as readCommandParamValue, z as resourceLinksCommandId, Y as syncWorkbenchModuleHostRegistrations, e as useCommandOptions, G as useWorkbenchResourceActionResolver, q as useWorkbenchStore, H as useWorkbenchThemePreferences };
package/dist/storage.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { $r as LayoutPersistenceAdapter, B as WorkbenchPersistenceAdapter, Ur as TreeRendererPersistenceAdapter, fn as WorkbenchPanelMenuStatePersistenceAdapter, it as WorkbenchStatusBarPersistenceAdapter, vn as WorkbenchPageLocationPersistence } from "./index-JZ3eu6uE.js";
1
+ import { Hr as TreeRendererPersistenceAdapter, Qr as LayoutPersistenceAdapter, _n as WorkbenchPageLocationPersistence, bt as PreferencePersistenceAdapter, dn as WorkbenchPanelMenuStatePersistenceAdapter, rt as WorkbenchStatusBarPersistenceAdapter, z as WorkbenchPersistenceAdapter } from "./index-8x-QT7wg.js";
2
2
  //#region src/storage/local-storage-persistence-helpers.d.ts
3
3
  interface WorkbenchStorageLike {
4
4
  readonly length?: number;
@@ -7,7 +7,7 @@ interface WorkbenchStorageLike {
7
7
  setItem(key: string, value: string): void;
8
8
  removeItem?(key: string): void;
9
9
  }
10
- type WorkbenchStoragePersistenceKind = "layout" | "layout-compatibility" | "layout-generation" | "layout-resource-index" | "layout-scope-index" | "panel-menus" | "page-location" | "status-bar" | "tree";
10
+ type WorkbenchStoragePersistenceKind = "layout" | "layout-compatibility" | "layout-generation" | "layout-resource-index" | "layout-scope-index" | "panel-menus" | "page-location" | "preferences" | "status-bar" | "tree";
11
11
  interface CreateWorkbenchStoragePersistenceInput {
12
12
  debounceMs?: number;
13
13
  eventTarget?: {
@@ -36,6 +36,7 @@ export declare const createLocalStoragePageLocationPersistence: (input: CreateWo
36
36
  export declare const createLocalStoragePanelMenuStatePersistence: (input: CreateLocalStoragePanelMenuStatePersistenceInput) => WorkbenchPanelMenuStatePersistenceAdapter;
37
37
  export declare const createLocalStorageTreePersistence: (input: CreateLocalStorageTreePersistenceInput) => TreeRendererPersistenceAdapter;
38
38
  export declare const createLocalStorageWorkbenchPersistence: (input: CreateLocalStorageWorkbenchPersistenceInput) => {
39
+ preferencePersistence: PreferencePersistenceAdapter;
39
40
  snapshotPersistence: WorkbenchPersistenceAdapter;
40
41
  statusBarPersistence: WorkbenchStatusBarPersistenceAdapter;
41
42
  layoutPersistence: LayoutPersistenceAdapter;
package/dist/storage.js CHANGED
@@ -1,5 +1,6 @@
1
+ import { t as e } from "./layout-tab-presentation-Bz6EgFEa.js";
1
2
  //#region src/storage/local-storage-persistence-helpers.ts
2
- var e = (e, t, n) => `${e}:${t}:${n ?? "global"}`, t = () => {
3
+ var t = (e, t, n) => `${e}:${t}:${n ?? "global"}`, n = () => {
3
4
  let e = /* @__PURE__ */ new Map();
4
5
  return {
5
6
  get length() {
@@ -14,193 +15,211 @@ var e = (e, t, n) => `${e}:${t}:${n ?? "global"}`, t = () => {
14
15
  e.delete(t);
15
16
  }
16
17
  };
17
- }, n = (e) => e || (typeof localStorage < "u" ? localStorage : t()), r = (e, t) => {
18
+ }, r = (e) => e || (typeof localStorage < "u" ? localStorage : n()), i = (e, t) => {
18
19
  let n = e.getItem(t);
19
20
  if (n) try {
20
21
  return JSON.parse(n);
21
22
  } catch {
22
23
  return;
23
24
  }
24
- }, i = 5, a = 1, o = 50, s = (t) => {
25
- let s = n(t.storage), c = /* @__PURE__ */ new Map(), l = t.debounceMs ?? 250, u = t.eventTarget ?? (typeof window < "u" ? {
25
+ }, a = 5, o = 1, s = 50, c = (n) => {
26
+ let c = r(n.storage), l = /* @__PURE__ */ new Map(), u = n.debounceMs ?? 250, d = n.eventTarget ?? (typeof window < "u" ? {
26
27
  addEventListener: (e, t) => window.addEventListener(e, t),
27
28
  removeEventListener: (e, t) => window.removeEventListener(e, t)
28
- } : void 0), d, f = e(t.namespace, "layout-generation", void 0), p = () => {
29
- let e = r(s, f);
29
+ } : void 0), f, p = t(n.namespace, "layout-generation", void 0), m = () => {
30
+ let e = i(c, p);
30
31
  return typeof e == "object" && e && "version" in e && e.version === 1 && "generation" in e && typeof e.generation == "number" ? e.generation : 0;
31
- }, m = () => {
32
- let e = p() + 1, t = {
32
+ }, h = () => {
33
+ let e = m() + 1, t = {
33
34
  version: 1,
34
35
  generation: e
35
36
  };
36
- return s.setItem(f, JSON.stringify(t)), e;
37
- }, h = (e) => e?.match(/^project\/([^/]+)\/mode\/[^/]+\/resource\//)?.[1], g = (e) => e?.match(/^project\/([^/]+)/)?.[1], _ = (e) => {
38
- if (!s.key) return [];
39
- let n = `${t.namespace}:layout:`, r = [];
40
- for (let t = 0; t < (s.length ?? 0); t += 1) {
41
- let i = s.key(t);
42
- if (!i?.startsWith(n)) continue;
43
- let a = i.slice(n.length);
44
- g(a) === e && r.push(a);
37
+ return c.setItem(p, JSON.stringify(t)), e;
38
+ }, g = (e) => e?.match(/^project\/([^/]+)\/mode\/[^/]+\/resource\//)?.[1], _ = (e) => e?.match(/^project\/([^/]+)/)?.[1], v = (e) => {
39
+ if (!c.key) return [];
40
+ let t = `${n.namespace}:layout:`, r = [];
41
+ for (let n = 0; n < (c.length ?? 0); n += 1) {
42
+ let i = c.key(n);
43
+ if (!i?.startsWith(t)) continue;
44
+ let a = i.slice(t.length);
45
+ _(a) === e && r.push(a);
45
46
  }
46
47
  return r;
47
- }, v = (n, i) => {
48
- let o = r(s, e(t.namespace, n, i));
49
- return typeof o == "object" && o && "version" in o && o.version === a && "scopes" in o && Array.isArray(o.scopes) ? o.scopes.filter((n) => typeof n == "string" && s.getItem(e(t.namespace, "layout", n)) !== null) : [];
50
- }, y = (n, r, i) => {
51
- let o = {
52
- version: a,
48
+ }, y = (e, r) => {
49
+ let a = i(c, t(n.namespace, e, r));
50
+ return typeof a == "object" && a && "version" in a && a.version === o && "scopes" in a && Array.isArray(a.scopes) ? a.scopes.filter((e) => typeof e == "string" && c.getItem(t(n.namespace, "layout", e)) !== null) : [];
51
+ }, b = (e, r, i) => {
52
+ let a = {
53
+ version: o,
53
54
  scopes: i
54
55
  };
55
- s.setItem(e(t.namespace, n, r), JSON.stringify(o));
56
- }, b = (e) => {
57
- let t = g(e);
56
+ c.setItem(t(n.namespace, e, r), JSON.stringify(a));
57
+ }, x = (e) => {
58
+ let t = _(e);
58
59
  if (!t || !e) return;
59
- let n = v("layout-scope-index", t).filter((t) => t !== e);
60
- n.push(e), y("layout-scope-index", t, n);
61
- }, x = (n) => {
62
- let r = h(n);
63
- if (!r || !n) return;
64
- let i = v("layout-resource-index", r).filter((e) => e !== n);
65
- i.push(n);
66
- for (let n of i.splice(0, Math.max(0, i.length - o))) s.removeItem?.(e(t.namespace, "layout", n)), s.removeItem?.(e(t.namespace, "panel-menus", n));
67
- y("layout-resource-index", r, i);
68
- }, S = () => {
69
- d && clearTimeout(d), d = void 0;
70
- let n = [...c.values()];
71
- c.clear();
72
- let r = p();
73
- for (let i of n) i.generation === r && (s.setItem(e(t.namespace, "layout", i.scope), i.raw), b(i.scope), x(i.scope));
60
+ let n = y("layout-scope-index", t).filter((t) => t !== e);
61
+ n.push(e), b("layout-scope-index", t, n);
62
+ }, S = (e) => {
63
+ let r = g(e);
64
+ if (!r || !e) return;
65
+ let i = y("layout-resource-index", r).filter((t) => t !== e);
66
+ i.push(e);
67
+ for (let e of i.splice(0, Math.max(0, i.length - s))) c.removeItem?.(t(n.namespace, "layout", e)), c.removeItem?.(t(n.namespace, "panel-menus", e));
68
+ b("layout-resource-index", r, i);
74
69
  }, C = () => {
75
- if (l === 0) {
76
- S();
70
+ f && clearTimeout(f), f = void 0;
71
+ let e = [...l.values()];
72
+ l.clear();
73
+ let r = m();
74
+ for (let i of e) i.generation === r && (c.setItem(t(n.namespace, "layout", i.scope), i.raw), x(i.scope), S(i.scope));
75
+ }, w = () => {
76
+ if (u === 0) {
77
+ C();
77
78
  return;
78
79
  }
79
- d && clearTimeout(d), d = setTimeout(S, l);
80
+ f && clearTimeout(f), f = setTimeout(C, u);
80
81
  };
81
- return u?.addEventListener("pagehide", S), {
82
- getLayout: (n) => {
83
- let a = e(t.namespace, "layout", n), o = c.get(a), l = o && o.generation === p() ? JSON.parse(o.raw) : r(s, a);
84
- if (l?.version === i) return l.layout;
82
+ return d?.addEventListener("pagehide", C), {
83
+ getLayout: (e) => {
84
+ let r = t(n.namespace, "layout", e), o = l.get(r), s = o && o.generation === m() ? JSON.parse(o.raw) : i(c, r);
85
+ if (s?.version === a) return s.layout;
85
86
  },
86
- setLayout: (n, r) => {
87
- let a = {
88
- version: i,
89
- layout: n
90
- }, o = e(t.namespace, "layout", r);
91
- c.delete(o), c.set(o, {
92
- generation: p(),
93
- raw: JSON.stringify(a),
94
- scope: r
95
- }), C();
87
+ setLayout: (r, i) => {
88
+ let o = {
89
+ version: a,
90
+ layout: e(r)
91
+ }, s = t(n.namespace, "layout", i);
92
+ l.delete(s), l.set(s, {
93
+ generation: m(),
94
+ raw: JSON.stringify(o),
95
+ scope: i
96
+ }), w();
96
97
  },
97
- flush: S,
98
+ flush: C,
98
99
  listScopes(e) {
99
100
  return [.../* @__PURE__ */ new Set([
100
- ...v("layout-scope-index", e),
101
- ...v("layout-resource-index", e),
102
- ..._(e)
101
+ ...y("layout-scope-index", e),
102
+ ...y("layout-resource-index", e),
103
+ ...v(e)
103
104
  ])];
104
105
  },
105
- transformLayouts(n, a) {
106
- S(), m();
107
- for (let o of this.listScopes?.(n) ?? []) {
108
- let n = e(t.namespace, "layout", o), c = r(s, n);
109
- if (c?.version !== i) continue;
110
- let l = a(c.layout, o);
106
+ transformLayouts(e, r) {
107
+ C(), h();
108
+ for (let o of this.listScopes?.(e) ?? []) {
109
+ let e = t(n.namespace, "layout", o), s = i(c, e);
110
+ if (s?.version !== a) continue;
111
+ let l = r(s.layout, o);
111
112
  if (!l) {
112
- s.removeItem?.(n);
113
+ c.removeItem?.(e);
113
114
  continue;
114
115
  }
115
- s.setItem(n, JSON.stringify({
116
- version: i,
116
+ c.setItem(e, JSON.stringify({
117
+ version: a,
117
118
  layout: l
118
119
  }));
119
120
  }
120
121
  },
121
- getCompatibilityMarker: (n) => r(s, e(t.namespace, "layout-compatibility", n)),
122
- setCompatibilityMarker: (n, r) => {
123
- m(), s.setItem(e(t.namespace, "layout-compatibility", n), JSON.stringify(r));
122
+ getCompatibilityMarker: (e) => i(c, t(n.namespace, "layout-compatibility", e)),
123
+ setCompatibilityMarker: (e, r) => {
124
+ h(), c.setItem(t(n.namespace, "layout-compatibility", e), JSON.stringify(r));
124
125
  },
125
- advanceWriteGeneration: m,
126
+ advanceWriteGeneration: h,
126
127
  dispose() {
127
- S(), u?.removeEventListener("pagehide", S);
128
+ C(), d?.removeEventListener("pagehide", C);
128
129
  }
129
130
  };
130
- }, c = 1, l = (t) => {
131
- let i = n(t.storage);
131
+ }, l = 1, u = (e) => {
132
+ let n = r(e.storage);
132
133
  return {
133
- load: (n) => {
134
- let a = r(i, e(t.namespace, "page-location", n));
135
- if (a?.version === c) return {
134
+ load: (r) => {
135
+ let a = i(n, t(e.namespace, "page-location", r));
136
+ if (a?.version === l) return {
136
137
  location: a.location,
137
138
  ...a.rootLevel ? { rootLevel: a.rootLevel } : {}
138
139
  };
139
140
  },
140
- save: (n, r) => {
141
+ save: (r, i) => {
141
142
  let a = {
142
- version: c,
143
- ...r
143
+ version: l,
144
+ ...i
144
145
  };
145
- i.setItem(e(t.namespace, "page-location", n), JSON.stringify(a));
146
+ n.setItem(t(e.namespace, "page-location", r), JSON.stringify(a));
146
147
  }
147
148
  };
148
- }, u = (t) => {
149
- let i = n(t.storage);
149
+ }, d = (e) => {
150
+ let n = r(e.storage);
150
151
  return {
151
- getMenuStates: (n) => r(i, e(t.namespace, "panel-menus", n ?? t.scope)),
152
- setMenuStates: (n, r) => {
153
- let a = e(t.namespace, "panel-menus", r ?? t.scope);
154
- i.setItem(a, JSON.stringify(n));
152
+ getMenuStates: (r) => i(n, t(e.namespace, "panel-menus", r ?? e.scope)),
153
+ setMenuStates: (r, i) => {
154
+ let a = t(e.namespace, "panel-menus", i ?? e.scope);
155
+ n.setItem(a, JSON.stringify(r));
155
156
  }
156
157
  };
157
- }, d = (t) => {
158
- let i = n(t.storage), a = e(t.namespace, "tree", t.scope);
158
+ }, f = (e) => {
159
+ let n = r(e.storage), a = t(e.namespace, "tree", e.scope);
159
160
  return {
160
- getTreeStates: () => r(i, a),
161
+ getTreeStates: () => i(n, a),
161
162
  setTreeStates: (e) => {
162
- i.setItem(a, JSON.stringify(e));
163
+ n.setItem(a, JSON.stringify(e));
163
164
  }
164
165
  };
165
- }, f = (t) => {
166
- let i = n(t.storage), a = s({
167
- debounceMs: t.debounceMs,
168
- eventTarget: t.eventTarget,
169
- namespace: t.namespace,
170
- storage: i
171
- }), o = {
166
+ }, p = (e) => {
167
+ let n = r(e.storage), a = t(e.namespace, "preferences", void 0), o = {
168
+ getValue: (e, t) => i(n, a)?.[JSON.stringify([
169
+ e,
170
+ t.scope,
171
+ t.scopeId
172
+ ])],
173
+ setValue: (e, t, r) => {
174
+ let o = i(n, a) ?? {};
175
+ n.setItem(a, JSON.stringify({
176
+ ...o,
177
+ [JSON.stringify([
178
+ e,
179
+ r.scope,
180
+ r.scopeId
181
+ ])]: t
182
+ }));
183
+ }
184
+ }, s = c({
185
+ debounceMs: e.debounceMs,
186
+ eventTarget: e.eventTarget,
187
+ namespace: e.namespace,
188
+ storage: n
189
+ }), l = {
172
190
  getSnapshot: (e) => {
173
- let t = a.getLayout(e);
191
+ let t = s.getLayout(e);
174
192
  return t ? { layout: t } : void 0;
175
193
  },
176
- setSnapshot: (e, t) => a.setLayout(e.layout, t),
177
- flush: a.flush,
178
- dispose: a.dispose
179
- }, c = e(t.namespace, "status-bar", void 0);
194
+ setSnapshot: (e, t) => s.setLayout(e.layout, t),
195
+ flush: s.flush,
196
+ dispose: s.dispose
197
+ }, p = t(e.namespace, "status-bar", void 0);
180
198
  return {
181
- snapshotPersistence: o,
199
+ preferencePersistence: o,
200
+ snapshotPersistence: l,
182
201
  statusBarPersistence: {
183
- getOrder: () => r(i, c),
184
- setOrder: (e) => i.setItem(c, JSON.stringify(e))
202
+ getOrder: () => i(n, p),
203
+ setOrder: (e) => n.setItem(p, JSON.stringify(e))
185
204
  },
186
- layoutPersistence: a,
187
- panelMenuStatePersistence: u({
188
- namespace: t.namespace,
189
- scope: t.scope ?? "global",
190
- storage: i
205
+ layoutPersistence: s,
206
+ panelMenuStatePersistence: d({
207
+ namespace: e.namespace,
208
+ scope: e.scope ?? "global",
209
+ storage: n
191
210
  }),
192
- pageLocationPersistence: l({
193
- namespace: t.namespace,
194
- storage: i
211
+ pageLocationPersistence: u({
212
+ namespace: e.namespace,
213
+ storage: n
195
214
  }),
196
- treePersistence: d({
197
- namespace: t.namespace,
198
- scope: t.scope,
199
- storage: i
215
+ treePersistence: f({
216
+ namespace: e.namespace,
217
+ scope: e.scope,
218
+ storage: n
200
219
  })
201
220
  };
202
221
  };
203
222
  //#endregion
204
- export { s as createLocalStorageLayoutPersistence, l as createLocalStoragePageLocationPersistence, u as createLocalStoragePanelMenuStatePersistence, d as createLocalStorageTreePersistence, f as createLocalStorageWorkbenchPersistence, e as workbenchStoragePersistenceKey };
223
+ export { c as createLocalStorageLayoutPersistence, u as createLocalStoragePageLocationPersistence, d as createLocalStoragePanelMenuStatePersistence, f as createLocalStorageTreePersistence, p as createLocalStorageWorkbenchPersistence, t as workbenchStoragePersistenceKey };
205
224
 
206
225
  //# sourceMappingURL=storage.js.map