@scalar/api-client 2.34.1 → 2.36.1

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 (68) hide show
  1. package/CHANGELOG.md +88 -0
  2. package/dist/components/ViewLayout/ViewLayoutSection.vue.d.ts.map +1 -1
  3. package/dist/components/ViewLayout/ViewLayoutSection.vue.js +1 -1
  4. package/dist/style.css +1 -1
  5. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
  6. package/dist/v2/blocks/operation-block/OperationBlock.vue.js +88 -80
  7. package/dist/v2/blocks/operation-block/helpers/build-request-body.d.ts.map +1 -1
  8. package/dist/v2/blocks/operation-block/helpers/build-request-body.js +28 -27
  9. package/dist/v2/blocks/operation-block/helpers/de-serialize-parameter.js +6 -4
  10. package/dist/v2/blocks/operation-block/helpers/validate-path-parameters.d.ts +16 -0
  11. package/dist/v2/blocks/operation-block/helpers/validate-path-parameters.d.ts.map +1 -0
  12. package/dist/v2/blocks/operation-block/helpers/validate-path-parameters.js +17 -0
  13. package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.d.ts.map +1 -1
  14. package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.js +90 -84
  15. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-body.d.ts.map +1 -1
  16. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-body.js +47 -42
  17. package/dist/v2/blocks/request-block/helpers/get-default-headers.js +1 -1
  18. package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.d.ts.map +1 -1
  19. package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.js +76 -50
  20. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts.map +1 -1
  21. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.js +65 -59
  22. package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.d.ts.map +1 -1
  23. package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.js +57 -42
  24. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts.map +1 -1
  25. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.js +44 -41
  26. package/dist/v2/blocks/scalar-auth-selector-block/helpers/secret-types.d.ts +2 -2
  27. package/dist/v2/blocks/scalar-auth-selector-block/helpers/secret-types.d.ts.map +1 -1
  28. package/dist/v2/components/sidebar/Sidebar.vue.d.ts.map +1 -1
  29. package/dist/v2/components/sidebar/Sidebar.vue.js +50 -44
  30. package/dist/v2/features/app/App.vue.d.ts.map +1 -1
  31. package/dist/v2/features/app/App.vue.js +41 -35
  32. package/dist/v2/features/app/app-events.d.ts +5 -2
  33. package/dist/v2/features/app/app-events.d.ts.map +1 -1
  34. package/dist/v2/features/app/app-events.js +58 -44
  35. package/dist/v2/features/app/app-state.d.ts.map +1 -1
  36. package/dist/v2/features/app/app-state.js +82 -80
  37. package/dist/v2/features/app/components/AppSidebar.vue.d.ts.map +1 -1
  38. package/dist/v2/features/app/components/AppSidebar.vue.js +2 -2
  39. package/dist/v2/features/app/components/AppSidebar.vue2.js +78 -76
  40. package/dist/v2/features/app/components/DesktopTabs.vue.d.ts.map +1 -1
  41. package/dist/v2/features/app/components/DesktopTabs.vue.js +34 -30
  42. package/dist/v2/features/app/components/SidebarItemMenu.vue.d.ts.map +1 -1
  43. package/dist/v2/features/app/components/SidebarItemMenu.vue.js +73 -45
  44. package/dist/v2/features/collection/DocumentCollection.vue.d.ts.map +1 -1
  45. package/dist/v2/features/collection/DocumentCollection.vue.js +20 -20
  46. package/dist/v2/features/collection/OperationCollection.vue.d.ts.map +1 -1
  47. package/dist/v2/features/collection/OperationCollection.vue.js +7 -7
  48. package/dist/v2/features/collection/WorkspaceCollection.vue.d.ts.map +1 -1
  49. package/dist/v2/features/collection/WorkspaceCollection.vue.js +5 -4
  50. package/dist/v2/features/collection/components/Authentication.vue.d.ts.map +1 -1
  51. package/dist/v2/features/collection/components/Authentication.vue.js +1 -1
  52. package/dist/v2/features/collection/components/Authentication.vue2.js +84 -66
  53. package/dist/v2/features/collection/components/LabelInput.vue.d.ts.map +1 -1
  54. package/dist/v2/features/collection/components/LabelInput.vue.js +2 -2
  55. package/dist/v2/features/collection/components/LabelInput.vue2.js +1 -1
  56. package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.d.ts +5 -0
  57. package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.d.ts.map +1 -1
  58. package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.js +131 -96
  59. package/dist/v2/features/command-palette/hooks/use-command-palette-state.d.ts +25 -0
  60. package/dist/v2/features/command-palette/hooks/use-command-palette-state.d.ts.map +1 -1
  61. package/dist/v2/features/command-palette/hooks/use-command-palette-state.js +42 -36
  62. package/dist/v2/features/operation/Operation.vue.js +1 -1
  63. package/dist/v2/workspace-events.d.ts.map +1 -1
  64. package/dist/v2/workspace-events.js +8 -5
  65. package/dist/views/Components/CodeSnippet/helpers/get-har-request.d.ts.map +1 -1
  66. package/dist/views/Components/CodeSnippet/helpers/get-har-request.js +44 -45
  67. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  68. package/package.json +19 -19
