@scalar/api-client 2.22.1 → 2.22.2

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 (56) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/dist/hooks/useClientConfig.d.ts +6 -3
  3. package/dist/hooks/useClientConfig.d.ts.map +1 -1
  4. package/dist/style.css +1 -1
  5. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.d.ts.map +1 -1
  6. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.js +2 -2
  7. package/dist/v2/blocks/request-block/helpers/get-default-headers.js +1 -1
  8. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts.map +1 -1
  9. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js +2 -2
  10. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue2.js +23 -29
  11. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts.map +1 -1
  12. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.js +45 -43
  13. package/dist/v2/components/code-input/CodeInput.vue.d.ts +0 -6
  14. package/dist/v2/components/code-input/CodeInput.vue.d.ts.map +1 -1
  15. package/dist/v2/components/code-input/CodeInput.vue.js +1 -1
  16. package/dist/v2/components/code-input/CodeInput.vue2.js +50 -63
  17. package/dist/v2/components/sidebar/Sidebar.vue.d.ts +0 -3
  18. package/dist/v2/components/sidebar/Sidebar.vue.d.ts.map +1 -1
  19. package/dist/v2/components/sidebar/Sidebar.vue.js +55 -53
  20. package/dist/v2/features/app/app-state.d.ts.map +1 -1
  21. package/dist/v2/features/app/app-state.js +33 -28
  22. package/dist/v2/features/app/components/AppSidebar.vue.d.ts.map +1 -1
  23. package/dist/v2/features/app/components/AppSidebar.vue.js +1 -1
  24. package/dist/v2/features/app/components/AppSidebar.vue2.js +137 -127
  25. package/dist/v2/features/command-palette/TheCommandPalette.vue.d.ts.map +1 -1
  26. package/dist/v2/features/command-palette/TheCommandPalette.vue.js +1 -1
  27. package/dist/v2/features/command-palette/TheCommandPalette.vue2.js +6 -6
  28. package/dist/v2/features/command-palette/hooks/use-command-palette-state.d.ts +2 -2
  29. package/dist/v2/features/command-palette/hooks/use-command-palette-state.d.ts.map +1 -1
  30. package/dist/v2/features/command-palette/hooks/use-command-palette-state.js +60 -56
  31. package/dist/v2/features/operation/Operation.vue.js +1 -1
  32. package/dist/v2/features/search/hooks/use-search-index.d.ts +3 -7
  33. package/dist/v2/features/search/hooks/use-search-index.d.ts.map +1 -1
  34. package/dist/v2/features/search/hooks/use-search-index.js +12 -18
  35. package/dist/v2/features/search/index.d.ts +1 -2
  36. package/dist/v2/features/search/index.d.ts.map +1 -1
  37. package/dist/v2/features/search/index.js +2 -4
  38. package/dist/v2/features/search/types.d.ts +1 -1
  39. package/dist/v2/features/search/types.d.ts.map +1 -1
  40. package/dist/v2/helpers/handle-hotkeys.js +1 -1
  41. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  42. package/dist/views/Request/libs/oauth2.d.ts.map +1 -1
  43. package/dist/views/Request/libs/oauth2.js +54 -52
  44. package/package.json +17 -17
  45. package/dist/v2/features/search/components/SearchButton.vue.d.ts +0 -12
  46. package/dist/v2/features/search/components/SearchButton.vue.d.ts.map +0 -1
  47. package/dist/v2/features/search/components/SearchButton.vue.js +0 -71
  48. package/dist/v2/features/search/components/SearchButton.vue2.js +0 -4
  49. package/dist/v2/features/search/components/SearchModal.vue.d.ts +0 -11
  50. package/dist/v2/features/search/components/SearchModal.vue.d.ts.map +0 -1
  51. package/dist/v2/features/search/components/SearchModal.vue.js +0 -7
  52. package/dist/v2/features/search/components/SearchModal.vue2.js +0 -102
  53. package/dist/v2/features/search/components/SearchResult.vue.d.ts +0 -10
  54. package/dist/v2/features/search/components/SearchResult.vue.d.ts.map +0 -1
  55. package/dist/v2/features/search/components/SearchResult.vue.js +0 -80
  56. package/dist/v2/features/search/components/SearchResult.vue2.js +0 -4
@@ -1,9 +1,9 @@
1
- import { defineComponent as W, useAttrs as H, ref as d, computed as s, toRef as r, watch as J, createElementBlock as i, openBlock as o, Fragment as Q, createBlock as b, createCommentVNode as f, normalizeClass as G, createElementVNode as V, toDisplayString as X, mergeProps as Y, unref as T, withKeys as h, withModifiers as A, createTextVNode as B, renderSlot as N } from "vue";
1
+ import { defineComponent as W, useAttrs as H, ref as u, computed as d, toRef as r, watch as J, createElementBlock as i, openBlock as l, Fragment as Q, createBlock as m, createCommentVNode as f, normalizeClass as G, createElementVNode as V, toDisplayString as X, mergeProps as Y, unref as T, withKeys as b, withModifiers as A, createTextVNode as B, renderSlot as N } from "vue";
2
2
  import { isDefined as Z } from "@scalar/helpers/array/is-defined";
