@scalar/api-client 2.18.3 → 2.19.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 +56 -0
- package/dist/components/AddressBar/AddressBar.vue2.js +5 -5
- package/dist/components/CommandPalette/CommandPaletteImport.vue.js +6 -6
- package/dist/components/ImportCollection/DropEventListener.vue.d.ts.map +1 -1
- package/dist/components/ImportCollection/DropEventListener.vue.js +26 -28
- package/dist/components/ImportCollection/utils/get-openapi-version.d.ts.map +1 -1
- package/dist/components/ImportCollection/utils/import-collection.d.ts +1 -1
- package/dist/components/ImportCollection/utils/import-collection.d.ts.map +1 -1
- package/dist/components/Search/useSearch.d.ts.map +1 -1
- package/dist/components/Search/useSearch.js +16 -16
- package/dist/components/Server/index.d.ts +1 -1
- package/dist/components/Server/index.d.ts.map +1 -1
- package/dist/components/Server/index.js +6 -6
- package/dist/components/SideNav/SideNav.vue.js +3 -3
- package/dist/components/Sidebar/index.d.ts +1 -2
- package/dist/components/Sidebar/index.d.ts.map +1 -1
- package/dist/components/index.d.ts +2 -2
- package/dist/components/index.d.ts.map +1 -1
- package/dist/hooks/index.d.ts +2 -2
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/useResponseBody.d.ts +1 -1
- package/dist/hooks/useResponseBody.d.ts.map +1 -1
- package/dist/hooks/useResponseBody.js +4 -4
- package/dist/hooks/useSidebar.d.ts +1 -1
- package/dist/hooks/useSidebar.d.ts.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/layouts/App/ApiClientApp.vue.js +5 -5
- package/dist/layouts/App/MainLayout.vue.js +4 -4
- package/dist/layouts/App/create-api-client-app.d.ts +12 -12
- package/dist/layouts/App/index.d.ts +1 -1
- package/dist/layouts/App/index.d.ts.map +1 -1
- package/dist/layouts/Web/ApiClientWeb.vue.js +6 -6
- package/dist/layouts/Web/create-api-client-web.d.ts +12 -12
- package/dist/layouts/Web/index.d.ts +1 -1
- package/dist/layouts/Web/index.d.ts.map +1 -1
- package/dist/libs/create-client.d.ts +12 -12
- package/dist/libs/get-request-uid-by-path-method.d.ts +1 -1
- package/dist/libs/get-request-uid-by-path-method.d.ts.map +1 -1
- package/dist/libs/hot-keys.d.ts +2 -2
- package/dist/libs/hot-keys.d.ts.map +1 -1
- package/dist/libs/importers/curl.d.ts.map +1 -1
- package/dist/libs/index.d.ts +14 -15
- package/dist/libs/index.d.ts.map +1 -1
- package/dist/libs/index.js +33 -33
- package/dist/libs/parse-curl.js +4 -4
- package/dist/libs/send-request/create-fetch-body.d.ts +1 -1
- package/dist/libs/send-request/create-fetch-body.d.ts.map +1 -1
- package/dist/libs/send-request/create-fetch-body.js +1 -1
- package/dist/libs/send-request/create-fetch-headers.d.ts.map +1 -1
- package/dist/libs/send-request/create-fetch-query-params.d.ts.map +1 -1
- package/dist/libs/send-request/create-fetch-query-params.js +2 -1
- package/dist/libs/send-request/index.d.ts +1 -1
- package/dist/libs/send-request/index.d.ts.map +1 -1
- package/dist/libs/send-request/index.js +4 -4
- package/dist/libs/send-request/set-request-cookies.d.ts.map +1 -1
- package/dist/libs/send-request/set-request-cookies.js +4 -4
- package/dist/store/active-entities.d.ts +1 -1
- package/dist/store/collections.d.ts +1 -1
- package/dist/store/collections.d.ts.map +1 -1
- package/dist/store/collections.js +4 -4
- package/dist/store/environment.d.ts +1 -1
- package/dist/store/environment.d.ts.map +1 -1
- package/dist/store/environment.js +4 -4
- package/dist/store/import-spec.d.ts +2 -2
- package/dist/store/import-spec.d.ts.map +1 -1
- package/dist/store/index.d.ts +1 -1
- package/dist/store/index.d.ts.map +1 -1
- package/dist/store/request-example.d.ts +1 -1
- package/dist/store/request-example.d.ts.map +1 -1
- package/dist/store/request-example.js +6 -6
- package/dist/store/requests.d.ts +1 -1
- package/dist/store/requests.d.ts.map +1 -1
- package/dist/store/requests.js +8 -8
- package/dist/store/security-schemes.d.ts +1 -1
- package/dist/store/security-schemes.d.ts.map +1 -1
- package/dist/store/security-schemes.js +4 -4
- package/dist/store/servers.d.ts +1 -1
- package/dist/store/servers.d.ts.map +1 -1
- package/dist/store/servers.js +4 -4
- package/dist/store/store.d.ts +12 -12
- package/dist/store/tags.d.ts +1 -1
- package/dist/store/tags.d.ts.map +1 -1
- package/dist/store/tags.js +5 -5
- package/dist/store/workspace.d.ts +13 -13
- package/dist/store/workspace.d.ts.map +1 -1
- package/dist/store/workspace.js +7 -7
- package/dist/style.css +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts +4 -5
- package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.js +17 -16
- package/dist/v2/blocks/operation-block/helpers/build-request-cookie-header.d.ts +3 -3
- package/dist/v2/blocks/operation-block/helpers/build-request-cookie-header.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/build-request-cookie-header.js +22 -22
- package/dist/v2/blocks/operation-block/helpers/build-request-parameters.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/build-request-parameters.js +14 -13
- package/dist/v2/blocks/operation-block/helpers/build-request.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/build-request.js +43 -41
- package/dist/v2/blocks/operation-block/helpers/filter-global-cookies.d.ts +14 -0
- package/dist/v2/blocks/operation-block/helpers/filter-global-cookies.d.ts.map +1 -0
- package/dist/v2/blocks/operation-block/helpers/filter-global-cookies.js +14 -0
- package/dist/v2/blocks/operation-block/helpers/get-resolved-url.d.ts +25 -0
- package/dist/v2/blocks/operation-block/helpers/get-resolved-url.d.ts.map +1 -0
- package/dist/v2/blocks/operation-block/helpers/get-resolved-url.js +17 -0
- package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.d.ts +10 -0
- package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.js +1 -1
- package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue2.js +29 -25
- package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.d.ts +6 -1
- package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.js +27 -23
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.d.ts +10 -1
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.js +48 -39
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-parameters.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-parameters.js +49 -46
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-server-url.d.ts +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-server-url.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-server-url.js +1 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts +6 -2
- package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue.js +2 -2
- package/dist/v2/blocks/request-block/RequestBlock.vue2.js +200 -115
- package/dist/v2/blocks/request-block/components/RequestBody.vue.d.ts +4 -4
- package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.js +21 -17
- package/dist/v2/blocks/request-block/components/RequestParams.vue.d.ts +16 -10
- package/dist/v2/blocks/request-block/components/RequestParams.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestParams.vue.js +32 -45
- package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts +16 -13
- package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTable.vue.js +4 -4
- package/dist/v2/blocks/request-block/components/RequestTable.vue2.js +32 -33
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts +33 -18
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.js +106 -106
- package/dist/v2/blocks/request-block/helpers/create-parameter-handlers.d.ts +10 -5
- package/dist/v2/blocks/request-block/helpers/create-parameter-handlers.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/helpers/create-parameter-handlers.js +60 -31
- package/dist/v2/blocks/request-block/helpers/get-default-headers.d.ts +41 -0
- package/dist/v2/blocks/request-block/helpers/get-default-headers.d.ts.map +1 -0
- package/dist/v2/blocks/request-block/helpers/get-default-headers.js +25 -0
- package/dist/v2/blocks/request-block/helpers/group-by.d.ts +1 -1
- package/dist/v2/blocks/request-block/helpers/group-by.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/helpers/group-by.js +6 -3
- package/dist/v2/blocks/request-block/helpers/is-param-disabled.d.ts +13 -0
- package/dist/v2/blocks/request-block/helpers/is-param-disabled.d.ts.map +1 -0
- package/dist/v2/blocks/request-block/helpers/is-param-disabled.js +7 -0
- 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 +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue2.js +61 -63
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts +1 -2
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts +2 -2
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.d.ts +2 -2
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts +1 -2
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts +2 -2
- package/dist/v2/components/code-input/CodeInput.vue.d.ts +2 -0
- package/dist/v2/components/code-input/CodeInput.vue.d.ts.map +1 -1
- package/dist/v2/components/code-input/CodeInput.vue.js +2 -2
- package/dist/v2/components/code-input/CodeInput.vue2.js +57 -51
- package/dist/v2/components/sidebar/Sidebar.vue.d.ts +2 -0
- package/dist/v2/components/sidebar/Sidebar.vue.d.ts.map +1 -1
- package/dist/v2/components/sidebar/Sidebar.vue.js +31 -26
- package/dist/v2/components/sidebar/SidebarMenu.vue.d.ts +11 -1
- package/dist/v2/components/sidebar/SidebarMenu.vue.d.ts.map +1 -1
- package/dist/v2/components/sidebar/SidebarMenu.vue.js +31 -32
- package/dist/v2/features/app/App.vue.d.ts +16 -2
- package/dist/v2/features/app/App.vue.d.ts.map +1 -1
- package/dist/v2/features/app/App.vue.js +53 -48
- package/dist/v2/features/app/app-events.d.ts +5 -9
- package/dist/v2/features/app/app-events.d.ts.map +1 -1
- package/dist/v2/features/app/app-events.js +146 -120
- package/dist/v2/features/app/app-state.d.ts +2 -1
- package/dist/v2/features/app/app-state.d.ts.map +1 -1
- package/dist/v2/features/app/app-state.js +77 -79
- package/dist/v2/features/app/components/AppSidebar.vue.d.ts +11 -1
- 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 +78 -75
- package/dist/v2/features/app/helpers/create-api-client-app.d.ts +5 -59
- package/dist/v2/features/app/helpers/create-api-client-app.d.ts.map +1 -1
- package/dist/v2/features/app/helpers/create-api-client-app.js +9 -8
- package/dist/v2/features/app/index.d.ts +5 -1
- package/dist/v2/features/app/index.d.ts.map +1 -1
- package/dist/v2/features/app/index.js +8 -2
- package/dist/v2/features/modal/Modal.vue.d.ts.map +1 -1
- package/dist/v2/features/modal/Modal.vue.js +1 -1
- package/dist/v2/features/modal/Modal.vue2.js +21 -22
- package/dist/v2/features/modal/index.d.ts +1 -1
- package/dist/v2/features/modal/index.d.ts.map +1 -1
- package/dist/v2/features/modal/index.js +4 -4
- package/dist/v2/features/modal/modal-events.d.ts +13 -0
- package/dist/v2/features/modal/modal-events.d.ts.map +1 -0
- package/dist/v2/features/modal/modal-events.js +31 -0
- package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
- package/dist/v2/features/operation/Operation.vue.js +30 -43
- package/dist/v2/workspace-events.d.ts +25 -0
- package/dist/v2/workspace-events.d.ts.map +1 -0
- package/dist/v2/workspace-events.js +202 -0
- package/dist/views/Components/CodeSnippet/helpers/convert-to-har-request.d.ts.map +1 -1
- package/dist/views/Components/CodeSnippet/helpers/get-snippet.d.ts +1 -1
- package/dist/views/Components/CodeSnippet/helpers/get-snippet.d.ts.map +1 -1
- package/dist/views/Cookies/Cookies.vue2.js +3 -3
- package/dist/views/Environment/handle-drag.d.ts +1 -1
- package/dist/views/Environment/handle-drag.d.ts.map +1 -1
- package/dist/views/Request/RequestRoot.vue2.js +9 -9
- package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue2.js +4 -4
- package/dist/views/Request/RequestSection/RequestCodeExample.vue2.js +4 -4
- package/dist/views/Request/RequestSection/RequestSection.vue2.js +5 -5
- package/dist/views/Request/RequestSection/helpers/update-scheme.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebar.vue2.js +6 -6
- package/dist/views/Request/RequestSidebarItem.vue2.js +6 -6
- package/dist/views/Request/RequestSubpageHeader.vue2.js +4 -4
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/dist/views/Request/ResponseSection/index.d.ts +1 -1
- package/dist/views/Request/ResponseSection/index.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/index.js +4 -4
- package/dist/views/Request/consts/index.d.ts +2 -3
- package/dist/views/Request/consts/index.d.ts.map +1 -1
- package/dist/views/Request/consts/new-auth-options.d.ts +1 -1
- package/dist/views/Request/consts/new-auth-options.d.ts.map +1 -1
- package/dist/views/Request/handle-drag.d.ts +1 -1
- package/dist/views/Request/handle-drag.d.ts.map +1 -1
- package/dist/views/Request/hooks/useOpenApiWatcher.d.ts.map +1 -1
- package/dist/views/Request/hooks/useOpenApiWatcher.js +14 -14
- package/dist/views/Request/libs/auth.d.ts +1 -1
- package/dist/views/Request/libs/auth.d.ts.map +1 -1
- package/dist/views/Request/libs/index.d.ts +3 -3
- package/dist/views/Request/libs/index.d.ts.map +1 -1
- package/dist/views/Request/libs/oauth2.js +1 -1
- package/dist/views/Request/libs/watch-mode.js +6 -6
- package/dist/views/Request/types/index.d.ts +1 -1
- package/dist/views/Request/types/index.d.ts.map +1 -1
- package/package.json +14 -14
- package/dist/v2/features/modal/hooks/use-workspace-client-modal-events.d.ts +0 -18
- package/dist/v2/features/modal/hooks/use-workspace-client-modal-events.d.ts.map +0 -1
- package/dist/v2/features/modal/hooks/use-workspace-client-modal-events.js +0 -39
- package/dist/v2/features/operation/helpers/get-operation-header.js +0 -12
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { defineComponent as q, mergeModels as x, computed as b, capitalize as V, useModel as C, ref as G, createElementBlock as W, openBlock as m, createVNode as l, createBlock as g, createCommentVNode as f, unref as i, createSlots as R, withCtx as r, createTextVNode as y, withKeys as k, withModifiers as c, toDisplayString as j, createElementVNode as d, normalizeClass as
|
|
2
|
-
import { useModal as
|
|
3
|
-
import { ScalarIconPlus as
|
|
1
|
+
import { defineComponent as q, mergeModels as x, computed as b, capitalize as V, useModel as C, ref as G, createElementBlock as W, openBlock as m, createVNode as l, createBlock as g, createCommentVNode as f, unref as i, createSlots as R, withCtx as r, createTextVNode as y, withKeys as k, withModifiers as c, toDisplayString as j, renderSlot as F, createElementVNode as d, normalizeClass as H, nextTick as L } from "vue";
|
|
2
|
+
import { useModal as U, ScalarSidebarItem as I, ScalarIconButton as J, ScalarButton as $, ScalarModal as Y } from "@scalar/components";
|
|
3
|
+
import { ScalarIconPlus as Q, ScalarIconDotsThree as X, ScalarIconGlobe as Z } from "@scalar/icons";
|
|
4
4
|
import { getParentEntry as w } from "@scalar/workspace-store/navigation";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { dragHandleFactory as
|
|
11
|
-
import
|
|
12
|
-
const
|
|
5
|
+
import _ from "../../../../assets/rabbit.ascii.js";
|
|
6
|
+
import ee from "../../../../assets/rabbitjump.ascii.js";
|
|
7
|
+
import E from "../../../../components/ScalarAsciiArt.vue.js";
|
|
8
|
+
import te from "../../../../components/Sidebar/Actions/DeleteSidebarListElement.vue.js";
|
|
9
|
+
import ae from "./SidebarItemMenu.vue.js";
|
|
10
|
+
import { dragHandleFactory as oe } from "../../../helpers/drag-handle-factory.js";
|
|
11
|
+
import ne from "../../../components/sidebar/Sidebar.vue.js";
|
|
12
|
+
const ie = { class: "flex" }, se = {
|
|
13
13
|
key: 0,
|
|
14
14
|
class: "empty-sidebar-item-content overflow-hidden px-2.5 py-2.5"
|
|
15
|
-
},
|
|
15
|
+
}, re = { class: "rabbit-ascii relative m-auto mt-2 h-[68px] w-[60px]" }, le = { class: "gap-1.5 p-2" }, Se = /* @__PURE__ */ q({
|
|
16
16
|
__name: "AppSidebar",
|
|
17
17
|
props: /* @__PURE__ */ x({
|
|
18
18
|
layout: {},
|
|
@@ -32,64 +32,64 @@ const ne = { class: "flex" }, ie = {
|
|
|
32
32
|
sidebarWidthModifiers: {}
|
|
33
33
|
}),
|
|
34
34
|
emits: /* @__PURE__ */ x(["click:workspace", "selectItem", "select:workspace", "create:workspace"], ["update:isSidebarOpen", "update:sidebarWidth"]),
|
|
35
|
-
setup(
|
|
36
|
-
const p =
|
|
37
|
-
() =>
|
|
38
|
-
store:
|
|
39
|
-
sidebarState:
|
|
35
|
+
setup(o, { emit: O }) {
|
|
36
|
+
const p = O, A = b(() => V(o.activeWorkspace.label)), B = C(o, "isSidebarOpen"), M = C(o, "sidebarWidth"), S = b(() => o.sidebarState.items.value.length <= 1), h = b(
|
|
37
|
+
() => oe({
|
|
38
|
+
store: o.store,
|
|
39
|
+
sidebarState: o.sidebarState
|
|
40
40
|
})
|
|
41
|
-
),
|
|
42
|
-
const
|
|
43
|
-
return
|
|
41
|
+
), D = (a, e) => h.value.handleDragEnd(a, e), N = (a, e) => h.value.isDroppable(a, e), s = G(null), v = U(), T = b(() => {
|
|
42
|
+
const a = s.value?.item;
|
|
43
|
+
return a?.type === "document" ? "This cannot be undone. You're about to delete the document and all tags and operations inside it." : `Are you sure you want to delete this ${a?.type ?? "item"}? This action cannot be undone.`;
|
|
44
44
|
}), z = () => {
|
|
45
|
-
const
|
|
46
|
-
if (!
|
|
45
|
+
const a = s.value?.item;
|
|
46
|
+
if (!a)
|
|
47
47
|
return;
|
|
48
|
-
const e =
|
|
48
|
+
const e = o.sidebarState.getEntryById(a.id), t = w("document", e), n = w("operation", e);
|
|
49
49
|
if (t) {
|
|
50
|
-
if (
|
|
51
|
-
|
|
52
|
-
else if (
|
|
53
|
-
|
|
50
|
+
if (a.type === "document")
|
|
51
|
+
o.eventBus.emit("document:delete:document", { name: t.name });
|
|
52
|
+
else if (a.type === "tag")
|
|
53
|
+
o.eventBus.emit("tag:delete:tag", {
|
|
54
54
|
documentName: t.name,
|
|
55
|
-
name:
|
|
55
|
+
name: a.name
|
|
56
56
|
});
|
|
57
|
-
else if (
|
|
57
|
+
else if (a.type === "operation") {
|
|
58
58
|
if (!n)
|
|
59
59
|
return;
|
|
60
|
-
|
|
60
|
+
o.eventBus.emit("operation:delete:operation", {
|
|
61
61
|
meta: {
|
|
62
62
|
method: n.method,
|
|
63
63
|
path: n.path
|
|
64
64
|
},
|
|
65
65
|
documentName: t.name
|
|
66
66
|
});
|
|
67
|
-
} else if (
|
|
67
|
+
} else if (a.type === "example") {
|
|
68
68
|
if (!n)
|
|
69
69
|
return;
|
|
70
|
-
|
|
70
|
+
o.eventBus.emit("operation:delete:example", {
|
|
71
71
|
meta: {
|
|
72
72
|
method: n.method,
|
|
73
73
|
path: n.path,
|
|
74
|
-
exampleKey:
|
|
74
|
+
exampleKey: a.name
|
|
75
75
|
},
|
|
76
76
|
documentName: t.name
|
|
77
77
|
});
|
|
78
78
|
}
|
|
79
79
|
v.hide(), s.value = null;
|
|
80
80
|
}
|
|
81
|
-
}, u = async (
|
|
81
|
+
}, u = async (a, e) => {
|
|
82
82
|
if (s.value?.showMenu)
|
|
83
83
|
return;
|
|
84
|
-
const t =
|
|
85
|
-
s.value = { item: e, el: t, showMenu: !0 }, await
|
|
86
|
-
const n =
|
|
84
|
+
const t = a.currentTarget;
|
|
85
|
+
s.value = { item: e, el: t, showMenu: !0 }, await L();
|
|
86
|
+
const n = a instanceof MouseEvent ? new MouseEvent(a.type, a) : new KeyboardEvent(a.type, a);
|
|
87
87
|
s.value?.el.dispatchEvent(n);
|
|
88
88
|
}, K = () => {
|
|
89
89
|
s.value && (s.value.showMenu = !1);
|
|
90
|
-
}, P = (
|
|
91
|
-
const e =
|
|
92
|
-
|
|
90
|
+
}, P = (a) => {
|
|
91
|
+
const e = o.sidebarState.getEntryById(a.id), t = w("document", e), n = w("tag", e);
|
|
92
|
+
o.eventBus.emit("ui:open:command-palette", {
|
|
93
93
|
action: "create-request",
|
|
94
94
|
payload: {
|
|
95
95
|
documentId: t?.id,
|
|
@@ -97,42 +97,45 @@ const ne = { class: "flex" }, ie = {
|
|
|
97
97
|
}
|
|
98
98
|
});
|
|
99
99
|
};
|
|
100
|
-
return (
|
|
101
|
-
l(i(
|
|
100
|
+
return (a, e) => (m(), W("div", ie, [
|
|
101
|
+
l(i(ne), {
|
|
102
102
|
isSidebarOpen: B.value,
|
|
103
103
|
"onUpdate:isSidebarOpen": e[3] || (e[3] = (t) => B.value = t),
|
|
104
104
|
sidebarWidth: M.value,
|
|
105
105
|
"onUpdate:sidebarWidth": e[4] || (e[4] = (t) => M.value = t),
|
|
106
|
-
activeWorkspace:
|
|
107
|
-
documents: Object.values(
|
|
108
|
-
eventBus:
|
|
109
|
-
isDroppable:
|
|
110
|
-
layout:
|
|
111
|
-
sidebarState:
|
|
112
|
-
workspaces:
|
|
106
|
+
activeWorkspace: o.activeWorkspace,
|
|
107
|
+
documents: Object.values(o.store.workspace.documents),
|
|
108
|
+
eventBus: o.eventBus,
|
|
109
|
+
isDroppable: N,
|
|
110
|
+
layout: o.layout,
|
|
111
|
+
sidebarState: o.sidebarState,
|
|
112
|
+
workspaces: o.workspaces,
|
|
113
113
|
"onCreate:workspace": e[5] || (e[5] = (t) => p("create:workspace")),
|
|
114
|
-
onReorder: e[6] || (e[6] = (t, n) =>
|
|
114
|
+
onReorder: e[6] || (e[6] = (t, n) => D(t, n)),
|
|
115
115
|
"onSelect:workspace": e[7] || (e[7] = (t) => p("select:workspace", t)),
|
|
116
116
|
onSelectItem: e[8] || (e[8] = (t) => p("selectItem", t))
|
|
117
117
|
}, R({
|
|
118
|
+
sidebarMenuActions: r(() => [
|
|
119
|
+
F(a.$slots, "sidebarMenuActions", {}, void 0, !0)
|
|
120
|
+
]),
|
|
118
121
|
workspaceButton: r(() => [
|
|
119
122
|
l(i(I), {
|
|
120
123
|
is: "button",
|
|
121
|
-
active:
|
|
122
|
-
icon: i(
|
|
124
|
+
active: o.isWorkspaceOpen,
|
|
125
|
+
icon: i(Z),
|
|
123
126
|
onClick: e[0] || (e[0] = (t) => p("click:workspace"))
|
|
124
127
|
}, {
|
|
125
128
|
default: r(() => [
|
|
126
|
-
y(j(
|
|
129
|
+
y(j(A.value), 1)
|
|
127
130
|
]),
|
|
128
131
|
_: 1
|
|
129
132
|
}, 8, ["active", "icon"])
|
|
130
133
|
]),
|
|
131
134
|
decorator: r(({ item: t }) => [
|
|
132
|
-
l(i(
|
|
135
|
+
l(i(J), {
|
|
133
136
|
"aria-expanded": "false",
|
|
134
137
|
"aria-haspopup": "menu",
|
|
135
|
-
icon: i(
|
|
138
|
+
icon: i(X),
|
|
136
139
|
label: "More options",
|
|
137
140
|
size: "sm",
|
|
138
141
|
weight: "bold",
|
|
@@ -151,7 +154,7 @@ const ne = { class: "flex" }, ie = {
|
|
|
151
154
|
onClick: (n) => P(t)
|
|
152
155
|
}, {
|
|
153
156
|
icon: r(() => [
|
|
154
|
-
l(i(
|
|
157
|
+
l(i(Q))
|
|
155
158
|
]),
|
|
156
159
|
default: r(() => [...e[11] || (e[11] = [
|
|
157
160
|
y("Add operation", -1)
|
|
@@ -161,22 +164,22 @@ const ne = { class: "flex" }, ie = {
|
|
|
161
164
|
]),
|
|
162
165
|
_: 2
|
|
163
166
|
}, [
|
|
164
|
-
|
|
167
|
+
o.layout !== "modal" ? {
|
|
165
168
|
name: "footer",
|
|
166
169
|
fn: r(() => [
|
|
167
170
|
d("div", {
|
|
168
|
-
class:
|
|
171
|
+
class: H({
|
|
169
172
|
"empty-sidebar-item border-t": S.value
|
|
170
173
|
})
|
|
171
174
|
}, [
|
|
172
|
-
S.value ? (m(), W("div",
|
|
173
|
-
d("div",
|
|
174
|
-
l(
|
|
175
|
-
art: i(
|
|
175
|
+
S.value ? (m(), W("div", se, [
|
|
176
|
+
d("div", re, [
|
|
177
|
+
l(E, {
|
|
178
|
+
art: i(_),
|
|
176
179
|
class: "rabbitsit font-bold"
|
|
177
180
|
}, null, 8, ["art"]),
|
|
178
|
-
l(
|
|
179
|
-
art: i(
|
|
181
|
+
l(E, {
|
|
182
|
+
art: i(ee),
|
|
180
183
|
class: "rabbitjump absolute top-0 left-0 font-bold"
|
|
181
184
|
}, null, 8, ["art"])
|
|
182
185
|
]),
|
|
@@ -185,12 +188,12 @@ const ne = { class: "flex" }, ie = {
|
|
|
185
188
|
d("p", { class: "mt-2 leading-3" }, " Create request, folder, collection or import from OpenAPI/Postman ")
|
|
186
189
|
], -1))
|
|
187
190
|
])) : f("", !0),
|
|
188
|
-
d("div",
|
|
189
|
-
S.value ? (m(), g(i(
|
|
191
|
+
d("div", le, [
|
|
192
|
+
S.value ? (m(), g(i($), {
|
|
190
193
|
key: 0,
|
|
191
194
|
class: "w-full",
|
|
192
195
|
size: "sm",
|
|
193
|
-
onClick: e[1] || (e[1] = (t) =>
|
|
196
|
+
onClick: e[1] || (e[1] = (t) => o.eventBus.emit("ui:open:command-palette", {
|
|
194
197
|
action: "import-from-openapi-swagger-postman-curl",
|
|
195
198
|
payload: void 0
|
|
196
199
|
}))
|
|
@@ -200,12 +203,12 @@ const ne = { class: "flex" }, ie = {
|
|
|
200
203
|
])]),
|
|
201
204
|
_: 1
|
|
202
205
|
})) : f("", !0),
|
|
203
|
-
l(i(
|
|
206
|
+
l(i($), {
|
|
204
207
|
class: "w-full",
|
|
205
208
|
hotkey: "K",
|
|
206
209
|
size: "sm",
|
|
207
210
|
variant: "outlined",
|
|
208
|
-
onClick: e[2] || (e[2] = (t) =>
|
|
211
|
+
onClick: e[2] || (e[2] = (t) => o.eventBus.emit("ui:open:command-palette"))
|
|
209
212
|
}, {
|
|
210
213
|
default: r(() => [...e[14] || (e[14] = [
|
|
211
214
|
y(" Add Item ", -1)
|
|
@@ -218,23 +221,23 @@ const ne = { class: "flex" }, ie = {
|
|
|
218
221
|
key: "0"
|
|
219
222
|
} : void 0
|
|
220
223
|
]), 1032, ["isSidebarOpen", "sidebarWidth", "activeWorkspace", "documents", "eventBus", "layout", "sidebarState", "workspaces"]),
|
|
221
|
-
s.value?.showMenu ? (m(), g(
|
|
224
|
+
s.value?.showMenu ? (m(), g(ae, {
|
|
222
225
|
key: 0,
|
|
223
|
-
eventBus:
|
|
226
|
+
eventBus: o.eventBus,
|
|
224
227
|
item: s.value.item,
|
|
225
|
-
sidebarState:
|
|
228
|
+
sidebarState: o.sidebarState,
|
|
226
229
|
target: s.value.el,
|
|
227
230
|
onCloseMenu: K,
|
|
228
231
|
onShowDeleteModal: e[9] || (e[9] = (t) => i(v).show())
|
|
229
232
|
}, null, 8, ["eventBus", "item", "sidebarState", "target"])) : f("", !0),
|
|
230
|
-
s.value ? (m(), g(i(
|
|
233
|
+
s.value ? (m(), g(i(Y), {
|
|
231
234
|
key: 1,
|
|
232
235
|
size: "xxs",
|
|
233
236
|
state: i(v),
|
|
234
237
|
title: `Delete ${s.value.item.title}`
|
|
235
238
|
}, {
|
|
236
239
|
default: r(() => [
|
|
237
|
-
l(
|
|
240
|
+
l(te, {
|
|
238
241
|
variableName: s.value.item.title,
|
|
239
242
|
warningMessage: T.value,
|
|
240
243
|
onClose: e[10] || (e[10] = (t) => i(v).hide()),
|
|
@@ -247,5 +250,5 @@ const ne = { class: "flex" }, ie = {
|
|
|
247
250
|
}
|
|
248
251
|
});
|
|
249
252
|
export {
|
|
250
|
-
|
|
253
|
+
Se as default
|
|
251
254
|
};
|
|
@@ -13,70 +13,16 @@ type CreateApiClientOptions = {
|
|
|
13
13
|
*/
|
|
14
14
|
plugins?: ClientPlugin[];
|
|
15
15
|
};
|
|
16
|
+
/**
|
|
17
|
+
* Creates the appropriate router with the appropriate routes based on the layout
|
|
18
|
+
*/
|
|
19
|
+
export declare const createAppRouter: (layout: CreateApiClientOptions["layout"]) => import("vue-router").Router;
|
|
16
20
|
/**
|
|
17
21
|
* Create the API Client with router and passes in the workspace store as a prop
|
|
18
22
|
*/
|
|
19
23
|
export declare const createApiClientApp: (el: HTMLElement | null, { layout, plugins }: CreateApiClientOptions) => {
|
|
20
24
|
app: import("vue").App<Element>;
|
|
21
|
-
state:
|
|
22
|
-
store: import("vue").ShallowRef<import("@scalar/workspace-store/client").WorkspaceStore | null>;
|
|
23
|
-
sidebar: {
|
|
24
|
-
state: {
|
|
25
|
-
items: import("vue").ComputedRef<import("@scalar/workspace-store/schemas/navigation").TraversedEntry[]>;
|
|
26
|
-
index: import("vue").ComputedRef<Map<string, import("@scalar/workspace-store/schemas/navigation").TraversedEntry & {
|
|
27
|
-
parent?: import("@scalar/workspace-store/schemas/navigation").TraversedEntry | undefined;
|
|
28
|
-
}>>;
|
|
29
|
-
selectedItems: import("vue").Ref<Record<string, boolean>, Record<string, boolean>>;
|
|
30
|
-
expandedItems: import("vue").Ref<Record<string, boolean>, Record<string, boolean>>;
|
|
31
|
-
selectedItem: import("vue").Ref<string | null, string | null>;
|
|
32
|
-
setSelected: (id: string | null) => void;
|
|
33
|
-
setExpanded: (id: string, value: boolean) => void;
|
|
34
|
-
isExpanded: (id: string) => boolean;
|
|
35
|
-
isSelected: (id: string) => boolean;
|
|
36
|
-
getEntryById: (id: string) => (import("@scalar/workspace-store/schemas/navigation").TraversedEntry & {
|
|
37
|
-
parent?: import("@scalar/workspace-store/schemas/navigation").TraversedEntry | undefined;
|
|
38
|
-
}) | undefined;
|
|
39
|
-
reset: () => void;
|
|
40
|
-
};
|
|
41
|
-
width: import("vue").ComputedRef<number>;
|
|
42
|
-
isOpen: import("vue").Ref<boolean>;
|
|
43
|
-
handleSelectItem: (id: string) => Promise<void | import("vue-router").NavigationFailure | undefined> | undefined;
|
|
44
|
-
handleSidebarWidthUpdate: (width: number) => void | undefined;
|
|
45
|
-
getEntryByLocation: import("../../../../v2/features/app/app-state.js").GetEntryByLocation;
|
|
46
|
-
};
|
|
47
|
-
tabs: {
|
|
48
|
-
state: import("vue").Ref<import("@scalar/workspace-store/schemas/extensions/workspace/x-scalar-tabs").Tab[]>;
|
|
49
|
-
activeTabIndex: import("vue").Ref<number>;
|
|
50
|
-
copyTabUrl: (index: number) => Promise<void>;
|
|
51
|
-
};
|
|
52
|
-
workspace: {
|
|
53
|
-
create: ({ id, name, }: {
|
|
54
|
-
id?: string;
|
|
55
|
-
name: string;
|
|
56
|
-
}) => Promise<{
|
|
57
|
-
id: string;
|
|
58
|
-
name: string;
|
|
59
|
-
} | undefined>;
|
|
60
|
-
workspaceList: import("vue").Ref<import("@scalar/components").ScalarListboxOption[]>;
|
|
61
|
-
activeWorkspace: import("vue").ShallowRef<import("@scalar/components").ScalarListboxOption | null>;
|
|
62
|
-
setId: (id?: string) => Promise<void>;
|
|
63
|
-
isOpen: import("vue").ComputedRef<boolean>;
|
|
64
|
-
};
|
|
65
|
-
commandPalette: import("../../command-palette/hooks/use-command-palette-state.js").UseCommandPaletteStateReturn;
|
|
66
|
-
eventBus: import("@scalar/workspace-store/events").WorkspaceEventBus;
|
|
67
|
-
router: import("vue").ShallowRef<import("vue-router").Router | null>;
|
|
68
|
-
currentRoute: import("vue").Ref<import("vue-router").RouteLocationNormalizedGeneric | null>;
|
|
69
|
-
loading: import("vue").Ref<boolean>;
|
|
70
|
-
activeEntities: {
|
|
71
|
-
workspaceSlug: import("vue").Ref<string | undefined>;
|
|
72
|
-
documentSlug: import("vue").Ref<string | undefined>;
|
|
73
|
-
path: import("vue").Ref<string | undefined>;
|
|
74
|
-
method: import("vue").Ref<import("@scalar/helpers/http/http-methods").HttpMethod | undefined>;
|
|
75
|
-
exampleName: import("vue").Ref<string | undefined>;
|
|
76
|
-
};
|
|
77
|
-
environment: import("vue").ComputedRef<import("@scalar/workspace-store/schemas/extensions/document/x-scalar-environments").XScalarEnvironment>;
|
|
78
|
-
document: import("vue").ComputedRef<import("@scalar/workspace-store/schemas").WorkspaceDocument | null>;
|
|
79
|
-
};
|
|
25
|
+
state: import("../../../../v2/features/app/app-state.js").AppState;
|
|
80
26
|
} | undefined;
|
|
81
27
|
export {};
|
|
82
28
|
//# sourceMappingURL=create-api-client-app.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-api-client-app.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/app/helpers/create-api-client-app.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,KAAK,sBAAsB,GAAG;IAC5B;;;;;OAKG;IACH,MAAM,EAAE,OAAO,CAAC,YAAY,EAAE,OAAO,CAAC,CAAA;IACtC;;OAEG;IACH,OAAO,CAAC,EAAE,YAAY,EAAE,CAAA;CACzB,CAAA;
|
|
1
|
+
{"version":3,"file":"create-api-client-app.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/app/helpers/create-api-client-app.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,KAAK,sBAAsB,GAAG;IAC5B;;;;;OAKG;IACH,MAAM,EAAE,OAAO,CAAC,YAAY,EAAE,OAAO,CAAC,CAAA;IACtC;;OAEG;IACH,OAAO,CAAC,EAAE,YAAY,EAAE,CAAA;CACzB,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,eAAe,GAAI,QAAQ,sBAAsB,CAAC,QAAQ,CAAC,gCAQvE,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAAI,IAAI,WAAW,GAAG,IAAI,EAAE,qBAAiC,sBAAsB;;;aAyBjH,CAAA"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { createApp as c } from "vue";
|
|
2
|
-
import { createRouter as
|
|
2
|
+
import { createRouter as p, createWebHistory as n, createWebHashHistory as m } from "vue-router";
|
|
3
3
|
import u from "../App.vue.js";
|
|
4
4
|
/* empty css */
|
|
5
5
|
import { useAppState as l } from "../app-state.js";
|
|
6
|
-
import { ROUTES as
|
|
7
|
-
const f = (
|
|
8
|
-
const
|
|
9
|
-
if (
|
|
6
|
+
import { ROUTES as i } from "./routes.js";
|
|
7
|
+
const f = (t) => t === "web" ? p({ history: n(), routes: i }) : p({ history: m(), routes: i }), g = (t, { layout: r = "desktop", plugins: s }) => {
|
|
8
|
+
const o = f(r), a = l(o), e = c(u, { layout: r, plugins: s, getAppState: () => a });
|
|
9
|
+
if (e.use(o), !t) {
|
|
10
10
|
console.error(
|
|
11
11
|
"[@scalar/api-client-modal] Could not create the API client.",
|
|
12
12
|
"Invalid HTML element provided.",
|
|
@@ -14,11 +14,12 @@ const f = (e) => e === "web" ? i({ history: n(), routes: p }) : i({ history: m()
|
|
|
14
14
|
);
|
|
15
15
|
return;
|
|
16
16
|
}
|
|
17
|
-
return
|
|
18
|
-
app:
|
|
17
|
+
return e.mount(t), {
|
|
18
|
+
app: e,
|
|
19
19
|
state: a
|
|
20
20
|
};
|
|
21
21
|
};
|
|
22
22
|
export {
|
|
23
|
-
|
|
23
|
+
g as createApiClientApp,
|
|
24
|
+
f as createAppRouter
|
|
24
25
|
};
|
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { type AppState, useAppState } from '../../../v2/features/app/app-state.js';
|
|
2
|
+
export type { ClientPlugin } from '../../../v2/helpers/plugins.js';
|
|
3
|
+
export type { ClientLayout } from '../../../v2/types/layout';
|
|
4
|
+
export { default as ClientApp } from './App.vue.js';
|
|
5
|
+
export { createApiClientApp, createAppRouter } from './helpers/create-api-client-app.js';
|
|
2
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/app/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/app/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AACxE,YAAY,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACxD,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,WAAW,CAAA;AAChD,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAA"}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useAppState as r } from "./app-state.js";
|
|
2
|
+
import { default as a } from "./App.vue.js";
|
|
3
|
+
/* empty css */
|
|
4
|
+
import { createApiClientApp as f, createAppRouter as i } from "./helpers/create-api-client-app.js";
|
|
2
5
|
export {
|
|
3
|
-
|
|
6
|
+
a as ClientApp,
|
|
7
|
+
f as createApiClientApp,
|
|
8
|
+
i as createAppRouter,
|
|
9
|
+
r as useAppState
|
|
4
10
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/modal/Modal.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Modal.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/modal/Modal.vue"],"names":[],"mappings":"AAsYA,OAAO,EAGL,KAAK,UAAU,EAEhB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,6BAA6B,CAAA;AAE/E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AAExE,OAAO,EASL,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACtB,MAAM,KAAK,CAAA;AAIZ,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,6CAA6C,CAAA;AAIxF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAKxD,MAAM,MAAM,UAAU,GAAG;IACvB,4DAA4D;IAC5D,cAAc,EAAE,cAAc,CAAA;IAC9B,qDAAqD;IACrD,QAAQ,EAAE,WAAW,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAA;IAC/C,iDAAiD;IACjD,IAAI,EAAE,WAAW,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IACrC,4CAA4C;IAC5C,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,mDAAmD;IACnD,MAAM,EAAE,WAAW,CAAC,UAAU,GAAG,SAAS,CAAC,CAAA;IAC3C,yDAAyD;IACzD,WAAW,EAAE,WAAW,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IAC5C,2CAA2C;IAC3C,UAAU,EAAE,UAAU,CAAA;IACtB,0DAA0D;IAC1D,YAAY,EAAE,qBAAqB,CAAA;IACnC,iDAAiD;IACjD,OAAO,EAAE,YAAY,EAAE,CAAA;IACvB,wDAAwD;IACxD,OAAO,EAAE,gBAAgB,CACvB,OAAO,CACL,IAAI,CAAC,4BAA4B,EAAE,gBAAgB,GAAG,kBAAkB,CAAC,CAC1E,CACF,CAAA;CACF,CAAA;AAED;;;;GAIG;;;;;AACH,wBAsWC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./Modal.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
4
|
+
const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-6c81e410"]]);
|
|
5
5
|
export {
|
|
6
6
|
p as default
|
|
7
7
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { defineComponent as I, ref as w, useId as N, watch as D, nextTick as E, onBeforeMount as F, onBeforeUnmount as U, computed as d, toValue as k, withDirectives as b, createElementBlock as u, openBlock as m, createElementVNode as s, unref as o, createVNode as l, withCtx as V, vShow as x } from "vue";
|
|
2
2
|
import { addScalarClassesToHeadless as A, ScalarTeleportRoot as $ } from "@scalar/components";
|
|
3
|
-
import { ScalarToasts as
|
|
4
|
-
import { useFocusTrap as
|
|
5
|
-
import { mergeAuthConfig as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
3
|
+
import { ScalarToasts as z } from "@scalar/use-toasts";
|
|
4
|
+
import { useFocusTrap as H } from "@vueuse/integrations/useFocusTrap";
|
|
5
|
+
import { mergeAuthConfig as L } from "../../blocks/scalar-auth-selector-block/helpers/merge-auth-config.js";
|
|
6
|
+
import { initializeModalEvents as M } from "./modal-events.js";
|
|
7
|
+
import O from "../operation/Operation.vue.js";
|
|
8
|
+
import { getActiveEnvironment as R } from "../../helpers/get-active-environment.js";
|
|
9
|
+
import { useGlobalHotKeys as j } from "../../hooks/use-global-hot-keys.js";
|
|
10
|
+
import { useScrollLock as q } from "../../hooks/use-scroll-lock.js";
|
|
11
11
|
import G from "../../components/sidebar/SidebarToggle.vue.js";
|
|
12
12
|
import K from "../../components/sidebar/Sidebar.vue.js";
|
|
13
13
|
const P = { class: "scalar scalar-app" }, J = { class: "scalar-container" }, Q = ["id"], X = {
|
|
@@ -37,32 +37,31 @@ const P = { class: "scalar scalar-app" }, J = { class: "scalar-container" }, Q =
|
|
|
37
37
|
label: "default",
|
|
38
38
|
id: "default"
|
|
39
39
|
}, n = w(!1);
|
|
40
|
-
|
|
40
|
+
M({
|
|
41
41
|
eventBus: e.eventBus,
|
|
42
|
-
document: e.document,
|
|
43
|
-
workspaceStore: e.workspaceStore,
|
|
44
42
|
isSidebarOpen: n,
|
|
45
43
|
sidebarState: e.sidebarState,
|
|
46
|
-
modalState: e.modalState
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
modalState: e.modalState,
|
|
45
|
+
store: e.workspaceStore
|
|
46
|
+
}), j(e.eventBus, "modal");
|
|
47
|
+
const f = w(null), v = N(), { activate: y, deactivate: p } = H(f, {
|
|
49
48
|
allowOutsideClick: !0,
|
|
50
49
|
fallbackFocus: `#${v}`
|
|
51
50
|
}), S = () => {
|
|
52
51
|
p(), e.eventBus.emit("operation:cancel:request");
|
|
53
|
-
},
|
|
52
|
+
}, g = q(() => typeof window < "u" ? window.document.body : null);
|
|
54
53
|
D(
|
|
55
54
|
() => e.modalState.open,
|
|
56
55
|
(a) => {
|
|
57
|
-
|
|
56
|
+
g.value = a, a ? y({ checkCanFocusTrap: () => E() }) : S();
|
|
58
57
|
}
|
|
59
58
|
), F(() => A()), U(() => S());
|
|
60
|
-
const
|
|
61
|
-
() => e.workspaceStore?.workspace?.["x-scalar-sidebar-width"] ??
|
|
59
|
+
const C = 288, c = d(
|
|
60
|
+
() => e.workspaceStore?.workspace?.["x-scalar-sidebar-width"] ?? C
|
|
62
61
|
), T = (a) => e.workspaceStore?.update("x-scalar-sidebar-width", a), h = d(
|
|
63
|
-
() =>
|
|
62
|
+
() => R(e.workspaceStore, e.document.value)
|
|
64
63
|
), W = d(
|
|
65
|
-
() =>
|
|
64
|
+
() => L(
|
|
66
65
|
e.document.value?.components?.securitySchemes,
|
|
67
66
|
k(e.options)?.authentication?.securitySchemes
|
|
68
67
|
)
|
|
@@ -84,7 +83,7 @@ const P = { class: "scalar scalar-app" }, J = { class: "scalar-container" }, Q =
|
|
|
84
83
|
}, [
|
|
85
84
|
l(o($), null, {
|
|
86
85
|
default: V(() => [
|
|
87
|
-
l(o(
|
|
86
|
+
l(o(z)),
|
|
88
87
|
e.document.value && e.path?.value && e.method?.value ? (m(), u("main", X, [
|
|
89
88
|
l(o(G), {
|
|
90
89
|
modelValue: n.value,
|
|
@@ -109,7 +108,7 @@ const P = { class: "scalar scalar-app" }, J = { class: "scalar-container" }, Q =
|
|
|
109
108
|
}, null, 8, ["sidebarWidth", "documents", "eventBus", "sidebarState", "onSelectItem"]), [
|
|
110
109
|
[x, n.value]
|
|
111
110
|
]),
|
|
112
|
-
l(
|
|
111
|
+
l(O, {
|
|
113
112
|
activeWorkspace: r,
|
|
114
113
|
class: "flex-1",
|
|
115
114
|
document: e.document.value,
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { type ApiClientModal, createApiClientModal } from './helpers/create-api-client-modal.js';
|
|
2
|
-
export {
|
|
2
|
+
export { initializeModalEvents } from './modal-events.js';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/modal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAA;AAC7F,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/modal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAA;AAC7F,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { createApiClientModal as
|
|
2
|
-
import {
|
|
1
|
+
import { createApiClientModal as o } from "./helpers/create-api-client-modal.js";
|
|
2
|
+
import { initializeModalEvents as r } from "./modal-events.js";
|
|
3
3
|
export {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
o as createApiClientModal,
|
|
5
|
+
r as initializeModalEvents
|
|
6
6
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ModalState } from '@scalar/components';
|
|
2
|
+
import type { WorkspaceStore } from '@scalar/workspace-store/client';
|
|
3
|
+
import type { WorkspaceEventBus } from '@scalar/workspace-store/events';
|
|
4
|
+
import { type Ref } from 'vue';
|
|
5
|
+
import type { UseModalSidebarReturn } from '../../../v2/features/modal/hooks/use-modal-sidebar.js';
|
|
6
|
+
export declare function initializeModalEvents({ eventBus, isSidebarOpen, sidebarState, modalState, store, }: {
|
|
7
|
+
eventBus: WorkspaceEventBus;
|
|
8
|
+
isSidebarOpen: Ref<boolean>;
|
|
9
|
+
sidebarState: UseModalSidebarReturn;
|
|
10
|
+
modalState: ModalState;
|
|
11
|
+
store: WorkspaceStore;
|
|
12
|
+
}): void;
|
|
13
|
+
//# sourceMappingURL=modal-events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modal-events.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/modal/modal-events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,EAAE,KAAK,GAAG,EAAO,MAAM,KAAK,CAAA;AAEnC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,6CAA6C,CAAA;AAGxF,wBAAgB,qBAAqB,CAAC,EACpC,QAAQ,EACR,aAAa,EACb,YAAY,EACZ,UAAU,EACV,KAAK,GACN,EAAE;IACD,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,aAAa,EAAE,GAAG,CAAC,OAAO,CAAC,CAAA;IAC3B,YAAY,EAAE,qBAAqB,CAAA;IACnC,UAAU,EAAE,UAAU,CAAA;IACtB,KAAK,EAAE,cAAc,CAAA;CACtB,QA2CA"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ref as c } from "vue";
|
|
2
|
+
import { initializeWorkspaceEventHandlers as l } from "../../workspace-events.js";
|
|
3
|
+
function f({
|
|
4
|
+
eventBus: e,
|
|
5
|
+
isSidebarOpen: t,
|
|
6
|
+
sidebarState: n,
|
|
7
|
+
modalState: o,
|
|
8
|
+
store: m
|
|
9
|
+
}) {
|
|
10
|
+
l({
|
|
11
|
+
eventBus: e,
|
|
12
|
+
store: c(m),
|
|
13
|
+
hooks: {}
|
|
14
|
+
}), e.on("scroll-to:nav-item", ({ id: i }) => n.handleSelectItem(i)), e.on("ui:toggle:sidebar", () => t.value = !t.value), e.on("ui:close:client-modal", () => o.hide()), e.on("ui:open:client-modal", (i) => {
|
|
15
|
+
if (!i) {
|
|
16
|
+
o.show();
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
"id" in i && i.id ? n.handleSelectItem(i.id) : "method" in i && "path" in i && n.handleSelectItem(
|
|
20
|
+
n.getEntryByLocation({
|
|
21
|
+
document: m.workspace.activeDocument?.["x-scalar-navigation"]?.id ?? "",
|
|
22
|
+
path: i.path,
|
|
23
|
+
method: i.method,
|
|
24
|
+
example: i.exampleName
|
|
25
|
+
})?.id ?? ""
|
|
26
|
+
), o.show();
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
f as initializeModalEvents
|
|
31
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Operation.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/operation/Operation.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Operation.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/operation/Operation.vue"],"names":[],"mappings":"AA8JA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAA;AAKlE;;;;;;;GAOG;;uBAGoB,OAAO;;uBAAP,OAAO;;AAF9B,wBAwNC"}
|