@scalar/api-client 2.2.54 → 2.2.55
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.
- package/CHANGELOG.md +18 -0
- package/dist/components/CommandPalette/CommandActionForm.vue.d.ts +1 -1
- package/dist/components/CommandPalette/CommandActionForm.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandActionForm.vue.js +15 -14
- package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteImport.vue.js +121 -106
- package/dist/components/{ImportCurl/ImportCurlModal.vue.d.ts → CommandPalette/CommandPaletteImportCurl.vue.d.ts} +9 -17
- package/dist/components/CommandPalette/CommandPaletteImportCurl.vue.d.ts.map +1 -0
- package/dist/components/CommandPalette/CommandPaletteImportCurl.vue.js +7 -0
- package/dist/components/CommandPalette/CommandPaletteImportCurl.vue2.js +141 -0
- package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts +98 -1
- package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/TheCommandPalette.vue.js +2 -2
- package/dist/components/CommandPalette/TheCommandPalette.vue2.js +128 -113
- package/dist/components/HttpMethod/HttpMethod.vue.d.ts +2 -2
- package/dist/components/OpenApiClientButton.vue.d.ts.map +1 -1
- package/dist/components/OpenApiClientButton.vue.js +2 -2
- package/dist/components/TopNav/TopNav.vue.d.ts.map +1 -1
- package/dist/components/TopNav/TopNav.vue.js +122 -94
- package/dist/components/TopNav/TopNavItem.vue.d.ts +1 -0
- package/dist/components/TopNav/TopNavItem.vue.d.ts.map +1 -1
- package/dist/components/TopNav/TopNavItem.vue.js +1 -1
- package/dist/components/TopNav/TopNavItem.vue2.js +49 -42
- package/dist/layouts/App/create-api-client-app.d.ts +12 -12
- package/dist/layouts/Modal/ApiClientModal.vue.d.ts.map +1 -1
- package/dist/layouts/Modal/ApiClientModal.vue.js +2 -2
- package/dist/layouts/Modal/create-api-client-modal.d.ts +24 -24
- package/dist/layouts/Web/create-api-client-web.d.ts +12 -12
- package/dist/libs/create-client.d.ts +12 -12
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/libs/create-client.js +91 -115
- package/dist/libs/get-request-uid-by-path-method.d.ts +7 -0
- package/dist/libs/get-request-uid-by-path-method.d.ts.map +1 -0
- package/dist/libs/get-request-uid-by-path-method.js +10 -0
- package/dist/libs/get-request-uid-by-path-method.test.d.ts +2 -0
- package/dist/libs/get-request-uid-by-path-method.test.d.ts.map +1 -0
- package/dist/libs/send-request/create-fetch-body.d.ts +1 -1
- package/dist/libs/validate-parameters.d.ts +6 -0
- package/dist/libs/validate-parameters.d.ts.map +1 -0
- package/dist/libs/validate-parameters.js +12 -0
- package/dist/libs/validate-parameters.test.d.ts +2 -0
- package/dist/libs/validate-parameters.test.d.ts.map +1 -0
- package/dist/store/cookies.d.ts +4 -4
- package/dist/store/request-example.d.ts +4 -4
- package/dist/store/requests.d.ts +4 -4
- package/dist/store/store.d.ts +12 -12
- package/dist/style.css +1 -1
- package/dist/views/Request/Request.vue.d.ts +6 -3
- package/dist/views/Request/Request.vue.d.ts.map +1 -1
- package/dist/views/Request/Request.vue.js +2 -2
- package/dist/views/Request/Request.vue2.js +96 -145
- package/dist/views/Request/RequestRoot.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestRoot.vue.js +2 -2
- package/dist/views/Request/RequestRoot.vue2.js +68 -57
- package/dist/views/Request/RequestSection/RequestParams.vue.d.ts +1 -0
- package/dist/views/Request/RequestSection/RequestParams.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestParams.vue.js +34 -31
- package/dist/views/Request/RequestSection/RequestPathParams.vue.d.ts +1 -0
- package/dist/views/Request/RequestSection/RequestPathParams.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestPathParams.vue.js +35 -33
- package/dist/views/Request/RequestSection/RequestSection.vue.d.ts +1 -0
- package/dist/views/Request/RequestSection/RequestSection.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestSection.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestSection.vue2.js +59 -54
- package/dist/views/Request/RequestSection/RequestTable.vue.d.ts +1 -0
- package/dist/views/Request/RequestSection/RequestTable.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestTable.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestTable.vue2.js +29 -27
- package/dist/views/Request/RequestSidebar.vue.js +2 -2
- package/dist/views/Request/RequestSidebar.vue2.js +23 -23
- package/dist/views/Request/RequestSubpageHeader.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSubpageHeader.vue.js +2 -2
- package/dist/views/Request/RequestSubpageHeader.vue2.js +4 -4
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/dist/views/Request/libs/request.js +1 -2
- package/package.json +13 -13
- package/dist/components/ImportCurl/ImportCurlModal.vue.d.ts.map +0 -1
- package/dist/components/ImportCurl/ImportCurlModal.vue.js +0 -7
- package/dist/components/ImportCurl/ImportCurlModal.vue2.js +0 -125
|
@@ -1,158 +1,182 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarContextMenu as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
|
|
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
|
-
},
|
|
14
|
+
}, ge = /* @__PURE__ */ O({
|
|
14
15
|
__name: "TopNav",
|
|
15
16
|
props: {
|
|
16
17
|
openNewTab: {}
|
|
17
18
|
},
|
|
18
|
-
setup(
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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 = (
|
|
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 ((
|
|
42
|
+
if ((u = c.currentRoute.value.name) != null && u.toString().startsWith("request")) {
|
|
31
43
|
t[a.value] = {
|
|
32
|
-
label: ((
|
|
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 =
|
|
39
|
-
var
|
|
40
|
-
return
|
|
41
|
-
((
|
|
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
|
|
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
|
|
59
|
-
t.push({
|
|
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
|
|
62
|
-
a.value = e,
|
|
80
|
+
function f(e) {
|
|
81
|
+
a.value = e, b();
|
|
63
82
|
}
|
|
64
|
-
|
|
83
|
+
I(
|
|
65
84
|
() => c.currentRoute.value.path,
|
|
66
85
|
() => {
|
|
67
|
-
|
|
86
|
+
x();
|
|
68
87
|
},
|
|
69
88
|
{ immediate: !0 }
|
|
70
89
|
);
|
|
71
|
-
function
|
|
90
|
+
function w(e) {
|
|
72
91
|
t.splice(e, 1), a.value = Math.min(
|
|
73
92
|
a.value,
|
|
74
93
|
t.length - 1
|
|
75
|
-
),
|
|
94
|
+
), b();
|
|
76
95
|
}
|
|
77
|
-
const
|
|
78
|
-
var
|
|
79
|
-
if (!((
|
|
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,
|
|
82
|
-
},
|
|
83
|
-
t.splice(0, e), t.splice(1), a.value = 0,
|
|
84
|
-
},
|
|
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 &&
|
|
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 &&
|
|
107
|
+
o >= 0 && o < t.length && f(o);
|
|
89
108
|
}
|
|
90
|
-
e.jumpToLastTab &&
|
|
109
|
+
e.jumpToLastTab && f(t.length - 1);
|
|
91
110
|
}
|
|
92
|
-
},
|
|
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
|
|
100
|
-
() =>
|
|
119
|
+
return I(
|
|
120
|
+
() => M.openNewTab,
|
|
101
121
|
(e) => {
|
|
102
|
-
e &&
|
|
122
|
+
e && V(e);
|
|
103
123
|
},
|
|
104
124
|
{ immediate: !0 }
|
|
105
|
-
),
|
|
106
|
-
o[3] || (o[3] =
|
|
107
|
-
|
|
108
|
-
t.length === 1 ? (
|
|
109
|
-
r(
|
|
110
|
-
trigger:
|
|
111
|
-
var n,
|
|
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
|
-
|
|
133
|
+
N.value ? (p(), k(i(Y), {
|
|
114
134
|
key: 0,
|
|
115
|
-
|
|
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"])) :
|
|
119
|
-
|
|
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:
|
|
123
|
-
r(
|
|
124
|
-
floating:
|
|
125
|
-
r(
|
|
126
|
-
default:
|
|
127
|
-
r(
|
|
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:
|
|
153
|
+
onClick: d
|
|
130
154
|
}, {
|
|
131
|
-
default:
|
|
132
|
-
r(
|
|
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] =
|
|
138
|
-
r(
|
|
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(
|
|
169
|
+
r(i(A), {
|
|
146
170
|
class: "flex items-center gap-1.5",
|
|
147
|
-
onClick: o[0] || (o[0] = (
|
|
171
|
+
onClick: o[0] || (o[0] = (l) => R(y.value))
|
|
148
172
|
}, {
|
|
149
|
-
default:
|
|
150
|
-
r(
|
|
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] =
|
|
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
|
-
])) : (
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
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:
|
|
211
|
+
onClick: d
|
|
184
212
|
}, [
|
|
185
|
-
r(
|
|
213
|
+
r(i(C), {
|
|
186
214
|
icon: "Add",
|
|
187
|
-
size: "
|
|
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
|
-
|
|
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":"
|
|
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-
|
|
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
|
|
2
|
-
import { ScalarContextMenu as
|
|
3
|
-
import
|
|
4
|
-
|
|
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 (
|
|
16
|
+
return (s, e) => (a(), r(t(y), { triggerClass: "overflow-hidden w-full" }, {
|
|
15
17
|
trigger: l(() => [
|
|
16
|
-
t(
|
|
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
|
-
|
|
25
|
-
class:
|
|
26
|
-
onClick: e[1] || (e[1] = (i) =>
|
|
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
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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
|
-
|
|
40
|
+
}, null, 8, ["icon"])),
|
|
41
|
+
c("span", z, u(s.label), 1)
|
|
35
42
|
]),
|
|
36
|
-
|
|
43
|
+
c("button", {
|
|
37
44
|
class: "nav-item-close",
|
|
38
45
|
type: "button",
|
|
39
|
-
onClick: e[0] || (e[0] = (i) =>
|
|
46
|
+
onClick: e[0] || (e[0] = (i) => s.$emit("close"))
|
|
40
47
|
}, [
|
|
41
|
-
t(
|
|
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
|
-
|
|
56
|
+
s.hotkey ? (a(), r(k, {
|
|
50
57
|
key: 0,
|
|
51
|
-
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(
|
|
65
|
+
o(t(b), { placement: "right-start" }, {
|
|
59
66
|
floating: l(() => [
|
|
60
|
-
t(
|
|
67
|
+
o(t(v), { class: "scalar-app scalar-client" }, {
|
|
61
68
|
default: l(() => [
|
|
62
|
-
t(
|
|
69
|
+
o(t(p), {
|
|
63
70
|
class: "flex items-center gap-1.5",
|
|
64
|
-
onClick: e[2] || (e[2] = (i) =>
|
|
71
|
+
onClick: e[2] || (e[2] = (i) => s.$emit("newTab"))
|
|
65
72
|
}, {
|
|
66
73
|
default: l(() => [
|
|
67
|
-
t(
|
|
74
|
+
o(t(n), {
|
|
68
75
|
icon: "AddTab",
|
|
69
76
|
size: "sm",
|
|
70
77
|
thickness: "1.5"
|
|
71
78
|
}),
|
|
72
|
-
e[6] || (e[6] =
|
|
73
|
-
|
|
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(
|
|
87
|
+
o(t(p), {
|
|
81
88
|
class: "flex items-center gap-1.5",
|
|
82
|
-
onClick: e[3] || (e[3] = (i) =>
|
|
89
|
+
onClick: e[3] || (e[3] = (i) => s.$emit("copyUrl"))
|
|
83
90
|
}, {
|
|
84
91
|
default: l(() => [
|
|
85
|
-
t(
|
|
92
|
+
o(t(n), {
|
|
86
93
|
icon: "Link",
|
|
87
94
|
size: "sm",
|
|
88
95
|
thickness: "1.5"
|
|
89
96
|
}),
|
|
90
|
-
e[7] || (e[7] =
|
|
97
|
+
e[7] || (e[7] = m(" Copy URL "))
|
|
91
98
|
]),
|
|
92
99
|
_: 1
|
|
93
100
|
}),
|
|
94
|
-
t(
|
|
95
|
-
t(
|
|
101
|
+
o(t(T)),
|
|
102
|
+
o(t(p), {
|
|
96
103
|
class: "flex items-center gap-1.5",
|
|
97
|
-
onClick: e[4] || (e[4] = (i) =>
|
|
104
|
+
onClick: e[4] || (e[4] = (i) => s.$emit("close"))
|
|
98
105
|
}, {
|
|
99
106
|
default: l(() => [
|
|
100
|
-
t(
|
|
107
|
+
o(t(n), {
|
|
101
108
|
icon: "CloseTab",
|
|
102
109
|
size: "sm",
|
|
103
110
|
thickness: "1.5"
|
|
104
111
|
}),
|
|
105
|
-
e[8] || (e[8] =
|
|
106
|
-
|
|
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(
|
|
120
|
+
o(t(p), {
|
|
114
121
|
class: "flex items-center gap-1.5",
|
|
115
|
-
onClick: e[5] || (e[5] = (i) =>
|
|
122
|
+
onClick: e[5] || (e[5] = (i) => s.$emit("closeOtherTabs"))
|
|
116
123
|
}, {
|
|
117
124
|
default: l(() => [
|
|
118
|
-
t(
|
|
125
|
+
o(t(n), {
|
|
119
126
|
icon: "CloseTabs",
|
|
120
127
|
size: "sm",
|
|
121
128
|
thickness: "1.5"
|
|
122
129
|
}),
|
|
123
|
-
e[9] || (e[9] =
|
|
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
|
-
|
|
146
|
+
V as default
|
|
140
147
|
};
|