@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.
Files changed (28) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/style.css +1 -1
  3. package/dist/v2/blocks/request-block/helpers/get-default-headers.js +1 -1
  4. package/dist/v2/components/sidebar/Sidebar.vue.d.ts +2 -2
  5. package/dist/v2/components/sidebar/Sidebar.vue.d.ts.map +1 -1
  6. package/dist/v2/components/sidebar/SidebarMenu.vue.d.ts +2 -2
  7. package/dist/v2/components/sidebar/SidebarMenu.vue.d.ts.map +1 -1
  8. package/dist/v2/components/sidebar/SidebarMenu.vue.js +6 -6
  9. package/dist/v2/features/app/App.vue.d.ts +4 -1
  10. package/dist/v2/features/app/App.vue.d.ts.map +1 -1
  11. package/dist/v2/features/app/App.vue.js +60 -54
  12. package/dist/v2/features/app/app-state.d.ts +41 -9
  13. package/dist/v2/features/app/app-state.d.ts.map +1 -1
  14. package/dist/v2/features/app/app-state.js +200 -192
  15. package/dist/v2/features/app/components/AppSidebar.vue.d.ts +2 -2
  16. package/dist/v2/features/app/components/AppSidebar.vue.d.ts.map +1 -1
  17. package/dist/v2/features/app/components/AppSidebar.vue.js +3 -3
  18. package/dist/v2/features/app/components/WebTopNav.vue.d.ts +3 -3
  19. package/dist/v2/features/app/components/WebTopNav.vue.d.ts.map +1 -1
  20. package/dist/v2/features/app/helpers/filter-workspaces.d.ts +49 -0
  21. package/dist/v2/features/app/helpers/filter-workspaces.d.ts.map +1 -0
  22. package/dist/v2/features/app/helpers/filter-workspaces.js +5 -0
  23. package/dist/v2/features/app/helpers/group-workspaces.d.ts +24 -0
  24. package/dist/v2/features/app/helpers/group-workspaces.d.ts.map +1 -0
  25. package/dist/v2/features/app/helpers/group-workspaces.js +23 -0
  26. package/dist/v2/features/operation/Operation.vue.js +1 -1
  27. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  28. package/package.json +11 -11
