@scalar/api-client 2.0.57 → 2.0.58
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/AddressBar/AddressBar.vue.d.ts.map +1 -1
- package/dist/components/AddressBar/AddressBar.vue.js +2 -2
- package/dist/components/AddressBar/AddressBar.vue2.js +61 -58
- package/dist/components/CommandPalette/CommandPaletteCollection.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteCollection.vue.js +31 -25
- package/dist/components/CommandPalette/CommandPaletteExample.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteExample.vue.js +51 -45
- package/dist/components/CommandPalette/CommandPaletteFolder.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteFolder.vue.js +47 -41
- package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteImport.vue.js +56 -40
- package/dist/components/CommandPalette/CommandPaletteRequest.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteRequest.vue.js +67 -61
- package/dist/components/CommandPalette/TheCommandPalette.vue.js +4 -4
- package/dist/components/CommandPalette/TheCommandPalette.vue2.js +30 -30
- package/dist/components/TopNav/TopNav.vue.d.ts +20 -1
- package/dist/components/TopNav/TopNav.vue.d.ts.map +1 -1
- package/dist/components/TopNav/TopNav.vue.js +2 -2
- package/dist/components/TopNav/TopNav.vue2.js +64 -49
- package/dist/layouts/App/ApiClientApp.vue.d.ts +11 -1
- package/dist/layouts/App/ApiClientApp.vue.d.ts.map +1 -1
- package/dist/layouts/App/ApiClientApp.vue.js +53 -49
- package/dist/libs/event-busses/cancel-request-bus.d.ts +2 -0
- package/dist/libs/event-busses/cancel-request-bus.d.ts.map +1 -0
- package/dist/libs/event-busses/cancel-request-bus.js +5 -0
- package/dist/libs/event-busses/hot-keys-bus.d.ts +3 -1
- package/dist/libs/event-busses/hot-keys-bus.d.ts.map +1 -1
- package/dist/libs/event-busses/hot-keys-bus.js +1 -0
- package/dist/libs/event-busses/index.d.ts +2 -1
- package/dist/libs/event-busses/index.d.ts.map +1 -1
- package/dist/libs/event-busses/index.js +11 -8
- package/dist/libs/index.js +21 -18
- package/dist/libs/local-storage.js +1 -1
- package/dist/libs/sendRequest.d.ts +2 -2
- package/dist/libs/sendRequest.d.ts.map +1 -1
- package/dist/libs/sendRequest.js +22 -21
- package/dist/store/workspace.d.ts.map +1 -1
- package/dist/store/workspace.js +100 -103
- package/dist/style.css +1 -1
- package/dist/views/Request/Request.vue.d.ts +11 -1
- package/dist/views/Request/Request.vue.d.ts.map +1 -1
- package/dist/views/Request/Request.vue.js +3 -3
- package/dist/views/Request/Request.vue2.js +184 -174
- package/dist/views/Request/RequestSidebarItem.vue.d.ts +2 -0
- package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebarItem.vue.js +2 -2
- package/dist/views/Request/RequestSidebarItem.vue2.js +139 -130
- package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue.d.ts +3 -0
- package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue.d.ts.map +1 -0
- package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue.js +7 -0
- package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue2.js +39 -0
- package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.js +37 -30
- package/dist/views/Request/ResponseSection/ResponseSection.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseSection.vue.js +23 -21
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @scalar/api-client
|
|
2
2
|
|
|
3
|
+
## 2.0.58
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 1c3de0e: fix(api-client): correctly initialize complex auth, fixes #2874
|
|
8
|
+
- 857380d: fix: command palette import collection
|
|
9
|
+
- ab8c4d7: feat: meta clik link request to topnav
|
|
10
|
+
- 8d615dc: fix: request sidebar item new tab event modifier
|
|
11
|
+
- 9bc0ae7: feat: command palette input required on submit
|
|
12
|
+
- 8f24069: feat(api-client): add loading state and cancellation for slow requests
|
|
13
|
+
- Updated dependencies [9bc0ae7]
|
|
14
|
+
- Updated dependencies [a792002]
|
|
15
|
+
- Updated dependencies [bb13304]
|
|
16
|
+
- @scalar/components@0.12.39
|
|
17
|
+
- @scalar/themes@0.9.27
|
|
18
|
+
- @scalar/oas-utils@0.2.38
|
|
19
|
+
- @scalar/types@0.0.4
|
|
20
|
+
|
|
3
21
|
## 2.0.57
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddressBar.vue.d.ts","sourceRoot":"","sources":["../../../src/components/AddressBar/AddressBar.vue"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"AddressBar.vue.d.ts","sourceRoot":"","sources":["../../../src/components/AddressBar/AddressBar.vue"],"names":[],"mappings":";AAutBA,wBAKG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./AddressBar.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-0989c8b5"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as L, ref as n, watch as O, onMounted as
|
|
1
|
+
import { defineComponent as L, ref as n, watch as O, onMounted as K, onBeforeUnmount as N, unref as l, openBlock as T, createElementBlock as A, createElementVNode as o, createVNode as u, withCtx as y, normalizeClass as B, normalizeStyle as $, createCommentVNode as D, pushScopeId as Q, popScopeId as W } from "vue";
|
|
2
2
|
import j from "../CodeInput/CodeInput.vue.js";
|
|
3
3
|
import { useWorkspace as F } from "../../store/workspace.js";
|
|
4
4
|
import { Listbox as G } from "@headlessui/vue";
|
|
@@ -8,29 +8,29 @@ import { isMacOS as Y } from "@scalar/use-tooltip";
|
|
|
8
8
|
import { useMagicKeys as Z, whenever as ee } from "@vueuse/core";
|
|
9
9
|
import te from "../HttpMethod/HttpMethod.vue.js";
|
|
10
10
|
import le from "./AddressBarHistory.vue.js";
|
|
11
|
-
import { executeRequestBus as
|
|
11
|
+
import { executeRequestBus as k } from "../../libs/event-busses/execute-request-bus.js";
|
|
12
12
|
import { requestStatusBus as oe } from "../../libs/event-busses/request-status-bus.js";
|
|
13
|
-
import { hotKeyBus as
|
|
14
|
-
const
|
|
13
|
+
import { hotKeyBus as E } from "../../libs/event-busses/hot-keys-bus.js";
|
|
14
|
+
const m = (c) => (Q("data-v-0989c8b5"), c = c(), W(), c), ae = {
|
|
15
15
|
key: 0,
|
|
16
16
|
class: "order-last lg:order-none lg:w-auto w-full"
|
|
17
|
-
}, re = { class: "m-auto flex basis-1/2 flex-row items-center" }, se = { class: "pointer-events-none absolute left-0 top-0 z-10 block h-full w-full overflow-hidden" }, ne = { class: "flex gap-1" },
|
|
17
|
+
}, re = { class: "m-auto flex basis-1/2 flex-row items-center" }, se = { class: "pointer-events-none absolute left-0 top-0 z-10 block h-full w-full overflow-hidden" }, ne = { class: "flex gap-1" }, ue = { class: "codemirror-bg-switcher scroll-timeline-x scroll-timeline-x-hidden relative flex w-full" }, ie = /* @__PURE__ */ m(() => /* @__PURE__ */ o("div", { class: "fade-left" }, null, -1)), de = /* @__PURE__ */ m(() => /* @__PURE__ */ o("div", { class: "fade-right" }, null, -1)), ce = /* @__PURE__ */ m(() => /* @__PURE__ */ o("span", { class: "text-xxs relative z-10 lg:flex hidden" }, "Send", -1)), Se = /* @__PURE__ */ L({
|
|
18
18
|
__name: "AddressBar",
|
|
19
|
-
setup(
|
|
19
|
+
setup(c) {
|
|
20
20
|
const {
|
|
21
21
|
activeRequest: t,
|
|
22
|
-
activeExample:
|
|
23
|
-
isReadOnly:
|
|
24
|
-
requestMutators:
|
|
22
|
+
activeExample: f,
|
|
23
|
+
isReadOnly: v,
|
|
24
|
+
requestMutators: p,
|
|
25
25
|
requestExampleMutators: S,
|
|
26
|
-
requestsHistory:
|
|
27
|
-
} = F(),
|
|
26
|
+
requestsHistory: q
|
|
27
|
+
} = F(), h = n(q.value[0]), x = n(null), _ = Z();
|
|
28
28
|
ee(
|
|
29
|
-
Y() ?
|
|
30
|
-
() =>
|
|
29
|
+
Y() ? _.meta_enter : _.ctrl_enter,
|
|
30
|
+
() => k.emit()
|
|
31
31
|
);
|
|
32
32
|
const C = (e) => {
|
|
33
|
-
!t.value || t.value.path === e ||
|
|
33
|
+
!t.value || t.value.path === e || p.edit(t.value.uid, "path", e);
|
|
34
34
|
};
|
|
35
35
|
O(
|
|
36
36
|
() => {
|
|
@@ -41,95 +41,98 @@ const v = (f) => (Q("data-v-28ee5506"), f = f(), W(), f), ae = {
|
|
|
41
41
|
t.value && C(e);
|
|
42
42
|
}
|
|
43
43
|
);
|
|
44
|
-
const
|
|
45
|
-
function q() {
|
|
46
|
-
s.value ? r.value -= (r.value - 15) / 60 : r.value -= _.value / 20, r.value <= 0 && (clearInterval(u.value), u.value = void 0, r.value = 100, s.value = !1);
|
|
47
|
-
}
|
|
44
|
+
const a = n(100), b = n(0), r = n(!1), s = n();
|
|
48
45
|
function R() {
|
|
49
|
-
|
|
46
|
+
r.value ? a.value -= (a.value - 15) / 60 : a.value -= b.value / 20, a.value <= 0 && (clearInterval(s.value), s.value = void 0, a.value = 100, r.value = !1);
|
|
50
47
|
}
|
|
51
48
|
function I() {
|
|
52
|
-
|
|
49
|
+
s.value || (r.value = !0, s.value = setInterval(R, 20));
|
|
53
50
|
}
|
|
54
51
|
function V() {
|
|
55
|
-
|
|
52
|
+
b.value = a.value, r.value = !1;
|
|
53
|
+
}
|
|
54
|
+
function M() {
|
|
55
|
+
clearInterval(s.value), s.value = void 0, a.value = 100, r.value = !1;
|
|
56
56
|
}
|
|
57
57
|
oe.on((e) => {
|
|
58
|
-
e === "start" &&
|
|
58
|
+
e === "start" && I(), e === "stop" && V(), e === "abort" && M();
|
|
59
59
|
});
|
|
60
|
-
function
|
|
61
|
-
t.value &&
|
|
60
|
+
function z(e) {
|
|
61
|
+
t.value && p.edit(t.value.uid, "method", e);
|
|
62
62
|
}
|
|
63
|
-
function
|
|
63
|
+
function U() {
|
|
64
64
|
if (!t.value) return;
|
|
65
65
|
const { method: e } = t.value;
|
|
66
66
|
return X[e].backgroundColor;
|
|
67
67
|
}
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
function g() {
|
|
69
|
+
r.value || (r.value = !0, k.emit());
|
|
70
|
+
}
|
|
71
|
+
const H = (e) => {
|
|
72
|
+
S.edit(f.value.uid, "url", e);
|
|
70
73
|
}, w = (e) => {
|
|
71
|
-
var
|
|
72
|
-
e.focusAddressBar && ((
|
|
74
|
+
var i;
|
|
75
|
+
e.focusAddressBar && ((i = x.value) == null || i.focus());
|
|
73
76
|
};
|
|
74
|
-
return
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
modelValue:
|
|
78
|
-
"onUpdate:modelValue":
|
|
77
|
+
return K(() => E.on(w)), N(() => E.off(w)), (e, i) => l(t) && l(f) ? (T(), A("div", ae, [
|
|
78
|
+
o("div", re, [
|
|
79
|
+
u(l(G), {
|
|
80
|
+
modelValue: h.value,
|
|
81
|
+
"onUpdate:modelValue": i[0] || (i[0] = (d) => h.value = d)
|
|
79
82
|
}, {
|
|
80
83
|
default: y(({ open: d }) => [
|
|
81
|
-
|
|
84
|
+
o("div", {
|
|
82
85
|
class: B([
|
|
83
86
|
"addressbar-bg-states text-xxs relative flex w-full lg:min-w-[720px] lg:max-w-[720px] order-last lg:order-none flex-1 flex-row items-stretch rounded-lg border-1/2 p-[3px]",
|
|
84
87
|
{ "rounded-b-none": d },
|
|
85
88
|
{ "border-transparent": d }
|
|
86
89
|
])
|
|
87
90
|
}, [
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
class: B(["bg-mix-transparent bg-mix-amount-90 absolute left-0 top-0 h-full w-full",
|
|
91
|
-
style:
|
|
91
|
+
o("div", se, [
|
|
92
|
+
o("div", {
|
|
93
|
+
class: B(["bg-mix-transparent bg-mix-amount-90 absolute left-0 top-0 h-full w-full", U()]),
|
|
94
|
+
style: $({ transform: `translate3d(-${a.value}%,0,0)` })
|
|
92
95
|
}, null, 6)
|
|
93
96
|
]),
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
isEditable: !l(
|
|
97
|
+
o("div", ne, [
|
|
98
|
+
u(te, {
|
|
99
|
+
isEditable: !l(v),
|
|
97
100
|
isSquare: "",
|
|
98
101
|
method: l(t).method,
|
|
99
|
-
onChange:
|
|
102
|
+
onChange: z
|
|
100
103
|
}, null, 8, ["isEditable", "method"])
|
|
101
104
|
]),
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
+
o("div", ue, [
|
|
106
|
+
ie,
|
|
107
|
+
u(j, {
|
|
105
108
|
ref_key: "addressBarRef",
|
|
106
|
-
ref:
|
|
109
|
+
ref: x,
|
|
107
110
|
disableCloseBrackets: "",
|
|
108
|
-
disabled: l(
|
|
111
|
+
disabled: l(v),
|
|
109
112
|
disableEnter: "",
|
|
110
113
|
disableTabIndent: "",
|
|
111
114
|
emitOnBlur: !1,
|
|
112
|
-
modelValue: l(
|
|
115
|
+
modelValue: l(f).url,
|
|
113
116
|
placeholder: "Enter URL to get started",
|
|
114
117
|
server: "",
|
|
115
|
-
onSubmit:
|
|
116
|
-
"onUpdate:modelValue":
|
|
118
|
+
onSubmit: g,
|
|
119
|
+
"onUpdate:modelValue": H
|
|
117
120
|
}, null, 8, ["disabled", "modelValue"]),
|
|
118
121
|
de
|
|
119
122
|
]),
|
|
120
|
-
|
|
121
|
-
|
|
123
|
+
u(le, { open: d }, null, 8, ["open"]),
|
|
124
|
+
u(l(J), {
|
|
122
125
|
class: "relative h-auto shrink-0 gap-1 overflow-hidden pl-2 pr-2.5 py-1 z-[1] font-bold",
|
|
123
|
-
disabled:
|
|
124
|
-
onClick:
|
|
126
|
+
disabled: r.value,
|
|
127
|
+
onClick: g
|
|
125
128
|
}, {
|
|
126
129
|
default: y(() => [
|
|
127
|
-
|
|
130
|
+
u(l(P), {
|
|
128
131
|
class: "relative z-10 shrink-0 fill-current",
|
|
129
132
|
icon: "Play",
|
|
130
133
|
size: "xs"
|
|
131
134
|
}),
|
|
132
|
-
|
|
135
|
+
ce
|
|
133
136
|
]),
|
|
134
137
|
_: 1
|
|
135
138
|
}, 8, ["disabled"])
|
|
@@ -142,5 +145,5 @@ const v = (f) => (Q("data-v-28ee5506"), f = f(), W(), f), ae = {
|
|
|
142
145
|
}
|
|
143
146
|
});
|
|
144
147
|
export {
|
|
145
|
-
|
|
148
|
+
Se as default
|
|
146
149
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommandPaletteCollection.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandPaletteCollection.vue"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"CommandPaletteCollection.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandPaletteCollection.vue"],"names":[],"mappings":";;;;;AA8NA,wBAMG"}
|
|
@@ -1,64 +1,70 @@
|
|
|
1
|
-
import { defineComponent as p, ref as
|
|
2
|
-
import { useWorkspace as
|
|
3
|
-
import { ScalarButton as
|
|
4
|
-
|
|
1
|
+
import { defineComponent as p, ref as s, onMounted as f, openBlock as h, createElementBlock as _, createElementVNode as o, withDirectives as v, withKeys as x, withModifiers as b, vModelText as w, createVNode as C, unref as g, withCtx as y, createTextVNode as k } from "vue";
|
|
2
|
+
import { useWorkspace as N } from "../../store/workspace.js";
|
|
3
|
+
import { ScalarButton as M } from "@scalar/components";
|
|
4
|
+
import { useToasts as V } from "@scalar/use-toasts";
|
|
5
|
+
const B = { class: "flex w-full flex-col gap-3" }, K = { class: "gap-3 rounded bg-b-2 focus-within:bg-b-1 focus-within:shadow-border min-h-20 relative" }, T = /* @__PURE__ */ o("label", {
|
|
5
6
|
class: "absolute w-full h-full opacity-0 cursor-text",
|
|
6
7
|
for: "collectionanme"
|
|
7
|
-
}, null, -1),
|
|
8
|
+
}, null, -1), E = ["onKeydown"], I = { class: "flex" }, P = /* @__PURE__ */ o("div", { class: "flex flex-1 gap-2 max-h-8" }, null, -1), q = /* @__PURE__ */ p({
|
|
8
9
|
__name: "CommandPaletteCollection",
|
|
9
10
|
emits: ["close"],
|
|
10
|
-
setup(S, { emit:
|
|
11
|
-
const
|
|
11
|
+
setup(S, { emit: i }) {
|
|
12
|
+
const c = i, { activeWorkspace: r, collectionMutators: u } = N(), e = s(""), { toast: d } = V(), l = () => {
|
|
13
|
+
if (!e.value) {
|
|
14
|
+
d("Please enter a name before creating a collection.", "error");
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
12
17
|
u.add(
|
|
13
18
|
{
|
|
14
19
|
spec: {
|
|
15
20
|
openapi: "3.1.0",
|
|
16
21
|
info: {
|
|
17
|
-
title:
|
|
22
|
+
title: e.value,
|
|
18
23
|
version: "0.0.1"
|
|
19
24
|
}
|
|
20
25
|
}
|
|
21
26
|
},
|
|
22
27
|
r.value.uid
|
|
23
|
-
),
|
|
24
|
-
}, n =
|
|
25
|
-
return
|
|
28
|
+
), c("close");
|
|
29
|
+
}, n = s(null);
|
|
30
|
+
return f(() => {
|
|
26
31
|
var t;
|
|
27
32
|
(t = n.value) == null || t.focus();
|
|
28
|
-
}), (t,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
33
|
+
}), (t, a) => (h(), _("div", B, [
|
|
34
|
+
o("div", K, [
|
|
35
|
+
T,
|
|
36
|
+
v(o("input", {
|
|
32
37
|
id: "collectionanme",
|
|
33
38
|
ref_key: "collectionInput",
|
|
34
39
|
ref: n,
|
|
35
|
-
"onUpdate:modelValue":
|
|
40
|
+
"onUpdate:modelValue": a[0] || (a[0] = (m) => e.value = m),
|
|
36
41
|
autocomplete: "off",
|
|
37
42
|
class: "border-transparent outline-none w-full pl-8 text-sm min-h-8 py-1.5",
|
|
38
43
|
"data-form-type": "other",
|
|
39
44
|
"data-lpignore": "true",
|
|
40
45
|
label: "Collection Name",
|
|
41
46
|
placeholder: "Collection Name",
|
|
42
|
-
onKeydown: x(
|
|
43
|
-
}, null, 40,
|
|
44
|
-
[w,
|
|
47
|
+
onKeydown: x(b(l, ["prevent"]), ["enter"])
|
|
48
|
+
}, null, 40, E), [
|
|
49
|
+
[w, e.value]
|
|
45
50
|
])
|
|
46
51
|
]),
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
52
|
+
o("div", I, [
|
|
53
|
+
P,
|
|
54
|
+
C(g(M), {
|
|
50
55
|
class: "max-h-8 text-xs p-0 px-3",
|
|
56
|
+
disabled: !e.value.trim(),
|
|
51
57
|
onClick: l
|
|
52
58
|
}, {
|
|
53
59
|
default: y(() => [
|
|
54
|
-
|
|
60
|
+
k(" Continue ")
|
|
55
61
|
]),
|
|
56
62
|
_: 1
|
|
57
|
-
})
|
|
63
|
+
}, 8, ["disabled"])
|
|
58
64
|
])
|
|
59
65
|
]));
|
|
60
66
|
}
|
|
61
67
|
});
|
|
62
68
|
export {
|
|
63
|
-
|
|
69
|
+
q as default
|
|
64
70
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommandPaletteExample.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandPaletteExample.vue"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"CommandPaletteExample.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandPaletteExample.vue"],"names":[],"mappings":";IAgJE,oCAAoC;eACzB,MAAM;;;;IADjB,oCAAoC;eACzB,MAAM;;;;AAoTnB,wBAOG;AAOH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
|
|
@@ -1,76 +1,81 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as B, ref as c, onMounted as x, openBlock as m, createElementBlock as h, createElementVNode as a, withDirectives as I, withKeys as R, withModifiers as V, vModelText as q, createVNode as o, unref as s, withCtx as r, Fragment as K, renderList as T, createBlock as W, createTextVNode as d, toDisplayString as v } from "vue";
|
|
2
2
|
import _ from "../HttpMethod/HttpMethod.vue.js";
|
|
3
3
|
import { useWorkspace as j } from "../../store/workspace.js";
|
|
4
|
-
import { ScalarDropdown as z, ScalarDropdownItem as
|
|
5
|
-
import {
|
|
6
|
-
|
|
4
|
+
import { ScalarDropdown as z, ScalarDropdownItem as P, ScalarButton as w, ScalarIcon as F } from "@scalar/components";
|
|
5
|
+
import { useToasts as H } from "@scalar/use-toasts";
|
|
6
|
+
import { useRouter as L } from "vue-router";
|
|
7
|
+
const U = { class: "flex w-full flex-col gap-3" }, A = { class: "gap-3 rounded bg-b-2 focus-within:bg-b-1 focus-within:shadow-border min-h-20 relative" }, G = /* @__PURE__ */ a("label", {
|
|
7
8
|
class: "absolute w-full h-full opacity-0 cursor-text",
|
|
8
9
|
for: "examplename"
|
|
9
|
-
}, null, -1),
|
|
10
|
+
}, null, -1), J = ["onKeydown"], O = { class: "flex gap-2" }, Q = { class: "flex flex-1 max-h-8" }, X = { class: "flex items-center gap-2" }, Y = { class: "max-h-40 custom-scroll" }, ne = /* @__PURE__ */ B({
|
|
10
11
|
__name: "CommandPaletteExample",
|
|
11
12
|
props: {
|
|
12
13
|
metaData: {}
|
|
13
14
|
},
|
|
14
15
|
emits: ["close"],
|
|
15
16
|
setup(b, { emit: k }) {
|
|
16
|
-
const y = b, g = k, { push: C } =
|
|
17
|
+
const y = b, g = k, { push: C } = L(), {
|
|
17
18
|
activeRequest: D,
|
|
18
19
|
activeWorkspace: E,
|
|
19
20
|
activeWorkspaceRequests: S,
|
|
20
21
|
requests: N,
|
|
21
22
|
requestExampleMutators: M
|
|
22
|
-
} = j(),
|
|
23
|
+
} = j(), { toast: $ } = H(), n = c(""), l = c(
|
|
23
24
|
// Ensure we pre-select the correct request
|
|
24
25
|
N[y.metaData ?? ""] ?? D.value
|
|
25
|
-
), p = (e) =>
|
|
26
|
-
|
|
26
|
+
), p = (e) => l.value = e, u = c(null);
|
|
27
|
+
x(() => {
|
|
27
28
|
var e;
|
|
28
29
|
return (e = u.value) == null ? void 0 : e.focus();
|
|
29
30
|
});
|
|
30
|
-
const
|
|
31
|
+
const f = () => {
|
|
32
|
+
if (!n.value) {
|
|
33
|
+
$("Please enter a name before creating an example.", "error");
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
31
36
|
const e = M.add(
|
|
32
|
-
|
|
33
|
-
|
|
37
|
+
l.value,
|
|
38
|
+
n.value
|
|
34
39
|
);
|
|
35
40
|
e && (C(
|
|
36
|
-
`/workspace/${E.value.uid}/request/${
|
|
41
|
+
`/workspace/${E.value.uid}/request/${l.value.uid}/examples/${e.uid}`
|
|
37
42
|
), g("close"));
|
|
38
43
|
};
|
|
39
|
-
return
|
|
44
|
+
return x(() => {
|
|
40
45
|
var e;
|
|
41
46
|
(e = u.value) == null || e.focus();
|
|
42
|
-
}), (e,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
47
|
+
}), (e, i) => (m(), h("div", U, [
|
|
48
|
+
a("div", A, [
|
|
49
|
+
G,
|
|
50
|
+
I(a("input", {
|
|
46
51
|
id: "examplename",
|
|
47
52
|
ref_key: "exampleInput",
|
|
48
53
|
ref: u,
|
|
49
|
-
"onUpdate:modelValue":
|
|
54
|
+
"onUpdate:modelValue": i[0] || (i[0] = (t) => n.value = t),
|
|
50
55
|
class: "border-transparent outline-none w-full pl-8 text-sm min-h-8 py-1.5",
|
|
51
56
|
label: "Example Name",
|
|
52
57
|
placeholder: "Example Name",
|
|
53
|
-
onKeydown:
|
|
54
|
-
}, null, 40,
|
|
55
|
-
[
|
|
58
|
+
onKeydown: R(V(f, ["prevent"]), ["enter"])
|
|
59
|
+
}, null, 40, J), [
|
|
60
|
+
[q, n.value]
|
|
56
61
|
])
|
|
57
62
|
]),
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
63
|
+
a("div", O, [
|
|
64
|
+
a("div", Q, [
|
|
65
|
+
o(s(z), {
|
|
61
66
|
placement: "bottom",
|
|
62
67
|
resize: ""
|
|
63
68
|
}, {
|
|
64
|
-
items:
|
|
65
|
-
|
|
66
|
-
(m(!0), h(
|
|
69
|
+
items: r(() => [
|
|
70
|
+
a("div", Y, [
|
|
71
|
+
(m(!0), h(K, null, T(s(S), (t) => (m(), W(s(P), {
|
|
67
72
|
key: t.uid,
|
|
68
73
|
class: "flex h-7 w-full items-center justify-between px-1 pr-[26px]",
|
|
69
|
-
onClick: (
|
|
74
|
+
onClick: (Z) => p(t)
|
|
70
75
|
}, {
|
|
71
|
-
default:
|
|
76
|
+
default: r(() => [
|
|
72
77
|
d(v(t.summary) + " ", 1),
|
|
73
|
-
|
|
78
|
+
o(_, {
|
|
74
79
|
method: t.method
|
|
75
80
|
}, null, 8, ["method"])
|
|
76
81
|
]),
|
|
@@ -78,19 +83,19 @@ const L = { class: "flex w-full flex-col gap-3" }, P = { class: "gap-3 rounded b
|
|
|
78
83
|
}, 1032, ["onClick"]))), 128))
|
|
79
84
|
])
|
|
80
85
|
]),
|
|
81
|
-
default:
|
|
82
|
-
|
|
86
|
+
default: r(() => [
|
|
87
|
+
o(s(w), {
|
|
83
88
|
class: "justify-between p-2 max-h-8 w-full gap-1 text-xs hover:bg-b-2",
|
|
84
89
|
variant: "outlined",
|
|
85
|
-
onClick:
|
|
90
|
+
onClick: i[1] || (i[1] = (t) => p(l.value))
|
|
86
91
|
}, {
|
|
87
|
-
default:
|
|
88
|
-
d(v(
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
method:
|
|
92
|
+
default: r(() => [
|
|
93
|
+
d(v(l.value.summary) + " ", 1),
|
|
94
|
+
a("div", X, [
|
|
95
|
+
o(_, {
|
|
96
|
+
method: l.value.method
|
|
92
97
|
}, null, 8, ["method"]),
|
|
93
|
-
|
|
98
|
+
o(s(F), {
|
|
94
99
|
class: "text-c-3",
|
|
95
100
|
icon: "ChevronDown",
|
|
96
101
|
size: "xs"
|
|
@@ -103,19 +108,20 @@ const L = { class: "flex w-full flex-col gap-3" }, P = { class: "gap-3 rounded b
|
|
|
103
108
|
_: 1
|
|
104
109
|
})
|
|
105
110
|
]),
|
|
106
|
-
|
|
111
|
+
o(s(w), {
|
|
107
112
|
class: "max-h-8 text-xs p-0 px-3",
|
|
108
|
-
|
|
113
|
+
disabled: !n.value.trim(),
|
|
114
|
+
onClick: f
|
|
109
115
|
}, {
|
|
110
|
-
default:
|
|
116
|
+
default: r(() => [
|
|
111
117
|
d(" Create Example ")
|
|
112
118
|
]),
|
|
113
119
|
_: 1
|
|
114
|
-
})
|
|
120
|
+
}, 8, ["disabled"])
|
|
115
121
|
])
|
|
116
122
|
]));
|
|
117
123
|
}
|
|
118
124
|
});
|
|
119
125
|
export {
|
|
120
|
-
|
|
126
|
+
ne as default
|
|
121
127
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommandPaletteFolder.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandPaletteFolder.vue"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"CommandPaletteFolder.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandPaletteFolder.vue"],"names":[],"mappings":";;;;;AA6UA,wBAMG"}
|