@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
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @scalar/api-client
|
|
2
2
|
|
|
3
|
+
## 2.2.24
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 6890d7e: style: updates address bar server ui for multi server type
|
|
8
|
+
- ca2d98b: fix: sets active server on send request for non draft request only
|
|
9
|
+
- 6890d7e: fix: updates selected server logic on collection server selection
|
|
10
|
+
- Updated dependencies [ca2d98b]
|
|
11
|
+
- @scalar/oas-utils@0.2.93
|
|
12
|
+
- @scalar/import@0.2.13
|
|
13
|
+
- @scalar/postman-to-openapi@0.1.16
|
|
14
|
+
|
|
15
|
+
## 2.2.23
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- 02b4201: fix(api-client): strict TS config (enable noUncheckedIndexedAccess)
|
|
20
|
+
- Updated dependencies [02b4201]
|
|
21
|
+
- @scalar/oas-utils@0.2.92
|
|
22
|
+
- @scalar/import@0.2.12
|
|
23
|
+
- @scalar/postman-to-openapi@0.1.15
|
|
24
|
+
|
|
3
25
|
## 2.2.22
|
|
4
26
|
|
|
5
27
|
### 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":";;;;;AA6xBA,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 a = /* @__PURE__ */ r(o, [["__scopeId", "data-v-e6e6f37d"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
a as default
|
|
7
7
|
};
|
|
@@ -1,51 +1,50 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { useActiveEntities as
|
|
4
|
-
import { Listbox as
|
|
5
|
-
import { ScalarButton as
|
|
6
|
-
import { REQUEST_METHODS as
|
|
7
|
-
import { isMacOS as
|
|
8
|
-
import { useMagicKeys as
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import { useWorkspace as
|
|
13
|
-
const
|
|
1
|
+
import { defineComponent as P, ref as i, computed as D, watch as Q, onMounted as W, onBeforeUnmount as j, unref as o, openBlock as B, createElementBlock as F, createElementVNode as r, createVNode as u, withCtx as E, normalizeClass as S, normalizeStyle as G, createBlock as J, createCommentVNode as V } from "vue";
|
|
2
|
+
import X from "../CodeInput/CodeInput.vue.js";
|
|
3
|
+
import { useActiveEntities as Y } from "../../store/active-entities.js";
|
|
4
|
+
import { Listbox as Z } from "@headlessui/vue";
|
|
5
|
+
import { ScalarButton as ee, ScalarIcon as te } from "@scalar/components";
|
|
6
|
+
import { REQUEST_METHODS as le } from "@scalar/oas-utils/helpers";
|
|
7
|
+
import { isMacOS as oe } from "@scalar/use-tooltip";
|
|
8
|
+
import { useMagicKeys as re, whenever as ae } from "@vueuse/core";
|
|
9
|
+
import se from "../HttpMethod/HttpMethod.vue.js";
|
|
10
|
+
import ne from "./AddressBarHistory.vue.js";
|
|
11
|
+
import ie from "./AddressBarServer.vue.js";
|
|
12
|
+
import { useWorkspace as ue } from "../../store/store.js";
|
|
13
|
+
const de = {
|
|
14
14
|
key: 0,
|
|
15
15
|
class: "scalar-address-bar order-last lg:order-none lg:w-auto w-full"
|
|
16
|
-
},
|
|
16
|
+
}, fe = { class: "m-auto flex flex-row items-center" }, ce = { class: "pointer-events-none absolute left-0 top-0 block h-full w-full overflow-hidden" }, me = { class: "flex gap-1" }, ve = { class: "codemirror-bg-switcher scroll-timeline-x scroll-timeline-x-hidden relative flex w-full" }, pe = {
|
|
17
17
|
"aria-hidden": "true",
|
|
18
18
|
class: "inline-flex gap-1 items-center"
|
|
19
|
-
},
|
|
19
|
+
}, Se = /* @__PURE__ */ P({
|
|
20
20
|
__name: "AddressBar",
|
|
21
21
|
emits: ["importCurl"],
|
|
22
|
-
setup(
|
|
23
|
-
const { activeRequest: l, activeExample:
|
|
24
|
-
|
|
25
|
-
te() ? h.meta_enter : h.ctrl_enter,
|
|
26
|
-
() => d.executeRequest.emit()
|
|
22
|
+
setup(xe) {
|
|
23
|
+
const { activeRequest: l, activeExample: M, activeServer: m, activeCollection: v } = Y(), { isReadOnly: p, requestMutators: c, requestHistory: I, events: d } = ue(), x = i(I[0]), h = i(null), b = re(), U = D(
|
|
24
|
+
() => oe() ? b.meta_enter : b.ctrl_enter
|
|
27
25
|
);
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
ae(U, () => d.executeRequest.emit());
|
|
27
|
+
const H = (e) => {
|
|
28
|
+
!l.value || l.value.path === e || c.edit(l.value.uid, "path", e);
|
|
30
29
|
};
|
|
31
|
-
|
|
30
|
+
Q(
|
|
32
31
|
() => {
|
|
33
32
|
var e;
|
|
34
33
|
return (e = l.value) == null ? void 0 : e.path;
|
|
35
34
|
},
|
|
36
35
|
(e) => {
|
|
37
|
-
!l.value || !e ||
|
|
36
|
+
!l.value || !e || H(e);
|
|
38
37
|
}
|
|
39
38
|
);
|
|
40
|
-
const a = i(100),
|
|
41
|
-
function
|
|
42
|
-
s.value ? a.value -= (a.value - 15) / 60 : a.value -=
|
|
39
|
+
const a = i(100), g = i(0), s = i(!1), n = i();
|
|
40
|
+
function K() {
|
|
41
|
+
s.value ? a.value -= (a.value - 15) / 60 : a.value -= g.value / 20, a.value <= 0 && (clearInterval(n.value), n.value = void 0, a.value = 100, s.value = !1);
|
|
43
42
|
}
|
|
44
43
|
function L() {
|
|
45
|
-
n.value || (s.value = !0, n.value = setInterval(
|
|
44
|
+
n.value || (s.value = !0, n.value = setInterval(K, 20));
|
|
46
45
|
}
|
|
47
46
|
function z() {
|
|
48
|
-
|
|
47
|
+
g.value = a.value, s.value = !1;
|
|
49
48
|
}
|
|
50
49
|
function A() {
|
|
51
50
|
clearInterval(n.value), n.value = void 0, a.value = 100, s.value = !1;
|
|
@@ -53,86 +52,86 @@ const ie = {
|
|
|
53
52
|
d.requestStatus.on((e) => {
|
|
54
53
|
e === "start" && L(), e === "stop" && z(), e === "abort" && A();
|
|
55
54
|
});
|
|
56
|
-
function
|
|
57
|
-
l.value &&
|
|
55
|
+
function O(e) {
|
|
56
|
+
l.value && c.edit(l.value.uid, "method", e);
|
|
58
57
|
}
|
|
59
|
-
function
|
|
58
|
+
function N() {
|
|
60
59
|
if (!l.value) return;
|
|
61
60
|
const { method: e } = l.value;
|
|
62
|
-
return
|
|
61
|
+
return le[e].backgroundColor;
|
|
63
62
|
}
|
|
64
|
-
function
|
|
63
|
+
function w() {
|
|
65
64
|
s.value || (s.value = !0, d.executeRequest.emit());
|
|
66
65
|
}
|
|
67
|
-
function
|
|
68
|
-
l.value &&
|
|
66
|
+
function T(e) {
|
|
67
|
+
l.value && c.edit(l.value.uid, "path", e);
|
|
69
68
|
}
|
|
70
|
-
function
|
|
69
|
+
function y(e) {
|
|
71
70
|
var t;
|
|
72
|
-
e != null && e.focusAddressBar && ((t =
|
|
71
|
+
e != null && e.focusAddressBar && ((t = h.value) == null || t.focus());
|
|
73
72
|
}
|
|
74
|
-
return
|
|
75
|
-
r("div",
|
|
76
|
-
u(o(
|
|
77
|
-
modelValue:
|
|
78
|
-
"onUpdate:modelValue": t[1] || (t[1] = (f) =>
|
|
73
|
+
return W(() => d.hotKeys.on(y)), j(() => d.hotKeys.off(y)), (e, t) => o(l) && o(M) ? (B(), F("div", de, [
|
|
74
|
+
r("div", fe, [
|
|
75
|
+
u(o(Z), {
|
|
76
|
+
modelValue: x.value,
|
|
77
|
+
"onUpdate:modelValue": t[1] || (t[1] = (f) => x.value = f)
|
|
79
78
|
}, {
|
|
80
|
-
default:
|
|
81
|
-
var
|
|
79
|
+
default: E(({ open: f }) => {
|
|
80
|
+
var C, k, _, R, q;
|
|
82
81
|
return [
|
|
83
82
|
r("div", {
|
|
84
|
-
class:
|
|
83
|
+
class: S([
|
|
85
84
|
"addressbar-bg-states text-xxs relative flex w-full xl:min-w-[720px] xl:max-w-[720px] lg:min-w-[580px] lg:max-w-[580px] order-last overflow-hidden lg:order-none flex-1 flex-row items-stretch rounded-lg border-1/2 p-[3px]",
|
|
86
85
|
{ "border-transparent overflow-visible rounded-b-none": f }
|
|
87
86
|
])
|
|
88
87
|
}, [
|
|
89
|
-
r("div",
|
|
88
|
+
r("div", ce, [
|
|
90
89
|
r("div", {
|
|
91
|
-
class:
|
|
92
|
-
style:
|
|
90
|
+
class: S(["bg-mix-transparent bg-mix-amount-90 absolute left-0 top-0 h-full w-full z-context", N()]),
|
|
91
|
+
style: G({ transform: `translate3d(-${a.value}%,0,0)` })
|
|
93
92
|
}, null, 6)
|
|
94
93
|
]),
|
|
95
|
-
r("div",
|
|
96
|
-
u(
|
|
97
|
-
isEditable: !o(
|
|
94
|
+
r("div", me, [
|
|
95
|
+
u(se, {
|
|
96
|
+
isEditable: !o(p),
|
|
98
97
|
isSquare: "",
|
|
99
98
|
method: o(l).method,
|
|
100
99
|
teleport: "",
|
|
101
|
-
onChange:
|
|
100
|
+
onChange: O
|
|
102
101
|
}, null, 8, ["isEditable", "method"])
|
|
103
102
|
]),
|
|
104
|
-
r("div",
|
|
103
|
+
r("div", ve, [
|
|
105
104
|
t[2] || (t[2] = r("div", { class: "fade-left" }, null, -1)),
|
|
106
|
-
(
|
|
107
|
-
u(
|
|
105
|
+
(k = (C = o(v)) == null ? void 0 : C.servers) != null && k.length ? (B(), J(ie, { key: 0 })) : V("", !0),
|
|
106
|
+
u(X, {
|
|
108
107
|
ref_key: "addressBarRef",
|
|
109
|
-
ref:
|
|
108
|
+
ref: h,
|
|
110
109
|
"aria-label": "Path",
|
|
111
110
|
class: "outline-none",
|
|
112
111
|
disableCloseBrackets: "",
|
|
113
|
-
disabled: o(
|
|
112
|
+
disabled: o(p),
|
|
114
113
|
disableEnter: "",
|
|
115
114
|
disableTabIndent: "",
|
|
116
115
|
emitOnBlur: !1,
|
|
117
116
|
importCurl: "",
|
|
118
117
|
modelValue: o(l).path,
|
|
119
|
-
placeholder: (
|
|
118
|
+
placeholder: (_ = o(m)) != null && _.uid && ((q = (R = o(v)) == null ? void 0 : R.servers) != null && q.includes(o(m).uid)) ? "" : "Enter a URL or cURL command",
|
|
120
119
|
server: "",
|
|
121
|
-
onCurl: t[0] || (t[0] = (
|
|
122
|
-
onSubmit:
|
|
123
|
-
"onUpdate:modelValue":
|
|
120
|
+
onCurl: t[0] || (t[0] = ($) => e.$emit("importCurl", $)),
|
|
121
|
+
onSubmit: w,
|
|
122
|
+
"onUpdate:modelValue": T
|
|
124
123
|
}, null, 8, ["disabled", "modelValue", "placeholder"]),
|
|
125
124
|
t[3] || (t[3] = r("div", { class: "fade-right" }, null, -1))
|
|
126
125
|
]),
|
|
127
|
-
u(
|
|
128
|
-
u(o(
|
|
126
|
+
u(ne, { open: f }, null, 8, ["open"]),
|
|
127
|
+
u(o(ee), {
|
|
129
128
|
class: "relative h-auto shrink-0 overflow-hidden !pl-2 !pr-2.5 !py-1 font-bold",
|
|
130
129
|
disabled: s.value,
|
|
131
|
-
onClick:
|
|
130
|
+
onClick: w
|
|
132
131
|
}, {
|
|
133
|
-
default:
|
|
134
|
-
r("span",
|
|
135
|
-
u(o(
|
|
132
|
+
default: E(() => [
|
|
133
|
+
r("span", pe, [
|
|
134
|
+
u(o(te), {
|
|
136
135
|
class: "relative shrink-0 fill-current",
|
|
137
136
|
icon: "Play",
|
|
138
137
|
size: "xs"
|
|
@@ -149,9 +148,9 @@ const ie = {
|
|
|
149
148
|
_: 1
|
|
150
149
|
}, 8, ["modelValue"])
|
|
151
150
|
])
|
|
152
|
-
])) :
|
|
151
|
+
])) : V("", !0);
|
|
153
152
|
}
|
|
154
153
|
});
|
|
155
154
|
export {
|
|
156
|
-
|
|
155
|
+
Se as default
|
|
157
156
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddressBarServer.vue.d.ts","sourceRoot":"","sources":["../../../src/components/AddressBar/AddressBarServer.vue"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"AddressBarServer.vue.d.ts","sourceRoot":"","sources":["../../../src/components/AddressBar/AddressBarServer.vue"],"names":[],"mappings":";AAyVA,wBAMG"}
|
|
@@ -1,93 +1,101 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useActiveEntities as
|
|
3
|
-
import { ScalarDropdown as
|
|
4
|
-
import
|
|
5
|
-
import { useWorkspace as
|
|
6
|
-
const
|
|
1
|
+
import { defineComponent as U, computed as i, watch as V, openBlock as l, createBlock as p, unref as o, withCtx as m, createElementBlock as a, createCommentVNode as x, Fragment as d, renderList as b, createVNode as c, createElementVNode as n, createTextVNode as E, toDisplayString as O } from "vue";
|
|
2
|
+
import { useActiveEntities as R } from "../../store/active-entities.js";
|
|
3
|
+
import { ScalarDropdown as W, ScalarDropdownDivider as h, ScalarDropdownItem as I, ScalarIcon as L } from "@scalar/components";
|
|
4
|
+
import g from "./AddressBarServerItem.vue.js";
|
|
5
|
+
import { useWorkspace as T } from "../../store/store.js";
|
|
6
|
+
const j = {
|
|
7
7
|
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 -outline-offset-1",
|
|
8
8
|
type: "button"
|
|
9
|
-
},
|
|
9
|
+
}, z = {
|
|
10
10
|
key: 0,
|
|
11
|
-
class: "text-xxs text-c-2
|
|
12
|
-
},
|
|
11
|
+
class: "text-xxs text-c-2 px-2.5 py-1"
|
|
12
|
+
}, F = { class: "flex items-center justify-center h-4 w-4" }, J = /* @__PURE__ */ U({
|
|
13
13
|
__name: "AddressBarServer",
|
|
14
|
-
setup(
|
|
15
|
-
const { activeRequest:
|
|
14
|
+
setup(M) {
|
|
15
|
+
const { activeRequest: u, activeCollection: f, activeServer: v } = R(), { isReadOnly: A, servers: S, collectionMutators: C, events: D } = T(), y = i(
|
|
16
16
|
() => {
|
|
17
|
-
var
|
|
18
|
-
return (e = (
|
|
19
|
-
var
|
|
17
|
+
var r, e;
|
|
18
|
+
return (e = (r = u.value) == null ? void 0 : r.servers) == null ? void 0 : e.map((t) => {
|
|
19
|
+
var s;
|
|
20
20
|
return {
|
|
21
|
-
id:
|
|
22
|
-
label: ((
|
|
21
|
+
id: t,
|
|
22
|
+
label: ((s = S[t]) == null ? void 0 : s.url) ?? "Unknown server"
|
|
23
23
|
};
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
|
-
),
|
|
26
|
+
), w = i(
|
|
27
27
|
() => {
|
|
28
|
-
var
|
|
29
|
-
return (
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
28
|
+
var r, e;
|
|
29
|
+
return (
|
|
30
|
+
// Filters out servers already present in the request
|
|
31
|
+
(e = (r = f.value) == null ? void 0 : r.servers) == null ? void 0 : e.filter(
|
|
32
|
+
(t) => {
|
|
33
|
+
var s, _;
|
|
34
|
+
return !((_ = (s = u.value) == null ? void 0 : s.servers) != null && _.includes(t));
|
|
35
|
+
}
|
|
36
|
+
).map((t) => {
|
|
37
|
+
var s;
|
|
38
|
+
return {
|
|
39
|
+
id: t,
|
|
40
|
+
label: ((s = S[t]) == null ? void 0 : s.url) ?? "Unknown server"
|
|
41
|
+
};
|
|
42
|
+
})
|
|
43
|
+
);
|
|
36
44
|
}
|
|
37
45
|
), k = i(
|
|
38
46
|
() => {
|
|
39
|
-
var
|
|
40
|
-
return ((
|
|
47
|
+
var r, e;
|
|
48
|
+
return ((r = y.value) == null ? void 0 : r.length) && ((e = w.value) == null ? void 0 : e.length);
|
|
41
49
|
}
|
|
42
50
|
);
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
);
|
|
51
|
+
V([f, u], ([r, e]) => {
|
|
52
|
+
var s;
|
|
53
|
+
if (!r || r.selectedServerUid || e != null && e.selectedServerUid)
|
|
54
|
+
return;
|
|
55
|
+
const t = (s = r.servers) == null ? void 0 : s[0];
|
|
56
|
+
t && C.edit(r.uid, "selectedServerUid", t);
|
|
49
57
|
});
|
|
50
|
-
const
|
|
58
|
+
const N = () => D.commandPalette.emit({
|
|
51
59
|
commandName: "Add Server"
|
|
52
|
-
}),
|
|
53
|
-
var
|
|
54
|
-
return (e = (
|
|
60
|
+
}), B = i(() => {
|
|
61
|
+
var r, e, t;
|
|
62
|
+
return (e = (r = v.value) == null ? void 0 : r.url) != null && e.endsWith("/") ? v.value.url.slice(0, -1) : ((t = v.value) == null ? void 0 : t.url) || "";
|
|
55
63
|
});
|
|
56
|
-
return (
|
|
64
|
+
return (r, e) => (l(), p(o(W), {
|
|
57
65
|
class: "w-max",
|
|
58
66
|
teleport: ""
|
|
59
67
|
}, {
|
|
60
68
|
items: m(() => [
|
|
61
|
-
k.value ? (
|
|
62
|
-
(
|
|
63
|
-
key:
|
|
64
|
-
serverOption:
|
|
69
|
+
k.value ? (l(), a("div", z, " Request ")) : x("", !0),
|
|
70
|
+
(l(!0), a(d, null, b(y.value, (t) => (l(), p(g, {
|
|
71
|
+
key: t.id,
|
|
72
|
+
serverOption: t,
|
|
65
73
|
type: "request"
|
|
66
74
|
}, null, 8, ["serverOption"]))), 128)),
|
|
67
|
-
k.value ? (
|
|
68
|
-
c(
|
|
69
|
-
e[1] || (e[1] =
|
|
70
|
-
], 64)) :
|
|
71
|
-
(
|
|
72
|
-
key:
|
|
73
|
-
serverOption:
|
|
75
|
+
k.value ? (l(), a(d, { key: 1 }, [
|
|
76
|
+
c(o(h)),
|
|
77
|
+
e[1] || (e[1] = n("div", { class: "text-xxs text-c-2 px-2.5 py-1" }, "Collection", -1))
|
|
78
|
+
], 64)) : x("", !0),
|
|
79
|
+
(l(!0), a(d, null, b(w.value, (t) => (l(), p(g, {
|
|
80
|
+
key: t.id,
|
|
81
|
+
serverOption: t,
|
|
74
82
|
type: "collection"
|
|
75
83
|
}, null, 8, ["serverOption"]))), 128)),
|
|
76
|
-
|
|
77
|
-
c(
|
|
78
|
-
c(
|
|
84
|
+
o(A) ? x("", !0) : (l(), a(d, { key: 2 }, [
|
|
85
|
+
c(o(h)),
|
|
86
|
+
c(o(I), null, {
|
|
79
87
|
default: m(() => [
|
|
80
|
-
|
|
88
|
+
n("div", {
|
|
81
89
|
class: "font-code text-xxs flex items-center gap-1.5",
|
|
82
|
-
onClick:
|
|
90
|
+
onClick: N
|
|
83
91
|
}, [
|
|
84
|
-
|
|
85
|
-
c(
|
|
92
|
+
n("div", F, [
|
|
93
|
+
c(o(L), {
|
|
86
94
|
icon: "Add",
|
|
87
95
|
size: "sm"
|
|
88
96
|
})
|
|
89
97
|
]),
|
|
90
|
-
e[2] || (e[2] =
|
|
98
|
+
e[2] || (e[2] = n("span", null, "Add Server", -1))
|
|
91
99
|
])
|
|
92
100
|
]),
|
|
93
101
|
_: 1
|
|
@@ -95,9 +103,9 @@ const T = {
|
|
|
95
103
|
], 64))
|
|
96
104
|
]),
|
|
97
105
|
default: m(() => [
|
|
98
|
-
|
|
99
|
-
e[0] || (e[0] =
|
|
100
|
-
|
|
106
|
+
n("button", j, [
|
|
107
|
+
e[0] || (e[0] = n("span", { class: "sr-only" }, "Server:", -1)),
|
|
108
|
+
E(" " + O(B.value), 1)
|
|
101
109
|
])
|
|
102
110
|
]),
|
|
103
111
|
_: 1
|
|
@@ -105,5 +113,5 @@ const T = {
|
|
|
105
113
|
}
|
|
106
114
|
});
|
|
107
115
|
export {
|
|
108
|
-
|
|
116
|
+
J as default
|
|
109
117
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddressBarServerItem.vue.d.ts","sourceRoot":"","sources":["../../../src/components/AddressBar/AddressBarServerItem.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AddressBarServerItem.vue.d.ts","sourceRoot":"","sources":["../../../src/components/AddressBar/AddressBarServerItem.vue"],"names":[],"mappings":"AAyEA,MAAM,MAAM,YAAY,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CACvD;;kBAIe,YAAY;UACpB,YAAY,GAAG,SAAS;;kBADhB,YAAY;UACpB,YAAY,GAAG,SAAS;;AAJhC,wBAyJK"}
|
|
@@ -1,48 +1,49 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useActiveEntities as
|
|
1
|
+
import { defineComponent as m, openBlock as f, createBlock as S, unref as l, withCtx as h, createElementVNode as n, normalizeClass as w, createVNode as k, toDisplayString as x } from "vue";
|
|
2
|
+
import { useActiveEntities as g } from "../../store/active-entities.js";
|
|
3
3
|
import { ScalarDropdownItem as y, ScalarIcon as C } from "@scalar/components";
|
|
4
4
|
import { useWorkspace as O } from "../../store/store.js";
|
|
5
|
-
const b = { class: "whitespace-nowrap text-ellipsis overflow-hidden" }, _ = /* @__PURE__ */
|
|
5
|
+
const b = { class: "whitespace-nowrap text-ellipsis overflow-hidden" }, _ = /* @__PURE__ */ m({
|
|
6
6
|
__name: "AddressBarServerItem",
|
|
7
7
|
props: {
|
|
8
8
|
serverOption: {},
|
|
9
9
|
type: {}
|
|
10
10
|
},
|
|
11
|
-
setup(
|
|
12
|
-
const
|
|
13
|
-
|
|
11
|
+
setup(a) {
|
|
12
|
+
const i = a, { activeCollection: o, activeRequest: r, activeServer: c } = g(), { collectionMutators: p, requestMutators: d } = O(), u = (e) => {
|
|
13
|
+
var t, s;
|
|
14
|
+
i.type === "collection" && o.value ? ((s = (t = r.value) == null ? void 0 : t.servers) != null && s.length && (r.value.selectedServerUid = ""), p.edit(
|
|
14
15
|
o.value.uid,
|
|
15
16
|
"selectedServerUid",
|
|
16
17
|
e
|
|
17
|
-
) :
|
|
18
|
-
|
|
18
|
+
)) : i.type === "request" && r.value && d.edit(
|
|
19
|
+
r.value.uid,
|
|
19
20
|
"selectedServerUid",
|
|
20
21
|
e
|
|
21
22
|
);
|
|
22
|
-
},
|
|
23
|
+
}, v = (e) => {
|
|
23
24
|
var t;
|
|
24
|
-
return ((t =
|
|
25
|
+
return ((t = c.value) == null ? void 0 : t.uid) === e;
|
|
25
26
|
};
|
|
26
|
-
return (e, t) => (
|
|
27
|
+
return (e, t) => (f(), S(l(y), {
|
|
27
28
|
key: "serverOption.id",
|
|
28
29
|
class: "flex gap-1.5 group/item items-center whitespace-nowrap text-ellipsis overflow-hidden w-full",
|
|
29
30
|
value: e.serverOption.id,
|
|
30
|
-
onClick: t[0] || (t[0] = (
|
|
31
|
+
onClick: t[0] || (t[0] = (s) => u(e.serverOption.id))
|
|
31
32
|
}, {
|
|
32
|
-
default:
|
|
33
|
+
default: h(() => [
|
|
33
34
|
n("div", {
|
|
34
35
|
class: w([
|
|
35
36
|
"flex size-4 items-center justify-center p-0.75 text-b-1 rounded-full",
|
|
36
|
-
|
|
37
|
+
v(e.serverOption.id) ? "bg-c-accent text-b-1" : "group-hover/item:shadow-border text-transparent"
|
|
37
38
|
])
|
|
38
39
|
}, [
|
|
39
|
-
|
|
40
|
+
k(l(C), {
|
|
40
41
|
icon: "Checkmark",
|
|
41
42
|
size: "xs",
|
|
42
43
|
thickness: "2.5"
|
|
43
44
|
})
|
|
44
45
|
], 2),
|
|
45
|
-
n("span", b,
|
|
46
|
+
n("span", b, x(e.serverOption.label), 1)
|
|
46
47
|
]),
|
|
47
48
|
_: 1
|
|
48
49
|
}, 8, ["value"]));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CodeInput/CodeInput.vue"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"CodeInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CodeInput/CodeInput.vue"],"names":[],"mappings":"AAAA,OAgdO,EAGL,KAAK,kBAAkB,EAGxB,MAAM,wBAAwB,CAAA;;kBAkBb,OAAO;gBACT,MAAM,GAAG,MAAM;YACnB,OAAO;iBACF,OAAO;kBACN,OAAO;WACd,OAAO;uBACK,OAAO;eACf,kBAAkB;wBACT,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;wBACnB,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;kBACzB,MAAM;eACT,OAAO;mBACH,OAAO;2BACC,OAAO;WACvB,MAAM,EAAE;WACR,MAAM;eACF,OAAO;oBACF,OAAO;iBACV,OAAO;iBACP,OAAO;cACV,MAAM,GAAG,MAAM;;;;;;;;kBApBX,OAAO;gBACT,MAAM,GAAG,MAAM;YACnB,OAAO;iBACF,OAAO;kBACN,OAAO;WACd,OAAO;uBACK,OAAO;eACf,kBAAkB;wBACT,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;wBACnB,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;kBACzB,MAAM;eACT,OAAO;mBACH,OAAO;2BACC,OAAO;WACvB,MAAM,EAAE;WACR,MAAM;eACF,OAAO;oBACF,OAAO;iBACV,OAAO;iBACP,OAAO;cACV,MAAM,GAAG,MAAM;;;;;;gBAjBZ,OAAO;iBAHN,OAAO;sBAMF,OAAO;kBAMX,OAAO;0BACC,OAAO;cAGnB,OAAO;mBACF,OAAO;gBAEV,OAAO;;qBAuZM,GAAG;kBACN,GAAG;;AA9a9B,wBA0eC;AAgBD,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -2,7 +2,7 @@ import o from "./CodeInput.vue2.js";
|
|
|
2
2
|
/* empty css */
|
|
3
3
|
/* empty css */
|
|
4
4
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
-
const
|
|
5
|
+
const _ = /* @__PURE__ */ t(o, [["__scopeId", "data-v-958f2326"]]);
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
_ as default
|
|
8
8
|
};
|