@scalar/api-client 2.2.22 → 2.2.24
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 +22 -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 +69 -70
- package/dist/components/AddressBar/AddressBarServer.vue.d.ts.map +1 -1
- package/dist/components/AddressBar/AddressBarServer.vue.js +69 -61
- package/dist/components/AddressBar/AddressBarServerItem.vue.d.ts.map +1 -1
- package/dist/components/AddressBar/AddressBarServerItem.vue.js +17 -16
- package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
- package/dist/components/CodeInput/CodeInput.vue.js +2 -2
- package/dist/components/CodeInput/CodeInput.vue2.js +46 -46
- package/dist/components/CodeInput/codeVariableWidget.d.ts +4 -4
- package/dist/components/CodeInput/codeVariableWidget.d.ts.map +1 -1
- package/dist/components/CodeInput/codeVariableWidget.js +42 -38
- package/dist/components/CommandPalette/CommandPaletteCollection.vue.js +25 -24
- package/dist/components/CommandPalette/CommandPaletteExample.vue.d.ts +1 -1
- package/dist/components/CommandPalette/CommandPaletteExample.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteExample.vue.js +64 -55
- package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteImport.vue.js +110 -106
- package/dist/components/CommandPalette/CommandPaletteRequest.vue.js +2 -2
- package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts +1 -1
- package/dist/components/CommandPalette/TheCommandPalette.vue.js +1 -1
- package/dist/components/CommandPalette/TheCommandPalette.vue2.js +38 -37
- package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.d.ts.map +1 -1
- package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +52 -49
- package/dist/components/ImportCollection/DropEventListener.vue.d.ts.map +1 -1
- package/dist/components/ImportCollection/DropEventListener.vue.js +46 -43
- package/dist/components/ImportCollection/ImportCollectionModal.vue.js +40 -39
- package/dist/components/ImportCollection/ImportNowButton.vue.js +44 -42
- package/dist/components/ImportCollection/WorkspaceSelector.vue.js +76 -69
- package/dist/components/ScalarAsciiArt.vue.js +1 -1
- package/dist/components/ScalarAsciiArt.vue2.js +22 -19
- package/dist/components/Search/useSearch.d.ts.map +1 -1
- package/dist/components/Search/useSearch.js +57 -49
- package/dist/components/SideNav/SideNavRouterLink.vue.d.ts.map +1 -1
- package/dist/components/SideNav/SideNavRouterLink.vue.js +22 -19
- package/dist/components/Sidebar/SidebarListElement.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarListElement.vue.js +2 -2
- package/dist/components/Sidebar/SidebarListElement.vue2.js +38 -36
- package/dist/components/TopNav/TopNav.vue.d.ts.map +1 -1
- package/dist/components/TopNav/TopNav.vue.js +71 -64
- package/dist/layouts/App/ApiClientApp.vue.js +4 -1
- package/dist/layouts/Modal/ApiClientModal.vue.js +2 -2
- package/dist/layouts/Modal/ApiClientModal.vue2.js +22 -19
- package/dist/layouts/Web/ApiClientWeb.vue.js +4 -1
- package/dist/libs/create-client.d.ts +10 -10
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/libs/create-client.js +42 -36
- package/dist/libs/extractAttachmentFilename.d.ts +3 -0
- package/dist/libs/extractAttachmentFilename.d.ts.map +1 -1
- package/dist/libs/extractAttachmentFilename.js +7 -7
- package/dist/libs/importers/curl.d.ts.map +1 -1
- package/dist/libs/importers/curl.js +18 -18
- package/dist/libs/normalize-headers.d.ts.map +1 -1
- package/dist/libs/normalize-headers.js +2 -2
- package/dist/libs/parse-curl.js +39 -36
- package/dist/store/active-entities.d.ts +4 -4
- package/dist/store/active-entities.d.ts.map +1 -1
- package/dist/store/active-entities.js +88 -86
- package/dist/store/collections.d.ts.map +1 -1
- package/dist/store/collections.js +29 -29
- package/dist/store/request-example.d.ts.map +1 -1
- package/dist/store/request-example.js +27 -23
- package/dist/store/requests.d.ts.map +1 -1
- package/dist/store/requests.js +94 -77
- package/dist/store/security-schemes.d.ts.map +1 -1
- package/dist/store/security-schemes.js +27 -27
- package/dist/store/servers.d.ts.map +1 -1
- package/dist/store/servers.js +18 -18
- package/dist/store/tags.d.ts.map +1 -1
- package/dist/store/tags.js +35 -33
- package/dist/style.css +1 -1
- package/dist/views/Cookies/CookieForm.vue.d.ts.map +1 -1
- package/dist/views/Cookies/CookieForm.vue.js +14 -9
- package/dist/views/Cookies/Cookies.vue.d.ts.map +1 -1
- package/dist/views/Cookies/Cookies.vue2.js +39 -37
- package/dist/views/Environment/Environment.vue.d.ts.map +1 -1
- package/dist/views/Environment/Environment.vue2.js +94 -89
- package/dist/views/Request/Request.vue.d.ts.map +1 -1
- package/dist/views/Request/Request.vue.js +1 -1
- package/dist/views/Request/Request.vue2.js +118 -116
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.js +28 -25
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +38 -37
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue2.js +76 -73
- package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue2.js +80 -80
- package/dist/views/Request/RequestSection/RequestBody.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestBody.vue.js +1 -1
- package/dist/views/Request/RequestSection/RequestBody.vue2.js +192 -178
- package/dist/views/Request/RequestSection/RequestParams.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestParams.vue.js +80 -73
- package/dist/views/Request/RequestSection/RequestPathParams.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestPathParams.vue.js +50 -48
- package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebar.vue.js +1 -1
- package/dist/views/Request/RequestSidebar.vue2.js +149 -144
- 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 +168 -150
- package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebarItemMenu.vue.js +4 -4
- package/dist/views/Request/RequestSidebarItemMenu.vue2.js +80 -80
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseSection.vue.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseSection.vue2.js +1 -1
- package/dist/views/Request/components/WorkspaceDropdown.vue.d.ts.map +1 -1
- package/dist/views/Request/components/WorkspaceDropdown.vue.js +166 -156
- package/dist/views/Request/handle-drag.d.ts.map +1 -1
- package/dist/views/Request/handle-drag.js +37 -31
- package/dist/views/Request/hooks/useOpenApiWatcher.js +27 -27
- package/dist/views/Request/libs/live-sync.d.ts.map +1 -1
- package/dist/views/Request/libs/live-sync.js +147 -130
- package/dist/views/Request/types/sidebar-item.d.ts +4 -1
- package/dist/views/Request/types/sidebar-item.d.ts.map +1 -1
- package/dist/views/Servers/ServerForm.vue.js +38 -35
- package/dist/views/Servers/Servers.vue2.js +38 -35
- package/dist/views/Settings/Settings.vue.d.ts.map +1 -1
- package/dist/views/Settings/Settings.vue2.js +15 -15
- package/dist/views/Settings/SettingsGeneral.vue.d.ts.map +1 -1
- package/dist/views/Settings/SettingsGeneral.vue.js +206 -174
- package/package.json +8 -8
|
@@ -1,109 +1,113 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useActiveEntities as
|
|
3
|
-
import { useLoadingState as
|
|
4
|
-
import { useToasts as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { isPostmanCollection as
|
|
9
|
-
import { getOpenApiDocumentDetails as
|
|
10
|
-
import { isUrl as
|
|
11
|
-
import { useFileDialog as
|
|
12
|
-
import { useWorkspace as
|
|
13
|
-
const
|
|
1
|
+
import { defineComponent as j, ref as D, computed as I, watch as L, openBlock as l, createBlock as U, unref as r, withCtx as m, createElementVNode as y, createVNode as x, createTextVNode as d, createElementBlock as i, Fragment as v, toDisplayString as V, createCommentVNode as E } from "vue";
|
|
2
|
+
import { useActiveEntities as W } from "../../store/active-entities.js";
|
|
3
|
+
import { useLoadingState as J, ScalarButton as R, ScalarIcon as Y, ScalarTooltip as q, ScalarCodeBlock as G } from "@scalar/components";
|
|
4
|
+
import { useToasts as H } from "@scalar/use-toasts";
|
|
5
|
+
import K from "./CommandActionForm.vue.js";
|
|
6
|
+
import Q from "./CommandActionInput.vue.js";
|
|
7
|
+
import X from "./WatchModeToggle.vue.js";
|
|
8
|
+
import { isPostmanCollection as P, getPostmanDocumentDetails as Z, convertPostmanToOpenApi as F } from "../../libs/postman.js";
|
|
9
|
+
import { getOpenApiDocumentDetails as ee } from "../../libs/getOpenApiDocumentDetails.js";
|
|
10
|
+
import { isUrl as C } from "../../libs/isUrl.js";
|
|
11
|
+
import { useFileDialog as te } from "../../hooks/useFileDialog.js";
|
|
12
|
+
import { useWorkspace as oe } from "../../store/store.js";
|
|
13
|
+
const ae = { class: "flex justify-between" }, le = { class: "flex flex-row items-center justify-between gap-3 w-full" }, ne = { class: "grid gap-1.5 pointer-events-none max-w-[320px] w-content shadow-lg rounded bg-b-1 z-100 p-2 text-xxs leading-5 z-10 text-c-1" }, se = { class: "flex items-center text-c-2" }, re = {
|
|
14
14
|
key: 0,
|
|
15
15
|
class: "text-pretty"
|
|
16
|
-
},
|
|
16
|
+
}, ie = {
|
|
17
17
|
key: 1,
|
|
18
18
|
class: "text-pretty"
|
|
19
|
-
},
|
|
19
|
+
}, he = /* @__PURE__ */ j({
|
|
20
20
|
__name: "CommandPaletteImport",
|
|
21
21
|
emits: ["close", "back"],
|
|
22
|
-
setup(
|
|
23
|
-
const
|
|
24
|
-
() =>
|
|
25
|
-
),
|
|
26
|
-
onChange: async (
|
|
27
|
-
const e =
|
|
22
|
+
setup(ue, { emit: T }) {
|
|
23
|
+
const S = T, { activeWorkspace: p } = W(), { importSpecFile: w, importSpecFromUrl: M } = oe(), { toast: u } = H(), c = J(), t = D(""), f = D(!0), s = I(() => P(t.value) ? Z(t.value) : ee(t.value)), _ = I(
|
|
24
|
+
() => s.value ? s.value.type : "json"
|
|
25
|
+
), g = I(() => C(t.value)), $ = I(() => !!s.value), { open: z } = te({
|
|
26
|
+
onChange: async (a) => {
|
|
27
|
+
const e = a == null ? void 0 : a[0];
|
|
28
28
|
if (e) {
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
var
|
|
32
|
-
const
|
|
29
|
+
const o = new FileReader();
|
|
30
|
+
o.onload = async (k) => {
|
|
31
|
+
var b, A, O;
|
|
32
|
+
const n = (b = k.target) == null ? void 0 : b.result;
|
|
33
33
|
try {
|
|
34
|
-
|
|
35
|
-
await
|
|
36
|
-
|
|
37
|
-
) : await
|
|
38
|
-
} catch (
|
|
39
|
-
console.error(
|
|
40
|
-
const
|
|
41
|
-
|
|
34
|
+
P(n) ? await w(
|
|
35
|
+
await F(n),
|
|
36
|
+
((A = p.value) == null ? void 0 : A.uid) ?? ""
|
|
37
|
+
) : await w(n, ((O = p.value) == null ? void 0 : O.uid) ?? ""), u("Import successful", "info"), S("close");
|
|
38
|
+
} catch (h) {
|
|
39
|
+
console.error(h);
|
|
40
|
+
const N = (h == null ? void 0 : h.message) || "Unknown error";
|
|
41
|
+
u(`Import failed: ${N}`, "error");
|
|
42
42
|
}
|
|
43
|
-
},
|
|
43
|
+
}, o.readAsText(e);
|
|
44
44
|
}
|
|
45
45
|
},
|
|
46
46
|
multiple: !1,
|
|
47
47
|
accept: ".json,.yaml,.yml"
|
|
48
48
|
});
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}),
|
|
52
|
-
|
|
49
|
+
L(g, (a) => {
|
|
50
|
+
a || (f.value = !1);
|
|
51
|
+
}), L(t, (a) => {
|
|
52
|
+
C(a) || (f.value = !1);
|
|
53
53
|
});
|
|
54
|
-
async function
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
async function B() {
|
|
55
|
+
var a, e, o, k;
|
|
56
|
+
if (!(!t.value || c.isLoading)) {
|
|
57
|
+
c.startLoading();
|
|
57
58
|
try {
|
|
58
|
-
if (
|
|
59
|
-
const [
|
|
59
|
+
if (g.value) {
|
|
60
|
+
const [n] = await M(
|
|
60
61
|
t.value,
|
|
61
|
-
|
|
62
|
+
((a = p.value) == null ? void 0 : a.uid) ?? "",
|
|
62
63
|
{
|
|
63
|
-
proxyUrl:
|
|
64
|
-
watchMode:
|
|
64
|
+
proxyUrl: (e = p.value) == null ? void 0 : e.proxyUrl,
|
|
65
|
+
watchMode: f.value
|
|
65
66
|
}
|
|
66
67
|
);
|
|
67
|
-
if (
|
|
68
|
-
|
|
68
|
+
if (n) {
|
|
69
|
+
u(
|
|
69
70
|
"There was a possible CORS error while importing your spec, please make sure this server is allowed in the CORS policy of your OpenAPI document.",
|
|
70
71
|
"error",
|
|
71
72
|
{ timeout: 5e3 }
|
|
72
|
-
),
|
|
73
|
+
), c.invalidate(2e3, !0);
|
|
73
74
|
return;
|
|
74
75
|
}
|
|
75
|
-
} else if (
|
|
76
|
-
|
|
77
|
-
await
|
|
78
|
-
|
|
79
|
-
),
|
|
76
|
+
} else if ($.value)
|
|
77
|
+
P(t.value) ? (await w(
|
|
78
|
+
await F(t.value),
|
|
79
|
+
((o = p.value) == null ? void 0 : o.uid) ?? ""
|
|
80
|
+
), u("Successfully converted Postman collection", "info")) : await w(
|
|
81
|
+
t.value,
|
|
82
|
+
((k = p.value) == null ? void 0 : k.uid) ?? ""
|
|
83
|
+
);
|
|
80
84
|
else {
|
|
81
|
-
|
|
85
|
+
u("Import failed: Invalid URL or OpenAPI document", "error"), c.invalidate(2e3, !0);
|
|
82
86
|
return;
|
|
83
87
|
}
|
|
84
|
-
|
|
85
|
-
} catch (
|
|
86
|
-
console.error("[importCollection]",
|
|
87
|
-
const
|
|
88
|
-
|
|
88
|
+
c.clear(), S("close"), u("Import successful", "info");
|
|
89
|
+
} catch (n) {
|
|
90
|
+
console.error("[importCollection]", n);
|
|
91
|
+
const b = (n == null ? void 0 : n.message) || "Unknown error";
|
|
92
|
+
c.invalidate(2e3, !0), u(`Import failed: ${b}`, "error");
|
|
89
93
|
}
|
|
90
94
|
}
|
|
91
95
|
}
|
|
92
|
-
return (
|
|
96
|
+
return (a, e) => (l(), U(K, {
|
|
93
97
|
disabled: !t.value.trim(),
|
|
94
|
-
loading:
|
|
95
|
-
onSubmit:
|
|
98
|
+
loading: r(c),
|
|
99
|
+
onSubmit: B
|
|
96
100
|
}, {
|
|
97
|
-
options:
|
|
98
|
-
|
|
99
|
-
|
|
101
|
+
options: m(() => [
|
|
102
|
+
y("div", le, [
|
|
103
|
+
x(r(R), {
|
|
100
104
|
class: "p-2 max-h-8 gap-1.5 text-xs hover:bg-b-2 relative",
|
|
101
105
|
variant: "outlined",
|
|
102
|
-
onClick:
|
|
106
|
+
onClick: r(z)
|
|
103
107
|
}, {
|
|
104
|
-
default:
|
|
105
|
-
e[6] || (e[6] =
|
|
106
|
-
|
|
108
|
+
default: m(() => [
|
|
109
|
+
e[6] || (e[6] = d(" JSON, or YAML File ")),
|
|
110
|
+
x(r(Y), {
|
|
107
111
|
class: "text-c-3",
|
|
108
112
|
icon: "UploadSimple",
|
|
109
113
|
size: "md"
|
|
@@ -111,23 +115,23 @@ const te = { class: "flex justify-between" }, oe = { class: "flex flex-row items
|
|
|
111
115
|
]),
|
|
112
116
|
_: 1
|
|
113
117
|
}, 8, ["onClick"]),
|
|
114
|
-
|
|
118
|
+
x(r(q), {
|
|
115
119
|
as: "div",
|
|
116
120
|
class: "z-[10001]",
|
|
117
121
|
side: "bottom",
|
|
118
122
|
sideOffset: 5
|
|
119
123
|
}, {
|
|
120
|
-
trigger:
|
|
121
|
-
|
|
122
|
-
modelValue:
|
|
123
|
-
"onUpdate:modelValue": e[3] || (e[3] = (
|
|
124
|
-
disabled: !
|
|
124
|
+
trigger: m(() => [
|
|
125
|
+
x(X, {
|
|
126
|
+
modelValue: f.value,
|
|
127
|
+
"onUpdate:modelValue": e[3] || (e[3] = (o) => f.value = o),
|
|
128
|
+
disabled: !g.value
|
|
125
129
|
}, null, 8, ["modelValue", "disabled"])
|
|
126
130
|
]),
|
|
127
|
-
content:
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
+
content: m(() => [
|
|
132
|
+
y("div", ne, [
|
|
133
|
+
y("div", se, [
|
|
134
|
+
g.value ? (l(), i("span", re, " Automatically updates the API client when the OpenAPI URL content changes, ensuring your client remains up-to-date. ")) : (l(), i("span", ie, " Watch Mode is only available for URL imports. It automatically updates the API client when the OpenAPI URL content changes. "))
|
|
131
135
|
])
|
|
132
136
|
])
|
|
133
137
|
]),
|
|
@@ -135,48 +139,48 @@ const te = { class: "flex justify-between" }, oe = { class: "flex flex-row items
|
|
|
135
139
|
})
|
|
136
140
|
])
|
|
137
141
|
]),
|
|
138
|
-
submit:
|
|
139
|
-
e[7] || (e[7] =
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
], 64)) :
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
], 64)) : (
|
|
146
|
-
|
|
142
|
+
submit: m(() => [
|
|
143
|
+
e[7] || (e[7] = d(" Import ")),
|
|
144
|
+
g.value ? (l(), i(v, { key: 0 }, [
|
|
145
|
+
d(" from URL ")
|
|
146
|
+
], 64)) : s.value && _.value ? (l(), i(v, { key: 1 }, [
|
|
147
|
+
s.value.title ? (l(), i(v, { key: 0 }, [
|
|
148
|
+
d(' "' + V(s.value.title) + '" ', 1)
|
|
149
|
+
], 64)) : (l(), i(v, { key: 1 }, [
|
|
150
|
+
d(V(s.value.version) + " Spec", 1)
|
|
147
151
|
], 64))
|
|
148
|
-
], 64)) : (
|
|
149
|
-
|
|
152
|
+
], 64)) : (l(), i(v, { key: 2 }, [
|
|
153
|
+
d("Collection")
|
|
150
154
|
], 64))
|
|
151
155
|
]),
|
|
152
|
-
default:
|
|
153
|
-
!
|
|
156
|
+
default: m(() => [
|
|
157
|
+
!s.value || r(C)(t.value) ? (l(), U(Q, {
|
|
154
158
|
key: 0,
|
|
155
159
|
modelValue: t.value,
|
|
156
|
-
"onUpdate:modelValue": e[0] || (e[0] = (
|
|
160
|
+
"onUpdate:modelValue": e[0] || (e[0] = (o) => t.value = o),
|
|
157
161
|
placeholder: "OpenAPI/Swagger/Postman URL or document",
|
|
158
|
-
onOnDelete: e[1] || (e[1] = (
|
|
159
|
-
}, null, 8, ["modelValue"])) : (
|
|
160
|
-
|
|
161
|
-
e[5] || (e[5] =
|
|
162
|
-
|
|
162
|
+
onOnDelete: e[1] || (e[1] = (o) => S("back", o))
|
|
163
|
+
}, null, 8, ["modelValue"])) : (l(), i(v, { key: 1 }, [
|
|
164
|
+
y("div", ae, [
|
|
165
|
+
e[5] || (e[5] = y("div", { class: "pl-8 text-xs min-h-8 py-2 text-c-2" }, "Preview", -1)),
|
|
166
|
+
x(r(R), {
|
|
163
167
|
class: "ml-auto p-2 max-h-8 gap-1.5 text-xs hover:bg-b-2 relative",
|
|
164
168
|
variant: "ghost",
|
|
165
|
-
onClick: e[2] || (e[2] = (
|
|
169
|
+
onClick: e[2] || (e[2] = (o) => t.value = "")
|
|
166
170
|
}, {
|
|
167
|
-
default:
|
|
168
|
-
|
|
171
|
+
default: m(() => e[4] || (e[4] = [
|
|
172
|
+
d(" Clear ")
|
|
169
173
|
])),
|
|
170
174
|
_: 1
|
|
171
175
|
})
|
|
172
176
|
]),
|
|
173
|
-
|
|
177
|
+
s.value && !r(C)(t.value) ? (l(), U(r(G), {
|
|
174
178
|
key: 0,
|
|
175
179
|
class: "border max-h-[40dvh] mt-1 bg-b-2 rounded [--scalar-small:--scalar-font-size-4]",
|
|
176
180
|
content: t.value,
|
|
177
181
|
copy: !1,
|
|
178
|
-
lang:
|
|
179
|
-
}, null, 8, ["content", "lang"])) :
|
|
182
|
+
lang: _.value
|
|
183
|
+
}, null, 8, ["content", "lang"])) : E("", !0)
|
|
180
184
|
], 64))
|
|
181
185
|
]),
|
|
182
186
|
_: 1
|
|
@@ -184,5 +188,5 @@ const te = { class: "flex justify-between" }, oe = { class: "flex flex-row items
|
|
|
184
188
|
}
|
|
185
189
|
});
|
|
186
190
|
export {
|
|
187
|
-
|
|
191
|
+
he as default
|
|
188
192
|
};
|
|
@@ -64,7 +64,7 @@ const J = { class: "flex" }, se = /* @__PURE__ */ W({
|
|
|
64
64
|
return t.label === ((a = (e = y.value) == null ? void 0 : e.tags) == null ? void 0 : a[0]);
|
|
65
65
|
})
|
|
66
66
|
), B = (t) => m.value = t, E = () => {
|
|
67
|
-
var e;
|
|
67
|
+
var e, a;
|
|
68
68
|
if (!o.value.trim()) {
|
|
69
69
|
N("Please enter a name before creating a request.", "error");
|
|
70
70
|
return;
|
|
@@ -85,7 +85,7 @@ const J = { class: "flex" }, se = /* @__PURE__ */ W({
|
|
|
85
85
|
t && M({
|
|
86
86
|
name: "request",
|
|
87
87
|
params: {
|
|
88
|
-
workspace: U.value.uid,
|
|
88
|
+
workspace: (a = U.value) == null ? void 0 : a.uid,
|
|
89
89
|
request: t.uid
|
|
90
90
|
}
|
|
91
91
|
}), b("close");
|
|
@@ -72,7 +72,7 @@ export declare const PaletteComponents: {
|
|
|
72
72
|
}> & Readonly<{
|
|
73
73
|
onClose?: (() => any) | undefined;
|
|
74
74
|
onBack?: ((e: KeyboardEvent) => any) | undefined;
|
|
75
|
-
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {},
|
|
75
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
76
76
|
};
|
|
77
77
|
/** Infer the types from the commands */
|
|
78
78
|
export type CommandNames = keyof typeof PaletteComponents;
|
|
@@ -2,7 +2,7 @@ import o from "./TheCommandPalette.vue2.js";
|
|
|
2
2
|
import { PaletteComponents as s } from "./TheCommandPalette.vue2.js";
|
|
3
3
|
/* empty css */
|
|
4
4
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
-
const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
5
|
+
const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-5143d9bb"]]);
|
|
6
6
|
export {
|
|
7
7
|
s as PaletteComponents,
|
|
8
8
|
a as default
|
|
@@ -85,75 +85,76 @@ const he = {
|
|
|
85
85
|
},
|
|
86
86
|
{
|
|
87
87
|
label: "Pages",
|
|
88
|
-
commands: se.map((
|
|
89
|
-
name:
|
|
90
|
-
icon:
|
|
91
|
-
path: `${
|
|
88
|
+
commands: se.map((o) => ({
|
|
89
|
+
name: o.prettyName,
|
|
90
|
+
icon: o.icon,
|
|
91
|
+
path: `${o.name}.default`
|
|
92
92
|
}))
|
|
93
93
|
}
|
|
94
94
|
], d = oe(), { push: W } = le(), { activeWorkspace: H } = re(), { events: f } = ve(), x = i(), l = i(""), s = i(null), c = i(-1), D = i([]), v = T(
|
|
95
|
-
() => S.reduce((
|
|
96
|
-
const t =
|
|
95
|
+
() => S.reduce((o, e) => {
|
|
96
|
+
const t = e.commands.filter(
|
|
97
97
|
(n) => n.name.toLowerCase().includes(l.value.toLowerCase())
|
|
98
98
|
);
|
|
99
|
-
return [...
|
|
99
|
+
return [...o, ...t];
|
|
100
100
|
}, [])
|
|
101
101
|
), h = () => {
|
|
102
102
|
d.hide(), l.value = "", s.value = null, c.value = -1;
|
|
103
|
-
}, O = (
|
|
104
|
-
l.value !== "" && (
|
|
105
|
-
var
|
|
106
|
-
return (
|
|
103
|
+
}, O = (o) => {
|
|
104
|
+
l.value !== "" && (o == null || o.preventDefault()), s.value = null, V(() => {
|
|
105
|
+
var e;
|
|
106
|
+
return (e = _.value) == null ? void 0 : e.focus();
|
|
107
107
|
});
|
|
108
|
-
}, $ = (
|
|
109
|
-
|
|
110
|
-
|
|
108
|
+
}, $ = (o) => {
|
|
109
|
+
var e;
|
|
110
|
+
"path" in o ? (W({
|
|
111
|
+
name: o.path,
|
|
111
112
|
params: {
|
|
112
|
-
workspace: H.value.uid
|
|
113
|
+
workspace: (e = H.value) == null ? void 0 : e.uid
|
|
113
114
|
}
|
|
114
|
-
}), h()) : s.value =
|
|
115
|
+
}), h()) : s.value = o.name;
|
|
115
116
|
}, _ = i(), I = ({
|
|
116
|
-
commandName:
|
|
117
|
-
metaData:
|
|
117
|
+
commandName: o,
|
|
118
|
+
metaData: e
|
|
118
119
|
} = {}) => {
|
|
119
|
-
s.value =
|
|
120
|
+
s.value = o ?? null, x.value = e, d.show(), V(() => {
|
|
120
121
|
var t;
|
|
121
122
|
return (t = _.value) == null ? void 0 : t.focus();
|
|
122
123
|
});
|
|
123
124
|
};
|
|
124
|
-
F(l, (
|
|
125
|
-
|
|
125
|
+
F(l, (o) => {
|
|
126
|
+
o && v.value.length > 0 && (c.value = 0);
|
|
126
127
|
});
|
|
127
|
-
const R = (
|
|
128
|
+
const R = (o, e) => {
|
|
128
129
|
var C;
|
|
129
130
|
if (!d.open) return;
|
|
130
|
-
|
|
131
|
-
const t =
|
|
131
|
+
e.preventDefault();
|
|
132
|
+
const t = o === "up" ? -1 : 1, n = v.value.length;
|
|
132
133
|
c.value = (c.value + t + n) % n, (C = D.value[c.value]) == null || C.scrollIntoView({
|
|
133
134
|
behavior: "smooth",
|
|
134
135
|
block: "nearest"
|
|
135
136
|
});
|
|
136
137
|
}, k = T(
|
|
137
138
|
() => v.value[c.value]
|
|
138
|
-
), U = (
|
|
139
|
-
!k.value || s.value || (
|
|
140
|
-
}, E = (
|
|
141
|
-
d.open &&
|
|
139
|
+
), U = (o) => {
|
|
140
|
+
!k.value || s.value || (o.preventDefault(), o.stopPropagation(), $(k.value));
|
|
141
|
+
}, E = (o) => {
|
|
142
|
+
d.open && o != null && o.closeModal && h();
|
|
142
143
|
};
|
|
143
144
|
return G(() => {
|
|
144
145
|
f.commandPalette.on(I), f.hotKeys.on(E);
|
|
145
146
|
}), Q(() => {
|
|
146
147
|
f.commandPalette.off(I), f.hotKeys.off(E);
|
|
147
|
-
}), (
|
|
148
|
+
}), (o, e) => (a(), z(r(te), {
|
|
148
149
|
open: r(d).open,
|
|
149
|
-
onClose:
|
|
150
|
+
onClose: e[5] || (e[5] = (t) => h())
|
|
150
151
|
}, {
|
|
151
152
|
default: y(() => [
|
|
152
|
-
|
|
153
|
+
e[7] || (e[7] = u("div", { class: "commandmenu-overlay z-overlay" }, null, -1)),
|
|
153
154
|
p(r(ne), { class: "commandmenu z-overlay flex flex-col" }, {
|
|
154
155
|
default: y(() => [
|
|
155
156
|
p(r(ae), { class: "sr-only" }, {
|
|
156
|
-
default: y(() =>
|
|
157
|
+
default: y(() => e[6] || (e[6] = [
|
|
157
158
|
K("API Client Command Menu")
|
|
158
159
|
])),
|
|
159
160
|
_: 1
|
|
@@ -162,7 +163,7 @@ const he = {
|
|
|
162
163
|
u("button", {
|
|
163
164
|
class: "absolute p-0.75 hover:bg-b-3 rounded text-c-3 active:text-c-1 mr-1.5 my-1.25 z-1",
|
|
164
165
|
type: "button",
|
|
165
|
-
onClick:
|
|
166
|
+
onClick: e[3] || (e[3] = (t) => s.value = null)
|
|
166
167
|
}, [
|
|
167
168
|
p(r(A), {
|
|
168
169
|
icon: "ChevronLeft",
|
|
@@ -171,7 +172,7 @@ const he = {
|
|
|
171
172
|
})
|
|
172
173
|
]),
|
|
173
174
|
(a(), z(Z(ge[s.value]), ee(x.value ? { metaData: x.value } : {}, {
|
|
174
|
-
onBack:
|
|
175
|
+
onBack: e[4] || (e[4] = (t) => O(t)),
|
|
175
176
|
onClose: h
|
|
176
177
|
}), null, 16))
|
|
177
178
|
])) : (a(), m("div", he, [
|
|
@@ -188,16 +189,16 @@ const he = {
|
|
|
188
189
|
id: "commandmenu",
|
|
189
190
|
ref_key: "commandInputRef",
|
|
190
191
|
ref: _,
|
|
191
|
-
"onUpdate:modelValue":
|
|
192
|
+
"onUpdate:modelValue": e[0] || (e[0] = (t) => l.value = t),
|
|
192
193
|
autocomplete: "off",
|
|
193
194
|
autofocus: "",
|
|
194
195
|
class: "w-full rounded bg-none border-none py-1.5 text-sm focus:outline-none",
|
|
195
196
|
placeholder: "Search commands...",
|
|
196
197
|
type: "text",
|
|
197
198
|
onKeydown: [
|
|
198
|
-
|
|
199
|
+
e[1] || (e[1] = w(g((t) => R("down", t), ["stop"]), ["down"])),
|
|
199
200
|
w(g(U, ["stop"]), ["enter"]),
|
|
200
|
-
|
|
201
|
+
e[2] || (e[2] = w(g((t) => R("up", t), ["stop"]), ["up"]))
|
|
201
202
|
]
|
|
202
203
|
}, null, 40, _e), [
|
|
203
204
|
[j, l.value]
|
|
@@ -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":";AA8cA,wBAMG"}
|