@scalar/api-client 2.12.0 → 2.14.0
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 +66 -0
- package/dist/components/CodeInput/CodeInput.vue.d.ts +1 -1
- package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandActionForm.vue.d.ts +2 -2
- package/dist/components/CommandPalette/CommandActionForm.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandActionForm.vue.js +14 -14
- package/dist/components/CommandPalette/CommandPaletteImport.vue.js +38 -38
- package/dist/components/EmptyState.vue.d.ts.map +1 -1
- package/dist/components/EmptyState.vue.js +2 -2
- package/dist/components/EmptyState.vue2.js +27 -16
- package/dist/components/TopNav/TopNav.vue.js +33 -33
- package/dist/layouts/App/create-api-client-app.d.ts +28 -28
- package/dist/layouts/Web/create-api-client-web.d.ts +28 -28
- package/dist/libs/create-client.d.ts +28 -28
- package/dist/libs/hot-keys.d.ts +2 -2
- package/dist/libs/send-request/create-fetch-body.d.ts +2 -2
- package/dist/store/active-entities.d.ts +2 -2
- package/dist/store/collections.d.ts +4 -4
- package/dist/store/index.d.ts +1 -1
- package/dist/store/index.d.ts.map +1 -1
- package/dist/store/index.js +8 -8
- package/dist/store/request-example.d.ts +12 -12
- package/dist/store/store.d.ts +28 -28
- package/dist/store/workspace.d.ts +12 -12
- package/dist/style.css +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts +1 -2
- package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.js +9 -8
- package/dist/v2/blocks/operation-block/components/Header.vue.d.ts +1 -1
- package/dist/v2/blocks/operation-block/components/Header.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/components/Header.vue.js +3 -3
- package/dist/v2/blocks/operation-code-sample/index.d.ts.map +1 -1
- package/dist/v2/blocks/response-block/ResponseBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/response-block/ResponseBlock.vue.js +1 -1
- package/dist/v2/blocks/response-block/ResponseBlock.vue2.js +14 -11
- package/dist/v2/blocks/response-block/components/ResponseBodyStreaming.vue.js +22 -22
- package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.d.ts +2 -2
- package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.d.ts.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.js +2 -2
- package/dist/v2/blocks/response-block/components/ResponseEmpty.vue2.js +18 -15
- package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue.js +2 -2
- package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue2.js +17 -17
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js +2 -2
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue2.js +17 -12
- package/dist/v2/blocks/scalar-address-bar-block/index.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts +205 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.js +52 -52
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.d.ts +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts +205 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts +2 -2
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.js +90 -75
- package/dist/v2/blocks/scalar-auth-selector-block/index.d.ts.map +1 -1
- package/dist/v2/components/sidebar/Sidebar.vue.d.ts +1 -2
- package/dist/v2/components/sidebar/Sidebar.vue.d.ts.map +1 -1
- package/dist/v2/components/sidebar/Sidebar.vue.js +1 -1
- package/dist/v2/features/app/App.vue.d.ts.map +1 -1
- package/dist/v2/features/app/App.vue.js +126 -103
- package/dist/v2/features/app/components/AppSidebar.vue.d.ts +0 -2
- package/dist/v2/features/app/components/AppSidebar.vue.d.ts.map +1 -1
- package/dist/v2/features/app/components/AppSidebar.vue.js +1 -1
- package/dist/v2/features/app/components/AppSidebar.vue2.js +56 -53
- package/dist/v2/features/app/components/DesktopTab.vue.d.ts +26 -0
- package/dist/v2/features/app/components/DesktopTab.vue.d.ts.map +1 -0
- package/dist/v2/features/app/components/DesktopTab.vue.js +7 -0
- package/dist/v2/features/app/components/DesktopTab.vue2.js +134 -0
- package/dist/v2/features/app/components/DesktopTabs.vue.d.ts +9 -4
- package/dist/v2/features/app/components/DesktopTabs.vue.d.ts.map +1 -1
- package/dist/v2/features/app/components/DesktopTabs.vue.js +47 -13
- package/dist/v2/features/app/components/DesktopTabs.vue2.js +2 -4
- package/dist/v2/features/app/components/SplashScreen.vue.js +2 -2
- package/dist/v2/features/app/components/SplashScreen.vue2.js +2 -2
- package/dist/v2/features/app/helpers/routes.js +1 -1
- package/dist/v2/features/collection/components/Settings.vue2.js +3 -3
- package/dist/v2/features/command-palette/components/CommandActionForm.vue.d.ts +61 -0
- package/dist/v2/features/command-palette/components/CommandActionForm.vue.d.ts.map +1 -0
- package/dist/v2/features/command-palette/components/CommandActionForm.vue.js +48 -0
- package/dist/v2/features/command-palette/components/CommandActionForm.vue2.js +4 -0
- package/dist/v2/features/command-palette/components/CommandActionInput.vue.d.ts +39 -0
- package/dist/v2/features/command-palette/components/CommandActionInput.vue.d.ts.map +1 -0
- package/dist/v2/features/command-palette/components/CommandActionInput.vue.js +52 -0
- package/dist/v2/features/command-palette/components/CommandActionInput.vue2.js +4 -0
- package/dist/v2/features/command-palette/components/CommandPaletteDocument.vue.d.ts +36 -0
- package/dist/v2/features/command-palette/components/CommandPaletteDocument.vue.d.ts.map +1 -0
- package/dist/v2/features/command-palette/components/CommandPaletteDocument.vue.js +78 -0
- package/dist/v2/features/command-palette/components/CommandPaletteDocument.vue2.js +4 -0
- package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.d.ts +30 -0
- package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.d.ts.map +1 -0
- package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.js +169 -0
- package/dist/v2/features/command-palette/components/CommandPaletteExample.vue2.js +4 -0
- package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.d.ts +34 -0
- package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.d.ts.map +1 -0
- package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.js +175 -0
- package/dist/v2/features/command-palette/components/CommandPaletteImport.vue2.js +4 -0
- package/dist/v2/features/command-palette/components/CommandPaletteImportCurl.vue.d.ts +43 -0
- package/dist/v2/features/command-palette/components/CommandPaletteImportCurl.vue.d.ts.map +1 -0
- package/dist/v2/features/command-palette/components/CommandPaletteImportCurl.vue.js +7 -0
- package/dist/v2/features/command-palette/components/CommandPaletteImportCurl.vue2.js +115 -0
- package/dist/v2/features/command-palette/components/CommandPaletteRequest.vue.d.ts +39 -0
- package/dist/v2/features/command-palette/components/CommandPaletteRequest.vue.d.ts.map +1 -0
- package/dist/v2/features/command-palette/components/CommandPaletteRequest.vue.js +213 -0
- package/dist/v2/features/command-palette/components/CommandPaletteRequest.vue2.js +4 -0
- package/dist/v2/features/command-palette/components/CommandPaletteTag.vue.d.ts +38 -0
- package/dist/v2/features/command-palette/components/CommandPaletteTag.vue.d.ts.map +1 -0
- package/dist/v2/features/command-palette/components/CommandPaletteTag.vue.js +89 -0
- package/dist/v2/features/command-palette/components/CommandPaletteTag.vue2.js +4 -0
- package/dist/v2/features/command-palette/components/TheCommandPalette.vue.d.ts +41 -0
- package/dist/v2/features/command-palette/components/TheCommandPalette.vue.d.ts.map +1 -0
- package/dist/v2/features/command-palette/components/TheCommandPalette.vue.js +7 -0
- package/dist/v2/features/command-palette/components/TheCommandPalette.vue2.js +172 -0
- package/dist/v2/features/command-palette/components/WatchModeToggle.vue.d.ts +33 -0
- package/dist/v2/features/command-palette/components/WatchModeToggle.vue.d.ts.map +1 -0
- package/dist/v2/features/command-palette/components/WatchModeToggle.vue.js +40 -0
- package/dist/v2/features/command-palette/components/WatchModeToggle.vue2.js +4 -0
- package/dist/v2/features/command-palette/components/index.d.ts +2 -0
- package/dist/v2/features/command-palette/components/index.d.ts.map +1 -0
- package/dist/v2/features/command-palette/components/index.js +4 -0
- package/dist/v2/features/command-palette/helpers/get-openapi-document-details.d.ts +23 -0
- package/dist/v2/features/command-palette/helpers/get-openapi-document-details.d.ts.map +1 -0
- package/dist/v2/features/command-palette/helpers/get-openapi-document-details.js +31 -0
- package/dist/v2/features/command-palette/helpers/get-openapi-from-postman.d.ts +13 -0
- package/dist/v2/features/command-palette/helpers/get-openapi-from-postman.d.ts.map +1 -0
- package/dist/v2/features/command-palette/helpers/get-openapi-from-postman.js +12 -0
- package/dist/v2/features/command-palette/helpers/get-operation-from-curl.d.ts +26 -0
- package/dist/v2/features/command-palette/helpers/get-operation-from-curl.d.ts.map +1 -0
- package/dist/v2/features/command-palette/helpers/get-operation-from-curl.js +70 -0
- package/dist/v2/features/command-palette/helpers/get-postman-document-details.d.ts +23 -0
- package/dist/v2/features/command-palette/helpers/get-postman-document-details.d.ts.map +1 -0
- package/dist/v2/features/command-palette/helpers/get-postman-document-details.js +18 -0
- package/dist/v2/features/command-palette/helpers/is-postman-collection.d.ts +11 -0
- package/dist/v2/features/command-palette/helpers/is-postman-collection.d.ts.map +1 -0
- package/dist/v2/features/command-palette/helpers/is-postman-collection.js +11 -0
- package/dist/v2/features/command-palette/hooks/use-command-palette-state.d.ts +202 -0
- package/dist/v2/features/command-palette/hooks/use-command-palette-state.d.ts.map +1 -0
- package/dist/v2/features/command-palette/hooks/use-command-palette-state.js +109 -0
- package/dist/v2/features/command-palette/types.d.ts +82 -0
- package/dist/v2/features/command-palette/types.d.ts.map +1 -0
- package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
- package/dist/v2/features/operation/Operation.vue.js +24 -20
- package/dist/v2/helpers/drag-handle-factory.d.ts +1 -2
- package/dist/v2/helpers/drag-handle-factory.d.ts.map +1 -1
- package/dist/v2/helpers/drag-handle-factory.js +84 -99
- package/dist/v2/helpers/get-tab-details.d.ts +43 -0
- package/dist/v2/helpers/get-tab-details.d.ts.map +1 -0
- package/dist/v2/helpers/get-tab-details.js +34 -0
- package/dist/v2/helpers/handle-hotkeys.js +1 -1
- package/dist/v2/helpers/is-url.d.ts +2 -0
- package/dist/v2/helpers/is-url.d.ts.map +1 -0
- package/dist/v2/helpers/is-url.js +5 -0
- package/dist/v2/helpers/remove-circular.d.ts +15 -0
- package/dist/v2/helpers/remove-circular.d.ts.map +1 -0
- package/dist/v2/helpers/remove-circular.js +18 -0
- package/dist/v2/helpers/storage.d.ts +4 -6
- package/dist/v2/helpers/storage.d.ts.map +1 -1
- package/dist/v2/helpers/storage.js +8 -12
- package/dist/v2/hooks/use-sidebar-state.d.ts +12 -19
- package/dist/v2/hooks/use-sidebar-state.d.ts.map +1 -1
- package/dist/v2/hooks/use-sidebar-state.js +36 -30
- package/dist/v2/hooks/use-sync-path.d.ts +11 -0
- package/dist/v2/hooks/use-sync-path.d.ts.map +1 -0
- package/dist/v2/hooks/use-sync-path.js +51 -0
- package/dist/v2/hooks/use-tabs.d.ts +31 -0
- package/dist/v2/hooks/use-tabs.d.ts.map +1 -0
- package/dist/v2/hooks/use-tabs.js +44 -0
- package/dist/v2/hooks/use-workspace-client-events.d.ts +5 -2
- package/dist/v2/hooks/use-workspace-client-events.d.ts.map +1 -1
- package/dist/v2/hooks/use-workspace-client-events.js +91 -36
- package/dist/v2/hooks/use-workspace-selector.d.ts +16 -6
- package/dist/v2/hooks/use-workspace-selector.d.ts.map +1 -1
- package/dist/v2/hooks/use-workspace-selector.js +58 -64
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.js +78 -78
- package/dist/views/Request/ResponseSection/ResponseBodyStreaming.vue.js +29 -29
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue.js +2 -2
- package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue2.js +19 -19
- package/dist/views/Request/libs/oauth2.d.ts +2 -2
- package/dist/views/Request/libs/oauth2.d.ts.map +1 -1
- package/dist/views/Request/libs/oauth2.js +66 -53
- package/package.json +134 -44
|
@@ -1,152 +1,175 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useModal as
|
|
3
|
-
import { isHttpMethod as
|
|
4
|
-
import { getThemeStyles as
|
|
5
|
-
import { createWorkspaceEventBus as
|
|
6
|
-
import { xScalarEnvironmentSchema as
|
|
7
|
-
import { coerceValue as
|
|
8
|
-
import { useRoute as
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
import { defineComponent as F, ref as z, computed as r, createElementBlock as G, createBlock as h, unref as t, openBlock as d, Fragment as K, createElementVNode as b, createVNode as u, withCtx as j, withDirectives as q, vShow as J, normalizeProps as Q, guardReactiveProps as X } from "vue";
|
|
2
|
+
import { useModal as Y, ScalarTeleportRoot as Z } from "@scalar/components";
|
|
3
|
+
import { isHttpMethod as ee } from "@scalar/helpers/http/is-http-method";
|
|
4
|
+
import { getThemeStyles as te } from "@scalar/themes";
|
|
5
|
+
import { createWorkspaceEventBus as oe } from "@scalar/workspace-store/events";
|
|
6
|
+
import { xScalarEnvironmentSchema as W } from "@scalar/workspace-store/schemas/extensions/document/x-scalar-environments";
|
|
7
|
+
import { coerceValue as y } from "@scalar/workspace-store/schemas/typebox-coerce";
|
|
8
|
+
import { useRoute as ae, useRouter as re, RouterView as se } from "vue-router";
|
|
9
|
+
import ne from "./components/CreateWorkspaceModal.vue.js";
|
|
10
|
+
import le from "./components/SplashScreen.vue.js";
|
|
11
|
+
import ce from "../command-palette/components/TheCommandPalette.vue.js";
|
|
12
|
+
import { useCommandPaletteState as ue } from "../command-palette/hooks/use-command-palette-state.js";
|
|
13
|
+
import { useColorMode as ie } from "../../hooks/use-color-mode.js";
|
|
14
|
+
import { useDocumentWatcher as pe } from "../../hooks/use-document-watcher.js";
|
|
15
|
+
import { useGlobalHotKeys as me } from "../../hooks/use-global-hot-keys.js";
|
|
16
|
+
import { useSidebarState as de } from "../../hooks/use-sidebar-state.js";
|
|
17
|
+
import { useSyncPath as ve } from "../../hooks/use-sync-path.js";
|
|
18
|
+
import { useWorkspaceClientEvents as ke } from "../../hooks/use-workspace-client-events.js";
|
|
19
|
+
import { useWorkspaceSelector as Se } from "../../hooks/use-workspace-selector.js";
|
|
20
|
+
import { useTabs as fe } from "../../hooks/use-tabs.js";
|
|
21
|
+
import we from "./components/AppSidebar.vue.js";
|
|
22
|
+
import he from "./components/DesktopTabs.vue.js";
|
|
23
|
+
import be from "./components/WebTopNav.vue.js";
|
|
24
|
+
const We = ["innerHTML"], ye = { class: "flex min-h-0 flex-1" }, Ee = { class: "bg-b-1 flex-1" }, Te = {}, Je = /* @__PURE__ */ F({
|
|
25
|
+
...Te,
|
|
22
26
|
__name: "App",
|
|
23
27
|
props: {
|
|
24
28
|
layout: {}
|
|
25
29
|
},
|
|
26
|
-
setup(
|
|
30
|
+
setup(E) {
|
|
27
31
|
typeof window < "u" && (window.dataDumpWorkspace = () => o.value);
|
|
28
|
-
const
|
|
32
|
+
const n = oe({
|
|
29
33
|
debug: !1
|
|
30
|
-
}),
|
|
31
|
-
const a =
|
|
34
|
+
}), i = z(!0), O = ae(), U = re(), c = (e) => {
|
|
35
|
+
const a = O.params[e];
|
|
32
36
|
return typeof a == "string" ? a : void 0;
|
|
33
|
-
},
|
|
34
|
-
const e =
|
|
37
|
+
}, v = r(() => c("workspaceSlug")), l = r(() => c("documentSlug")), k = r(() => !l.value || o.value === null ? null : o.value.workspace.documents[l.value] ?? null), S = r(() => {
|
|
38
|
+
const e = c("pathEncoded");
|
|
35
39
|
return e ? decodeURIComponent(e) : void 0;
|
|
36
|
-
}),
|
|
37
|
-
const e =
|
|
38
|
-
return e &&
|
|
39
|
-
}),
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
se({ workspaceStore: o });
|
|
43
|
-
const { handleSelectItem: _, sidebarState: O } = ce({
|
|
40
|
+
}), f = r(() => {
|
|
41
|
+
const e = c("method");
|
|
42
|
+
return e && ee(e) ? e : void 0;
|
|
43
|
+
}), T = r(() => c("exampleName")), _ = Se(), { store: o, workspaces: g, activeWorkspace: p, setWorkspaceId: D, createWorkspace: I } = _;
|
|
44
|
+
ie({ workspaceStore: o });
|
|
45
|
+
const m = de({
|
|
44
46
|
workspaceStore: o,
|
|
45
|
-
documentSlug:
|
|
46
|
-
path:
|
|
47
|
-
method:
|
|
48
|
-
exampleName:
|
|
49
|
-
})
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
47
|
+
documentSlug: l,
|
|
48
|
+
path: S,
|
|
49
|
+
method: f,
|
|
50
|
+
exampleName: T
|
|
51
|
+
}), C = fe({
|
|
52
|
+
workspaceStore: o,
|
|
53
|
+
getEntryByLocation: m.getEntryByLocation,
|
|
54
|
+
workspaceSlug: v,
|
|
55
|
+
documentSlug: l,
|
|
56
|
+
path: S,
|
|
57
|
+
method: f
|
|
58
|
+
}), { isLoading: M } = ve({
|
|
59
|
+
workspaceSelectorState: _,
|
|
60
|
+
tabsState: C,
|
|
61
|
+
eventBus: n
|
|
62
|
+
}), B = ue();
|
|
63
|
+
ke({
|
|
64
|
+
eventBus: n,
|
|
65
|
+
document: k,
|
|
53
66
|
workspaceStore: o,
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
67
|
+
isSidebarOpen: i,
|
|
68
|
+
commandPaletteState: B,
|
|
69
|
+
sidebarState: m
|
|
70
|
+
}), me(n, E.layout), pe({
|
|
71
|
+
documentName: l,
|
|
58
72
|
store: o,
|
|
59
73
|
initialTimeout: 5e3
|
|
60
74
|
});
|
|
61
|
-
const
|
|
75
|
+
const P = r(() => {
|
|
62
76
|
if (o.value === null)
|
|
63
|
-
return
|
|
77
|
+
return y(W, {});
|
|
64
78
|
const e = o.value.workspace["x-scalar-active-environment"];
|
|
65
79
|
if (!e)
|
|
66
|
-
return
|
|
80
|
+
return y(W, {});
|
|
67
81
|
const a = o.value.workspace["x-scalar-environments"]?.[e] ?? {
|
|
68
82
|
variables: []
|
|
69
|
-
}, s =
|
|
83
|
+
}, s = k.value?.["x-scalar-environments"]?.[e] ?? {
|
|
70
84
|
variables: []
|
|
71
85
|
};
|
|
72
|
-
return
|
|
86
|
+
return y(W, {
|
|
73
87
|
...a,
|
|
74
88
|
...s,
|
|
75
89
|
variables: [...a.variables, ...s.variables]
|
|
76
90
|
});
|
|
77
|
-
}),
|
|
91
|
+
}), L = r(() => {
|
|
78
92
|
if (o.value === null)
|
|
79
93
|
return "";
|
|
80
94
|
const e = o.value.workspace["x-scalar-theme"];
|
|
81
|
-
return e ? `<style>${
|
|
82
|
-
}),
|
|
83
|
-
() => o.value?.workspace?.["x-scalar-sidebar-width"] ??
|
|
84
|
-
),
|
|
85
|
-
() => !!(
|
|
86
|
-
),
|
|
95
|
+
return e ? `<style>${te(e)}</style>` : "";
|
|
96
|
+
}), A = 288, N = r(
|
|
97
|
+
() => o.value?.workspace?.["x-scalar-sidebar-width"] ?? A
|
|
98
|
+
), R = r(
|
|
99
|
+
() => !!(v.value && !l.value)
|
|
100
|
+
), H = (e) => o.value?.update("x-scalar-sidebar-width", e), $ = () => U.push({
|
|
87
101
|
name: "workspace.environment",
|
|
88
|
-
params: { workspaceSlug:
|
|
89
|
-
}),
|
|
102
|
+
params: { workspaceSlug: v.value }
|
|
103
|
+
}), x = (e) => {
|
|
90
104
|
e && D(e);
|
|
91
|
-
},
|
|
105
|
+
}, V = r(
|
|
92
106
|
() => ({
|
|
93
|
-
documentSlug:
|
|
94
|
-
document:
|
|
95
|
-
environment:
|
|
96
|
-
eventBus:
|
|
97
|
-
exampleName:
|
|
98
|
-
layout:
|
|
99
|
-
method:
|
|
100
|
-
path:
|
|
107
|
+
documentSlug: l.value ?? "",
|
|
108
|
+
document: k.value,
|
|
109
|
+
environment: P.value,
|
|
110
|
+
eventBus: n,
|
|
111
|
+
exampleName: T.value,
|
|
112
|
+
layout: E.layout,
|
|
113
|
+
method: f.value,
|
|
114
|
+
path: S.value,
|
|
101
115
|
workspaceStore: o.value,
|
|
102
|
-
activeWorkspace:
|
|
116
|
+
activeWorkspace: p.value
|
|
103
117
|
})
|
|
104
|
-
),
|
|
105
|
-
return (e, a) => t(o) !== null && t(
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
default:
|
|
109
|
-
e.layout === "desktop" ? (
|
|
118
|
+
), w = Y();
|
|
119
|
+
return (e, a) => t(o) !== null && t(p) !== null && !t(M) ? (d(), G(K, { key: 0 }, [
|
|
120
|
+
b("div", { innerHTML: L.value }, null, 8, We),
|
|
121
|
+
u(t(Z), null, {
|
|
122
|
+
default: j(() => [
|
|
123
|
+
e.layout === "desktop" ? (d(), h(he, {
|
|
124
|
+
key: 0,
|
|
125
|
+
eventBus: t(n),
|
|
126
|
+
tabsState: t(C)
|
|
127
|
+
}, null, 8, ["eventBus", "tabsState"])) : (d(), h(be, {
|
|
110
128
|
key: 1,
|
|
111
|
-
activeWorkspace: t(
|
|
112
|
-
workspaces: t(
|
|
113
|
-
"onCreate:workspace": a[0] || (a[0] = (s) => t(
|
|
114
|
-
"onSelect:workspace":
|
|
129
|
+
activeWorkspace: t(p),
|
|
130
|
+
workspaces: t(g),
|
|
131
|
+
"onCreate:workspace": a[0] || (a[0] = (s) => t(w).show()),
|
|
132
|
+
"onSelect:workspace": x
|
|
115
133
|
}, null, 8, ["activeWorkspace", "workspaces"])),
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
isSidebarOpen:
|
|
119
|
-
"onUpdate:isSidebarOpen": a[1] || (a[1] = (s) =>
|
|
120
|
-
activeWorkspace: t(
|
|
121
|
-
eventBus: t(
|
|
122
|
-
isWorkspaceOpen:
|
|
134
|
+
b("main", ye, [
|
|
135
|
+
q(u(we, {
|
|
136
|
+
isSidebarOpen: i.value,
|
|
137
|
+
"onUpdate:isSidebarOpen": a[1] || (a[1] = (s) => i.value = s),
|
|
138
|
+
activeWorkspace: t(p),
|
|
139
|
+
eventBus: t(n),
|
|
140
|
+
isWorkspaceOpen: R.value,
|
|
123
141
|
layout: e.layout,
|
|
124
|
-
sidebarState: t(
|
|
125
|
-
sidebarWidth:
|
|
142
|
+
sidebarState: t(m).state,
|
|
143
|
+
sidebarWidth: N.value,
|
|
126
144
|
store: t(o),
|
|
127
|
-
workspaces: t(
|
|
128
|
-
"onClick:workspace":
|
|
129
|
-
"onCreate:workspace": a[2] || (a[2] = (s) => t(
|
|
130
|
-
"onSelect:workspace":
|
|
131
|
-
onSelectItem: t(
|
|
132
|
-
"onUpdate:sidebarWidth":
|
|
145
|
+
workspaces: t(g),
|
|
146
|
+
"onClick:workspace": $,
|
|
147
|
+
"onCreate:workspace": a[2] || (a[2] = (s) => t(w).show()),
|
|
148
|
+
"onSelect:workspace": x,
|
|
149
|
+
onSelectItem: t(m).handleSelectItem,
|
|
150
|
+
"onUpdate:sidebarWidth": H
|
|
133
151
|
}, null, 8, ["isSidebarOpen", "activeWorkspace", "eventBus", "isWorkspaceOpen", "layout", "sidebarState", "sidebarWidth", "store", "workspaces", "onSelectItem"]), [
|
|
134
|
-
[
|
|
152
|
+
[J, i.value]
|
|
135
153
|
]),
|
|
136
|
-
|
|
137
|
-
state: t(
|
|
154
|
+
u(ne, {
|
|
155
|
+
state: t(w),
|
|
138
156
|
"onCreate:workspace": a[3] || (a[3] = (s) => t(I)(s))
|
|
139
157
|
}, null, 8, ["state"]),
|
|
140
|
-
|
|
141
|
-
|
|
158
|
+
u(ce, {
|
|
159
|
+
eventBus: t(n),
|
|
160
|
+
paletteState: t(B),
|
|
161
|
+
workspaceStore: t(o)
|
|
162
|
+
}, null, 8, ["eventBus", "paletteState", "workspaceStore"]),
|
|
163
|
+
b("div", Ee, [
|
|
164
|
+
u(t(se), Q(X(V.value)), null, 16)
|
|
142
165
|
])
|
|
143
166
|
])
|
|
144
167
|
]),
|
|
145
168
|
_: 1
|
|
146
169
|
})
|
|
147
|
-
], 64)) : (
|
|
170
|
+
], 64)) : (d(), h(le, { key: 1 }));
|
|
148
171
|
}
|
|
149
172
|
});
|
|
150
173
|
export {
|
|
151
|
-
|
|
174
|
+
Je as default
|
|
152
175
|
};
|
|
@@ -51,7 +51,6 @@ declare const _default: import("vue").DefineComponent<__VLS_PublicProps, {}, {},
|
|
|
51
51
|
"create:workspace": () => any;
|
|
52
52
|
"select:workspace": (id?: string | undefined) => any;
|
|
53
53
|
selectItem: (id: string) => any;
|
|
54
|
-
"open:commandPalette": (action?: "import" | undefined) => any;
|
|
55
54
|
"click:workspace": () => any;
|
|
56
55
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
57
56
|
"onCreate:workspace"?: (() => any) | undefined;
|
|
@@ -59,7 +58,6 @@ declare const _default: import("vue").DefineComponent<__VLS_PublicProps, {}, {},
|
|
|
59
58
|
onSelectItem?: ((id: string) => any) | undefined;
|
|
60
59
|
"onUpdate:isSidebarOpen"?: ((value: boolean) => any) | undefined;
|
|
61
60
|
"onUpdate:sidebarWidth"?: ((value: number) => any) | undefined;
|
|
62
|
-
"onOpen:commandPalette"?: ((action?: "import" | undefined) => any) | undefined;
|
|
63
61
|
"onClick:workspace"?: (() => any) | undefined;
|
|
64
62
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
65
63
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppSidebar.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/app/components/AppSidebar.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AppSidebar.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/app/components/AppSidebar.vue"],"names":[],"mappings":"AAoQA,OAAO,KAAK,EAA6B,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAA;AAQhF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAA;AAClE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,KAAK,WAAW,GAAG;IACjB;;OAEG;IACH,MAAM,EAAE,YAAY,CAAA;IAEpB;;OAEG;IACH,YAAY,EAAE,YAAY,CAAC,cAAc,CAAC,CAAA;IAE1C;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB;;;OAGG;IACH,eAAe,EAAE,SAAS,CAAA;IAC1B;;;OAGG;IACH,UAAU,EAAE,SAAS,EAAE,CAAA;IACvB;;;OAGG;IACH,QAAQ,EAAE,iBAAiB,CAAA;IAC3B;;;OAGG;IACH,KAAK,EAAE,cAAc,CAAA;CACtB,CAAC;AAkEF,KAAK,iBAAiB,GAAG,WAAW,GAAG;IACvC,6CAA6C;IAC7C,eAAe,EAAE,OAAO,CAAC;IACzB,wCAAwC;IACxC,cAAc,EAAE,MAAM,CAAC;CACtB,CAAC;;;;;;;;;;;;;;;;;AAoRF,wBAOG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./AppSidebar.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import p from "../../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const m = /* @__PURE__ */ p(o, [["__scopeId", "data-v-
|
|
4
|
+
const m = /* @__PURE__ */ p(o, [["__scopeId", "data-v-a9d2880c"]]);
|
|
5
5
|
export {
|
|
6
6
|
m as default
|
|
7
7
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { defineComponent as A, mergeModels as k, computed as p, capitalize as D, useModel as f, createBlock as S, openBlock as m, unref as o, createSlots as
|
|
2
|
-
import { ScalarSidebarItem as
|
|
3
|
-
import { ScalarIconGlobe as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
1
|
+
import { defineComponent as A, mergeModels as k, computed as p, capitalize as D, useModel as f, createBlock as S, openBlock as m, unref as o, createSlots as $, withCtx as i, createVNode as l, createTextVNode as u, toDisplayString as z, createElementVNode as s, normalizeClass as E, createElementBlock as M, createCommentVNode as w } from "vue";
|
|
2
|
+
import { ScalarSidebarItem as N, ScalarButton as y } from "@scalar/components";
|
|
3
|
+
import { ScalarIconGlobe as V } from "@scalar/icons";
|
|
4
|
+
import q from "../../../../assets/rabbit.ascii.js";
|
|
5
|
+
import G from "../../../../assets/rabbitjump.ascii.js";
|
|
6
6
|
import W from "../../../../components/ScalarAsciiArt.vue.js";
|
|
7
|
-
import { dragHandleFactory as
|
|
8
|
-
import
|
|
9
|
-
const
|
|
7
|
+
import { dragHandleFactory as R } from "../../../helpers/drag-handle-factory.js";
|
|
8
|
+
import j from "../../../components/sidebar/Sidebar.vue.js";
|
|
9
|
+
const H = {
|
|
10
10
|
key: 0,
|
|
11
11
|
class: "empty-sidebar-item-content overflow-hidden px-2.5 py-2.5"
|
|
12
|
-
},
|
|
12
|
+
}, L = { class: "rabbit-ascii relative m-auto mt-2 h-[68px] w-[60px]" }, P = { class: "gap-1.5 p-2" }, Y = /* @__PURE__ */ A({
|
|
13
13
|
__name: "AppSidebar",
|
|
14
14
|
props: /* @__PURE__ */ k({
|
|
15
15
|
layout: {},
|
|
@@ -28,78 +28,81 @@ const j = {
|
|
|
28
28
|
},
|
|
29
29
|
sidebarWidthModifiers: {}
|
|
30
30
|
}),
|
|
31
|
-
emits: /* @__PURE__ */ k(["
|
|
32
|
-
setup(r, { emit:
|
|
33
|
-
const
|
|
34
|
-
() =>
|
|
31
|
+
emits: /* @__PURE__ */ k(["click:workspace", "selectItem", "select:workspace", "create:workspace"], ["update:isSidebarOpen", "update:sidebarWidth"]),
|
|
32
|
+
setup(r, { emit: B }) {
|
|
33
|
+
const n = B, g = p(() => D(r.activeWorkspace.name)), b = f(r, "isSidebarOpen"), c = f(r, "sidebarWidth"), d = p(() => r.sidebarState.items.value.length <= 1), v = p(
|
|
34
|
+
() => R({
|
|
35
35
|
store: r.store,
|
|
36
36
|
sidebarState: r.sidebarState
|
|
37
37
|
})
|
|
38
|
-
),
|
|
39
|
-
return (
|
|
38
|
+
), O = (t, e) => v.value.handleDragEnd(t, e), C = (t, e) => v.value.isDroppable(t, e);
|
|
39
|
+
return (t, e) => (m(), S(o(j), {
|
|
40
|
+
isSidebarOpen: b.value,
|
|
41
|
+
"onUpdate:isSidebarOpen": e[3] || (e[3] = (a) => b.value = a),
|
|
42
|
+
sidebarWidth: c.value,
|
|
43
|
+
"onUpdate:sidebarWidth": e[4] || (e[4] = (a) => c.value = a),
|
|
44
|
+
activeWorkspace: t.activeWorkspace,
|
|
45
|
+
documents: Object.values(t.store.workspace.documents),
|
|
46
|
+
eventBus: t.eventBus,
|
|
40
47
|
isDroppable: C,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
"
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
onCreateWorkspace: e[5] || (e[5] = (t) => s("create:workspace")),
|
|
52
|
-
"onSelect:workspace": e[6] || (e[6] = (t) => s("select:workspace", t)),
|
|
53
|
-
onSelectItem: e[7] || (e[7] = (t) => s("selectItem", t)),
|
|
54
|
-
onReorder: e[8] || (e[8] = (t, I) => g(t, I))
|
|
55
|
-
}, P({
|
|
56
|
-
workspaceButton: n(() => [
|
|
57
|
-
l(o(M), {
|
|
48
|
+
layout: t.layout,
|
|
49
|
+
sidebarState: t.sidebarState,
|
|
50
|
+
workspaces: t.workspaces,
|
|
51
|
+
"onCreate:workspace": e[5] || (e[5] = (a) => n("create:workspace")),
|
|
52
|
+
onReorder: e[6] || (e[6] = (a, I) => O(a, I)),
|
|
53
|
+
"onSelect:workspace": e[7] || (e[7] = (a) => n("select:workspace", a)),
|
|
54
|
+
onSelectItem: e[8] || (e[8] = (a) => n("selectItem", a))
|
|
55
|
+
}, $({
|
|
56
|
+
workspaceButton: i(() => [
|
|
57
|
+
l(o(N), {
|
|
58
58
|
is: "button",
|
|
59
|
-
active:
|
|
60
|
-
icon: o(
|
|
61
|
-
onClick: e[0] || (e[0] = (
|
|
59
|
+
active: t.isWorkspaceOpen,
|
|
60
|
+
icon: o(V),
|
|
61
|
+
onClick: e[0] || (e[0] = (a) => n("click:workspace"))
|
|
62
62
|
}, {
|
|
63
|
-
default:
|
|
64
|
-
u(
|
|
63
|
+
default: i(() => [
|
|
64
|
+
u(z(g.value), 1)
|
|
65
65
|
]),
|
|
66
66
|
_: 1
|
|
67
67
|
}, 8, ["active", "icon"])
|
|
68
68
|
]),
|
|
69
69
|
_: 2
|
|
70
70
|
}, [
|
|
71
|
-
|
|
71
|
+
t.layout !== "modal" ? {
|
|
72
72
|
name: "footer",
|
|
73
|
-
fn:
|
|
74
|
-
|
|
75
|
-
class:
|
|
73
|
+
fn: i(() => [
|
|
74
|
+
s("div", {
|
|
75
|
+
class: E({
|
|
76
76
|
"empty-sidebar-item border-t": d.value
|
|
77
77
|
})
|
|
78
78
|
}, [
|
|
79
|
-
d.value ? (m(),
|
|
80
|
-
|
|
79
|
+
d.value ? (m(), M("div", H, [
|
|
80
|
+
s("div", L, [
|
|
81
81
|
l(W, {
|
|
82
|
-
art: o(
|
|
82
|
+
art: o(q),
|
|
83
83
|
class: "rabbitsit font-bold"
|
|
84
84
|
}, null, 8, ["art"]),
|
|
85
85
|
l(W, {
|
|
86
|
-
art: o(
|
|
86
|
+
art: o(G),
|
|
87
87
|
class: "rabbitjump absolute top-0 left-0 font-bold"
|
|
88
88
|
}, null, 8, ["art"])
|
|
89
89
|
]),
|
|
90
|
-
e[9] || (e[9] =
|
|
91
|
-
|
|
92
|
-
|
|
90
|
+
e[9] || (e[9] = s("div", { class: "mt-2 mb-2 text-center text-sm text-balance" }, [
|
|
91
|
+
s("b", { class: "font-medium" }, "Let's Get Started"),
|
|
92
|
+
s("p", { class: "mt-2 leading-3" }, " Create request, folder, collection or import from OpenAPI/Postman ")
|
|
93
93
|
], -1))
|
|
94
94
|
])) : w("", !0),
|
|
95
|
-
|
|
95
|
+
s("div", P, [
|
|
96
96
|
d.value ? (m(), S(o(y), {
|
|
97
97
|
key: 0,
|
|
98
98
|
class: "w-full",
|
|
99
99
|
size: "sm",
|
|
100
|
-
onClick: e[1] || (e[1] = (
|
|
100
|
+
onClick: e[1] || (e[1] = (a) => t.eventBus.emit("ui:open:command-palette", {
|
|
101
|
+
action: "import-from-openapi-swagger-postman-curl",
|
|
102
|
+
payload: void 0
|
|
103
|
+
}))
|
|
101
104
|
}, {
|
|
102
|
-
default:
|
|
105
|
+
default: i(() => [...e[10] || (e[10] = [
|
|
103
106
|
u(" Import Collection ", -1)
|
|
104
107
|
])]),
|
|
105
108
|
_: 1
|
|
@@ -109,9 +112,9 @@ const j = {
|
|
|
109
112
|
hotkey: "K",
|
|
110
113
|
size: "sm",
|
|
111
114
|
variant: "outlined",
|
|
112
|
-
onClick: e[2] || (e[2] = (
|
|
115
|
+
onClick: e[2] || (e[2] = (a) => t.eventBus.emit("ui:open:command-palette"))
|
|
113
116
|
}, {
|
|
114
|
-
default:
|
|
117
|
+
default: i(() => [...e[11] || (e[11] = [
|
|
115
118
|
u(" Add Item ", -1)
|
|
116
119
|
])]),
|
|
117
120
|
_: 1
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Tab } from '@scalar/workspace-store/schemas/extensions/workspace';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
/** Optional keyboard shortcut number for the tab */
|
|
4
|
+
hotkey?: string;
|
|
5
|
+
/** Whether this tab is currently active */
|
|
6
|
+
active: boolean;
|
|
7
|
+
/** Whether this is the only tab (changes styling to header-like appearance) */
|
|
8
|
+
isSingleTab?: boolean;
|
|
9
|
+
/** The tab data */
|
|
10
|
+
tab: Tab;
|
|
11
|
+
};
|
|
12
|
+
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
13
|
+
click: () => any;
|
|
14
|
+
close: () => any;
|
|
15
|
+
newTab: () => any;
|
|
16
|
+
copyUrl: () => any;
|
|
17
|
+
closeOtherTabs: () => any;
|
|
18
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
19
|
+
onClick?: (() => any) | undefined;
|
|
20
|
+
onClose?: (() => any) | undefined;
|
|
21
|
+
onNewTab?: (() => any) | undefined;
|
|
22
|
+
onCopyUrl?: (() => any) | undefined;
|
|
23
|
+
onCloseOtherTabs?: (() => any) | undefined;
|
|
24
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
25
|
+
export default _default;
|
|
26
|
+
//# sourceMappingURL=DesktopTab.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DesktopTab.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/app/components/DesktopTab.vue"],"names":[],"mappings":"AAwTA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,sDAAsD,CAAA;AAG/E,KAAK,WAAW,GAAG;IACjB,oDAAoD;IACpD,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,2CAA2C;IAC3C,MAAM,EAAE,OAAO,CAAA;IACf,+EAA+E;IAC/E,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,mBAAmB;IACnB,GAAG,EAAE,GAAG,CAAA;CACT,CAAC;;;;;;;;;;;;;;AAmXF,wBAOG"}
|