@scalar/api-client 2.1.19 → 2.1.20
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 +12 -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 +77 -79
- package/dist/components/AddressBar/AddressBarServer.vue.js +23 -23
- package/dist/components/CommandPalette/CommandPaletteServer.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteServer.vue.js +62 -45
- package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts +6 -0
- package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/TheCommandPalette.vue.js +4 -4
- package/dist/components/CommandPalette/TheCommandPalette.vue2.js +89 -91
- package/dist/components/ImportCollection/ImportCollectionModal.vue.d.ts.map +1 -1
- package/dist/components/ImportCollection/ImportCollectionModal.vue.js +29 -32
- package/dist/components/TopNav/TopNav.vue.d.ts.map +1 -1
- package/dist/components/TopNav/TopNav.vue.js +3 -3
- package/dist/components/TopNav/TopNav.vue2.js +41 -40
- package/dist/components/ViewLayout/ViewLayoutCollapse.vue.d.ts.map +1 -1
- package/dist/components/ViewLayout/ViewLayoutCollapse.vue.js +1 -1
- package/dist/layouts/App/ApiClientApp.vue.d.ts.map +1 -1
- package/dist/layouts/App/ApiClientApp.vue.js +38 -38
- package/dist/layouts/App/create-api-client-app.d.ts +33 -26
- package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
- package/dist/layouts/Modal/ApiClientModal.vue.js +1 -1
- package/dist/layouts/Modal/ApiClientModal.vue2.js +15 -15
- package/dist/layouts/Modal/create-api-client-modal.d.ts +66 -52
- 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 +30 -30
- package/dist/layouts/Web/create-api-client-web.d.ts +33 -26
- package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
- package/dist/libs/create-client.d.ts +33 -26
- package/dist/libs/create-client.d.ts.map +1 -1
- package/dist/libs/event-bus.d.ts +41 -0
- package/dist/libs/event-bus.d.ts.map +1 -0
- package/dist/libs/event-bus.js +32 -0
- package/dist/libs/{event-busses/hot-keys-bus.d.ts → hot-keys.d.ts} +6 -7
- package/dist/libs/hot-keys.d.ts.map +1 -0
- package/dist/libs/hot-keys.js +45 -0
- package/dist/libs/index.d.ts +3 -1
- package/dist/libs/index.d.ts.map +1 -1
- package/dist/libs/index.js +31 -33
- package/dist/libs/send-request.d.ts +4 -1
- package/dist/libs/send-request.d.ts.map +1 -1
- package/dist/libs/send-request.js +103 -103
- package/dist/store/collections.d.ts +4 -4
- package/dist/store/events.d.ts +29 -0
- package/dist/store/events.d.ts.map +1 -0
- package/dist/store/events.js +31 -0
- package/dist/store/request-example.d.ts +2 -2
- package/dist/store/requests.d.ts +4 -4
- package/dist/store/security-schemes.d.ts +4 -4
- package/dist/store/servers.d.ts +4 -4
- package/dist/store/store.d.ts +66 -52
- package/dist/store/store.d.ts.map +1 -1
- package/dist/store/store.js +75 -73
- package/dist/store/tags.d.ts +4 -4
- package/dist/store/workspace.d.ts +4 -4
- package/dist/style.css +1 -1
- 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 +63 -63
- 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 +101 -102
- 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 +76 -76
- 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 +33 -34
- package/dist/views/Request/ResponseSection/ResponseBodyVirtual.vue.d.ts +16 -0
- package/dist/views/Request/ResponseSection/ResponseBodyVirtual.vue.d.ts.map +1 -0
- package/dist/views/Request/ResponseSection/ResponseBodyVirtual.vue.js +31 -0
- package/dist/views/Request/ResponseSection/ResponseBodyVirtual.vue3.js +5 -0
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +30 -33
- package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue.js +3 -3
- package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue2.js +17 -18
- package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.js +20 -20
- package/dist/views/Request/ResponseSection/ResponseSection.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseSection.vue.js +68 -56
- package/dist/views/Request/components/WorkspaceDropdown.vue.js +29 -30
- package/package.json +5 -5
- package/dist/libs/event-busses/cancel-request-bus.d.ts +0 -2
- package/dist/libs/event-busses/cancel-request-bus.d.ts.map +0 -1
- package/dist/libs/event-busses/cancel-request-bus.js +0 -5
- package/dist/libs/event-busses/command-palette-bus.d.ts +0 -14
- package/dist/libs/event-busses/command-palette-bus.d.ts.map +0 -1
- package/dist/libs/event-busses/command-palette-bus.js +0 -5
- package/dist/libs/event-busses/execute-request-bus.d.ts +0 -2
- package/dist/libs/event-busses/execute-request-bus.d.ts.map +0 -1
- package/dist/libs/event-busses/execute-request-bus.js +0 -5
- package/dist/libs/event-busses/hot-keys-bus.d.ts.map +0 -1
- package/dist/libs/event-busses/hot-keys-bus.js +0 -47
- package/dist/libs/event-busses/index.d.ts +0 -6
- package/dist/libs/event-busses/index.d.ts.map +0 -1
- package/dist/libs/event-busses/index.js +0 -15
- package/dist/libs/event-busses/request-status-bus.d.ts +0 -5
- package/dist/libs/event-busses/request-status-bus.d.ts.map +0 -1
- package/dist/libs/event-busses/request-status-bus.js +0 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @scalar/api-client
|
|
2
2
|
|
|
3
|
+
## 2.1.20
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 0ddd4f3: feat: added virtual text component
|
|
8
|
+
- deb13b9: fix: updates command palette server collection logic
|
|
9
|
+
- b99799e: refactor(api-client): localize event bus in workspace store
|
|
10
|
+
- Updated dependencies [0ddd4f3]
|
|
11
|
+
- @scalar/components@0.12.52
|
|
12
|
+
- @scalar/oas-utils@0.2.55
|
|
13
|
+
- @scalar/use-codemirror@0.11.19
|
|
14
|
+
|
|
3
15
|
## 2.1.19
|
|
4
16
|
|
|
5
17
|
### 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":";;;;;AAmvBA,wBAMG"}
|
|
@@ -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 s = /* @__PURE__ */ r(o, [["__scopeId", "data-v-b2aad57d"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
s as default
|
|
7
7
|
};
|
|
@@ -1,40 +1,38 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { Listbox as
|
|
4
|
-
import { ScalarButton as
|
|
5
|
-
import { REQUEST_METHODS as
|
|
6
|
-
import { isMacOS as
|
|
7
|
-
import { useMagicKeys as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
import { requestStatusBus as re } from "../../libs/event-busses/request-status-bus.js";
|
|
14
|
-
import { hotKeyBus as S } from "../../libs/event-busses/hot-keys-bus.js";
|
|
15
|
-
const m = (d) => (Q("data-v-30d2e87b"), d = d(), W(), d), se = {
|
|
1
|
+
import { defineComponent as K, ref as u, watch as O, onMounted as z, onBeforeUnmount as A, unref as l, openBlock as N, createElementBlock as T, createElementVNode as o, createVNode as n, withCtx as C, normalizeClass as y, normalizeStyle as $, createCommentVNode as D, pushScopeId as P, popScopeId as Q } from "vue";
|
|
2
|
+
import W from "../CodeInput/CodeInput.vue.js";
|
|
3
|
+
import { Listbox as j } from "@headlessui/vue";
|
|
4
|
+
import { ScalarButton as F, ScalarIcon as G } from "@scalar/components";
|
|
5
|
+
import { REQUEST_METHODS as J } from "@scalar/oas-utils/helpers";
|
|
6
|
+
import { isMacOS as X } from "@scalar/use-tooltip";
|
|
7
|
+
import { useMagicKeys as Y, whenever as Z } from "@vueuse/core";
|
|
8
|
+
import ee from "../HttpMethod/HttpMethod.vue.js";
|
|
9
|
+
import te from "./AddressBarHistory.vue.js";
|
|
10
|
+
import le from "./AddressBarServer.vue.js";
|
|
11
|
+
import { useWorkspace as oe } from "../../store/store.js";
|
|
12
|
+
const v = (c) => (P("data-v-b2aad57d"), c = c(), Q(), c), ae = {
|
|
16
13
|
key: 0,
|
|
17
14
|
class: "order-last lg:order-none lg:w-auto w-full"
|
|
18
|
-
},
|
|
15
|
+
}, re = { class: "m-auto flex flex-row items-center" }, se = { class: "pointer-events-none absolute left-0 top-0 block h-full w-full overflow-hidden" }, ne = { class: "flex gap-1" }, ie = { class: "codemirror-bg-switcher scroll-timeline-x scroll-timeline-x-hidden relative flex w-full" }, ue = /* @__PURE__ */ v(() => /* @__PURE__ */ o("div", { class: "fade-left" }, null, -1)), de = /* @__PURE__ */ v(() => /* @__PURE__ */ o("div", { class: "fade-right" }, null, -1)), ce = /* @__PURE__ */ v(() => /* @__PURE__ */ o("span", { class: "text-xxs relative lg:flex hidden" }, "Send", -1)), ye = /* @__PURE__ */ K({
|
|
19
16
|
__name: "AddressBar",
|
|
20
17
|
emits: ["importCurl"],
|
|
21
|
-
setup(
|
|
18
|
+
setup(c) {
|
|
22
19
|
const {
|
|
23
20
|
activeRequest: t,
|
|
24
|
-
activeExample:
|
|
25
|
-
activeServer:
|
|
26
|
-
isReadOnly:
|
|
27
|
-
requestMutators:
|
|
28
|
-
requestHistory: R
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
()
|
|
21
|
+
activeExample: S,
|
|
22
|
+
activeServer: k,
|
|
23
|
+
isReadOnly: p,
|
|
24
|
+
requestMutators: m,
|
|
25
|
+
requestHistory: R,
|
|
26
|
+
events: d
|
|
27
|
+
} = oe(), h = u(R[0]), x = u(null), b = Y();
|
|
28
|
+
Z(
|
|
29
|
+
X() ? b.meta_enter : b.ctrl_enter,
|
|
30
|
+
() => d.executeRequest.emit()
|
|
33
31
|
);
|
|
34
32
|
const q = (e) => {
|
|
35
|
-
!t.value || t.value.path === e ||
|
|
33
|
+
!t.value || t.value.path === e || m.edit(t.value.uid, "path", e);
|
|
36
34
|
};
|
|
37
|
-
|
|
35
|
+
O(
|
|
38
36
|
() => {
|
|
39
37
|
var e;
|
|
40
38
|
return (e = t.value) == null ? void 0 : e.path;
|
|
@@ -43,102 +41,102 @@ const m = (d) => (Q("data-v-30d2e87b"), d = d(), W(), d), se = {
|
|
|
43
41
|
!t.value || !e || q(e);
|
|
44
42
|
}
|
|
45
43
|
);
|
|
46
|
-
const a = u(100),
|
|
44
|
+
const a = u(100), _ = u(0), r = u(!1), i = u();
|
|
45
|
+
function B() {
|
|
46
|
+
r.value ? a.value -= (a.value - 15) / 60 : a.value -= _.value / 20, a.value <= 0 && (clearInterval(i.value), i.value = void 0, a.value = 100, r.value = !1);
|
|
47
|
+
}
|
|
47
48
|
function E() {
|
|
48
|
-
|
|
49
|
+
i.value || (r.value = !0, i.value = setInterval(B, 20));
|
|
49
50
|
}
|
|
50
51
|
function I() {
|
|
51
|
-
|
|
52
|
+
_.value = a.value, r.value = !1;
|
|
52
53
|
}
|
|
53
54
|
function V() {
|
|
54
|
-
x.value = a.value, r.value = !1;
|
|
55
|
-
}
|
|
56
|
-
function M() {
|
|
57
55
|
clearInterval(i.value), i.value = void 0, a.value = 100, r.value = !1;
|
|
58
56
|
}
|
|
59
|
-
|
|
60
|
-
e === "start" &&
|
|
57
|
+
d.requestStatus.on((e) => {
|
|
58
|
+
e === "start" && E(), e === "stop" && I(), e === "abort" && V();
|
|
61
59
|
});
|
|
62
|
-
function
|
|
63
|
-
t.value &&
|
|
60
|
+
function M(e) {
|
|
61
|
+
t.value && m.edit(t.value.uid, "method", e);
|
|
64
62
|
}
|
|
65
|
-
function
|
|
63
|
+
function U() {
|
|
66
64
|
if (!t.value) return;
|
|
67
65
|
const { method: e } = t.value;
|
|
68
|
-
return
|
|
66
|
+
return J[e].backgroundColor;
|
|
69
67
|
}
|
|
70
|
-
function
|
|
71
|
-
r.value || (r.value = !0,
|
|
68
|
+
function g() {
|
|
69
|
+
r.value || (r.value = !0, d.executeRequest.emit());
|
|
72
70
|
}
|
|
73
|
-
function
|
|
74
|
-
t.value &&
|
|
71
|
+
function H(e) {
|
|
72
|
+
t.value && m.edit(t.value.uid, "path", e);
|
|
75
73
|
}
|
|
76
|
-
function
|
|
74
|
+
function w(e) {
|
|
77
75
|
var s;
|
|
78
|
-
e.focusAddressBar && ((s =
|
|
76
|
+
e != null && e.focusAddressBar && ((s = x.value) == null || s.focus());
|
|
79
77
|
}
|
|
80
|
-
return
|
|
81
|
-
o("div",
|
|
82
|
-
n(l(
|
|
83
|
-
modelValue:
|
|
84
|
-
"onUpdate:modelValue": s[1] || (s[1] = (f) =>
|
|
78
|
+
return z(() => d.hotKeys.on(w)), A(() => d.hotKeys.off(w)), (e, s) => l(t) && l(S) ? (N(), T("div", ae, [
|
|
79
|
+
o("div", re, [
|
|
80
|
+
n(l(j), {
|
|
81
|
+
modelValue: h.value,
|
|
82
|
+
"onUpdate:modelValue": s[1] || (s[1] = (f) => h.value = f)
|
|
85
83
|
}, {
|
|
86
|
-
default:
|
|
84
|
+
default: C(({ open: f }) => [
|
|
87
85
|
o("div", {
|
|
88
|
-
class:
|
|
86
|
+
class: y([
|
|
89
87
|
"addressbar-bg-states text-xxs relative flex w-full lg:min-w-[720px] lg:max-w-[720px] order-last overflow-hidden lg:order-none flex-1 flex-row items-stretch rounded-lg border-1/2 p-[3px]",
|
|
90
88
|
{ "border-transparent overflow-visible rounded-b-none": f }
|
|
91
89
|
])
|
|
92
90
|
}, [
|
|
93
|
-
o("div",
|
|
91
|
+
o("div", se, [
|
|
94
92
|
o("div", {
|
|
95
|
-
class:
|
|
96
|
-
style:
|
|
93
|
+
class: y(["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)` })
|
|
97
95
|
}, null, 6)
|
|
98
96
|
]),
|
|
99
|
-
o("div",
|
|
100
|
-
n(
|
|
101
|
-
isEditable: !l(
|
|
97
|
+
o("div", ne, [
|
|
98
|
+
n(ee, {
|
|
99
|
+
isEditable: !l(p),
|
|
102
100
|
isSquare: "",
|
|
103
101
|
method: l(t).method,
|
|
104
102
|
teleport: ".scalar-client",
|
|
105
|
-
onChange:
|
|
103
|
+
onChange: M
|
|
106
104
|
}, null, 8, ["isEditable", "method"])
|
|
107
105
|
]),
|
|
108
|
-
o("div",
|
|
109
|
-
|
|
110
|
-
n(
|
|
111
|
-
n(
|
|
106
|
+
o("div", ie, [
|
|
107
|
+
ue,
|
|
108
|
+
n(le),
|
|
109
|
+
n(W, {
|
|
112
110
|
ref_key: "addressBarRef",
|
|
113
|
-
ref:
|
|
111
|
+
ref: x,
|
|
114
112
|
disableCloseBrackets: "",
|
|
115
|
-
disabled: l(
|
|
113
|
+
disabled: l(p),
|
|
116
114
|
disableEnter: "",
|
|
117
115
|
disableTabIndent: "",
|
|
118
116
|
emitOnBlur: !1,
|
|
119
117
|
importCurl: "",
|
|
120
118
|
modelValue: l(t).path,
|
|
121
|
-
placeholder: l(
|
|
119
|
+
placeholder: l(k) ? "" : "Enter a URL or cURL command",
|
|
122
120
|
server: "",
|
|
123
|
-
onCurl: s[0] || (s[0] = (
|
|
124
|
-
onSubmit:
|
|
125
|
-
"onUpdate:modelValue":
|
|
121
|
+
onCurl: s[0] || (s[0] = (L) => e.$emit("importCurl", L)),
|
|
122
|
+
onSubmit: g,
|
|
123
|
+
"onUpdate:modelValue": H
|
|
126
124
|
}, null, 8, ["disabled", "modelValue", "placeholder"]),
|
|
127
|
-
|
|
125
|
+
de
|
|
128
126
|
]),
|
|
129
|
-
n(
|
|
130
|
-
n(l(
|
|
127
|
+
n(te, { open: f }, null, 8, ["open"]),
|
|
128
|
+
n(l(F), {
|
|
131
129
|
class: "relative h-auto shrink-0 gap-1 overflow-hidden pl-2 pr-2.5 py-1 font-bold",
|
|
132
130
|
disabled: r.value,
|
|
133
|
-
onClick:
|
|
131
|
+
onClick: g
|
|
134
132
|
}, {
|
|
135
|
-
default:
|
|
136
|
-
n(l(
|
|
133
|
+
default: C(() => [
|
|
134
|
+
n(l(G), {
|
|
137
135
|
class: "relative shrink-0 fill-current",
|
|
138
136
|
icon: "Play",
|
|
139
137
|
size: "xs"
|
|
140
138
|
}),
|
|
141
|
-
|
|
139
|
+
ce
|
|
142
140
|
]),
|
|
143
141
|
_: 1
|
|
144
142
|
}, 8, ["disabled"])
|
|
@@ -147,9 +145,9 @@ const m = (d) => (Q("data-v-30d2e87b"), d = d(), W(), d), se = {
|
|
|
147
145
|
_: 1
|
|
148
146
|
}, 8, ["modelValue"])
|
|
149
147
|
])
|
|
150
|
-
])) :
|
|
148
|
+
])) : D("", !0);
|
|
151
149
|
}
|
|
152
150
|
});
|
|
153
151
|
export {
|
|
154
|
-
|
|
152
|
+
ye as default
|
|
155
153
|
};
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarDropdown as
|
|
1
|
+
import { defineComponent as O, computed as u, watch as R, openBlock as l, createBlock as h, unref as o, withCtx as _, createElementBlock as n, createCommentVNode as v, Fragment as m, renderList as g, createVNode as p, createElementVNode as c, withModifiers as V, toDisplayString as b } from "vue";
|
|
2
|
+
import { ScalarDropdown as W, ScalarDropdownDivider as C, ScalarDropdownItem as E, ScalarIcon as I } from "@scalar/components";
|
|
3
3
|
import D from "./AddressBarServerItem.vue.js";
|
|
4
|
-
import { useWorkspace as
|
|
5
|
-
import { commandPaletteBus as L } from "../../libs/event-busses/command-palette-bus.js";
|
|
4
|
+
import { useWorkspace as L } from "../../store/store.js";
|
|
6
5
|
const M = {
|
|
7
6
|
key: 0,
|
|
8
7
|
class: "text-xxs text-c-2 ml-8"
|
|
9
8
|
}, j = /* @__PURE__ */ c("div", { class: "text-xxs text-c-2 ml-8" }, "Collection Servers", -1), F = { class: "flex items-center justify-center h-4 w-4" }, P = /* @__PURE__ */ c("span", null, "Add Server", -1), T = {
|
|
10
9
|
key: 1,
|
|
11
10
|
class: "flex whitespace-nowrap items-center font-code lg:text-sm text-xs"
|
|
12
|
-
},
|
|
11
|
+
}, J = /* @__PURE__ */ O({
|
|
13
12
|
__name: "AddressBarServer",
|
|
14
13
|
setup($) {
|
|
15
14
|
const {
|
|
@@ -18,15 +17,16 @@ const M = {
|
|
|
18
17
|
activeServer: x,
|
|
19
18
|
isReadOnly: A,
|
|
20
19
|
servers: w,
|
|
21
|
-
collectionMutators: B
|
|
22
|
-
|
|
20
|
+
collectionMutators: B,
|
|
21
|
+
events: N
|
|
22
|
+
} = L(), i = u(
|
|
23
23
|
() => {
|
|
24
24
|
var t, e;
|
|
25
25
|
return (e = (t = S.value) == null ? void 0 : t.servers) == null ? void 0 : e.map((r) => {
|
|
26
|
-
var
|
|
26
|
+
var s;
|
|
27
27
|
return {
|
|
28
28
|
id: r,
|
|
29
|
-
label: ((
|
|
29
|
+
label: ((s = w[r]) == null ? void 0 : s.url) ?? "Unknown server"
|
|
30
30
|
};
|
|
31
31
|
});
|
|
32
32
|
}
|
|
@@ -34,10 +34,10 @@ const M = {
|
|
|
34
34
|
() => {
|
|
35
35
|
var t, e;
|
|
36
36
|
return (e = (t = k.value) == null ? void 0 : t.servers) == null ? void 0 : e.map((r) => {
|
|
37
|
-
var
|
|
37
|
+
var s;
|
|
38
38
|
return {
|
|
39
39
|
id: r,
|
|
40
|
-
label: ((
|
|
40
|
+
label: ((s = w[r]) == null ? void 0 : s.url) ?? "Unknown server"
|
|
41
41
|
};
|
|
42
42
|
});
|
|
43
43
|
}
|
|
@@ -47,22 +47,22 @@ const M = {
|
|
|
47
47
|
return ((t = i.value) == null ? void 0 : t.length) && ((e = d.value) == null ? void 0 : e.length);
|
|
48
48
|
}
|
|
49
49
|
);
|
|
50
|
-
|
|
50
|
+
R([k, S], ([t, e]) => {
|
|
51
51
|
!t || t.selectedServerUid || e != null && e.selectedServerUid || B.edit(
|
|
52
52
|
t.uid,
|
|
53
53
|
"selectedServerUid",
|
|
54
54
|
t.servers[0]
|
|
55
55
|
);
|
|
56
56
|
});
|
|
57
|
-
const
|
|
57
|
+
const U = () => N.commandPalette.emit({
|
|
58
58
|
commandName: "Add Server"
|
|
59
59
|
}), f = u(() => {
|
|
60
60
|
var t, e, r;
|
|
61
61
|
return (e = (t = x.value) == null ? void 0 : t.url) != null && e.endsWith("/") ? x.value.url.slice(0, -1) : ((r = x.value) == null ? void 0 : r.url) || "";
|
|
62
62
|
});
|
|
63
63
|
return (t, e) => {
|
|
64
|
-
var r,
|
|
65
|
-
return i.value && ((r = i.value) == null ? void 0 : r.length) > 1 || d.value && ((
|
|
64
|
+
var r, s;
|
|
65
|
+
return i.value && ((r = i.value) == null ? void 0 : r.length) > 1 || d.value && ((s = d.value) == null ? void 0 : s.length) > 1 ? (l(), h(o(W), {
|
|
66
66
|
key: 0,
|
|
67
67
|
teleport: ".scalar-client"
|
|
68
68
|
}, {
|
|
@@ -74,7 +74,7 @@ const M = {
|
|
|
74
74
|
type: "request"
|
|
75
75
|
}, null, 8, ["serverOption"]))), 128)),
|
|
76
76
|
y.value ? (l(), n(m, { key: 1 }, [
|
|
77
|
-
p(
|
|
77
|
+
p(o(C)),
|
|
78
78
|
j
|
|
79
79
|
], 64)) : v("", !0),
|
|
80
80
|
(l(!0), n(m, null, g(d.value, (a) => (l(), h(D, {
|
|
@@ -82,16 +82,16 @@ const M = {
|
|
|
82
82
|
serverOption: a,
|
|
83
83
|
type: "collection"
|
|
84
84
|
}, null, 8, ["serverOption"]))), 128)),
|
|
85
|
-
|
|
86
|
-
p(
|
|
87
|
-
p(
|
|
85
|
+
o(A) ? v("", !0) : (l(), n(m, { key: 2 }, [
|
|
86
|
+
p(o(C)),
|
|
87
|
+
p(o(E), null, {
|
|
88
88
|
default: _(() => [
|
|
89
89
|
c("div", {
|
|
90
90
|
class: "font-code text-xxs flex items-center gap-1.5",
|
|
91
|
-
onClick:
|
|
91
|
+
onClick: U
|
|
92
92
|
}, [
|
|
93
93
|
c("div", F, [
|
|
94
|
-
p(
|
|
94
|
+
p(o(I), {
|
|
95
95
|
class: "h-2.5",
|
|
96
96
|
icon: "Add"
|
|
97
97
|
})
|
|
@@ -107,7 +107,7 @@ const M = {
|
|
|
107
107
|
c("button", {
|
|
108
108
|
class: "font-code lg:text-sm text-xs whitespace-nowrap border border-b-3 border-solid rounded px-1.5 py-0.5 text-c-2",
|
|
109
109
|
type: "button",
|
|
110
|
-
onClick: e[0] || (e[0] =
|
|
110
|
+
onClick: e[0] || (e[0] = V(() => {
|
|
111
111
|
}, ["stop"]))
|
|
112
112
|
}, b(f.value), 1)
|
|
113
113
|
]),
|
|
@@ -117,5 +117,5 @@ const M = {
|
|
|
117
117
|
}
|
|
118
118
|
});
|
|
119
119
|
export {
|
|
120
|
-
|
|
120
|
+
J as default
|
|
121
121
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommandPaletteServer.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandPaletteServer.vue"],"names":[],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"CommandPaletteServer.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandPaletteServer.vue"],"names":[],"mappings":";;;;;;;AA6XA,wBAMG"}
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarListbox as
|
|
3
|
-
import { useToasts as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { useWorkspace as
|
|
7
|
-
const
|
|
1
|
+
import { defineComponent as U, ref as v, computed as w, openBlock as s, createBlock as c, withCtx as a, createVNode as u, unref as n, createElementVNode as p, normalizeClass as h, toDisplayString as y, createTextVNode as D } from "vue";
|
|
2
|
+
import { ScalarListbox as N, ScalarButton as f, ScalarIcon as P } from "@scalar/components";
|
|
3
|
+
import { useToasts as B } from "@scalar/use-toasts";
|
|
4
|
+
import L from "./CommandActionForm.vue.js";
|
|
5
|
+
import M from "./CommandActionInput.vue.js";
|
|
6
|
+
import { useWorkspace as T } from "../../store/store.js";
|
|
7
|
+
const j = /* @__PURE__ */ p("span", { class: "text-c-1" }, "Create Collection", -1), q = /* @__PURE__ */ U({
|
|
8
8
|
__name: "CommandPaletteServer",
|
|
9
9
|
emits: ["close", "back"],
|
|
10
|
-
setup(
|
|
11
|
-
const
|
|
12
|
-
activeCollection:
|
|
13
|
-
activeWorkspaceCollections:
|
|
14
|
-
collectionMutators:
|
|
15
|
-
serverMutators:
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
setup(z, { emit: b }) {
|
|
11
|
+
const d = b, { toast: m } = B(), {
|
|
12
|
+
activeCollection: C,
|
|
13
|
+
activeWorkspaceCollections: x,
|
|
14
|
+
collectionMutators: S,
|
|
15
|
+
serverMutators: _,
|
|
16
|
+
events: k
|
|
17
|
+
} = T(), r = v(""), i = w(
|
|
18
|
+
() => x.value.flatMap(
|
|
18
19
|
(l) => {
|
|
19
20
|
var e, t;
|
|
20
21
|
return ((e = l.info) == null ? void 0 : e.title) === "Drafts" ? [] : {
|
|
@@ -23,65 +24,81 @@ const E = /* @__PURE__ */ S({
|
|
|
23
24
|
};
|
|
24
25
|
}
|
|
25
26
|
)
|
|
26
|
-
), o =
|
|
27
|
-
|
|
27
|
+
), o = v(
|
|
28
|
+
i.value.find(
|
|
28
29
|
(l) => {
|
|
29
30
|
var e;
|
|
30
|
-
return l.id === ((e =
|
|
31
|
+
return l.id === ((e = C.value) == null ? void 0 : e.uid);
|
|
31
32
|
}
|
|
32
33
|
)
|
|
33
|
-
),
|
|
34
|
+
), V = () => {
|
|
34
35
|
var t;
|
|
35
|
-
if (!
|
|
36
|
+
if (!r.value.trim()) {
|
|
36
37
|
m("Please enter a valid url before creating a server.", "error");
|
|
37
38
|
return;
|
|
38
39
|
}
|
|
39
40
|
const l = (t = o.value) == null ? void 0 : t.id;
|
|
40
|
-
if (!l)
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
if (!l) {
|
|
42
|
+
m("Please select a collection before creating a server.", "error");
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
const e = _.add({ url: r.value }, l);
|
|
46
|
+
S.edit(l, "selectedServerUid", e.uid), d("close");
|
|
47
|
+
}, g = () => {
|
|
48
|
+
k.commandPalette.emit({ commandName: "Create Collection" });
|
|
43
49
|
};
|
|
44
|
-
return (l, e) => (
|
|
45
|
-
disabled: !
|
|
46
|
-
onSubmit:
|
|
50
|
+
return (l, e) => (s(), c(L, {
|
|
51
|
+
disabled: !r.value.trim() || !o.value,
|
|
52
|
+
onSubmit: V
|
|
47
53
|
}, {
|
|
48
|
-
options:
|
|
49
|
-
|
|
54
|
+
options: a(() => [
|
|
55
|
+
u(n(N), {
|
|
50
56
|
modelValue: o.value,
|
|
51
57
|
"onUpdate:modelValue": e[2] || (e[2] = (t) => o.value = t),
|
|
52
|
-
options:
|
|
58
|
+
options: i.value
|
|
53
59
|
}, {
|
|
54
|
-
default:
|
|
55
|
-
i(s(
|
|
60
|
+
default: a(() => [
|
|
61
|
+
i.value.length > 0 ? (s(), c(n(f), {
|
|
62
|
+
key: 0,
|
|
56
63
|
class: "justify-between p-2 max-h-8 w-full gap-1 text-xs hover:bg-b-2",
|
|
57
64
|
variant: "outlined"
|
|
58
65
|
}, {
|
|
59
|
-
default:
|
|
60
|
-
|
|
61
|
-
class:
|
|
62
|
-
},
|
|
63
|
-
|
|
66
|
+
default: a(() => [
|
|
67
|
+
p("span", {
|
|
68
|
+
class: h(o.value ? "text-c-1" : "text-c-3")
|
|
69
|
+
}, y(o.value ? o.value.label : "Select Collection"), 3),
|
|
70
|
+
u(n(P), {
|
|
64
71
|
class: "text-c-3",
|
|
65
72
|
icon: "ChevronDown",
|
|
66
73
|
size: "xs"
|
|
67
74
|
})
|
|
68
75
|
]),
|
|
69
76
|
_: 1
|
|
70
|
-
})
|
|
77
|
+
})) : (s(), c(n(f), {
|
|
78
|
+
key: 1,
|
|
79
|
+
class: "justify-between p-2 max-h-8 w-full gap-1 text-xs hover:bg-b-2",
|
|
80
|
+
variant: "outlined",
|
|
81
|
+
onClick: g
|
|
82
|
+
}, {
|
|
83
|
+
default: a(() => [
|
|
84
|
+
j
|
|
85
|
+
]),
|
|
86
|
+
_: 1
|
|
87
|
+
}))
|
|
71
88
|
]),
|
|
72
89
|
_: 1
|
|
73
90
|
}, 8, ["modelValue", "options"])
|
|
74
91
|
]),
|
|
75
|
-
submit:
|
|
76
|
-
|
|
92
|
+
submit: a(() => [
|
|
93
|
+
D("Create Server")
|
|
77
94
|
]),
|
|
78
|
-
default:
|
|
79
|
-
|
|
80
|
-
modelValue:
|
|
81
|
-
"onUpdate:modelValue": e[0] || (e[0] = (t) =>
|
|
95
|
+
default: a(() => [
|
|
96
|
+
u(M, {
|
|
97
|
+
modelValue: r.value,
|
|
98
|
+
"onUpdate:modelValue": e[0] || (e[0] = (t) => r.value = t),
|
|
82
99
|
label: "Server URL",
|
|
83
100
|
placeholder: "Server URL",
|
|
84
|
-
onOnDelete: e[1] || (e[1] = (t) =>
|
|
101
|
+
onOnDelete: e[1] || (e[1] = (t) => d("back", t))
|
|
85
102
|
}, null, 8, ["modelValue"])
|
|
86
103
|
]),
|
|
87
104
|
_: 1
|
|
@@ -89,5 +106,5 @@ const E = /* @__PURE__ */ S({
|
|
|
89
106
|
}
|
|
90
107
|
});
|
|
91
108
|
export {
|
|
92
|
-
|
|
109
|
+
q as default
|
|
93
110
|
};
|
|
@@ -84,4 +84,10 @@ export declare const PaletteComponents: {
|
|
|
84
84
|
};
|
|
85
85
|
/** Infer the types from the commands */
|
|
86
86
|
export type CommandNames = keyof typeof PaletteComponents;
|
|
87
|
+
export type CommandPaletteEvent = {
|
|
88
|
+
/** The command name which matches with the command palette */
|
|
89
|
+
commandName?: CommandNames;
|
|
90
|
+
/** Any extra metadata we want to pass to the command palettes */
|
|
91
|
+
metaData?: Record<string, any>;
|
|
92
|
+
};
|
|
87
93
|
//# sourceMappingURL=TheCommandPalette.vue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TheCommandPalette.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/TheCommandPalette.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TheCommandPalette.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/TheCommandPalette.vue"],"names":[],"mappings":"AA8XA;;;;GAIG;;AACH,wBAybI;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"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import o from "./TheCommandPalette.vue2.js";
|
|
2
|
-
import { PaletteComponents as
|
|
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
|
|
5
|
+
const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-60105bc4"]]);
|
|
6
6
|
export {
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
s as PaletteComponents,
|
|
8
|
+
a as default
|
|
9
9
|
};
|