@scalar/api-client 2.2.54 → 2.2.56

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 (82) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/components/CommandPalette/CommandActionForm.vue.d.ts +1 -1
  3. package/dist/components/CommandPalette/CommandActionForm.vue.d.ts.map +1 -1
  4. package/dist/components/CommandPalette/CommandActionForm.vue.js +15 -14
  5. package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts.map +1 -1
  6. package/dist/components/CommandPalette/CommandPaletteImport.vue.js +121 -106
  7. package/dist/components/{ImportCurl/ImportCurlModal.vue.d.ts → CommandPalette/CommandPaletteImportCurl.vue.d.ts} +9 -17
  8. package/dist/components/CommandPalette/CommandPaletteImportCurl.vue.d.ts.map +1 -0
  9. package/dist/components/CommandPalette/CommandPaletteImportCurl.vue.js +7 -0
  10. package/dist/components/CommandPalette/CommandPaletteImportCurl.vue2.js +141 -0
  11. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts +98 -1
  12. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -1
  13. package/dist/components/CommandPalette/TheCommandPalette.vue.js +2 -2
  14. package/dist/components/CommandPalette/TheCommandPalette.vue2.js +128 -113
  15. package/dist/components/HttpMethod/HttpMethod.vue.d.ts +2 -2
  16. package/dist/components/OpenApiClientButton.vue.d.ts.map +1 -1
  17. package/dist/components/OpenApiClientButton.vue.js +2 -2
  18. package/dist/components/TopNav/TopNav.vue.d.ts.map +1 -1
  19. package/dist/components/TopNav/TopNav.vue.js +122 -94
  20. package/dist/components/TopNav/TopNavItem.vue.d.ts +1 -0
  21. package/dist/components/TopNav/TopNavItem.vue.d.ts.map +1 -1
  22. package/dist/components/TopNav/TopNavItem.vue.js +1 -1
  23. package/dist/components/TopNav/TopNavItem.vue2.js +49 -42
  24. package/dist/layouts/App/create-api-client-app.d.ts +12 -12
  25. package/dist/layouts/Modal/ApiClientModal.vue.d.ts.map +1 -1
  26. package/dist/layouts/Modal/ApiClientModal.vue.js +2 -2
  27. package/dist/layouts/Modal/create-api-client-modal.d.ts +24 -24
  28. package/dist/layouts/Web/create-api-client-web.d.ts +12 -12
  29. package/dist/libs/create-client.d.ts +12 -12
  30. package/dist/libs/create-client.d.ts.map +1 -1
  31. package/dist/libs/create-client.js +91 -115
  32. package/dist/libs/get-request-uid-by-path-method.d.ts +7 -0
  33. package/dist/libs/get-request-uid-by-path-method.d.ts.map +1 -0
  34. package/dist/libs/get-request-uid-by-path-method.js +10 -0
  35. package/dist/libs/get-request-uid-by-path-method.test.d.ts +2 -0
  36. package/dist/libs/get-request-uid-by-path-method.test.d.ts.map +1 -0
  37. package/dist/libs/send-request/create-fetch-body.d.ts +1 -1
  38. package/dist/libs/validate-parameters.d.ts +6 -0
  39. package/dist/libs/validate-parameters.d.ts.map +1 -0
  40. package/dist/libs/validate-parameters.js +12 -0
  41. package/dist/libs/validate-parameters.test.d.ts +2 -0
  42. package/dist/libs/validate-parameters.test.d.ts.map +1 -0
  43. package/dist/store/cookies.d.ts +4 -4
  44. package/dist/store/request-example.d.ts +4 -4
  45. package/dist/store/requests.d.ts +4 -4
  46. package/dist/store/store.d.ts +12 -12
  47. package/dist/style.css +1 -1
  48. package/dist/views/Request/Request.vue.d.ts +6 -3
  49. package/dist/views/Request/Request.vue.d.ts.map +1 -1
  50. package/dist/views/Request/Request.vue.js +2 -2
  51. package/dist/views/Request/Request.vue2.js +96 -145
  52. package/dist/views/Request/RequestRoot.vue.d.ts.map +1 -1
  53. package/dist/views/Request/RequestRoot.vue.js +2 -2
  54. package/dist/views/Request/RequestRoot.vue2.js +68 -57
  55. package/dist/views/Request/RequestSection/RequestBody.vue.d.ts.map +1 -1
  56. package/dist/views/Request/RequestSection/RequestBody.vue.js +2 -2
  57. package/dist/views/Request/RequestSection/RequestBody.vue2.js +1 -1
  58. package/dist/views/Request/RequestSection/RequestParams.vue.d.ts +1 -0
  59. package/dist/views/Request/RequestSection/RequestParams.vue.d.ts.map +1 -1
  60. package/dist/views/Request/RequestSection/RequestParams.vue.js +34 -31
  61. package/dist/views/Request/RequestSection/RequestPathParams.vue.d.ts +1 -0
  62. package/dist/views/Request/RequestSection/RequestPathParams.vue.d.ts.map +1 -1
  63. package/dist/views/Request/RequestSection/RequestPathParams.vue.js +35 -33
  64. package/dist/views/Request/RequestSection/RequestSection.vue.d.ts +1 -0
  65. package/dist/views/Request/RequestSection/RequestSection.vue.d.ts.map +1 -1
  66. package/dist/views/Request/RequestSection/RequestSection.vue.js +2 -2
  67. package/dist/views/Request/RequestSection/RequestSection.vue2.js +59 -54
  68. package/dist/views/Request/RequestSection/RequestTable.vue.d.ts +1 -0
  69. package/dist/views/Request/RequestSection/RequestTable.vue.d.ts.map +1 -1
  70. package/dist/views/Request/RequestSection/RequestTable.vue.js +2 -2
  71. package/dist/views/Request/RequestSection/RequestTable.vue2.js +29 -27
  72. package/dist/views/Request/RequestSidebar.vue.js +2 -2
  73. package/dist/views/Request/RequestSidebar.vue2.js +23 -23
  74. package/dist/views/Request/RequestSubpageHeader.vue.d.ts.map +1 -1
  75. package/dist/views/Request/RequestSubpageHeader.vue.js +2 -2
  76. package/dist/views/Request/RequestSubpageHeader.vue2.js +4 -4
  77. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  78. package/dist/views/Request/libs/request.js +1 -2
  79. package/package.json +12 -12
  80. package/dist/components/ImportCurl/ImportCurlModal.vue.d.ts.map +0 -1
  81. package/dist/components/ImportCurl/ImportCurlModal.vue.js +0 -7
  82. package/dist/components/ImportCurl/ImportCurlModal.vue2.js +0 -125