@@ -1,5 +1,5 @@
1
- import { defineComponent as V, mergeModels as W, computed as S, capitalize as j, useModel as $, ref as F, createElementBlock as b, openBlock as d, createVNode as u, createBlock as f, createCommentVNode as c, unref as i, createSlots as G, withCtx as l, createTextVNode as y, createElementVNode as r, withKeys as p, withModifiers as m, toDisplayString as H, renderSlot as U, normalizeClass as J, Fragment as I, nextTick as Y } from "vue";
2
- import { useModal as Q, ScalarSidebarItem as O, ScalarIconButton as E, ScalarButton as A, ScalarModal as X } from "@scalar/components";
1
+ import { defineComponent as j, mergeModels as C, computed as S, capitalize as F, useModel as W, ref as G, createElementBlock as b, openBlock as d, createVNode as u, createBlock as f, createCommentVNode as c, unref as s, normalizeClass as $, createSlots as H, withCtx as l, createTextVNode as y, createElementVNode as r, withKeys as p, withModifiers as m, toDisplayString as J, renderSlot as U, Fragment as I, nextTick as Y } from "vue";
2
+ import { useModal as Q, ScalarSidebarItem as E, ScalarIconButton as O, ScalarButton as A, ScalarModal as X } from "@scalar/components";
3
3
  import { isMacOS as Z } from "@scalar/helpers/general/is-mac-os";
4
4
  import { ScalarIconPlus as _, ScalarIconGearSix as ee, ScalarIconDotsThree as te } from "@scalar/icons";
5
5
  import { LibraryIcon as ae } from "@scalar/icons/library";
@@ -7,8 +7,8 @@ import { getParentEntry as g } from "@scalar/workspace-store/navigation";
7
7
  import oe from "../../../../assets/rabbit.ascii.js";
8
8
  import ne from "../../../../assets/rabbitjump.ascii.js";
9
9
  import D from "../../../../components/ScalarAsciiArt.vue.js";
10
- import ie from "../../../../components/Sidebar/Actions/DeleteSidebarListElement.vue.js";
11
- import se from "./DownloadAppButton.vue.js";
10
+ import se from "../../../../components/Sidebar/Actions/DeleteSidebarListElement.vue.js";
11
+ import ie from "./DownloadAppButton.vue.js";
12
12
  import re from "./SidebarItemMenu.vue.js";
13
13
  import { dragHandleFactory as le } from "../../../helpers/drag-handle-factory.js";
14
14
  import de from "../../../components/sidebar/Sidebar.vue.js";
