@principal-ade/panel-layouts 0.2.2 → 0.2.4
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/index.d.ts +392 -0
- package/dist/index.esm.js +1291 -637
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.esm.js
CHANGED
|
@@ -1,73 +1,73 @@
|
|
|
1
|
-
import './index.css';var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { EditableConfigurablePanelLayout as
|
|
5
|
-
import
|
|
6
|
-
import { jsx as
|
|
7
|
-
import { useTheme as
|
|
8
|
-
class
|
|
1
|
+
import './index.css';var Y = Object.defineProperty;
|
|
2
|
+
var Q = (t, e, o) => e in t ? Y(t, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : t[e] = o;
|
|
3
|
+
var _ = (t, e, o) => Q(t, typeof e != "symbol" ? e + "" : e, o);
|
|
4
|
+
import { EditableConfigurablePanelLayout as ot, ResponsiveConfigurablePanelLayout as rt, mapThemeToPanelVars as at, mapThemeToTabVars as st } from "@principal-ade/panels";
|
|
5
|
+
import U, { useState as W, useRef as A, useEffect as I, useCallback as w, forwardRef as Z, useMemo as M } from "react";
|
|
6
|
+
import { jsx as f, jsxs as T, Fragment as ee } from "react/jsx-runtime";
|
|
7
|
+
import { useTheme as $ } from "@principal-ade/industry-theme";
|
|
8
|
+
class te {
|
|
9
9
|
constructor() {
|
|
10
|
-
|
|
10
|
+
_(this, "storageKey", "panel-layouts");
|
|
11
11
|
}
|
|
12
12
|
async load(e) {
|
|
13
13
|
try {
|
|
14
|
-
const
|
|
15
|
-
return
|
|
16
|
-
} catch (
|
|
17
|
-
return console.error(`Failed to load panel layout for ${e}:`,
|
|
14
|
+
const o = localStorage.getItem(`${this.storageKey}:${e}`);
|
|
15
|
+
return o ? JSON.parse(o) : null;
|
|
16
|
+
} catch (o) {
|
|
17
|
+
return console.error(`Failed to load panel layout for ${e}:`, o), null;
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
async save(e,
|
|
20
|
+
async save(e, o) {
|
|
21
21
|
try {
|
|
22
22
|
localStorage.setItem(
|
|
23
23
|
`${this.storageKey}:${e}`,
|
|
24
|
-
JSON.stringify(
|
|
24
|
+
JSON.stringify(o)
|
|
25
25
|
);
|
|
26
|
-
} catch (
|
|
27
|
-
console.error(`Failed to save panel layout for ${e}:`,
|
|
26
|
+
} catch (r) {
|
|
27
|
+
console.error(`Failed to save panel layout for ${e}:`, r);
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function Ee(t) {
|
|
32
32
|
const {
|
|
33
33
|
viewKey: e,
|
|
34
|
-
defaultSizes:
|
|
35
|
-
panelType:
|
|
36
|
-
adapter:
|
|
37
|
-
} =
|
|
38
|
-
|
|
34
|
+
defaultSizes: o,
|
|
35
|
+
panelType: r,
|
|
36
|
+
adapter: a = new te()
|
|
37
|
+
} = t, [n, s] = W(o), [l, d] = W(t.collapsed), p = A(t.collapsed), g = A({}), c = A(null), m = A(null);
|
|
38
|
+
I(() => {
|
|
39
39
|
(async () => {
|
|
40
|
-
const C = await
|
|
41
|
-
C != null && C.sizes && (
|
|
40
|
+
const C = await a.load(e);
|
|
41
|
+
C != null && C.sizes && (s(C.sizes), y(C.sizes));
|
|
42
42
|
})();
|
|
43
43
|
}, [e]);
|
|
44
|
-
const
|
|
45
|
-
(
|
|
46
|
-
"left" in
|
|
44
|
+
const y = w(
|
|
45
|
+
(b) => {
|
|
46
|
+
"left" in b && b.left > 0 && (g.current.left = b.left), "middle" in b && b.middle > 0 && (g.current.middle = b.middle), "right" in b && b.right > 0 && (g.current.right = b.right);
|
|
47
47
|
},
|
|
48
48
|
[]
|
|
49
|
-
),
|
|
50
|
-
(
|
|
51
|
-
const C =
|
|
49
|
+
), u = w(
|
|
50
|
+
(b) => {
|
|
51
|
+
const C = g.current[b];
|
|
52
52
|
if (C && C > 0)
|
|
53
53
|
return C;
|
|
54
|
-
if (
|
|
55
|
-
return
|
|
56
|
-
if (
|
|
57
|
-
return
|
|
54
|
+
if (b === "left" && "left" in o && o.left > 0)
|
|
55
|
+
return o.left;
|
|
56
|
+
if (b === "right" && "right" in o && o.right > 0)
|
|
57
|
+
return o.right;
|
|
58
58
|
},
|
|
59
|
-
[
|
|
60
|
-
), i =
|
|
61
|
-
|
|
62
|
-
("left" in
|
|
63
|
-
}, [
|
|
64
|
-
const
|
|
65
|
-
(
|
|
66
|
-
}, [
|
|
67
|
-
const
|
|
68
|
-
async (
|
|
59
|
+
[o]
|
|
60
|
+
), i = A(o);
|
|
61
|
+
I(() => {
|
|
62
|
+
("left" in o && o.left !== i.current.left || "middle" in o && "middle" in i.current && o.middle !== i.current.middle || "right" in o && o.right !== i.current.right) && (s(o), y(o), i.current = o);
|
|
63
|
+
}, [o, y]), I(() => {
|
|
64
|
+
const b = t.collapsed.left !== p.current.left, C = "right" in t.collapsed && "right" in p.current && t.collapsed.right !== p.current.right;
|
|
65
|
+
(b || C) && (d(t.collapsed), p.current = { ...t.collapsed });
|
|
66
|
+
}, [t.collapsed.left, t.collapsed.right]);
|
|
67
|
+
const k = w(
|
|
68
|
+
async (b) => {
|
|
69
69
|
try {
|
|
70
|
-
await
|
|
70
|
+
await a.save(e, { sizes: b });
|
|
71
71
|
} catch (C) {
|
|
72
72
|
console.error(
|
|
73
73
|
`Failed to save panel preferences for ${e}:`,
|
|
@@ -75,75 +75,75 @@ function ie(o) {
|
|
|
75
75
|
);
|
|
76
76
|
}
|
|
77
77
|
},
|
|
78
|
-
[e,
|
|
79
|
-
),
|
|
80
|
-
(
|
|
81
|
-
const C = { ...
|
|
82
|
-
let
|
|
83
|
-
if ("left" in
|
|
84
|
-
const
|
|
85
|
-
if (
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
} else
|
|
78
|
+
[e, a]
|
|
79
|
+
), P = w(
|
|
80
|
+
(b) => {
|
|
81
|
+
const C = { ...b };
|
|
82
|
+
let v = !0;
|
|
83
|
+
if ("left" in b) {
|
|
84
|
+
const x = !!(l != null && l.left), h = b.left;
|
|
85
|
+
if (x) {
|
|
86
|
+
const S = u("left");
|
|
87
|
+
S !== void 0 && S > 0 ? C.left = S : v = !1;
|
|
88
|
+
} else h === 0 && (v = !1);
|
|
89
89
|
}
|
|
90
|
-
if (
|
|
91
|
-
const
|
|
92
|
-
if (
|
|
93
|
-
const
|
|
94
|
-
|
|
95
|
-
} else
|
|
90
|
+
if (r === "three-panel" && "right" in b) {
|
|
91
|
+
const x = !!(l != null && l.right), h = b.right;
|
|
92
|
+
if (x) {
|
|
93
|
+
const S = u("right");
|
|
94
|
+
S !== void 0 && S > 0 ? C.right = S : v = !1;
|
|
95
|
+
} else h === 0 && (v = !1);
|
|
96
96
|
}
|
|
97
|
-
if (
|
|
98
|
-
|
|
97
|
+
if (s(C), y(C), c.current && (clearTimeout(c.current), c.current = null), !v) {
|
|
98
|
+
m.current = null;
|
|
99
99
|
return;
|
|
100
100
|
}
|
|
101
|
-
|
|
102
|
-
const
|
|
103
|
-
|
|
101
|
+
m.current = C, c.current = setTimeout(() => {
|
|
102
|
+
const x = m.current;
|
|
103
|
+
x && (k(x), m.current = null), c.current = null;
|
|
104
104
|
}, 500);
|
|
105
105
|
},
|
|
106
106
|
[
|
|
107
107
|
l,
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
108
|
+
u,
|
|
109
|
+
r,
|
|
110
|
+
k,
|
|
111
|
+
y
|
|
112
112
|
]
|
|
113
113
|
);
|
|
114
|
-
|
|
115
|
-
if (
|
|
116
|
-
const
|
|
117
|
-
|
|
114
|
+
I(() => () => {
|
|
115
|
+
if (c.current) {
|
|
116
|
+
const b = m.current;
|
|
117
|
+
b && (k(b), m.current = null), clearTimeout(c.current), c.current = null;
|
|
118
118
|
}
|
|
119
|
-
}, [
|
|
120
|
-
const
|
|
121
|
-
}, []),
|
|
122
|
-
}, []),
|
|
123
|
-
}, []),
|
|
119
|
+
}, [k]);
|
|
120
|
+
const L = w(async () => {
|
|
121
|
+
}, []), z = w(async () => {
|
|
122
|
+
}, []), D = w(async () => {
|
|
123
|
+
}, []), F = w(async () => {
|
|
124
124
|
}, []);
|
|
125
|
-
return
|
|
125
|
+
return r === "three-panel" ? {
|
|
126
126
|
type: "three-panel",
|
|
127
127
|
sizes: n,
|
|
128
128
|
collapsed: l,
|
|
129
|
-
handlePanelResize:
|
|
130
|
-
handleLeftCollapseComplete:
|
|
131
|
-
handleLeftExpandComplete:
|
|
132
|
-
handleRightCollapseComplete:
|
|
133
|
-
handleRightExpandComplete:
|
|
129
|
+
handlePanelResize: P,
|
|
130
|
+
handleLeftCollapseComplete: L,
|
|
131
|
+
handleLeftExpandComplete: z,
|
|
132
|
+
handleRightCollapseComplete: D,
|
|
133
|
+
handleRightExpandComplete: F
|
|
134
134
|
} : {
|
|
135
135
|
type: "two-panel",
|
|
136
136
|
sizes: n,
|
|
137
137
|
collapsed: l,
|
|
138
|
-
handlePanelResize:
|
|
139
|
-
handleLeftCollapseComplete:
|
|
140
|
-
handleLeftExpandComplete:
|
|
138
|
+
handlePanelResize: P,
|
|
139
|
+
handleLeftCollapseComplete: L,
|
|
140
|
+
handleLeftExpandComplete: z
|
|
141
141
|
};
|
|
142
142
|
}
|
|
143
|
-
class
|
|
143
|
+
class oe {
|
|
144
144
|
constructor() {
|
|
145
|
-
|
|
146
|
-
|
|
145
|
+
_(this, "PRESETS_KEY", "panel-layouts:workspace-presets");
|
|
146
|
+
_(this, "REPO_STATE_PREFIX", "panel-layouts:repo-state:");
|
|
147
147
|
}
|
|
148
148
|
/**
|
|
149
149
|
* Load all user-created workspace presets
|
|
@@ -162,8 +162,8 @@ class U {
|
|
|
162
162
|
async saveWorkspacePresets(e) {
|
|
163
163
|
try {
|
|
164
164
|
localStorage.setItem(this.PRESETS_KEY, JSON.stringify(e));
|
|
165
|
-
} catch (
|
|
166
|
-
throw console.error("Failed to save workspace presets:",
|
|
165
|
+
} catch (o) {
|
|
166
|
+
throw console.error("Failed to save workspace presets:", o), o;
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
169
|
/**
|
|
@@ -171,27 +171,27 @@ class U {
|
|
|
171
171
|
*/
|
|
172
172
|
async loadRepositoryState(e) {
|
|
173
173
|
try {
|
|
174
|
-
const
|
|
175
|
-
return
|
|
176
|
-
} catch (
|
|
174
|
+
const o = `${this.REPO_STATE_PREFIX}${e}`, r = localStorage.getItem(o);
|
|
175
|
+
return r ? JSON.parse(r) : null;
|
|
176
|
+
} catch (o) {
|
|
177
177
|
return console.error(
|
|
178
178
|
`Failed to load repository state for ${e}:`,
|
|
179
|
-
|
|
179
|
+
o
|
|
180
180
|
), null;
|
|
181
181
|
}
|
|
182
182
|
}
|
|
183
183
|
/**
|
|
184
184
|
* Save repository-specific workspace state
|
|
185
185
|
*/
|
|
186
|
-
async saveRepositoryState(e,
|
|
186
|
+
async saveRepositoryState(e, o) {
|
|
187
187
|
try {
|
|
188
|
-
const
|
|
189
|
-
localStorage.setItem(
|
|
190
|
-
} catch (
|
|
188
|
+
const r = `${this.REPO_STATE_PREFIX}${e}`;
|
|
189
|
+
localStorage.setItem(r, JSON.stringify(o));
|
|
190
|
+
} catch (r) {
|
|
191
191
|
throw console.error(
|
|
192
192
|
`Failed to save repository state for ${e}:`,
|
|
193
|
-
|
|
194
|
-
),
|
|
193
|
+
r
|
|
194
|
+
), r;
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
197
|
/**
|
|
@@ -200,17 +200,17 @@ class U {
|
|
|
200
200
|
async loadAllRepositoryStates() {
|
|
201
201
|
try {
|
|
202
202
|
const e = {};
|
|
203
|
-
for (let
|
|
204
|
-
const
|
|
205
|
-
if (
|
|
206
|
-
const
|
|
203
|
+
for (let o = 0; o < localStorage.length; o++) {
|
|
204
|
+
const r = localStorage.key(o);
|
|
205
|
+
if (r && r.startsWith(this.REPO_STATE_PREFIX)) {
|
|
206
|
+
const a = r.substring(this.REPO_STATE_PREFIX.length), n = localStorage.getItem(r);
|
|
207
207
|
if (n)
|
|
208
208
|
try {
|
|
209
|
-
e[
|
|
210
|
-
} catch (
|
|
209
|
+
e[a] = JSON.parse(n);
|
|
210
|
+
} catch (s) {
|
|
211
211
|
console.error(
|
|
212
|
-
`Failed to parse repository state for ${
|
|
213
|
-
|
|
212
|
+
`Failed to parse repository state for ${a}:`,
|
|
213
|
+
s
|
|
214
214
|
);
|
|
215
215
|
}
|
|
216
216
|
}
|
|
@@ -248,8 +248,8 @@ class R {
|
|
|
248
248
|
* Create a new workspace layout
|
|
249
249
|
*/
|
|
250
250
|
static async createWorkspaceLayout(e) {
|
|
251
|
-
const
|
|
252
|
-
id:
|
|
251
|
+
const o = await this.adapter.loadWorkspacePresets(), r = this.generateWorkspaceId(e.name), a = {
|
|
252
|
+
id: r,
|
|
253
253
|
name: e.name,
|
|
254
254
|
description: e.description,
|
|
255
255
|
layout: e.layout,
|
|
@@ -259,45 +259,45 @@ class R {
|
|
|
259
259
|
updatedAt: Date.now(),
|
|
260
260
|
isBuiltIn: !1
|
|
261
261
|
}, n = {
|
|
262
|
-
...
|
|
263
|
-
[
|
|
262
|
+
...o,
|
|
263
|
+
[r]: a
|
|
264
264
|
};
|
|
265
|
-
return await this.adapter.saveWorkspacePresets(n),
|
|
265
|
+
return await this.adapter.saveWorkspacePresets(n), a;
|
|
266
266
|
}
|
|
267
267
|
/**
|
|
268
268
|
* Update an existing workspace layout
|
|
269
269
|
*/
|
|
270
|
-
static async updateWorkspaceLayout(e,
|
|
271
|
-
const
|
|
272
|
-
if (!
|
|
270
|
+
static async updateWorkspaceLayout(e, o) {
|
|
271
|
+
const r = await this.adapter.loadWorkspacePresets(), a = r[e];
|
|
272
|
+
if (!a)
|
|
273
273
|
return console.error(`Workspace layout ${e} not found`), null;
|
|
274
|
-
if (
|
|
274
|
+
if (a.isBuiltIn)
|
|
275
275
|
return console.error(`Cannot update built-in workspace layout ${e}`), null;
|
|
276
276
|
const n = {
|
|
277
|
-
...
|
|
278
|
-
...
|
|
277
|
+
...a,
|
|
278
|
+
...o,
|
|
279
279
|
id: e,
|
|
280
280
|
// Preserve ID
|
|
281
|
-
createdAt:
|
|
281
|
+
createdAt: a.createdAt,
|
|
282
282
|
// Preserve creation time
|
|
283
283
|
updatedAt: Date.now()
|
|
284
|
-
},
|
|
285
|
-
...
|
|
284
|
+
}, s = {
|
|
285
|
+
...r,
|
|
286
286
|
[e]: n
|
|
287
287
|
};
|
|
288
|
-
return await this.adapter.saveWorkspacePresets(
|
|
288
|
+
return await this.adapter.saveWorkspacePresets(s), n;
|
|
289
289
|
}
|
|
290
290
|
/**
|
|
291
291
|
* Delete a workspace layout
|
|
292
292
|
*/
|
|
293
293
|
static async deleteWorkspaceLayout(e) {
|
|
294
|
-
const
|
|
295
|
-
if (!
|
|
294
|
+
const o = await this.adapter.loadWorkspacePresets(), r = o[e];
|
|
295
|
+
if (!r)
|
|
296
296
|
return console.error(`Workspace layout ${e} not found`), !1;
|
|
297
|
-
if (
|
|
297
|
+
if (r.isBuiltIn)
|
|
298
298
|
return console.error(`Cannot delete built-in workspace layout ${e}`), !1;
|
|
299
|
-
const
|
|
300
|
-
return delete
|
|
299
|
+
const a = { ...o };
|
|
300
|
+
return delete a[e], await this.adapter.saveWorkspacePresets(a), !0;
|
|
301
301
|
}
|
|
302
302
|
/**
|
|
303
303
|
* Get repository state (which workspace + current sizes/collapsed)
|
|
@@ -308,89 +308,89 @@ class R {
|
|
|
308
308
|
/**
|
|
309
309
|
* Set repository state (which workspace + current sizes/collapsed/layout)
|
|
310
310
|
*/
|
|
311
|
-
static async setRepositoryState(e,
|
|
312
|
-
await this.adapter.saveRepositoryState(e,
|
|
311
|
+
static async setRepositoryState(e, o) {
|
|
312
|
+
await this.adapter.saveRepositoryState(e, o);
|
|
313
313
|
}
|
|
314
314
|
/**
|
|
315
315
|
* Update only sizes in repository state
|
|
316
316
|
*/
|
|
317
|
-
static async updateRepositorySizes(e,
|
|
318
|
-
const
|
|
319
|
-
|
|
320
|
-
...
|
|
321
|
-
sizes:
|
|
317
|
+
static async updateRepositorySizes(e, o) {
|
|
318
|
+
const r = await this.getRepositoryState(e);
|
|
319
|
+
r && await this.setRepositoryState(e, {
|
|
320
|
+
...r,
|
|
321
|
+
sizes: o
|
|
322
322
|
});
|
|
323
323
|
}
|
|
324
324
|
/**
|
|
325
325
|
* Update only collapsed state in repository state
|
|
326
326
|
*/
|
|
327
|
-
static async updateRepositoryCollapsed(e,
|
|
328
|
-
const
|
|
329
|
-
|
|
330
|
-
...
|
|
331
|
-
collapsed:
|
|
327
|
+
static async updateRepositoryCollapsed(e, o) {
|
|
328
|
+
const r = await this.getRepositoryState(e);
|
|
329
|
+
r && await this.setRepositoryState(e, {
|
|
330
|
+
...r,
|
|
331
|
+
collapsed: o
|
|
332
332
|
});
|
|
333
333
|
}
|
|
334
334
|
/**
|
|
335
335
|
* Check if repository state differs from workspace defaults
|
|
336
336
|
*/
|
|
337
|
-
static hasStateDeviation(e,
|
|
338
|
-
const
|
|
339
|
-
return { hasSizeDeviation:
|
|
337
|
+
static hasStateDeviation(e, o) {
|
|
338
|
+
const r = o.defaultSizes ? JSON.stringify(e.sizes) !== JSON.stringify(o.defaultSizes) : !1, a = o.defaultCollapsed ? JSON.stringify(e.collapsed) !== JSON.stringify(o.defaultCollapsed) : !1;
|
|
339
|
+
return { hasSizeDeviation: r, hasCollapsedDeviation: a };
|
|
340
340
|
}
|
|
341
341
|
/**
|
|
342
342
|
* Update workspace defaults from repository state
|
|
343
343
|
*/
|
|
344
|
-
static async updateWorkspaceFromRepositoryState(e,
|
|
345
|
-
const
|
|
346
|
-
if (!
|
|
344
|
+
static async updateWorkspaceFromRepositoryState(e, o) {
|
|
345
|
+
const r = await this.getWorkspaceLayout(e), a = await this.getRepositoryState(o);
|
|
346
|
+
if (!r || !a || r.isBuiltIn) {
|
|
347
347
|
console.error(
|
|
348
348
|
"Cannot update built-in workspace or workspace/state not found"
|
|
349
349
|
);
|
|
350
350
|
return;
|
|
351
351
|
}
|
|
352
352
|
await this.updateWorkspaceLayout(e, {
|
|
353
|
-
defaultSizes:
|
|
354
|
-
defaultCollapsed:
|
|
353
|
+
defaultSizes: a.sizes,
|
|
354
|
+
defaultCollapsed: a.collapsed
|
|
355
355
|
});
|
|
356
356
|
}
|
|
357
357
|
/**
|
|
358
358
|
* Reset repository state to workspace defaults
|
|
359
359
|
*/
|
|
360
|
-
static async resetRepositoryToWorkspaceDefaults(e,
|
|
361
|
-
const
|
|
362
|
-
if (!
|
|
363
|
-
console.error(`Workspace ${
|
|
360
|
+
static async resetRepositoryToWorkspaceDefaults(e, o) {
|
|
361
|
+
const r = await this.getWorkspaceLayout(o);
|
|
362
|
+
if (!r) {
|
|
363
|
+
console.error(`Workspace ${o} not found`);
|
|
364
364
|
return;
|
|
365
365
|
}
|
|
366
|
-
const
|
|
367
|
-
|
|
368
|
-
...
|
|
369
|
-
sizes:
|
|
370
|
-
collapsed:
|
|
366
|
+
const a = await this.getRepositoryState(e);
|
|
367
|
+
a && await this.setRepositoryState(e, {
|
|
368
|
+
...a,
|
|
369
|
+
sizes: r.defaultSizes || { left: 20, middle: 45, right: 35 },
|
|
370
|
+
collapsed: r.defaultCollapsed || { left: !1, right: !1 }
|
|
371
371
|
});
|
|
372
372
|
}
|
|
373
373
|
/**
|
|
374
374
|
* Check if a layout matches a workspace layout
|
|
375
375
|
*/
|
|
376
|
-
static isLayoutMatchingWorkspace(e,
|
|
377
|
-
return this.areLayoutsEqual(e,
|
|
376
|
+
static isLayoutMatchingWorkspace(e, o) {
|
|
377
|
+
return this.areLayoutsEqual(e, o.layout);
|
|
378
378
|
}
|
|
379
379
|
/**
|
|
380
380
|
* Find workspace ID that matches the given layout
|
|
381
381
|
*/
|
|
382
382
|
static async findMatchingWorkspace(e) {
|
|
383
|
-
const
|
|
384
|
-
for (const [
|
|
385
|
-
if (this.isLayoutMatchingWorkspace(e,
|
|
386
|
-
return
|
|
383
|
+
const o = await this.getWorkspaceLayouts();
|
|
384
|
+
for (const [r, a] of Object.entries(o))
|
|
385
|
+
if (this.isLayoutMatchingWorkspace(e, a))
|
|
386
|
+
return r;
|
|
387
387
|
return null;
|
|
388
388
|
}
|
|
389
389
|
/**
|
|
390
390
|
* Deep comparison of two panel layouts
|
|
391
391
|
*/
|
|
392
|
-
static areLayoutsEqual(e,
|
|
393
|
-
return JSON.stringify(e) === JSON.stringify(
|
|
392
|
+
static areLayoutsEqual(e, o) {
|
|
393
|
+
return JSON.stringify(e) === JSON.stringify(o);
|
|
394
394
|
}
|
|
395
395
|
/**
|
|
396
396
|
* Generate a unique ID from a workspace name
|
|
@@ -610,303 +610,303 @@ class R {
|
|
|
610
610
|
Object.keys(e).length;
|
|
611
611
|
}
|
|
612
612
|
}
|
|
613
|
-
|
|
614
|
-
function
|
|
615
|
-
const { repositoryKey: e, autoInitialize:
|
|
613
|
+
_(R, "adapter", new oe());
|
|
614
|
+
function De(t = {}) {
|
|
615
|
+
const { repositoryKey: e, autoInitialize: o = !1, defaultWorkspaceId: r } = t, [a, n] = W(
|
|
616
616
|
{}
|
|
617
|
-
), [
|
|
617
|
+
), [s, l] = W(null), [d, p] = W(null), [g, c] = W(!0), [m, y] = W(null), u = w(async () => {
|
|
618
618
|
try {
|
|
619
|
-
|
|
620
|
-
const
|
|
621
|
-
if (n(
|
|
622
|
-
let
|
|
623
|
-
if (!
|
|
624
|
-
const
|
|
625
|
-
|
|
626
|
-
workspaceId:
|
|
627
|
-
sizes:
|
|
619
|
+
c(!0), y(null);
|
|
620
|
+
const v = await R.getWorkspaceLayouts();
|
|
621
|
+
if (n(v), e) {
|
|
622
|
+
let x = await R.getRepositoryState(e);
|
|
623
|
+
if (!x && o) {
|
|
624
|
+
const h = r || "project-management", S = await R.getWorkspaceLayout(h);
|
|
625
|
+
S && (x = {
|
|
626
|
+
workspaceId: h,
|
|
627
|
+
sizes: S.defaultSizes || {
|
|
628
628
|
left: 20,
|
|
629
629
|
middle: 45,
|
|
630
630
|
right: 35
|
|
631
631
|
},
|
|
632
|
-
collapsed:
|
|
632
|
+
collapsed: S.defaultCollapsed || {
|
|
633
633
|
left: !1,
|
|
634
634
|
right: !1
|
|
635
635
|
}
|
|
636
636
|
}, await R.setRepositoryState(
|
|
637
637
|
e,
|
|
638
|
-
|
|
638
|
+
x
|
|
639
639
|
));
|
|
640
640
|
}
|
|
641
|
-
if (l(
|
|
642
|
-
const
|
|
643
|
-
|
|
641
|
+
if (l(x), x != null && x.workspaceId) {
|
|
642
|
+
const h = await R.getWorkspaceLayout(
|
|
643
|
+
x.workspaceId
|
|
644
644
|
);
|
|
645
|
-
h
|
|
645
|
+
p(h);
|
|
646
646
|
} else
|
|
647
|
-
|
|
647
|
+
p(null);
|
|
648
648
|
}
|
|
649
|
-
} catch (
|
|
650
|
-
|
|
649
|
+
} catch (v) {
|
|
650
|
+
y(v), console.error("Failed to load workspace data:", v);
|
|
651
651
|
} finally {
|
|
652
|
-
|
|
652
|
+
c(!1);
|
|
653
653
|
}
|
|
654
|
-
}, [e,
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
}, [
|
|
658
|
-
const i =
|
|
659
|
-
async (
|
|
654
|
+
}, [e, o, r]);
|
|
655
|
+
I(() => {
|
|
656
|
+
u();
|
|
657
|
+
}, [u]);
|
|
658
|
+
const i = w(
|
|
659
|
+
async (v) => await R.getWorkspaceLayout(v),
|
|
660
660
|
[]
|
|
661
|
-
),
|
|
662
|
-
async (
|
|
663
|
-
const
|
|
664
|
-
return await
|
|
661
|
+
), k = w(
|
|
662
|
+
async (v) => {
|
|
663
|
+
const x = await R.createWorkspaceLayout(v);
|
|
664
|
+
return await u(), x;
|
|
665
665
|
},
|
|
666
|
-
[
|
|
667
|
-
),
|
|
668
|
-
async (
|
|
669
|
-
const
|
|
670
|
-
return await
|
|
666
|
+
[u]
|
|
667
|
+
), P = w(
|
|
668
|
+
async (v, x) => {
|
|
669
|
+
const h = await R.updateWorkspaceLayout(v, x);
|
|
670
|
+
return await u(), h;
|
|
671
671
|
},
|
|
672
|
-
[
|
|
673
|
-
),
|
|
674
|
-
async (
|
|
675
|
-
const
|
|
676
|
-
return
|
|
672
|
+
[u]
|
|
673
|
+
), L = w(
|
|
674
|
+
async (v) => {
|
|
675
|
+
const x = await R.deleteWorkspaceLayout(v);
|
|
676
|
+
return x && await u(), x;
|
|
677
677
|
},
|
|
678
|
-
[
|
|
679
|
-
),
|
|
680
|
-
async (
|
|
678
|
+
[u]
|
|
679
|
+
), z = w(
|
|
680
|
+
async (v) => {
|
|
681
681
|
if (!e) {
|
|
682
682
|
console.error("Cannot apply workspace without repositoryKey");
|
|
683
683
|
return;
|
|
684
684
|
}
|
|
685
|
-
const
|
|
686
|
-
if (!
|
|
687
|
-
console.error(`Workspace ${
|
|
685
|
+
const x = await R.getWorkspaceLayout(v);
|
|
686
|
+
if (!x) {
|
|
687
|
+
console.error(`Workspace ${v} not found`);
|
|
688
688
|
return;
|
|
689
689
|
}
|
|
690
|
-
const
|
|
691
|
-
workspaceId:
|
|
692
|
-
sizes:
|
|
693
|
-
collapsed:
|
|
690
|
+
const h = {
|
|
691
|
+
workspaceId: v,
|
|
692
|
+
sizes: x.defaultSizes || { left: 20, middle: 45, right: 35 },
|
|
693
|
+
collapsed: x.defaultCollapsed || {
|
|
694
694
|
left: !1,
|
|
695
695
|
right: !1
|
|
696
696
|
}
|
|
697
697
|
};
|
|
698
|
-
await R.setRepositoryState(e,
|
|
698
|
+
await R.setRepositoryState(e, h), await u();
|
|
699
699
|
},
|
|
700
|
-
[e,
|
|
701
|
-
),
|
|
702
|
-
async (
|
|
700
|
+
[e, u]
|
|
701
|
+
), D = w(
|
|
702
|
+
async (v) => {
|
|
703
703
|
if (!e) {
|
|
704
704
|
console.error("Cannot update sizes without repositoryKey");
|
|
705
705
|
return;
|
|
706
706
|
}
|
|
707
|
-
await R.updateRepositorySizes(e,
|
|
707
|
+
await R.updateRepositorySizes(e, v), await u();
|
|
708
708
|
},
|
|
709
|
-
[e,
|
|
710
|
-
),
|
|
711
|
-
async (
|
|
709
|
+
[e, u]
|
|
710
|
+
), F = w(
|
|
711
|
+
async (v) => {
|
|
712
712
|
if (!e) {
|
|
713
713
|
console.error("Cannot update collapsed without repositoryKey");
|
|
714
714
|
return;
|
|
715
715
|
}
|
|
716
716
|
await R.updateRepositoryCollapsed(
|
|
717
717
|
e,
|
|
718
|
-
|
|
719
|
-
), await
|
|
718
|
+
v
|
|
719
|
+
), await u();
|
|
720
720
|
},
|
|
721
|
-
[e,
|
|
722
|
-
),
|
|
723
|
-
if (!e || !(
|
|
721
|
+
[e, u]
|
|
722
|
+
), b = w(async () => {
|
|
723
|
+
if (!e || !(s != null && s.workspaceId)) {
|
|
724
724
|
console.error("Cannot reset without repositoryKey and active workspace");
|
|
725
725
|
return;
|
|
726
726
|
}
|
|
727
727
|
await R.resetRepositoryToWorkspaceDefaults(
|
|
728
728
|
e,
|
|
729
|
-
|
|
730
|
-
), await
|
|
731
|
-
}, [e,
|
|
732
|
-
await
|
|
733
|
-
}, [
|
|
729
|
+
s.workspaceId
|
|
730
|
+
), await u();
|
|
731
|
+
}, [e, s == null ? void 0 : s.workspaceId, u]), C = w(async () => {
|
|
732
|
+
await u();
|
|
733
|
+
}, [u]);
|
|
734
734
|
return {
|
|
735
|
-
workspaces:
|
|
736
|
-
repositoryState:
|
|
737
|
-
activeWorkspace:
|
|
738
|
-
loading:
|
|
739
|
-
error:
|
|
735
|
+
workspaces: a,
|
|
736
|
+
repositoryState: s,
|
|
737
|
+
activeWorkspace: d,
|
|
738
|
+
loading: g,
|
|
739
|
+
error: m,
|
|
740
740
|
getWorkspace: i,
|
|
741
|
-
createWorkspace:
|
|
742
|
-
updateWorkspace:
|
|
743
|
-
deleteWorkspace:
|
|
744
|
-
applyWorkspace:
|
|
745
|
-
updateSizes:
|
|
746
|
-
updateCollapsed:
|
|
747
|
-
resetToDefaults:
|
|
741
|
+
createWorkspace: k,
|
|
742
|
+
updateWorkspace: P,
|
|
743
|
+
deleteWorkspace: L,
|
|
744
|
+
applyWorkspace: z,
|
|
745
|
+
updateSizes: D,
|
|
746
|
+
updateCollapsed: F,
|
|
747
|
+
resetToDefaults: b,
|
|
748
748
|
refresh: C
|
|
749
749
|
};
|
|
750
750
|
}
|
|
751
|
-
function
|
|
751
|
+
function _e(t = {}) {
|
|
752
752
|
const {
|
|
753
753
|
initialFocus: e = null,
|
|
754
|
-
collapsed:
|
|
755
|
-
panelType:
|
|
756
|
-
onFocusChange:
|
|
754
|
+
collapsed: o = {},
|
|
755
|
+
panelType: r = "three-panel",
|
|
756
|
+
onFocusChange: a,
|
|
757
757
|
events: n,
|
|
758
|
-
getPanelId:
|
|
759
|
-
} =
|
|
758
|
+
getPanelId: s
|
|
759
|
+
} = t, [l, d] = W(
|
|
760
760
|
e
|
|
761
|
-
),
|
|
761
|
+
), p = w(
|
|
762
762
|
(i) => {
|
|
763
|
-
const
|
|
764
|
-
if (
|
|
765
|
-
if (
|
|
766
|
-
const
|
|
767
|
-
|
|
763
|
+
const k = l;
|
|
764
|
+
if (d(i), a == null || a(i), n && s) {
|
|
765
|
+
if (k) {
|
|
766
|
+
const L = s(k);
|
|
767
|
+
L && n.emit({
|
|
768
768
|
type: "panel:blur",
|
|
769
769
|
source: "panel-layouts",
|
|
770
770
|
timestamp: Date.now(),
|
|
771
771
|
payload: {
|
|
772
|
-
panelId:
|
|
773
|
-
panelSlot:
|
|
774
|
-
nextPanelId:
|
|
772
|
+
panelId: L,
|
|
773
|
+
panelSlot: k,
|
|
774
|
+
nextPanelId: s(i)
|
|
775
775
|
}
|
|
776
776
|
});
|
|
777
777
|
}
|
|
778
|
-
const
|
|
779
|
-
|
|
778
|
+
const P = s(i);
|
|
779
|
+
P && n.emit({
|
|
780
780
|
type: "panel:focus",
|
|
781
781
|
source: "panel-layouts",
|
|
782
782
|
timestamp: Date.now(),
|
|
783
783
|
payload: {
|
|
784
|
-
panelId:
|
|
784
|
+
panelId: P,
|
|
785
785
|
panelSlot: i,
|
|
786
786
|
source: "keyboard-shortcut"
|
|
787
787
|
}
|
|
788
788
|
});
|
|
789
789
|
}
|
|
790
790
|
},
|
|
791
|
-
[l,
|
|
792
|
-
),
|
|
791
|
+
[l, a, n, s]
|
|
792
|
+
), g = w(() => {
|
|
793
793
|
const i = l;
|
|
794
|
-
if (
|
|
795
|
-
const
|
|
796
|
-
|
|
794
|
+
if (d(null), a == null || a(null), n && s && i) {
|
|
795
|
+
const k = s(i);
|
|
796
|
+
k && n.emit({
|
|
797
797
|
type: "panel:blur",
|
|
798
798
|
source: "panel-layouts",
|
|
799
799
|
timestamp: Date.now(),
|
|
800
800
|
payload: {
|
|
801
|
-
panelId:
|
|
801
|
+
panelId: k,
|
|
802
802
|
panelSlot: i
|
|
803
803
|
}
|
|
804
804
|
});
|
|
805
805
|
}
|
|
806
|
-
}, [l,
|
|
806
|
+
}, [l, a, n, s]), c = w(() => {
|
|
807
807
|
const i = [];
|
|
808
|
-
return
|
|
809
|
-
}, [
|
|
810
|
-
const i =
|
|
808
|
+
return o.left || i.push("left"), i.push("middle"), r === "three-panel" && !o.right && i.push("right"), i;
|
|
809
|
+
}, [o, r]), m = w(() => {
|
|
810
|
+
const i = c();
|
|
811
811
|
if (i.length === 0) return;
|
|
812
812
|
if (l === null) {
|
|
813
|
-
|
|
813
|
+
p(i[0]);
|
|
814
814
|
return;
|
|
815
815
|
}
|
|
816
|
-
const
|
|
817
|
-
if (
|
|
818
|
-
|
|
816
|
+
const k = i.indexOf(l);
|
|
817
|
+
if (k === -1) {
|
|
818
|
+
p(i[0]);
|
|
819
819
|
return;
|
|
820
820
|
}
|
|
821
|
-
const
|
|
822
|
-
|
|
823
|
-
}, [l,
|
|
824
|
-
const i =
|
|
821
|
+
const P = (k + 1) % i.length;
|
|
822
|
+
p(i[P]);
|
|
823
|
+
}, [l, c, p]), y = w(() => {
|
|
824
|
+
const i = c();
|
|
825
825
|
if (i.length === 0) return;
|
|
826
826
|
if (l === null) {
|
|
827
|
-
|
|
827
|
+
p(i[i.length - 1]);
|
|
828
828
|
return;
|
|
829
829
|
}
|
|
830
|
-
const
|
|
831
|
-
if (
|
|
832
|
-
|
|
830
|
+
const k = i.indexOf(l);
|
|
831
|
+
if (k === -1) {
|
|
832
|
+
p(i[i.length - 1]);
|
|
833
833
|
return;
|
|
834
834
|
}
|
|
835
|
-
const
|
|
836
|
-
|
|
837
|
-
}, [l,
|
|
835
|
+
const P = k === 0 ? i.length - 1 : k - 1;
|
|
836
|
+
p(i[P]);
|
|
837
|
+
}, [l, c, p]), u = w(
|
|
838
838
|
(i) => l === i,
|
|
839
839
|
[l]
|
|
840
840
|
);
|
|
841
841
|
return {
|
|
842
842
|
focusedPanel: l,
|
|
843
|
-
setFocus:
|
|
844
|
-
clearFocus:
|
|
845
|
-
focusNext:
|
|
846
|
-
focusPrevious:
|
|
847
|
-
isFocused:
|
|
843
|
+
setFocus: p,
|
|
844
|
+
clearFocus: g,
|
|
845
|
+
focusNext: m,
|
|
846
|
+
focusPrevious: y,
|
|
847
|
+
isFocused: u
|
|
848
848
|
};
|
|
849
849
|
}
|
|
850
|
-
function
|
|
850
|
+
function $e(t) {
|
|
851
851
|
const {
|
|
852
852
|
enabled: e = !0,
|
|
853
|
-
focusedPanel:
|
|
854
|
-
collapsed:
|
|
855
|
-
panelType:
|
|
853
|
+
focusedPanel: o,
|
|
854
|
+
collapsed: r,
|
|
855
|
+
panelType: a,
|
|
856
856
|
setFocus: n,
|
|
857
|
-
onExpand:
|
|
857
|
+
onExpand: s,
|
|
858
858
|
onCollapse: l
|
|
859
|
-
} =
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
}, [
|
|
863
|
-
|
|
864
|
-
}, [
|
|
865
|
-
|
|
866
|
-
}, [
|
|
867
|
-
const
|
|
868
|
-
(
|
|
869
|
-
if (!
|
|
859
|
+
} = t, d = A(o), p = A(r), g = A(a);
|
|
860
|
+
I(() => {
|
|
861
|
+
d.current = o;
|
|
862
|
+
}, [o]), I(() => {
|
|
863
|
+
p.current = r;
|
|
864
|
+
}, [r]), I(() => {
|
|
865
|
+
g.current = a;
|
|
866
|
+
}, [a]);
|
|
867
|
+
const c = w(
|
|
868
|
+
(m) => {
|
|
869
|
+
if (!m.altKey || m.ctrlKey || m.metaKey || m.shiftKey)
|
|
870
870
|
return;
|
|
871
|
-
const
|
|
872
|
-
|
|
871
|
+
const y = m.code, u = d.current, i = p.current, k = g.current;
|
|
872
|
+
y === "Digit1" || y === "Numpad1" ? (m.preventDefault(), i.left ? s("left") : u !== "left" ? n("left") : (l("left"), n("middle"))) : y === "Digit2" || y === "Numpad2" ? (m.preventDefault(), n("middle")) : (y === "Digit3" || y === "Numpad3") && k === "three-panel" && (m.preventDefault(), i.right ? s("right") : u !== "right" ? n("right") : (l("right"), n("middle")));
|
|
873
873
|
},
|
|
874
|
-
[n,
|
|
874
|
+
[n, s, l]
|
|
875
875
|
);
|
|
876
|
-
|
|
876
|
+
I(() => {
|
|
877
877
|
if (e)
|
|
878
|
-
return window.addEventListener("keydown",
|
|
879
|
-
window.removeEventListener("keydown",
|
|
878
|
+
return window.addEventListener("keydown", c), () => {
|
|
879
|
+
window.removeEventListener("keydown", c);
|
|
880
880
|
};
|
|
881
|
-
}, [e,
|
|
881
|
+
}, [e, c]);
|
|
882
882
|
}
|
|
883
|
-
function
|
|
884
|
-
|
|
885
|
-
const
|
|
883
|
+
function Fe(t, e, o, r) {
|
|
884
|
+
I(() => {
|
|
885
|
+
const a = e.on(
|
|
886
886
|
"panel:focus",
|
|
887
|
-
(
|
|
888
|
-
|
|
887
|
+
(s) => {
|
|
888
|
+
s.payload.panelId === t && o();
|
|
889
889
|
}
|
|
890
890
|
);
|
|
891
891
|
let n;
|
|
892
|
-
return
|
|
892
|
+
return r && (n = e.on(
|
|
893
893
|
"panel:blur",
|
|
894
|
-
(
|
|
895
|
-
|
|
894
|
+
(s) => {
|
|
895
|
+
s.payload.panelId === t && r();
|
|
896
896
|
}
|
|
897
897
|
)), () => {
|
|
898
|
-
|
|
898
|
+
a(), n == null || n();
|
|
899
899
|
};
|
|
900
|
-
}, [
|
|
900
|
+
}, [t, e, o, r]);
|
|
901
901
|
}
|
|
902
|
-
const
|
|
903
|
-
isFocused:
|
|
902
|
+
const je = ({
|
|
903
|
+
isFocused: t,
|
|
904
904
|
className: e = "",
|
|
905
|
-
style:
|
|
905
|
+
style: o = {}
|
|
906
906
|
}) => {
|
|
907
|
-
if (!
|
|
907
|
+
if (!t)
|
|
908
908
|
return null;
|
|
909
|
-
const
|
|
909
|
+
const r = {
|
|
910
910
|
position: "absolute",
|
|
911
911
|
top: 0,
|
|
912
912
|
left: 0,
|
|
@@ -918,39 +918,39 @@ const fe = ({
|
|
|
918
918
|
boxShadow: "0 0 0 1px var(--panel-focus-shadow-color, rgba(0, 102, 204, 0.2))",
|
|
919
919
|
zIndex: 1e3,
|
|
920
920
|
transition: "opacity 0.15s ease-in-out",
|
|
921
|
-
...
|
|
921
|
+
...o
|
|
922
922
|
};
|
|
923
|
-
return /* @__PURE__ */
|
|
923
|
+
return /* @__PURE__ */ f(
|
|
924
924
|
"div",
|
|
925
925
|
{
|
|
926
926
|
className: `panel-focus-indicator ${e}`,
|
|
927
|
-
style:
|
|
927
|
+
style: r,
|
|
928
928
|
role: "presentation",
|
|
929
929
|
"aria-hidden": "true"
|
|
930
930
|
}
|
|
931
931
|
);
|
|
932
|
-
},
|
|
933
|
-
value:
|
|
932
|
+
}, re = ({
|
|
933
|
+
value: t,
|
|
934
934
|
onChange: e,
|
|
935
|
-
placeholder:
|
|
936
|
-
onClose:
|
|
937
|
-
onEnter:
|
|
935
|
+
placeholder: o = "> Type a command...",
|
|
936
|
+
onClose: r,
|
|
937
|
+
onEnter: a
|
|
938
938
|
}) => {
|
|
939
|
-
const { theme: n } =
|
|
940
|
-
|
|
941
|
-
|
|
939
|
+
const { theme: n } = $(), s = A(null);
|
|
940
|
+
I(() => {
|
|
941
|
+
s.current && s.current.focus();
|
|
942
942
|
}, []);
|
|
943
|
-
const l = (
|
|
944
|
-
switch (
|
|
943
|
+
const l = (d) => {
|
|
944
|
+
switch (d.key) {
|
|
945
945
|
case "Enter":
|
|
946
|
-
|
|
946
|
+
d.preventDefault(), a == null || a();
|
|
947
947
|
break;
|
|
948
948
|
case "Escape":
|
|
949
|
-
|
|
949
|
+
d.preventDefault(), r();
|
|
950
950
|
break;
|
|
951
951
|
}
|
|
952
952
|
};
|
|
953
|
-
return /* @__PURE__ */
|
|
953
|
+
return /* @__PURE__ */ f(
|
|
954
954
|
"div",
|
|
955
955
|
{
|
|
956
956
|
style: {
|
|
@@ -958,15 +958,15 @@ const fe = ({
|
|
|
958
958
|
borderBottom: `1px solid ${n.colors.border}`,
|
|
959
959
|
backgroundColor: n.colors.background
|
|
960
960
|
},
|
|
961
|
-
children: /* @__PURE__ */
|
|
961
|
+
children: /* @__PURE__ */ f(
|
|
962
962
|
"input",
|
|
963
963
|
{
|
|
964
|
-
ref:
|
|
964
|
+
ref: s,
|
|
965
965
|
type: "text",
|
|
966
|
-
value:
|
|
967
|
-
onChange: (
|
|
966
|
+
value: t,
|
|
967
|
+
onChange: (d) => e(d.target.value),
|
|
968
968
|
onKeyDown: l,
|
|
969
|
-
placeholder:
|
|
969
|
+
placeholder: o,
|
|
970
970
|
style: {
|
|
971
971
|
width: "100%",
|
|
972
972
|
padding: "16px 20px",
|
|
@@ -986,33 +986,33 @@ const fe = ({
|
|
|
986
986
|
)
|
|
987
987
|
}
|
|
988
988
|
);
|
|
989
|
-
},
|
|
990
|
-
({ command:
|
|
991
|
-
const { theme: n } =
|
|
992
|
-
return /* @__PURE__ */
|
|
989
|
+
}, B = Z(
|
|
990
|
+
({ command: t, isSelected: e, onClick: o, onMouseEnter: r }, a) => {
|
|
991
|
+
const { theme: n } = $(), { label: s, description: l, icon: d, shortcut: p } = t, [g, c] = U.useState(!1);
|
|
992
|
+
return /* @__PURE__ */ T(
|
|
993
993
|
"div",
|
|
994
994
|
{
|
|
995
|
-
ref:
|
|
996
|
-
onClick:
|
|
995
|
+
ref: a,
|
|
996
|
+
onClick: o,
|
|
997
997
|
onMouseEnter: () => {
|
|
998
|
-
|
|
998
|
+
c(!0), r();
|
|
999
999
|
},
|
|
1000
|
-
onMouseLeave: () =>
|
|
1000
|
+
onMouseLeave: () => c(!1),
|
|
1001
1001
|
style: {
|
|
1002
1002
|
padding: "10px 16px",
|
|
1003
1003
|
cursor: "pointer",
|
|
1004
|
-
backgroundColor: e ||
|
|
1005
|
-
borderLeft: e ||
|
|
1004
|
+
backgroundColor: e || g ? n.colors.backgroundSecondary : "transparent",
|
|
1005
|
+
borderLeft: e || g ? `3px solid ${n.colors.primary}` : "3px solid transparent",
|
|
1006
1006
|
transition: "all 0.1s ease",
|
|
1007
1007
|
display: "flex",
|
|
1008
1008
|
alignItems: "center",
|
|
1009
1009
|
gap: "12px"
|
|
1010
1010
|
},
|
|
1011
|
-
onMouseDown: (
|
|
1012
|
-
|
|
1011
|
+
onMouseDown: (m) => {
|
|
1012
|
+
m.preventDefault();
|
|
1013
1013
|
},
|
|
1014
1014
|
children: [
|
|
1015
|
-
|
|
1015
|
+
d && /* @__PURE__ */ f(
|
|
1016
1016
|
"div",
|
|
1017
1017
|
{
|
|
1018
1018
|
style: {
|
|
@@ -1023,25 +1023,25 @@ const fe = ({
|
|
|
1023
1023
|
alignItems: "center",
|
|
1024
1024
|
justifyContent: "center",
|
|
1025
1025
|
fontSize: "16px",
|
|
1026
|
-
color: e ||
|
|
1026
|
+
color: e || g ? n.colors.primary : n.colors.textSecondary
|
|
1027
1027
|
},
|
|
1028
|
-
children:
|
|
1028
|
+
children: d
|
|
1029
1029
|
}
|
|
1030
1030
|
),
|
|
1031
|
-
/* @__PURE__ */
|
|
1032
|
-
/* @__PURE__ */
|
|
1031
|
+
/* @__PURE__ */ T("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
1032
|
+
/* @__PURE__ */ f(
|
|
1033
1033
|
"div",
|
|
1034
1034
|
{
|
|
1035
1035
|
style: {
|
|
1036
1036
|
fontSize: "14px",
|
|
1037
1037
|
fontWeight: 500,
|
|
1038
|
-
color: e ||
|
|
1038
|
+
color: e || g ? n.colors.text : n.colors.textSecondary,
|
|
1039
1039
|
marginBottom: l ? "2px" : 0
|
|
1040
1040
|
},
|
|
1041
|
-
children:
|
|
1041
|
+
children: s
|
|
1042
1042
|
}
|
|
1043
1043
|
),
|
|
1044
|
-
l && /* @__PURE__ */
|
|
1044
|
+
l && /* @__PURE__ */ f(
|
|
1045
1045
|
"div",
|
|
1046
1046
|
{
|
|
1047
1047
|
style: {
|
|
@@ -1055,7 +1055,7 @@ const fe = ({
|
|
|
1055
1055
|
}
|
|
1056
1056
|
)
|
|
1057
1057
|
] }),
|
|
1058
|
-
|
|
1058
|
+
p && /* @__PURE__ */ f(
|
|
1059
1059
|
"div",
|
|
1060
1060
|
{
|
|
1061
1061
|
style: {
|
|
@@ -1068,7 +1068,7 @@ const fe = ({
|
|
|
1068
1068
|
borderRadius: "4px",
|
|
1069
1069
|
fontFamily: n.fonts.monospace
|
|
1070
1070
|
},
|
|
1071
|
-
children:
|
|
1071
|
+
children: p
|
|
1072
1072
|
}
|
|
1073
1073
|
)
|
|
1074
1074
|
]
|
|
@@ -1076,37 +1076,37 @@ const fe = ({
|
|
|
1076
1076
|
);
|
|
1077
1077
|
}
|
|
1078
1078
|
);
|
|
1079
|
-
|
|
1080
|
-
const
|
|
1081
|
-
commands:
|
|
1079
|
+
B.displayName = "CommandItem";
|
|
1080
|
+
const ae = ({
|
|
1081
|
+
commands: t,
|
|
1082
1082
|
selectedIndex: e,
|
|
1083
|
-
onSelect:
|
|
1084
|
-
onHover:
|
|
1085
|
-
maxResults:
|
|
1083
|
+
onSelect: o,
|
|
1084
|
+
onHover: r,
|
|
1085
|
+
maxResults: a = 10
|
|
1086
1086
|
}) => {
|
|
1087
|
-
const { theme: n } =
|
|
1088
|
-
|
|
1089
|
-
if (l.current &&
|
|
1090
|
-
const
|
|
1091
|
-
|
|
1087
|
+
const { theme: n } = $(), s = A(null), l = A(null), d = t.slice(0, a);
|
|
1088
|
+
I(() => {
|
|
1089
|
+
if (l.current && s.current) {
|
|
1090
|
+
const c = l.current, m = s.current, y = c.offsetTop, u = y + c.offsetHeight, i = m.scrollTop, k = m.clientHeight;
|
|
1091
|
+
y < i ? m.scrollTop = y - 8 : u > i + k && (m.scrollTop = u - k + 8);
|
|
1092
1092
|
}
|
|
1093
1093
|
}, [e]);
|
|
1094
|
-
const
|
|
1095
|
-
const
|
|
1096
|
-
return u
|
|
1097
|
-
}, {}),
|
|
1098
|
-
return /* @__PURE__ */
|
|
1094
|
+
const p = d.reduce((c, m, y) => {
|
|
1095
|
+
const u = m.category || "Other";
|
|
1096
|
+
return c[u] || (c[u] = []), c[u].push({ command: m, index: y }), c;
|
|
1097
|
+
}, {}), g = Object.keys(p).sort((c, m) => c === "Other" ? 1 : m === "Other" ? -1 : c.localeCompare(m));
|
|
1098
|
+
return /* @__PURE__ */ T(
|
|
1099
1099
|
"div",
|
|
1100
1100
|
{
|
|
1101
|
-
ref:
|
|
1101
|
+
ref: s,
|
|
1102
1102
|
style: {
|
|
1103
1103
|
overflowY: "auto",
|
|
1104
1104
|
maxHeight: "400px",
|
|
1105
1105
|
padding: "8px 0"
|
|
1106
1106
|
},
|
|
1107
1107
|
children: [
|
|
1108
|
-
|
|
1109
|
-
|
|
1108
|
+
g.map((c) => /* @__PURE__ */ T("div", { children: [
|
|
1109
|
+
g.length > 1 && /* @__PURE__ */ f(
|
|
1110
1110
|
"div",
|
|
1111
1111
|
{
|
|
1112
1112
|
style: {
|
|
@@ -1117,22 +1117,22 @@ const te = ({
|
|
|
1117
1117
|
color: n.colors.textMuted,
|
|
1118
1118
|
letterSpacing: "0.5px"
|
|
1119
1119
|
},
|
|
1120
|
-
children:
|
|
1120
|
+
children: c
|
|
1121
1121
|
}
|
|
1122
1122
|
),
|
|
1123
|
-
|
|
1124
|
-
|
|
1123
|
+
p[c].map(({ command: m, index: y }) => /* @__PURE__ */ f(
|
|
1124
|
+
B,
|
|
1125
1125
|
{
|
|
1126
|
-
command:
|
|
1127
|
-
isSelected:
|
|
1128
|
-
onClick: () =>
|
|
1129
|
-
onMouseEnter: () =>
|
|
1130
|
-
ref:
|
|
1126
|
+
command: m,
|
|
1127
|
+
isSelected: y === e,
|
|
1128
|
+
onClick: () => o(m),
|
|
1129
|
+
onMouseEnter: () => r(y),
|
|
1130
|
+
ref: y === e ? l : void 0
|
|
1131
1131
|
},
|
|
1132
|
-
|
|
1132
|
+
m.id
|
|
1133
1133
|
))
|
|
1134
|
-
] },
|
|
1135
|
-
|
|
1134
|
+
] }, c)),
|
|
1135
|
+
t.length > a && /* @__PURE__ */ T(
|
|
1136
1136
|
"div",
|
|
1137
1137
|
{
|
|
1138
1138
|
style: {
|
|
@@ -1144,9 +1144,9 @@ const te = ({
|
|
|
1144
1144
|
},
|
|
1145
1145
|
children: [
|
|
1146
1146
|
"Showing ",
|
|
1147
|
-
|
|
1147
|
+
a,
|
|
1148
1148
|
" of ",
|
|
1149
|
-
|
|
1149
|
+
t.length,
|
|
1150
1150
|
" results"
|
|
1151
1151
|
]
|
|
1152
1152
|
}
|
|
@@ -1154,35 +1154,35 @@ const te = ({
|
|
|
1154
1154
|
]
|
|
1155
1155
|
}
|
|
1156
1156
|
);
|
|
1157
|
-
},
|
|
1158
|
-
commandPalette:
|
|
1157
|
+
}, Oe = ({
|
|
1158
|
+
commandPalette: t,
|
|
1159
1159
|
config: e
|
|
1160
1160
|
}) => {
|
|
1161
|
-
const { theme:
|
|
1162
|
-
isOpen:
|
|
1161
|
+
const { theme: o } = $(), r = A(null), {
|
|
1162
|
+
isOpen: a,
|
|
1163
1163
|
close: n,
|
|
1164
|
-
query:
|
|
1164
|
+
query: s,
|
|
1165
1165
|
setQuery: l,
|
|
1166
|
-
filteredCommands:
|
|
1167
|
-
selectedIndex:
|
|
1168
|
-
setSelectedIndex:
|
|
1169
|
-
executeSelected:
|
|
1170
|
-
} =
|
|
1171
|
-
if (
|
|
1172
|
-
if (!
|
|
1173
|
-
const
|
|
1174
|
-
|
|
1166
|
+
filteredCommands: d,
|
|
1167
|
+
selectedIndex: p,
|
|
1168
|
+
setSelectedIndex: g,
|
|
1169
|
+
executeSelected: c
|
|
1170
|
+
} = t;
|
|
1171
|
+
if (I(() => {
|
|
1172
|
+
if (!a) return;
|
|
1173
|
+
const u = (k) => {
|
|
1174
|
+
r.current && !r.current.contains(k.target) && n();
|
|
1175
1175
|
}, i = setTimeout(() => {
|
|
1176
|
-
document.addEventListener("mousedown",
|
|
1176
|
+
document.addEventListener("mousedown", u);
|
|
1177
1177
|
}, 100);
|
|
1178
1178
|
return () => {
|
|
1179
|
-
clearTimeout(i), document.removeEventListener("mousedown",
|
|
1179
|
+
clearTimeout(i), document.removeEventListener("mousedown", u);
|
|
1180
1180
|
};
|
|
1181
|
-
}, [
|
|
1181
|
+
}, [a, n]), !a)
|
|
1182
1182
|
return null;
|
|
1183
|
-
const
|
|
1184
|
-
return /* @__PURE__ */
|
|
1185
|
-
/* @__PURE__ */
|
|
1183
|
+
const m = (e == null ? void 0 : e.maxHeight) || "50vh", y = (e == null ? void 0 : e.placeholder) || "> Type a command...";
|
|
1184
|
+
return /* @__PURE__ */ T(ee, { children: [
|
|
1185
|
+
/* @__PURE__ */ f(
|
|
1186
1186
|
"div",
|
|
1187
1187
|
{
|
|
1188
1188
|
style: {
|
|
@@ -1195,86 +1195,86 @@ const te = ({
|
|
|
1195
1195
|
onClick: n
|
|
1196
1196
|
}
|
|
1197
1197
|
),
|
|
1198
|
-
/* @__PURE__ */
|
|
1198
|
+
/* @__PURE__ */ T(
|
|
1199
1199
|
"div",
|
|
1200
1200
|
{
|
|
1201
|
-
ref:
|
|
1201
|
+
ref: r,
|
|
1202
1202
|
className: e == null ? void 0 : e.className,
|
|
1203
1203
|
style: {
|
|
1204
1204
|
position: "fixed",
|
|
1205
1205
|
bottom: 0,
|
|
1206
1206
|
left: 0,
|
|
1207
1207
|
right: 0,
|
|
1208
|
-
maxHeight:
|
|
1209
|
-
backgroundColor:
|
|
1210
|
-
borderTop: `1px solid ${
|
|
1211
|
-
boxShadow:
|
|
1208
|
+
maxHeight: m,
|
|
1209
|
+
backgroundColor: o.colors.surface,
|
|
1210
|
+
borderTop: `1px solid ${o.colors.border}`,
|
|
1211
|
+
boxShadow: o.shadows[2],
|
|
1212
1212
|
zIndex: 1e3,
|
|
1213
1213
|
display: "flex",
|
|
1214
1214
|
flexDirection: "column-reverse",
|
|
1215
1215
|
...e == null ? void 0 : e.style
|
|
1216
1216
|
},
|
|
1217
1217
|
children: [
|
|
1218
|
-
/* @__PURE__ */
|
|
1219
|
-
/* @__PURE__ */
|
|
1220
|
-
|
|
1218
|
+
/* @__PURE__ */ T("div", { children: [
|
|
1219
|
+
/* @__PURE__ */ f(
|
|
1220
|
+
re,
|
|
1221
1221
|
{
|
|
1222
|
-
value:
|
|
1222
|
+
value: s,
|
|
1223
1223
|
onChange: l,
|
|
1224
|
-
placeholder:
|
|
1224
|
+
placeholder: y,
|
|
1225
1225
|
onClose: n,
|
|
1226
|
-
onEnter:
|
|
1226
|
+
onEnter: c
|
|
1227
1227
|
}
|
|
1228
1228
|
),
|
|
1229
|
-
/* @__PURE__ */
|
|
1229
|
+
/* @__PURE__ */ T(
|
|
1230
1230
|
"div",
|
|
1231
1231
|
{
|
|
1232
1232
|
style: {
|
|
1233
1233
|
padding: "8px 16px",
|
|
1234
|
-
borderTop: `1px solid ${
|
|
1234
|
+
borderTop: `1px solid ${o.colors.border}`,
|
|
1235
1235
|
display: "flex",
|
|
1236
1236
|
gap: "16px",
|
|
1237
1237
|
fontSize: "12px",
|
|
1238
|
-
color:
|
|
1239
|
-
backgroundColor:
|
|
1238
|
+
color: o.colors.textMuted,
|
|
1239
|
+
backgroundColor: o.colors.background
|
|
1240
1240
|
},
|
|
1241
1241
|
children: [
|
|
1242
|
-
/* @__PURE__ */
|
|
1243
|
-
/* @__PURE__ */
|
|
1242
|
+
/* @__PURE__ */ T("span", { children: [
|
|
1243
|
+
/* @__PURE__ */ f("kbd", { style: { padding: "2px 6px", backgroundColor: o.colors.backgroundSecondary, borderRadius: "3px", border: `1px solid ${o.colors.border}` }, children: "Enter" }),
|
|
1244
1244
|
" Execute"
|
|
1245
1245
|
] }),
|
|
1246
|
-
/* @__PURE__ */
|
|
1247
|
-
/* @__PURE__ */
|
|
1246
|
+
/* @__PURE__ */ T("span", { children: [
|
|
1247
|
+
/* @__PURE__ */ f("kbd", { style: { padding: "2px 6px", backgroundColor: o.colors.backgroundSecondary, borderRadius: "3px", border: `1px solid ${o.colors.border}` }, children: "Esc" }),
|
|
1248
1248
|
" Close"
|
|
1249
1249
|
] })
|
|
1250
1250
|
]
|
|
1251
1251
|
}
|
|
1252
1252
|
)
|
|
1253
1253
|
] }),
|
|
1254
|
-
|
|
1255
|
-
|
|
1254
|
+
d.length > 0 && /* @__PURE__ */ f(
|
|
1255
|
+
ae,
|
|
1256
1256
|
{
|
|
1257
|
-
commands:
|
|
1258
|
-
selectedIndex:
|
|
1259
|
-
onSelect: (
|
|
1260
|
-
|
|
1257
|
+
commands: d,
|
|
1258
|
+
selectedIndex: p,
|
|
1259
|
+
onSelect: (u) => {
|
|
1260
|
+
t.executeCommand(u.id);
|
|
1261
1261
|
},
|
|
1262
|
-
onHover:
|
|
1262
|
+
onHover: g,
|
|
1263
1263
|
maxResults: e == null ? void 0 : e.maxResults
|
|
1264
1264
|
}
|
|
1265
1265
|
),
|
|
1266
|
-
|
|
1266
|
+
s && d.length === 0 && /* @__PURE__ */ T(
|
|
1267
1267
|
"div",
|
|
1268
1268
|
{
|
|
1269
1269
|
style: {
|
|
1270
1270
|
padding: "24px 16px",
|
|
1271
|
-
color:
|
|
1271
|
+
color: o.colors.textMuted,
|
|
1272
1272
|
textAlign: "center",
|
|
1273
1273
|
fontSize: "14px"
|
|
1274
1274
|
},
|
|
1275
1275
|
children: [
|
|
1276
1276
|
'No commands found for "',
|
|
1277
|
-
|
|
1277
|
+
s,
|
|
1278
1278
|
'"'
|
|
1279
1279
|
]
|
|
1280
1280
|
}
|
|
@@ -1284,18 +1284,18 @@ const te = ({
|
|
|
1284
1284
|
)
|
|
1285
1285
|
] });
|
|
1286
1286
|
};
|
|
1287
|
-
class
|
|
1287
|
+
class K {
|
|
1288
1288
|
constructor() {
|
|
1289
|
-
|
|
1290
|
-
|
|
1289
|
+
_(this, "commands", /* @__PURE__ */ new Map());
|
|
1290
|
+
_(this, "listeners", /* @__PURE__ */ new Set());
|
|
1291
1291
|
}
|
|
1292
1292
|
/**
|
|
1293
1293
|
* Register one or more commands
|
|
1294
1294
|
* @param commands - Array of commands to register
|
|
1295
1295
|
*/
|
|
1296
1296
|
registerCommands(e) {
|
|
1297
|
-
e.forEach((
|
|
1298
|
-
this.commands.set(
|
|
1297
|
+
e.forEach((o) => {
|
|
1298
|
+
this.commands.set(o.id, o);
|
|
1299
1299
|
}), this.notifyListeners();
|
|
1300
1300
|
}
|
|
1301
1301
|
/**
|
|
@@ -1310,8 +1310,8 @@ class B {
|
|
|
1310
1310
|
* @param commandIds - Array of command IDs to unregister
|
|
1311
1311
|
*/
|
|
1312
1312
|
unregisterCommands(e) {
|
|
1313
|
-
e.forEach((
|
|
1314
|
-
this.commands.delete(
|
|
1313
|
+
e.forEach((o) => {
|
|
1314
|
+
this.commands.delete(o);
|
|
1315
1315
|
}), this.notifyListeners();
|
|
1316
1316
|
}
|
|
1317
1317
|
/**
|
|
@@ -1327,8 +1327,8 @@ class B {
|
|
|
1327
1327
|
* @returns Array of available commands
|
|
1328
1328
|
*/
|
|
1329
1329
|
getCommands(e) {
|
|
1330
|
-
const
|
|
1331
|
-
return e ?
|
|
1330
|
+
const o = Array.from(this.commands.values());
|
|
1331
|
+
return e ? o.filter((r) => r.isAvailable ? r.isAvailable(e) : !0) : o;
|
|
1332
1332
|
}
|
|
1333
1333
|
/**
|
|
1334
1334
|
* Get a command by ID
|
|
@@ -1343,35 +1343,35 @@ class B {
|
|
|
1343
1343
|
* @param commandId - Command ID to execute
|
|
1344
1344
|
* @param context - Command context
|
|
1345
1345
|
*/
|
|
1346
|
-
async executeCommand(e,
|
|
1347
|
-
var
|
|
1348
|
-
const
|
|
1349
|
-
if (!
|
|
1346
|
+
async executeCommand(e, o) {
|
|
1347
|
+
var a, n;
|
|
1348
|
+
const r = this.commands.get(e);
|
|
1349
|
+
if (!r) {
|
|
1350
1350
|
console.warn(`Command not found: ${e}`);
|
|
1351
1351
|
return;
|
|
1352
1352
|
}
|
|
1353
|
-
if (
|
|
1353
|
+
if (r.isAvailable && !r.isAvailable(o)) {
|
|
1354
1354
|
console.warn(`Command not available: ${e}`);
|
|
1355
1355
|
return;
|
|
1356
1356
|
}
|
|
1357
1357
|
try {
|
|
1358
|
-
await
|
|
1358
|
+
await r.execute(o), (a = o.events) == null || a.emit({
|
|
1359
1359
|
type: "command:executed",
|
|
1360
1360
|
source: "command-palette",
|
|
1361
1361
|
timestamp: Date.now(),
|
|
1362
1362
|
payload: {
|
|
1363
|
-
commandId:
|
|
1364
|
-
commandLabel:
|
|
1363
|
+
commandId: r.id,
|
|
1364
|
+
commandLabel: r.label
|
|
1365
1365
|
}
|
|
1366
1366
|
});
|
|
1367
|
-
} catch (
|
|
1368
|
-
console.error(`Error executing command ${e}:`,
|
|
1367
|
+
} catch (s) {
|
|
1368
|
+
console.error(`Error executing command ${e}:`, s), (n = o.events) == null || n.emit({
|
|
1369
1369
|
type: "command:error",
|
|
1370
1370
|
source: "command-palette",
|
|
1371
1371
|
timestamp: Date.now(),
|
|
1372
1372
|
payload: {
|
|
1373
|
-
commandId:
|
|
1374
|
-
error:
|
|
1373
|
+
commandId: r.id,
|
|
1374
|
+
error: s instanceof Error ? s.message : String(s)
|
|
1375
1375
|
}
|
|
1376
1376
|
});
|
|
1377
1377
|
}
|
|
@@ -1382,18 +1382,18 @@ class B {
|
|
|
1382
1382
|
* @param context - Command context for availability checks
|
|
1383
1383
|
* @returns Filtered and sorted commands
|
|
1384
1384
|
*/
|
|
1385
|
-
searchCommands(e,
|
|
1386
|
-
const
|
|
1385
|
+
searchCommands(e, o) {
|
|
1386
|
+
const r = this.getCommands(o);
|
|
1387
1387
|
if (!e.trim())
|
|
1388
|
-
return this.sortCommands(
|
|
1389
|
-
const
|
|
1390
|
-
return
|
|
1391
|
-
var
|
|
1388
|
+
return this.sortCommands(r);
|
|
1389
|
+
const a = e.toLowerCase();
|
|
1390
|
+
return r.map((s) => {
|
|
1391
|
+
var d, p;
|
|
1392
1392
|
let l = 0;
|
|
1393
|
-
return
|
|
1394
|
-
(
|
|
1395
|
-
) && (l += 150), (
|
|
1396
|
-
}).filter((
|
|
1393
|
+
return s.label.toLowerCase() === a ? l += 1e3 : s.label.toLowerCase().startsWith(a) ? l += 500 : s.label.toLowerCase().includes(a) && (l += 250), (d = s.description) != null && d.toLowerCase().includes(a) && (l += 100), s.keywords && s.keywords.some(
|
|
1394
|
+
(c) => c.toLowerCase().includes(a)
|
|
1395
|
+
) && (l += 150), (p = s.category) != null && p.toLowerCase().includes(a) && (l += 50), l > 0 && s.priority && (l += s.priority), { command: s, score: l };
|
|
1396
|
+
}).filter((s) => s.score > 0).sort((s, l) => l.score - s.score).map((s) => s.command);
|
|
1397
1397
|
}
|
|
1398
1398
|
/**
|
|
1399
1399
|
* Sort commands by priority and label
|
|
@@ -1401,12 +1401,12 @@ class B {
|
|
|
1401
1401
|
* @returns Sorted commands
|
|
1402
1402
|
*/
|
|
1403
1403
|
sortCommands(e) {
|
|
1404
|
-
return e.sort((
|
|
1405
|
-
const
|
|
1406
|
-
if (
|
|
1407
|
-
return
|
|
1408
|
-
const n =
|
|
1409
|
-
return l !== 0 ? l :
|
|
1404
|
+
return e.sort((o, r) => {
|
|
1405
|
+
const a = (r.priority || 0) - (o.priority || 0);
|
|
1406
|
+
if (a !== 0)
|
|
1407
|
+
return a;
|
|
1408
|
+
const n = o.category || "", s = r.category || "", l = n.localeCompare(s);
|
|
1409
|
+
return l !== 0 ? l : o.label.localeCompare(r.label);
|
|
1410
1410
|
});
|
|
1411
1411
|
}
|
|
1412
1412
|
/**
|
|
@@ -1438,136 +1438,136 @@ class B {
|
|
|
1438
1438
|
this.listeners.forEach((e) => e());
|
|
1439
1439
|
}
|
|
1440
1440
|
}
|
|
1441
|
-
let
|
|
1442
|
-
function
|
|
1443
|
-
return
|
|
1441
|
+
let j = null;
|
|
1442
|
+
function Me() {
|
|
1443
|
+
return j || (j = new K()), j;
|
|
1444
1444
|
}
|
|
1445
|
-
function
|
|
1446
|
-
|
|
1445
|
+
function Ne() {
|
|
1446
|
+
j = null;
|
|
1447
1447
|
}
|
|
1448
|
-
function
|
|
1449
|
-
context:
|
|
1448
|
+
function qe({
|
|
1449
|
+
context: t,
|
|
1450
1450
|
commands: e = [],
|
|
1451
|
-
keyboard:
|
|
1452
|
-
config:
|
|
1453
|
-
registry:
|
|
1451
|
+
keyboard: o = { key: " ", altKey: !0 },
|
|
1452
|
+
config: r = {},
|
|
1453
|
+
registry: a
|
|
1454
1454
|
}) {
|
|
1455
|
-
const [n,
|
|
1456
|
-
() =>
|
|
1457
|
-
[
|
|
1458
|
-
),
|
|
1455
|
+
const [n, s] = W(!1), [l, d] = W(""), [p, g] = W(0), [c, m] = W([]), y = M(
|
|
1456
|
+
() => a || new K(),
|
|
1457
|
+
[a]
|
|
1458
|
+
), u = M(
|
|
1459
1459
|
() => ({
|
|
1460
|
-
...
|
|
1461
|
-
closeCommandPalette: () =>
|
|
1460
|
+
...t,
|
|
1461
|
+
closeCommandPalette: () => s(!1)
|
|
1462
1462
|
}),
|
|
1463
|
-
[
|
|
1463
|
+
[t]
|
|
1464
1464
|
);
|
|
1465
|
-
|
|
1466
|
-
let
|
|
1467
|
-
const
|
|
1468
|
-
if (
|
|
1469
|
-
const
|
|
1470
|
-
|
|
1465
|
+
I(() => {
|
|
1466
|
+
let h = !0;
|
|
1467
|
+
const S = y.subscribe(() => {
|
|
1468
|
+
if (h) {
|
|
1469
|
+
const E = y.getCommands(u);
|
|
1470
|
+
m(E);
|
|
1471
1471
|
}
|
|
1472
1472
|
});
|
|
1473
1473
|
if (e.length > 0)
|
|
1474
|
-
|
|
1474
|
+
y.registerCommands(e);
|
|
1475
1475
|
else {
|
|
1476
|
-
const
|
|
1477
|
-
|
|
1476
|
+
const E = y.getCommands(u);
|
|
1477
|
+
m(E);
|
|
1478
1478
|
}
|
|
1479
1479
|
return () => {
|
|
1480
|
-
|
|
1480
|
+
h = !1, S();
|
|
1481
1481
|
};
|
|
1482
|
-
}, [
|
|
1483
|
-
const i =
|
|
1484
|
-
|
|
1485
|
-
|
|
1482
|
+
}, [y]);
|
|
1483
|
+
const i = M(() => (r.fuzzySearch === !1, y.searchCommands(l, u)), [l, y, u, r.fuzzySearch]);
|
|
1484
|
+
I(() => {
|
|
1485
|
+
g(0);
|
|
1486
1486
|
}, [i]);
|
|
1487
|
-
const
|
|
1488
|
-
var
|
|
1489
|
-
|
|
1487
|
+
const k = w(() => {
|
|
1488
|
+
var h;
|
|
1489
|
+
s(!0), d(""), g(0), (h = t.events) == null || h.emit({
|
|
1490
1490
|
type: "command-palette:opened",
|
|
1491
1491
|
source: "command-palette",
|
|
1492
1492
|
timestamp: Date.now(),
|
|
1493
1493
|
payload: {}
|
|
1494
1494
|
});
|
|
1495
|
-
}, [
|
|
1496
|
-
var
|
|
1497
|
-
|
|
1495
|
+
}, [t.events]), P = w(() => {
|
|
1496
|
+
var h;
|
|
1497
|
+
s(!1), d(""), g(0), (h = t.events) == null || h.emit({
|
|
1498
1498
|
type: "command-palette:closed",
|
|
1499
1499
|
source: "command-palette",
|
|
1500
1500
|
timestamp: Date.now(),
|
|
1501
1501
|
payload: {}
|
|
1502
1502
|
});
|
|
1503
|
-
}, [
|
|
1504
|
-
n ?
|
|
1505
|
-
}, [n,
|
|
1506
|
-
async (
|
|
1507
|
-
await
|
|
1503
|
+
}, [t.events]), L = w(() => {
|
|
1504
|
+
n ? P() : k();
|
|
1505
|
+
}, [n, k, P]), z = w(
|
|
1506
|
+
async (h) => {
|
|
1507
|
+
await y.executeCommand(h, u), P();
|
|
1508
1508
|
},
|
|
1509
|
-
[
|
|
1510
|
-
),
|
|
1511
|
-
|
|
1512
|
-
const
|
|
1513
|
-
return
|
|
1509
|
+
[y, u, P]
|
|
1510
|
+
), D = w(() => {
|
|
1511
|
+
g((h) => {
|
|
1512
|
+
const S = r.maxResults || i.length, E = Math.min(i.length, S) - 1;
|
|
1513
|
+
return h < E ? h + 1 : 0;
|
|
1514
1514
|
});
|
|
1515
|
-
}, [i.length,
|
|
1516
|
-
|
|
1517
|
-
const
|
|
1518
|
-
return
|
|
1515
|
+
}, [i.length, r.maxResults]), F = w(() => {
|
|
1516
|
+
g((h) => {
|
|
1517
|
+
const S = r.maxResults || i.length, E = Math.min(i.length, S) - 1;
|
|
1518
|
+
return h > 0 ? h - 1 : E;
|
|
1519
1519
|
});
|
|
1520
|
-
}, [i.length,
|
|
1521
|
-
const
|
|
1522
|
-
|
|
1523
|
-
}, [i,
|
|
1524
|
-
(
|
|
1525
|
-
|
|
1520
|
+
}, [i.length, r.maxResults]), b = w(async () => {
|
|
1521
|
+
const h = i[0];
|
|
1522
|
+
h && await z(h.id);
|
|
1523
|
+
}, [i, z]), C = w(
|
|
1524
|
+
(h) => {
|
|
1525
|
+
y.registerCommands(h);
|
|
1526
1526
|
},
|
|
1527
|
-
[
|
|
1528
|
-
),
|
|
1529
|
-
(
|
|
1530
|
-
|
|
1527
|
+
[y]
|
|
1528
|
+
), v = w(
|
|
1529
|
+
(h) => {
|
|
1530
|
+
y.unregisterCommands(h);
|
|
1531
1531
|
},
|
|
1532
|
-
[
|
|
1533
|
-
),
|
|
1534
|
-
(
|
|
1532
|
+
[y]
|
|
1533
|
+
), x = w(
|
|
1534
|
+
(h) => {
|
|
1535
1535
|
const {
|
|
1536
|
-
key:
|
|
1537
|
-
altKey:
|
|
1536
|
+
key: S = " ",
|
|
1537
|
+
altKey: E = !0,
|
|
1538
1538
|
ctrlKey: J = !1,
|
|
1539
|
-
metaKey:
|
|
1540
|
-
shiftKey:
|
|
1541
|
-
} =
|
|
1542
|
-
if ((
|
|
1543
|
-
const
|
|
1544
|
-
if (
|
|
1539
|
+
metaKey: H = !1,
|
|
1540
|
+
shiftKey: X = !1
|
|
1541
|
+
} = o, G = h.altKey === E && h.ctrlKey === J && h.metaKey === H && h.shiftKey === X;
|
|
1542
|
+
if ((S === " " ? h.code === "Space" : h.key === S) && G) {
|
|
1543
|
+
const O = h.target;
|
|
1544
|
+
if (O.tagName === "INPUT" || O.tagName === "TEXTAREA" || O.isContentEditable)
|
|
1545
1545
|
return;
|
|
1546
|
-
|
|
1546
|
+
h.preventDefault(), L();
|
|
1547
1547
|
}
|
|
1548
1548
|
},
|
|
1549
|
-
[
|
|
1549
|
+
[o, L]
|
|
1550
1550
|
);
|
|
1551
|
-
return
|
|
1551
|
+
return I(() => (window.addEventListener("keydown", x), () => window.removeEventListener("keydown", x)), [x]), {
|
|
1552
1552
|
isOpen: n,
|
|
1553
|
-
open:
|
|
1554
|
-
close:
|
|
1555
|
-
toggle:
|
|
1553
|
+
open: k,
|
|
1554
|
+
close: P,
|
|
1555
|
+
toggle: L,
|
|
1556
1556
|
query: l,
|
|
1557
|
-
setQuery:
|
|
1557
|
+
setQuery: d,
|
|
1558
1558
|
filteredCommands: i,
|
|
1559
|
-
executeCommand:
|
|
1560
|
-
selectedIndex:
|
|
1561
|
-
setSelectedIndex:
|
|
1562
|
-
selectNext:
|
|
1563
|
-
selectPrevious:
|
|
1564
|
-
executeSelected:
|
|
1565
|
-
commands:
|
|
1559
|
+
executeCommand: z,
|
|
1560
|
+
selectedIndex: p,
|
|
1561
|
+
setSelectedIndex: g,
|
|
1562
|
+
selectNext: D,
|
|
1563
|
+
selectPrevious: F,
|
|
1564
|
+
executeSelected: b,
|
|
1565
|
+
commands: c,
|
|
1566
1566
|
registerCommands: C,
|
|
1567
|
-
unregisterCommands:
|
|
1567
|
+
unregisterCommands: v
|
|
1568
1568
|
};
|
|
1569
1569
|
}
|
|
1570
|
-
const
|
|
1570
|
+
const se = [
|
|
1571
1571
|
{
|
|
1572
1572
|
id: "panel.focus.left",
|
|
1573
1573
|
label: "Focus Left Panel",
|
|
@@ -1577,10 +1577,10 @@ const ae = [
|
|
|
1577
1577
|
shortcut: "Alt+1",
|
|
1578
1578
|
priority: 100,
|
|
1579
1579
|
keywords: ["left", "sidebar", "focus", "switch"],
|
|
1580
|
-
execute: (
|
|
1581
|
-
|
|
1580
|
+
execute: (t) => {
|
|
1581
|
+
t.setFocus("left");
|
|
1582
1582
|
},
|
|
1583
|
-
isAvailable: (
|
|
1583
|
+
isAvailable: (t) => t.focusedPanel !== "left"
|
|
1584
1584
|
},
|
|
1585
1585
|
{
|
|
1586
1586
|
id: "panel.focus.middle",
|
|
@@ -1591,10 +1591,10 @@ const ae = [
|
|
|
1591
1591
|
shortcut: "Alt+2",
|
|
1592
1592
|
priority: 100,
|
|
1593
1593
|
keywords: ["middle", "center", "main", "focus", "switch"],
|
|
1594
|
-
execute: (
|
|
1595
|
-
|
|
1594
|
+
execute: (t) => {
|
|
1595
|
+
t.setFocus("middle");
|
|
1596
1596
|
},
|
|
1597
|
-
isAvailable: (
|
|
1597
|
+
isAvailable: (t) => t.focusedPanel !== "middle"
|
|
1598
1598
|
},
|
|
1599
1599
|
{
|
|
1600
1600
|
id: "panel.focus.right",
|
|
@@ -1605,10 +1605,10 @@ const ae = [
|
|
|
1605
1605
|
shortcut: "Alt+3",
|
|
1606
1606
|
priority: 100,
|
|
1607
1607
|
keywords: ["right", "sidebar", "focus", "switch"],
|
|
1608
|
-
execute: (
|
|
1609
|
-
|
|
1608
|
+
execute: (t) => {
|
|
1609
|
+
t.setFocus("right");
|
|
1610
1610
|
},
|
|
1611
|
-
isAvailable: (
|
|
1611
|
+
isAvailable: (t) => t.focusedPanel !== "right"
|
|
1612
1612
|
},
|
|
1613
1613
|
{
|
|
1614
1614
|
id: "panel.toggle.left",
|
|
@@ -1618,9 +1618,9 @@ const ae = [
|
|
|
1618
1618
|
category: "Panel Control",
|
|
1619
1619
|
keywords: ["toggle", "left", "collapse", "expand", "hide", "show"],
|
|
1620
1620
|
priority: 80,
|
|
1621
|
-
execute: (
|
|
1621
|
+
execute: (t) => {
|
|
1622
1622
|
var e;
|
|
1623
|
-
(e =
|
|
1623
|
+
(e = t.events) == null || e.emit({
|
|
1624
1624
|
type: "panel:toggle",
|
|
1625
1625
|
source: "command-palette",
|
|
1626
1626
|
timestamp: Date.now(),
|
|
@@ -1636,9 +1636,9 @@ const ae = [
|
|
|
1636
1636
|
category: "Panel Control",
|
|
1637
1637
|
keywords: ["toggle", "right", "collapse", "expand", "hide", "show"],
|
|
1638
1638
|
priority: 80,
|
|
1639
|
-
execute: (
|
|
1639
|
+
execute: (t) => {
|
|
1640
1640
|
var e;
|
|
1641
|
-
(e =
|
|
1641
|
+
(e = t.events) == null || e.emit({
|
|
1642
1642
|
type: "panel:toggle",
|
|
1643
1643
|
source: "command-palette",
|
|
1644
1644
|
timestamp: Date.now(),
|
|
@@ -1654,9 +1654,9 @@ const ae = [
|
|
|
1654
1654
|
category: "Panel Control",
|
|
1655
1655
|
keywords: ["collapse", "hide", "all", "maximize", "focus mode"],
|
|
1656
1656
|
priority: 70,
|
|
1657
|
-
execute: (
|
|
1657
|
+
execute: (t) => {
|
|
1658
1658
|
var e;
|
|
1659
|
-
(e =
|
|
1659
|
+
(e = t.events) == null || e.emit({
|
|
1660
1660
|
type: "panel:collapse-all",
|
|
1661
1661
|
source: "command-palette",
|
|
1662
1662
|
timestamp: Date.now(),
|
|
@@ -1672,9 +1672,9 @@ const ae = [
|
|
|
1672
1672
|
category: "Panel Control",
|
|
1673
1673
|
keywords: ["expand", "show", "all", "restore", "default"],
|
|
1674
1674
|
priority: 70,
|
|
1675
|
-
execute: (
|
|
1675
|
+
execute: (t) => {
|
|
1676
1676
|
var e;
|
|
1677
|
-
(e =
|
|
1677
|
+
(e = t.events) == null || e.emit({
|
|
1678
1678
|
type: "panel:expand-all",
|
|
1679
1679
|
source: "command-palette",
|
|
1680
1680
|
timestamp: Date.now(),
|
|
@@ -1690,17 +1690,17 @@ const ae = [
|
|
|
1690
1690
|
category: "Panel Control",
|
|
1691
1691
|
keywords: ["refresh", "reload", "update", "sync"],
|
|
1692
1692
|
priority: 60,
|
|
1693
|
-
execute: (
|
|
1694
|
-
var
|
|
1695
|
-
const e =
|
|
1696
|
-
e && ((
|
|
1693
|
+
execute: (t) => {
|
|
1694
|
+
var o;
|
|
1695
|
+
const e = t.focusedPanel;
|
|
1696
|
+
e && ((o = t.events) == null || o.emit({
|
|
1697
1697
|
type: "panel:refresh",
|
|
1698
1698
|
source: "command-palette",
|
|
1699
1699
|
timestamp: Date.now(),
|
|
1700
1700
|
payload: { panelId: e }
|
|
1701
1701
|
}));
|
|
1702
1702
|
},
|
|
1703
|
-
isAvailable: (
|
|
1703
|
+
isAvailable: (t) => t.focusedPanel !== null
|
|
1704
1704
|
},
|
|
1705
1705
|
{
|
|
1706
1706
|
id: "panel.reset.layout",
|
|
@@ -1710,9 +1710,9 @@ const ae = [
|
|
|
1710
1710
|
category: "Panel Control",
|
|
1711
1711
|
keywords: ["reset", "layout", "default", "restore"],
|
|
1712
1712
|
priority: 50,
|
|
1713
|
-
execute: (
|
|
1713
|
+
execute: (t) => {
|
|
1714
1714
|
var e;
|
|
1715
|
-
(e =
|
|
1715
|
+
(e = t.events) == null || e.emit({
|
|
1716
1716
|
type: "panel:reset-layout",
|
|
1717
1717
|
source: "command-palette",
|
|
1718
1718
|
timestamp: Date.now(),
|
|
@@ -1721,32 +1721,686 @@ const ae = [
|
|
|
1721
1721
|
}
|
|
1722
1722
|
}
|
|
1723
1723
|
];
|
|
1724
|
-
function
|
|
1725
|
-
return
|
|
1724
|
+
function Be() {
|
|
1725
|
+
return se;
|
|
1726
|
+
}
|
|
1727
|
+
const ne = {
|
|
1728
|
+
name: "toggle_panel",
|
|
1729
|
+
description: "Collapse or expand a side panel to give more space to the main content area.",
|
|
1730
|
+
inputs: {
|
|
1731
|
+
type: "object",
|
|
1732
|
+
properties: {
|
|
1733
|
+
panel: {
|
|
1734
|
+
type: "string",
|
|
1735
|
+
enum: ["left", "right"],
|
|
1736
|
+
description: 'Which panel to toggle: "left" or "right"'
|
|
1737
|
+
}
|
|
1738
|
+
},
|
|
1739
|
+
required: ["panel"]
|
|
1740
|
+
},
|
|
1741
|
+
outputs: {
|
|
1742
|
+
type: "object",
|
|
1743
|
+
properties: {
|
|
1744
|
+
success: { type: "boolean" },
|
|
1745
|
+
panel: { type: "string" },
|
|
1746
|
+
action: { type: "string" }
|
|
1747
|
+
}
|
|
1748
|
+
},
|
|
1749
|
+
tags: ["panel", "layout", "toggle", "collapse", "expand", "sidebar"],
|
|
1750
|
+
tool_call_template: {
|
|
1751
|
+
call_template_type: "panel_event",
|
|
1752
|
+
event_type: "panel:toggle"
|
|
1753
|
+
}
|
|
1754
|
+
}, le = {
|
|
1755
|
+
name: "collapse_all_panels",
|
|
1756
|
+
description: "Collapse both left and right panels to maximize the main content area. Useful for focus mode.",
|
|
1757
|
+
inputs: {
|
|
1758
|
+
type: "object",
|
|
1759
|
+
properties: {},
|
|
1760
|
+
required: []
|
|
1761
|
+
},
|
|
1762
|
+
outputs: {
|
|
1763
|
+
type: "object",
|
|
1764
|
+
properties: {
|
|
1765
|
+
success: { type: "boolean" },
|
|
1766
|
+
action: { type: "string" }
|
|
1767
|
+
}
|
|
1768
|
+
},
|
|
1769
|
+
tags: ["panel", "layout", "collapse", "focus", "maximize"],
|
|
1770
|
+
tool_call_template: {
|
|
1771
|
+
call_template_type: "panel_event",
|
|
1772
|
+
event_type: "panel:collapse-all"
|
|
1773
|
+
}
|
|
1774
|
+
}, ie = {
|
|
1775
|
+
name: "expand_all_panels",
|
|
1776
|
+
description: "Expand both left and right panels to show all content. Restores the default layout.",
|
|
1777
|
+
inputs: {
|
|
1778
|
+
type: "object",
|
|
1779
|
+
properties: {},
|
|
1780
|
+
required: []
|
|
1781
|
+
},
|
|
1782
|
+
outputs: {
|
|
1783
|
+
type: "object",
|
|
1784
|
+
properties: {
|
|
1785
|
+
success: { type: "boolean" },
|
|
1786
|
+
action: { type: "string" }
|
|
1787
|
+
}
|
|
1788
|
+
},
|
|
1789
|
+
tags: ["panel", "layout", "expand", "restore", "show"],
|
|
1790
|
+
tool_call_template: {
|
|
1791
|
+
call_template_type: "panel_event",
|
|
1792
|
+
event_type: "panel:expand-all"
|
|
1793
|
+
}
|
|
1794
|
+
}, ce = {
|
|
1795
|
+
name: "switch_panel",
|
|
1796
|
+
description: "Change which content is displayed in a panel slot (left, middle, or right).",
|
|
1797
|
+
inputs: {
|
|
1798
|
+
type: "object",
|
|
1799
|
+
properties: {
|
|
1800
|
+
slot: {
|
|
1801
|
+
type: "string",
|
|
1802
|
+
enum: ["left", "middle", "right"],
|
|
1803
|
+
description: 'Which slot to change: "left", "middle", or "right"'
|
|
1804
|
+
},
|
|
1805
|
+
panel: {
|
|
1806
|
+
type: "string",
|
|
1807
|
+
description: "The panel ID to display in the slot"
|
|
1808
|
+
}
|
|
1809
|
+
},
|
|
1810
|
+
required: ["slot", "panel"]
|
|
1811
|
+
},
|
|
1812
|
+
outputs: {
|
|
1813
|
+
type: "object",
|
|
1814
|
+
properties: {
|
|
1815
|
+
success: { type: "boolean" },
|
|
1816
|
+
slot: { type: "string" },
|
|
1817
|
+
panel: { type: "string" }
|
|
1818
|
+
}
|
|
1819
|
+
},
|
|
1820
|
+
tags: ["panel", "layout", "switch", "navigation", "view"],
|
|
1821
|
+
tool_call_template: {
|
|
1822
|
+
call_template_type: "panel_event",
|
|
1823
|
+
event_type: "panel:switch"
|
|
1824
|
+
}
|
|
1825
|
+
}, de = {
|
|
1826
|
+
name: "focus_panel",
|
|
1827
|
+
description: "Set focus to a specific panel slot for keyboard navigation.",
|
|
1828
|
+
inputs: {
|
|
1829
|
+
type: "object",
|
|
1830
|
+
properties: {
|
|
1831
|
+
slot: {
|
|
1832
|
+
type: "string",
|
|
1833
|
+
enum: ["left", "middle", "right"],
|
|
1834
|
+
description: 'Which slot to focus: "left", "middle", or "right"'
|
|
1835
|
+
}
|
|
1836
|
+
},
|
|
1837
|
+
required: ["slot"]
|
|
1838
|
+
},
|
|
1839
|
+
outputs: {
|
|
1840
|
+
type: "object",
|
|
1841
|
+
properties: {
|
|
1842
|
+
success: { type: "boolean" },
|
|
1843
|
+
slot: { type: "string" }
|
|
1844
|
+
}
|
|
1845
|
+
},
|
|
1846
|
+
tags: ["panel", "focus", "navigation", "keyboard"],
|
|
1847
|
+
tool_call_template: {
|
|
1848
|
+
call_template_type: "panel_event",
|
|
1849
|
+
event_type: "panel:focus"
|
|
1850
|
+
}
|
|
1851
|
+
}, pe = {
|
|
1852
|
+
name: "reset_layout",
|
|
1853
|
+
description: "Reset panel sizes to the default layout configuration.",
|
|
1854
|
+
inputs: {
|
|
1855
|
+
type: "object",
|
|
1856
|
+
properties: {},
|
|
1857
|
+
required: []
|
|
1858
|
+
},
|
|
1859
|
+
outputs: {
|
|
1860
|
+
type: "object",
|
|
1861
|
+
properties: {
|
|
1862
|
+
success: { type: "boolean" },
|
|
1863
|
+
action: { type: "string" }
|
|
1864
|
+
}
|
|
1865
|
+
},
|
|
1866
|
+
tags: ["panel", "layout", "reset", "default", "restore"],
|
|
1867
|
+
tool_call_template: {
|
|
1868
|
+
call_template_type: "panel_event",
|
|
1869
|
+
event_type: "panel:reset-layout"
|
|
1870
|
+
}
|
|
1871
|
+
}, ue = [
|
|
1872
|
+
ne,
|
|
1873
|
+
le,
|
|
1874
|
+
ie,
|
|
1875
|
+
ce,
|
|
1876
|
+
de,
|
|
1877
|
+
pe
|
|
1878
|
+
], Ke = {
|
|
1879
|
+
id: "panel-layouts",
|
|
1880
|
+
name: "Panel Layouts",
|
|
1881
|
+
description: "Generic panel layout operations",
|
|
1882
|
+
tools: ue
|
|
1883
|
+
};
|
|
1884
|
+
function fe(t, e, o = {}) {
|
|
1885
|
+
const {
|
|
1886
|
+
categoryPrefix: r = "Panel Tools",
|
|
1887
|
+
basePriority: a = 50,
|
|
1888
|
+
includePanelInCategory: n = !0
|
|
1889
|
+
} = o, s = n ? `${r} > ${t.panelId}` : r, l = ye(t.inputs);
|
|
1890
|
+
return {
|
|
1891
|
+
id: `tool.${t.qualifiedName}`,
|
|
1892
|
+
label: me(t.name),
|
|
1893
|
+
description: t.description,
|
|
1894
|
+
category: s,
|
|
1895
|
+
keywords: [...t.tags, t.panelId, "tool"],
|
|
1896
|
+
priority: a,
|
|
1897
|
+
execute: async (d) => {
|
|
1898
|
+
var g;
|
|
1899
|
+
if (l) {
|
|
1900
|
+
console.warn(
|
|
1901
|
+
`Tool "${t.qualifiedName}" requires parameters. Invoke programmatically with: registry.invokeTool('${t.qualifiedName}', { ... })`
|
|
1902
|
+
), (g = d.events) == null || g.emit({
|
|
1903
|
+
type: "tool:requires-parameters",
|
|
1904
|
+
source: "command-palette",
|
|
1905
|
+
timestamp: Date.now(),
|
|
1906
|
+
payload: {
|
|
1907
|
+
toolName: t.qualifiedName,
|
|
1908
|
+
inputs: t.inputs
|
|
1909
|
+
}
|
|
1910
|
+
});
|
|
1911
|
+
return;
|
|
1912
|
+
}
|
|
1913
|
+
const p = await e.invokeTool(
|
|
1914
|
+
t.qualifiedName,
|
|
1915
|
+
{},
|
|
1916
|
+
"command-palette"
|
|
1917
|
+
);
|
|
1918
|
+
p.success || console.error(`Tool invocation failed: ${p.error}`), d.closeCommandPalette();
|
|
1919
|
+
}
|
|
1920
|
+
};
|
|
1921
|
+
}
|
|
1922
|
+
function V(t, e = {}) {
|
|
1923
|
+
return t.getAllTools().map((r) => fe(r, t, e));
|
|
1924
|
+
}
|
|
1925
|
+
function Ve(t, e = {}) {
|
|
1926
|
+
return () => V(t, e);
|
|
1726
1927
|
}
|
|
1928
|
+
function me(t) {
|
|
1929
|
+
return t.split("_").map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join(" ");
|
|
1930
|
+
}
|
|
1931
|
+
function ye(t) {
|
|
1932
|
+
return !(t.type !== "object" || !t.required || t.required.length === 0);
|
|
1933
|
+
}
|
|
1934
|
+
function Je(t, e = {}) {
|
|
1935
|
+
return V(t, e);
|
|
1936
|
+
}
|
|
1937
|
+
function He(t) {
|
|
1938
|
+
const { inputs: e } = t;
|
|
1939
|
+
if (e.type !== "object" || !e.properties)
|
|
1940
|
+
return [];
|
|
1941
|
+
const o = new Set(e.required || []), r = [];
|
|
1942
|
+
for (const [a, n] of Object.entries(e.properties))
|
|
1943
|
+
r.push({
|
|
1944
|
+
name: a,
|
|
1945
|
+
type: n.type || "unknown",
|
|
1946
|
+
description: n.description || "",
|
|
1947
|
+
required: o.has(a),
|
|
1948
|
+
default: n.default,
|
|
1949
|
+
enum: n.enum
|
|
1950
|
+
});
|
|
1951
|
+
return r;
|
|
1952
|
+
}
|
|
1953
|
+
function he(t) {
|
|
1954
|
+
const e = {};
|
|
1955
|
+
if (t.inputs.properties)
|
|
1956
|
+
for (const [o, r] of Object.entries(t.inputs.properties)) {
|
|
1957
|
+
const a = r;
|
|
1958
|
+
e[o] = {
|
|
1959
|
+
type: a.type || "string",
|
|
1960
|
+
description: a.description,
|
|
1961
|
+
...a.enum && { enum: a.enum }
|
|
1962
|
+
};
|
|
1963
|
+
}
|
|
1964
|
+
return {
|
|
1965
|
+
name: t.name,
|
|
1966
|
+
description: t.description,
|
|
1967
|
+
parameters: {
|
|
1968
|
+
type: "object",
|
|
1969
|
+
properties: e,
|
|
1970
|
+
required: t.inputs.required || []
|
|
1971
|
+
}
|
|
1972
|
+
};
|
|
1973
|
+
}
|
|
1974
|
+
function Xe(t) {
|
|
1975
|
+
return {
|
|
1976
|
+
functionDeclarations: t.map(he)
|
|
1977
|
+
};
|
|
1978
|
+
}
|
|
1979
|
+
function ge(t) {
|
|
1980
|
+
return {
|
|
1981
|
+
type: "function",
|
|
1982
|
+
function: {
|
|
1983
|
+
name: t.name,
|
|
1984
|
+
description: t.description,
|
|
1985
|
+
parameters: t.inputs
|
|
1986
|
+
}
|
|
1987
|
+
};
|
|
1988
|
+
}
|
|
1989
|
+
function Ge(t) {
|
|
1990
|
+
return t.map(ge);
|
|
1991
|
+
}
|
|
1992
|
+
function we(t) {
|
|
1993
|
+
return {
|
|
1994
|
+
name: t.name,
|
|
1995
|
+
description: t.description,
|
|
1996
|
+
input_schema: t.inputs
|
|
1997
|
+
};
|
|
1998
|
+
}
|
|
1999
|
+
function Ye(t) {
|
|
2000
|
+
return t.map(we);
|
|
2001
|
+
}
|
|
2002
|
+
function ke(t) {
|
|
2003
|
+
return {
|
|
2004
|
+
name: t.name,
|
|
2005
|
+
description: t.description,
|
|
2006
|
+
parameters: t.inputs
|
|
2007
|
+
};
|
|
2008
|
+
}
|
|
2009
|
+
function Qe(t) {
|
|
2010
|
+
return t.map(ke);
|
|
2011
|
+
}
|
|
2012
|
+
function Ue(t, e = {}) {
|
|
2013
|
+
const {
|
|
2014
|
+
header: o = "You have access to the following tools:",
|
|
2015
|
+
includeParameters: r = !0
|
|
2016
|
+
} = e, a = t.map((n) => {
|
|
2017
|
+
let s = `- ${n.name}: ${n.description}`;
|
|
2018
|
+
if (r && n.inputs.properties) {
|
|
2019
|
+
const l = Object.entries(n.inputs.properties).map(([d, p]) => {
|
|
2020
|
+
var m;
|
|
2021
|
+
const g = p, c = (m = n.inputs.required) != null && m.includes(d) ? " (required)" : "";
|
|
2022
|
+
return ` - ${d}: ${g.description || g.type}${c}`;
|
|
2023
|
+
}).join(`
|
|
2024
|
+
`);
|
|
2025
|
+
l && (s += `
|
|
2026
|
+
${l}`);
|
|
2027
|
+
}
|
|
2028
|
+
return s;
|
|
2029
|
+
});
|
|
2030
|
+
return `${o}
|
|
2031
|
+
|
|
2032
|
+
${a.join(`
|
|
2033
|
+
|
|
2034
|
+
`)}`;
|
|
2035
|
+
}
|
|
2036
|
+
const be = ({ size: t = 18 }) => /* @__PURE__ */ T(
|
|
2037
|
+
"svg",
|
|
2038
|
+
{
|
|
2039
|
+
width: t,
|
|
2040
|
+
height: t,
|
|
2041
|
+
viewBox: "0 0 24 24",
|
|
2042
|
+
fill: "none",
|
|
2043
|
+
stroke: "currentColor",
|
|
2044
|
+
strokeWidth: "2",
|
|
2045
|
+
strokeLinecap: "round",
|
|
2046
|
+
strokeLinejoin: "round",
|
|
2047
|
+
children: [
|
|
2048
|
+
/* @__PURE__ */ f("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }),
|
|
2049
|
+
/* @__PURE__ */ f("path", { d: "M9 3v18" })
|
|
2050
|
+
]
|
|
2051
|
+
}
|
|
2052
|
+
), xe = ({ size: t = 18 }) => /* @__PURE__ */ T(
|
|
2053
|
+
"svg",
|
|
2054
|
+
{
|
|
2055
|
+
width: t,
|
|
2056
|
+
height: t,
|
|
2057
|
+
viewBox: "0 0 24 24",
|
|
2058
|
+
fill: "none",
|
|
2059
|
+
stroke: "currentColor",
|
|
2060
|
+
strokeWidth: "2",
|
|
2061
|
+
strokeLinecap: "round",
|
|
2062
|
+
strokeLinejoin: "round",
|
|
2063
|
+
children: [
|
|
2064
|
+
/* @__PURE__ */ f("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }),
|
|
2065
|
+
/* @__PURE__ */ f("path", { d: "M9 3v18" }),
|
|
2066
|
+
/* @__PURE__ */ f("path", { d: "m16 15-3-3 3-3" })
|
|
2067
|
+
]
|
|
2068
|
+
}
|
|
2069
|
+
), ve = ({ size: t = 18 }) => /* @__PURE__ */ T(
|
|
2070
|
+
"svg",
|
|
2071
|
+
{
|
|
2072
|
+
width: t,
|
|
2073
|
+
height: t,
|
|
2074
|
+
viewBox: "0 0 24 24",
|
|
2075
|
+
fill: "none",
|
|
2076
|
+
stroke: "currentColor",
|
|
2077
|
+
strokeWidth: "2",
|
|
2078
|
+
strokeLinecap: "round",
|
|
2079
|
+
strokeLinejoin: "round",
|
|
2080
|
+
children: [
|
|
2081
|
+
/* @__PURE__ */ f("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }),
|
|
2082
|
+
/* @__PURE__ */ f("path", { d: "M15 3v18" })
|
|
2083
|
+
]
|
|
2084
|
+
}
|
|
2085
|
+
), Ce = ({ size: t = 18 }) => /* @__PURE__ */ T(
|
|
2086
|
+
"svg",
|
|
2087
|
+
{
|
|
2088
|
+
width: t,
|
|
2089
|
+
height: t,
|
|
2090
|
+
viewBox: "0 0 24 24",
|
|
2091
|
+
fill: "none",
|
|
2092
|
+
stroke: "currentColor",
|
|
2093
|
+
strokeWidth: "2",
|
|
2094
|
+
strokeLinecap: "round",
|
|
2095
|
+
strokeLinejoin: "round",
|
|
2096
|
+
children: [
|
|
2097
|
+
/* @__PURE__ */ f("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }),
|
|
2098
|
+
/* @__PURE__ */ f("path", { d: "M15 3v18" }),
|
|
2099
|
+
/* @__PURE__ */ f("path", { d: "m8 9 3 3-3 3" })
|
|
2100
|
+
]
|
|
2101
|
+
}
|
|
2102
|
+
), N = ({
|
|
2103
|
+
isCollapsed: t,
|
|
2104
|
+
onToggle: e,
|
|
2105
|
+
side: o = "left",
|
|
2106
|
+
iconSize: r = 18,
|
|
2107
|
+
style: a,
|
|
2108
|
+
shortcutHint: n = "Cmd/Ctrl+B",
|
|
2109
|
+
title: s,
|
|
2110
|
+
className: l
|
|
2111
|
+
}) => {
|
|
2112
|
+
const { theme: d } = $(), p = () => o === "right" ? t ? /* @__PURE__ */ f(ve, { size: r }) : /* @__PURE__ */ f(Ce, { size: r }) : t ? /* @__PURE__ */ f(be, { size: r }) : /* @__PURE__ */ f(xe, { size: r });
|
|
2113
|
+
return /* @__PURE__ */ f(
|
|
2114
|
+
"button",
|
|
2115
|
+
{
|
|
2116
|
+
onClick: e,
|
|
2117
|
+
title: s ?? `${t ? "Show" : "Hide"} ${o === "right" ? "Right Panel" : "Sidebar"}${n ? ` (${n})` : ""}`,
|
|
2118
|
+
className: l,
|
|
2119
|
+
style: {
|
|
2120
|
+
background: "transparent",
|
|
2121
|
+
border: "none",
|
|
2122
|
+
color: t ? d.colors.textSecondary : d.colors.primary,
|
|
2123
|
+
cursor: "pointer",
|
|
2124
|
+
padding: "6px",
|
|
2125
|
+
borderRadius: "4px",
|
|
2126
|
+
display: "flex",
|
|
2127
|
+
alignItems: "center",
|
|
2128
|
+
justifyContent: "center",
|
|
2129
|
+
transition: "all 0.2s",
|
|
2130
|
+
width: "32px",
|
|
2131
|
+
height: "32px",
|
|
2132
|
+
...a
|
|
2133
|
+
},
|
|
2134
|
+
onMouseEnter: (c) => {
|
|
2135
|
+
c.currentTarget.style.backgroundColor = d.colors.backgroundTertiary, c.currentTarget.style.color = d.colors.primary;
|
|
2136
|
+
},
|
|
2137
|
+
onMouseLeave: (c) => {
|
|
2138
|
+
c.currentTarget.style.backgroundColor = "transparent", c.currentTarget.style.color = t ? d.colors.textSecondary : d.colors.primary;
|
|
2139
|
+
},
|
|
2140
|
+
children: p()
|
|
2141
|
+
}
|
|
2142
|
+
);
|
|
2143
|
+
}, Se = ({ size: t = 14 }) => /* @__PURE__ */ T(
|
|
2144
|
+
"svg",
|
|
2145
|
+
{
|
|
2146
|
+
width: t,
|
|
2147
|
+
height: t,
|
|
2148
|
+
viewBox: "0 0 24 24",
|
|
2149
|
+
fill: "none",
|
|
2150
|
+
stroke: "currentColor",
|
|
2151
|
+
strokeWidth: "2",
|
|
2152
|
+
strokeLinecap: "round",
|
|
2153
|
+
strokeLinejoin: "round",
|
|
2154
|
+
children: [
|
|
2155
|
+
/* @__PURE__ */ f("path", { d: "M8 3 4 7l4 4" }),
|
|
2156
|
+
/* @__PURE__ */ f("path", { d: "M4 7h16" }),
|
|
2157
|
+
/* @__PURE__ */ f("path", { d: "m16 21 4-4-4-4" }),
|
|
2158
|
+
/* @__PURE__ */ f("path", { d: "M20 17H4" })
|
|
2159
|
+
]
|
|
2160
|
+
}
|
|
2161
|
+
), Te = ({ size: t = 14 }) => /* @__PURE__ */ T(
|
|
2162
|
+
"svg",
|
|
2163
|
+
{
|
|
2164
|
+
width: t,
|
|
2165
|
+
height: t,
|
|
2166
|
+
viewBox: "0 0 24 24",
|
|
2167
|
+
fill: "none",
|
|
2168
|
+
stroke: "currentColor",
|
|
2169
|
+
strokeWidth: "2",
|
|
2170
|
+
strokeLinecap: "round",
|
|
2171
|
+
strokeLinejoin: "round",
|
|
2172
|
+
children: [
|
|
2173
|
+
/* @__PURE__ */ f("path", { d: "m16 3 4 4-4 4" }),
|
|
2174
|
+
/* @__PURE__ */ f("path", { d: "M20 7H4" }),
|
|
2175
|
+
/* @__PURE__ */ f("path", { d: "m8 21-4-4 4-4" }),
|
|
2176
|
+
/* @__PURE__ */ f("path", { d: "M4 17h16" })
|
|
2177
|
+
]
|
|
2178
|
+
}
|
|
2179
|
+
), q = ({
|
|
2180
|
+
onSwitch: t,
|
|
2181
|
+
variant: e = "left-middle",
|
|
2182
|
+
iconSize: o = 14,
|
|
2183
|
+
style: r,
|
|
2184
|
+
title: a,
|
|
2185
|
+
className: n
|
|
2186
|
+
}) => {
|
|
2187
|
+
const { theme: s } = $(), l = () => e === "left-middle" ? "Switch left and middle panels" : "Switch right and middle panels", d = e === "left-middle" ? Se : Te;
|
|
2188
|
+
return /* @__PURE__ */ f(
|
|
2189
|
+
"button",
|
|
2190
|
+
{
|
|
2191
|
+
onClick: t,
|
|
2192
|
+
title: a ?? l(),
|
|
2193
|
+
className: n,
|
|
2194
|
+
style: {
|
|
2195
|
+
background: "transparent",
|
|
2196
|
+
border: "none",
|
|
2197
|
+
color: s.colors.textSecondary,
|
|
2198
|
+
cursor: "pointer",
|
|
2199
|
+
padding: "6px",
|
|
2200
|
+
borderRadius: "4px",
|
|
2201
|
+
display: "flex",
|
|
2202
|
+
alignItems: "center",
|
|
2203
|
+
justifyContent: "center",
|
|
2204
|
+
transition: "all 0.2s",
|
|
2205
|
+
width: "32px",
|
|
2206
|
+
height: "32px",
|
|
2207
|
+
...r
|
|
2208
|
+
},
|
|
2209
|
+
onMouseEnter: (p) => {
|
|
2210
|
+
p.currentTarget.style.backgroundColor = s.colors.backgroundTertiary, p.currentTarget.style.color = s.colors.text;
|
|
2211
|
+
},
|
|
2212
|
+
onMouseLeave: (p) => {
|
|
2213
|
+
p.currentTarget.style.backgroundColor = "transparent", p.currentTarget.style.color = s.colors.textSecondary;
|
|
2214
|
+
},
|
|
2215
|
+
children: /* @__PURE__ */ f(d, { size: o })
|
|
2216
|
+
}
|
|
2217
|
+
);
|
|
2218
|
+
}, Pe = ({ size: t = 14 }) => /* @__PURE__ */ T(
|
|
2219
|
+
"svg",
|
|
2220
|
+
{
|
|
2221
|
+
width: t,
|
|
2222
|
+
height: t,
|
|
2223
|
+
viewBox: "0 0 24 24",
|
|
2224
|
+
fill: "none",
|
|
2225
|
+
stroke: "currentColor",
|
|
2226
|
+
strokeWidth: "2",
|
|
2227
|
+
strokeLinecap: "round",
|
|
2228
|
+
strokeLinejoin: "round",
|
|
2229
|
+
children: [
|
|
2230
|
+
/* @__PURE__ */ f("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }),
|
|
2231
|
+
/* @__PURE__ */ f("path", { d: "M3 9h18" }),
|
|
2232
|
+
/* @__PURE__ */ f("path", { d: "M9 21V9" })
|
|
2233
|
+
]
|
|
2234
|
+
}
|
|
2235
|
+
), Ie = ({
|
|
2236
|
+
onConfigure: t,
|
|
2237
|
+
iconSize: e = 14,
|
|
2238
|
+
style: o,
|
|
2239
|
+
title: r = "Configure panel layout",
|
|
2240
|
+
className: a
|
|
2241
|
+
}) => {
|
|
2242
|
+
const { theme: n } = $();
|
|
2243
|
+
return /* @__PURE__ */ f(
|
|
2244
|
+
"button",
|
|
2245
|
+
{
|
|
2246
|
+
onClick: t,
|
|
2247
|
+
title: r,
|
|
2248
|
+
className: a,
|
|
2249
|
+
style: {
|
|
2250
|
+
background: "transparent",
|
|
2251
|
+
border: "none",
|
|
2252
|
+
color: n.colors.textSecondary,
|
|
2253
|
+
cursor: "pointer",
|
|
2254
|
+
padding: "6px",
|
|
2255
|
+
borderRadius: "4px",
|
|
2256
|
+
display: "flex",
|
|
2257
|
+
alignItems: "center",
|
|
2258
|
+
justifyContent: "center",
|
|
2259
|
+
transition: "all 0.2s",
|
|
2260
|
+
width: "32px",
|
|
2261
|
+
height: "32px",
|
|
2262
|
+
...o
|
|
2263
|
+
},
|
|
2264
|
+
onMouseEnter: (s) => {
|
|
2265
|
+
s.currentTarget.style.backgroundColor = n.colors.backgroundTertiary, s.currentTarget.style.color = n.colors.text;
|
|
2266
|
+
},
|
|
2267
|
+
onMouseLeave: (s) => {
|
|
2268
|
+
s.currentTarget.style.backgroundColor = "transparent", s.currentTarget.style.color = n.colors.textSecondary;
|
|
2269
|
+
},
|
|
2270
|
+
children: /* @__PURE__ */ f(Pe, { size: e })
|
|
2271
|
+
}
|
|
2272
|
+
);
|
|
2273
|
+
}, Ze = ({
|
|
2274
|
+
leftSidebarCollapsed: t = !1,
|
|
2275
|
+
onToggleLeftSidebar: e,
|
|
2276
|
+
showLeftSidebarControl: o = !1,
|
|
2277
|
+
rightSidebarCollapsed: r = !1,
|
|
2278
|
+
onToggleRightSidebar: a,
|
|
2279
|
+
showRightSidebarControl: n = !1,
|
|
2280
|
+
onSwitchLeftMiddlePanels: s,
|
|
2281
|
+
showSwitchLeftMiddle: l = !1,
|
|
2282
|
+
onSwitchRightMiddlePanels: d,
|
|
2283
|
+
showSwitchRightMiddle: p = !1,
|
|
2284
|
+
onConfigurePanels: g,
|
|
2285
|
+
showConfigureButton: c = !1,
|
|
2286
|
+
gap: m = 4,
|
|
2287
|
+
style: y,
|
|
2288
|
+
className: u,
|
|
2289
|
+
iconSize: i,
|
|
2290
|
+
leftCollapseButtonProps: k,
|
|
2291
|
+
rightCollapseButtonProps: P,
|
|
2292
|
+
leftMiddleSwitchButtonProps: L,
|
|
2293
|
+
rightMiddleSwitchButtonProps: z,
|
|
2294
|
+
configureButtonProps: D
|
|
2295
|
+
}) => o && e || l && s || c && g || p && d || n && a ? /* @__PURE__ */ T(
|
|
2296
|
+
"div",
|
|
2297
|
+
{
|
|
2298
|
+
className: u,
|
|
2299
|
+
style: {
|
|
2300
|
+
display: "flex",
|
|
2301
|
+
alignItems: "center",
|
|
2302
|
+
gap: `${m}px`,
|
|
2303
|
+
...y
|
|
2304
|
+
},
|
|
2305
|
+
children: [
|
|
2306
|
+
o && e && /* @__PURE__ */ f(
|
|
2307
|
+
N,
|
|
2308
|
+
{
|
|
2309
|
+
isCollapsed: t,
|
|
2310
|
+
onToggle: e,
|
|
2311
|
+
side: "left",
|
|
2312
|
+
iconSize: i ?? 18,
|
|
2313
|
+
...k
|
|
2314
|
+
}
|
|
2315
|
+
),
|
|
2316
|
+
l && s && /* @__PURE__ */ f(
|
|
2317
|
+
q,
|
|
2318
|
+
{
|
|
2319
|
+
onSwitch: s,
|
|
2320
|
+
variant: "left-middle",
|
|
2321
|
+
iconSize: i ?? 14,
|
|
2322
|
+
...L
|
|
2323
|
+
}
|
|
2324
|
+
),
|
|
2325
|
+
c && g && /* @__PURE__ */ f(
|
|
2326
|
+
Ie,
|
|
2327
|
+
{
|
|
2328
|
+
onConfigure: g,
|
|
2329
|
+
iconSize: i ?? 14,
|
|
2330
|
+
...D
|
|
2331
|
+
}
|
|
2332
|
+
),
|
|
2333
|
+
p && d && /* @__PURE__ */ f(
|
|
2334
|
+
q,
|
|
2335
|
+
{
|
|
2336
|
+
onSwitch: d,
|
|
2337
|
+
variant: "right-middle",
|
|
2338
|
+
iconSize: i ?? 14,
|
|
2339
|
+
...z
|
|
2340
|
+
}
|
|
2341
|
+
),
|
|
2342
|
+
n && a && /* @__PURE__ */ f(
|
|
2343
|
+
N,
|
|
2344
|
+
{
|
|
2345
|
+
isCollapsed: r,
|
|
2346
|
+
onToggle: a,
|
|
2347
|
+
side: "right",
|
|
2348
|
+
iconSize: i ?? 18,
|
|
2349
|
+
...P
|
|
2350
|
+
}
|
|
2351
|
+
)
|
|
2352
|
+
]
|
|
2353
|
+
}
|
|
2354
|
+
) : null;
|
|
1727
2355
|
export {
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
2356
|
+
re as CommandInput,
|
|
2357
|
+
B as CommandItem,
|
|
2358
|
+
ae as CommandList,
|
|
2359
|
+
Oe as CommandPalette,
|
|
2360
|
+
K as CommandRegistryService,
|
|
2361
|
+
ot as EditableConfigurablePanelLayout,
|
|
2362
|
+
je as FocusIndicator,
|
|
2363
|
+
te as LocalStoragePersistenceAdapter,
|
|
2364
|
+
oe as LocalStorageWorkspaceAdapter,
|
|
2365
|
+
N as PanelCollapseButton,
|
|
2366
|
+
Ie as PanelConfigureButton,
|
|
2367
|
+
Ze as PanelControls,
|
|
2368
|
+
q as PanelSwitchButton,
|
|
2369
|
+
rt as ResponsiveConfigurablePanelLayout,
|
|
1738
2370
|
R as WorkspaceLayoutService,
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
2371
|
+
le as collapseAllPanelsTool,
|
|
2372
|
+
Ve as createToolCommandsProvider,
|
|
2373
|
+
ie as expandAllPanelsTool,
|
|
2374
|
+
de as focusPanelTool,
|
|
2375
|
+
Ue as generateToolsSystemPrompt,
|
|
2376
|
+
Me as getGlobalCommandRegistry,
|
|
2377
|
+
Be as getPanelCommands,
|
|
2378
|
+
He as getToolParameterInfo,
|
|
2379
|
+
ue as layoutTools,
|
|
2380
|
+
Ke as layoutToolsMetadata,
|
|
2381
|
+
at as mapThemeToPanelVars,
|
|
2382
|
+
st as mapThemeToTabVars,
|
|
2383
|
+
se as panelCommands,
|
|
2384
|
+
Ne as resetGlobalCommandRegistry,
|
|
2385
|
+
pe as resetLayoutTool,
|
|
2386
|
+
ce as switchPanelTool,
|
|
2387
|
+
ne as togglePanelTool,
|
|
2388
|
+
ke as toolToAIFunction,
|
|
2389
|
+
we as toolToAnthropicFormat,
|
|
2390
|
+
fe as toolToCommand,
|
|
2391
|
+
he as toolToGeminiFunction,
|
|
2392
|
+
ge as toolToOpenAIFunction,
|
|
2393
|
+
Qe as toolsToAIFunctions,
|
|
2394
|
+
Ye as toolsToAnthropicFormat,
|
|
2395
|
+
V as toolsToCommands,
|
|
2396
|
+
Xe as toolsToGeminiFormat,
|
|
2397
|
+
Ge as toolsToOpenAIFormat,
|
|
2398
|
+
qe as useCommandPalette,
|
|
2399
|
+
_e as usePanelFocus,
|
|
2400
|
+
Fe as usePanelFocusListener,
|
|
2401
|
+
$e as usePanelKeyboardShortcuts,
|
|
2402
|
+
Ee as usePanelPersistence,
|
|
2403
|
+
Je as useToolCommands,
|
|
2404
|
+
De as useWorkspace
|
|
1751
2405
|
};
|
|
1752
2406
|
//# sourceMappingURL=index.esm.js.map
|