@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,23 +1,24 @@
1
- import { defineComponent as q, mergeModels as C, computed as f, capitalize as V, useModel as W, ref as G, createElementBlock as g, openBlock as u, createVNode as l, createBlock as B, createCommentVNode as c, unref as i, createSlots as R, withCtx as r, createTextVNode as y, createElementVNode as d, withKeys as k, withModifiers as p, toDisplayString as j, renderSlot as F, normalizeClass as H, nextTick as L } from "vue";
2
- import { useModal as U, ScalarSidebarItem as I, ScalarIconButton as J, ScalarButton as $, ScalarModal as Y } from "@scalar/components";
3
- import { ScalarIconPlus as Q, ScalarIconDotsThree as X, ScalarIconGlobe as Z } from "@scalar/icons";
4
- import { getParentEntry as w } from "@scalar/workspace-store/navigation";
5
- import _ from "../../../../assets/rabbit.ascii.js";
6
- import ee from "../../../../assets/rabbitjump.ascii.js";
1
+ import { defineComponent as R, mergeModels as W, computed as k, capitalize as V, useModel as I, ref as F, createElementBlock as c, openBlock as u, createVNode as d, createBlock as M, createCommentVNode as p, unref as s, createSlots as G, withCtx as r, createTextVNode as b, createElementVNode as l, withKeys as w, withModifiers as v, toDisplayString as L, renderSlot as j, normalizeClass as H, Fragment as h, nextTick as U } from "vue";
2
+ import { useModal as J, ScalarSidebarItem as O, ScalarIconButton as Y, ScalarButton as $, ScalarModal as Q } from "@scalar/components";
3
+ import { isMacOS as X } from "@scalar/helpers/general/is-mac-os";
4
+ import { ScalarIconPlus as Z, ScalarIconDotsThree as _, ScalarIconGlobe as ee } from "@scalar/icons";
5
+ import { getParentEntry as S } from "@scalar/workspace-store/navigation";
6
+ import te from "../../../../assets/rabbit.ascii.js";
7
+ import ae from "../../../../assets/rabbitjump.ascii.js";
7
8
  import E from "../../../../components/ScalarAsciiArt.vue.js";
