@scalar/api-client 2.2.3 → 2.2.4
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 +26 -0
- package/dist/components/CommandPalette/CommandPaletteImport.vue.js +1 -1
- package/dist/components/CommandPalette/CommandPaletteRequest.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteRequest.vue.js +24 -24
- package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.d.ts.map +1 -1
- package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +36 -45
- package/dist/components/ImportCollection/ImportNowButton.vue.js +3 -3
- package/dist/components/TopNav/TopNav.vue.d.ts.map +1 -1
- package/dist/components/TopNav/TopNav.vue.js +72 -70
- 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 +83 -81
- package/dist/layouts/App/create-api-client-app.d.ts +2 -2
- package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
- package/dist/layouts/App/create-api-client-app.js +6 -6
- package/dist/layouts/Modal/create-api-client-modal.d.ts +4 -4
- package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
- package/dist/layouts/Modal/create-api-client-modal.js +1 -1
- package/dist/layouts/Web/create-api-client-web.d.ts +2 -2
- package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
- package/dist/layouts/Web/create-api-client-web.js +4 -4
- package/dist/libs/create-client.d.ts +4 -4
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/libs/create-client.js +5 -5
- package/dist/libs/index.d.ts +1 -2
- package/dist/libs/index.d.ts.map +1 -1
- package/dist/libs/index.js +20 -20
- package/dist/libs/send-request/index.d.ts +2 -0
- package/dist/libs/send-request/index.d.ts.map +1 -0
- package/dist/libs/send-request/index.js +9 -0
- package/dist/libs/{send-request.d.ts → send-request/send-request.d.ts} +6 -6
- package/dist/libs/send-request/send-request.d.ts.map +1 -0
- package/dist/libs/{send-request.js → send-request/send-request.js} +29 -29
- package/dist/store/events.d.ts +1 -1
- package/dist/store/import-spec.d.ts +1 -1
- package/dist/store/import-spec.d.ts.map +1 -1
- package/dist/store/import-spec.js +1 -1
- package/dist/store/store.d.ts +3 -3
- package/dist/store/store.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts.map +1 -1
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.js +76 -72
- package/dist/views/Request/Request.vue.js +1 -1
- package/dist/views/Request/Request.vue2.js +30 -30
- package/dist/views/Request/RequestSection/RequestBody.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestBody.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestBody.vue2.js +245 -189
- package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebarItem.vue.js +1 -1
- package/dist/views/Request/RequestSidebarItem.vue2.js +4 -4
- package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebarItemMenu.vue.js +3 -3
- package/dist/views/Request/RequestSidebarItemMenu.vue2.js +153 -147
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/dist/views/Request/components/WorkspaceDropdown.vue.d.ts.map +1 -1
- package/dist/views/Request/components/WorkspaceDropdown.vue.js +48 -54
- package/package.json +15 -10
- package/dist/libs/send-request.d.ts.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# @scalar/api-client
|
|
2
2
|
|
|
3
|
+
## 2.2.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- d08a7ae: feat(components): cleanup and extend floating components
|
|
8
|
+
- baaad1c: refactor: deprecated the `proxy` configuration attribute, and use `proxyUrl` everywhere
|
|
9
|
+
- 642d112: feat: adds request body example selector
|
|
10
|
+
- bae9997: refactor: move send-request lib to its own folder
|
|
11
|
+
- Updated dependencies [2dd6aa3]
|
|
12
|
+
- Updated dependencies [6389557]
|
|
13
|
+
- Updated dependencies [6389557]
|
|
14
|
+
- Updated dependencies [7605d6f]
|
|
15
|
+
- Updated dependencies [d08a7ae]
|
|
16
|
+
- Updated dependencies [baaad1c]
|
|
17
|
+
- Updated dependencies [c984ac8]
|
|
18
|
+
- Updated dependencies [7278742]
|
|
19
|
+
- Updated dependencies [3ca88dc]
|
|
20
|
+
- Updated dependencies [f6cd5ed]
|
|
21
|
+
- @scalar/components@0.13.0
|
|
22
|
+
- @scalar/import@0.2.0
|
|
23
|
+
- @scalar/oas-utils@0.2.82
|
|
24
|
+
- @scalar/types@0.0.22
|
|
25
|
+
- @scalar/use-codemirror@0.11.44
|
|
26
|
+
- @scalar/themes@0.9.53
|
|
27
|
+
- @scalar/use-hooks@0.1.6
|
|
28
|
+
|
|
3
29
|
## 2.2.3
|
|
4
30
|
|
|
5
31
|
### Patch Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommandPaletteRequest.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandPaletteRequest.vue"],"names":[],"mappings":"AAwMA,KAAK,WAAW,GAAG;IACjB,QAAQ,CAAC,EAAE;QACT,OAAO,EAAE,MAAM,CAAA;QACf,SAAS,EAAE,MAAM,CAAA;KAClB,CAAA;CACF,CAAC;;;;;;;;
|
|
1
|
+
{"version":3,"file":"CommandPaletteRequest.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandPaletteRequest.vue"],"names":[],"mappings":"AAwMA,KAAK,WAAW,GAAG;IACjB,QAAQ,CAAC,EAAE;QACT,OAAO,EAAE,MAAM,CAAA;QACf,SAAS,EAAE,MAAM,CAAA;KAClB,CAAA;CACF,CAAC;;;;;;;;AA2TF,wBAQG"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as P, ref as c, computed as
|
|
1
|
+
import { defineComponent as P, ref as c, computed as g, openBlock as C, createBlock as h, withCtx as u, createElementVNode as f, createVNode as i, unref as n, normalizeClass as q, toDisplayString as V, createCommentVNode as W, createTextVNode as j } from "vue";
|
|
2
2
|
import H from "../HttpMethod/HttpMethod.vue.js";
|
|
3
3
|
import { useActiveEntities as I } from "../../store/active-entities.js";
|
|
4
4
|
import { ScalarListbox as D, ScalarButton as k, ScalarIcon as w } from "@scalar/components";
|
|
@@ -8,7 +8,7 @@ import L from "./CommandActionForm.vue.js";
|
|
|
8
8
|
import O from "./CommandActionInput.vue.js";
|
|
9
9
|
import { isHTTPMethod as F } from "../HttpMethod/helpers.js";
|
|
10
10
|
import { useWorkspace as G } from "../../store/store.js";
|
|
11
|
-
const J = { class: "flex
|
|
11
|
+
const J = { class: "flex" }, se = /* @__PURE__ */ P({
|
|
12
12
|
__name: "CommandPaletteRequest",
|
|
13
13
|
props: {
|
|
14
14
|
metaData: {}
|
|
@@ -18,63 +18,63 @@ const J = { class: "flex gap-2" }, se = /* @__PURE__ */ P({
|
|
|
18
18
|
const r = S, b = _, { push: M } = A(), { toast: N } = $(), {
|
|
19
19
|
activeCollection: R,
|
|
20
20
|
activeWorkspace: U,
|
|
21
|
-
activeWorkspaceCollections:
|
|
21
|
+
activeWorkspaceCollections: x,
|
|
22
22
|
activeRequest: T
|
|
23
|
-
} = I(), { requestMutators: y, tags: z } = G(), o = c(""),
|
|
24
|
-
() =>
|
|
23
|
+
} = I(), { requestMutators: y, tags: z } = G(), o = c(""), m = c("get"), v = g(
|
|
24
|
+
() => x.value.map((t) => {
|
|
25
25
|
var e;
|
|
26
26
|
return {
|
|
27
27
|
id: t.uid,
|
|
28
28
|
label: ((e = t.info) == null ? void 0 : e.title) ?? "Unititled Collection"
|
|
29
29
|
};
|
|
30
30
|
})
|
|
31
|
-
),
|
|
32
|
-
() =>
|
|
31
|
+
), d = g(
|
|
32
|
+
() => x.value.flatMap(
|
|
33
33
|
(t) => {
|
|
34
34
|
var e;
|
|
35
35
|
return t.uid === ((e = l.value) == null ? void 0 : e.id) ? t.tags.flatMap((a) => {
|
|
36
|
-
const
|
|
37
|
-
return
|
|
36
|
+
const p = z[a];
|
|
37
|
+
return p ? [
|
|
38
38
|
{
|
|
39
|
-
id:
|
|
40
|
-
label:
|
|
39
|
+
id: p.uid,
|
|
40
|
+
label: p.name
|
|
41
41
|
}
|
|
42
42
|
] : [];
|
|
43
43
|
}) : [];
|
|
44
44
|
}
|
|
45
45
|
)
|
|
46
46
|
), l = c(
|
|
47
|
-
r.metaData ?
|
|
47
|
+
r.metaData ? v.value.find(
|
|
48
48
|
(t) => {
|
|
49
49
|
var e, a;
|
|
50
50
|
return t.id === ((e = r.metaData) == null ? void 0 : e.itemUid) || t.id === ((a = r.metaData) == null ? void 0 : a.parentUid);
|
|
51
51
|
}
|
|
52
|
-
) :
|
|
52
|
+
) : v.value.find(
|
|
53
53
|
(t) => {
|
|
54
54
|
var e;
|
|
55
55
|
return t.id === ((e = R.value) == null ? void 0 : e.uid);
|
|
56
56
|
}
|
|
57
57
|
)
|
|
58
58
|
), s = c(
|
|
59
|
-
r.metaData ?
|
|
59
|
+
r.metaData ? d.value.find((t) => {
|
|
60
60
|
var e;
|
|
61
61
|
return t.id === ((e = r.metaData) == null ? void 0 : e.itemUid);
|
|
62
|
-
}) :
|
|
62
|
+
}) : d.value.find((t) => {
|
|
63
63
|
var e, a;
|
|
64
64
|
return t.label === ((a = (e = T.value) == null ? void 0 : e.tags) == null ? void 0 : a[0]);
|
|
65
65
|
})
|
|
66
|
-
), B = (t) =>
|
|
66
|
+
), B = (t) => m.value = t, E = () => {
|
|
67
67
|
var e;
|
|
68
68
|
if (!o.value.trim()) {
|
|
69
69
|
N("Please enter a name before creating a request.", "error");
|
|
70
70
|
return;
|
|
71
71
|
}
|
|
72
|
-
if (!((e = l.value) != null && e.id) || !F(
|
|
72
|
+
if (!((e = l.value) != null && e.id) || !F(m.value))
|
|
73
73
|
return;
|
|
74
74
|
const t = y.add(
|
|
75
75
|
{
|
|
76
76
|
path: "",
|
|
77
|
-
method:
|
|
77
|
+
method: m.value,
|
|
78
78
|
description: o.value,
|
|
79
79
|
operationId: o.value,
|
|
80
80
|
summary: o.value,
|
|
@@ -99,17 +99,17 @@ const J = { class: "flex gap-2" }, se = /* @__PURE__ */ P({
|
|
|
99
99
|
i(H, {
|
|
100
100
|
isEditable: !0,
|
|
101
101
|
isSquare: "",
|
|
102
|
-
method:
|
|
102
|
+
method: m.value,
|
|
103
103
|
onChange: B
|
|
104
104
|
}, null, 8, ["method"]),
|
|
105
105
|
i(n(D), {
|
|
106
106
|
modelValue: l.value,
|
|
107
107
|
"onUpdate:modelValue": e[2] || (e[2] = (a) => l.value = a),
|
|
108
|
-
options:
|
|
108
|
+
options: v.value
|
|
109
109
|
}, {
|
|
110
110
|
default: u(() => [
|
|
111
111
|
i(n(k), {
|
|
112
|
-
class: "justify-between p-2 max-h-8 w-full gap-1 text-xs hover:bg-b-2",
|
|
112
|
+
class: "justify-between p-2 ml-2 max-h-8 w-full gap-1 text-xs hover:bg-b-2",
|
|
113
113
|
variant: "outlined"
|
|
114
114
|
}, {
|
|
115
115
|
default: u(() => [
|
|
@@ -127,15 +127,15 @@ const J = { class: "flex gap-2" }, se = /* @__PURE__ */ P({
|
|
|
127
127
|
]),
|
|
128
128
|
_: 1
|
|
129
129
|
}, 8, ["modelValue", "options"]),
|
|
130
|
-
|
|
130
|
+
d.value.length ? (C(), h(n(D), {
|
|
131
131
|
key: 0,
|
|
132
132
|
modelValue: s.value,
|
|
133
133
|
"onUpdate:modelValue": e[3] || (e[3] = (a) => s.value = a),
|
|
134
|
-
options:
|
|
134
|
+
options: d.value
|
|
135
135
|
}, {
|
|
136
136
|
default: u(() => [
|
|
137
137
|
i(n(k), {
|
|
138
|
-
class: "justify-between p-2 max-h-8 w-full gap-1 text-xs hover:bg-b-2",
|
|
138
|
+
class: "justify-between p-2 ml-2 max-h-8 w-full gap-1 text-xs hover:bg-b-2",
|
|
139
139
|
variant: "outlined"
|
|
140
140
|
}, {
|
|
141
141
|
default: u(() => [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnvironmentSelector.vue.d.ts","sourceRoot":"","sources":["../../../src/components/EnvironmentSelector/EnvironmentSelector.vue"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"EnvironmentSelector.vue.d.ts","sourceRoot":"","sources":["../../../src/components/EnvironmentSelector/EnvironmentSelector.vue"],"names":[],"mappings":";AAuXA,wBAMG"}
|
|
@@ -1,89 +1,80 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useActiveEntities as
|
|
3
|
-
import { ScalarDropdown as
|
|
4
|
-
import { useRouter as
|
|
5
|
-
import { useWorkspace as
|
|
6
|
-
const O = { class: "font-medium m-0 flex gap-1.5 items-center whitespace-nowrap" }, R = { class: "flex items-center justify-center h-4 w-4" },
|
|
1
|
+
import { defineComponent as b, computed as S, openBlock as a, createElementBlock as f, createVNode as n, unref as e, withCtx as r, Fragment as y, renderList as N, createBlock as v, withModifiers as w, createTextVNode as l, toDisplayString as x, createElementVNode as c, normalizeClass as D, createCommentVNode as B } from "vue";
|
|
2
|
+
import { useActiveEntities as I } from "../../store/active-entities.js";
|
|
3
|
+
import { ScalarDropdown as j, ScalarDropdownItem as m, ScalarListboxCheckbox as z, ScalarIcon as d, ScalarDropdownDivider as V, ScalarButton as M } from "@scalar/components";
|
|
4
|
+
import { useRouter as W } from "vue-router";
|
|
5
|
+
import { useWorkspace as L } from "../../store/store.js";
|
|
6
|
+
const O = { class: "font-medium m-0 flex gap-1.5 items-center whitespace-nowrap" }, R = { class: "flex items-center justify-center h-4 w-4" }, J = /* @__PURE__ */ b({
|
|
7
7
|
__name: "EnvironmentSelector",
|
|
8
8
|
setup($) {
|
|
9
|
-
const { activeWorkspace: i, activeEnvironment:
|
|
10
|
-
|
|
11
|
-
},
|
|
9
|
+
const { activeWorkspace: i, activeEnvironment: h } = I(), { environments: u, workspaceMutators: k, isReadOnly: g } = L(), E = W(), p = (s) => {
|
|
10
|
+
k.edit(i.value.uid, "activeEnvironmentId", s);
|
|
11
|
+
}, C = () => E.push({
|
|
12
12
|
name: "environment",
|
|
13
13
|
params: {
|
|
14
14
|
environment: i.value.uid
|
|
15
15
|
}
|
|
16
|
-
}),
|
|
16
|
+
}), _ = S(() => [
|
|
17
17
|
// Always add the default environment
|
|
18
18
|
u.default,
|
|
19
|
-
...Object.values(u).filter((
|
|
19
|
+
...Object.values(u).filter((s) => s.uid !== "default")
|
|
20
20
|
]);
|
|
21
|
-
return (
|
|
22
|
-
n(e(
|
|
21
|
+
return (s, o) => (a(), f("div", null, [
|
|
22
|
+
n(e(j), { placement: "bottom-end" }, {
|
|
23
23
|
items: r(() => [
|
|
24
|
-
(
|
|
24
|
+
(a(!0), f(y, null, N(_.value, (t) => (a(), v(e(m), {
|
|
25
25
|
key: t.uid,
|
|
26
26
|
class: "flex gap-1.5 group/item items-center whitespace-nowrap text-ellipsis overflow-hidden",
|
|
27
|
-
onClick:
|
|
27
|
+
onClick: w((A) => p(t.uid), ["stop"])
|
|
28
28
|
}, {
|
|
29
29
|
default: r(() => [
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
])
|
|
35
|
-
}, [
|
|
36
|
-
n(e(l), {
|
|
37
|
-
class: "size-2.5",
|
|
38
|
-
icon: "Checkmark",
|
|
39
|
-
thickness: "3.5"
|
|
40
|
-
})
|
|
41
|
-
], 2),
|
|
42
|
-
m(" " + x(t.name), 1)
|
|
30
|
+
n(e(z), {
|
|
31
|
+
selected: e(i).activeEnvironmentId === t.uid
|
|
32
|
+
}, null, 8, ["selected"]),
|
|
33
|
+
l(" " + x(t.name), 1)
|
|
43
34
|
]),
|
|
44
35
|
_: 2
|
|
45
36
|
}, 1032, ["onClick"]))), 128)),
|
|
46
|
-
n(e(
|
|
37
|
+
n(e(m), {
|
|
47
38
|
class: "flex gap-1.5 group/item items-center whitespace-nowrap text-ellipsis overflow-hidden",
|
|
48
|
-
onClick: o[0] || (o[0] =
|
|
39
|
+
onClick: o[0] || (o[0] = w((t) => p(""), ["stop"]))
|
|
49
40
|
}, {
|
|
50
41
|
default: r(() => [
|
|
51
|
-
|
|
52
|
-
class:
|
|
42
|
+
c("div", {
|
|
43
|
+
class: D([
|
|
53
44
|
"flex items-center justify-center rounded-full p-[3px] w-4 h-4",
|
|
54
45
|
e(i).activeEnvironmentId === "" ? "bg-c-accent text-b-1" : "group-hover/item:shadow-border text-transparent"
|
|
55
46
|
])
|
|
56
47
|
}, [
|
|
57
|
-
n(e(
|
|
48
|
+
n(e(d), {
|
|
58
49
|
class: "size-2.5",
|
|
59
50
|
icon: "Checkmark",
|
|
60
51
|
thickness: "3.5"
|
|
61
52
|
})
|
|
62
53
|
], 2),
|
|
63
|
-
o[1] || (o[1] =
|
|
54
|
+
o[1] || (o[1] = l(" No Environment "))
|
|
64
55
|
]),
|
|
65
56
|
_: 1
|
|
66
57
|
}),
|
|
67
|
-
n(e(
|
|
68
|
-
e(
|
|
58
|
+
n(e(V)),
|
|
59
|
+
e(g) ? B("", !0) : (a(), v(e(m), {
|
|
69
60
|
key: 0,
|
|
70
61
|
class: "flex items-center gap-1.5",
|
|
71
|
-
onClick:
|
|
62
|
+
onClick: C
|
|
72
63
|
}, {
|
|
73
64
|
default: r(() => [
|
|
74
|
-
|
|
75
|
-
n(e(
|
|
65
|
+
c("div", R, [
|
|
66
|
+
n(e(d), {
|
|
76
67
|
icon: "Brackets",
|
|
77
68
|
size: "sm"
|
|
78
69
|
})
|
|
79
70
|
]),
|
|
80
|
-
o[2] || (o[2] =
|
|
71
|
+
o[2] || (o[2] = c("span", { class: "leading-none" }, "Manage Environments", -1))
|
|
81
72
|
]),
|
|
82
73
|
_: 1
|
|
83
74
|
}))
|
|
84
75
|
]),
|
|
85
76
|
default: r(() => [
|
|
86
|
-
n(e(
|
|
77
|
+
n(e(M), {
|
|
87
78
|
class: "font-normal h-auto justify-start py-1.5 px-1.5 pl-2 text-c-1 hover:bg-b-2 text-c-1 w-fit",
|
|
88
79
|
fullWidth: "",
|
|
89
80
|
variant: "ghost"
|
|
@@ -91,9 +82,9 @@ const O = { class: "font-medium m-0 flex gap-1.5 items-center whitespace-nowrap"
|
|
|
91
82
|
default: r(() => {
|
|
92
83
|
var t;
|
|
93
84
|
return [
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
n(e(
|
|
85
|
+
c("h2", O, [
|
|
86
|
+
l(x(((t = e(h)) == null ? void 0 : t.name) ?? "No Environment") + " ", 1),
|
|
87
|
+
n(e(d), {
|
|
97
88
|
class: "size-3",
|
|
98
89
|
icon: "ChevronDown",
|
|
99
90
|
thickness: "3"
|
|
@@ -110,5 +101,5 @@ const O = { class: "font-medium m-0 flex gap-1.5 items-center whitespace-nowrap"
|
|
|
110
101
|
}
|
|
111
102
|
});
|
|
112
103
|
export {
|
|
113
|
-
|
|
104
|
+
J as default
|
|
114
105
|
};
|
|
@@ -4,7 +4,7 @@ import { useActiveEntities as B } from "../../store/active-entities.js";
|
|
|
4
4
|
import { ScalarButton as l } from "@scalar/components";
|
|
5
5
|
import { useToasts as F } from "@scalar/use-toasts";
|
|
6
6
|
import { useRouter as I } from "vue-router";
|
|
7
|
-
import { useWorkspace as
|
|
7
|
+
import { useWorkspace as U } from "../../store/store.js";
|
|
8
8
|
const R = /* @__PURE__ */ v({
|
|
9
9
|
__name: "ImportNowButton",
|
|
10
10
|
props: {
|
|
@@ -14,7 +14,7 @@ const R = /* @__PURE__ */ v({
|
|
|
14
14
|
},
|
|
15
15
|
emits: ["importFinished"],
|
|
16
16
|
setup(f, { emit: d }) {
|
|
17
|
-
const o = f, y = d, k = I(), { activeWorkspace: r } = B(), { importSpecFromUrl: w, importSpecFile: h } =
|
|
17
|
+
const o = f, y = d, k = I(), { activeWorkspace: r } = B(), { importSpecFromUrl: w, importSpecFile: h } = U(), { toast: i } = F();
|
|
18
18
|
async function n() {
|
|
19
19
|
try {
|
|
20
20
|
if (o.source) {
|
|
@@ -23,7 +23,7 @@ const R = /* @__PURE__ */ v({
|
|
|
23
23
|
o.source,
|
|
24
24
|
r.value.uid,
|
|
25
25
|
{
|
|
26
|
-
|
|
26
|
+
proxyUrl: r.value.proxyUrl,
|
|
27
27
|
watchMode: o.watchMode
|
|
28
28
|
}
|
|
29
29
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TopNav.vue.d.ts","sourceRoot":"","sources":["../../../src/components/TopNav/TopNav.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TopNav.vue.d.ts","sourceRoot":"","sources":["../../../src/components/TopNav/TopNav.vue"],"names":[],"mappings":"AAwPA,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAA;CACjD,CAAC;;AA0aF,wBAOG"}
|
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as M, reactive as $, ref as z, computed as B, watch as w, onMounted as E, onBeforeUnmount as j, openBlock as m, createElementBlock as b, createElementVNode as f, createVNode as n, unref as l, withCtx as r, toDisplayString as O, createTextVNode as x, Fragment as V, renderList as D, createBlock as K } from "vue";
|
|
2
2
|
import q from "../ScalarHotkey.vue.js";
|
|
3
3
|
import { ROUTES as F } from "../../constants.js";
|
|
4
4
|
import { useActiveEntities as H } from "../../store/active-entities.js";
|
|
5
|
-
import { ScalarContextMenu as W, ScalarIcon as d,
|
|
6
|
-
import { capitalize as
|
|
7
|
-
import { useClipboard as
|
|
8
|
-
import
|
|
9
|
-
import { useWorkspace as
|
|
10
|
-
const
|
|
5
|
+
import { ScalarContextMenu as W, ScalarIcon as d, ScalarFloating as G, ScalarDropdownMenu as J, ScalarDropdownButton as _ } from "@scalar/components";
|
|
6
|
+
import { capitalize as P } from "@scalar/oas-utils/helpers";
|
|
7
|
+
import { useClipboard as Q } from "@scalar/use-hooks/useClipboard";
|
|
8
|
+
import X from "./TopNavItem.vue.js";
|
|
9
|
+
import { useWorkspace as Y } from "../../store/store.js";
|
|
10
|
+
const Z = { class: "flex relative h-10 pl-2 mac:pl-[72px] t-app__top-nav" }, ee = { class: "flex h-10 flex-1 items-center gap-1.5 text-sm font-medium pr-2.5 relative overflow-hidden" }, te = {
|
|
11
11
|
key: 0,
|
|
12
12
|
class: "h-full w-full overflow-hidden"
|
|
13
|
-
},
|
|
13
|
+
}, pe = /* @__PURE__ */ M({
|
|
14
14
|
__name: "TopNav",
|
|
15
15
|
props: {
|
|
16
16
|
openNewTab: {}
|
|
17
17
|
},
|
|
18
|
-
setup(
|
|
19
|
-
const
|
|
18
|
+
setup(I) {
|
|
19
|
+
const S = I, { activeRequest: L, router: s } = H(), { events: g } = Y(), { copyToClipboard: U } = Q(), t = $([{ label: "", path: "", icon: "Add" }]), a = z(0), T = B(() => a.value);
|
|
20
20
|
function k() {
|
|
21
21
|
var o;
|
|
22
|
-
const e = F.find((
|
|
22
|
+
const e = F.find((u) => s.currentRoute.value.name == u.name);
|
|
23
23
|
e && ((e == null ? void 0 : e.name) === "request" ? t[a.value] = {
|
|
24
|
-
label: ((o =
|
|
25
|
-
path:
|
|
24
|
+
label: ((o = L.value) == null ? void 0 : o.summary) || "",
|
|
25
|
+
path: s.currentRoute.value.path,
|
|
26
26
|
icon: e.icon
|
|
27
27
|
} : t[a.value] = {
|
|
28
|
-
label:
|
|
29
|
-
path:
|
|
28
|
+
label: P(e == null ? void 0 : e.name) || "",
|
|
29
|
+
path: s.currentRoute.value.path,
|
|
30
30
|
icon: e.icon
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
33
|
function v() {
|
|
34
|
-
|
|
34
|
+
s.push(t[a.value].path);
|
|
35
35
|
}
|
|
36
36
|
function p() {
|
|
37
37
|
t.push({ label: "", path: "", icon: "Add" }), a.value = t.length - 1, k();
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function c(e) {
|
|
40
40
|
a.value = e, v();
|
|
41
41
|
}
|
|
42
42
|
w(
|
|
43
|
-
() =>
|
|
43
|
+
() => s.currentRoute.value.path,
|
|
44
44
|
() => {
|
|
45
45
|
k();
|
|
46
46
|
},
|
|
@@ -59,11 +59,11 @@ const Y = { class: "flex relative h-10 pl-2 mac:pl-[72px] t-app__top-nav" }, Z =
|
|
|
59
59
|
t.splice(0, e), t.splice(1), a.value = 0, v();
|
|
60
60
|
}, C = (e) => {
|
|
61
61
|
if (e) {
|
|
62
|
-
if (e.addTopNav && p(), e.closeTopNav && N(a.value), e.navigateTopNavLeft &&
|
|
62
|
+
if (e.addTopNav && p(), e.closeTopNav && N(a.value), e.navigateTopNavLeft && c(Math.max(a.value - 1, 0)), e.navigateTopNavRight && c(Math.min(a.value + 1, t.length - 1)), e.jumpToTab) {
|
|
63
63
|
const o = Number(e.jumpToTab.key) - 1;
|
|
64
|
-
o >= 0 && o < t.length &&
|
|
64
|
+
o >= 0 && o < t.length && c(o);
|
|
65
65
|
}
|
|
66
|
-
e.jumpToLastTab &&
|
|
66
|
+
e.jumpToLastTab && c(t.length - 1);
|
|
67
67
|
}
|
|
68
68
|
}, A = (e) => {
|
|
69
69
|
t.push({
|
|
@@ -73,17 +73,17 @@ const Y = { class: "flex relative h-10 pl-2 mac:pl-[72px] t-app__top-nav" }, Z =
|
|
|
73
73
|
});
|
|
74
74
|
};
|
|
75
75
|
return w(
|
|
76
|
-
() =>
|
|
76
|
+
() => S.openNewTab,
|
|
77
77
|
(e) => {
|
|
78
78
|
e && A(e);
|
|
79
79
|
},
|
|
80
80
|
{ immediate: !0 }
|
|
81
|
-
),
|
|
81
|
+
), E(() => g.hotKeys.on(C)), j(() => g.hotKeys.off(C)), (e, o) => (m(), b("nav", Z, [
|
|
82
82
|
o[3] || (o[3] = f("div", { class: "absolute inset-0 app-drag-region" }, null, -1)),
|
|
83
|
-
f("div",
|
|
84
|
-
t.length === 1 ? (m(), b("div",
|
|
83
|
+
f("div", ee, [
|
|
84
|
+
t.length === 1 ? (m(), b("div", te, [
|
|
85
85
|
n(l(W), { triggerClass: "flex custom-scroll gap-1.5 h-full items-center justify-center w-full whitespace-nowrap" }, {
|
|
86
|
-
trigger:
|
|
86
|
+
trigger: r(() => [
|
|
87
87
|
n(l(d), {
|
|
88
88
|
icon: t[0].icon,
|
|
89
89
|
size: "xs",
|
|
@@ -91,43 +91,45 @@ const Y = { class: "flex relative h-10 pl-2 mac:pl-[72px] t-app__top-nav" }, Z =
|
|
|
91
91
|
}, null, 8, ["icon"]),
|
|
92
92
|
f("span", null, O(t[0].label), 1)
|
|
93
93
|
]),
|
|
94
|
-
content:
|
|
95
|
-
n(l(G), {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
94
|
+
content: r(() => [
|
|
95
|
+
n(l(G), { placement: "right-start" }, {
|
|
96
|
+
floating: r(() => [
|
|
97
|
+
n(l(J), { class: "scalar-app scalar-client" }, {
|
|
98
|
+
default: r(() => [
|
|
99
|
+
n(l(_), {
|
|
100
|
+
class: "flex items-center gap-1.5",
|
|
101
|
+
onClick: p
|
|
102
|
+
}, {
|
|
103
|
+
default: r(() => [
|
|
104
|
+
n(l(d), {
|
|
105
|
+
icon: "AddTab",
|
|
106
|
+
size: "sm",
|
|
107
|
+
thickness: "1.5"
|
|
108
|
+
}),
|
|
109
|
+
o[1] || (o[1] = x(" New Tab ")),
|
|
110
|
+
n(q, {
|
|
111
|
+
class: "bg-b-2 ml-auto",
|
|
112
|
+
hotkey: "T"
|
|
113
|
+
})
|
|
114
|
+
]),
|
|
115
|
+
_: 1
|
|
109
116
|
}),
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
117
|
+
n(l(_), {
|
|
118
|
+
class: "flex items-center gap-1.5",
|
|
119
|
+
onClick: o[0] || (o[0] = (u) => y(T.value))
|
|
120
|
+
}, {
|
|
121
|
+
default: r(() => [
|
|
122
|
+
n(l(d), {
|
|
123
|
+
icon: "Link",
|
|
124
|
+
size: "sm",
|
|
125
|
+
thickness: "1.5"
|
|
126
|
+
}),
|
|
127
|
+
o[2] || (o[2] = x(" Copy URL "))
|
|
128
|
+
]),
|
|
129
|
+
_: 1
|
|
114
130
|
})
|
|
115
131
|
]),
|
|
116
132
|
_: 1
|
|
117
|
-
}),
|
|
118
|
-
n(l(I), {
|
|
119
|
-
class: "flex items-center gap-1.5",
|
|
120
|
-
onClick: o[0] || (o[0] = (c) => y(T.value))
|
|
121
|
-
}, {
|
|
122
|
-
default: u(() => [
|
|
123
|
-
n(l(d), {
|
|
124
|
-
icon: "Link",
|
|
125
|
-
size: "sm",
|
|
126
|
-
thickness: "1.5"
|
|
127
|
-
}),
|
|
128
|
-
o[2] || (o[2] = x(" Copy URL "))
|
|
129
|
-
]),
|
|
130
|
-
_: 1
|
|
131
133
|
})
|
|
132
134
|
]),
|
|
133
135
|
_: 1
|
|
@@ -135,16 +137,16 @@ const Y = { class: "flex relative h-10 pl-2 mac:pl-[72px] t-app__top-nav" }, Z =
|
|
|
135
137
|
]),
|
|
136
138
|
_: 1
|
|
137
139
|
})
|
|
138
|
-
])) : (m(!0), b(V, { key: 1 }, D(t, (
|
|
139
|
-
key:
|
|
140
|
-
active:
|
|
141
|
-
hotkey: (
|
|
142
|
-
icon:
|
|
143
|
-
label:
|
|
144
|
-
onClick: (h) =>
|
|
145
|
-
onClose: (h) => N(
|
|
146
|
-
onCloseOtherTabs: (h) => R(
|
|
147
|
-
onCopyUrl: (h) => y(
|
|
140
|
+
])) : (m(!0), b(V, { key: 1 }, D(t, (u, i) => (m(), K(X, {
|
|
141
|
+
key: i,
|
|
142
|
+
active: i === T.value,
|
|
143
|
+
hotkey: (i + 1).toString(),
|
|
144
|
+
icon: u.icon,
|
|
145
|
+
label: u.label,
|
|
146
|
+
onClick: (h) => c(i),
|
|
147
|
+
onClose: (h) => N(i),
|
|
148
|
+
onCloseOtherTabs: (h) => R(i),
|
|
149
|
+
onCopyUrl: (h) => y(i),
|
|
148
150
|
onNewTab: p
|
|
149
151
|
}, null, 8, ["active", "hotkey", "icon", "label", "onClick", "onClose", "onCloseOtherTabs", "onCopyUrl"]))), 128)),
|
|
150
152
|
f("button", {
|
|
@@ -163,5 +165,5 @@ const Y = { class: "flex relative h-10 pl-2 mac:pl-[72px] t-app__top-nav" }, Z =
|
|
|
163
165
|
}
|
|
164
166
|
});
|
|
165
167
|
export {
|
|
166
|
-
|
|
168
|
+
pe as default
|
|
167
169
|
};
|
|
@@ -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":"AAwMA,OAAO,EACL,KAAK,IAAI,EAQV,MAAM,oBAAoB,CAAA;AAI3B,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,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 a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
4
|
+
const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-d56f12d9"]]);
|
|
5
5
|
export {
|
|
6
6
|
a as default
|
|
7
7
|
};
|