@@ -18,9 +18,9 @@ const ue = { class: "flex" }, me = { class: "flex items-center gap-0.5" }, ce =
18
18
  }, pe = {
19
19
  key: 0,
20
20
  class: "empty-sidebar-item-content overflow-hidden px-2.5 py-2.5"
21
- }, ve = { class: "rabbit-ascii relative m-auto mt-2 h-[68px] w-[60px]" }, be = { class: "flex flex-col gap-1.5 p-2" }, fe = { class: "text-sidebar-c-2 rounded border px-1.25 py-1 text-xs leading-none font-medium uppercase" }, Ee = /* @__PURE__ */ V({
21
+ }, ve = { class: "rabbit-ascii relative m-auto mt-2 h-[68px] w-[60px]" }, be = { class: "flex flex-col gap-1.5 p-2" }, fe = { class: "text-sidebar-c-2 rounded border px-1.25 py-1 text-xs leading-none font-medium uppercase" }, Oe = /* @__PURE__ */ j({
22
22
  __name: "AppSidebar",
23
- props: /* @__PURE__ */ W({
23
+ props: /* @__PURE__ */ C({
24
24
  layout: {},
25
25
  sidebarState: {},
26
26
  isWorkspaceOpen: { type: Boolean },
@@ -37,18 +37,18 @@ const ue = { class: "flex" }, me = { class: "flex items-center gap-0.5" }, ce =
37
37
  },
38
38
  sidebarWidthModifiers: {}
39
39
  }),
40
- emits: /* @__PURE__ */ W(["click:workspace", "selectItem", "select:workspace", "create:workspace"], ["update:isSidebarOpen", "update:sidebarWidth"]),
40
+ emits: /* @__PURE__ */ C(["click:workspace", "selectItem", "select:workspace", "create:workspace"], ["update:isSidebarOpen", "update:sidebarWidth"]),
41
41
  setup(o, { emit: N }) {
42
- const k = N, K = S(() => j(o.activeWorkspace.label)), M = $(o, "isSidebarOpen"), h = $(o, "sidebarWidth"), x = S(() => o.sidebarState.items.value.length <= 1), C = S(
42
+ const k = N, K = S(() => F(o.activeWorkspace.label)), T = W(o, "isSidebarOpen"), B = W(o, "sidebarWidth"), x = S(() => o.sidebarState.items.value.length <= 1), M = S(
43
43
  () => le({
44
44
  store: o.store,
45
45
  sidebarState: o.sidebarState
46
46
  })
47
- ), T = (a, e) => C.value.handleDragEnd(a, e), P = (a, e) => C.value.isDroppable(a, e), s = F(null), w = Q(), z = S(() => {
48
- const a = s.value?.item;
47
+ ), z = (a, e) => M.value.handleDragEnd(a, e), P = (a, e) => M.value.isDroppable(a, e), i = G(null), w = Q(), q = S(() => {
48
+ const a = i.value?.item;
49
49
  return a?.type === "document" ? "This cannot be undone. You're about to delete the document and all tags and operations inside it." : `Are you sure you want to delete this ${a?.type ?? "item"}? This action cannot be undone.`;
50
- }), q = () => {
51
- const a = s.value?.item;
50
+ }), L = () => {
51
+ const a = i.value?.item;
52
52
  if (!a)
53
53
  return;
54
54
  const e = o.sidebarState.getEntryById(a.id), t = g("document", e), n = g("operation", e);
@@ -82,18 +82,18 @@ const ue = { class: "flex" }, me = { class: "flex items-center gap-0.5" }, ce =
82
82
  documentName: t.name
83
83
  });
84
84
  }
85
- w.hide(), s.value = null;
85
+ w.hide(), i.value = null;
86
86
  }
87
87
  }, v = async (a, e) => {
88
- if (s.value?.showMenu)
88
+ if (i.value?.showMenu)
89
89
  return;
90
90
  const t = a.currentTarget;
91
- s.value = { item: e, el: t, showMenu: !0 }, await Y();
91
+ i.value = { item: e, el: t, showMenu: !0 }, await Y();
92
92
  const n = a instanceof MouseEvent ? new MouseEvent(a.type, a) : new KeyboardEvent(a.type, a);
93
- s.value?.el.dispatchEvent(n);
94
- }, L = () => {
95
- s.value && (s.value.showMenu = !1);
96
- }, R = (a) => {
93
+ i.value?.el.dispatchEvent(n);
94
+ }, R = () => {
95
+ i.value && (i.value.showMenu = !1);
96
+ }, V = (a) => {
97
97
  const e = o.sidebarState.getEntryById(a.id), t = g("document", e), n = g("tag", e);
98
98
  o.eventBus.emit("ui:open:command-palette", {
99
99
  action: "create-request",
@@ -102,7 +102,7 @@ const ue = { class: "flex" }, me = { class: "flex items-center gap-0.5" }, ce =
102
102
  tagId: n?.name
103
103
  }
104
104
  });
105
- }, B = (a) => {
105
+ }, h = (a) => {
106
106
  const e = o.sidebarState.getEntryById(a.id), t = g("document", e)?.name;
107
107
  o.eventBus.emit("ui:navigate", {
108
108
  page: "operation",
@@ -113,56 +113,58 @@ const ue = { class: "flex" }, me = { class: "flex items-center gap-0.5" }, ce =
113
113
  });
114
114
  };
115
115
  return (a, e) => (d(), b("div", ue, [
116
- u(i(de), {
117
- isSidebarOpen: M.value,
118
- "onUpdate:isSidebarOpen": e[3] || (e[3] = (t) => M.value = t),
119
- sidebarWidth: h.value,
120
- "onUpdate:sidebarWidth": e[4] || (e[4] = (t) => h.value = t),
116
+ u(s(de), {
117
+ sidebarWidth: B.value,
118
+ "onUpdate:sidebarWidth": e[3] || (e[3] = (t) => B.value = t),
121
119
  activeWorkspace: o.activeWorkspace,
120
+ class: $([
121
+ "max-md:inset-y-0 max-md:z-2 max-md:w-full!",
122
+ T.value ? "max-md:fixed! max-md:flex!" : "max-md:hidden!"
123
+ ]),
122
124
  documents: Object.values(o.store.workspace.documents),
123
125
  isDroppable: P,
124
126
  layout: o.layout,
125
127
  sidebarState: o.sidebarState,
126
128
  workspaces: o.workspaces,
127
- "onCreate:workspace": e[5] || (e[5] = (t) => k("create:workspace")),
128
- "onNavigate:to:settings": e[6] || (e[6] = (t) => o.eventBus.emit("ui:navigate", { page: "workspace", path: "settings" })),
129
- onReorder: e[7] || (e[7] = (t, n) => T(t, n)),
130
- "onSelect:workspace": e[8] || (e[8] = (t) => k("select:workspace", t)),
131
- onSelectItem: e[9] || (e[9] = (t) => k("selectItem", t))
132
- }, G({
129
+ "onCreate:workspace": e[4] || (e[4] = (t) => k("create:workspace")),
130
+ "onNavigate:to:settings": e[5] || (e[5] = (t) => o.eventBus.emit("ui:navigate", { page: "workspace", path: "settings" })),
131
+ onReorder: e[6] || (e[6] = (t, n) => z(t, n)),
132
+ "onSelect:workspace": e[7] || (e[7] = (t) => k("select:workspace", t)),
133
+ onSelectItem: e[8] || (e[8] = (t) => k("selectItem", t))
134
+ }, H({
133
135
  sidebarMenuActions: l(() => [
134
136
  U(a.$slots, "sidebarMenuActions", {}, void 0, !0)
135
137
  ]),
136
138
  workspaceButton: l(() => [
137
- u(i(O), {
139
+ u(s(E), {
138
140
  is: "button",
139
141
  active: o.isWorkspaceOpen,
140
142
  onClick: e[0] || (e[0] = (t) => k("click:workspace"))
141
143
  }, {
142
144
  default: l(() => [
143
- y(H(K.value), 1)
145
+ y(J(K.value), 1)
144
146
  ]),
145
147
  _: 1
146
148
  }, 8, ["active"])
147
149
  ]),
148
150
  decorator: l(({ item: t }) => [
149
151
  r("div", me, [
150
- t.type === "operation" ? (d(), f(i(E), {
152
+ t.type === "operation" ? (d(), f(s(O), {
151
153
  key: 0,
152
- icon: i(ee),
154
+ icon: s(ee),
153
155
  label: "Operation settings",
154
156
  size: "sm",
155
157
  weight: "bold",
156
- onClick: m((n) => B(t), ["stop"]),
158
+ onClick: m((n) => h(t), ["stop"]),
157
159
  onKeydown: [
158
- p(m((n) => B(t), ["stop"]), ["enter"]),
159
- p(m((n) => B(t), ["stop"]), ["space"])
160
+ p(m((n) => h(t), ["stop"]), ["enter"]),
161
+ p(m((n) => h(t), ["stop"]), ["space"])
160
162
  ]
161
163
  }, null, 8, ["icon", "onClick", "onKeydown"])) : c("", !0),
162
- u(i(E), {
164
+ u(s(O), {
163
165
  "aria-expanded": "false",
164
166
  "aria-haspopup": "menu",
165
- icon: i(te),
167
+ icon: s(te),
166
168
  label: "More options",
167
169
  size: "sm",
168
170
  weight: "bold",
@@ -178,22 +180,22 @@ const ue = { class: "flex" }, me = { class: "flex items-center gap-0.5" }, ce =
178
180
  ]),
179
181
  icon: l(({ item: t }) => [
180
182
  t.type === "document" && o.store.workspace.documents[t.name]?.["x-scalar-is-dirty"] === !0 ? (d(), b("div", ce, [
181
- u(i(ae), {
183
+ u(s(ae), {
182
184
  class: "block",
183
185
  src: "icon" in t && t.icon || "interface-content-folder"
184
186
  }, null, 8, ["src"]),
185
- e[12] || (e[12] = r("div", { class: "bg-orange absolute -top-1.25 -right-1.25 flex h-2.5 w-2.5 items-center justify-center rounded-full text-[9px] font-bold text-white" }, " ! ", -1))
187
+ e[11] || (e[11] = r("div", { class: "bg-orange absolute -top-1.25 -right-1.25 flex h-2.5 w-2.5 items-center justify-center rounded-full text-[9px] font-bold text-white" }, " ! ", -1))
186
188
  ])) : c("", !0)
187
189
  ]),
188
190
  empty: l(({ item: t }) => [
189
- u(i(O), {
191
+ u(s(E), {
190
192
  is: "button",
191
- onClick: (n) => R(t)
193
+ onClick: (n) => V(t)
192
194
  }, {
193
195
  icon: l(() => [
194
- u(i(_))
196
+ u(s(_))
195
197
  ]),
196
- default: l(() => [...e[13] || (e[13] = [
198
+ default: l(() => [...e[12] || (e[12] = [
197
199
  y("Add operation", -1)
198
200
  ])]),
199
201
  _: 1
@@ -205,28 +207,28 @@ const ue = { class: "flex" }, me = { class: "flex items-center gap-0.5" }, ce =
205
207
  name: "footer",
206
208
  fn: l(() => [
207
209
  r("div", {
208
- class: J({
210
+ class: $({
209
211
  "empty-sidebar-item border-t": x.value
210
212
  })
211
213
  }, [
212
214
  x.value ? (d(), b("div", pe, [
213
215
  r("div", ve, [
214
216
  u(D, {
215
- art: i(oe),
217
+ art: s(oe),
216
218
  class: "rabbitsit font-bold"
217
219
  }, null, 8, ["art"]),
218
220
  u(D, {
219
- art: i(ne),
221
+ art: s(ne),
220
222
  class: "rabbitjump absolute top-0 left-0 font-bold"
221
223
  }, null, 8, ["art"])
222
224
  ]),
223
- e[14] || (e[14] = r("div", { class: "mt-2 mb-2 text-center text-sm text-balance" }, [
225
+ e[13] || (e[13] = r("div", { class: "mt-2 mb-2 text-center text-sm text-balance" }, [
224
226
  r("b", { class: "font-medium" }, "Let's Get Started"),
225
227
  r("p", { class: "mt-2 leading-5" }, " Create request, folder, collection or import from OpenAPI/Postman ")
226
228
  ], -1))
227
229
  ])) : c("", !0),
228
230
  r("div", be, [
229
- x.value ? (d(), f(i(A), {
231
+ x.value ? (d(), f(s(A), {
230
232
  key: 0,
231
233
  class: "w-full",
232
234
  size: "sm",
@@ -235,12 +237,12 @@ const ue = { class: "flex" }, me = { class: "flex items-center gap-0.5" }, ce =
235
237
  payload: void 0
236
238
  }))
237
239
  }, {
238
- default: l(() => [...e[15] || (e[15] = [
240
+ default: l(() => [...e[14] || (e[14] = [
239
241
  y(" Import Collection ", -1)
240
242
  ])]),
241
243
  _: 1
242
244
  })) : c("", !0),
243
- u(i(A), {
245
+ u(s(A), {
244
246
  class: "w-full",
245
247
  hotkey: "K",
246
248
  size: "sm",
@@ -248,48 +250,48 @@ const ue = { class: "flex" }, me = { class: "flex items-center gap-0.5" }, ce =
248
250
  onClick: e[2] || (e[2] = (t) => o.eventBus.emit("ui:open:command-palette"))
249
251
  }, {
250
252
  default: l(() => [
251
- e[21] || (e[21] = y(" Add Item   ", -1)),
253
+ e[20] || (e[20] = y(" Add Item   ", -1)),
252
254
  r("span", fe, [
253
- i(Z)() ? (d(), b(I, { key: 0 }, [
254
- e[16] || (e[16] = r("span", { class: "sr-only" }, "Command", -1)),
255
- e[17] || (e[17] = r("span", { "aria-hidden": "true" }, "⌘", -1))
255
+ s(Z)() ? (d(), b(I, { key: 0 }, [
256
+ e[15] || (e[15] = r("span", { class: "sr-only" }, "Command", -1)),
257
+ e[16] || (e[16] = r("span", { "aria-hidden": "true" }, "⌘", -1))
256
258
  ], 64)) : (d(), b(I, { key: 1 }, [
257
- e[18] || (e[18] = r("span", { class: "sr-only" }, "CTRL", -1)),
258
- e[19] || (e[19] = r("span", { "aria-hidden": "true" }, "⌃", -1))
259
+ e[17] || (e[17] = r("span", { class: "sr-only" }, "CTRL", -1)),
260
+ e[18] || (e[18] = r("span", { "aria-hidden": "true" }, "⌃", -1))
259
261
  ], 64)),
260
- e[20] || (e[20] = y(" K ", -1))
262
+ e[19] || (e[19] = y(" K ", -1))
261
263
  ])
262
264
  ]),
263
265
  _: 1
264
266
  }),
265
- o.layout === "web" ? (d(), f(se, { key: 1 })) : c("", !0)
267
+ o.layout === "web" ? (d(), f(ie, { key: 1 })) : c("", !0)
266
268
  ])
267
269
  ], 2)
268
270
  ]),
269
271
  key: "0"
270
272
  } : void 0
271
- ]), 1032, ["isSidebarOpen", "sidebarWidth", "activeWorkspace", "documents", "layout", "sidebarState", "workspaces"]),
272
- s.value?.showMenu ? (d(), f(re, {
273
+ ]), 1032, ["sidebarWidth", "activeWorkspace", "class", "documents", "layout", "sidebarState", "workspaces"]),
274
+ i.value?.showMenu ? (d(), f(re, {
273
275
  key: 0,
274
276
  eventBus: o.eventBus,
275
- item: s.value.item,
277
+ item: i.value.item,
276
278
  sidebarState: o.sidebarState,
277
- target: s.value.el,
278
- onCloseMenu: L,
279
- onShowDeleteModal: e[10] || (e[10] = (t) => i(w).show())
279
+ target: i.value.el,
280
+ onCloseMenu: R,
281
+ onShowDeleteModal: e[9] || (e[9] = (t) => s(w).show())
280
282
  }, null, 8, ["eventBus", "item", "sidebarState", "target"])) : c("", !0),
281
- s.value ? (d(), f(i(X), {
283
+ i.value ? (d(), f(s(X), {
282
284
  key: 1,
283
285
  size: "xxs",
284
- state: i(w),
285
- title: `Delete ${s.value.item.title}`
286
+ state: s(w),
287
+ title: `Delete ${i.value.item.title}`
286
288
  }, {
287
289
  default: l(() => [
288
- u(ie, {
289
- variableName: s.value.item.title,
290
- warningMessage: z.value,
291
- onClose: e[11] || (e[11] = (t) => i(w).hide()),
292
- onDelete: q
290
+ u(se, {
291
+ variableName: i.value.item.title,
292
+ warningMessage: q.value,
293
+ onClose: e[10] || (e[10] = (t) => s(w).hide()),
294
+ onDelete: L
293
295
  }, null, 8, ["variableName", "warningMessage"])
294
296
  ]),
295
297
  _: 1
@@ -298,5 +300,5 @@ const ue = { class: "flex" }, me = { class: "flex items-center gap-0.5" }, ce =
298
300
  }
299
301
  });
300
302
  export {
301
- Ee as default
303
+ Oe as default
302
304
  };
@@ -1 +1 @@
1
- {"version":3,"file":"DesktopTabs.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/app/components/DesktopTabs.vue"],"names":[],"mappings":"AA2EA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,oEAAoE,CAAA;AAK7F,KAAK,WAAW,GAAG;IACjB,iBAAiB;IACjB,IAAI,EAAE,GAAG,EAAE,CAAA;IACX,+BAA+B;IAC/B,cAAc,EAAE,MAAM,CAAA;IACtB,0DAA0D;IAC1D,QAAQ,EAAE,iBAAiB,CAAA;CAC5B,CAAC;AAwJF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"DesktopTabs.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/app/components/DesktopTabs.vue"],"names":[],"mappings":"AAgFA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,oEAAoE,CAAA;AAK7F,KAAK,WAAW,GAAG;IACjB,iBAAiB;IACjB,IAAI,EAAE,GAAG,EAAE,CAAA;IACX,+BAA+B;IAC/B,cAAc,EAAE,MAAM,CAAA;IACtB,0DAA0D;IAC1D,QAAQ,EAAE,iBAAiB,CAAA;CAC5B,CAAC;AA+JF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -1,7 +1,7 @@
1
- import { defineComponent as v, computed as d, createElementBlock as l, openBlock as n, createElementVNode as h, Fragment as T, renderList as C, createBlock as k, createVNode as p, unref as g } from "vue";
1
+ import { defineComponent as m, computed as h, createElementBlock as r, openBlock as o, createElementVNode as n, Fragment as T, renderList as p, createBlock as C, createVNode as g, unref as k } from "vue";
2
2
  import { ScalarIcon as f } from "@scalar/components";
3
3
  import B from "./DesktopTab.vue.js";
4
- const y = { class: "t-app__top-nav z-1 flex h-10 items-center gap-2 px-2" }, U = /* @__PURE__ */ v({
4
+ const y = { class: "t-app__top-nav" }, S = { class: "mac:app-drag-region" }, I = { class: "z-1 flex h-10 items-center gap-2 px-2" }, w = /* @__PURE__ */ m({
5
5
  __name: "DesktopTabs",
6
6
  props: {
7
7
  tabs: {},
@@ -9,44 +9,48 @@ const y = { class: "t-app__top-nav z-1 flex h-10 items-center gap-2 px-2" }, U =
9
9
  eventBus: {}
10
10
  },
11
11
  setup(e) {
12
- const o = d(() => e.tabs.length === 1), s = () => {
12
+ const s = h(() => e.tabs.length === 1), c = () => {
13
13
  e.eventBus.emit("tabs:add:tab", void 0);
14
14
  }, b = (t) => {
15
15
  e.eventBus.emit("tabs:focus:tab", { index: t });
16
- }, r = (t) => {
17
- e.eventBus.emit("tabs:close:tab", { index: t });
18
16
  }, i = (t) => {
19
- e.eventBus.emit("tabs:close:other-tabs", { index: t });
17
+ e.eventBus.emit("tabs:close:tab", { index: t });
20
18
  }, u = (t) => {
19
+ e.eventBus.emit("tabs:close:other-tabs", { index: t });
20
+ }, d = (t) => {
21
21
  e.eventBus.emit("tabs:copy:url", { index: t });
22
22
  };
23
- return (t, S) => (n(), l("nav", y, [
24
- (n(!0), l(T, null, C(e.tabs, (m, a) => (n(), k(B, {
25
- key: a,
26
- active: a === e.activeTabIndex,
27
- hotkey: !o.value && a < 9 ? String(a + 1) : void 0,
28
- isSingleTab: o.value,
29
- tab: m,
30
- onClick: (c) => b(a),
31
- onClose: (c) => r(a),
32
- onCloseOtherTabs: (c) => i(a),
33
- onCopyUrl: () => u(a),
34
- onNewTab: s
35
- }, null, 8, ["active", "hotkey", "isSingleTab", "tab", "onClick", "onClose", "onCloseOtherTabs", "onCopyUrl"]))), 128)),
36
- h("button", {
37
- class: "text-c-3 hover:bg-b-3 app-no-drag-region rounded p-1.5",
38
- type: "button",
39
- onClick: s
40
- }, [
41
- p(g(f), {
42
- icon: "Add",
43
- size: "sm",
44
- thickness: "2.5"
45
- })
23
+ return (t, N) => (o(), r("nav", y, [
24
+ n("div", S, [
25
+ n("div", I, [
26
+ (o(!0), r(T, null, p(e.tabs, (v, a) => (o(), C(B, {
27
+ key: a,
28
+ active: a === e.activeTabIndex,
29
+ hotkey: !s.value && a < 9 ? String(a + 1) : void 0,
30
+ isSingleTab: s.value,
31
+ tab: v,
32
+ onClick: (l) => b(a),
33
+ onClose: (l) => i(a),
34
+ onCloseOtherTabs: (l) => u(a),
35
+ onCopyUrl: () => d(a),
36
+ onNewTab: c
37
+ }, null, 8, ["active", "hotkey", "isSingleTab", "tab", "onClick", "onClose", "onCloseOtherTabs", "onCopyUrl"]))), 128)),
38
+ n("button", {
39
+ class: "text-c-3 hover:bg-b-3 app-no-drag-region rounded p-1.5",
40
+ type: "button",
41
+ onClick: c
42
+ }, [
43
+ g(k(f), {
44
+ icon: "Add",
45
+ size: "sm",
46
+ thickness: "2.5"
47
+ })
48
+ ])
49
+ ])
46
50
  ])
47
51
  ]));
48
52
  }
49
53
  });
50
54
  export {
51
- U as default
55
+ w as default
52
56
  };
@@ -1 +1 @@
1
- {"version":3,"file":"SidebarItemMenu.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/app/components/SidebarItemMenu.vue"],"names":[],"mappings":"AA2MA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAEvE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAA;AAGhF,KAAK,WAAW,GAAG;IACjB,4CAA4C;IAC5C,IAAI,EAAE,cAAc,CAAA;IACpB,sCAAsC;IACtC,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,qDAAqD;IACrD,YAAY,EAAE,YAAY,CAAC,cAAc,CAAC,CAAA;IAC1C,sDAAsD;IACtD,MAAM,EAAE,WAAW,CAAA;CACpB,CAAC;AA+YF,QAAA,MAAM,YAAY;;;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"SidebarItemMenu.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/app/components/SidebarItemMenu.vue"],"names":[],"mappings":"AA+OA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAEvE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAA;AAGhF,KAAK,WAAW,GAAG;IACjB,4CAA4C;IAC5C,IAAI,EAAE,cAAc,CAAA;IACpB,sCAAsC;IACtC,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,qDAAqD;IACrD,YAAY,EAAE,YAAY,CAAC,cAAc,CAAC,CAAA;IAC1C,sDAAsD;IACtD,MAAM,EAAE,WAAW,CAAA;CACpB,CAAC;AAqdF,QAAA,MAAM,YAAY;;;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -1,8 +1,8 @@
1
- import { defineComponent as C, ref as T, watch as b, nextTick as p, createBlock as i, openBlock as d, unref as n, withCtx as o, createCommentVNode as l, createElementVNode as c, createVNode as u, createTextVNode as s } from "vue";
2
- import { ScalarDropdown as P, ScalarDropdownItem as r, ScalarIcon as y, ScalarDropdownDivider as z } from "@scalar/components";
3
- import { ScalarIconPencil as M } from "@scalar/icons";
4
- import { getParentEntry as f } from "@scalar/workspace-store/navigation";
5
- const $ = { class: "flex items-center gap-2" }, V = { class: "flex items-center gap-2" }, O = { class: "flex items-center gap-2" }, W = { class: "flex items-center gap-2" }, q = { class: "text-red flex items-center gap-2" }, G = /* @__PURE__ */ C({
1
+ import { defineComponent as T, ref as b, watch as z, nextTick as $, createBlock as i, openBlock as m, unref as n, withCtx as o, createCommentVNode as l, createElementVNode as c, createVNode as u, createTextVNode as s } from "vue";
2
+ import { ScalarDropdown as M, ScalarDropdownItem as r, ScalarIcon as f, ScalarDropdownDivider as O } from "@scalar/components";
3
+ import { ScalarIconPencil as A } from "@scalar/icons";
4
+ import { getParentEntry as y } from "@scalar/workspace-store/navigation";
5
+ const V = { class: "flex items-center gap-2" }, W = { class: "flex items-center gap-2" }, U = { class: "flex items-center gap-2" }, q = { class: "flex items-center gap-2" }, R = { class: "flex items-center gap-2" }, j = { class: "text-red flex items-center gap-2" }, K = /* @__PURE__ */ T({
6
6
  __name: "SidebarItemMenu",
7
7
  props: {
8
8
  item: {},
@@ -11,12 +11,12 @@ const $ = { class: "flex items-center gap-2" }, V = { class: "flex items-center
11
11
  target: {}
12
12
  },
13
13
  emits: ["closeMenu", "showDeleteModal"],
14
- setup(e, { emit: E }) {
15
- const v = E, g = T(!1);
16
- b(g, async (a, t) => {
17
- !a && t && (await p(), v("closeMenu"));
14
+ setup(e, { emit: I }) {
15
+ const x = I, g = b(!1);
16
+ z(g, async (a, t) => {
17
+ !a && t && (await $(), x("closeMenu"));
18
18
  });
19
- const x = () => e.item.type === "document" || e.item.type === "tag", k = () => e.item.type === "document", S = () => e.item.type === "tag", A = () => e.item.type === "operation", B = () => e.item.type === "document" && e.item.id !== "drafts" || e.item.type === "tag" || e.item.type === "operation" || e.item.type === "example", D = () => {
19
+ const v = () => e.item.type === "document" || e.item.type === "tag", k = () => e.item.type === "document", S = () => e.item.type === "tag", E = () => e.item.type === "example", p = () => e.item.type === "operation", B = () => e.item.type === "document" && e.item.id !== "drafts" || e.item.type === "tag" || e.item.type === "operation" || e.item.type === "example", N = () => {
20
20
  if (e.item.type === "document" && e.eventBus.emit("ui:open:command-palette", {
21
21
  action: "create-request",
22
22
  payload: {
@@ -27,19 +27,19 @@ const $ = { class: "flex items-center gap-2" }, V = { class: "flex items-center
27
27
  e.eventBus.emit("ui:open:command-palette", {
28
28
  action: "create-request",
29
29
  payload: {
30
- documentName: f("document", a)?.name,
30
+ documentName: y("document", a)?.name,
31
31
  tagId: e.item.name
32
32
  }
33
33
  });
34
34
  }
35
- }, I = () => {
35
+ }, C = () => {
36
36
  e.item.type === "document" && e.eventBus.emit("ui:open:command-palette", {
37
37
  action: "add-tag",
38
38
  payload: {
39
39
  documentName: e.item.name
40
40
  }
41
41
  });
42
- }, N = () => {
42
+ }, D = () => {
43
43
  if (e.item.type === "tag") {
44
44
  const a = e.sidebarState.getEntryById(e.item.id);
45
45
  e.eventBus.emit(
@@ -48,7 +48,7 @@ const $ = { class: "flex items-center gap-2" }, V = { class: "flex items-center
48
48
  action: "edit-tag",
49
49
  payload: {
50
50
  tag: e.item,
51
- documentName: f("document", a)?.name ?? ""
51
+ documentName: y("document", a)?.name ?? ""
52
52
  }
53
53
  },
54
54
  { skipUnpackProxy: !0 }
@@ -60,89 +60,117 @@ const $ = { class: "flex items-center gap-2" }, V = { class: "flex items-center
60
60
  e.eventBus.emit("ui:open:command-palette", {
61
61
  action: "add-example",
62
62
  payload: {
63
- documentName: f("document", a)?.name,
63
+ documentName: y("document", a)?.name,
64
64
  operationId: e.item.id
65
65
  }
66
66
  });
67
67
  }
68
+ }, P = () => {
69
+ if (e.item.type === "example") {
70
+ const a = e.sidebarState.getEntryById(e.item.id), t = y("operation", a);
71
+ e.eventBus.emit(
72
+ "ui:open:command-palette",
73
+ {
74
+ action: "edit-example",
75
+ payload: {
76
+ example: e.item,
77
+ documentName: y("document", a)?.name ?? "",
78
+ operationId: t?.id ?? ""
79
+ }
80
+ },
81
+ { skipUnpackProxy: !0 }
82
+ );
83
+ }
68
84
  };
69
- return (a, t) => (d(), i(n(P), {
85
+ return (a, t) => (m(), i(n(M), {
70
86
  open: g.value,
71
- "onUpdate:open": t[5] || (t[5] = (m) => g.value = m),
87
+ "onUpdate:open": t[6] || (t[6] = (d) => g.value = d),
72
88
  placement: "bottom-end",
73
89
  target: e.target,
74
90
  teleport: ""
75
91
  }, {
76
92
  items: o(() => [
77
- x() ? (d(), i(n(r), {
93
+ v() ? (m(), i(n(r), {
78
94
  key: 0,
79
- onClick: t[0] || (t[0] = (m) => D())
95
+ onClick: t[0] || (t[0] = (d) => N())
80
96
  }, {
81
97
  default: o(() => [
82
- c("div", $, [
83
- u(n(y), {
98
+ c("div", V, [
99
+ u(n(f), {
84
100
  icon: "Add",
85
101
  size: "sm"
86
102
  }),
87
- t[6] || (t[6] = s(" Add Operation ", -1))
103
+ t[7] || (t[7] = s(" Add Operation ", -1))
88
104
  ])
89
105
  ]),
90
106
  _: 1
91
107
  })) : l("", !0),
92
- k() ? (d(), i(n(r), {
108
+ k() ? (m(), i(n(r), {
93
109
  key: 1,
94
- onClick: t[1] || (t[1] = (m) => I())
110
+ onClick: t[1] || (t[1] = (d) => C())
95
111
  }, {
96
112
  default: o(() => [
97
- c("div", V, [
98
- u(n(y), {
113
+ c("div", W, [
114
+ u(n(f), {
99
115
  icon: "Add",
100
116
  size: "sm"
101
117
  }),
102
- t[7] || (t[7] = s(" Add Tag ", -1))
118
+ t[8] || (t[8] = s(" Add Tag ", -1))
103
119
  ])
104
120
  ]),
105
121
  _: 1
106
122
  })) : l("", !0),
107
- S() ? (d(), i(n(r), {
123
+ S() ? (m(), i(n(r), {
108
124
  key: 2,
109
- onClick: t[2] || (t[2] = (m) => N())
125
+ onClick: t[2] || (t[2] = (d) => D())
110
126
  }, {
111
127
  default: o(() => [
112
- c("div", O, [
113
- u(n(M), { size: "sm" }),
114
- t[8] || (t[8] = s(" Rename Tag ", -1))
128
+ c("div", U, [
129
+ u(n(A), { size: "sm" }),
130
+ t[9] || (t[9] = s(" Rename Tag ", -1))
115
131
  ])
116
132
  ]),
117
133
  _: 1
118
134
  })) : l("", !0),
119
- A() ? (d(), i(n(r), {
135
+ E() ? (m(), i(n(r), {
120
136
  key: 3,
121
- onClick: t[3] || (t[3] = (m) => w())
137
+ onClick: t[3] || (t[3] = (d) => P())
122
138
  }, {
123
139
  default: o(() => [
124
- c("div", W, [
125
- u(n(y), {
140
+ c("div", q, [
141
+ u(n(A), { size: "sm" }),
142
+ t[10] || (t[10] = s(" Rename Example ", -1))
143
+ ])
144
+ ]),
145
+ _: 1
146
+ })) : l("", !0),
147
+ p() ? (m(), i(n(r), {
148
+ key: 4,
149
+ onClick: t[4] || (t[4] = (d) => w())
150
+ }, {
151
+ default: o(() => [
152
+ c("div", R, [
153
+ u(n(f), {
126
154
  icon: "Add",
127
155
  size: "sm"
128
156
  }),
129
- t[9] || (t[9] = s(" Add Example ", -1))
157
+ t[11] || (t[11] = s(" Add Example ", -1))
130
158
  ])
131
159
  ]),
132
160
  _: 1
133
161
  })) : l("", !0),
134
- (A() || x() || k()) && B() ? (d(), i(n(z), { key: 4 })) : l("", !0),
135
- B() ? (d(), i(n(r), {
136
- key: 5,
137
- onClick: t[4] || (t[4] = (m) => v("showDeleteModal"))
162
+ (p() || v() || k() || E()) && B() ? (m(), i(n(O), { key: 5 })) : l("", !0),
163
+ B() ? (m(), i(n(r), {
164
+ key: 6,
165
+ onClick: t[5] || (t[5] = (d) => x("showDeleteModal"))
138
166
  }, {
139
167
  default: o(() => [
140
- c("div", q, [
141
- u(n(y), {
168
+ c("div", j, [
169
+ u(n(f), {
142
170
  icon: "Delete",
143
171
  size: "sm"
144
172
  }),
145
- t[10] || (t[10] = s(" Delete ", -1))
173
+ t[12] || (t[12] = s(" Delete ", -1))
146
174
  ])
147
175
  ]),
148
176
  _: 1
@@ -153,5 +181,5 @@ const $ = { class: "flex items-center gap-2" }, V = { class: "flex items-center
153
181
  }
154
182
  });
155
183
  export {
156
- G as default
184
+ K as default
157
185
  };