@scalar/api-client 2.5.32 → 2.5.33
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 +20 -0
- package/dist/components/AddressBar/AddressBar.vue.js +1 -1
- package/dist/components/AddressBar/AddressBar.vue2.js +120 -128
- package/dist/components/AddressBar/AddressBarHistory.vue.js +1 -1
- package/dist/components/AddressBar/AddressBarHistory.vue2.js +57 -63
- package/dist/components/CodeInput/CodeInput.vue.js +2 -2
- package/dist/components/CodeInput/CodeInput.vue2.js +143 -150
- package/dist/components/CodeInput/codeVariableWidget.js +70 -75
- package/dist/components/CommandPalette/CommandActionInput.vue.js +17 -19
- package/dist/components/CommandPalette/CommandPaletteCollection.vue.js +26 -27
- package/dist/components/CommandPalette/CommandPaletteExample.vue.js +53 -55
- package/dist/components/CommandPalette/CommandPaletteImport.vue.js +129 -133
- package/dist/components/CommandPalette/CommandPaletteImportCurl.vue.js +1 -1
- package/dist/components/CommandPalette/CommandPaletteImportCurl.vue2.js +84 -98
- package/dist/components/CommandPalette/CommandPaletteServer.vue.js +64 -74
- package/dist/components/CommandPalette/CommandPaletteTag.vue.js +5 -11
- package/dist/components/CommandPalette/TheCommandPalette.vue.js +1 -1
- package/dist/components/CommandPalette/TheCommandPalette.vue2.js +164 -183
- package/dist/components/DataTable/DataTableInput.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableInput.vue.js +4 -4
- package/dist/components/DataTable/DataTableInput.vue2.js +31 -31
- package/dist/components/DataTable/DataTableInputSelect.vue.js +1 -2
- package/dist/components/EmptyState.vue.js +1 -1
- package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +75 -84
- package/dist/components/Form/LabelInput.vue.js +1 -1
- package/dist/components/HttpMethod/HttpMethod.vue.js +1 -1
- package/dist/components/HttpMethod/HttpMethod.vue2.js +11 -11
- package/dist/components/ImportCollection/DropEventListener.vue.js +42 -44
- package/dist/components/ImportCollection/ImportCollectionListener.vue.js +22 -23
- package/dist/components/ImportCollection/ImportCollectionModal.vue.js +141 -149
- package/dist/components/ImportCollection/ImportCollectionModal.vue3.js +1 -1
- package/dist/components/ImportCollection/ImportNowButton.vue.js +22 -23
- package/dist/components/ImportCollection/IntegrationLogo.vue.js +12 -13
- package/dist/components/ImportCollection/PasteEventListener.vue.js +11 -12
- package/dist/components/ImportCollection/WorkspaceSelector.vue.js +69 -76
- package/dist/components/ImportCollection/utils/get-openapi-version.js +8 -8
- package/dist/components/ImportCollection/utils/import-collection.js +14 -14
- package/dist/components/OpenApiClientButton.vue.js +1 -1
- package/dist/components/OpenApiClientButton.vue2.js +10 -10
- package/dist/components/ScalarAsciiArt.vue.js +1 -1
- package/dist/components/ScalarAsciiArt.vue2.js +19 -22
- package/dist/components/Search/useSearch.js +51 -61
- package/dist/components/SectionFilter.vue.js +1 -1
- package/dist/components/SectionFilter.vue2.js +26 -29
- package/dist/components/Server/ServerDropdown.vue.js +70 -96
- package/dist/components/Server/ServerDropdownItem.vue.js +1 -1
- package/dist/components/Server/ServerDropdownItem.vue2.js +57 -67
- package/dist/components/Server/ServerSelector.vue.js +44 -55
- package/dist/components/Server/ServerVariablesForm.vue.js +36 -42
- package/dist/components/Server/ServerVariablesSelect.vue.js +6 -6
- package/dist/components/SideNav/DownloadAppButton.vue.js +1 -1
- package/dist/components/SideNav/SideNav.vue.js +68 -74
- package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.js +1 -1
- package/dist/components/Sidebar/Sidebar.vue.js +1 -1
- package/dist/components/Sidebar/SidebarListElement.vue.js +2 -2
- package/dist/components/TopNav/TopNav.vue.js +107 -122
- package/dist/components/TopNav/TopNavItem.vue.js +1 -1
- package/dist/hooks/useFileDialog.js +12 -12
- package/dist/hooks/useResponseBody.js +14 -16
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/layouts/App/ApiClientApp.vue.js +50 -56
- package/dist/layouts/App/ApiClientApp.vue3.js +1 -1
- package/dist/layouts/App/create-api-client-app.js +19 -20
- package/dist/layouts/App/index.js +1 -1
- package/dist/layouts/Modal/ApiClientModal.vue.js +1 -1
- package/dist/layouts/Modal/ApiClientModal.vue2.js +18 -21
- package/dist/layouts/Web/ApiClientWeb.vue.js +45 -51
- package/dist/layouts/Web/ApiClientWeb.vue3.js +1 -1
- package/dist/layouts/Web/create-api-client-web.js +19 -20
- package/dist/layouts/Web/index.js +1 -1
- package/dist/libs/create-client.js +102 -109
- package/dist/libs/env-helpers.js +3 -3
- package/dist/libs/event-bus.js +15 -15
- package/dist/libs/extractAttachmentFilename.js +5 -6
- package/dist/libs/find-request.js +9 -10
- package/dist/libs/get-request-uid-by-path-method.js +12 -12
- package/dist/libs/getOpenApiDocumentDetails.js +7 -7
- package/dist/libs/importers/curl.js +3 -3
- package/dist/libs/normalize-headers.js +9 -10
- package/dist/libs/postman.js +15 -17
- package/dist/libs/send-request/build-request-security.js +9 -10
- package/dist/libs/send-request/create-fetch-body.js +11 -12
- package/dist/libs/send-request/create-fetch-query-params.js +13 -13
- package/dist/libs/send-request/create-request-operation.js +83 -84
- package/dist/libs/send-request/decode-buffer.d.ts.map +1 -1
- package/dist/libs/send-request/set-request-cookies.js +12 -12
- package/dist/libs/string-template.js +21 -21
- package/dist/libs/validate-parameters.js +5 -8
- package/dist/plugins/plugin-manager.js +11 -17
- package/dist/store/active-entities.js +90 -117
- package/dist/store/collections.js +41 -42
- package/dist/store/import-spec.js +25 -26
- package/dist/store/request-example.js +20 -24
- package/dist/store/requests.js +63 -81
- package/dist/store/router-params.js +7 -7
- package/dist/store/security-schemes.js +35 -36
- package/dist/store/store.js +2 -2
- package/dist/store/tags.js +20 -21
- package/dist/style.css +1 -1
- package/dist/views/Collection/Collection.vue2.js +21 -22
- package/dist/views/Collection/CollectionAuthentication.vue.js +1 -1
- package/dist/views/Collection/CollectionAuthentication.vue2.js +43 -47
- package/dist/views/Collection/CollectionEnvironment.vue.js +1 -1
- package/dist/views/Collection/CollectionEnvironment.vue2.js +196 -207
- package/dist/views/Collection/CollectionInfoForm.vue.js +1 -1
- package/dist/views/Collection/CollectionInfoForm.vue2.js +34 -41
- package/dist/views/Collection/CollectionNavigation.vue.js +116 -125
- package/dist/views/Collection/CollectionOverview.vue2.js +22 -25
- package/dist/views/Collection/CollectionServerForm.vue.js +39 -45
- package/dist/views/Collection/CollectionServers.vue2.js +88 -98
- package/dist/views/Collection/CollectionSettings.vue.js +1 -1
- package/dist/views/Collection/CollectionSettings.vue2.js +101 -108
- package/dist/views/Collection/components/EnvironmentForm.vue.js +1 -1
- package/dist/views/Collection/components/EnvironmentForm.vue2.js +141 -145
- package/dist/views/Collection/components/MarkdownInput.vue.js +1 -1
- package/dist/views/Collection/components/MarkdownInput.vue2.js +1 -2
- package/dist/views/Components/CodeSnippet/CodeSnippet.vue.js +15 -15
- package/dist/views/Components/CodeSnippet/helpers/convert-to-har-request.js +15 -16
- package/dist/views/Components/CodeSnippet/helpers/get-har-request.js +61 -64
- package/dist/views/Components/CodeSnippet/helpers/get-snippet.js +9 -10
- package/dist/views/Cookies/CookieModal.vue.js +1 -1
- package/dist/views/Cookies/Cookies.vue2.js +90 -93
- package/dist/views/Environment/Environment.vue2.js +267 -295
- package/dist/views/Environment/EnvironmentModal.vue.js +63 -70
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.js +38 -42
- package/dist/views/Request/Request.vue.js +1 -1
- package/dist/views/Request/Request.vue2.js +60 -67
- package/dist/views/Request/RequestRoot.vue.js +1 -1
- package/dist/views/Request/RequestRoot.vue2.js +78 -89
- package/dist/views/Request/RequestSection/RequestAuth/DeleteRequestAuthModal.vue.js +37 -44
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.js +44 -45
- package/dist/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue.js +111 -127
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +120 -139
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.js +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue.js +97 -97
- package/dist/views/Request/RequestSection/RequestBody.vue.js +1 -1
- package/dist/views/Request/RequestSection/RequestBody.vue2.js +287 -310
- package/dist/views/Request/RequestSection/RequestCodeExample.vue.js +1 -1
- package/dist/views/Request/RequestSection/RequestCodeExample.vue2.js +86 -94
- package/dist/views/Request/RequestSection/RequestParams.vue.js +37 -38
- package/dist/views/Request/RequestSection/RequestPathParams.vue.js +36 -38
- package/dist/views/Request/RequestSection/RequestSection.vue.js +1 -1
- package/dist/views/Request/RequestSection/RequestSection.vue2.js +28 -31
- package/dist/views/Request/RequestSection/RequestTable.vue.js +1 -1
- package/dist/views/Request/RequestSection/RequestTable.vue2.js +49 -52
- package/dist/views/Request/RequestSection/RequestTableTooltip.vue.js +1 -1
- package/dist/views/Request/RequestSection/helpers/filter-security-requirements.js +16 -16
- package/dist/views/Request/RequestSection/helpers/getting-started.js +7 -11
- package/dist/views/Request/RequestSection/helpers/update-scheme.js +7 -8
- package/dist/views/Request/RequestSidebar.vue.js +1 -1
- package/dist/views/Request/RequestSidebar.vue2.js +199 -211
- package/dist/views/Request/RequestSidebarItem.vue.js +2 -2
- package/dist/views/Request/RequestSidebarItem.vue2.js +332 -349
- package/dist/views/Request/RequestSidebarItemMenu.vue.js +1 -1
- package/dist/views/Request/RequestSidebarItemMenu.vue2.js +210 -240
- package/dist/views/Request/RequestSubpageHeader.vue.js +1 -1
- package/dist/views/Request/ResponseSection/RequestHeaders.vue.js +38 -41
- package/dist/views/Request/ResponseSection/ResponseBody.vue.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseBody.vue2.js +58 -64
- package/dist/views/Request/ResponseSection/ResponseBodyDownload.vue.js +1 -2
- package/dist/views/Request/ResponseSection/ResponseBodyPreview.vue.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseBodyRaw.vue.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseBodyRaw.vue2.js +20 -23
- package/dist/views/Request/ResponseSection/ResponseBodyVirtual.vue3.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +29 -30
- package/dist/views/Request/ResponseSection/ResponseHeaders.vue.js +38 -41
- package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.js +28 -29
- package/dist/views/Request/ResponseSection/ResponseSection.vue.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseSection.vue2.js +128 -140
- package/dist/views/Request/components/WorkspaceDropdown.vue.js +116 -124
- package/dist/views/Request/consts/mediaTypes.js +2 -3
- package/dist/views/Request/handle-drag.js +24 -28
- package/dist/views/Request/hooks/useOpenApiWatcher.js +26 -33
- package/dist/views/Request/libs/auth.js +37 -43
- package/dist/views/Request/libs/oauth2.js +30 -32
- package/dist/views/Request/libs/watch-mode.js +100 -103
- package/dist/views/Settings/SettingsGeneral.vue.js +206 -236
- package/package.json +22 -22
- package/dist/components/AddressBar/AddressBar.vue3.js +0 -4
- package/dist/components/AddressBar/AddressBarHistory.vue3.js +0 -4
- package/dist/components/CodeInput/CodeInput.vue3.js +0 -4
- package/dist/components/CodeInput/CodeInput.vue4.js +0 -4
- package/dist/components/CommandPalette/CommandPaletteImportCurl.vue3.js +0 -4
- package/dist/components/CommandPalette/TheCommandPalette.vue3.js +0 -4
- package/dist/components/DataTable/DataTableInput.vue3.js +0 -4
- package/dist/components/EmptyState.vue3.js +0 -4
- package/dist/components/Form/LabelInput.vue3.js +0 -4
- package/dist/components/HttpMethod/HttpMethod.vue3.js +0 -4
- package/dist/components/ImportCollection/ImportCollectionModal.vue2.js +0 -4
- package/dist/components/OpenApiClientButton.vue3.js +0 -4
- package/dist/components/ScalarAsciiArt.vue3.js +0 -4
- package/dist/components/SectionFilter.vue3.js +0 -4
- package/dist/components/Server/ServerDropdownItem.vue3.js +0 -4
- package/dist/components/SideNav/DownloadAppButton.vue3.js +0 -4
- package/dist/components/Sidebar/Actions/SidebarListElementForm.vue3.js +0 -4
- package/dist/components/Sidebar/Sidebar.vue3.js +0 -4
- package/dist/components/Sidebar/SidebarListElement.vue3.js +0 -4
- package/dist/components/Sidebar/SidebarListElement.vue4.js +0 -4
- package/dist/components/TopNav/TopNavItem.vue3.js +0 -4
- package/dist/layouts/App/ApiClientApp.vue2.js +0 -4
- package/dist/layouts/Modal/ApiClientModal.vue3.js +0 -4
- package/dist/layouts/Web/ApiClientWeb.vue2.js +0 -4
- package/dist/style.css.js +0 -4
- package/dist/views/Collection/CollectionAuthentication.vue3.js +0 -4
- package/dist/views/Collection/CollectionEnvironment.vue3.js +0 -4
- package/dist/views/Collection/CollectionInfoForm.vue3.js +0 -4
- package/dist/views/Collection/CollectionSettings.vue3.js +0 -4
- package/dist/views/Collection/components/EnvironmentForm.vue3.js +0 -4
- package/dist/views/Collection/components/MarkdownInput.vue3.js +0 -4
- package/dist/views/Cookies/CookieModal.vue3.js +0 -4
- package/dist/views/Request/Request.vue3.js +0 -4
- package/dist/views/Request/RequestRoot.vue3.js +0 -4
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue3.js +0 -4
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue3.js +0 -4
- package/dist/views/Request/RequestSection/RequestBody.vue3.js +0 -4
- package/dist/views/Request/RequestSection/RequestCodeExample.vue3.js +0 -4
- package/dist/views/Request/RequestSection/RequestSection.vue3.js +0 -4
- package/dist/views/Request/RequestSection/RequestTable.vue3.js +0 -4
- package/dist/views/Request/RequestSection/RequestTableTooltip.vue3.js +0 -4
- package/dist/views/Request/RequestSidebar.vue3.js +0 -4
- package/dist/views/Request/RequestSidebarItem.vue3.js +0 -4
- package/dist/views/Request/RequestSidebarItem.vue4.js +0 -4
- package/dist/views/Request/RequestSidebarItemMenu.vue3.js +0 -4
- package/dist/views/Request/RequestSubpageHeader.vue3.js +0 -4
- package/dist/views/Request/ResponseSection/ResponseBody.vue3.js +0 -4
- package/dist/views/Request/ResponseSection/ResponseBodyPreview.vue3.js +0 -4
- package/dist/views/Request/ResponseSection/ResponseBodyRaw.vue3.js +0 -4
- package/dist/views/Request/ResponseSection/ResponseBodyVirtual.vue2.js +0 -4
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue3.js +0 -4
- package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue3.js +0 -4
- package/dist/views/Request/ResponseSection/ResponseSection.vue3.js +0 -4
|
@@ -13,16 +13,16 @@ const N = {
|
|
|
13
13
|
},
|
|
14
14
|
emits: ["change"],
|
|
15
15
|
setup(u, { emit: m }) {
|
|
16
|
-
const
|
|
17
|
-
() =>
|
|
16
|
+
const o = u, p = m, a = r(
|
|
17
|
+
() => o.enum.map((e) => ({ id: e, label: e }))
|
|
18
18
|
), n = r({
|
|
19
|
-
get: () =>
|
|
20
|
-
set: (e) =>
|
|
19
|
+
get: () => a.value.find((e) => e.id === o.value),
|
|
20
|
+
set: (e) => p("change", e?.id ?? "")
|
|
21
21
|
});
|
|
22
22
|
return (e, l) => (s(), v(t(k), {
|
|
23
23
|
modelValue: n.value,
|
|
24
|
-
"onUpdate:modelValue": l[0] || (l[0] = (
|
|
25
|
-
options:
|
|
24
|
+
"onUpdate:modelValue": l[0] || (l[0] = (d) => n.value = d),
|
|
25
|
+
options: a.value
|
|
26
26
|
}, {
|
|
27
27
|
default: c(() => [
|
|
28
28
|
i(t(x), {
|
|
@@ -1,103 +1,97 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarIcon as
|
|
3
|
-
import { useRouter as
|
|
4
|
-
import { ROUTES as
|
|
5
|
-
import { PathId as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { useActiveEntities as
|
|
11
|
-
import { useLayout as
|
|
12
|
-
const
|
|
1
|
+
import { defineComponent as h, createElementBlock as o, openBlock as r, normalizeClass as f, unref as e, createVNode as t, withCtx as n, createElementVNode as c, Fragment as w, renderList as k, createTextVNode as d, toDisplayString as b, createCommentVNode as y } from "vue";
|
|
2
|
+
import { ScalarIcon as C } from "@scalar/components";
|
|
3
|
+
import { useRouter as S } from "vue-router";
|
|
4
|
+
import { ROUTES as L } from "../../constants.js";
|
|
5
|
+
import { PathId as u } from "../../routes.js";
|
|
6
|
+
import B from "./DownloadAppButton.vue.js";
|
|
7
|
+
import E from "./SideHelp.vue.js";
|
|
8
|
+
import _ from "./SideNavGroup.vue.js";
|
|
9
|
+
import g from "./SideNavRouterLink.vue.js";
|
|
10
|
+
import { useActiveEntities as N } from "../../store/active-entities.js";
|
|
11
|
+
import { useLayout as V } from "../../hooks/useLayout.js";
|
|
12
|
+
const j = { class: "flex items-center" }, A = { class: "flex items-center" }, R = {
|
|
13
13
|
key: 0,
|
|
14
14
|
class: "hidden items-center justify-center sm:ml-1.5 sm:flex"
|
|
15
|
-
},
|
|
15
|
+
}, J = /* @__PURE__ */ h({
|
|
16
16
|
__name: "SideNav",
|
|
17
|
-
setup(
|
|
18
|
-
const { currentRoute:
|
|
19
|
-
return (
|
|
17
|
+
setup(W) {
|
|
18
|
+
const { currentRoute: a } = S(), { layout: s } = V(), { activeWorkspace: l } = N();
|
|
19
|
+
return ($, p) => (r(), o("nav", {
|
|
20
20
|
"aria-label": "App Navigation",
|
|
21
|
-
class:
|
|
21
|
+
class: f([
|
|
22
22
|
"app-drag-region flex items-center justify-center gap-1.5 pt-2 sm:justify-between",
|
|
23
|
-
e(
|
|
23
|
+
e(s) === "web" ? "h-header border !pt-0" : "px-2 pb-2 sm:flex-col"
|
|
24
24
|
]),
|
|
25
25
|
role: "navigation"
|
|
26
26
|
}, [
|
|
27
|
-
t(
|
|
28
|
-
default:
|
|
27
|
+
t(_, { class: "app-no-drag-region" }, {
|
|
28
|
+
default: n(() => [
|
|
29
29
|
c("a", {
|
|
30
|
-
class:
|
|
31
|
-
"sm:flex": e(
|
|
30
|
+
class: f(["mr-3 ml-1 hidden items-center", {
|
|
31
|
+
"sm:flex": e(s) === "web"
|
|
32
32
|
}]),
|
|
33
33
|
href: "https://www.scalar.com",
|
|
34
34
|
target: "_blank"
|
|
35
35
|
}, [
|
|
36
|
-
t(e(
|
|
36
|
+
t(e(C), {
|
|
37
37
|
icon: "Logo",
|
|
38
38
|
size: "xl"
|
|
39
39
|
})
|
|
40
40
|
], 2),
|
|
41
|
-
(
|
|
42
|
-
(
|
|
43
|
-
), ({ icon:
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
params: {
|
|
52
|
-
[e(_).Workspace]: ((f = e(l)) == null ? void 0 : f.uid) ?? "default"
|
|
53
|
-
}
|
|
41
|
+
(r(!0), o(w, null, k(e(L).filter(
|
|
42
|
+
(i) => i.to.name !== "settings.default"
|
|
43
|
+
), ({ icon: i, to: v, displayName: m }, x) => (r(), o("li", { key: x }, [
|
|
44
|
+
t(g, {
|
|
45
|
+
active: e(a).name === m.toLowerCase() || m.toLowerCase() === "environment" && e(a).name === "environment.collection",
|
|
46
|
+
icon: i,
|
|
47
|
+
to: {
|
|
48
|
+
...v,
|
|
49
|
+
params: {
|
|
50
|
+
[e(u).Workspace]: e(l)?.uid ?? "default"
|
|
54
51
|
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
])
|
|
62
|
-
|
|
52
|
+
}
|
|
53
|
+
}, {
|
|
54
|
+
default: n(() => [
|
|
55
|
+
d(b(m), 1)
|
|
56
|
+
]),
|
|
57
|
+
_: 2
|
|
58
|
+
}, 1032, ["active", "icon", "to"])
|
|
59
|
+
]))), 128))
|
|
63
60
|
]),
|
|
64
61
|
_: 1
|
|
65
62
|
}),
|
|
66
|
-
t(
|
|
67
|
-
default:
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
params: {
|
|
77
|
-
[e(_).Workspace]: (o = e(l)) == null ? void 0 : o.uid
|
|
78
|
-
}
|
|
63
|
+
t(_, { class: "app-no-drag-region" }, {
|
|
64
|
+
default: n(() => [
|
|
65
|
+
c("li", j, [
|
|
66
|
+
t(g, {
|
|
67
|
+
active: e(a).name === "settings",
|
|
68
|
+
icon: "Settings",
|
|
69
|
+
to: {
|
|
70
|
+
name: "settings.default",
|
|
71
|
+
params: {
|
|
72
|
+
[e(u).Workspace]: e(l)?.uid
|
|
79
73
|
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
])
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
]
|
|
95
|
-
|
|
74
|
+
}
|
|
75
|
+
}, {
|
|
76
|
+
default: n(() => p[0] || (p[0] = [
|
|
77
|
+
d(" Settings ")
|
|
78
|
+
])),
|
|
79
|
+
_: 1,
|
|
80
|
+
__: [0]
|
|
81
|
+
}, 8, ["active", "to"])
|
|
82
|
+
]),
|
|
83
|
+
c("li", A, [
|
|
84
|
+
t(E)
|
|
85
|
+
]),
|
|
86
|
+
e(s) !== "desktop" ? (r(), o("li", R, [
|
|
87
|
+
t(B)
|
|
88
|
+
])) : y("", !0)
|
|
89
|
+
]),
|
|
96
90
|
_: 1
|
|
97
91
|
})
|
|
98
92
|
], 2));
|
|
99
93
|
}
|
|
100
94
|
});
|
|
101
95
|
export {
|
|
102
|
-
|
|
96
|
+
J as default
|
|
103
97
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import t from "./SidebarListElement.vue2.js";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
/* empty css */
|
|
3
|
+
/* empty css */
|
|
4
4
|
import o from "../../_virtual/_plugin-vue_export-helper.js";
|
|
5
5
|
const p = /* @__PURE__ */ o(t, [["__scopeId", "data-v-0b6c70e4"]]);
|
|
6
6
|
export {
|
|
@@ -1,114 +1,105 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarContextMenu as
|
|
3
|
-
import { LibraryIcon as
|
|
4
|
-
import { useClipboard as
|
|
5
|
-
import { useRouter as
|
|
6
|
-
import { ROUTES as
|
|
7
|
-
import { useActiveEntities as
|
|
8
|
-
import
|
|
9
|
-
import { useWorkspace as
|
|
10
|
-
const
|
|
1
|
+
import { defineComponent as V, reactive as $, ref as j, computed as _, watch as S, onMounted as O, onBeforeUnmount as W, createElementBlock as C, openBlock as c, createElementVNode as v, createVNode as n, unref as a, withCtx as u, createTextVNode as L, createBlock as g, createCommentVNode as D, toDisplayString as K, Fragment as q, renderList as F } from "vue";
|
|
2
|
+
import { ScalarContextMenu as H, ScalarFloating as G, ScalarDropdownMenu as J, ScalarDropdownButton as I, ScalarIcon as d, ScalarHotkey as P } from "@scalar/components";
|
|
3
|
+
import { LibraryIcon as Q } from "@scalar/icons/library";
|
|
4
|
+
import { useClipboard as X } from "@scalar/use-hooks/useClipboard";
|
|
5
|
+
import { useRouter as Y } from "vue-router";
|
|
6
|
+
import { ROUTES as Z } from "../../constants.js";
|
|
7
|
+
import { useActiveEntities as ee } from "../../store/active-entities.js";
|
|
8
|
+
import te from "./TopNavItem.vue.js";
|
|
9
|
+
import { useWorkspace as oe } from "../../store/store.js";
|
|
10
|
+
const le = { class: "mac:pl-[72px] t-app__top-nav relative flex h-10 pl-2" }, ae = { class: "relative flex h-10 flex-1 items-center gap-1.5 overflow-hidden pr-2.5 text-base font-medium" }, ne = {
|
|
11
11
|
key: 0,
|
|
12
12
|
class: "h-full w-full overflow-hidden"
|
|
13
|
-
},
|
|
13
|
+
}, de = /* @__PURE__ */ V({
|
|
14
14
|
__name: "TopNav",
|
|
15
15
|
props: {
|
|
16
16
|
openNewTab: {}
|
|
17
17
|
},
|
|
18
|
-
setup(
|
|
19
|
-
const
|
|
18
|
+
setup(U) {
|
|
19
|
+
const A = U, { activeRequest: E, activeCollection: f } = ee(), i = Y(), { events: k } = oe(), { copyToClipboard: M } = X(), t = $([
|
|
20
20
|
{
|
|
21
21
|
label: "",
|
|
22
22
|
path: "",
|
|
23
23
|
icon: "Add",
|
|
24
24
|
isCollection: !1
|
|
25
25
|
}
|
|
26
|
-
]),
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
t[a.value] = {
|
|
34
|
-
label: ((l = (o = v.value) == null ? void 0 : o.info) == null ? void 0 : l.title) || "Untitled Collection",
|
|
35
|
-
path: c.currentRoute.value.path,
|
|
36
|
-
icon: ((i = v.value) == null ? void 0 : i["x-scalar-icon"]) || "Collection",
|
|
26
|
+
]), l = j(0), T = _(() => l.value), y = _(() => i.currentRoute.value.name?.toString().startsWith("collection."));
|
|
27
|
+
function N() {
|
|
28
|
+
if (y.value) {
|
|
29
|
+
t[l.value] = {
|
|
30
|
+
label: f.value?.info?.title || "Untitled Collection",
|
|
31
|
+
path: i.currentRoute.value.path,
|
|
32
|
+
icon: f.value?.["x-scalar-icon"] || "Collection",
|
|
37
33
|
isCollection: !0
|
|
38
34
|
};
|
|
39
35
|
return;
|
|
40
36
|
}
|
|
41
|
-
if (
|
|
42
|
-
t[
|
|
43
|
-
label:
|
|
44
|
-
path:
|
|
37
|
+
if (i.currentRoute.value.name?.toString().startsWith("request")) {
|
|
38
|
+
t[l.value] = {
|
|
39
|
+
label: E.value?.summary || "",
|
|
40
|
+
path: i.currentRoute.value.path,
|
|
45
41
|
icon: "ExternalLink",
|
|
46
42
|
isCollection: !1
|
|
47
43
|
};
|
|
48
44
|
return;
|
|
49
45
|
}
|
|
50
|
-
const e =
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
((S = c.currentRoute.value.name) == null ? void 0 : S.toString()) ?? ""
|
|
54
|
-
);
|
|
55
|
-
});
|
|
46
|
+
const e = Z.find((o) => o.to.name.startsWith(
|
|
47
|
+
i.currentRoute.value.name?.toString() ?? ""
|
|
48
|
+
));
|
|
56
49
|
if (e) {
|
|
57
|
-
t[
|
|
50
|
+
t[l.value] = {
|
|
58
51
|
label: e.displayName,
|
|
59
|
-
path:
|
|
52
|
+
path: i.currentRoute.value.path,
|
|
60
53
|
icon: e.icon,
|
|
61
54
|
isCollection: !1
|
|
62
55
|
};
|
|
63
56
|
return;
|
|
64
57
|
}
|
|
65
58
|
}
|
|
66
|
-
function
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
e && c.push(e);
|
|
59
|
+
function h() {
|
|
60
|
+
const e = t[l.value]?.path;
|
|
61
|
+
e && i.push(e);
|
|
70
62
|
}
|
|
71
|
-
function
|
|
63
|
+
function m() {
|
|
72
64
|
t.push({
|
|
73
65
|
label: "",
|
|
74
66
|
path: "",
|
|
75
67
|
icon: "Add",
|
|
76
68
|
isCollection: !1
|
|
77
|
-
}),
|
|
69
|
+
}), l.value = t.length - 1, N();
|
|
78
70
|
}
|
|
79
|
-
function
|
|
80
|
-
|
|
71
|
+
function p(e) {
|
|
72
|
+
l.value = e, h();
|
|
81
73
|
}
|
|
82
|
-
|
|
83
|
-
() =>
|
|
74
|
+
S(
|
|
75
|
+
() => i.currentRoute.value.path,
|
|
84
76
|
() => {
|
|
85
|
-
|
|
77
|
+
N();
|
|
86
78
|
},
|
|
87
79
|
{ immediate: !0 }
|
|
88
80
|
);
|
|
89
|
-
function
|
|
90
|
-
t.splice(e, 1),
|
|
91
|
-
|
|
81
|
+
function x(e) {
|
|
82
|
+
t.splice(e, 1), l.value = Math.min(
|
|
83
|
+
l.value,
|
|
92
84
|
t.length - 1
|
|
93
|
-
),
|
|
85
|
+
), h();
|
|
94
86
|
}
|
|
95
|
-
const
|
|
96
|
-
|
|
97
|
-
if (!((l = t[e]) != null && l.path))
|
|
87
|
+
const w = (e) => {
|
|
88
|
+
if (!t[e]?.path)
|
|
98
89
|
return;
|
|
99
90
|
const o = new URL(window.location.href);
|
|
100
|
-
o.pathname = t[e].path,
|
|
101
|
-
},
|
|
102
|
-
t.splice(0, e), t.splice(1),
|
|
103
|
-
},
|
|
91
|
+
o.pathname = t[e].path, M(o.toString());
|
|
92
|
+
}, z = (e) => {
|
|
93
|
+
t.splice(0, e), t.splice(1), l.value = 0, h();
|
|
94
|
+
}, R = (e) => {
|
|
104
95
|
if (e) {
|
|
105
|
-
if (e.addTopNav &&
|
|
96
|
+
if (e.addTopNav && m(), e.closeTopNav && x(l.value), e.navigateTopNavLeft && p(Math.max(l.value - 1, 0)), e.navigateTopNavRight && p(Math.min(l.value + 1, t.length - 1)), e.jumpToTab) {
|
|
106
97
|
const o = Number(e.jumpToTab.key) - 1;
|
|
107
|
-
o >= 0 && o < t.length &&
|
|
98
|
+
o >= 0 && o < t.length && p(o);
|
|
108
99
|
}
|
|
109
|
-
e.jumpToLastTab &&
|
|
100
|
+
e.jumpToLastTab && p(t.length - 1);
|
|
110
101
|
}
|
|
111
|
-
},
|
|
102
|
+
}, B = (e) => {
|
|
112
103
|
t.push({
|
|
113
104
|
label: e.name,
|
|
114
105
|
path: e.uid,
|
|
@@ -116,50 +107,47 @@ const ie = { class: "mac:pl-[72px] t-app__top-nav relative flex h-10 pl-2" }, se
|
|
|
116
107
|
isCollection: !1
|
|
117
108
|
});
|
|
118
109
|
};
|
|
119
|
-
return
|
|
120
|
-
() =>
|
|
110
|
+
return S(
|
|
111
|
+
() => A.openNewTab,
|
|
121
112
|
(e) => {
|
|
122
|
-
e &&
|
|
113
|
+
e && B(e);
|
|
123
114
|
},
|
|
124
115
|
{ immediate: !0 }
|
|
125
|
-
),
|
|
126
|
-
o[3] || (o[3] =
|
|
127
|
-
|
|
128
|
-
t.length === 1 ? (
|
|
129
|
-
|
|
130
|
-
trigger:
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
r(n(X), { class: "scalar-app scalar-client" }, {
|
|
150
|
-
default: f(() => [
|
|
151
|
-
r(n(A), {
|
|
116
|
+
), O(() => k.hotKeys.on(R)), W(() => k.hotKeys.off(R)), (e, o) => (c(), C("nav", le, [
|
|
117
|
+
o[3] || (o[3] = v("div", { class: "app-drag-region absolute inset-0" }, null, -1)),
|
|
118
|
+
v("div", ae, [
|
|
119
|
+
t.length === 1 ? (c(), C("div", ne, [
|
|
120
|
+
n(a(H), { triggerClass: "flex custom-scroll gap-1.5 h-full items-center justify-center w-full whitespace-nowrap" }, {
|
|
121
|
+
trigger: u(() => [
|
|
122
|
+
y.value ? (c(), g(a(Q), {
|
|
123
|
+
key: 0,
|
|
124
|
+
class: "size-3.5 min-w-3.5 stroke-2",
|
|
125
|
+
src: a(f)?.["x-scalar-icon"] || "Collection"
|
|
126
|
+
}, null, 8, ["src"])) : t[0]?.icon ? (c(), g(a(d), {
|
|
127
|
+
key: 1,
|
|
128
|
+
icon: t[0]?.icon,
|
|
129
|
+
size: "xs",
|
|
130
|
+
thickness: "2.5"
|
|
131
|
+
}, null, 8, ["icon"])) : D("", !0),
|
|
132
|
+
v("span", null, K(t[0]?.label), 1)
|
|
133
|
+
]),
|
|
134
|
+
content: u(() => [
|
|
135
|
+
n(a(G), { placement: "right-start" }, {
|
|
136
|
+
floating: u(() => [
|
|
137
|
+
n(a(J), { class: "scalar-app scalar-client" }, {
|
|
138
|
+
default: u(() => [
|
|
139
|
+
n(a(I), {
|
|
152
140
|
class: "flex items-center gap-1.5",
|
|
153
|
-
onClick:
|
|
141
|
+
onClick: m
|
|
154
142
|
}, {
|
|
155
|
-
default:
|
|
156
|
-
|
|
143
|
+
default: u(() => [
|
|
144
|
+
n(a(d), {
|
|
157
145
|
icon: "AddTab",
|
|
158
146
|
size: "sm",
|
|
159
147
|
thickness: "1.5"
|
|
160
148
|
}),
|
|
161
|
-
o[1] || (o[1] =
|
|
162
|
-
|
|
149
|
+
o[1] || (o[1] = L(" New Tab ")),
|
|
150
|
+
n(a(P), {
|
|
163
151
|
class: "bg-b-2 ml-auto",
|
|
164
152
|
hotkey: "T"
|
|
165
153
|
})
|
|
@@ -167,17 +155,17 @@ const ie = { class: "mac:pl-[72px] t-app__top-nav relative flex h-10 pl-2" }, se
|
|
|
167
155
|
_: 1,
|
|
168
156
|
__: [1]
|
|
169
157
|
}),
|
|
170
|
-
|
|
158
|
+
n(a(I), {
|
|
171
159
|
class: "flex items-center gap-1.5",
|
|
172
|
-
onClick: o[0] || (o[0] = (
|
|
160
|
+
onClick: o[0] || (o[0] = (s) => w(T.value))
|
|
173
161
|
}, {
|
|
174
|
-
default:
|
|
175
|
-
|
|
162
|
+
default: u(() => [
|
|
163
|
+
n(a(d), {
|
|
176
164
|
icon: "Link",
|
|
177
165
|
size: "sm",
|
|
178
166
|
thickness: "1.5"
|
|
179
167
|
}),
|
|
180
|
-
o[2] || (o[2] =
|
|
168
|
+
o[2] || (o[2] = L(" Copy URL "))
|
|
181
169
|
]),
|
|
182
170
|
_: 1,
|
|
183
171
|
__: [2]
|
|
@@ -191,28 +179,25 @@ const ie = { class: "mac:pl-[72px] t-app__top-nav relative flex h-10 pl-2" }, se
|
|
|
191
179
|
]),
|
|
192
180
|
_: 1
|
|
193
181
|
})
|
|
194
|
-
])) : (
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
}, null, 8, ["active", "hotkey", "icon", "isCollection", "label", "onClick", "onClose", "onCloseOtherTabs", "onCopyUrl"]);
|
|
209
|
-
}), 128)),
|
|
210
|
-
h("button", {
|
|
182
|
+
])) : (c(!0), C(q, { key: 1 }, F(t, (s, r) => (c(), g(te, {
|
|
183
|
+
key: s.path,
|
|
184
|
+
active: r === T.value,
|
|
185
|
+
hotkey: (r + 1).toString(),
|
|
186
|
+
icon: s.isCollection ? a(f)?.["x-scalar-icon"] || "Collection" : s.icon,
|
|
187
|
+
isCollection: s.isCollection || !1,
|
|
188
|
+
label: s.label,
|
|
189
|
+
onClick: (b) => p(r),
|
|
190
|
+
onClose: (b) => x(r),
|
|
191
|
+
onCloseOtherTabs: (b) => z(r),
|
|
192
|
+
onCopyUrl: (b) => w(r),
|
|
193
|
+
onNewTab: m
|
|
194
|
+
}, null, 8, ["active", "hotkey", "icon", "isCollection", "label", "onClick", "onClose", "onCloseOtherTabs", "onCopyUrl"]))), 128)),
|
|
195
|
+
v("button", {
|
|
211
196
|
class: "text-c-3 hover:bg-b-3 app-no-drag-region rounded p-1.5",
|
|
212
197
|
type: "button",
|
|
213
|
-
onClick:
|
|
198
|
+
onClick: m
|
|
214
199
|
}, [
|
|
215
|
-
|
|
200
|
+
n(a(d), {
|
|
216
201
|
icon: "Add",
|
|
217
202
|
size: "sm",
|
|
218
203
|
thickness: "2.5"
|
|
@@ -223,5 +208,5 @@ const ie = { class: "mac:pl-[72px] t-app__top-nav relative flex h-10 pl-2" }, se
|
|
|
223
208
|
}
|
|
224
209
|
});
|
|
225
210
|
export {
|
|
226
|
-
|
|
211
|
+
de as default
|
|
227
212
|
};
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
function
|
|
3
|
-
const
|
|
1
|
+
import { ref as f, readonly as p } from "vue";
|
|
2
|
+
function s({ multiple: l, accept: i, onChange: o, onError: n } = {}) {
|
|
3
|
+
const t = f(null);
|
|
4
4
|
let e;
|
|
5
|
-
typeof document < "u" && (e = document.createElement("input"), e.type = "file", e.onchange = (
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
}, e.onerror = () =>
|
|
9
|
-
const
|
|
5
|
+
typeof document < "u" && (e = document.createElement("input"), e.type = "file", e.onchange = (c) => {
|
|
6
|
+
const r = c.target;
|
|
7
|
+
t.value = r.files, o?.(t.value);
|
|
8
|
+
}, e.onerror = () => n?.(), e.multiple = l, e.accept = i);
|
|
9
|
+
const u = () => {
|
|
10
10
|
if (!e)
|
|
11
|
-
return
|
|
11
|
+
return n?.();
|
|
12
12
|
e.click();
|
|
13
13
|
};
|
|
14
14
|
return {
|
|
15
|
-
files:
|
|
16
|
-
open:
|
|
15
|
+
files: p(t),
|
|
16
|
+
open: u
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
19
|
export {
|
|
20
|
-
|
|
20
|
+
s as useFileDialog
|
|
21
21
|
};
|