@scalar/api-client 2.1.18 → 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 +41 -0
- package/dist/components/AddressBar/AddressBar.vue.d.ts +5 -1
- 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 +70 -69
- package/dist/components/AddressBar/AddressBarHistory.vue.js +2 -2
- package/dist/components/AddressBar/AddressBarHistory.vue2.js +8 -8
- package/dist/components/AddressBar/AddressBarServer.vue.d.ts.map +1 -1
- package/dist/components/AddressBar/AddressBarServer.vue.js +29 -29
- package/dist/components/CodeInput/CodeInput.vue.d.ts +6 -2
- 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 +57 -49
- package/dist/components/CommandPalette/CommandPaletteCollection.vue.d.ts +1 -1
- package/dist/components/CommandPalette/CommandPaletteExample.vue.d.ts +1 -1
- package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts +1 -1
- package/dist/components/CommandPalette/CommandPaletteRequest.vue.d.ts +1 -1
- package/dist/components/CommandPalette/CommandPaletteServer.vue.d.ts +1 -1
- package/dist/components/CommandPalette/CommandPaletteServer.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteServer.vue.js +62 -45
- package/dist/components/CommandPalette/CommandPaletteTag.vue.d.ts +1 -1
- package/dist/components/CommandPalette/CommandPaletteWorkspace.vue.d.ts +1 -1
- package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts +13 -7
- 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 +87 -89
- package/dist/components/ContextBar.vue.d.ts.map +1 -1
- package/dist/components/ContextBar.vue.js +2 -2
- package/dist/components/DataTable/DataTableCheckbox.vue.d.ts +19 -3
- package/dist/components/DataTable/DataTableCheckbox.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableCheckbox.vue.js +27 -14
- package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.d.ts.map +1 -1
- package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +8 -8
- package/dist/components/HttpMethod/HttpMethod.vue.d.ts +2 -2
- package/dist/components/ImportCollection/ImportCollectionModal.vue.d.ts.map +1 -1
- package/dist/components/ImportCollection/ImportCollectionModal.vue.js +29 -32
- package/dist/components/ImportCurl/ImportCurlModal.vue.d.ts +39 -0
- package/dist/components/ImportCurl/ImportCurlModal.vue.d.ts.map +1 -0
- package/dist/components/ImportCurl/ImportCurlModal.vue.js +7 -0
- package/dist/components/ImportCurl/ImportCurlModal.vue2.js +88 -0
- package/dist/components/SideNav/SideHelp.vue.d.ts.map +1 -1
- package/dist/components/SideNav/SideNav.vue.d.ts.map +1 -1
- package/dist/components/SideNav/SideNav.vue.js +1 -1
- package/dist/components/SideNav/SideNav.vue2.js +37 -26
- package/dist/components/SideNav/SideNavLink.vue.d.ts +2 -2
- package/dist/components/SideNav/SideNavLink.vue.d.ts.map +1 -1
- package/dist/components/SideNav/SideNavLink.vue.js +10 -11
- package/dist/components/Sidebar/Actions/DeleteSidebarListElement.vue.d.ts +1 -1
- package/dist/components/Sidebar/Sidebar.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/Sidebar.vue.js +1 -1
- package/dist/components/Sidebar/Sidebar.vue2.js +1 -1
- package/dist/components/Sidebar/SidebarButton.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarButton.vue.js +1 -1
- package/dist/components/Sidebar/SidebarListElement.vue.d.ts +24 -3
- 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 +26 -22
- package/dist/components/Sidebar/SidebarListElementActions.vue.d.ts +4 -0
- package/dist/components/Sidebar/SidebarListElementActions.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarListElementActions.vue.js +35 -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/ViewLayout.vue.d.ts.map +1 -1
- package/dist/components/ViewLayout/ViewLayout.vue.js +7 -7
- package/dist/components/ViewLayout/ViewLayoutCollapse.vue.d.ts.map +1 -1
- package/dist/components/ViewLayout/ViewLayoutCollapse.vue.js +1 -1
- package/dist/components/ViewLayout/ViewLayoutContent.vue.d.ts.map +1 -1
- package/dist/components/ViewLayout/ViewLayoutContent.vue.js +1 -1
- package/dist/components/ViewLayout/ViewLayoutSection.vue.d.ts.map +1 -1
- package/dist/components/ViewLayout/ViewLayoutSection.vue.js +11 -11
- package/dist/constants.d.ts +4 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +2 -1
- package/dist/hooks/useDarkModeState.d.ts +4 -3
- package/dist/hooks/useDarkModeState.d.ts.map +1 -1
- package/dist/hooks/useDarkModeState.js +36 -21
- package/dist/layouts/App/ApiClientApp.vue.d.ts.map +1 -1
- package/dist/layouts/App/ApiClientApp.vue.js +40 -44
- package/dist/layouts/App/create-api-client-app.d.ts +46 -36
- 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 +2 -2
- package/dist/layouts/Modal/ApiClientModal.vue2.js +17 -17
- package/dist/layouts/Modal/create-api-client-modal.d.ts +92 -72
- 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 -34
- package/dist/layouts/Web/create-api-client-web.d.ts +46 -36
- package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
- package/dist/libs/create-client.d.ts +46 -36
- 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/importers/curl.d.ts +3 -0
- package/dist/libs/importers/curl.d.ts.map +1 -0
- package/dist/libs/importers/curl.js +61 -0
- package/dist/libs/importers/index.d.ts +2 -0
- package/dist/libs/importers/index.d.ts.map +1 -0
- package/dist/libs/importers/index.js +4 -0
- package/dist/libs/index.d.ts +4 -1
- package/dist/libs/index.d.ts.map +1 -1
- package/dist/libs/index.js +31 -31
- package/dist/libs/parse-curl.d.ts +12 -0
- package/dist/libs/parse-curl.d.ts.map +1 -0
- package/dist/libs/parse-curl.js +70 -0
- 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/router.d.ts +2 -1
- package/dist/router.d.ts.map +1 -1
- package/dist/router.js +33 -24
- package/dist/store/collections.d.ts +4 -4
- package/dist/store/cookies.d.ts +4 -4
- package/dist/store/environment.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 +4 -4
- package/dist/store/requests.d.ts +4 -4
- package/dist/store/router-params.d.ts +1 -0
- package/dist/store/router-params.d.ts.map +1 -1
- package/dist/store/router-params.js +2 -1
- package/dist/store/security-schemes.d.ts +4 -4
- package/dist/store/servers.d.ts +4 -4
- package/dist/store/store.d.ts +92 -72
- package/dist/store/store.d.ts.map +1 -1
- package/dist/store/store.js +138 -129
- 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/Cookies/Cookies.vue.d.ts.map +1 -1
- package/dist/views/Cookies/Cookies.vue2.js +18 -18
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts.map +1 -1
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.js +9 -9
- 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 +148 -98
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +2 -2
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +1 -1
- package/dist/views/Request/RequestSection/RequestTableTooltip.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestTableTooltip.vue.js +4 -4
- package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebar.vue.js +3 -3
- 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 +73 -73
- 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/RequestSubpageHeader.vue.d.ts +2 -0
- package/dist/views/Request/RequestSubpageHeader.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSubpageHeader.vue.js +4 -4
- package/dist/views/Request/RequestSubpageHeader.vue2.js +17 -15
- 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 +18 -19
- 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/dist/views/Settings/Settings.vue.d.ts +4 -0
- package/dist/views/Settings/Settings.vue.d.ts.map +1 -0
- package/dist/views/Settings/Settings.vue.js +4 -0
- package/dist/views/Settings/Settings.vue2.js +59 -0
- package/dist/{components/DarkModeToggle/DarkModeIconToggle.vue.d.ts → views/Settings/SettingsGeneral.vue.d.ts} +1 -1
- package/dist/views/Settings/SettingsGeneral.vue.d.ts.map +1 -0
- package/dist/views/Settings/SettingsGeneral.vue.js +124 -0
- package/dist/views/Settings/SettingsGeneral.vue2.js +4 -0
- package/dist/views/Settings/SettingsGeneralMode.vue.d.ts +3 -0
- package/dist/views/Settings/SettingsGeneralMode.vue.d.ts.map +1 -0
- package/dist/views/Settings/SettingsGeneralMode.vue.js +78 -0
- package/dist/views/Settings/SettingsGeneralMode.vue2.js +4 -0
- package/package.json +59 -35
- package/dist/components/DarkModeToggle/DarkModeIconToggle.vue.d.ts.map +0 -1
- package/dist/components/DarkModeToggle/DarkModeIconToggle.vue.js +0 -31
- package/dist/components/DarkModeToggle/DarkModeIconToggle.vue2.js +0 -4
- package/dist/components/DarkModeToggle/index.d.ts +0 -2
- package/dist/components/DarkModeToggle/index.d.ts.map +0 -1
- package/dist/components/DarkModeToggle/index.js +0 -4
- package/dist/components/ScreenReader.vue.js +0 -7
- package/dist/components/ScreenReader.vue2.js +0 -18
- 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
|
@@ -1,65 +1,68 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { useModal as
|
|
4
|
-
import { useClipboard as
|
|
5
|
-
const
|
|
1
|
+
import { defineComponent as y, ref as h, openBlock as n, createElementBlock as i, Fragment as w, createElementVNode as k, unref as a, createVNode as r, createCommentVNode as s, withModifiers as M, withCtx as D, createBlock as N } from "vue";
|
|
2
|
+
import $ from "./Actions/DeleteSidebarListElement.vue.js";
|
|
3
|
+
import { useModal as B, ScalarIcon as m, ScalarModal as S } from "@scalar/components";
|
|
4
|
+
import { useClipboard as x } from "../../hooks/useClipboard.js";
|
|
5
|
+
const A = { class: "absolute flex right-1 opacity-0 group-hover:opacity-100" }, I = /* @__PURE__ */ y({
|
|
6
6
|
__name: "SidebarListElementActions",
|
|
7
7
|
props: {
|
|
8
8
|
variable: {},
|
|
9
|
-
warningMessage: {}
|
|
9
|
+
warningMessage: {},
|
|
10
|
+
isCopyable: { type: Boolean },
|
|
11
|
+
isDeletable: { type: Boolean }
|
|
10
12
|
},
|
|
11
13
|
emits: ["delete"],
|
|
12
|
-
setup(
|
|
13
|
-
const { variable: b } =
|
|
14
|
-
function
|
|
15
|
-
t.value = { action: e, name: b.name },
|
|
14
|
+
setup(d, { emit: p }) {
|
|
15
|
+
const { variable: b } = d, v = p, t = h({ action: "None", name: "" }), l = B(), { copyToClipboard: f } = x();
|
|
16
|
+
function g(e) {
|
|
17
|
+
t.value = { action: e, name: b.name }, l.show();
|
|
16
18
|
}
|
|
17
|
-
function
|
|
18
|
-
|
|
19
|
+
function u() {
|
|
20
|
+
l.hide(), t.value = { action: "None", name: "" };
|
|
19
21
|
}
|
|
20
|
-
function
|
|
21
|
-
|
|
22
|
+
function C(e) {
|
|
23
|
+
v("delete", e), u();
|
|
22
24
|
}
|
|
23
|
-
return (e, o) => (
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
return (e, o) => (n(), i(w, null, [
|
|
26
|
+
k("div", A, [
|
|
27
|
+
e.isCopyable ? (n(), i("button", {
|
|
28
|
+
key: 0,
|
|
26
29
|
class: "text-c-3 hover:bg-b-3 hover:text-c-1 rounded p-[5px]",
|
|
27
30
|
type: "button",
|
|
28
|
-
onClick: o[0] || (o[0] = (
|
|
31
|
+
onClick: o[0] || (o[0] = (c) => a(f)(e.variable.name))
|
|
29
32
|
}, [
|
|
30
|
-
|
|
33
|
+
r(a(m), {
|
|
31
34
|
class: "h-3 w-3",
|
|
32
35
|
icon: "Clipboard"
|
|
33
36
|
})
|
|
34
|
-
]),
|
|
35
|
-
e.variable.isDefault
|
|
36
|
-
key:
|
|
37
|
+
])) : s("", !0),
|
|
38
|
+
!e.variable.isDefault && e.isDeletable ? (n(), i("button", {
|
|
39
|
+
key: 1,
|
|
37
40
|
class: "text-c-3 hover:bg-b-3 hover:text-c-1 rounded p-1",
|
|
38
41
|
type: "button",
|
|
39
|
-
onClick: o[1] || (o[1] =
|
|
42
|
+
onClick: o[1] || (o[1] = M((c) => g(
|
|
40
43
|
"Delete"
|
|
41
44
|
/* Delete */
|
|
42
45
|
), ["prevent"]))
|
|
43
46
|
}, [
|
|
44
|
-
|
|
47
|
+
r(a(m), {
|
|
45
48
|
class: "h-3.5 w-3.5",
|
|
46
49
|
icon: "Close"
|
|
47
50
|
})
|
|
48
|
-
]))
|
|
51
|
+
])) : s("", !0)
|
|
49
52
|
]),
|
|
50
|
-
|
|
53
|
+
r(a(S), {
|
|
51
54
|
size: "sm",
|
|
52
|
-
state: a(
|
|
55
|
+
state: a(l),
|
|
53
56
|
title: `${t.value.action} ${t.value.name}`
|
|
54
57
|
}, {
|
|
55
|
-
default:
|
|
56
|
-
t.value.action === "Delete" ? (
|
|
58
|
+
default: D(() => [
|
|
59
|
+
t.value.action === "Delete" ? (n(), N($, {
|
|
57
60
|
key: 0,
|
|
58
61
|
variableName: t.value.name,
|
|
59
62
|
warningMessage: e.warningMessage,
|
|
60
|
-
onClose:
|
|
61
|
-
onDelete: o[2] || (o[2] = (
|
|
62
|
-
}, null, 8, ["variableName", "warningMessage"])) :
|
|
63
|
+
onClose: u,
|
|
64
|
+
onDelete: o[2] || (o[2] = (c) => C(e.variable.uid))
|
|
65
|
+
}, null, 8, ["variableName", "warningMessage"])) : s("", !0)
|
|
63
66
|
]),
|
|
64
67
|
_: 1
|
|
65
68
|
}, 8, ["state", "title"])
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TopNav.vue.d.ts","sourceRoot":"","sources":["../../../src/components/TopNav/TopNav.vue"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"TopNav.vue.d.ts","sourceRoot":"","sources":["../../../src/components/TopNav/TopNav.vue"],"names":[],"mappings":";gBAoRc;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;;gBAApC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;;AA2dlD,wBAMG;AAOH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./TopNav.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
const
|
|
3
|
+
import f from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const a = /* @__PURE__ */ f(o, [["__scopeId", "data-v-f3ff8743"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
a as default
|
|
7
7
|
};
|
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
import { defineComponent as z, reactive as A, ref as
|
|
1
|
+
import { defineComponent as z, reactive as A, ref as M, computed as j, watch as C, onMounted as B, onBeforeUnmount as E, openBlock as d, createElementBlock as g, createElementVNode as h, createVNode as n, unref as l, withCtx as u, toDisplayString as O, createTextVNode as x, Fragment as V, renderList as D, createBlock as K, pushScopeId as q, popScopeId as F } from "vue";
|
|
2
2
|
import H from "../ScalarHotkey.vue.js";
|
|
3
3
|
import { ROUTES as W } from "../../constants.js";
|
|
4
4
|
import { useClipboard as G } from "../../hooks/useClipboard.js";
|
|
5
|
-
import { ScalarContextMenu as J, ScalarIcon as
|
|
5
|
+
import { ScalarContextMenu as J, ScalarIcon as f, ScalarDropdown as P, ScalarDropdownItem as I } from "@scalar/components";
|
|
6
6
|
import { capitalize as Q } from "@scalar/oas-utils/helpers";
|
|
7
7
|
import X from "./TopNavItem.vue.js";
|
|
8
8
|
import { useWorkspace as Y } from "../../store/store.js";
|
|
9
|
-
|
|
10
|
-
const Z = (s) => (K("data-v-9a66e94b"), s = s(), F(), s), ee = { class: "flex h-10 t-app__top-nav" }, te = /* @__PURE__ */ Z(() => /* @__PURE__ */ f("div", { class: "t-app__top-nav-draggable" }, null, -1)), oe = { class: "flex h-10 flex-1 items-center gap-1.5 text-sm font-medium pr-1 relative overflow-hidden" }, ae = {
|
|
9
|
+
const Z = (c) => (q("data-v-f3ff8743"), c = c(), F(), c), ee = { class: "flex h-10 t-app__top-nav" }, te = /* @__PURE__ */ Z(() => /* @__PURE__ */ h("div", { class: "t-app__top-nav-draggable" }, null, -1)), oe = { class: "flex h-10 flex-1 items-center gap-1.5 text-sm font-medium pr-1 relative overflow-hidden" }, ae = {
|
|
11
10
|
key: 0,
|
|
12
11
|
class: "h-full w-full overflow-hidden"
|
|
13
|
-
},
|
|
12
|
+
}, me = /* @__PURE__ */ z({
|
|
14
13
|
__name: "TopNav",
|
|
15
14
|
props: {
|
|
16
15
|
openNewTab: {}
|
|
17
16
|
},
|
|
18
|
-
setup(
|
|
19
|
-
const S =
|
|
20
|
-
function
|
|
17
|
+
setup(c) {
|
|
18
|
+
const S = c, { activeRequest: L, router: i, events: T } = Y(), { copyToClipboard: U } = G(), t = A([{ label: "", path: "", icon: "Add" }]), o = M(0), k = j(() => o.value);
|
|
19
|
+
function _() {
|
|
21
20
|
var a;
|
|
22
21
|
const e = W.find((p) => i.currentRoute.value.name == p.name);
|
|
23
22
|
e && ((e == null ? void 0 : e.name) === "request" ? t[o.value] = {
|
|
@@ -34,35 +33,37 @@ const Z = (s) => (K("data-v-9a66e94b"), s = s(), F(), s), ee = { class: "flex h-
|
|
|
34
33
|
i.push(t[o.value].path);
|
|
35
34
|
}
|
|
36
35
|
function m() {
|
|
37
|
-
t.push({ label: "", path: "", icon: "Add" }), o.value = t.length - 1,
|
|
36
|
+
t.push({ label: "", path: "", icon: "Add" }), o.value = t.length - 1, _();
|
|
38
37
|
}
|
|
39
38
|
function r(e) {
|
|
40
39
|
o.value = e, v();
|
|
41
40
|
}
|
|
42
|
-
|
|
41
|
+
C(
|
|
43
42
|
() => i.currentRoute.value.path,
|
|
44
43
|
() => {
|
|
45
|
-
|
|
44
|
+
_();
|
|
46
45
|
},
|
|
47
46
|
{ immediate: !0 }
|
|
48
47
|
);
|
|
49
|
-
function
|
|
48
|
+
function N(e) {
|
|
50
49
|
t.splice(e, 1), o.value = Math.min(
|
|
51
50
|
o.value,
|
|
52
51
|
t.length - 1
|
|
53
52
|
), v();
|
|
54
53
|
}
|
|
55
|
-
const
|
|
54
|
+
const y = (e) => {
|
|
56
55
|
const a = new URL(window.location.href);
|
|
57
56
|
a.pathname = t[e].path, U(a.toString());
|
|
58
57
|
}, R = (e) => {
|
|
59
58
|
t.splice(0, e), t.splice(1), o.value = 0, v();
|
|
60
59
|
}, w = (e) => {
|
|
61
|
-
if (e
|
|
62
|
-
|
|
63
|
-
|
|
60
|
+
if (e) {
|
|
61
|
+
if (e.addTopNav && m(), e.closeTopNav && N(o.value), e.navigateTopNavLeft && r(Math.max(o.value - 1, 0)), e.navigateTopNavRight && r(Math.min(o.value + 1, t.length - 1)), e.jumpToTab) {
|
|
62
|
+
const a = Number(e.jumpToTab.key) - 1;
|
|
63
|
+
a >= 0 && a < t.length && r(a);
|
|
64
|
+
}
|
|
65
|
+
e.jumpToLastTab && r(t.length - 1);
|
|
64
66
|
}
|
|
65
|
-
e.jumpToLastTab && r(t.length - 1);
|
|
66
67
|
}, $ = (e) => {
|
|
67
68
|
t.push({
|
|
68
69
|
label: e.name,
|
|
@@ -70,24 +71,24 @@ const Z = (s) => (K("data-v-9a66e94b"), s = s(), F(), s), ee = { class: "flex h-
|
|
|
70
71
|
icon: "ExternalLink"
|
|
71
72
|
});
|
|
72
73
|
};
|
|
73
|
-
return
|
|
74
|
+
return C(
|
|
74
75
|
() => S.openNewTab,
|
|
75
76
|
(e) => {
|
|
76
77
|
e && $(e);
|
|
77
78
|
},
|
|
78
79
|
{ immediate: !0 }
|
|
79
|
-
),
|
|
80
|
+
), B(() => T.hotKeys.on(w)), E(() => T.hotKeys.off(w)), (e, a) => (d(), g("nav", ee, [
|
|
80
81
|
te,
|
|
81
|
-
|
|
82
|
+
h("div", oe, [
|
|
82
83
|
t.length === 1 ? (d(), g("div", ae, [
|
|
83
84
|
n(l(J), { triggerClass: "flex custom-scroll gap-1.5 h-full items-center justify-center w-full whitespace-nowrap" }, {
|
|
84
85
|
trigger: u(() => [
|
|
85
|
-
n(l(
|
|
86
|
+
n(l(f), {
|
|
86
87
|
icon: t[0].icon,
|
|
87
88
|
size: "xs",
|
|
88
89
|
thickness: "2.5"
|
|
89
90
|
}, null, 8, ["icon"]),
|
|
90
|
-
|
|
91
|
+
h("span", null, O(t[0].label), 1)
|
|
91
92
|
]),
|
|
92
93
|
content: u(() => [
|
|
93
94
|
n(l(P), {
|
|
@@ -95,17 +96,17 @@ const Z = (s) => (K("data-v-9a66e94b"), s = s(), F(), s), ee = { class: "flex h-
|
|
|
95
96
|
static: ""
|
|
96
97
|
}, {
|
|
97
98
|
items: u(() => [
|
|
98
|
-
n(l(
|
|
99
|
+
n(l(I), {
|
|
99
100
|
class: "flex items-center gap-1.5",
|
|
100
101
|
onClick: m
|
|
101
102
|
}, {
|
|
102
103
|
default: u(() => [
|
|
103
|
-
n(l(
|
|
104
|
+
n(l(f), {
|
|
104
105
|
icon: "AddTab",
|
|
105
106
|
size: "sm",
|
|
106
107
|
thickness: "1.5"
|
|
107
108
|
}),
|
|
108
|
-
|
|
109
|
+
x(" New Tab "),
|
|
109
110
|
n(H, {
|
|
110
111
|
class: "bg-b-2 ml-auto",
|
|
111
112
|
hotkey: "T"
|
|
@@ -113,17 +114,17 @@ const Z = (s) => (K("data-v-9a66e94b"), s = s(), F(), s), ee = { class: "flex h-
|
|
|
113
114
|
]),
|
|
114
115
|
_: 1
|
|
115
116
|
}),
|
|
116
|
-
n(l(
|
|
117
|
+
n(l(I), {
|
|
117
118
|
class: "flex items-center gap-1.5",
|
|
118
|
-
onClick: a[0] || (a[0] = (p) =>
|
|
119
|
+
onClick: a[0] || (a[0] = (p) => y(k.value))
|
|
119
120
|
}, {
|
|
120
121
|
default: u(() => [
|
|
121
|
-
n(l(
|
|
122
|
+
n(l(f), {
|
|
122
123
|
icon: "Link",
|
|
123
124
|
size: "sm",
|
|
124
125
|
thickness: "1.5"
|
|
125
126
|
}),
|
|
126
|
-
|
|
127
|
+
x(" Copy URL ")
|
|
127
128
|
]),
|
|
128
129
|
_: 1
|
|
129
130
|
})
|
|
@@ -133,24 +134,24 @@ const Z = (s) => (K("data-v-9a66e94b"), s = s(), F(), s), ee = { class: "flex h-
|
|
|
133
134
|
]),
|
|
134
135
|
_: 1
|
|
135
136
|
})
|
|
136
|
-
])) : (d(!0), g(V, { key: 1 }, D(t, (p,
|
|
137
|
-
key:
|
|
138
|
-
active:
|
|
139
|
-
hotkey: (
|
|
137
|
+
])) : (d(!0), g(V, { key: 1 }, D(t, (p, s) => (d(), K(X, {
|
|
138
|
+
key: s,
|
|
139
|
+
active: s === k.value,
|
|
140
|
+
hotkey: (s + 1).toString(),
|
|
140
141
|
icon: p.icon,
|
|
141
142
|
label: p.label,
|
|
142
|
-
onClick: (b) => r(
|
|
143
|
-
onClose: (b) =>
|
|
144
|
-
onCloseOtherTabs: (b) => R(
|
|
145
|
-
onCopyUrl: (b) =>
|
|
143
|
+
onClick: (b) => r(s),
|
|
144
|
+
onClose: (b) => N(s),
|
|
145
|
+
onCloseOtherTabs: (b) => R(s),
|
|
146
|
+
onCopyUrl: (b) => y(s),
|
|
146
147
|
onNewTab: m
|
|
147
148
|
}, null, 8, ["active", "hotkey", "icon", "label", "onClick", "onClose", "onCloseOtherTabs", "onCopyUrl"]))), 128)),
|
|
148
|
-
|
|
149
|
+
h("button", {
|
|
149
150
|
class: "text-c-3 hover:bg-b-3 p-1.5 rounded webkit-app-no-drag",
|
|
150
151
|
type: "button",
|
|
151
152
|
onClick: m
|
|
152
153
|
}, [
|
|
153
|
-
n(l(
|
|
154
|
+
n(l(f), {
|
|
154
155
|
icon: "Add",
|
|
155
156
|
size: "xs",
|
|
156
157
|
thickness: "2.5"
|
|
@@ -161,5 +162,5 @@ const Z = (s) => (K("data-v-9a66e94b"), s = s(), F(), s), ee = { class: "flex h-
|
|
|
161
162
|
}
|
|
162
163
|
});
|
|
163
164
|
export {
|
|
164
|
-
|
|
165
|
+
me as default
|
|
165
166
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewLayout.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ViewLayout/ViewLayout.vue"],"names":[],"mappings":"AAeA,iBAAS,cAAc;
|
|
1
|
+
{"version":3,"file":"ViewLayout.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ViewLayout/ViewLayout.vue"],"names":[],"mappings":"AAeA,iBAAS,cAAc;qBA2BM,GAAG;EAa/B;AACD,QAAA,MAAM,eAAe,0NAKnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAAvG,wBAAwG;AAOxG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACpC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { openBlock as o, createElementBlock as
|
|
2
|
-
import
|
|
3
|
-
const
|
|
4
|
-
function
|
|
5
|
-
return o(),
|
|
6
|
-
|
|
1
|
+
import { openBlock as o, createElementBlock as d, renderSlot as r } from "vue";
|
|
2
|
+
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
3
|
+
const i = {}, l = { class: "divide-y md:divide-y-0 divide-1 flex flex-col min-h-0 flex-1 xl:overflow-hidden md:flex-row leading-3" };
|
|
4
|
+
function n(e, c) {
|
|
5
|
+
return o(), d("div", l, [
|
|
6
|
+
r(e.$slots, "default")
|
|
7
7
|
]);
|
|
8
8
|
}
|
|
9
|
-
const a = /* @__PURE__ */
|
|
9
|
+
const a = /* @__PURE__ */ t(i, [["render", n]]);
|
|
10
10
|
export {
|
|
11
11
|
a as default
|
|
12
12
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewLayoutCollapse.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ViewLayout/ViewLayoutCollapse.vue"],"names":[],"mappings":"AAiFA,iBAAS,cAAc;;;
|
|
1
|
+
{"version":3,"file":"ViewLayoutCollapse.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ViewLayout/ViewLayoutCollapse.vue"],"names":[],"mappings":"AAiFA,iBAAS,cAAc;;;QAgJK,GAAG;;;QACD,GAAG;;;QACH,GAAG;EAkBhC;AACD,QAAA,MAAM,eAAe;kBAzLH,OAAO;gBACT,MAAM;;;;;kBADJ,OAAO;gBACT,MAAM;;;;;iBADJ,OAAO;eACT,MAAM;MA8LpB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAAvG,wBAAwG;AAOxG,KAAK,kBAAkB,CAAC,CAAC,EAAE,CAAC,IAAI;KAC1B,CAAC,IAAI,MAAM,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,SAAS,MAAM,CAAC,GAC7C,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG;QAAE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;KAAC,CAAC,GACvC,CAAC,CAAC,CAAC,CAAC;CACP,CAAC;AAEN,KAAK,cAAc,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC;AAExD,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACpC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC;AAEN,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewLayoutContent.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ViewLayout/ViewLayoutContent.vue"],"names":[],"mappings":"AAeA,iBAAS,cAAc;
|
|
1
|
+
{"version":3,"file":"ViewLayoutContent.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ViewLayout/ViewLayoutContent.vue"],"names":[],"mappings":"AAeA,iBAAS,cAAc;qBA4BM,GAAG;EAa/B;AACD,QAAA,MAAM,eAAe,0NAKnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAAvG,wBAAwG;AAOxG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACpC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { openBlock as o, createElementBlock as r, renderSlot as t } from "vue";
|
|
2
2
|
import d from "../../_virtual/_plugin-vue_export-helper.js";
|
|
3
|
-
const l = {}, c = { class: "border-t-1/2 md:border-t-0 divide divide-y xl:divide-y-0 xl:divide-x-1/2 flex xl:flex-row flex-col custom-scroll pr-0
|
|
3
|
+
const l = {}, c = { class: "border-t-1/2 md:border-t-0 divide divide-y xl:divide-y-0 xl:divide-x-1/2 flex xl:flex-row flex-col custom-scroll pr-0" };
|
|
4
4
|
function i(e, n) {
|
|
5
5
|
return o(), r("div", c, [
|
|
6
6
|
t(e.$slots, "default")
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewLayoutSection.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ViewLayout/ViewLayoutSection.vue"],"names":[],"mappings":"AA8BA,iBAAS,cAAc;
|
|
1
|
+
{"version":3,"file":"ViewLayoutSection.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ViewLayout/ViewLayoutSection.vue"],"names":[],"mappings":"AA8BA,iBAAS,cAAc;mBA8CI,GAAG;qBACD,GAAG;EAc/B;AACD,QAAA,MAAM,eAAe,0NAKnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAAvG,wBAAwG;AAOxG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACpC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { defineComponent as n, openBlock as r, createElementBlock as s, unref as
|
|
2
|
-
import { nanoid as
|
|
1
|
+
import { defineComponent as n, openBlock as r, createElementBlock as s, unref as t, createElementVNode as i, renderSlot as o } from "vue";
|
|
2
|
+
import { nanoid as d } from "nanoid";
|
|
3
3
|
const a = ["aria-labelledby"], c = ["id"], u = /* @__PURE__ */ n({
|
|
4
4
|
__name: "ViewLayoutSection",
|
|
5
5
|
setup(m) {
|
|
6
|
-
const e =
|
|
7
|
-
return (
|
|
8
|
-
"aria-labelledby":
|
|
9
|
-
class: "flex xl:min-w-0 xl:flex-1 flex-col xl:custom-scroll bg-b-1"
|
|
6
|
+
const e = d();
|
|
7
|
+
return (l, p) => (r(), s("section", {
|
|
8
|
+
"aria-labelledby": t(e),
|
|
9
|
+
class: "flex h-full xl:min-w-0 xl:flex-1 flex-col xl:custom-scroll bg-b-1"
|
|
10
10
|
}, [
|
|
11
|
-
|
|
12
|
-
id:
|
|
13
|
-
class: "xl:min-h-header flex items-center border-b-1/2
|
|
11
|
+
i("div", {
|
|
12
|
+
id: t(e),
|
|
13
|
+
class: "min-h-11 xl:min-h-header flex items-center border-b-1/2 px-3.5 py-2 md:px-4 md:py-2.5 xl:px-6 xl:pr-5 text-sm font-medium sticky top-0 bg-b-1 xl:rounded-none"
|
|
14
14
|
}, [
|
|
15
|
-
l
|
|
15
|
+
o(l.$slots, "title")
|
|
16
16
|
], 8, c),
|
|
17
|
-
l
|
|
17
|
+
o(l.$slots, "default")
|
|
18
18
|
], 8, a));
|
|
19
19
|
}
|
|
20
20
|
});
|
package/dist/constants.d.ts
CHANGED
|
@@ -10,5 +10,9 @@ export declare const ROUTES: readonly [{
|
|
|
10
10
|
readonly prettyName: "Env Vars";
|
|
11
11
|
readonly name: "environment";
|
|
12
12
|
readonly icon: "Brackets";
|
|
13
|
+
}, {
|
|
14
|
+
readonly prettyName: "Settings";
|
|
15
|
+
readonly name: "settings";
|
|
16
|
+
readonly icon: "Settings";
|
|
13
17
|
}];
|
|
14
18
|
//# sourceMappingURL=constants.d.ts.map
|
package/dist/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;EAOT,CAAA"}
|
package/dist/constants.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
const e = [
|
|
2
2
|
{ prettyName: "Request", name: "request", icon: "ExternalLink" },
|
|
3
3
|
{ prettyName: "Cookies", name: "cookies", icon: "Cookie" },
|
|
4
|
-
{ prettyName: "Env Vars", name: "environment", icon: "Brackets" }
|
|
4
|
+
{ prettyName: "Env Vars", name: "environment", icon: "Brackets" },
|
|
5
|
+
{ prettyName: "Settings", name: "settings", icon: "Settings" }
|
|
5
6
|
// { prettyName: 'Servers', name: 'servers', icon: 'Server' },
|
|
6
7
|
// { label: 'Git Sync', icon: 'Branch', path: '/git-sync' },
|
|
7
8
|
];
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/** This hook helps with retrieving the dark mode setting from local storage or from system settings. */
|
|
2
|
-
export declare function useDarkModeState(
|
|
3
|
-
|
|
2
|
+
export declare function useDarkModeState(): {
|
|
3
|
+
colorMode: import("vue").Ref<"light" | "dark" | "system">;
|
|
4
4
|
toggleDarkMode: () => void;
|
|
5
|
-
setDarkMode: (value: boolean) => void;
|
|
5
|
+
setDarkMode: (value: boolean | null) => void;
|
|
6
|
+
getSystemModePreference: () => boolean;
|
|
6
7
|
};
|
|
7
8
|
//# sourceMappingURL=useDarkModeState.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDarkModeState.d.ts","sourceRoot":"","sources":["../../src/hooks/useDarkModeState.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useDarkModeState.d.ts","sourceRoot":"","sources":["../../src/hooks/useDarkModeState.ts"],"names":[],"mappings":"AAIA,wGAAwG;AACxG,wBAAgB,gBAAgB;;;yBAYF,OAAO,GAAG,IAAI;;EA+E3C"}
|
|
@@ -1,31 +1,46 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
const
|
|
3
|
-
function
|
|
4
|
-
|
|
5
|
-
const r = () => {
|
|
6
|
-
var o, i;
|
|
7
|
-
const e = typeof window < "u" ? (o = window.localStorage) == null ? void 0 : o.getItem("isDark") : null;
|
|
8
|
-
return typeof e == "string" ? !!JSON.parse(e) : !!(typeof window < "u" && typeof (window == null ? void 0 : window.matchMedia) == "function" && ((i = window == null ? void 0 : window.matchMedia("(prefers-color-scheme: dark)")) != null && i.matches));
|
|
9
|
-
}, d = () => {
|
|
1
|
+
import { ref as r, watch as l, onMounted as s, onUnmounted as c } from "vue";
|
|
2
|
+
const o = r("dark");
|
|
3
|
+
function f() {
|
|
4
|
+
const a = () => {
|
|
10
5
|
var e;
|
|
11
|
-
|
|
6
|
+
o.value = o.value === "dark" ? "light" : "dark", typeof window < "u" && ((e = window == null ? void 0 : window.localStorage) == null || e.setItem("colorMode", o.value));
|
|
12
7
|
};
|
|
13
|
-
function
|
|
14
|
-
var
|
|
15
|
-
|
|
8
|
+
function i(e) {
|
|
9
|
+
var d;
|
|
10
|
+
o.value = e === null ? "system" : e ? "dark" : "light", typeof window < "u" && ((d = window == null ? void 0 : window.localStorage) == null || d.setItem("colorMode", o.value));
|
|
16
11
|
}
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
const t = () => {
|
|
13
|
+
var e;
|
|
14
|
+
return typeof window < "u" && typeof (window == null ? void 0 : window.matchMedia) == "function" ? (e = window == null ? void 0 : window.matchMedia("(prefers-color-scheme: dark)")) == null ? void 0 : e.matches : !1;
|
|
15
|
+
}, n = (e) => {
|
|
16
|
+
typeof document < "u" && (e === null ? (document.body.classList.toggle("dark-mode", t()), document.body.classList.toggle("light-mode", !t())) : (document.body.classList.toggle("dark-mode", e === !0), document.body.classList.toggle("light-mode", e === !1)));
|
|
17
|
+
};
|
|
18
|
+
return o.value = typeof window > "u" ? "dark" : localStorage.getItem("colorMode") || "dark", n(
|
|
19
|
+
o.value === "dark" || o.value === "system" && t()
|
|
20
|
+
), l(
|
|
21
|
+
o,
|
|
19
22
|
(e) => {
|
|
20
|
-
|
|
23
|
+
n(
|
|
24
|
+
e === "dark" || e === "system" && t()
|
|
25
|
+
);
|
|
21
26
|
},
|
|
22
27
|
{ immediate: !0 }
|
|
23
|
-
), {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
28
|
+
), s(() => {
|
|
29
|
+
if (typeof window < "u" && typeof window.matchMedia == "function") {
|
|
30
|
+
const e = window.matchMedia("(prefers-color-scheme: dark)"), d = () => {
|
|
31
|
+
o.value === "system" && n(t());
|
|
32
|
+
};
|
|
33
|
+
e.addEventListener("change", d), c(() => {
|
|
34
|
+
e.removeEventListener("change", d);
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
}), {
|
|
38
|
+
colorMode: o,
|
|
39
|
+
toggleDarkMode: a,
|
|
40
|
+
setDarkMode: i,
|
|
41
|
+
getSystemModePreference: t
|
|
27
42
|
};
|
|
28
43
|
}
|
|
29
44
|
export {
|
|
30
|
-
|
|
45
|
+
f as useDarkModeState
|
|
31
46
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiClientApp.vue.d.ts","sourceRoot":"","sources":["../../../src/layouts/App/ApiClientApp.vue"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"ApiClientApp.vue.d.ts","sourceRoot":"","sources":["../../../src/layouts/App/ApiClientApp.vue"],"names":[],"mappings":";;cAyH8B,MAAM;aAAO,MAAM;;;;cAAnB,MAAM;aAAO,MAAM;;;AAgMjD,wBAMG"}
|