@pstdio/workbench 0.44.0-nightly.20261017030225 → 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.
- package/dist/extensions.d.ts +163 -1040
- package/dist/extensions.js +1194 -808
- package/dist/extensions.js.map +1 -1
- package/dist/{file-renderer-view-r1qeAkQT.js → file-renderer-view-C5dyoQQW.js} +211 -214
- package/dist/file-renderer-view-C5dyoQQW.js.map +1 -0
- package/dist/{index-zQfxsv7O.d.ts → index-8x-QT7wg.d.ts} +1994 -533
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2052 -2002
- package/dist/index.js.map +1 -1
- package/dist/{kanban-presentation-BtBGjJnW.d.ts → kanban-presentation-pexk_oCY.d.ts} +1 -1
- package/dist/layout-tab-presentation-Bz6EgFEa.js +15 -0
- package/dist/layout-tab-presentation-Bz6EgFEa.js.map +1 -0
- package/dist/{navigation-tree-registry-CIwRvLFJ.js → navigation-tree-registry-C5l3eO3n.js} +2 -2
- package/dist/{navigation-tree-registry-CIwRvLFJ.js.map → navigation-tree-registry-C5l3eO3n.js.map} +1 -1
- package/dist/react-C-HbdPSw.js +8881 -0
- package/dist/react-C-HbdPSw.js.map +1 -0
- package/dist/react.d.ts +75 -29
- package/dist/react.js +2 -2
- package/dist/storage.d.ts +3 -2
- package/dist/storage.js +142 -123
- package/dist/storage.js.map +1 -1
- package/dist/webview-runtime.js +1 -1
- package/dist/workbench-renderers-Bz_dLyHW.js +4775 -0
- package/dist/workbench-renderers-Bz_dLyHW.js.map +1 -0
- package/package.json +3 -3
- package/dist/file-renderer-view-r1qeAkQT.js.map +0 -1
- package/dist/react-CoeiP5wi.js +0 -10939
- package/dist/react-CoeiP5wi.js.map +0 -1
- package/dist/workbench-renderers-Bj4sazP5.js +0 -976
- package/dist/workbench-renderers-Bj4sazP5.js.map +0 -1
package/dist/react.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as ReactResourceContextAction, i as ReactKanbanRendererContribution, n as ReactAttributesSource, r as ReactBoardColumnConfig, t as ReactAttributeDescriptor } from "./kanban-presentation-
|
|
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,
|
|
165
|
-
|
|
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,
|
|
2
|
-
export {
|
|
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 {
|
|
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
|
|
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
|
-
},
|
|
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
|
-
},
|
|
25
|
-
let
|
|
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),
|
|
29
|
-
let e =
|
|
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
|
-
},
|
|
32
|
-
let e =
|
|
32
|
+
}, h = () => {
|
|
33
|
+
let e = m() + 1, t = {
|
|
33
34
|
version: 1,
|
|
34
35
|
generation: e
|
|
35
36
|
};
|
|
36
|
-
return
|
|
37
|
-
},
|
|
38
|
-
if (!
|
|
39
|
-
let
|
|
40
|
-
for (let
|
|
41
|
-
let i =
|
|
42
|
-
if (!i?.startsWith(
|
|
43
|
-
let a = i.slice(
|
|
44
|
-
|
|
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
|
-
},
|
|
48
|
-
let
|
|
49
|
-
return typeof
|
|
50
|
-
},
|
|
51
|
-
let
|
|
52
|
-
version:
|
|
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
|
-
|
|
56
|
-
},
|
|
57
|
-
let t =
|
|
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 =
|
|
60
|
-
n.push(e),
|
|
61
|
-
},
|
|
62
|
-
let r =
|
|
63
|
-
if (!r || !
|
|
64
|
-
let i =
|
|
65
|
-
i.push(
|
|
66
|
-
for (let
|
|
67
|
-
|
|
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
|
-
|
|
76
|
-
|
|
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
|
-
|
|
80
|
+
f && clearTimeout(f), f = setTimeout(C, u);
|
|
80
81
|
};
|
|
81
|
-
return
|
|
82
|
-
getLayout: (
|
|
83
|
-
let
|
|
84
|
-
if (
|
|
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: (
|
|
87
|
-
let
|
|
88
|
-
version:
|
|
89
|
-
layout:
|
|
90
|
-
},
|
|
91
|
-
|
|
92
|
-
generation:
|
|
93
|
-
raw: JSON.stringify(
|
|
94
|
-
scope:
|
|
95
|
-
}),
|
|
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:
|
|
98
|
+
flush: C,
|
|
98
99
|
listScopes(e) {
|
|
99
100
|
return [.../* @__PURE__ */ new Set([
|
|
100
|
-
...
|
|
101
|
-
...
|
|
102
|
-
...
|
|
101
|
+
...y("layout-scope-index", e),
|
|
102
|
+
...y("layout-resource-index", e),
|
|
103
|
+
...v(e)
|
|
103
104
|
])];
|
|
104
105
|
},
|
|
105
|
-
transformLayouts(
|
|
106
|
-
|
|
107
|
-
for (let o of this.listScopes?.(
|
|
108
|
-
let
|
|
109
|
-
if (
|
|
110
|
-
let l =
|
|
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
|
-
|
|
113
|
+
c.removeItem?.(e);
|
|
113
114
|
continue;
|
|
114
115
|
}
|
|
115
|
-
|
|
116
|
-
version:
|
|
116
|
+
c.setItem(e, JSON.stringify({
|
|
117
|
+
version: a,
|
|
117
118
|
layout: l
|
|
118
119
|
}));
|
|
119
120
|
}
|
|
120
121
|
},
|
|
121
|
-
getCompatibilityMarker: (
|
|
122
|
-
setCompatibilityMarker: (
|
|
123
|
-
|
|
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:
|
|
126
|
+
advanceWriteGeneration: h,
|
|
126
127
|
dispose() {
|
|
127
|
-
|
|
128
|
+
C(), d?.removeEventListener("pagehide", C);
|
|
128
129
|
}
|
|
129
130
|
};
|
|
130
|
-
},
|
|
131
|
-
let
|
|
131
|
+
}, l = 1, u = (e) => {
|
|
132
|
+
let n = r(e.storage);
|
|
132
133
|
return {
|
|
133
|
-
load: (
|
|
134
|
-
let a =
|
|
135
|
-
if (a?.version ===
|
|
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: (
|
|
141
|
+
save: (r, i) => {
|
|
141
142
|
let a = {
|
|
142
|
-
version:
|
|
143
|
-
...
|
|
143
|
+
version: l,
|
|
144
|
+
...i
|
|
144
145
|
};
|
|
145
|
-
|
|
146
|
+
n.setItem(t(e.namespace, "page-location", r), JSON.stringify(a));
|
|
146
147
|
}
|
|
147
148
|
};
|
|
148
|
-
},
|
|
149
|
-
let
|
|
149
|
+
}, d = (e) => {
|
|
150
|
+
let n = r(e.storage);
|
|
150
151
|
return {
|
|
151
|
-
getMenuStates: (
|
|
152
|
-
setMenuStates: (
|
|
153
|
-
let a = e
|
|
154
|
-
|
|
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
|
-
},
|
|
158
|
-
let
|
|
158
|
+
}, f = (e) => {
|
|
159
|
+
let n = r(e.storage), a = t(e.namespace, "tree", e.scope);
|
|
159
160
|
return {
|
|
160
|
-
getTreeStates: () =>
|
|
161
|
+
getTreeStates: () => i(n, a),
|
|
161
162
|
setTreeStates: (e) => {
|
|
162
|
-
|
|
163
|
+
n.setItem(a, JSON.stringify(e));
|
|
163
164
|
}
|
|
164
165
|
};
|
|
165
|
-
},
|
|
166
|
-
let
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
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 =
|
|
191
|
+
let t = s.getLayout(e);
|
|
174
192
|
return t ? { layout: t } : void 0;
|
|
175
193
|
},
|
|
176
|
-
setSnapshot: (e, t) =>
|
|
177
|
-
flush:
|
|
178
|
-
dispose:
|
|
179
|
-
},
|
|
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
|
-
|
|
199
|
+
preferencePersistence: o,
|
|
200
|
+
snapshotPersistence: l,
|
|
182
201
|
statusBarPersistence: {
|
|
183
|
-
getOrder: () =>
|
|
184
|
-
setOrder: (e) =>
|
|
202
|
+
getOrder: () => i(n, p),
|
|
203
|
+
setOrder: (e) => n.setItem(p, JSON.stringify(e))
|
|
185
204
|
},
|
|
186
|
-
layoutPersistence:
|
|
187
|
-
panelMenuStatePersistence:
|
|
188
|
-
namespace:
|
|
189
|
-
scope:
|
|
190
|
-
storage:
|
|
205
|
+
layoutPersistence: s,
|
|
206
|
+
panelMenuStatePersistence: d({
|
|
207
|
+
namespace: e.namespace,
|
|
208
|
+
scope: e.scope ?? "global",
|
|
209
|
+
storage: n
|
|
191
210
|
}),
|
|
192
|
-
pageLocationPersistence:
|
|
193
|
-
namespace:
|
|
194
|
-
storage:
|
|
211
|
+
pageLocationPersistence: u({
|
|
212
|
+
namespace: e.namespace,
|
|
213
|
+
storage: n
|
|
195
214
|
}),
|
|
196
|
-
treePersistence:
|
|
197
|
-
namespace:
|
|
198
|
-
scope:
|
|
199
|
-
storage:
|
|
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 {
|
|
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
|