@scalar/api-client 2.1.35 → 2.1.37
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 +21 -0
- package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteImport.vue.js +105 -119
- package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/TheCommandPalette.vue.js +1 -1
- package/dist/components/CommandPalette/TheCommandPalette.vue2.js +14 -14
- package/dist/components/CommandPalette/WatchModeToggle.vue.d.ts +15 -0
- package/dist/components/CommandPalette/WatchModeToggle.vue.d.ts.map +1 -0
- package/dist/components/CommandPalette/WatchModeToggle.vue.js +39 -0
- package/dist/components/CommandPalette/WatchModeToggle.vue2.js +4 -0
- package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +1 -1
- package/dist/components/ImportCollection/DropEventListener.vue.d.ts.map +1 -1
- package/dist/components/ImportCollection/DropEventListener.vue.js +39 -33
- package/dist/components/ImportCollection/ImportCollectionListener.vue.d.ts.map +1 -1
- package/dist/components/ImportCollection/ImportCollectionListener.vue.js +22 -20
- package/dist/components/ImportCollection/ImportCollectionModal.vue.d.ts +2 -0
- package/dist/components/ImportCollection/ImportCollectionModal.vue.d.ts.map +1 -1
- package/dist/components/ImportCollection/ImportCollectionModal.vue.js +159 -100
- package/dist/components/ImportCollection/ImportCollectionModal.vue3.js +5 -0
- package/dist/components/ImportCollection/ImportNowButton.vue.d.ts +2 -0
- package/dist/components/ImportCollection/ImportNowButton.vue.d.ts.map +1 -1
- package/dist/components/ImportCollection/ImportNowButton.vue.js +35 -31
- package/dist/components/ImportCollection/IntegrationLogo.vue.d.ts +7 -0
- package/dist/components/ImportCollection/IntegrationLogo.vue.d.ts.map +1 -0
- package/dist/components/ImportCollection/IntegrationLogo.vue.js +46 -0
- package/dist/components/ImportCollection/IntegrationLogo.vue2.js +4 -0
- package/dist/components/ImportCollection/PrefetchError.vue.d.ts +8 -0
- package/dist/components/ImportCollection/PrefetchError.vue.d.ts.map +1 -0
- package/dist/components/ImportCollection/UrlQueryParameterChecker.vue.d.ts +2 -2
- package/dist/components/ImportCollection/UrlQueryParameterChecker.vue.d.ts.map +1 -1
- package/dist/components/ImportCollection/UrlQueryParameterChecker.vue.js +7 -7
- package/dist/components/ImportCollection/WorkspaceSelector.vue.d.ts.map +1 -1
- package/dist/components/ImportCollection/WorkspaceSelector.vue.js +2 -2
- package/dist/components/ImportCollection/hooks/useUrlPrefetcher.d.ts +29 -12
- package/dist/components/ImportCollection/hooks/useUrlPrefetcher.d.ts.map +1 -1
- package/dist/components/ImportCollection/hooks/useUrlPrefetcher.js +34 -42
- package/dist/components/OpenApiClientButton.vue.d.ts +13 -0
- package/dist/components/OpenApiClientButton.vue.d.ts.map +1 -0
- package/dist/components/OpenApiClientButton.vue.js +7 -0
- package/dist/components/OpenApiClientButton.vue2.js +36 -0
- package/dist/components/ViewLayout/ViewLayoutSection.vue.d.ts.map +1 -1
- package/dist/components/ViewLayout/ViewLayoutSection.vue.js +6 -6
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +4 -2
- package/dist/layouts/App/create-api-client-app.d.ts +58 -41
- package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
- package/dist/layouts/Modal/ApiClientModal.vue.d.ts.map +1 -1
- package/dist/layouts/Modal/ApiClientModal.vue.js +1 -1
- package/dist/layouts/Modal/create-api-client-modal.d.ts +116 -82
- package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
- package/dist/layouts/Web/ApiClientWeb.vue.d.ts.map +1 -1
- package/dist/layouts/Web/ApiClientWeb.vue.js +42 -38
- package/dist/layouts/Web/create-api-client-web.d.ts +58 -41
- package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
- package/dist/libs/create-client.d.ts +58 -41
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/store/collections.d.ts +34 -24
- package/dist/store/collections.d.ts.map +1 -1
- package/dist/store/import-spec.d.ts +6 -4
- package/dist/store/import-spec.d.ts.map +1 -1
- package/dist/store/store.d.ts +116 -82
- package/dist/store/store.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/views/Request/RequestSection/RequestSection.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestSection.vue2.js +7 -7
- package/dist/views/Request/RequestSidebar.vue.js +3 -3
- package/dist/views/Request/RequestSidebar.vue2.js +29 -29
- package/dist/views/Request/RequestSidebarItem.vue.js +2 -2
- package/dist/views/Request/RequestSidebarItem.vue2.js +76 -76
- package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts +2 -2
- package/dist/views/Request/RequestSidebarItemMenu.vue.js +3 -3
- package/dist/views/Request/RequestSidebarItemMenu.vue2.js +47 -47
- package/dist/views/Request/RequestSubpageHeader.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSubpageHeader.vue.js +1 -1
- package/dist/views/Request/RequestSubpageHeader.vue2.js +67 -42
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseSection.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseSection.vue.js +3 -3
- package/dist/views/Request/ResponseSection/ResponseSection.vue2.js +1 -1
- package/dist/views/Request/components/WorkspaceDropdown.vue.js +1 -1
- package/dist/views/Request/hooks/useOpenApiWatcher.js +24 -24
- package/dist/views/Request/types/sidebar-item.d.ts +1 -1
- package/dist/views/Request/types/sidebar-item.d.ts.map +1 -1
- package/package.json +7 -7
- package/dist/components/ImportCollection/ImportCollectionModal.vue2.js +0 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @scalar/api-client
|
|
2
2
|
|
|
3
|
+
## 2.1.37
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [931106f]
|
|
8
|
+
- @scalar/oas-utils@0.2.64
|
|
9
|
+
|
|
10
|
+
## 2.1.36
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- 84bd664: style: updates request section ui
|
|
15
|
+
- ada8545: feat: add the sidebar button
|
|
16
|
+
- 86104fd: fix(api-client): prevent spec import overflowing
|
|
17
|
+
- Updated dependencies [ad12c56]
|
|
18
|
+
- Updated dependencies [ada8545]
|
|
19
|
+
- @scalar/components@0.12.62
|
|
20
|
+
- @scalar/themes@0.9.44
|
|
21
|
+
- @scalar/oas-utils@0.2.63
|
|
22
|
+
- @scalar/use-codemirror@0.11.29
|
|
23
|
+
|
|
3
24
|
## 2.1.35
|
|
4
25
|
|
|
5
26
|
### Patch Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommandPaletteImport.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandPaletteImport.vue"],"names":[],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"CommandPaletteImport.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandPaletteImport.vue"],"names":[],"mappings":";;;;;;;AAipBA,wBASG"}
|
|
@@ -1,102 +1,106 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useLoadingState as
|
|
3
|
-
import { useToasts as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
1
|
+
import { defineComponent as $, ref as U, computed as k, watch as _, openBlock as a, createBlock as h, unref as r, withCtx as u, createElementVNode as f, createVNode as g, createTextVNode as c, createElementBlock as s, Fragment as d, toDisplayString as A, createCommentVNode as z } from "vue";
|
|
2
|
+
import { useLoadingState as B, ScalarButton as O, ScalarIcon as N, ScalarTooltip as j, ScalarCodeBlock as W } from "@scalar/components";
|
|
3
|
+
import { useToasts as E } from "@scalar/use-toasts";
|
|
4
|
+
import J from "./CommandActionForm.vue.js";
|
|
5
|
+
import Y from "./CommandActionInput.vue.js";
|
|
6
|
+
import q from "./WatchModeToggle.vue.js";
|
|
7
|
+
import { getOpenApiDocumentDetails as G } from "../../libs/getOpenApiDocumentDetails.js";
|
|
8
|
+
import { isUrl as w } from "../../libs/isUrl.js";
|
|
9
|
+
import { useFileDialog as H } from "../../hooks/useFileDialog.js";
|
|
10
|
+
import { useWorkspace as K } from "../../store/store.js";
|
|
11
|
+
const Q = { class: "flex justify-between" }, X = { class: "flex flex-row items-center justify-between gap-3 w-full" }, Z = { 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" }, ee = { class: "flex items-center text-c-2" }, te = {
|
|
12
|
+
key: 0,
|
|
13
|
+
class: "text-pretty"
|
|
14
|
+
}, oe = {
|
|
11
15
|
key: 1,
|
|
12
16
|
class: "text-pretty"
|
|
13
|
-
}, ve = /* @__PURE__ */
|
|
17
|
+
}, ve = /* @__PURE__ */ $({
|
|
14
18
|
__name: "CommandPaletteImport",
|
|
15
19
|
emits: ["close", "back"],
|
|
16
|
-
setup(
|
|
17
|
-
const b =
|
|
18
|
-
() =>
|
|
19
|
-
), S =
|
|
20
|
-
() =>
|
|
21
|
-
), v =
|
|
22
|
-
onChange: async (
|
|
23
|
-
const e =
|
|
20
|
+
setup(ae, { emit: L }) {
|
|
21
|
+
const b = L, { activeWorkspace: y, importSpecFile: I, importSpecFromUrl: V } = K(), { toast: m } = E(), i = B(), o = U(""), p = U(!0), l = k(
|
|
22
|
+
() => G(o.value)
|
|
23
|
+
), S = k(
|
|
24
|
+
() => l.value ? l.value.type : "json"
|
|
25
|
+
), v = k(() => w(o.value)), P = k(() => !!l.value), { open: R } = H({
|
|
26
|
+
onChange: async (t) => {
|
|
27
|
+
const e = t == null ? void 0 : t[0];
|
|
24
28
|
if (e) {
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
var
|
|
28
|
-
const
|
|
29
|
+
const n = new FileReader();
|
|
30
|
+
n.onload = async (F) => {
|
|
31
|
+
var C;
|
|
32
|
+
const M = (C = F.target) == null ? void 0 : C.result;
|
|
29
33
|
try {
|
|
30
|
-
await
|
|
31
|
-
} catch (
|
|
32
|
-
console.error(
|
|
33
|
-
const
|
|
34
|
-
m(`Import failed: ${
|
|
34
|
+
await I(M, y.value.uid), m("Import successful", "info"), b("close");
|
|
35
|
+
} catch (x) {
|
|
36
|
+
console.error(x);
|
|
37
|
+
const T = (x == null ? void 0 : x.message) || "Unknown error";
|
|
38
|
+
m(`Import failed: ${T}`, "error");
|
|
35
39
|
}
|
|
36
|
-
},
|
|
40
|
+
}, n.readAsText(e);
|
|
37
41
|
}
|
|
38
42
|
},
|
|
39
43
|
multiple: !1,
|
|
40
44
|
accept: ".json,.yaml,.yml"
|
|
41
45
|
});
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}),
|
|
45
|
-
|
|
46
|
+
_(v, (t) => {
|
|
47
|
+
t || (p.value = !1);
|
|
48
|
+
}), _(o, (t) => {
|
|
49
|
+
w(t) || (p.value = !1);
|
|
46
50
|
});
|
|
47
|
-
async function
|
|
48
|
-
if (!(!
|
|
49
|
-
|
|
51
|
+
async function D() {
|
|
52
|
+
if (!(!o.value || i.isLoading)) {
|
|
53
|
+
i.startLoading();
|
|
50
54
|
try {
|
|
51
55
|
if (v.value) {
|
|
52
|
-
const [
|
|
53
|
-
|
|
54
|
-
|
|
56
|
+
const [t] = await V(
|
|
57
|
+
o.value,
|
|
58
|
+
y.value.uid,
|
|
55
59
|
{
|
|
56
|
-
proxy:
|
|
57
|
-
|
|
60
|
+
proxy: y.value.proxyUrl,
|
|
61
|
+
watchMode: p.value
|
|
58
62
|
}
|
|
59
63
|
);
|
|
60
|
-
if (
|
|
64
|
+
if (t) {
|
|
61
65
|
m(
|
|
62
66
|
"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.",
|
|
63
67
|
"error",
|
|
64
68
|
{ timeout: 5e3 }
|
|
65
|
-
),
|
|
69
|
+
), i.invalidate(2e3, !0);
|
|
66
70
|
return;
|
|
67
71
|
}
|
|
68
|
-
} else if (
|
|
69
|
-
await
|
|
70
|
-
String(
|
|
71
|
-
|
|
72
|
+
} else if (P.value)
|
|
73
|
+
await I(
|
|
74
|
+
String(o.value),
|
|
75
|
+
y.value.uid
|
|
72
76
|
);
|
|
73
77
|
else {
|
|
74
|
-
m("Import failed: Invalid URL or OpenAPI document", "error"),
|
|
78
|
+
m("Import failed: Invalid URL or OpenAPI document", "error"), i.invalidate(2e3, !0);
|
|
75
79
|
return;
|
|
76
80
|
}
|
|
77
|
-
|
|
78
|
-
} catch (
|
|
79
|
-
console.error("[importCollection]",
|
|
80
|
-
const e = (
|
|
81
|
-
|
|
81
|
+
i.clear(), b("close"), m("Import successful", "info");
|
|
82
|
+
} catch (t) {
|
|
83
|
+
console.error("[importCollection]", t);
|
|
84
|
+
const e = (t == null ? void 0 : t.message) || "Unknown error";
|
|
85
|
+
i.invalidate(2e3, !0), m(`Import failed: ${e}`, "error");
|
|
82
86
|
}
|
|
83
87
|
}
|
|
84
88
|
}
|
|
85
|
-
return (
|
|
86
|
-
disabled: !
|
|
87
|
-
loading:
|
|
88
|
-
onSubmit:
|
|
89
|
+
return (t, e) => (a(), h(J, {
|
|
90
|
+
disabled: !o.value.trim(),
|
|
91
|
+
loading: r(i),
|
|
92
|
+
onSubmit: D
|
|
89
93
|
}, {
|
|
90
|
-
options:
|
|
91
|
-
|
|
92
|
-
|
|
94
|
+
options: u(() => [
|
|
95
|
+
f("div", X, [
|
|
96
|
+
g(r(O), {
|
|
93
97
|
class: "p-2 max-h-8 gap-1.5 text-xs hover:bg-b-2 relative",
|
|
94
98
|
variant: "outlined",
|
|
95
|
-
onClick:
|
|
99
|
+
onClick: r(R)
|
|
96
100
|
}, {
|
|
97
|
-
default:
|
|
98
|
-
e[6] || (e[6] =
|
|
99
|
-
|
|
101
|
+
default: u(() => [
|
|
102
|
+
e[6] || (e[6] = c(" JSON, or YAML File ")),
|
|
103
|
+
g(r(N), {
|
|
100
104
|
class: "text-c-3",
|
|
101
105
|
icon: "UploadSimple",
|
|
102
106
|
size: "md"
|
|
@@ -104,41 +108,23 @@ const X = { class: "flex justify-between" }, Z = { class: "flex flex-row items-c
|
|
|
104
108
|
]),
|
|
105
109
|
_: 1
|
|
106
110
|
}, 8, ["onClick"]),
|
|
107
|
-
|
|
111
|
+
g(r(j), {
|
|
108
112
|
as: "div",
|
|
109
113
|
class: "z-[10001]",
|
|
110
114
|
side: "bottom",
|
|
111
115
|
sideOffset: 5
|
|
112
116
|
}, {
|
|
113
|
-
trigger:
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
for: "watch-toggle"
|
|
120
|
-
}, [
|
|
121
|
-
d("span", {
|
|
122
|
-
class: V(["text-c-1 flex gap-1 items-center font-medium text-xs", { "text-c-3": !p.value }])
|
|
123
|
-
}, [
|
|
124
|
-
f(l(L), {
|
|
125
|
-
icon: "Watch",
|
|
126
|
-
size: "sm"
|
|
127
|
-
}),
|
|
128
|
-
e[7] || (e[7] = n(" Watch Mode "))
|
|
129
|
-
], 2),
|
|
130
|
-
f(l(E), {
|
|
131
|
-
id: "watch-toggle",
|
|
132
|
-
modelValue: p.value,
|
|
133
|
-
"onUpdate:modelValue": e[3] || (e[3] = (s) => p.value = s),
|
|
134
|
-
disabled: !!t.value && !v.value
|
|
135
|
-
}, null, 8, ["modelValue", "disabled"])
|
|
136
|
-
], 2)
|
|
117
|
+
trigger: u(() => [
|
|
118
|
+
g(q, {
|
|
119
|
+
modelValue: p.value,
|
|
120
|
+
"onUpdate:modelValue": e[3] || (e[3] = (n) => p.value = n),
|
|
121
|
+
disabled: !v.value
|
|
122
|
+
}, null, 8, ["modelValue", "disabled"])
|
|
137
123
|
]),
|
|
138
|
-
content:
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
124
|
+
content: u(() => [
|
|
125
|
+
f("div", Z, [
|
|
126
|
+
f("div", ee, [
|
|
127
|
+
v.value ? (a(), s("span", te, " Automatically updates the API client when the OpenAPI URL content changes, ensuring your client remains up-to-date. ")) : (a(), s("span", oe, " Watch Mode is only available for URL imports. It automatically updates the API client when the OpenAPI URL content changes. "))
|
|
142
128
|
])
|
|
143
129
|
])
|
|
144
130
|
]),
|
|
@@ -146,48 +132,48 @@ const X = { class: "flex justify-between" }, Z = { class: "flex flex-row items-c
|
|
|
146
132
|
})
|
|
147
133
|
])
|
|
148
134
|
]),
|
|
149
|
-
submit:
|
|
150
|
-
e[
|
|
151
|
-
v.value ? (a(),
|
|
152
|
-
|
|
153
|
-
], 64)) :
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
], 64)) : (a(),
|
|
157
|
-
|
|
135
|
+
submit: u(() => [
|
|
136
|
+
e[7] || (e[7] = c(" Import ")),
|
|
137
|
+
v.value ? (a(), s(d, { key: 0 }, [
|
|
138
|
+
c(" from URL ")
|
|
139
|
+
], 64)) : l.value && S.value ? (a(), s(d, { key: 1 }, [
|
|
140
|
+
l.value.title ? (a(), s(d, { key: 0 }, [
|
|
141
|
+
c(' "' + A(l.value.title) + '" ', 1)
|
|
142
|
+
], 64)) : (a(), s(d, { key: 1 }, [
|
|
143
|
+
c(A(l.value.version) + " Spec", 1)
|
|
158
144
|
], 64))
|
|
159
|
-
], 64)) : (a(),
|
|
160
|
-
|
|
145
|
+
], 64)) : (a(), s(d, { key: 2 }, [
|
|
146
|
+
c("Collection")
|
|
161
147
|
], 64))
|
|
162
148
|
]),
|
|
163
|
-
default:
|
|
164
|
-
!
|
|
149
|
+
default: u(() => [
|
|
150
|
+
!l.value || r(w)(o.value) ? (a(), h(Y, {
|
|
165
151
|
key: 0,
|
|
166
|
-
modelValue:
|
|
167
|
-
"onUpdate:modelValue": e[0] || (e[0] = (
|
|
152
|
+
modelValue: o.value,
|
|
153
|
+
"onUpdate:modelValue": e[0] || (e[0] = (n) => o.value = n),
|
|
168
154
|
placeholder: "OpenAPI/Swagger URL or document",
|
|
169
|
-
onOnDelete: e[1] || (e[1] = (
|
|
170
|
-
}, null, 8, ["modelValue"])) : (a(),
|
|
171
|
-
|
|
172
|
-
e[5] || (e[5] =
|
|
173
|
-
|
|
155
|
+
onOnDelete: e[1] || (e[1] = (n) => b("back", n))
|
|
156
|
+
}, null, 8, ["modelValue"])) : (a(), s(d, { key: 1 }, [
|
|
157
|
+
f("div", Q, [
|
|
158
|
+
e[5] || (e[5] = f("div", { class: "pl-8 text-xs min-h-8 py-2 text-c-2" }, "Preview", -1)),
|
|
159
|
+
g(r(O), {
|
|
174
160
|
class: "ml-auto p-2 max-h-8 gap-1.5 text-xs hover:bg-b-2 relative",
|
|
175
161
|
variant: "ghost",
|
|
176
|
-
onClick: e[2] || (e[2] = (
|
|
162
|
+
onClick: e[2] || (e[2] = (n) => o.value = "")
|
|
177
163
|
}, {
|
|
178
|
-
default:
|
|
179
|
-
|
|
164
|
+
default: u(() => e[4] || (e[4] = [
|
|
165
|
+
c(" Clear ")
|
|
180
166
|
])),
|
|
181
167
|
_: 1
|
|
182
168
|
})
|
|
183
169
|
]),
|
|
184
|
-
|
|
170
|
+
l.value && !r(w)(o.value) ? (a(), h(r(W), {
|
|
185
171
|
key: 0,
|
|
186
172
|
class: "border max-h-[40dvh] mt-1 bg-b-2 rounded [--scalar-small:--scalar-font-size-4]",
|
|
187
|
-
content:
|
|
173
|
+
content: o.value,
|
|
188
174
|
copy: !1,
|
|
189
175
|
lang: S.value
|
|
190
|
-
}, null, 8, ["content", "lang"])) :
|
|
176
|
+
}, null, 8, ["content", "lang"])) : z("", !0)
|
|
191
177
|
], 64))
|
|
192
178
|
]),
|
|
193
179
|
_: 1
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TheCommandPalette.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/TheCommandPalette.vue"],"names":[],"mappings":"AAwYA;;;;GAIG;;AACH,
|
|
1
|
+
{"version":3,"file":"TheCommandPalette.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/TheCommandPalette.vue"],"names":[],"mappings":"AAwYA;;;;GAIG;;AACH,wBAugBI;AAEJ,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQpB,CAAA;AAEV,yCAAyC;AACzC,MAAM,MAAM,YAAY,GAAG,MAAM,OAAO,iBAAiB,CAAA;AAEzD,MAAM,MAAM,mBAAmB,GAAG;IAChC,8DAA8D;IAC9D,WAAW,CAAC,EAAE,YAAY,CAAA;IAC1B,iEAAiE;IACjE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAC/B,CACA"}
|
|
@@ -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 r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
5
|
+
const r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-feffe6c9"]]);
|
|
6
6
|
export {
|
|
7
7
|
s as PaletteComponents,
|
|
8
8
|
r as default
|
|
@@ -13,8 +13,8 @@ import pe from "./CommandPaletteWorkspace.vue.js";
|
|
|
13
13
|
import { useWorkspace as fe } from "../../store/store.js";
|
|
14
14
|
const ve = {
|
|
15
15
|
key: 0,
|
|
16
|
-
class: "flex-1 min-h-0 p-1.5 custom-scroll rounded-lg"
|
|
17
|
-
},
|
|
16
|
+
class: "flex-1 min-h-0 max-h-[50dvh] p-1.5 custom-scroll rounded-lg"
|
|
17
|
+
}, he = { class: "bg-b-2 border border-transparent flex items-center rounded-md sticky top-0 pl-2 shadow-[0_-8px_0_8px_var(--scalar-background-1),0_0_8px_8px_var(--scalar-background-1)] focus-within:bg-b-1 focus-within:border-b-3" }, Ce = { for: "commandmenu" }, xe = ["onKeydown"], _e = ["onClick"], ke = {
|
|
18
18
|
key: 0,
|
|
19
19
|
class: "text-c-3 text-center text-sm p-2 pt-3"
|
|
20
20
|
}, be = {
|
|
@@ -97,7 +97,7 @@ const ve = {
|
|
|
97
97
|
);
|
|
98
98
|
return [...e, ...t];
|
|
99
99
|
}, [])
|
|
100
|
-
),
|
|
100
|
+
), h = () => {
|
|
101
101
|
d.hide(), l.value = "", s.value = null, c.value = -1;
|
|
102
102
|
}, O = (e) => {
|
|
103
103
|
l.value !== "" && (e == null || e.preventDefault()), s.value = null, V(() => {
|
|
@@ -105,7 +105,7 @@ const ve = {
|
|
|
105
105
|
return (o = _.value) == null ? void 0 : o.focus();
|
|
106
106
|
});
|
|
107
107
|
}, D = (e) => {
|
|
108
|
-
"path" in e ? (W(`/workspace/${H.value.uid}${e.path}`),
|
|
108
|
+
"path" in e ? (W(`/workspace/${H.value.uid}${e.path}`), h()) : s.value = e.name;
|
|
109
109
|
}, _ = i(), I = ({
|
|
110
110
|
commandName: e,
|
|
111
111
|
metaData: o
|
|
@@ -119,11 +119,11 @@ const ve = {
|
|
|
119
119
|
e && v.value.length > 0 && (c.value = 0);
|
|
120
120
|
});
|
|
121
121
|
const R = (e, o) => {
|
|
122
|
-
var
|
|
122
|
+
var C;
|
|
123
123
|
if (!d.open) return;
|
|
124
124
|
o.preventDefault();
|
|
125
125
|
const t = e === "up" ? -1 : 1, n = v.value.length;
|
|
126
|
-
c.value = (c.value + t + n) % n, (
|
|
126
|
+
c.value = (c.value + t + n) % n, (C = $.value[c.value]) == null || C.scrollIntoView({
|
|
127
127
|
behavior: "smooth",
|
|
128
128
|
block: "nearest"
|
|
129
129
|
});
|
|
@@ -132,7 +132,7 @@ const ve = {
|
|
|
132
132
|
), U = (e) => {
|
|
133
133
|
!k.value || s.value || (e.preventDefault(), e.stopPropagation(), D(k.value));
|
|
134
134
|
}, L = (e) => {
|
|
135
|
-
d.open && e != null && e.closeModal &&
|
|
135
|
+
d.open && e != null && e.closeModal && h();
|
|
136
136
|
};
|
|
137
137
|
return G(() => {
|
|
138
138
|
f.commandPalette.on(I), f.hotKeys.on(L);
|
|
@@ -140,11 +140,11 @@ const ve = {
|
|
|
140
140
|
f.commandPalette.off(I), f.hotKeys.off(L);
|
|
141
141
|
}), (e, o) => (a(), z(r(te), {
|
|
142
142
|
open: r(d).open,
|
|
143
|
-
onClose: o[5] || (o[5] = (t) =>
|
|
143
|
+
onClose: o[5] || (o[5] = (t) => h())
|
|
144
144
|
}, {
|
|
145
145
|
default: y(() => [
|
|
146
146
|
o[7] || (o[7] = u("div", { class: "commandmenu-overlay z-overlay" }, null, -1)),
|
|
147
|
-
p(r(ne), { class: "commandmenu z-overlay flex flex-
|
|
147
|
+
p(r(ne), { class: "commandmenu z-overlay flex flex-col" }, {
|
|
148
148
|
default: y(() => [
|
|
149
149
|
p(r(ae), { class: "sr-only" }, {
|
|
150
150
|
default: y(() => o[6] || (o[6] = [
|
|
@@ -166,11 +166,11 @@ const ve = {
|
|
|
166
166
|
]),
|
|
167
167
|
(a(), z(Z(we[s.value]), ee(x.value ? { metaData: x.value } : {}, {
|
|
168
168
|
onBack: o[4] || (o[4] = (t) => O(t)),
|
|
169
|
-
onClose:
|
|
169
|
+
onClose: h
|
|
170
170
|
}), null, 16))
|
|
171
171
|
])) : (a(), m("div", ve, [
|
|
172
|
-
u("div",
|
|
173
|
-
u("label",
|
|
172
|
+
u("div", he, [
|
|
173
|
+
u("label", Ce, [
|
|
174
174
|
p(r(A), {
|
|
175
175
|
class: "text-c-2 mr-2.5",
|
|
176
176
|
icon: "Search",
|
|
@@ -210,13 +210,13 @@ const ve = {
|
|
|
210
210
|
]),
|
|
211
211
|
(a(!0), m(S, null, B(t.commands.filter(
|
|
212
212
|
(n) => n.name.toLowerCase().includes(l.value.toLowerCase())
|
|
213
|
-
), (n,
|
|
213
|
+
), (n, C) => {
|
|
214
214
|
var E;
|
|
215
215
|
return a(), m("div", {
|
|
216
216
|
key: n.name,
|
|
217
217
|
ref_for: !0,
|
|
218
218
|
ref: (b) => {
|
|
219
|
-
b && ($.value[
|
|
219
|
+
b && ($.value[C] = b);
|
|
220
220
|
},
|
|
221
221
|
class: X(["commandmenu-item text-sm flex items-center py-1.5 px-2 rounded hover:bg-b-2 cursor-pointer", {
|
|
222
222
|
"bg-b-2": n.name === ((E = k.value) == null ? void 0 : E.name)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{
|
|
2
|
+
modelValue: boolean;
|
|
3
|
+
disabled?: boolean;
|
|
4
|
+
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
5
|
+
"update:modelValue": (value: boolean) => any;
|
|
6
|
+
}, string, import("vue").PublicProps, Readonly<{
|
|
7
|
+
modelValue: boolean;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
}> & Readonly<{
|
|
10
|
+
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
11
|
+
}>, {
|
|
12
|
+
disabled: boolean;
|
|
13
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
14
|
+
export default _default;
|
|
15
|
+
//# sourceMappingURL=WatchModeToggle.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WatchModeToggle.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/WatchModeToggle.vue"],"names":[],"mappings":";gBAoDgB,OAAO;eACR,OAAO;;;;gBADN,OAAO;eACR,OAAO;;;;cAAP,OAAO;;AA8HtB,wBAUG"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { defineComponent as c, computed as p, openBlock as i, createElementBlock as f, normalizeClass as a, createElementVNode as V, createVNode as d, unref as s, createTextVNode as g } from "vue";
|
|
2
|
+
import { ScalarIcon as x, ScalarToggle as b } from "@scalar/components";
|
|
3
|
+
const N = /* @__PURE__ */ c({
|
|
4
|
+
__name: "WatchModeToggle",
|
|
5
|
+
props: {
|
|
6
|
+
modelValue: { type: Boolean },
|
|
7
|
+
disabled: { type: Boolean, default: !1 }
|
|
8
|
+
},
|
|
9
|
+
emits: ["update:modelValue"],
|
|
10
|
+
setup(n, { emit: m }) {
|
|
11
|
+
const r = n, l = m, o = p({
|
|
12
|
+
get: () => r.modelValue,
|
|
13
|
+
set: (e) => l("update:modelValue", e)
|
|
14
|
+
});
|
|
15
|
+
return (e, t) => (i(), f("label", {
|
|
16
|
+
class: a(["p-3 py-1.5 rounded flex items-center text-sm text-c-2 gap-2 select-none", e.disabled ? "cursor-default" : "cursor-pointer"]),
|
|
17
|
+
for: "watch-toggle"
|
|
18
|
+
}, [
|
|
19
|
+
V("span", {
|
|
20
|
+
class: a(["text-c-1 flex gap-1 items-center font-medium text-xs", { "text-c-3": !o.value }])
|
|
21
|
+
}, [
|
|
22
|
+
d(s(x), {
|
|
23
|
+
icon: "Watch",
|
|
24
|
+
size: "sm"
|
|
25
|
+
}),
|
|
26
|
+
t[1] || (t[1] = g(" Watch Mode "))
|
|
27
|
+
], 2),
|
|
28
|
+
d(s(b), {
|
|
29
|
+
id: "watch-toggle",
|
|
30
|
+
disabled: e.disabled,
|
|
31
|
+
modelValue: o.value,
|
|
32
|
+
"onUpdate:modelValue": t[0] || (t[0] = (u) => l("update:modelValue", u))
|
|
33
|
+
}, null, 8, ["disabled", "modelValue"])
|
|
34
|
+
], 2));
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
export {
|
|
38
|
+
N as default
|
|
39
|
+
};
|
|
@@ -84,7 +84,7 @@ const W = { class: "font-medium m-0 text-xs flex gap-1.5 items-center whitespace
|
|
|
84
84
|
]),
|
|
85
85
|
default: r(() => [
|
|
86
86
|
n(e(I), {
|
|
87
|
-
class: "font-normal h-auto justify-start py-1.5 px-1.5 pl-2 text-c-1 hover:bg-b-2 text-c-
|
|
87
|
+
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
88
|
fullWidth: "",
|
|
89
89
|
variant: "ghost"
|
|
90
90
|
}, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropEventListener.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCollection/DropEventListener.vue"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"DropEventListener.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCollection/DropEventListener.vue"],"names":[],"mappings":";;;;;AAkVA,wBAQG"}
|
|
@@ -1,70 +1,76 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarIcon as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as g, ref as y, onMounted as x, onBeforeUnmount as h, openBlock as p, createBlock as D, Transition as E, withCtx as T, createElementBlock as _, createElementVNode as i, createVNode as L, unref as C, createCommentVNode as b } from "vue";
|
|
2
|
+
import { ScalarIcon as k } from "@scalar/components";
|
|
3
|
+
const A = {
|
|
4
4
|
key: 0,
|
|
5
|
-
class: "fixed bottom-10 right-10 w-64 h-64 bg-b-2 z-50 rounded-xl border transition-opacity duration-200"
|
|
6
|
-
}, w = { class: "flex flex-col items-center justify-center h-full" }, V = /* @__PURE__ */
|
|
5
|
+
class: "fixed translate-x-1/2 translate-y-1/2 md:translate-x-0 md:translate-y-0 right-1/2 bottom-1/2 md:bottom-10 md:right-10 w-64 h-64 bg-b-2 z-50 rounded-xl border transition-opacity duration-200"
|
|
6
|
+
}, w = { class: "flex flex-col items-center justify-center h-full" }, V = /* @__PURE__ */ g({
|
|
7
7
|
__name: "DropEventListener",
|
|
8
8
|
emits: ["input"],
|
|
9
|
-
setup(
|
|
10
|
-
const d =
|
|
9
|
+
setup(B, { emit: v }) {
|
|
10
|
+
const d = v, r = y(!1);
|
|
11
11
|
let o = 0;
|
|
12
|
-
|
|
13
|
-
document.addEventListener("dragenter",
|
|
12
|
+
x(() => {
|
|
13
|
+
document.addEventListener("dragenter", m), document.addEventListener("dragleave", f), document.addEventListener("dragover", u), document.addEventListener("drop", c);
|
|
14
14
|
}), h(() => {
|
|
15
|
-
document.removeEventListener("dragenter",
|
|
15
|
+
document.removeEventListener("dragenter", m), document.removeEventListener("dragover", u), document.removeEventListener("dragleave", f), document.removeEventListener("drop", c);
|
|
16
16
|
});
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
function l(e) {
|
|
18
|
+
var t;
|
|
19
|
+
return ((t = e.dataTransfer) == null ? void 0 : t.types.includes("text/html")) ?? !1;
|
|
20
|
+
}
|
|
21
|
+
async function c(e) {
|
|
22
|
+
if (e.preventDefault(), r.value = !1, o = 0, !l(e) && e.dataTransfer) {
|
|
19
23
|
const t = e.dataTransfer.getData("text").replace(/^blob:/, "");
|
|
20
24
|
if (t)
|
|
21
25
|
d("input", t);
|
|
22
26
|
else if (e.dataTransfer.files.length > 0) {
|
|
23
27
|
const a = e.dataTransfer.files[0], n = new FileReader();
|
|
24
|
-
n.onload = async (
|
|
25
|
-
|
|
28
|
+
n.onload = async (s) => {
|
|
29
|
+
s.target && typeof s.target.result == "string" && d("input", s.target.result);
|
|
26
30
|
}, n.readAsText(a);
|
|
27
31
|
}
|
|
28
32
|
}
|
|
29
33
|
}
|
|
30
|
-
function
|
|
34
|
+
function u(e) {
|
|
31
35
|
e.preventDefault();
|
|
32
36
|
}
|
|
33
|
-
function
|
|
37
|
+
function f(e) {
|
|
34
38
|
e.preventDefault(), o--, o === 0 && (r.value = !1);
|
|
35
39
|
}
|
|
36
|
-
function
|
|
37
|
-
if (e.preventDefault(), o++, e
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
function m(e) {
|
|
41
|
+
if (e.preventDefault(), o++, !l(e)) {
|
|
42
|
+
if (e.dataTransfer) {
|
|
43
|
+
const t = e.dataTransfer.items;
|
|
44
|
+
for (let a = 0; a < t.length; a++) {
|
|
45
|
+
const n = t[a];
|
|
46
|
+
if (n.kind === "string" || n.type.includes("json") || n.type.includes("yml") || n.type.includes("yaml")) {
|
|
47
|
+
r.value = !0;
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
44
50
|
}
|
|
45
51
|
}
|
|
52
|
+
r.value = !1;
|
|
46
53
|
}
|
|
47
|
-
r.value = !1;
|
|
48
54
|
}
|
|
49
|
-
return (e, t) => (
|
|
55
|
+
return (e, t) => (p(), D(E, {
|
|
50
56
|
enterActiveClass: "transition-opacity duration-200",
|
|
51
57
|
enterFromClass: "opacity-0",
|
|
52
58
|
leaveActiveClass: "transition-opacity duration-200",
|
|
53
59
|
leaveToClass: "opacity-0"
|
|
54
60
|
}, {
|
|
55
|
-
default:
|
|
56
|
-
r.value ? (
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
L(
|
|
61
|
+
default: T(() => [
|
|
62
|
+
r.value ? (p(), _("div", A, [
|
|
63
|
+
i("div", w, [
|
|
64
|
+
i("div", null, [
|
|
65
|
+
L(C(k), {
|
|
60
66
|
icon: "Download",
|
|
61
67
|
size: "xl",
|
|
62
68
|
thickness: "2"
|
|
63
69
|
})
|
|
64
70
|
]),
|
|
65
|
-
t[0] || (t[0] =
|
|
71
|
+
t[0] || (t[0] = i("div", { class: "text-center text-c-1 m-4" }, " Drop your OpenAPI document here ", -1))
|
|
66
72
|
])
|
|
67
|
-
])) :
|
|
73
|
+
])) : b("", !0)
|
|
68
74
|
]),
|
|
69
75
|
_: 1
|
|
70
76
|
}));
|