8
- import te from "../../../../components/Sidebar/Actions/DeleteSidebarListElement.vue.js";
9
- import ae from "./SidebarItemMenu.vue.js";
10
- import { dragHandleFactory as oe } from "../../../helpers/drag-handle-factory.js";
11
- import ne from "../../../components/sidebar/Sidebar.vue.js";
12
- const ie = { class: "flex" }, se = {
9
+ import oe from "../../../../components/Sidebar/Actions/DeleteSidebarListElement.vue.js";
10
+ import ne from "./SidebarItemMenu.vue.js";
11
+ import { dragHandleFactory as se } from "../../../helpers/drag-handle-factory.js";
12
+ import ie from "../../../components/sidebar/Sidebar.vue.js";
13
+ const re = { class: "flex" }, le = {
13
14
  key: 0,
14
15
  class: "flex items-center"
15
- }, re = {
16
+ }, de = {
16
17
  key: 0,
17
18
  class: "empty-sidebar-item-content overflow-hidden px-2.5 py-2.5"
18
- }, le = { class: "rabbit-ascii relative m-auto mt-2 h-[68px] w-[60px]" }, de = { class: "gap-1.5 p-2" }, ge = /* @__PURE__ */ q({
19
+ }, ue = { class: "rabbit-ascii relative m-auto mt-2 h-[68px] w-[60px]" }, me = { class: "gap-1.5 p-2" }, ce = { class: "text-sidebar-c-2 rounded border px-1.25 py-1 text-xs leading-none font-medium uppercase" }, Ce = /* @__PURE__ */ R({
19
20
  __name: "AppSidebar",
20
- props: /* @__PURE__ */ C({
21
+ props: /* @__PURE__ */ W({
21
22
  layout: {},
22
23
  sidebarState: {},
23
24
  isWorkspaceOpen: { type: Boolean },
@@ -34,65 +35,65 @@ const ie = { class: "flex" }, se = {
34
35
  },
35
36
  sidebarWidthModifiers: {}
36
37
  }),
37
- emits: /* @__PURE__ */ C(["click:workspace", "selectItem", "select:workspace", "create:workspace"], ["update:isSidebarOpen", "update:sidebarWidth"]),
38
- setup(a, { emit: O }) {
39
- const v = O, A = f(() => V(a.activeWorkspace.label)), M = W(a, "isSidebarOpen"), h = W(a, "sidebarWidth"), S = f(() => a.sidebarState.items.value.length <= 1), x = f(
40
- () => oe({
41
- store: a.store,
42
- sidebarState: a.sidebarState
38
+ emits: /* @__PURE__ */ W(["click:workspace", "selectItem", "select:workspace", "create:workspace"], ["update:isSidebarOpen", "update:sidebarWidth"]),
39
+ setup(o, { emit: A }) {
40
+ const f = A, D = k(() => V(o.activeWorkspace.label)), x = I(o, "isSidebarOpen"), B = I(o, "sidebarWidth"), g = k(() => o.sidebarState.items.value.length <= 1), C = k(
41
+ () => se({
42
+ store: o.store,
43
+ sidebarState: o.sidebarState
43
44
  })
44
- ), D = (o, e) => x.value.handleDragEnd(o, e), N = (o, e) => x.value.isDroppable(o, e), s = G(null), b = U(), T = f(() => {
45
- const o = s.value?.item;
46
- return o?.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 ${o?.type ?? "item"}? This action cannot be undone.`;
45
+ ), N = (a, e) => C.value.handleDragEnd(a, e), T = (a, e) => C.value.isDroppable(a, e), i = F(null), y = J(), K = k(() => {
46
+ const a = i.value?.item;
47
+ 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.`;
47
48
  }), z = () => {
48
- const o = s.value?.item;
49
- if (!o)
49
+ const a = i.value?.item;
50
+ if (!a)
50
51
  return;
51
- const e = a.sidebarState.getEntryById(o.id), t = w("document", e), n = w("operation", e);
52
+ const e = o.sidebarState.getEntryById(a.id), t = S("document", e), n = S("operation", e);
52
53
  if (t) {
53
- if (o.type === "document")
54
- a.eventBus.emit("document:delete:document", { name: t.name });
55
- else if (o.type === "tag")
56
- a.eventBus.emit("tag:delete:tag", {
54
+ if (a.type === "document")
55
+ o.eventBus.emit("document:delete:document", { name: t.name });
56
+ else if (a.type === "tag")
57
+ o.eventBus.emit("tag:delete:tag", {
57
58
  documentName: t.name,
58
- name: o.name
59
+ name: a.name
59
60
  });
60
- else if (o.type === "operation") {
61
+ else if (a.type === "operation") {
61
62
  if (!n)
62
63
  return;
63
- a.eventBus.emit("operation:delete:operation", {
64
+ o.eventBus.emit("operation:delete:operation", {
64
65
  meta: {
65
66
  method: n.method,
66
67
  path: n.path
67
68
  },
68
69
  documentName: t.name
69
70
  });
70
- } else if (o.type === "example") {
71
+ } else if (a.type === "example") {
71
72
  if (!n)
72
73
  return;
73
- a.eventBus.emit("operation:delete:example", {
74
+ o.eventBus.emit("operation:delete:example", {
74
75
  meta: {
75
76
  method: n.method,
76
77
  path: n.path,
77
- exampleKey: o.name
78
+ exampleKey: a.name
78
79
  },
79
80
  documentName: t.name
80
81
  });
81
82
  }
82
- b.hide(), s.value = null;
83
+ y.hide(), i.value = null;
83
84
  }
84
- }, m = async (o, e) => {
85
- if (s.value?.showMenu)
85
+ }, m = async (a, e) => {
86
+ if (i.value?.showMenu)
86
87
  return;
87
- const t = o.currentTarget;
88
- s.value = { item: e, el: t, showMenu: !0 }, await L();
89
- const n = o instanceof MouseEvent ? new MouseEvent(o.type, o) : new KeyboardEvent(o.type, o);
90
- s.value?.el.dispatchEvent(n);
91
- }, K = () => {
92
- s.value && (s.value.showMenu = !1);
93
- }, P = (o) => {
94
- const e = a.sidebarState.getEntryById(o.id), t = w("document", e), n = w("tag", e);
95
- a.eventBus.emit("ui:open:command-palette", {
88
+ const t = a.currentTarget;
89
+ i.value = { item: e, el: t, showMenu: !0 }, await U();
90
+ const n = a instanceof MouseEvent ? new MouseEvent(a.type, a) : new KeyboardEvent(a.type, a);
91
+ i.value?.el.dispatchEvent(n);
92
+ }, P = () => {
93
+ i.value && (i.value.showMenu = !1);
94
+ }, q = (a) => {
95
+ const e = o.sidebarState.getEntryById(a.id), t = S("document", e), n = S("tag", e);
96
+ o.eventBus.emit("ui:open:command-palette", {
96
97
  action: "create-request",
97
98
  payload: {
98
99
  documentId: t?.id,
@@ -100,127 +101,136 @@ const ie = { class: "flex" }, se = {
100
101
  }
101
102
  });
102
103
  };
103
- return (o, e) => (u(), g("div", ie, [
104
- l(i(ne), {
105
- isSidebarOpen: M.value,
106
- "onUpdate:isSidebarOpen": e[3] || (e[3] = (t) => M.value = t),
107
- sidebarWidth: h.value,
108
- "onUpdate:sidebarWidth": e[4] || (e[4] = (t) => h.value = t),
109
- activeWorkspace: a.activeWorkspace,
110
- documents: Object.values(a.store.workspace.documents),
111
- eventBus: a.eventBus,
112
- isDroppable: N,
113
- layout: a.layout,
114
- sidebarState: a.sidebarState,
115
- workspaces: a.workspaces,
116
- "onCreate:workspace": e[5] || (e[5] = (t) => v("create:workspace")),
117
- onReorder: e[6] || (e[6] = (t, n) => D(t, n)),
118
- "onSelect:workspace": e[7] || (e[7] = (t) => v("select:workspace", t)),
119
- onSelectItem: e[8] || (e[8] = (t) => v("selectItem", t))
120
- }, R({
104
+ return (a, e) => (u(), c("div", re, [
105
+ d(s(ie), {
106
+ isSidebarOpen: x.value,
107
+ "onUpdate:isSidebarOpen": e[3] || (e[3] = (t) => x.value = t),
108
+ sidebarWidth: B.value,
109
+ "onUpdate:sidebarWidth": e[4] || (e[4] = (t) => B.value = t),
110
+ activeWorkspace: o.activeWorkspace,
111
+ documents: Object.values(o.store.workspace.documents),
112
+ isDroppable: T,
113
+ layout: o.layout,
114
+ sidebarState: o.sidebarState,
115
+ workspaces: o.workspaces,
116
+ "onCreate:workspace": e[5] || (e[5] = (t) => f("create:workspace")),
117
+ onReorder: e[6] || (e[6] = (t, n) => N(t, n)),
118
+ "onSelect:workspace": e[7] || (e[7] = (t) => f("select:workspace", t)),
119
+ onSelectItem: e[8] || (e[8] = (t) => f("selectItem", t))
120
+ }, G({
121
121
  sidebarMenuActions: r(() => [
122
- F(o.$slots, "sidebarMenuActions", {}, void 0, !0)
122
+ j(a.$slots, "sidebarMenuActions", {}, void 0, !0)
123
123
  ]),
124
124
  workspaceButton: r(() => [
125
- l(i(I), {
125
+ d(s(O), {
126
126
  is: "button",
127
- active: a.isWorkspaceOpen,
128
- icon: i(Z),
129
- onClick: e[0] || (e[0] = (t) => v("click:workspace"))
127
+ active: o.isWorkspaceOpen,
128
+ icon: s(ee),
129
+ onClick: e[0] || (e[0] = (t) => f("click:workspace"))
130
130
  }, {
131
131
  default: r(() => [
132
- y(j(A.value), 1)
132
+ b(L(D.value), 1)
133
133
  ]),
134
134
  _: 1
135
135
  }, 8, ["active", "icon"])
136
136
  ]),
137
137
  decorator: r(({ item: t }) => [
138
- l(i(J), {
138
+ d(s(Y), {
139
139
  "aria-expanded": "false",
140
140
  "aria-haspopup": "menu",
141
- icon: i(X),
141
+ icon: s(_),
142
142
  label: "More options",
143
143
  size: "sm",
144
144
  weight: "bold",
145
- onClick: p((n) => m(n, t), ["stop"]),
145
+ onClick: v((n) => m(n, t), ["stop"]),
146
146
  onKeydown: [
147
- k(p((n) => m(n, t), ["stop"]), ["down"]),
148
- k(p((n) => m(n, t), ["stop"]), ["enter"]),
149
- k(p((n) => m(n, t), ["stop"]), ["space"]),
150
- k(p((n) => m(n, t), ["stop"]), ["up"])
147
+ w(v((n) => m(n, t), ["stop"]), ["down"]),
148
+ w(v((n) => m(n, t), ["stop"]), ["enter"]),
149
+ w(v((n) => m(n, t), ["stop"]), ["space"]),
150
+ w(v((n) => m(n, t), ["stop"]), ["up"])
151
151
  ]
152
152
  }, null, 8, ["icon", "onClick", "onKeydown"])
153
153
  ]),
154
154
  icon: r(({ item: t }) => [
155
- t.type === "document" && a.store.workspace.documents[t.name]?.["x-scalar-is-dirty"] === !0 ? (u(), g("div", se, [...e[11] || (e[11] = [
156
- d("div", { class: "h-2 w-2 rounded-full bg-white" }, null, -1)
157
- ])])) : c("", !0)
155
+ t.type === "document" && o.store.workspace.documents[t.name]?.["x-scalar-is-dirty"] === !0 ? (u(), c("div", le, [...e[11] || (e[11] = [
156
+ l("div", { class: "h-2 w-2 rounded-full bg-white" }, null, -1)
157
+ ])])) : p("", !0)
158
158
  ]),
159
159
  empty: r(({ item: t }) => [
160
- l(i(I), {
160
+ d(s(O), {
161
161
  is: "button",
162
- onClick: (n) => P(t)
162
+ onClick: (n) => q(t)
163
163
  }, {
164
164
  icon: r(() => [
165
- l(i(Q))
165
+ d(s(Z))
166
166
  ]),
167
167
  default: r(() => [...e[12] || (e[12] = [
168
- y("Add operation", -1)
168
+ b("Add operation", -1)
169
169
  ])]),
170
170
  _: 1
171
171
  }, 8, ["onClick"])
172
172
  ]),
173
173
  _: 2
174
174
  }, [
175
- a.layout !== "modal" ? {
175
+ o.layout !== "modal" ? {
176
176
  name: "footer",
177
177
  fn: r(() => [
178
- d("div", {
178
+ l("div", {
179
179
  class: H({
180
- "empty-sidebar-item border-t": S.value
180
+ "empty-sidebar-item border-t": g.value
181
181
  })
182
182
  }, [
183
- S.value ? (u(), g("div", re, [
184
- d("div", le, [
185
- l(E, {
186
- art: i(_),
183
+ g.value ? (u(), c("div", de, [
184
+ l("div", ue, [
185
+ d(E, {
186
+ art: s(te),
187
187
  class: "rabbitsit font-bold"
188
188
  }, null, 8, ["art"]),
189
- l(E, {
190
- art: i(ee),
189
+ d(E, {
190
+ art: s(ae),
191
191
  class: "rabbitjump absolute top-0 left-0 font-bold"
192
192
  }, null, 8, ["art"])
193
193
  ]),
194
- e[13] || (e[13] = d("div", { class: "mt-2 mb-2 text-center text-sm text-balance" }, [
195
- d("b", { class: "font-medium" }, "Let's Get Started"),
196
- d("p", { class: "mt-2 leading-3" }, " Create request, folder, collection or import from OpenAPI/Postman ")
194
+ e[13] || (e[13] = l("div", { class: "mt-2 mb-2 text-center text-sm text-balance" }, [
195
+ l("b", { class: "font-medium" }, "Let's Get Started"),
196
+ l("p", { class: "mt-2 leading-3" }, " Create request, folder, collection or import from OpenAPI/Postman ")
197
197
  ], -1))
198
- ])) : c("", !0),
199
- d("div", de, [
200
- S.value ? (u(), B(i($), {
198
+ ])) : p("", !0),
199
+ l("div", me, [
200
+ g.value ? (u(), M(s($), {
201
201
  key: 0,
202
202
  class: "w-full",
203
203
  size: "sm",
204
- onClick: e[1] || (e[1] = (t) => a.eventBus.emit("ui:open:command-palette", {
204
+ onClick: e[1] || (e[1] = (t) => o.eventBus.emit("ui:open:command-palette", {
205
205
  action: "import-from-openapi-swagger-postman-curl",
206
206
  payload: void 0
207
207
  }))
208
208
  }, {
209
209
  default: r(() => [...e[14] || (e[14] = [
210
- y(" Import Collection ", -1)
210
+ b(" Import Collection ", -1)
211
211
  ])]),
212
212
  _: 1
213
- })) : c("", !0),
214
- l(i($), {
213
+ })) : p("", !0),
214
+ d(s($), {
215
215
  class: "w-full",
216
216
  hotkey: "K",
217
217
  size: "sm",
218
218
  variant: "outlined",
219
- onClick: e[2] || (e[2] = (t) => a.eventBus.emit("ui:open:command-palette"))
219
+ onClick: e[2] || (e[2] = (t) => o.eventBus.emit("ui:open:command-palette"))
220
220
  }, {
221
- default: r(() => [...e[15] || (e[15] = [
222
- y(" Add Item ", -1)
223
- ])]),
221
+ default: r(() => [
222
+ e[20] || (e[20] = b(" Add Item   ", -1)),
223
+ l("span", ce, [
224
+ s(X)() ? (u(), c(h, { key: 0 }, [
225
+ e[15] || (e[15] = l("span", { class: "sr-only" }, "Command", -1)),
226
+ e[16] || (e[16] = l("span", { "aria-hidden": "true" }, "⌘", -1))
227
+ ], 64)) : (u(), c(h, { key: 1 }, [
228
+ e[17] || (e[17] = l("span", { class: "sr-only" }, "CTRL", -1)),
229
+ e[18] || (e[18] = l("span", { "aria-hidden": "true" }, "⌃", -1))
230
+ ], 64)),
231
+ e[19] || (e[19] = b(" K ", -1))
232
+ ])
233
+ ]),
224
234
  _: 1
225
235
  })
226
236
  ])
@@ -228,35 +238,35 @@ const ie = { class: "flex" }, se = {
228
238
  ]),
229
239
  key: "0"
230
240
  } : void 0
231
- ]), 1032, ["isSidebarOpen", "sidebarWidth", "activeWorkspace", "documents", "eventBus", "layout", "sidebarState", "workspaces"]),
232
- s.value?.showMenu ? (u(), B(ae, {
241
+ ]), 1032, ["isSidebarOpen", "sidebarWidth", "activeWorkspace", "documents", "layout", "sidebarState", "workspaces"]),
242
+ i.value?.showMenu ? (u(), M(ne, {
233
243
  key: 0,
234
- eventBus: a.eventBus,
235
- item: s.value.item,
236
- sidebarState: a.sidebarState,
237
- target: s.value.el,
238
- onCloseMenu: K,
239
- onShowDeleteModal: e[9] || (e[9] = (t) => i(b).show())
240
- }, null, 8, ["eventBus", "item", "sidebarState", "target"])) : c("", !0),
241
- s.value ? (u(), B(i(Y), {
244
+ eventBus: o.eventBus,
245
+ item: i.value.item,
246
+ sidebarState: o.sidebarState,
247
+ target: i.value.el,
248
+ onCloseMenu: P,
249
+ onShowDeleteModal: e[9] || (e[9] = (t) => s(y).show())
250
+ }, null, 8, ["eventBus", "item", "sidebarState", "target"])) : p("", !0),
251
+ i.value ? (u(), M(s(Q), {
242
252
  key: 1,
243
253
  size: "xxs",
244
- state: i(b),
245
- title: `Delete ${s.value.item.title}`
254
+ state: s(y),
255
+ title: `Delete ${i.value.item.title}`
246
256
  }, {
247
257
  default: r(() => [
248
- l(te, {
249
- variableName: s.value.item.title,
250
- warningMessage: T.value,
251
- onClose: e[10] || (e[10] = (t) => i(b).hide()),
258
+ d(oe, {
259
+ variableName: i.value.item.title,
260
+ warningMessage: K.value,
261
+ onClose: e[10] || (e[10] = (t) => s(y).hide()),
252
262
  onDelete: z
253
263
  }, null, 8, ["variableName", "warningMessage"])
254
264
  ]),
255
265
  _: 1
256
- }, 8, ["state", "title"])) : c("", !0)
266
+ }, 8, ["state", "title"])) : p("", !0)
257
267
  ]));
258
268
  }
259
269
  });
260
270
  export {
261
- ge as default
271
+ Ce as default
262
272
  };
@@ -1 +1 @@
1
- {"version":3,"file":"TheCommandPalette.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/command-palette/TheCommandPalette.vue"],"names":[],"mappings":"AAkWA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAGV,iBAAiB,EAClB,MAAM,gCAAgC,CAAA;AAWvC,OAAO,KAAK,EAEV,mBAAmB,EACpB,MAAM,mCAAmC,CAAA;AAG1C;;;;;;;;;;;;;;;;;;;;GAoBG;;IAGD,gDAAgD;kBAClC,mBAAmB;IACjC,iEAAiE;oBACjD,cAAc;IAC9B,8CAA8C;cACpC,iBAAiB;;IAL3B,gDAAgD;kBAClC,mBAAmB;IACjC,iEAAiE;oBACjD,cAAc;IAC9B,8CAA8C;cACpC,iBAAiB;;AAP7B,wBA+bC"}
1
+ {"version":3,"file":"TheCommandPalette.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/command-palette/TheCommandPalette.vue"],"names":[],"mappings":"AA0WA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAIV,iBAAiB,EAClB,MAAM,gCAAgC,CAAA;AAWvC,OAAO,KAAK,EAEV,mBAAmB,EACpB,MAAM,mCAAmC,CAAA;AAG1C;;;;;;;;;;;;;;;;;;;;GAoBG;;IAGD,gDAAgD;kBAClC,mBAAmB;IACjC,iEAAiE;oBACjD,cAAc;IAC9B,8CAA8C;cACpC,iBAAiB;;IAL3B,gDAAgD;kBAClC,mBAAmB;IACjC,iEAAiE;oBACjD,cAAc;IAC9B,8CAA8C;cACpC,iBAAiB;;AAP7B,wBAscC"}
@@ -1,7 +1,7 @@
1
1
  import o from "./TheCommandPalette.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-c47a3ecf"]]);
4
+ const r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-2fe57517"]]);
5
5
  export {
6
6
  r as default
7
7
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent as V, ref as E, computed as f, watch as K, onBeforeMount as R, onBeforeUnmount as X, createBlock as v, openBlock as l, unref as r, withCtx as p, createElementVNode as u, createVNode as i, createElementBlock as s, createTextVNode as I, createCommentVNode as S, withKeys as x, withModifiers as C, Fragment as h, renderList as B, withDirectives as Q, toDisplayString as D, vShow as A, normalizeClass as F, resolveDynamicComponent as O, mergeProps as G, nextTick as H } from "vue";
1
+ import { defineComponent as V, ref as E, computed as f, watch as K, onBeforeMount as R, onBeforeUnmount as X, createBlock as v, openBlock as l, unref as r, withCtx as p, createElementVNode as u, createVNode as i, createElementBlock as s, createTextVNode as I, createCommentVNode as S, withKeys as x, withModifiers as C, Fragment as h, renderList as D, withDirectives as Q, toDisplayString as B, vShow as A, normalizeClass as F, resolveDynamicComponent as O, mergeProps as G, nextTick as H } from "vue";
2
2
  import { Dialog as U, DialogPanel as W, DialogTitle as $ } from "@headlessui/vue";
3
3
  import { ScalarIconMagnifyingGlass as j, ScalarIconCaretLeft as q } from "@scalar/icons";
4
4
  import { useRouter as J } from "vue-router";
@@ -58,7 +58,7 @@ const Y = {
58
58
  eventBus: e.eventBus,
59
59
  ...e.paletteState.activeCommandProps.value
60
60
  })), N = (t) => {
61
- t ? e.paletteState.open(t.action, t.payload) : e.paletteState.open();
61
+ t?.event && t.event.preventDefault(), t && "action" in t ? e.paletteState.open(t.action, t.payload) : e.paletteState.open();
62
62
  };
63
63
  return R(() => e.eventBus.on("ui:open:command-palette", N)), X(() => e.eventBus.off("ui:open:command-palette", N)), (t, a) => (l(), v(r(U), {
64
64
  open: e.paletteState.isOpen.value,
@@ -113,13 +113,13 @@ const Y = {
113
113
  ]
114
114
  }, null, 40, ee)
115
115
  ]),
116
- (l(!0), s(h, null, B(e.paletteState.filteredCommands.value, (n) => (l(), s(h, {
116
+ (l(!0), s(h, null, D(e.paletteState.filteredCommands.value, (n) => (l(), s(h, {
117
117
  key: n.label || "100"
118
118
  }, [
119
- Q(u("div", { class: "text-c-3 mt-2 mb-1 px-2 text-xs font-medium" }, D(n.label), 513), [
119
+ Q(u("div", { class: "text-c-3 mt-2 mb-1 px-2 text-xs font-medium" }, B(n.label), 513), [
120
120
  [A, n.commands.length > 0]
121
121
  ]),
122
- (l(!0), s(h, null, B(n.commands, (o) => (l(), s("button", {
122
+ (l(!0), s(h, null, D(n.commands, (o) => (l(), s("button", {
123
123
  id: o.id,
124
124
  key: o.id,
125
125
  class: F(["commandmenu-item hover:bg-b-2 flex w-full cursor-pointer items-center rounded px-2 py-1.5 text-left text-sm", {
@@ -134,7 +134,7 @@ const Y = {
134
134
  size: "md",
135
135
  thickness: "1.5"
136
136
  })) : S("", !0),
137
- I(" " + D(o.name), 1)
137
+ I(" " + B(o.name), 1)
138
138
  ], 10, te))), 128))
139
139
  ], 64))), 128)),
140
140
  e.paletteState.filteredCommands.value.flatMap((n) => n.commands).length ? S("", !0) : (l(), s("div", ne, " No commands found "))
@@ -1,6 +1,6 @@
1
1
  import type { ScalarIconComponent } from '@scalar/icons/types';
2
2
  import type { CommandPalettePayload } from '@scalar/workspace-store/events';
3
- import { type Component, type ComputedRef, type Ref, type ShallowRef } from 'vue';
3
+ import { type Component, type ComputedRef, type MaybeRefOrGetter, type Ref, type ShallowRef } from 'vue';
4
4
  import type { RouteLocationRaw } from 'vue-router';
5
5
  /**
6
6
  * Command IDs that map to UI components (folder and hidden-folder types)
@@ -100,7 +100,7 @@ export type CommandPaletteState = {
100
100
  * // Close and reset
101
101
  * palette.close()
102
102
  */
103
- export declare const useCommandPaletteState: (actions?: CommandPaletteAction[], routes?: CommandPaletteRoute[]) => CommandPaletteState;
103
+ export declare const useCommandPaletteState: (actions?: MaybeRefOrGetter<CommandPaletteAction[]>, routes?: MaybeRefOrGetter<CommandPaletteRoute[]>) => CommandPaletteState;
104
104
  /**
105
105
  * The base naviation routes used in the command palette.
106
106
  * This object can be extended and passed to the useCommandPaletteState hook to add custom routes
@@ -1 +1 @@
1
- {"version":3,"file":"use-command-palette-state.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/command-palette/hooks/use-command-palette-state.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAC9D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAA;AAE3E,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,WAAW,EAAE,KAAK,GAAG,EAAE,KAAK,UAAU,EAA6B,MAAM,KAAK,CAAA;AAC5G,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AASlD;;;;GAIG;AACH,KAAK,YAAY,GAAG,MAAM,qBAAqB,CAAA;AAE/C,oDAAoD;AACpD,KAAK,yBAAyB,CAAC,CAAC,SAAS,YAAY,IAAI,qBAAqB,CAAC,CA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E,KAAK,CAAC,EAAE,MAAM,CAAA;QACd,QAAQ,EAAE,CAAC,oBAAoB,GAAG,mBAAmB,CAAC,EAAE,CAAA;KACzD,EAAE,CACJ,CAAA;IACD;;;OAGG;IACH,IAAI,EAAE,WAAW,CAAA;IACjB,kDAAkD;IAClD,KAAK,EAAE,MAAM,IAAI,CAAA;IACjB,sDAAsD;IACtD,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACvC,yCAAyC;IACzC,KAAK,EAAE,MAAM,IAAI,CAAA;CAClB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,sBAAsB,GACjC,UAAS,oBAAoB,EAAsB,EACnD,SAAQ,mBAAmB,EAAe,KACzC,mBA0FF,CAAA;AAKD;;;GAGG;AACH,eAAO,MAAM,UAAU,EAAE,mBAAmB,EA4B3C,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqCiB,CAAA"}
1
+ {"version":3,"file":"use-command-palette-state.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/command-palette/hooks/use-command-palette-state.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAC9D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAA;AAE3E,OAAO,EACL,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,GAAG,EACR,KAAK,UAAU,EAKhB,MAAM,KAAK,CAAA;AACZ,OAAO,KAAK,EAAE,gBAAgB,E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