@@ -1,158 +1,182 @@
1
- import { defineComponent as j, reactive as z, ref as O, computed as W, watch as R, onMounted as D, onBeforeUnmount as K, openBlock as m, createElementBlock as b, createElementVNode as v, createVNode as r, unref as s, withCtx as u, createBlock as _, createCommentVNode as q, toDisplayString as F, createTextVNode as S, Fragment as H, renderList as G } from "vue";
2
- import { ScalarContextMenu as J, ScalarIcon as d, ScalarFloating as P, ScalarDropdownMenu as Q, ScalarDropdownButton as I } from "@scalar/components";
3
- import { useClipboard as X } from "@scalar/use-hooks/useClipboard";
4
- import { useRouter as Y } from "vue-router";
5
- import Z from "../ScalarHotkey.vue.js";
6
- import { ROUTES as ee } from "../../constants.js";
7
- import { useActiveEntities as te } from "../../store/active-entities.js";
8
- import oe from "./TopNavItem.vue.js";
9
- import { useWorkspace as ae } from "../../store/store.js";
10
- const ne = { class: "mac:pl-[72px] t-app__top-nav relative flex h-10 pl-2" }, le = { class: "relative flex h-10 flex-1 items-center gap-1.5 overflow-hidden pr-2.5 text-sm font-medium" }, ie = {
1
+ import { defineComponent as O, reactive as W, ref as D, computed as L, watch as I, onMounted as K, onBeforeUnmount as q, openBlock as p, createElementBlock as g, createElementVNode as h, createVNode as r, unref as i, withCtx as m, createBlock as k, createCommentVNode as F, toDisplayString as H, createTextVNode as U, Fragment as G, renderList as J } from "vue";
2
+ import { ScalarContextMenu as P, ScalarIcon as C, ScalarFloating as Q, ScalarDropdownMenu as X, ScalarDropdownButton as A } from "@scalar/components";
3
+ import { LibraryIcon as Y } from "@scalar/icons";
4
+ import { useClipboard as Z } from "@scalar/use-hooks/useClipboard";
5
+ import { useRouter as ee } from "vue-router";
6
+ import te from "../ScalarHotkey.vue.js";
7
+ import { ROUTES as oe } from "../../constants.js";
8
+ import { useActiveEntities as le } from "../../store/active-entities.js";
9
+ import ae from "./TopNavItem.vue.js";
10
+ import { useWorkspace as ne } from "../../store/store.js";
11
+ const ie = { class: "mac:pl-[72px] t-app__top-nav relative flex h-10 pl-2" }, se = { class: "relative flex h-10 flex-1 items-center gap-1.5 overflow-hidden pr-2.5 text-sm font-medium" }, re = {
11
12
  key: 0,
12
13
  class: "h-full w-full overflow-hidden"
13
- }, he = /* @__PURE__ */ j({
14
+ }, ge = /* @__PURE__ */ O({
14
15
  __name: "TopNav",
15
16
  props: {
16
17
  openNewTab: {}
17
18
  },
18
- setup(L) {
19
- const U = L, { activeRequest: A, activeCollection: E } = te(), c = Y(), { events: g } = ae(), { copyToClipboard: M } = X(), t = z([{ label: "", path: "", icon: "Add" }]), a = O(0), T = W(() => a.value);
20
- function k() {
21
- var o, n, l, i, x;
22
- if ((o = c.currentRoute.value.name) != null && o.toString().startsWith("collection.")) {
19
+ setup(E) {
20
+ const M = E, { activeRequest: $, activeCollection: v } = le(), c = ee(), { events: T } = ne(), { copyToClipboard: z } = Z(), t = W([
21
+ {
22
+ label: "",
23
+ path: "",
24
+ icon: "Add",
25
+ isCollection: !1
26
+ }
27
+ ]), a = D(0), y = L(() => a.value), N = L(() => {
28
+ var e;
29
+ return (e = c.currentRoute.value.name) == null ? void 0 : e.toString().startsWith("collection.");
30
+ });
31
+ function x() {
32
+ var o, l, n, u, s;
33
+ if (N.value) {
23
34
  t[a.value] = {
24
- label: ((l = (n = E.value) == null ? void 0 : n.info) == null ? void 0 : l.title) || "Untitled Collection",
35
+ label: ((l = (o = v.value) == null ? void 0 : o.info) == null ? void 0 : l.title) || "Untitled Collection",
25
36
  path: c.currentRoute.value.path,
26
- icon: "Collection"
37
+ icon: ((n = v.value) == null ? void 0 : n["x-scalar-icon"]) || "Collection",
38
+ isCollection: !0
27
39
  };
28
40
  return;
29
41
  }
30
- if ((i = c.currentRoute.value.name) != null && i.toString().startsWith("request")) {
42
+ if ((u = c.currentRoute.value.name) != null && u.toString().startsWith("request")) {
31
43
  t[a.value] = {
32
- label: ((x = A.value) == null ? void 0 : x.summary) || "",
44
+ label: ((s = $.value) == null ? void 0 : s.summary) || "",
33
45
  path: c.currentRoute.value.path,
34
- icon: "ExternalLink"
46
+ icon: "ExternalLink",
47
+ isCollection: !1
35
48
  };
36
49
  return;
37
50
  }
38
- const e = ee.find((V) => {
39
- var w;
40
- return V.to.name.startsWith(
41
- ((w = c.currentRoute.value.name) == null ? void 0 : w.toString()) ?? ""
51
+ const e = oe.find((j) => {
52
+ var S;
53
+ return j.to.name.startsWith(
54
+ ((S = c.currentRoute.value.name) == null ? void 0 : S.toString()) ?? ""
42
55
  );
43
56
  });
44
57
  if (e) {
45
58
  t[a.value] = {
46
59
  label: e.displayName,
47
60
  path: c.currentRoute.value.path,
48
- icon: e.icon
61
+ icon: e.icon,
62
+ isCollection: !1
49
63
  };
50
64
  return;
51
65
  }
52
66
  }
53
- function h() {
67
+ function b() {
54
68
  var o;
55
69
  const e = (o = t[a.value]) == null ? void 0 : o.path;
56
70
  e && c.push(e);
57
71
  }
58
- function f() {
59
- t.push({ label: "", path: "", icon: "Add" }), a.value = t.length - 1, k();
72
+ function d() {
73
+ t.push({
74
+ label: "",
75
+ path: "",
76
+ icon: "Add",
77
+ isCollection: !1
78
+ }), a.value = t.length - 1, x();
60
79
  }
61
- function p(e) {
62
- a.value = e, h();
80
+ function f(e) {
81
+ a.value = e, b();
63
82
  }
64
- R(
83
+ I(
65
84
  () => c.currentRoute.value.path,
66
85
  () => {
67
- k();
86
+ x();
68
87
  },
69
88
  { immediate: !0 }
70
89
  );
71
- function C(e) {
90
+ function w(e) {
72
91
  t.splice(e, 1), a.value = Math.min(
73
92
  a.value,
74
93
  t.length - 1
75
- ), h();
94
+ ), b();
76
95
  }
77
- const N = (e) => {
78
- var n;
79
- if (!((n = t[e]) != null && n.path)) return;
96
+ const R = (e) => {
97
+ var l;
98
+ if (!((l = t[e]) != null && l.path)) return;
80
99
  const o = new URL(window.location.href);
81
- o.pathname = t[e].path, M(o.toString());
82
- }, $ = (e) => {
83
- t.splice(0, e), t.splice(1), a.value = 0, h();
84
- }, y = (e) => {
100
+ o.pathname = t[e].path, z(o.toString());
101
+ }, B = (e) => {
102
+ t.splice(0, e), t.splice(1), a.value = 0, b();
103
+ }, _ = (e) => {
85
104
  if (e) {
86
- if (e.addTopNav && f(), e.closeTopNav && C(a.value), e.navigateTopNavLeft && p(Math.max(a.value - 1, 0)), e.navigateTopNavRight && p(Math.min(a.value + 1, t.length - 1)), e.jumpToTab) {
105
+ if (e.addTopNav && d(), e.closeTopNav && w(a.value), e.navigateTopNavLeft && f(Math.max(a.value - 1, 0)), e.navigateTopNavRight && f(Math.min(a.value + 1, t.length - 1)), e.jumpToTab) {
87
106
  const o = Number(e.jumpToTab.key) - 1;
88
- o >= 0 && o < t.length && p(o);
107
+ o >= 0 && o < t.length && f(o);
89
108
  }
90
- e.jumpToLastTab && p(t.length - 1);
109
+ e.jumpToLastTab && f(t.length - 1);
91
110
  }
92
- }, B = (e) => {
111
+ }, V = (e) => {
93
112
  t.push({
94
113
  label: e.name,
95
114
  path: e.uid,
96
- icon: "ExternalLink"
115
+ icon: "ExternalLink",
116
+ isCollection: !1
97
117
  });
98
118
  };
99
- return R(
100
- () => U.openNewTab,
119
+ return I(
120
+ () => M.openNewTab,
101
121
  (e) => {
102
- e && B(e);
122
+ e && V(e);
103
123
  },
104
124
  { immediate: !0 }
105
- ), D(() => g.hotKeys.on(y)), K(() => g.hotKeys.off(y)), (e, o) => (m(), b("nav", ne, [
106
- o[3] || (o[3] = v("div", { class: "app-drag-region absolute inset-0" }, null, -1)),
107
- v("div", le, [
108
- t.length === 1 ? (m(), b("div", ie, [
109
- r(s(J), { triggerClass: "flex custom-scroll gap-1.5 h-full items-center justify-center w-full whitespace-nowrap" }, {
110
- trigger: u(() => {
111
- var n, l, i;
125
+ ), K(() => T.hotKeys.on(_)), q(() => T.hotKeys.off(_)), (e, o) => (p(), g("nav", ie, [
126
+ o[3] || (o[3] = h("div", { class: "app-drag-region absolute inset-0" }, null, -1)),
127
+ h("div", se, [
128
+ t.length === 1 ? (p(), g("div", re, [
129
+ r(i(P), { triggerClass: "flex custom-scroll gap-1.5 h-full items-center justify-center w-full whitespace-nowrap" }, {
130
+ trigger: m(() => {
131
+ var l, n, u, s;
112
132
  return [
113
- (n = t[0]) != null && n.icon ? (m(), _(s(d), {
133
+ N.value ? (p(), k(i(Y), {
114
134
  key: 0,
115
- icon: (l = t[0]) == null ? void 0 : l.icon,
135
+ class: "size-3.5 min-w-3.5 stroke-2",
136
+ src: ((l = i(v)) == null ? void 0 : l["x-scalar-icon"]) || "Collection"
137
+ }, null, 8, ["src"])) : (n = t[0]) != null && n.icon ? (p(), k(i(C), {
138
+ key: 1,
139
+ icon: (u = t[0]) == null ? void 0 : u.icon,
116
140
  size: "xs",
117
141
  thickness: "2.5"
118
- }, null, 8, ["icon"])) : q("", !0),
119
- v("span", null, F((i = t[0]) == null ? void 0 : i.label), 1)
142
+ }, null, 8, ["icon"])) : F("", !0),
143
+ h("span", null, H((s = t[0]) == null ? void 0 : s.label), 1)
120
144
  ];
121
145
  }),
122
- content: u(() => [
123
- r(s(P), { placement: "right-start" }, {
124
- floating: u(() => [
125
- r(s(Q), { class: "scalar-app scalar-client" }, {
126
- default: u(() => [
127
- r(s(I), {
146
+ content: m(() => [
147
+ r(i(Q), { placement: "right-start" }, {
148
+ floating: m(() => [
149
+ r(i(X), { class: "scalar-app scalar-client" }, {
150
+ default: m(() => [
151
+ r(i(A), {
128
152
  class: "flex items-center gap-1.5",
129
- onClick: f
153
+ onClick: d
130
154
  }, {
131
- default: u(() => [
132
- r(s(d), {
155
+ default: m(() => [
156
+ r(i(C), {
133
157
  icon: "AddTab",
134
158
  size: "sm",
135
159
  thickness: "1.5"
136
160
  }),
137
- o[1] || (o[1] = S(" New Tab ")),
138
- r(Z, {
161
+ o[1] || (o[1] = U(" New Tab ")),
162
+ r(te, {
139
163
  class: "bg-b-2 ml-auto",
140
164
  hotkey: "T"
141
165
  })
142
166
  ]),
143
167
  _: 1
144
168
  }),
145
- r(s(I), {
169
+ r(i(A), {
146
170
  class: "flex items-center gap-1.5",
147
- onClick: o[0] || (o[0] = (n) => N(T.value))
171
+ onClick: o[0] || (o[0] = (l) => R(y.value))
148
172
  }, {
149
- default: u(() => [
150
- r(s(d), {
173
+ default: m(() => [
174
+ r(i(C), {
151
175
  icon: "Link",
152
176
  size: "sm",
153
177
  thickness: "1.5"
154
178
  }),
155
- o[2] || (o[2] = S(" Copy URL "))
179
+ o[2] || (o[2] = U(" Copy URL "))
156
180
  ]),
157
181
  _: 1
158
182
  })
@@ -165,26 +189,30 @@ const ne = { class: "mac:pl-[72px] t-app__top-nav relative flex h-10 pl-2" }, le
165
189
  ]),
166
190
  _: 1
167
191
  })
168
- ])) : (m(!0), b(H, { key: 1 }, G(t, (n, l) => (m(), _(oe, {
169
- key: n.path,
170
- active: l === T.value,
171
- hotkey: (l + 1).toString(),
172
- icon: n.icon,
173
- label: n.label,
174
- onClick: (i) => p(l),
175
- onClose: (i) => C(l),
176
- onCloseOtherTabs: (i) => $(l),
177
- onCopyUrl: (i) => N(l),
178
- onNewTab: f
179
- }, null, 8, ["active", "hotkey", "icon", "label", "onClick", "onClose", "onCloseOtherTabs", "onCopyUrl"]))), 128)),
180
- v("button", {
192
+ ])) : (p(!0), g(G, { key: 1 }, J(t, (l, n) => {
193
+ var u;
194
+ return p(), k(ae, {
195
+ key: l.path,
196
+ active: n === y.value,
197
+ hotkey: (n + 1).toString(),
198
+ icon: l.isCollection ? ((u = i(v)) == null ? void 0 : u["x-scalar-icon"]) || "Collection" : l.icon,
199
+ label: l.label,
200
+ isCollection: l.isCollection || !1,
201
+ onClick: (s) => f(n),
202
+ onClose: (s) => w(n),
203
+ onCloseOtherTabs: (s) => B(n),
204
+ onCopyUrl: (s) => R(n),
205
+ onNewTab: d
206
+ }, null, 8, ["active", "hotkey", "icon", "label", "isCollection", "onClick", "onClose", "onCloseOtherTabs", "onCopyUrl"]);
207
+ }), 128)),
208
+ h("button", {
181
209
  class: "text-c-3 hover:bg-b-3 app-no-drag-region rounded p-1.5",
182
210
  type: "button",
183
- onClick: f
211
+ onClick: d
184
212
  }, [
185
- r(s(d), {
213
+ r(i(C), {
186
214
  icon: "Add",
187
- size: "xs",
215
+ size: "sm",
188
216
  thickness: "2.5"
189
217
  })
190
218
  ])
@@ -193,5 +221,5 @@ const ne = { class: "mac:pl-[72px] t-app__top-nav relative flex h-10 pl-2" }, le
193
221
  }
194
222
  });
195
223
  export {
196
- he as default
224
+ ge as default
197
225
  };
@@ -4,6 +4,7 @@ type __VLS_Props = {
4
4
  active: boolean;
5
5
  label: string;
6
6
  icon: Icon;
7
+ isCollection?: boolean;
7
8
  };
8
9
  declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
9
10
  click: () => any;
@@ -1 +1 @@
1
- {"version":3,"file":"TopNavItem.vue.d.ts","sourceRoot":"","sources":["../../../src/components/TopNav/TopNavItem.vue"],"names":[],"mappings":"AAwMA,OAAO,EAQL,KAAK,IAAI,EACV,MAAM,oBAAoB,CAAA;AAM3B,KAAK,WAAW,GAAG;IACjB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,OAAO,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,IAAI,CAAA;CACX,CAAC;;;;;;;;;;;;;;AA2UF,wBAQG"}
1
+ {"version":3,"file":"TopNavItem.vue.d.ts","sourceRoot":"","sources":["../../../src/components/TopNav/TopNavItem.vue"],"names":[],"mappings":"AA+MA,OAAO,EAQL,KAAK,IAAI,EACV,MAAM,oBAAoB,CAAA;AAO3B,KAAK,WAAW,GAAG;IACjB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,OAAO,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,IAAI,CAAA;IACV,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB,CAAC;;;;;;;;;;;;;;AAyVF,wBAQG"}
@@ -1,7 +1,7 @@
1
1
  import o from "./TopNavItem.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-220e0e29"]]);
4
+ const r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-3f2a2c71"]]);
5
5
  export {
6
6
  r as default
7
7
  };
@@ -1,19 +1,21 @@
1
- import { defineComponent as f, openBlock as p, createBlock as d, unref as s, withCtx as l, createVNode as t, createElementVNode as a, normalizeClass as k, toDisplayString as u, createCommentVNode as g, createTextVNode as r } from "vue";
2
- import { ScalarContextMenu as b, ScalarTooltip as v, ScalarIcon as n, ScalarFloating as C, ScalarDropdownMenu as y, ScalarDropdownButton as m, ScalarDropdownDivider as T } from "@scalar/components";
3
- import c from "../ScalarHotkey.vue.js";
4
- const $ = { class: "nav-item-icon-copy flex flex-1 items-center justify-center gap-1.5" }, w = { class: "custom-scroll nav-item-copy text-xs" }, B = /* @__PURE__ */ f({
1
+ import { defineComponent as d, openBlock as a, createBlock as r, unref as t, withCtx as l, createVNode as o, createElementVNode as c, normalizeClass as f, toDisplayString as u, createCommentVNode as g, createTextVNode as m } from "vue";
2
+ import { ScalarContextMenu as y, ScalarTooltip as C, ScalarIcon as n, ScalarFloating as b, ScalarDropdownMenu as v, ScalarDropdownButton as p, ScalarDropdownDivider as T } from "@scalar/components";
3
+ import { LibraryIcon as $ } from "@scalar/icons";
4
+ import k from "../ScalarHotkey.vue.js";
5
+ const w = { class: "nav-item-icon-copy flex flex-1 items-center justify-center gap-1.5" }, z = { class: "custom-scroll nav-item-copy text-xs" }, V = /* @__PURE__ */ d({
5
6
  __name: "TopNavItem",
6
7
  props: {
7
8
  hotkey: {},
8
9
  active: { type: Boolean },
9
10
  label: {},
10
- icon: {}
11
+ icon: {},
12
+ isCollection: { type: Boolean }
11
13
  },
12
14
  emits: ["click", "close", "newTab", "copyUrl", "closeOtherTabs"],
13
15
  setup(S) {
14
- return (o, e) => (p(), d(s(b), { triggerClass: "overflow-hidden w-full" }, {
16
+ return (s, e) => (a(), r(t(y), { triggerClass: "overflow-hidden w-full" }, {
15
17
  trigger: l(() => [
16
- t(s(v), {
18
+ o(t(C), {
17
19
  class: "scalar-client",
18
20
  delay: 500,
19
21
  disableClosingTrigger: !0,
@@ -21,24 +23,29 @@ const $ = { class: "nav-item-icon-copy flex flex-1 items-center justify-center g
21
23
  sideOffset: 4
22
24
  }, {
23
25
  trigger: l(() => [
24
- a("div", {
25
- class: k(["nav-item app-no-drag-region", { "nav-item__active": o.active }]),
26
- onClick: e[1] || (e[1] = (i) => o.$emit("click"))
26
+ c("div", {
27
+ class: f(["nav-item app-no-drag-region", { "nav-item__active": s.active }]),
28
+ onClick: e[1] || (e[1] = (i) => s.$emit("click"))
27
29
  }, [
28
- a("div", $, [
29
- t(s(n), {
30
- icon: o.icon,
30
+ c("div", w, [
31
+ s.isCollection ? (a(), r(t($), {
32
+ key: 0,
33
+ class: "size-3.5 min-w-3.5 stroke-2",
34
+ src: s.icon
35
+ }, null, 8, ["src"])) : (a(), r(t(n), {
36
+ key: 1,
37
+ icon: s.icon,
31
38
  size: "xs",
32
39
  thickness: "2.5"
33
- }, null, 8, ["icon"]),
34
- a("span", w, u(o.label), 1)
40
+ }, null, 8, ["icon"])),
41
+ c("span", z, u(s.label), 1)
35
42
  ]),
36
- a("button", {
43
+ c("button", {
37
44
  class: "nav-item-close",
38
45
  type: "button",
39
- onClick: e[0] || (e[0] = (i) => o.$emit("close"))
46
+ onClick: e[0] || (e[0] = (i) => s.$emit("close"))
40
47
  }, [
41
- t(s(n), {
48
+ o(t(n), {
42
49
  icon: "Close",
43
50
  thickness: "1.75"
44
51
  })
@@ -46,81 +53,81 @@ const $ = { class: "nav-item-icon-copy flex flex-1 items-center justify-center g
46
53
  ], 2)
47
54
  ]),
48
55
  content: l(() => [
49
- o.hotkey ? (p(), d(c, {
56
+ s.hotkey ? (a(), r(k, {
50
57
  key: 0,
51
- hotkey: o.hotkey
58
+ hotkey: s.hotkey
52
59
  }, null, 8, ["hotkey"])) : g("", !0)
53
60
  ]),
54
61
  _: 1
55
62
  })
56
63
  ]),
57
64
  content: l(() => [
58
- t(s(C), { placement: "right-start" }, {
65
+ o(t(b), { placement: "right-start" }, {
59
66
  floating: l(() => [
60
- t(s(y), { class: "scalar-app scalar-client" }, {
67
+ o(t(v), { class: "scalar-app scalar-client" }, {
61
68
  default: l(() => [
62
- t(s(m), {
69
+ o(t(p), {
63
70
  class: "flex items-center gap-1.5",
64
- onClick: e[2] || (e[2] = (i) => o.$emit("newTab"))
71
+ onClick: e[2] || (e[2] = (i) => s.$emit("newTab"))
65
72
  }, {
66
73
  default: l(() => [
67
- t(s(n), {
74
+ o(t(n), {
68
75
  icon: "AddTab",
69
76
  size: "sm",
70
77
  thickness: "1.5"
71
78
  }),
72
- e[6] || (e[6] = r(" New Tab ")),
73
- t(c, {
79
+ e[6] || (e[6] = m(" New Tab ")),
80
+ o(k, {
74
81
  class: "bg-b-2 ml-auto",
75
82
  hotkey: "T"
76
83
  })
77
84
  ]),
78
85
  _: 1
79
86
  }),
80
- t(s(m), {
87
+ o(t(p), {
81
88
  class: "flex items-center gap-1.5",
82
- onClick: e[3] || (e[3] = (i) => o.$emit("copyUrl"))
89
+ onClick: e[3] || (e[3] = (i) => s.$emit("copyUrl"))
83
90
  }, {
84
91
  default: l(() => [
85
- t(s(n), {
92
+ o(t(n), {
86
93
  icon: "Link",
87
94
  size: "sm",
88
95
  thickness: "1.5"
89
96
  }),
90
- e[7] || (e[7] = r(" Copy URL "))
97
+ e[7] || (e[7] = m(" Copy URL "))
91
98
  ]),
92
99
  _: 1
93
100
  }),
94
- t(s(T)),
95
- t(s(m), {
101
+ o(t(T)),
102
+ o(t(p), {
96
103
  class: "flex items-center gap-1.5",
97
- onClick: e[4] || (e[4] = (i) => o.$emit("close"))
104
+ onClick: e[4] || (e[4] = (i) => s.$emit("close"))
98
105
  }, {
99
106
  default: l(() => [
100
- t(s(n), {
107
+ o(t(n), {
101
108
  icon: "CloseTab",
102
109
  size: "sm",
103
110
  thickness: "1.5"
104
111
  }),
105
- e[8] || (e[8] = r(" Close Tab ")),
106
- t(c, {
112
+ e[8] || (e[8] = m(" Close Tab ")),
113
+ o(k, {
107
114
  class: "bg-b-2 ml-auto",
108
115
  hotkey: "W"
109
116
  })
110
117
  ]),
111
118
  _: 1
112
119
  }),
113
- t(s(m), {
120
+ o(t(p), {
114
121
  class: "flex items-center gap-1.5",
115
- onClick: e[5] || (e[5] = (i) => o.$emit("closeOtherTabs"))
122
+ onClick: e[5] || (e[5] = (i) => s.$emit("closeOtherTabs"))
116
123
  }, {
117
124
  default: l(() => [
118
- t(s(n), {
125
+ o(t(n), {
119
126
  icon: "CloseTabs",
120
127
  size: "sm",
121
128
  thickness: "1.5"
122
129
  }),
123
- e[9] || (e[9] = r(" Close Other Tabs "))
130
+ e[9] || (e[9] = m(" Close Other Tabs "))
124
131
  ]),
125
132
  _: 1
126
133
  })
@@ -136,5 +143,5 @@ const $ = { class: "nav-item-icon-copy flex flex-1 items-center justify-center g
136
143
  }
137
144
  });
138
145
  export {
139
- B as default
146
+ V as default
140
147
  };