@@ -1,65 +1,66 @@
1
- import { isDefined as B } from "@scalar/helpers/array/is-defined";
2
- import { sortByOrder as Y } from "@scalar/helpers/array/sort-by-order";
3
- import { isHttpMethod as j } from "@scalar/helpers/http/is-http-method";
4
- import { createSidebarState as z, generateReverseIndex as J } from "@scalar/sidebar";
5
- import { createWorkspaceStore as O } from "@scalar/workspace-store/client";
6
- import { createWorkspaceEventBus as M } from "@scalar/workspace-store/events";
7
- import { generateUniqueValue as G } from "@scalar/workspace-store/helpers/generate-unique-value";
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 Q } from "@scalar/workspace-store/persistence";
10
- import { persistencePlugin as X } from "@scalar/workspace-store/plugins/client";
11
- import { extensions as Z } from "@scalar/workspace-store/schemas/extensions";
12
- import { shallowRef as T, computed as i, ref as p, watch as ee } from "vue";
13
- import { getActiveEnvironment as te } from "../../helpers/get-active-environment.js";
14
- import { getTabDetails as ae } from "../../helpers/get-tab-details.js";
15
- import { slugify as ne } from "../../helpers/slugify.js";
16
- import { workspaceStorage as re } from "../../helpers/storage.js";
17
- import { initializeAppEventHandlers as oe } from "./app-events.js";
18
- const se = 1e3, b = M({
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
- }), f = p(void 0), E = p(void 0), k = p(void 0), L = p(void 0), N = p(void 0), P = p(void 0), x = p(!1), u = T(null);
21
- ee(u, (e) => {
22
- e && e.afterEach((t) => be(t));
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 s(e, t) {
26
- const a = t?.params[e];
27
- if (typeof a == "string")
28
- return e === "method" ? a && j(a) ? a : void 0 : decodeURIComponent(a);
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 D = T(null), h = p([]), o = T(null), R = i(() => o.value?.workspace.documents[k.value ?? ""] || null), ce = i(() => te(o.value, R.value)), { workspace: y } = await Q(), w = (e, t) => `${e}/${t}`;
31
- h.value = await y.getAll().then(
32
- (e) => e.map(({ teamUid: t, namespace: a, slug: n, name: l }) => ({
33
- id: w(a, n),
34
- teamUid: t,
35
- namespace: a,
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: l
38
+ label: c
38
39
  }))
39
40
  );
40
- const ue = async ({ namespace: e, slug: t }) => O({
41
+ const me = async ({ namespace: e, slug: a }) => N({
41
42
  plugins: [
42
- await X({ workspaceId: w(e, t), debounceDelay: se })
43
+ await ee({ workspaceId: h(e, a), debounceDelay: ie })
43
44
  ]
44
- }), le = async (e, t) => {
45
- const a = await y.getItem({ namespace: e, slug: t });
46
- if (!a)
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 ue({ namespace: e, slug: t });
51
- return n.loadWorkspace(a.workspace), D.value = { id: w(a.namespace, a.slug), label: a.name }, o.value = n, {
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
- }, ie = async ({
56
+ }, ve = async ({
56
57
  name: e,
57
- teamUid: t,
58
- namespace: a,
58
+ teamUid: a,
59
+ namespace: t,
59
60
  slug: n
60
61
  }) => {
61
- const l = O();
62
- await l.addDocument({
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 c = await y.setItem(
80
- { namespace: a, slug: n },
80
+ const s = await y.setItem(
81
+ { namespace: t, slug: n },
81
82
  {
82
83
  name: e,
83
- teamUid: t,
84
- workspace: l.exportWorkspace()
84
+ teamUid: a,
85
+ workspace: c.exportWorkspace()
85
86
  }
86
87
  );
87
- return h.value.push({
88
- id: w(c.namespace, c.slug),
89
- teamUid: c.teamUid,
90
- namespace: c.namespace,
91
- slug: c.slug,
92
- label: c.name
93
- }), c;
94
- }, A = async (e, t) => {
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: t }
98
+ params: { namespace: e, workspaceSlug: a }
98
99
  });
99
- }, _ = async ({
100
+ }, F = async ({
100
101
  teamUid: e,
101
- namespace: t,
102
- slug: a,
102
+ namespace: a,
103
+ slug: t,
103
104
  name: n
104
105
  }) => {
105
106
  o.value = null;
106
- const l = await G({
107
- defaultValue: a ?? n,
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 (g) => !await y.has({ namespace: t ?? "local", slug: g }),
110
+ validation: async (w) => !await y.has({ namespace: a ?? "local", slug: w }),
110
111
  maxRetries: 100,
111
- transformation: ne
112
+ transformation: oe
112
113
  });
113
- if (!l)
114
+ if (!c)
114
115
  return;
115
- const m = await ie({
116
+ const m = await ve({
116
117
  teamUid: e,
117
- namespace: t,
118
- slug: l,
118
+ namespace: a,
119
+ slug: c,
119
120
  name: n
120
121
  });
121
- return await A(m.namespace, m.slug), m;
122
- }, pe = async (e, t) => {
122
+ return await S(m.namespace, m.slug), m;
123
+ }, fe = async (e, a) => {
123
124
  o.value = null, x.value = !0;
124
- const a = await le(e, t);
125
- if (a.success) {
126
- const c = a.workspace["x-scalar-active-tab"] ?? 0, m = a.workspace["x-scalar-tabs"], g = m?.[c];
127
- g && await u.value?.replace({
128
- path: g.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 && c >= m.length && b.emit("tabs:update:tabs", {
131
+ }), m && s >= m.length && k.emit("tabs:update:tabs", {
131
132
  "x-scalar-active-tab": 0
132
- }), m || b.emit("tabs:update:tabs", {
133
- "x-scalar-tabs": [C(d.value)],
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 = h.value.find((c) => c.slug === "default") ?? h.value[0];
139
+ const n = U.value.find((s) => s.teamUid === "local" && s.slug === "default") ?? U.value[0];
139
140
  if (n)
140
- return A(n.namespace, n.slug);
141
- const l = await _({
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, !l)
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
- }, $ = i(() => {
149
+ }, K = i(() => {
149
150
  const e = o.value;
150
151
  if (!e)
151
152
  return [];
152
- const t = e.workspace["x-scalar-order"] ?? Object.keys(e.workspace.documents);
153
- return Y(Object.keys(e.workspace.documents), t, (a) => a).map((a) => e.workspace.documents[a]?.["x-scalar-navigation"]).filter(B);
154
- }), r = z($), W = ({
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: t,
157
- method: a,
157
+ path: a,
158
+ method: t,
158
159
  example: n
159
- }) => JSON.stringify([e, t, a, n].filter(B)), U = i(
160
- () => J({
161
- items: $.value,
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 t = v("document", e), a = v("operation", e);
166
- return W({
167
- document: t?.name ?? "",
168
- path: a?.path,
169
- method: a?.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
- ), S = (e) => {
175
- const t = U.value.get(W(e));
176
- return t || U.value.get(
177
- W({
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
- }, F = (e) => {
184
- const t = r.getEntryById(e);
185
- if (!t) {
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 (t.type === "document") {
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: t.name }
197
+ params: { documentSlug: a.name }
197
198
  });
198
199
  }
199
- if (t.type === "operation") {
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 a = t.children?.find((n) => n.type === "example");
205
- return a ? (r.setSelected(a.id), r.setExpanded(a.id, !0)) : r.setSelected(e), u.value?.push({
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", t)?.name,
209
- pathEncoded: encodeURIComponent(t.path),
210
- method: t.method,
211
- exampleName: a?.name ?? "default"
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 (t.type === "example") {
216
+ if (a.type === "example") {
216
217
  r.setSelected(e);
217
- const a = v("operation", t);
218
+ const t = v("operation", a);
218
219
  return u.value?.push({
219
220
  name: "example",
220
221
  params: {
221
- documentSlug: v("document", t)?.name,
222
- pathEncoded: encodeURIComponent(a?.path ?? ""),
223
- method: a?.method,
224
- exampleName: t.name
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 (t.type === "text")
229
+ if (a.type === "text")
229
230
  return u.value?.push({
230
231
  name: "document.overview",
231
232
  params: {
232
- documentSlug: v("document", t)?.name
233
+ documentSlug: v("document", a)?.name
233
234
  }
234
235
  });
235
236
  r.setExpanded(e, !r.isExpanded(e));
236
- }, me = async () => {
237
+ }, he = async () => {
237
238
  if (!o.value)
238
239
  return;
239
- const e = o.value.workspace["x-scalar-active-tab"] ?? 0, t = o.value.workspace["x-scalar-tabs"]?.[e];
240
- t && await u.value?.replace(t.path);
241
- }, K = (e) => {
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
- }, de = (e) => {
244
- const t = R.value?.["x-scalar-navigation"]?.name;
245
- if (!t)
244
+ }, we = (e) => {
245
+ const a = C.value?.["x-scalar-navigation"]?.name;
246
+ if (!a)
246
247
  return;
247
- const a = S({
248
- document: t,
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
- (!a || a.type !== "example") && (K(t), d.value && V(d.value));
254
- }, ve = 288, fe = i(() => o.value?.workspace?.["x-scalar-sidebar-width"] ?? ve), he = (e) => o.value?.update("x-scalar-sidebar-width", e), I = p(!0), we = "x-scalar-tabs", ge = "x-scalar-active-tab", C = (e) => {
255
- const t = s("method", e), a = s("pathEncoded", e), n = s("documentSlug", e), l = s("workspaceSlug", e);
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
- ...ae({
258
- workspace: l,
258
+ ...re({
259
+ workspace: c,
259
260
  document: n,
260
- path: a,
261
- method: t,
262
- getEntryByLocation: S
261
+ path: t,
262
+ method: a,
263
+ getEntryByLocation: E
263
264
  }),
264
265
  path: d.value?.path ?? ""
265
266
  };
266
- }, q = i(() => o.value?.workspace[we] ?? [C(d.value)]), xe = i(() => o.value?.workspace[ge] ?? 0), H = async (e) => {
267
- const t = q.value[e];
268
- if (!t) {
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 a = `${window.location.origin}${t.path}`;
273
+ const t = `${window.location.origin}${a.path}`;
273
274
  try {
274
- await navigator.clipboard.writeText(a);
275
+ await navigator.clipboard.writeText(t);
275
276
  } catch (n) {
276
277
  console.error("Failed to copy URL to clipboard:", n);
277
278
  }
278
- }, be = (e) => {
279
- const t = s("workspaceSlug", e), a = s("documentSlug", e);
280
- if (f.value = s("namespace", e), E.value = t, k.value = a, L.value = s("method", e), N.value = s("pathEncoded", e), P.value = s("exampleName", e), !(!f.value || !t)) {
281
- if (e.path !== "" && re.setCurrentPath(e.path), w(f.value, t) !== D.value?.id)
282
- return pe(f.value, t);
283
- a && a !== o.value?.workspace[Z.workspace.activeDocument] && o?.value?.update("x-scalar-active-document", a), ke(e), V(e);
284
- }
285
- }, ke = (e) => {
286
- const t = o.value?.workspace["x-scalar-tabs"] ?? [], a = o.value?.workspace["x-scalar-active-tab"] ?? 0, n = t[a];
287
- !n || n.path === e.path || (t[a] = C(e));
288
- }, V = (e) => {
289
- const t = s("documentSlug", e);
290
- if (!t) {
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 a = S({
295
- document: t,
296
- path: s("pathEncoded", e),
297
- method: s("method", e),
298
- example: s("exampleName", e)
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
- a && (r.setSelected(a.id), r.setExpanded(a.id, !0));
306
+ t && (r.setSelected(t.id), r.setExpanded(t.id, !0));
301
307
  };
302
- oe({
303
- eventBus: b,
308
+ ce({
309
+ eventBus: k,
304
310
  router: u,
305
311
  store: o,
306
- navigateToCurrentTab: me,
307
- rebuildSidebar: K,
308
- onAfterExampleCreation: de,
309
- onSelectSidebarItem: F,
310
- onCopyTabUrl: (e) => H(e),
311
- onToggleSidebar: () => I.value = !I.value
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 $e(e) {
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: fe,
320
- isOpen: I,
321
- handleSelectItem: F,
322
- handleSidebarWidthUpdate: he,
323
- getEntryByLocation: S
325
+ width: xe,
326
+ isOpen: T,
327
+ handleSelectItem: V,
328
+ handleSidebarWidthUpdate: ke,
329
+ getEntryByLocation: E
324
330
  },
325
331
  tabs: {
326
- state: q,
327
- activeTabIndex: xe,
328
- copyTabUrl: H
332
+ state: H,
333
+ activeTabIndex: Se,
334
+ copyTabUrl: Y
329
335
  },
330
336
  workspace: {
331
- create: _,
332
- workspaceList: h,
333
- activeWorkspace: D,
334
- navigateToWorkspace: A,
335
- isOpen: i(() => !!(E.value && !k.value))
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: b,
344
+ eventBus: k,
338
345
  router: u,
339
346
  currentRoute: d,
340
347
  loading: x,
341
348
  activeEntities: {
342
- namespace: f,
343
- workspaceSlug: E,
344
- documentSlug: k,
345
- path: N,
346
- method: L,
347
- exampleName: P
349
+ namespace: g,
350
+ workspaceSlug: W,
351
+ documentSlug: b,
352
+ path: _,
353
+ method: P,
354
+ exampleName: $,
355
+ teamUid: R
348
356
  },
349
- environment: ce,
350
- document: R
357
+ environment: pe,
358
+ document: C
351
359
  };
352
360
  }
353
361
  export {
354
- $e as useAppState
362
+ He as useAppState
355
363
  };
@@ -1,4 +1,4 @@
1
- import { type ScalarListboxOption } from '@scalar/components';
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: ScalarListboxOption[];
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,mBAAmB,EACzB,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,mBAAmB,EAAE,CAAA;IACjC;;;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
+ {"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 p from "../../../../_virtual/_plugin-vue_export-helper.js";
4
- const e = /* @__PURE__ */ p(o, [["__scopeId", "data-v-b574e7b1"]]);
3
+ import a from "../../../../_virtual/_plugin-vue_export-helper.js";
4
+ const m = /* @__PURE__ */ a(o, [["__scopeId", "data-v-6a79a4d6"]]);
5
5
  export {
6
- e as default
6
+ m as default
7
7
  };
@@ -1,4 +1,4 @@
1
- import type { ScalarListboxOption } from '@scalar/components';
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: ScalarListboxOption[];
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: ScalarListboxOption[];
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,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAO7D;;;;GAIG;;IAGD;;;OAGG;qBACc;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE;IAC/B;;;OAGG;gBACS,mBAAmB,EAAE;;;;;IATjC;;;OAGG;qBACc;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE;IAC/B;;;OAGG;gBACS,mBAAmB,EAAE;;;;;AAXnC,wBAuGC"}
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"}