@scalar/api-client 2.24.0 → 2.25.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/CHANGELOG.md +22 -0
- package/dist/style.css +1 -1
- package/dist/v2/blocks/request-block/helpers/get-default-headers.js +1 -1
- package/dist/v2/components/sidebar/Sidebar.vue.d.ts +2 -2
- package/dist/v2/components/sidebar/Sidebar.vue.d.ts.map +1 -1
- package/dist/v2/components/sidebar/SidebarMenu.vue.d.ts +2 -2
- package/dist/v2/components/sidebar/SidebarMenu.vue.d.ts.map +1 -1
- package/dist/v2/components/sidebar/SidebarMenu.vue.js +6 -6
- package/dist/v2/features/app/App.vue.d.ts +4 -1
- package/dist/v2/features/app/App.vue.d.ts.map +1 -1
- package/dist/v2/features/app/App.vue.js +60 -54
- package/dist/v2/features/app/app-state.d.ts +41 -9
- package/dist/v2/features/app/app-state.d.ts.map +1 -1
- package/dist/v2/features/app/app-state.js +200 -192
- package/dist/v2/features/app/components/AppSidebar.vue.d.ts +2 -2
- package/dist/v2/features/app/components/AppSidebar.vue.d.ts.map +1 -1
- package/dist/v2/features/app/components/AppSidebar.vue.js +3 -3
- package/dist/v2/features/app/components/WebTopNav.vue.d.ts +3 -3
- package/dist/v2/features/app/components/WebTopNav.vue.d.ts.map +1 -1
- package/dist/v2/features/app/helpers/filter-workspaces.d.ts +49 -0
- package/dist/v2/features/app/helpers/filter-workspaces.d.ts.map +1 -0
- package/dist/v2/features/app/helpers/filter-workspaces.js +5 -0
- package/dist/v2/features/app/helpers/group-workspaces.d.ts +24 -0
- package/dist/v2/features/app/helpers/group-workspaces.d.ts.map +1 -0
- package/dist/v2/features/app/helpers/group-workspaces.js +23 -0
- package/dist/v2/features/operation/Operation.vue.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/package.json +11 -11
|
@@ -1,65 +1,66 @@
|
|
|
1
|
-
import { isDefined as
|
|
2
|
-
import { sortByOrder as
|
|
3
|
-
import { isHttpMethod as
|
|
4
|
-
import { createSidebarState as
|
|
5
|
-
import { createWorkspaceStore as
|
|
6
|
-
import { createWorkspaceEventBus as
|
|
7
|
-
import { generateUniqueValue as
|
|
1
|
+
import { isDefined as O } from "@scalar/helpers/array/is-defined";
|
|
2
|
+
import { sortByOrder as z } from "@scalar/helpers/array/sort-by-order";
|
|
3
|
+
import { isHttpMethod as J } from "@scalar/helpers/http/is-http-method";
|
|
4
|
+
import { createSidebarState as M, generateReverseIndex as G } from "@scalar/sidebar";
|
|
5
|
+
import { createWorkspaceStore as N } from "@scalar/workspace-store/client";
|
|
6
|
+
import { createWorkspaceEventBus as Q } from "@scalar/workspace-store/events";
|
|
7
|
+
import { generateUniqueValue as X } from "@scalar/workspace-store/helpers/generate-unique-value";
|
|
8
8
|
import { getParentEntry as v } from "@scalar/workspace-store/navigation";
|
|
9
|
-
import { createWorkspaceStorePersistence as
|
|
10
|
-
import { persistencePlugin as
|
|
11
|
-
import { extensions as
|
|
12
|
-
import { shallowRef as
|
|
13
|
-
import { getActiveEnvironment as
|
|
14
|
-
import { getTabDetails as
|
|
15
|
-
import { slugify as
|
|
16
|
-
import { workspaceStorage as
|
|
17
|
-
import { initializeAppEventHandlers as
|
|
18
|
-
|
|
9
|
+
import { createWorkspaceStorePersistence as Z } from "@scalar/workspace-store/persistence";
|
|
10
|
+
import { persistencePlugin as ee } from "@scalar/workspace-store/plugins/client";
|
|
11
|
+
import { extensions as ae } from "@scalar/workspace-store/schemas/extensions";
|
|
12
|
+
import { shallowRef as D, computed as i, ref as p, watch as te } from "vue";
|
|
13
|
+
import { getActiveEnvironment as ne } from "../../helpers/get-active-environment.js";
|
|
14
|
+
import { getTabDetails as re } from "../../helpers/get-tab-details.js";
|
|
15
|
+
import { slugify as oe } from "../../helpers/slugify.js";
|
|
16
|
+
import { workspaceStorage as se } from "../../helpers/storage.js";
|
|
17
|
+
import { initializeAppEventHandlers as ce } from "./app-events.js";
|
|
18
|
+
import { filterWorkspacesByTeam as le, canLoadWorkspace as ue } from "./helpers/filter-workspaces.js";
|
|
19
|
+
const ie = 1e3, k = Q({
|
|
19
20
|
debug: !1
|
|
20
|
-
}),
|
|
21
|
-
|
|
22
|
-
e && e.afterEach((
|
|
21
|
+
}), R = p("local"), g = p(void 0), W = p(void 0), b = p(void 0), P = p(void 0), _ = p(void 0), $ = p(void 0), x = p(!1), u = D(null);
|
|
22
|
+
te(u, (e) => {
|
|
23
|
+
e && e.afterEach((a) => Ee(a));
|
|
23
24
|
});
|
|
24
25
|
const d = i(() => u.value?.currentRoute.value ?? null);
|
|
25
|
-
function
|
|
26
|
-
const
|
|
27
|
-
if (typeof
|
|
28
|
-
return e === "method" ?
|
|
26
|
+
function l(e, a) {
|
|
27
|
+
const t = a?.params[e];
|
|
28
|
+
if (typeof t == "string")
|
|
29
|
+
return e === "method" ? t && J(t) ? t : void 0 : decodeURIComponent(t);
|
|
29
30
|
}
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
(e) => e.map(({ teamUid:
|
|
33
|
-
id:
|
|
34
|
-
teamUid:
|
|
35
|
-
namespace:
|
|
31
|
+
const A = D(null), f = p([]), U = i(() => le(f.value, R.value)), o = D(null), C = i(() => o.value?.workspace.documents[b.value ?? ""] || null), pe = i(() => ne(o.value, C.value)), { workspace: y } = await Z(), h = (e, a) => `${e}/${a}`;
|
|
32
|
+
f.value = await y.getAll().then(
|
|
33
|
+
(e) => e.map(({ teamUid: a, namespace: t, slug: n, name: c }) => ({
|
|
34
|
+
id: h(t, n),
|
|
35
|
+
teamUid: a,
|
|
36
|
+
namespace: t,
|
|
36
37
|
slug: n,
|
|
37
|
-
label:
|
|
38
|
+
label: c
|
|
38
39
|
}))
|
|
39
40
|
);
|
|
40
|
-
const
|
|
41
|
+
const me = async ({ namespace: e, slug: a }) => N({
|
|
41
42
|
plugins: [
|
|
42
|
-
await
|
|
43
|
+
await ee({ workspaceId: h(e, a), debounceDelay: ie })
|
|
43
44
|
]
|
|
44
|
-
}),
|
|
45
|
-
const
|
|
46
|
-
if (!
|
|
45
|
+
}), de = async (e, a) => {
|
|
46
|
+
const t = await y.getItem({ namespace: e, slug: a });
|
|
47
|
+
if (!t)
|
|
47
48
|
return {
|
|
48
49
|
success: !1
|
|
49
50
|
};
|
|
50
|
-
const n = await
|
|
51
|
-
return n.loadWorkspace(
|
|
51
|
+
const n = await me({ namespace: e, slug: a });
|
|
52
|
+
return n.loadWorkspace(t.workspace), A.value = { id: h(t.namespace, t.slug), label: t.name }, o.value = n, {
|
|
52
53
|
success: !0,
|
|
53
54
|
workspace: n.workspace
|
|
54
55
|
};
|
|
55
|
-
},
|
|
56
|
+
}, ve = async ({
|
|
56
57
|
name: e,
|
|
57
|
-
teamUid:
|
|
58
|
-
namespace:
|
|
58
|
+
teamUid: a,
|
|
59
|
+
namespace: t,
|
|
59
60
|
slug: n
|
|
60
61
|
}) => {
|
|
61
|
-
const
|
|
62
|
-
await
|
|
62
|
+
const c = N();
|
|
63
|
+
await c.addDocument({
|
|
63
64
|
name: "drafts",
|
|
64
65
|
document: {
|
|
65
66
|
openapi: "3.1.0",
|
|
@@ -76,280 +77,287 @@ const ue = async ({ namespace: e, slug: t }) => O({
|
|
|
76
77
|
"x-scalar-icon": "interface-edit-tool-pencil"
|
|
77
78
|
}
|
|
78
79
|
});
|
|
79
|
-
const
|
|
80
|
-
{ namespace:
|
|
80
|
+
const s = await y.setItem(
|
|
81
|
+
{ namespace: t, slug: n },
|
|
81
82
|
{
|
|
82
83
|
name: e,
|
|
83
|
-
teamUid:
|
|
84
|
-
workspace:
|
|
84
|
+
teamUid: a,
|
|
85
|
+
workspace: c.exportWorkspace()
|
|
85
86
|
}
|
|
86
87
|
);
|
|
87
|
-
return
|
|
88
|
-
id:
|
|
89
|
-
teamUid:
|
|
90
|
-
namespace:
|
|
91
|
-
slug:
|
|
92
|
-
label:
|
|
93
|
-
}),
|
|
94
|
-
},
|
|
88
|
+
return f.value.push({
|
|
89
|
+
id: h(s.namespace, s.slug),
|
|
90
|
+
teamUid: s.teamUid,
|
|
91
|
+
namespace: s.namespace,
|
|
92
|
+
slug: s.slug,
|
|
93
|
+
label: s.name
|
|
94
|
+
}), s;
|
|
95
|
+
}, S = async (e, a) => {
|
|
95
96
|
await u.value?.push({
|
|
96
97
|
name: "workspace.environment",
|
|
97
|
-
params: { namespace: e, workspaceSlug:
|
|
98
|
+
params: { namespace: e, workspaceSlug: a }
|
|
98
99
|
});
|
|
99
|
-
},
|
|
100
|
+
}, F = async ({
|
|
100
101
|
teamUid: e,
|
|
101
|
-
namespace:
|
|
102
|
-
slug:
|
|
102
|
+
namespace: a,
|
|
103
|
+
slug: t,
|
|
103
104
|
name: n
|
|
104
105
|
}) => {
|
|
105
106
|
o.value = null;
|
|
106
|
-
const
|
|
107
|
-
defaultValue:
|
|
107
|
+
const c = await X({
|
|
108
|
+
defaultValue: t ?? n,
|
|
108
109
|
// Use the provided id if it exists, otherwise use the name
|
|
109
|
-
validation: async (
|
|
110
|
+
validation: async (w) => !await y.has({ namespace: a ?? "local", slug: w }),
|
|
110
111
|
maxRetries: 100,
|
|
111
|
-
transformation:
|
|
112
|
+
transformation: oe
|
|
112
113
|
});
|
|
113
|
-
if (!
|
|
114
|
+
if (!c)
|
|
114
115
|
return;
|
|
115
|
-
const m = await
|
|
116
|
+
const m = await ve({
|
|
116
117
|
teamUid: e,
|
|
117
|
-
namespace:
|
|
118
|
-
slug:
|
|
118
|
+
namespace: a,
|
|
119
|
+
slug: c,
|
|
119
120
|
name: n
|
|
120
121
|
});
|
|
121
|
-
return await
|
|
122
|
-
},
|
|
122
|
+
return await S(m.namespace, m.slug), m;
|
|
123
|
+
}, fe = async (e, a) => {
|
|
123
124
|
o.value = null, x.value = !0;
|
|
124
|
-
const
|
|
125
|
-
if (
|
|
126
|
-
const
|
|
127
|
-
|
|
128
|
-
path:
|
|
125
|
+
const t = await de(e, a);
|
|
126
|
+
if (t.success) {
|
|
127
|
+
const s = t.workspace["x-scalar-active-tab"] ?? 0, m = t.workspace["x-scalar-tabs"], w = m?.[s];
|
|
128
|
+
w && await u.value?.replace({
|
|
129
|
+
path: w.path,
|
|
129
130
|
query: d.value?.query ?? {}
|
|
130
|
-
}), m &&
|
|
131
|
+
}), m && s >= m.length && k.emit("tabs:update:tabs", {
|
|
131
132
|
"x-scalar-active-tab": 0
|
|
132
|
-
}), m ||
|
|
133
|
-
"x-scalar-tabs": [
|
|
133
|
+
}), m || k.emit("tabs:update:tabs", {
|
|
134
|
+
"x-scalar-tabs": [B(d.value)],
|
|
134
135
|
"x-scalar-active-tab": 0
|
|
135
136
|
}), x.value = !1;
|
|
136
137
|
return;
|
|
137
138
|
}
|
|
138
|
-
const n =
|
|
139
|
+
const n = U.value.find((s) => s.teamUid === "local" && s.slug === "default") ?? U.value[0];
|
|
139
140
|
if (n)
|
|
140
|
-
return
|
|
141
|
-
const
|
|
141
|
+
return S(n.namespace, n.slug);
|
|
142
|
+
const c = await F({
|
|
142
143
|
name: "Default Workspace",
|
|
143
144
|
slug: "default"
|
|
144
145
|
});
|
|
145
|
-
if (x.value = !1, !
|
|
146
|
+
if (x.value = !1, !c)
|
|
146
147
|
return console.error("Failed to create the default workspace, something went wrong, can not load the workspace");
|
|
147
148
|
r.reset();
|
|
148
|
-
},
|
|
149
|
+
}, K = i(() => {
|
|
149
150
|
const e = o.value;
|
|
150
151
|
if (!e)
|
|
151
152
|
return [];
|
|
152
|
-
const
|
|
153
|
-
return
|
|
154
|
-
}), r =
|
|
153
|
+
const a = e.workspace["x-scalar-order"] ?? Object.keys(e.workspace.documents);
|
|
154
|
+
return z(Object.keys(e.workspace.documents), a, (t) => t).map((t) => e.workspace.documents[t]?.["x-scalar-navigation"]).filter(O);
|
|
155
|
+
}), r = M(K), I = ({
|
|
155
156
|
document: e,
|
|
156
|
-
path:
|
|
157
|
-
method:
|
|
157
|
+
path: a,
|
|
158
|
+
method: t,
|
|
158
159
|
example: n
|
|
159
|
-
}) => JSON.stringify([e,
|
|
160
|
-
() =>
|
|
161
|
-
items:
|
|
160
|
+
}) => JSON.stringify([e, a, t, n].filter(O)), L = i(
|
|
161
|
+
() => G({
|
|
162
|
+
items: K.value,
|
|
162
163
|
nestedKey: "children",
|
|
163
164
|
filter: (e) => e.type === "document" || e.type === "operation" || e.type === "example",
|
|
164
165
|
getId: (e) => {
|
|
165
|
-
const
|
|
166
|
-
return
|
|
167
|
-
document:
|
|
168
|
-
path:
|
|
169
|
-
method:
|
|
166
|
+
const a = v("document", e), t = v("operation", e);
|
|
167
|
+
return I({
|
|
168
|
+
document: a?.name ?? "",
|
|
169
|
+
path: t?.path,
|
|
170
|
+
method: t?.method,
|
|
170
171
|
example: e.type === "example" ? e.name : void 0
|
|
171
172
|
});
|
|
172
173
|
}
|
|
173
174
|
})
|
|
174
|
-
),
|
|
175
|
-
const
|
|
176
|
-
return
|
|
177
|
-
|
|
175
|
+
), E = (e) => {
|
|
176
|
+
const a = L.value.get(I(e));
|
|
177
|
+
return a || L.value.get(
|
|
178
|
+
I({
|
|
178
179
|
document: e.document,
|
|
179
180
|
path: e.path,
|
|
180
181
|
method: e.method
|
|
181
182
|
})
|
|
182
183
|
);
|
|
183
|
-
},
|
|
184
|
-
const
|
|
185
|
-
if (!
|
|
184
|
+
}, V = (e) => {
|
|
185
|
+
const a = r.getEntryById(e);
|
|
186
|
+
if (!a) {
|
|
186
187
|
console.warn(`Could not find sidebar entry with id ${e} to select`);
|
|
187
188
|
return;
|
|
188
189
|
}
|
|
189
|
-
if (
|
|
190
|
+
if (a.type === "document") {
|
|
190
191
|
if (r.selectedItem.value === e) {
|
|
191
192
|
r.setExpanded(e, !r.isExpanded(e));
|
|
192
193
|
return;
|
|
193
194
|
}
|
|
194
195
|
return r.setSelected(e), r.setExpanded(e, !0), u.value?.push({
|
|
195
196
|
name: "document.overview",
|
|
196
|
-
params: { documentSlug:
|
|
197
|
+
params: { documentSlug: a.name }
|
|
197
198
|
});
|
|
198
199
|
}
|
|
199
|
-
if (
|
|
200
|
+
if (a.type === "operation") {
|
|
200
201
|
if (r.isSelected(e)) {
|
|
201
202
|
r.setExpanded(e, !r.isExpanded(e));
|
|
202
203
|
return;
|
|
203
204
|
}
|
|
204
|
-
const
|
|
205
|
-
return
|
|
205
|
+
const t = a.children?.find((n) => n.type === "example");
|
|
206
|
+
return t ? (r.setSelected(t.id), r.setExpanded(t.id, !0)) : r.setSelected(e), u.value?.push({
|
|
206
207
|
name: "example",
|
|
207
208
|
params: {
|
|
208
|
-
documentSlug: v("document",
|
|
209
|
-
pathEncoded: encodeURIComponent(
|
|
210
|
-
method:
|
|
211
|
-
exampleName:
|
|
209
|
+
documentSlug: v("document", a)?.name,
|
|
210
|
+
pathEncoded: encodeURIComponent(a.path),
|
|
211
|
+
method: a.method,
|
|
212
|
+
exampleName: t?.name ?? "default"
|
|
212
213
|
}
|
|
213
214
|
});
|
|
214
215
|
}
|
|
215
|
-
if (
|
|
216
|
+
if (a.type === "example") {
|
|
216
217
|
r.setSelected(e);
|
|
217
|
-
const
|
|
218
|
+
const t = v("operation", a);
|
|
218
219
|
return u.value?.push({
|
|
219
220
|
name: "example",
|
|
220
221
|
params: {
|
|
221
|
-
documentSlug: v("document",
|
|
222
|
-
pathEncoded: encodeURIComponent(
|
|
223
|
-
method:
|
|
224
|
-
exampleName:
|
|
222
|
+
documentSlug: v("document", a)?.name,
|
|
223
|
+
pathEncoded: encodeURIComponent(t?.path ?? ""),
|
|
224
|
+
method: t?.method,
|
|
225
|
+
exampleName: a.name
|
|
225
226
|
}
|
|
226
227
|
});
|
|
227
228
|
}
|
|
228
|
-
if (
|
|
229
|
+
if (a.type === "text")
|
|
229
230
|
return u.value?.push({
|
|
230
231
|
name: "document.overview",
|
|
231
232
|
params: {
|
|
232
|
-
documentSlug: v("document",
|
|
233
|
+
documentSlug: v("document", a)?.name
|
|
233
234
|
}
|
|
234
235
|
});
|
|
235
236
|
r.setExpanded(e, !r.isExpanded(e));
|
|
236
|
-
},
|
|
237
|
+
}, he = async () => {
|
|
237
238
|
if (!o.value)
|
|
238
239
|
return;
|
|
239
|
-
const e = o.value.workspace["x-scalar-active-tab"] ?? 0,
|
|
240
|
-
|
|
241
|
-
},
|
|
240
|
+
const e = o.value.workspace["x-scalar-active-tab"] ?? 0, a = o.value.workspace["x-scalar-tabs"]?.[e];
|
|
241
|
+
a && await u.value?.replace(a.path);
|
|
242
|
+
}, q = (e) => {
|
|
242
243
|
e && o.value?.buildSidebar(e);
|
|
243
|
-
},
|
|
244
|
-
const
|
|
245
|
-
if (!
|
|
244
|
+
}, we = (e) => {
|
|
245
|
+
const a = C.value?.["x-scalar-navigation"]?.name;
|
|
246
|
+
if (!a)
|
|
246
247
|
return;
|
|
247
|
-
const
|
|
248
|
-
document:
|
|
248
|
+
const t = E({
|
|
249
|
+
document: a,
|
|
249
250
|
path: e.path,
|
|
250
251
|
method: e.method,
|
|
251
252
|
example: e.exampleKey
|
|
252
253
|
});
|
|
253
|
-
(!
|
|
254
|
-
},
|
|
255
|
-
const
|
|
254
|
+
(!t || t.type !== "example") && (q(a), d.value && j(d.value));
|
|
255
|
+
}, ge = 288, xe = i(() => o.value?.workspace?.["x-scalar-sidebar-width"] ?? ge), ke = (e) => o.value?.update("x-scalar-sidebar-width", e), T = p(!0), be = "x-scalar-tabs", ye = "x-scalar-active-tab", B = (e) => {
|
|
256
|
+
const a = l("method", e), t = l("pathEncoded", e), n = l("documentSlug", e), c = l("workspaceSlug", e);
|
|
256
257
|
return {
|
|
257
|
-
...
|
|
258
|
-
workspace:
|
|
258
|
+
...re({
|
|
259
|
+
workspace: c,
|
|
259
260
|
document: n,
|
|
260
|
-
path:
|
|
261
|
-
method:
|
|
262
|
-
getEntryByLocation:
|
|
261
|
+
path: t,
|
|
262
|
+
method: a,
|
|
263
|
+
getEntryByLocation: E
|
|
263
264
|
}),
|
|
264
265
|
path: d.value?.path ?? ""
|
|
265
266
|
};
|
|
266
|
-
},
|
|
267
|
-
const
|
|
268
|
-
if (!
|
|
267
|
+
}, H = i(() => o.value?.workspace[be] ?? [B(d.value)]), Se = i(() => o.value?.workspace[ye] ?? 0), Y = async (e) => {
|
|
268
|
+
const a = H.value[e];
|
|
269
|
+
if (!a) {
|
|
269
270
|
console.warn(`Cannot copy URL: tab at index ${e} does not exist`);
|
|
270
271
|
return;
|
|
271
272
|
}
|
|
272
|
-
const
|
|
273
|
+
const t = `${window.location.origin}${a.path}`;
|
|
273
274
|
try {
|
|
274
|
-
await navigator.clipboard.writeText(
|
|
275
|
+
await navigator.clipboard.writeText(t);
|
|
275
276
|
} catch (n) {
|
|
276
277
|
console.error("Failed to copy URL to clipboard:", n);
|
|
277
278
|
}
|
|
278
|
-
},
|
|
279
|
-
const
|
|
280
|
-
if (
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
279
|
+
}, Ee = (e) => {
|
|
280
|
+
const a = l("workspaceSlug", e), t = l("documentSlug", e), n = l("namespace", e);
|
|
281
|
+
if (!n || !a)
|
|
282
|
+
return;
|
|
283
|
+
const c = f.value.find(
|
|
284
|
+
(s) => s.slug === a && s.namespace === n
|
|
285
|
+
);
|
|
286
|
+
if (c && !ue(c.teamUid, R.value))
|
|
287
|
+
return S("local", "default");
|
|
288
|
+
if (g.value = n, W.value = a, b.value = t, P.value = l("method", e), _.value = l("pathEncoded", e), $.value = l("exampleName", e), e.path !== "" && se.setCurrentPath(e.path), h(g.value, a) !== A.value?.id)
|
|
289
|
+
return fe(g.value, a);
|
|
290
|
+
t && t !== o.value?.workspace[ae.workspace.activeDocument] && o?.value?.update("x-scalar-active-document", t), We(e), j(e);
|
|
291
|
+
}, We = (e) => {
|
|
292
|
+
const a = o.value?.workspace["x-scalar-tabs"] ?? [], t = o.value?.workspace["x-scalar-active-tab"] ?? 0, n = a[t];
|
|
293
|
+
!n || n.path === e.path || (a[t] = B(e));
|
|
294
|
+
}, j = (e) => {
|
|
295
|
+
const a = l("documentSlug", e);
|
|
296
|
+
if (!a) {
|
|
291
297
|
r.setSelected(null);
|
|
292
298
|
return;
|
|
293
299
|
}
|
|
294
|
-
const
|
|
295
|
-
document:
|
|
296
|
-
path:
|
|
297
|
-
method:
|
|
298
|
-
example:
|
|
300
|
+
const t = E({
|
|
301
|
+
document: a,
|
|
302
|
+
path: l("pathEncoded", e),
|
|
303
|
+
method: l("method", e),
|
|
304
|
+
example: l("exampleName", e)
|
|
299
305
|
});
|
|
300
|
-
|
|
306
|
+
t && (r.setSelected(t.id), r.setExpanded(t.id, !0));
|
|
301
307
|
};
|
|
302
|
-
|
|
303
|
-
eventBus:
|
|
308
|
+
ce({
|
|
309
|
+
eventBus: k,
|
|
304
310
|
router: u,
|
|
305
311
|
store: o,
|
|
306
|
-
navigateToCurrentTab:
|
|
307
|
-
rebuildSidebar:
|
|
308
|
-
onAfterExampleCreation:
|
|
309
|
-
onSelectSidebarItem:
|
|
310
|
-
onCopyTabUrl: (e) =>
|
|
311
|
-
onToggleSidebar: () =>
|
|
312
|
+
navigateToCurrentTab: he,
|
|
313
|
+
rebuildSidebar: q,
|
|
314
|
+
onAfterExampleCreation: we,
|
|
315
|
+
onSelectSidebarItem: V,
|
|
316
|
+
onCopyTabUrl: (e) => Y(e),
|
|
317
|
+
onToggleSidebar: () => T.value = !T.value
|
|
312
318
|
});
|
|
313
|
-
function
|
|
319
|
+
function He(e) {
|
|
314
320
|
return e && (u.value = e), {
|
|
315
321
|
/** Active workspace store */
|
|
316
322
|
store: o,
|
|
317
323
|
sidebar: {
|
|
318
324
|
state: r,
|
|
319
|
-
width:
|
|
320
|
-
isOpen:
|
|
321
|
-
handleSelectItem:
|
|
322
|
-
handleSidebarWidthUpdate:
|
|
323
|
-
getEntryByLocation:
|
|
325
|
+
width: xe,
|
|
326
|
+
isOpen: T,
|
|
327
|
+
handleSelectItem: V,
|
|
328
|
+
handleSidebarWidthUpdate: ke,
|
|
329
|
+
getEntryByLocation: E
|
|
324
330
|
},
|
|
325
331
|
tabs: {
|
|
326
|
-
state:
|
|
327
|
-
activeTabIndex:
|
|
328
|
-
copyTabUrl:
|
|
332
|
+
state: H,
|
|
333
|
+
activeTabIndex: Se,
|
|
334
|
+
copyTabUrl: Y
|
|
329
335
|
},
|
|
330
336
|
workspace: {
|
|
331
|
-
create:
|
|
332
|
-
workspaceList:
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
337
|
+
create: F,
|
|
338
|
+
workspaceList: f,
|
|
339
|
+
filteredWorkspaceList: U,
|
|
340
|
+
activeWorkspace: A,
|
|
341
|
+
navigateToWorkspace: S,
|
|
342
|
+
isOpen: i(() => !!(W.value && !b.value))
|
|
336
343
|
},
|
|
337
|
-
eventBus:
|
|
344
|
+
eventBus: k,
|
|
338
345
|
router: u,
|
|
339
346
|
currentRoute: d,
|
|
340
347
|
loading: x,
|
|
341
348
|
activeEntities: {
|
|
342
|
-
namespace:
|
|
343
|
-
workspaceSlug:
|
|
344
|
-
documentSlug:
|
|
345
|
-
path:
|
|
346
|
-
method:
|
|
347
|
-
exampleName:
|
|
349
|
+
namespace: g,
|
|
350
|
+
workspaceSlug: W,
|
|
351
|
+
documentSlug: b,
|
|
352
|
+
path: _,
|
|
353
|
+
method: P,
|
|
354
|
+
exampleName: $,
|
|
355
|
+
teamUid: R
|
|
348
356
|
},
|
|
349
|
-
environment:
|
|
350
|
-
document:
|
|
357
|
+
environment: pe,
|
|
358
|
+
document: C
|
|
351
359
|
};
|
|
352
360
|
}
|
|
353
361
|
export {
|
|
354
|
-
|
|
362
|
+
He as useAppState
|
|
355
363
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type WorkspaceGroup } from '@scalar/components';
|
|
2
2
|
import type { SidebarState } from '@scalar/sidebar';
|
|
3
3
|
import type { WorkspaceStore } from '@scalar/workspace-store/client';
|
|
4
4
|
import type { WorkspaceEventBus } from '@scalar/workspace-store/events';
|
|
@@ -29,7 +29,7 @@ type __VLS_Props = {
|
|
|
29
29
|
* The list of all available workspaces.
|
|
30
30
|
* Used to render options for workspace switching and selection.
|
|
31
31
|
*/
|
|
32
|
-
workspaces:
|
|
32
|
+
workspaces: WorkspaceGroup[];
|
|
33
33
|
/**
|
|
34
34
|
* The workspace event bus for handling workspace-level events.
|
|
35
35
|
* Used for triggering and responding to workspace changes and actions.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppSidebar.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/app/components/AppSidebar.vue"],"names":[],"mappings":"AAkeA,OAAO,EAML,KAAK,
|
|
1
|
+
{"version":3,"file":"AppSidebar.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/app/components/AppSidebar.vue"],"names":[],"mappings":"AAkeA,OAAO,EAML,KAAK,cAAc,EACpB,MAAM,oBAAoB,CAAA;AAO3B,OAAO,KAAK,EAA6B,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAEvE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAA;AAUhF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,KAAK,WAAW,GAAG;IACf;;OAEG;IACH,MAAM,EAAE,YAAY,CAAA;IAEpB;;OAEG;IACH,YAAY,EAAE,YAAY,CAAC,cAAc,CAAC,CAAA;IAE1C;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB;;;OAGG;IACH,eAAe,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAA;IAC9C;;;OAGG;IACH,UAAU,EAAE,cAAc,EAAE,CAAA;IAC5B;;;OAGG;IACH,QAAQ,EAAE,iBAAiB,CAAA;IAC3B;;;OAGG;IACH,KAAK,EAAE,cAAc,CAAA;CACtB,CAAC;AAgBJ,KAAK,WAAW,GAAG;IACjB,oEAAoE;IACpE,kBAAkB,CAAC,IAAI,OAAO,CAAA;CAC/B,CAAC;AAmLF,KAAK,iBAAiB,GAAG,WAAW,GAAG;IACvC,6CAA6C;IAC7C,eAAe,EAAE,OAAO,CAAC;IACzB,wCAAwC;IACxC,cAAc,EAAE,MAAM,CAAC;CACtB,CAAC;AAqfF,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;kFAOnB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAQ1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./AppSidebar.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
const
|
|
3
|
+
import a from "../../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const m = /* @__PURE__ */ a(o, [["__scopeId", "data-v-6a79a4d6"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { WorkspaceGroup } from '@scalar/components';
|
|
2
2
|
/**
|
|
3
3
|
* The top nav on the web
|
|
4
4
|
*
|
|
@@ -16,7 +16,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
16
16
|
* The list of all available workspaces.
|
|
17
17
|
* Used to render options for workspace switching and selection.
|
|
18
18
|
*/
|
|
19
|
-
workspaces:
|
|
19
|
+
workspaces: WorkspaceGroup[];
|
|
20
20
|
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
21
21
|
"create:workspace": () => any;
|
|
22
22
|
"select:workspace": (id?: string | undefined) => any;
|
|
@@ -32,7 +32,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
32
32
|
* The list of all available workspaces.
|
|
33
33
|
* Used to render options for workspace switching and selection.
|
|
34
34
|
*/
|
|
35
|
-
workspaces:
|
|
35
|
+
workspaces: WorkspaceGroup[];
|
|
36
36
|
}> & Readonly<{
|
|
37
37
|
"onCreate:workspace"?: (() => any) | undefined;
|
|
38
38
|
"onSelect:workspace"?: ((id?: string | undefined) => any) | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WebTopNav.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/app/components/WebTopNav.vue"],"names":[],"mappings":"AAiDA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"WebTopNav.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/app/components/WebTopNav.vue"],"names":[],"mappings":"AAiDA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAOxD;;;;GAIG;;IAGD;;;OAGG;qBACc;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE;IAC/B;;;OAGG;gBACS,cAAc,EAAE;;;;;IAT5B;;;OAGG;qBACc;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE;IAC/B;;;OAGG;gBACS,cAAc,EAAE;;;;;AAX9B,wBAuGC"}
|