3
3
  import { useCodeMirror as _, useDropdown as ee, colorPicker as te } from "@scalar/use-codemirror";
4
- import { nanoid as le } from "nanoid";
4
+ import { nanoid as ne } from "nanoid";
5
5
  import p from "../data-table/DataTableInputSelect.vue.js";
6
- import ne from "../../features/environments/components/EnvironmentVariablesDropdown.vue.js";
6
+ import le from "../../features/environments/components/EnvironmentVariablesDropdown.vue.js";
7
7
  import { pillPlugin as oe, backspaceCommand as ae } from "./code-variable-widget.js";
8
8
  const re = { class: "whitespace-nowrap" }, ie = ["id"], ue = {
9
9
  key: 0,
@@ -47,50 +47,37 @@ const re = { class: "whitespace-nowrap" }, ie = ["id"], ue = {
47
47
  disableCloseBrackets: { type: Boolean, default: !1 },
48
48
  emitOnBlur: { type: Boolean, default: !0 },
49
49
  withVariables: { type: Boolean, default: !0 },
50
- importCurl: { type: Boolean, default: !1 },
51
50
  alwaysEmitChange: { type: Boolean, default: !1 },
52
51
  handleFieldChange: { type: Function },
53
52
  handleFieldSubmit: { type: Function },
54
53
  linethrough: { type: Boolean }
55
54
  },
56
- emits: ["update:modelValue", "submit", "blur", "curl", "redirectToEnvironment"],
55
+ emits: ["update:modelValue", "submit", "blur", "redirectToEnvironment"],
57
56
  setup(e, { expose: O, emit: $ }) {
58
- const u = $, k = H(), I = k.id || `id-${le()}`, y = d(!1), M = s(() => e.enum?.length ? !1 : e.type === "boolean" || Array.isArray(e.type) && e.type.includes("boolean")), C = s(
57
+ const s = $, k = H(), I = k.id || `id-${ne()}`, y = u(!1), M = d(() => e.enum?.length ? !1 : e.type === "boolean" || Array.isArray(e.type) && e.type.includes("boolean")), C = d(
59
58
  () => e.nullable ? ["true", "false", "null"] : ["true", "false"]
60
- ), R = s(() => Array.isArray(e.type) ? e.type.find((t) => t !== "null") ?? "string" : e.type), E = (t) => {
61
- if (!(!e.alwaysEmitChange && t === c(e.modelValue))) {
62
- if (e.importCurl && t.trim().toLowerCase().startsWith("curl")) {
63
- u("curl", t), n.value && n.value.dispatch({
64
- changes: {
65
- from: 0,
66
- to: n.value.state.doc.length,
67
- insert: c(e.modelValue)
68
- }
69
- });
70
- return;
71
- }
72
- e.handleFieldChange ? e.handleFieldChange(t) : u("update:modelValue", t);
73
- }
74
- }, g = (t) => {
75
- e.handleFieldSubmit ? e.handleFieldSubmit(t) : u("submit", t);
59
+ ), R = d(() => Array.isArray(e.type) ? e.type.find((t) => t !== "null") ?? "string" : e.type), E = (t) => {
60
+ !e.alwaysEmitChange && t === v(e.modelValue) || (e.handleFieldChange ? e.handleFieldChange(t) : s("update:modelValue", t));
61
+ }, h = (t) => {
62
+ e.handleFieldSubmit ? e.handleFieldSubmit(t) : s("submit", t);
76
63
  }, S = (t) => {
77
- y.value = !1, e.emitOnBlur && e.modelValue && g(t), u("blur", t);
78
- }, v = (t) => u("update:modelValue", t), q = () => {
64
+ y.value = !1, e.emitOnBlur && e.modelValue && h(t), s("blur", t);
65
+ }, g = (t) => s("update:modelValue", t), q = () => {
79
66
  const t = [...e.extensions];
80
67
  return e.colorPicker && t.push(te), t;
81
- }, z = s(
68
+ }, z = d(
82
69
  () => oe({
83
70
  environment: e.environment,
84
71
  isReadOnly: e.layout === "modal"
85
72
  })
86
- ), j = s(() => [
73
+ ), j = d(() => [
87
74
  ...q(),
88
75
  z.value,
89
76
  ae
90
- ]), P = d(null), c = (t) => typeof t == "string" ? t : JSON.stringify(t), { codeMirror: n } = _({
91
- content: r(() => c(e.modelValue)),
77
+ ]), P = u(null), v = (t) => typeof t == "string" ? t : JSON.stringify(t), { codeMirror: o } = _({
78
+ content: r(() => v(e.modelValue)),
92
79
  onChange: (t) => {
93
- E(t), L();
80
+ E(t), U();
94
81
  },
95
82
  onFocus: () => {
96
83
  y.value = !0;
@@ -106,20 +93,20 @@ const re = { class: "whitespace-nowrap" }, ie = ["id"], ue = {
106
93
  extensions: j,
107
94
  placeholder: r(() => e.placeholder)
108
95
  });
109
- J(n, () => {
110
- n.value && Object.hasOwn(k, "autofocus") && n.value.focus();
96
+ J(o, () => {
97
+ o.value && Object.hasOwn(k, "autofocus") && o.value.focus();
111
98
  });
112
- const w = d(!1), D = d(""), F = d({ left: 0, top: 0 }), x = d(null), { handleDropdownSelect: K, updateDropdownVisibility: L } = ee({
113
- codeMirror: n,
99
+ const w = u(!1), D = u(""), F = u({ left: 0, top: 0 }), x = u(null), { handleDropdownSelect: K, updateDropdownVisibility: U } = ee({
100
+ codeMirror: o,
114
101
  query: D,
115
102
  showDropdown: w,
116
103
  dropdownPosition: F
117
- }), U = s(() => w.value && e.withVariables && e.layout !== "modal" && !!e.environment), m = (t, l) => {
104
+ }), L = d(() => w.value && e.withVariables && e.layout !== "modal" && !!e.environment), c = (t, n) => {
118
105
  if (w.value) {
119
- t === "down" || t === "up" ? (l.preventDefault(), x.value?.handleArrowKey(t)) : t === "enter" && (l.preventDefault(), x.value?.handleSelect());
106
+ t === "down" || t === "up" ? (n.preventDefault(), x.value?.handleArrowKey(t)) : t === "enter" && (n.preventDefault(), x.value?.handleSelect());
120
107
  return;
121
108
  }
122
- t === "escape" && !e.disableTabIndent && l.stopPropagation(), t === "enter" && l.target instanceof HTMLDivElement && g(l.target.textContent ?? "");
109
+ t === "escape" && !e.disableTabIndent && n.stopPropagation(), t === "enter" && n.target instanceof HTMLDivElement && h(n.target.textContent ?? "");
123
110
  };
124
111
  return O({
125
112
  /**
@@ -128,25 +115,25 @@ const re = { class: "whitespace-nowrap" }, ie = ["id"], ue = {
128
115
  * @param cursorAtEnd boolean place the cursor at the end of the input
129
116
  */
130
117
  focus: (t) => {
131
- if (!n.value || (n.value.focus(), !Z(t)))
118
+ if (!o.value || (o.value.focus(), !Z(t)))
132
119
  return;
133
- const l = t === "start" ? 0 : t === "end" ? n.value.state.doc.length : t;
134
- n.value.dispatch({
135
- selection: { anchor: l },
120
+ const n = t === "start" ? 0 : t === "end" ? o.value.state.doc.length : t;
121
+ o.value.dispatch({
122
+ selection: { anchor: n },
136
123
  scrollIntoView: !0
137
124
  });
138
125
  },
139
126
  isFocused: y,
140
127
  handleChange: E,
141
- handleSubmit: g,
128
+ handleSubmit: h,
142
129
  handleBlur: S,
143
130
  booleanOptions: C,
144
- codeMirror: n,
131
+ codeMirror: o,
145
132
  modelValue: e.modelValue,
146
- cursorPosition: () => n.value?.state.selection.main.head,
147
- serializeValue: c
148
- }), (t, l) => (o(), i(Q, null, [
149
- e.disabled ? (o(), i("div", {
133
+ cursorPosition: () => o.value?.state.selection.main.head,
134
+ serializeValue: v
135
+ }), (t, n) => (l(), i(Q, null, [
136
+ e.disabled ? (l(), i("div", {
150
137
  key: 0,
151
138
  class: G(["text-c-2 flex cursor-default items-center justify-center", {
152
139
  "font-code pr-2 pl-1 text-base": e.layout === "modal",
@@ -156,26 +143,26 @@ const re = { class: "whitespace-nowrap" }, ie = ["id"], ue = {
156
143
  "data-testid": "code-input-disabled"
157
144
  }, [
158
145
  V("span", re, X(e.modelValue), 1)
159
- ], 2)) : e.enum?.length ? (o(), b(p, {
146
+ ], 2)) : e.enum?.length ? (l(), m(p, {
160
147
  key: 1,
161
148
  default: e.default,
162
149
  modelValue: e.modelValue,
163
150
  type: R.value,
164
151
  value: e.enum,
165
- "onUpdate:modelValue": v
166
- }, null, 8, ["default", "modelValue", "type", "value"])) : M.value ? (o(), b(p, {
152
+ "onUpdate:modelValue": g
153
+ }, null, 8, ["default", "modelValue", "type", "value"])) : M.value ? (l(), m(p, {
167
154
  key: 2,
168
155
  default: e.default,
169
156
  modelValue: e.modelValue,
170
157
  value: C.value,
171
- "onUpdate:modelValue": v
172
- }, null, 8, ["default", "modelValue", "value"])) : e.examples?.length ? (o(), b(p, {
158
+ "onUpdate:modelValue": g
159
+ }, null, 8, ["default", "modelValue", "value"])) : e.examples?.length ? (l(), m(p, {
173
160
  key: 3,
174
161
  default: e.default,
175
162
  modelValue: e.modelValue,
176
163
  value: e.examples,
177
- "onUpdate:modelValue": v
178
- }, null, 8, ["default", "modelValue", "value"])) : (o(), i("div", Y({
164
+ "onUpdate:modelValue": g
165
+ }, null, 8, ["default", "modelValue", "value"])) : (l(), i("div", Y({
179
166
  key: 4,
180
167
  id: T(I)
181
168
  }, t.$attrs, {
@@ -187,13 +174,13 @@ const re = { class: "whitespace-nowrap" }, ie = ["id"], ue = {
187
174
  "line-through": e.linethrough
188
175
  }],
189
176
  onKeydown: [
190
- l[0] || (l[0] = h(A((a) => m("down", a), ["stop"]), ["down"])),
191
- l[1] || (l[1] = h((a) => m("enter", a), ["enter"])),
192
- l[2] || (l[2] = h((a) => m("escape", a), ["escape"])),
193
- l[3] || (l[3] = h(A((a) => m("up", a), ["stop"]), ["up"]))
177
+ n[0] || (n[0] = b(A((a) => c("down", a), ["stop"]), ["down"])),
178
+ n[1] || (n[1] = b((a) => c("enter", a), ["enter"])),
179
+ n[2] || (n[2] = b((a) => c("escape", a), ["escape"])),
180
+ n[3] || (n[3] = b(A((a) => c("up", a), ["stop"]), ["up"]))
194
181
  ]
195
182
  }), [
196
- e.disableTabIndent ? f("", !0) : (o(), i("div", ue, [...l[5] || (l[5] = [
183
+ e.disableTabIndent ? f("", !0) : (l(), i("div", ue, [...n[5] || (n[5] = [
197
184
  B(" Press ", -1),
198
185
  V("kbd", { class: "-mx-0.25 rounded border px-0.5 font-mono" }, "Esc", -1),
199
186
  B(" then ", -1),
@@ -201,21 +188,21 @@ const re = { class: "whitespace-nowrap" }, ie = ["id"], ue = {
201
188
  B(" to exit ", -1)
202
189
  ])]))
203
190
  ], 16, ie)),
204
- t.$slots.warning ? (o(), i("div", de, [
191
+ t.$slots.warning ? (l(), i("div", de, [
205
192
  N(t.$slots, "warning", {}, void 0, !0)
206
193
  ])) : f("", !0),
207
- t.$slots.icon ? (o(), i("div", se, [
194
+ t.$slots.icon ? (l(), i("div", se, [
208
195
  N(t.$slots, "icon", {}, void 0, !0)
209
196
  ])) : f("", !0),
210
- e.required ? (o(), i("div", fe, " Required ")) : f("", !0),
211
- U.value && e.environment ? (o(), b(ne, {
197
+ e.required ? (l(), i("div", fe, " Required ")) : f("", !0),
198
+ L.value && e.environment ? (l(), m(le, {
212
199
  key: 8,
213
200
  ref_key: "dropdownRef",
214
201
  ref: x,
215
202
  dropdownPosition: F.value,
216
203
  environment: e.environment,
217
204
  query: D.value,
218
- onRedirect: l[4] || (l[4] = (a) => u("redirectToEnvironment")),
205
+ onRedirect: n[4] || (n[4] = (a) => s("redirectToEnvironment")),
219
206
  onSelect: T(K)
220
207
  }, null, 8, ["dropdownPosition", "environment", "query", "onSelect"])) : f("", !0)
221
208
  ], 64));
@@ -1,6 +1,5 @@
1
1
  import { type ScalarListboxOption } from '@scalar/components';
2
2
  import { type DraggingItem, type HoveredItem, type SidebarState } from '@scalar/sidebar';
3
- import type { WorkspaceEventBus } from '@scalar/workspace-store/events';
4
3
  import type { WorkspaceDocument } from '@scalar/workspace-store/schemas';
5
4
  import type { TraversedEntry } from '@scalar/workspace-store/schemas/navigation';
6
5
  import type { ClientLayout } from '../../../v2/types/layout';
@@ -15,8 +14,6 @@ type __VLS_Props = {
15
14
  };
16
15
  /** The list of all available workspaces */
17
16
  workspaces: ScalarListboxOption[];
18
- /** The workspace event bus for handling workspace-level events */
19
- eventBus: WorkspaceEventBus;
20
17
  /** The documents belonging to the workspace */
21
18
  documents: WorkspaceDocument[];
22
19
  /**
@@ -1 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, useModel as W, createBlock as n, openBlock as r, unref as i, withCtx as a, createVNode as D, createSlots as I, renderSlot as l, createElementBlock as y, createCommentVNode as d, Fragment as M, normalizeProps as m, guardReactiveProps as f, createElementVNode as S } from "vue";
2
- import { ScalarIconButton as h } from "@scalar/components";
3
- import { ScalarIconFileDashed as C, ScalarIconMagnifyingGlass as E } from "@scalar/icons";
4
- import { ScalarSidebar as V } from "@scalar/sidebar";
5
- import z from "./SidebarMenu.vue.js";
6
- import F from "../resize/Resize.vue.js";
7
- import N from "../../features/search/components/SearchButton.vue.js";
8
- const R = { class: "bg-sidebar-b-1 z-1 flex flex-col gap-1.5 px-3 pb-1.5" }, A = { class: "flex items-center justify-between" }, j = { key: 1 }, O = /* @__PURE__ */ B({
1
+ import { defineComponent as h, mergeModels as y, useSlots as D, ref as V, useModel as B, computed as M, createBlock as d, openBlock as l, unref as r, withCtx as s, createVNode as C, createSlots as E, renderSlot as i, createElementBlock as v, createCommentVNode as n, Fragment as R, normalizeProps as f, guardReactiveProps as b, createElementVNode as w, isRef as z } from "vue";
2
+ import { ScalarIconButton as F, ScalarSidebarSearchInput as N } from "@scalar/components";
3
+ import { ScalarIconFileDashed as q, ScalarIconMagnifyingGlass as A } from "@scalar/icons";
4
+ import { ScalarSidebar as U } from "@scalar/sidebar";
5
+ import j from "./SidebarMenu.vue.js";
6
+ import { useSearchIndex as G } from "../../features/search/hooks/use-search-index.js";
7
+ import H from "../resize/Resize.vue.js";
8
+ const J = { class: "bg-sidebar-b-1 z-1 flex flex-col gap-1.5 px-3 pb-1.5" }, K = { class: "flex items-center justify-between" }, L = { key: 1 }, _ = /* @__PURE__ */ h({
9
9
  __name: "Sidebar",
10
- props: /* @__PURE__ */ v({
10
+ props: /* @__PURE__ */ y({
11
11
  sidebarState: {},
12
12
  layout: {},
13
13
  activeWorkspace: {},
14
14
  workspaces: {},
15
- eventBus: {},
16
15
  documents: {},
17
16
  isDroppable: { type: [Boolean, Function] }
18
17
  }, {
@@ -22,77 +21,80 @@ const R = { class: "bg-sidebar-b-1 z-1 flex flex-col gap-1.5 px-3 pb-1.5" }, A =
22
21
  },
23
22
  sidebarWidthModifiers: {}
24
23
  }),
25
- emits: /* @__PURE__ */ v(["selectItem", "select:workspace", "create:workspace", "reorder"], ["update:sidebarWidth"]),
26
- setup(t, { emit: w }) {
27
- const c = w, b = $(), u = x(!1), k = W(t, "sidebarWidth"), p = (s) => s.type === "example" && s.title === "draft";
28
- return (s, o) => (r(), n(i(F), {
24
+ emits: /* @__PURE__ */ y(["selectItem", "select:workspace", "create:workspace", "reorder"], ["update:sidebarWidth"]),
25
+ setup(t, { emit: g }) {
26
+ const c = g, p = D(), u = V(!1), k = B(t, "sidebarWidth"), S = (o) => o.type === "example" && o.title === "draft", { query: m, results: x } = G(() => t.documents), I = M(() => x.value ?? t.sidebarState.items.value), W = (o) => {
27
+ c("selectItem", o), m.value = "", u.value = !1;
28
+ };
29
+ return (o, a) => (l(), d(r(H), {
29
30
  width: k.value,
30
- "onUpdate:width": o[5] || (o[5] = (e) => k.value = e),
31
+ "onUpdate:width": a[5] || (a[5] = (e) => k.value = e),
31
32
  class: "flex flex-col"
32
33
  }, {
33
- default: a(() => [
34
- D(i(V), {
34
+ default: s(() => [
35
+ C(r(U), {
35
36
  class: "flex w-auto flex-1 pt-2",
36
37
  indent: 15,
37
38
  isDraggable: t.layout !== "modal",
38
39
  isDroppable: t.isDroppable,
39
40
  isExpanded: t.sidebarState.isExpanded,
40
41
  isSelected: t.sidebarState.isSelected,
41
- items: t.sidebarState.items.value,
42
+ items: I.value,
42
43
  layout: "client",
43
- onReorder: o[3] || (o[3] = (e, g) => c("reorder", e, g)),
44
- onSelectItem: o[4] || (o[4] = (e) => c("selectItem", e))
45
- }, I({
46
- header: a(() => [
47
- S("div", R, [
48
- S("div", A, [
49
- t.layout === "desktop" ? (r(), n(z, {
44
+ onReorder: a[4] || (a[4] = (e, $) => c("reorder", e, $)),
45
+ onSelectItem: W
46
+ }, E({
47
+ header: s(() => [
48
+ w("div", J, [
49
+ w("div", K, [
50
+ t.layout === "desktop" ? (l(), d(j, {
50
51
  key: 0,
51
52
  activeWorkspace: t.activeWorkspace,
52
53
  workspaces: t.workspaces,
53
- "onCreate:workspace": o[0] || (o[0] = (e) => c("create:workspace")),
54
- "onSelect:workspace": o[1] || (o[1] = (e) => c("select:workspace", e))
54
+ "onCreate:workspace": a[0] || (a[0] = (e) => c("create:workspace")),
55
+ "onSelect:workspace": a[1] || (a[1] = (e) => c("select:workspace", e))
55
56
  }, {
56
- sidebarMenuActions: a(() => [
57
- l(s.$slots, "sidebarMenuActions")
57
+ sidebarMenuActions: s(() => [
58
+ i(o.$slots, "sidebarMenuActions")
58
59
  ]),
59
60
  _: 3
60
- }, 8, ["activeWorkspace", "workspaces"])) : t.layout === "modal" ? (r(), y("div", j)) : d("", !0),
61
- t.layout !== "web" ? (r(), n(i(h), {
61
+ }, 8, ["activeWorkspace", "workspaces"])) : t.layout === "modal" ? (l(), v("div", L)) : n("", !0),
62
+ t.layout !== "web" ? (l(), d(r(F), {
62
63
  key: 2,
63
- icon: i(E),
64
+ icon: r(A),
64
65
  label: "Search",
65
- onClick: o[2] || (o[2] = (e) => u.value = !u.value)
66
- }, null, 8, ["icon"])) : d("", !0)
66
+ onClick: a[2] || (a[2] = (e) => u.value = !u.value)
67
+ }, null, 8, ["icon"])) : n("", !0)
67
68
  ]),
68
- u.value || t.layout === "web" ? (r(), n(i(N), {
69
+ u.value || t.layout === "web" ? (l(), d(r(N), {
69
70
  key: 0,
70
- documents: t.documents,
71
- eventBus: t.eventBus
72
- }, null, 8, ["documents", "eventBus"])) : d("", !0)
71
+ modelValue: r(m),
72
+ "onUpdate:modelValue": a[3] || (a[3] = (e) => z(m) ? m.value = e : null),
73
+ autofocus: t.layout !== "web"
74
+ }, null, 8, ["modelValue", "autofocus"])) : n("", !0)
73
75
  ])
74
76
  ]),
75
- decorator: a((e) => [
76
- l(s.$slots, "decorator", m(f(e)))
77
+ decorator: s((e) => [
78
+ i(o.$slots, "decorator", f(b(e)))
77
79
  ]),
78
- icon: a((e) => [
79
- b.icon || p(e.item) ? (r(), y(M, { key: 0 }, [
80
- p(e.item) ? (r(), n(i(C), { key: 0 })) : d("", !0),
81
- l(s.$slots, "icon", m(f(e)))
82
- ], 64)) : d("", !0)
80
+ icon: s((e) => [
81
+ p.icon || S(e.item) ? (l(), v(R, { key: 0 }, [
82
+ S(e.item) ? (l(), d(r(q), { key: 0 })) : n("", !0),
83
+ i(o.$slots, "icon", f(b(e)))
84
+ ], 64)) : n("", !0)
83
85
  ]),
84
- before: a(() => [
85
- l(s.$slots, "workspaceButton")
86
+ before: s(() => [
87
+ i(o.$slots, "workspaceButton")
86
88
  ]),
87
- footer: a(() => [
88
- l(s.$slots, "footer")
89
+ footer: s(() => [
90
+ i(o.$slots, "footer")
89
91
  ]),
90
92
  _: 2
91
93
  }, [
92
- b.empty ? {
94
+ p.empty ? {
93
95
  name: "empty",
94
- fn: a((e) => [
95
- l(s.$slots, "empty", m(f(e)))
96
+ fn: s((e) => [
97
+ i(o.$slots, "empty", f(b(e)))
96
98
  ]),
97
99
  key: "0"
98
100
  } : void 0
@@ -103,5 +105,5 @@ const R = { class: "bg-sidebar-b-1 z-1 flex flex-col gap-1.5 px-3 pb-1.5" }, A =
103
105
  }
104
106
  });
105
107
  export {
106
- O as default
108
+ _ as default
107
109
  };
@@ -1 +1 @@
1
- {"version":3,"file":"app-state.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/app/app-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAG7D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AAGnE,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,gCAAgC,CAAA;AAC1F,OAAO,EAEL,KAAK,iBAAiB,EAEvB,MAAM,gCAAgC,CAAA;AAKvC,OAAO,KAAK,EAAa,iBAAiB,EAAE,MAAM,i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GAAG,QAAQ,CAyCrD"}
@@ -9,7 +9,7 @@ import { getParentEntry as p } from "@scalar/workspace-store/navigation";
9
9
  import { createWorkspaceStorePersistence as z } from "@scalar/workspace-store/persistence";
10
10
  import { persistencePlugin as J } from "@scalar/workspace-store/plugins/client";
11
11
  import { extensions as M } from "@scalar/workspace-store/schemas/extensions";
12
- import { shallowRef as g, computed as i, ref as l, watch as G } from "vue";
12
+ import { shallowRef as g, computed as u, ref as l, watch as G } from "vue";
13
13
  import { getActiveEnvironment as Q } from "../../helpers/get-active-environment.js";
14
14
  import { getTabDetails as X } from "../../helpers/get-tab-details.js";
15
15
  import { slugify as Z } from "../../helpers/slugify.js";
@@ -21,15 +21,15 @@ const ae = 1e3, v = j({
21
21
  G(c, (e) => {
22
22
  e && e.afterEach((t) => he(t));
23
23
  });
24
- const d = i(() => c.value?.currentRoute.value ?? null);
24
+ const d = u(() => c.value?.currentRoute.value ?? null);
25
25
  function s(e, t) {
26
26
  const a = t?.params[e];
27
27
  if (typeof a == "string")
28
28
  return e === "method" ? a && H(a) ? a : void 0 : decodeURIComponent(a);
29
29
  }
30
- const y = g(null), S = l([]), n = g(null), E = i(() => n.value?.workspace.documents[f.value ?? ""] || null), ne = i(() => Q(n.value, E.value)), { workspace: h } = await z();
30
+ const y = g(null), S = l([]), n = g(null), E = u(() => n.value?.workspace.documents[f.value ?? ""] || null), re = u(() => Q(n.value, E.value)), { workspace: h } = await z();
31
31
  S.value = await h.getAll().then((e) => e.map(({ id: t, name: a }) => ({ id: t, label: a })));
32
- const re = async ({ workspaceId: e }) => R({
32
+ const ne = async ({ workspaceId: e }) => R({
33
33
  plugins: [await J({ workspaceId: e, debounceDelay: ae })]
34
34
  }), oe = async (e) => {
35
35
  const t = await h.getItem(e);
@@ -37,7 +37,7 @@ const re = async ({ workspaceId: e }) => R({
37
37
  return {
38
38
  success: !1
39
39
  };
40
- const a = await re({ workspaceId: e });
40
+ const a = await ne({ workspaceId: e });
41
41
  return a.loadWorkspace(t.workspace), y.value = { id: e, label: t.name }, n.value = a, {
42
42
  success: !0,
43
43
  workspace: a.workspace
@@ -77,7 +77,7 @@ const re = async ({ workspaceId: e }) => R({
77
77
  const a = await q({
78
78
  defaultValue: e ?? t,
79
79
  // Use the provided id if it exists, otherwise use the name
80
- validation: async (u) => !await h.has(u),
80
+ validation: async (i) => !await h.has(i),
81
81
  maxRetries: 100,
82
82
  transformation: Z
83
83
  });
@@ -89,10 +89,10 @@ const re = async ({ workspaceId: e }) => R({
89
89
  n.value = null, m.value = !0;
90
90
  const t = await oe(e);
91
91
  if (t.success) {
92
- const o = t.workspace["x-scalar-active-tab"] ?? 0, u = t.workspace["x-scalar-tabs"], W = u?.[o];
93
- W && await c.value?.replace(W.path), u && o >= u.length && v.emit("tabs:update:tabs", {
92
+ const o = t.workspace["x-scalar-active-tab"] ?? 0, i = t.workspace["x-scalar-tabs"], W = i?.[o];
93
+ W && await c.value?.replace(W.path), i && o >= i.length && v.emit("tabs:update:tabs", {
94
94
  "x-scalar-active-tab": 0
95
- }), u || v.emit("tabs:update:tabs", {
95
+ }), i || v.emit("tabs:update:tabs", {
96
96
  "x-scalar-tabs": [I(d.value)],
97
97
  "x-scalar-active-tab": 0
98
98
  }), m.value = !1;
@@ -105,7 +105,7 @@ const re = async ({ workspaceId: e }) => R({
105
105
  if (m.value = !1, !a)
106
106
  return console.error("Failed to create the default workspace, something went wrong, can not load the workspace");
107
107
  r.reset();
108
- }, L = i(() => {
108
+ }, L = u(() => {
109
109
  const e = n.value;
110
110
  if (!e)
111
111
  return [];
@@ -116,7 +116,7 @@ const re = async ({ workspaceId: e }) => R({
116
116
  path: t,
117
117
  method: a,
118
118
  example: o
119
- }) => JSON.stringify([e, t, a, o].filter(D)), T = i(
119
+ }) => JSON.stringify([e, t, a, o].filter(D)), T = u(
120
120
  () => Y({
121
121
  items: L.value,
122
122
  nestedKey: "children",
@@ -146,16 +146,21 @@ const re = async ({ workspaceId: e }) => R({
146
146
  console.warn(`Could not find sidebar entry with id ${e} to select`);
147
147
  return;
148
148
  }
149
- if (r.isSelected(e)) {
150
- r.setExpanded(e, !r.isExpanded(e));
151
- return;
152
- }
153
- if (t.type === "document")
154
- return r.setSelected(e), r.setExpanded(e, !r.isExpanded(e)), c.value?.push({
149
+ if (t.type === "document") {
150
+ if (r.selectedItem.value === e) {
151
+ r.setExpanded(e, !r.isExpanded(e));
152
+ return;
153
+ }
154
+ return r.setSelected(e), r.setExpanded(e, !0), c.value?.push({
155
155
  name: "document.overview",
156
156
  params: { documentSlug: t.name }
157
157
  });
158
+ }
158
159
  if (t.type === "operation") {
160
+ if (r.isSelected(e)) {
161
+ r.setExpanded(e, !r.isExpanded(e));
162
+ return;
163
+ }
159
164
  const a = t.children?.find((o) => o.type === "example");
160
165
  return a ? (r.setSelected(a.id), r.setExpanded(a.id, !0)) : r.setSelected(e), c.value?.push({
161
166
  name: "example",
@@ -168,7 +173,7 @@ const re = async ({ workspaceId: e }) => R({
168
173
  });
169
174
  }
170
175
  if (t.type === "example") {
171
- r.setSelected(e), r.setExpanded(e, !0);
176
+ r.setSelected(e);
172
177
  const a = p("operation", t);
173
178
  return c.value?.push({
174
179
  name: "example",
@@ -188,14 +193,14 @@ const re = async ({ workspaceId: e }) => R({
188
193
  }
189
194
  });
190
195
  r.setExpanded(e, !r.isExpanded(e));
191
- }, ie = async () => {
196
+ }, ue = async () => {
192
197
  if (!n.value)
193
198
  return;
194
199
  const e = n.value.workspace["x-scalar-active-tab"] ?? 0, t = n.value.workspace["x-scalar-tabs"]?.[e];
195
200
  t && await c.value?.replace(t.path);
196
201
  }, P = (e) => {
197
202
  e && n.value?.buildSidebar(e);
198
- }, ue = (e) => {
203
+ }, ie = (e) => {
199
204
  const t = E.value?.["x-scalar-navigation"]?.name;
200
205
  if (!t)
201
206
  return;
@@ -206,11 +211,11 @@ const re = async ({ workspaceId: e }) => R({
206
211
  example: e.exampleKey
207
212
  });
208
213
  (!a || a.type !== "example") && (P(t), d.value && K(d.value));
209
- }, le = 288, pe = i(() => n.value?.workspace?.["x-scalar-sidebar-width"] ?? le), de = (e) => n.value?.update("x-scalar-sidebar-width", e), k = l(!0), me = "x-scalar-tabs", ve = "x-scalar-active-tab", I = (e) => {
210
- const t = s("method", e), a = s("pathEncoded", e), o = s("documentSlug", e), u = s("workspaceSlug", e);
214
+ }, le = 288, pe = u(() => n.value?.workspace?.["x-scalar-sidebar-width"] ?? le), de = (e) => n.value?.update("x-scalar-sidebar-width", e), k = l(!0), me = "x-scalar-tabs", ve = "x-scalar-active-tab", I = (e) => {
215
+ const t = s("method", e), a = s("pathEncoded", e), o = s("documentSlug", e), i = s("workspaceSlug", e);
211
216
  return {
212
217
  ...X({
213
- workspace: u,
218
+ workspace: i,
214
219
  document: o,
215
220
  path: a,
216
221
  method: t,
@@ -218,7 +223,7 @@ const re = async ({ workspaceId: e }) => R({
218
223
  }),
219
224
  path: d.value?.path ?? ""
220
225
  };
221
- }, _ = i(() => n.value?.workspace[me] ?? [I(d.value)]), fe = i(() => n.value?.workspace[ve] ?? 0), F = async (e) => {
226
+ }, _ = u(() => n.value?.workspace[me] ?? [I(d.value)]), fe = u(() => n.value?.workspace[ve] ?? 0), F = async (e) => {
222
227
  const t = _.value[e];
223
228
  if (!t) {
224
229
  console.warn(`Cannot copy URL: tab at index ${e} does not exist`);
@@ -260,9 +265,9 @@ te({
260
265
  eventBus: v,
261
266
  router: c,
262
267
  store: n,
263
- navigateToCurrentTab: ie,
268
+ navigateToCurrentTab: ue,
264
269
  rebuildSidebar: P,
265
- onAfterExampleCreation: ue,
270
+ onAfterExampleCreation: ie,
266
271
  onSelectSidebarItem: N,
267
272
  onCopyTabUrl: (e) => F(e),
268
273
  onToggleSidebar: () => k.value = !k.value
@@ -289,7 +294,7 @@ function Le(e) {
289
294
  workspaceList: S,
290
295
  activeWorkspace: y,
291
296
  setId: B,
292
- isOpen: i(() => !!(x.value && !f.value))
297
+ isOpen: u(() => !!(x.value && !f.value))
293
298
  },
294
299
  eventBus: v,
295
300
  router: c,
@@ -302,7 +307,7 @@ function Le(e) {
302
307
  method: A,
303
308
  exampleName: U
304
309
  },
305
- environment: ne,
310
+ environment: re,
306
311
  document: E
307
312
  };
308
313
  }
@@ -1 +1 @@
1
- {"version":3,"file":"AppSidebar.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/app/components/AppSidebar.vue"],"names":[],"mappings":"AAqdA,OAAO,EAML,KAAK,mBAAmB,EACzB,MAAM,oBAAoB,CAAA;AAM3B,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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AAA;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
3
  import p from "../../../../_virtual/_plugin-vue_export-helper.js";
4
- const e = /* @__PURE__ */ p(o, [["__scopeId", "data-v-e30bf25b"]]);
4
+ const e = /* @__PURE__ */ p(o, [["__scopeId", "data-v-b574e7b1"]]);
5
5
  export {
6
6
  e as default
7
7
  };