@scalar/api-client 2.18.4 → 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 +37 -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/features/app/App.vue.js +6 -6
- 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.map +1 -1
- package/dist/v2/features/app/app-state.js +69 -71
- package/dist/v2/features/app/components/AppSidebar.vue.js +1 -1
- package/dist/v2/features/app/components/AppSidebar.vue2.js +5 -5
- 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 +13 -13
- 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,24 +1,21 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as D, useId as F, computed as w, ref as S, useTemplateRef as U, onMounted as H, onBeforeUnmount as W, createElementBlock as R, openBlock as h, unref as l, createElementVNode as o, normalizeClass as O, createVNode as a, createCommentVNode as z, normalizeStyle as P, createBlock as K, withCtx as E, createTextVNode as x, toDisplayString as m } from "vue";
|
|
2
2
|
import { ScalarButton as $, ScalarWrappingText as Q, ScalarIcon as j } from "@scalar/components";
|
|
3
3
|
import { REQUEST_METHODS as G } from "@scalar/helpers/http/http-info";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import oe from "
|
|
12
|
-
|
|
13
|
-
import se from "../../../components/server/ServerDropdown.vue.js";
|
|
14
|
-
import ae from "../../../components/code-input/CodeInput.vue.js";
|
|
15
|
-
const re = ["id"], ie = { class: "pointer-events-none absolute top-0 left-0 block h-full w-full overflow-hidden rounded-lg border" }, de = { class: "z-context-plus flex gap-1" }, ue = { class: "scroll-timeline-x scroll-timeline-x-hidden z-context-plus relative flex w-full bg-blend-normal" }, me = {
|
|
4
|
+
import { ScalarIconCopy as J, ScalarIconWarningCircle as X } from "@scalar/icons";
|
|
5
|
+
import { useClipboard as Y } from "@scalar/use-hooks/useClipboard";
|
|
6
|
+
import { getResolvedUrl as Z } from "../../operation-block/helpers/get-resolved-url.js";
|
|
7
|
+
import { useLoadingAnimation as _ } from "../hooks/use-loading-animation.js";
|
|
8
|
+
import ee from "./AddressBarHistory.vue.js";
|
|
9
|
+
import te from "../../../../components/HttpMethod/HttpMethod.vue.js";
|
|
10
|
+
import ne from "../../../components/server/ServerDropdown.vue.js";
|
|
11
|
+
import oe from "../../../components/code-input/CodeInput.vue.js";
|
|
12
|
+
const le = ["id"], se = { class: "pointer-events-none absolute top-0 left-0 block h-full w-full overflow-hidden rounded-lg border" }, ae = { class: "z-context-plus flex gap-1" }, re = { class: "scroll-timeline-x scroll-timeline-x-hidden z-context-plus relative flex w-full bg-blend-normal" }, ie = {
|
|
16
13
|
key: 0,
|
|
17
14
|
class: "z-context absolute inset-x-0 top-[calc(100%+4px)] flex flex-col items-center rounded px-6"
|
|
18
|
-
},
|
|
15
|
+
}, de = { class: "text-c-danger bg-b-danger border-c-danger flex items-center gap-1 rounded border p-1" }, ue = { class: "min-w-0 flex-1" }, me = {
|
|
19
16
|
"aria-hidden": "true",
|
|
20
17
|
class: "inline-flex items-center gap-1"
|
|
21
|
-
},
|
|
18
|
+
}, ce = { class: "sr-only" }, we = /* @__PURE__ */ D({
|
|
22
19
|
__name: "AddressBar",
|
|
23
20
|
props: {
|
|
24
21
|
path: {},
|
|
@@ -31,72 +28,73 @@ const re = ["id"], ie = { class: "pointer-events-none absolute top-0 left-0 bloc
|
|
|
31
28
|
environment: {}
|
|
32
29
|
},
|
|
33
30
|
emits: ["execute", "update:servers"],
|
|
34
|
-
setup(e, { expose:
|
|
35
|
-
const c =
|
|
31
|
+
setup(e, { expose: V, emit: q }) {
|
|
32
|
+
const c = q, f = F(), { percentage: b, startLoading: g, stopLoading: v } = _(), T = w(() => ({
|
|
36
33
|
backgroundColor: `color-mix(in srgb, transparent 90%, ${G[e.method].colorVar})`,
|
|
37
|
-
transform: `translate3d(-${
|
|
38
|
-
})), i =
|
|
39
|
-
const
|
|
34
|
+
transform: `translate3d(-${b.value}%,0,0)`
|
|
35
|
+
})), i = S(null), r = S(null), y = w(() => r.value || i.value), B = (n, t, s) => {
|
|
36
|
+
const N = d.value?.cursorPosition();
|
|
40
37
|
e.eventBus.emit(
|
|
41
38
|
"operation:update:pathMethod",
|
|
42
39
|
{
|
|
43
40
|
meta: { method: e.method, path: e.path },
|
|
44
41
|
payload: { method: n, path: t },
|
|
45
42
|
callback: (u) => {
|
|
46
|
-
(u === "success" || u === "no-change") && (r.value = null, i.value = null), u === "success" ? e.eventBus.emit("ui:focus:address-bar", { position:
|
|
43
|
+
(u === "success" || u === "no-change") && (r.value = null, i.value = null), u === "success" ? e.eventBus.emit("ui:focus:address-bar", { position: N }) : u === "conflict" && (n !== e.method && (r.value = n), t !== e.path && (i.value = t));
|
|
47
44
|
}
|
|
48
45
|
},
|
|
49
46
|
s
|
|
50
47
|
);
|
|
51
|
-
},
|
|
48
|
+
}, I = (n) => B(n, i.value ?? e.path), L = (n) => {
|
|
52
49
|
const t = n.startsWith("/") ? n : `/${n}`;
|
|
53
|
-
|
|
50
|
+
B(r.value ?? e.method, t, {
|
|
54
51
|
debounceKey: `operation:update:pathMethod-${e.path}-${e.method}`
|
|
55
52
|
});
|
|
56
|
-
}, C =
|
|
53
|
+
}, C = U("sendButtonRef"), d = U("addressBarRef"), p = () => C.value?.$el?.focus(), k = (n) => {
|
|
57
54
|
if (d.value?.isFocused && e.layout !== "desktop")
|
|
58
55
|
return;
|
|
59
56
|
const t = n && "position" in n ? n.position : "end";
|
|
60
57
|
d.value?.focus(t), n && "event" in n && n.event.preventDefault();
|
|
61
58
|
};
|
|
62
|
-
|
|
63
|
-
e.eventBus.on("ui:focus:address-bar",
|
|
64
|
-
}),
|
|
65
|
-
e.eventBus.off("ui:focus:address-bar",
|
|
59
|
+
H(() => {
|
|
60
|
+
e.eventBus.on("ui:focus:address-bar", k), e.eventBus.on("ui:focus:send-button", p), e.eventBus.on("hooks:on:request:sent", g), e.eventBus.on("hooks:on:request:complete", v);
|
|
61
|
+
}), W(() => {
|
|
62
|
+
e.eventBus.off("ui:focus:address-bar", k), e.eventBus.off("ui:focus:send-button", p), e.eventBus.off("hooks:on:request:sent", g), e.eventBus.off("hooks:on:request:complete", v), v();
|
|
66
63
|
});
|
|
67
|
-
const { copyToClipboard:
|
|
68
|
-
|
|
69
|
-
|
|
64
|
+
const { copyToClipboard: A } = Y(), M = async () => {
|
|
65
|
+
await A(
|
|
66
|
+
Z({ environment: e.environment, server: e.server, path: e.path, pathVariables: {} })
|
|
67
|
+
);
|
|
70
68
|
};
|
|
71
|
-
return
|
|
69
|
+
return V({
|
|
72
70
|
methodConflict: r,
|
|
73
71
|
pathConflict: i
|
|
74
|
-
}), (n, t) => (
|
|
72
|
+
}), (n, t) => (h(), R("div", {
|
|
75
73
|
id: l(f),
|
|
76
74
|
class: "scalar-address-bar order-last flex h-(--scalar-address-bar-height) w-full [--scalar-address-bar-height:32px] lg:order-none lg:w-auto"
|
|
77
75
|
}, [
|
|
78
76
|
o("div", {
|
|
79
|
-
class:
|
|
80
|
-
"outline-c-danger outline":
|
|
77
|
+
class: O(["address-bar-bg-states text-xxs group relative order-last flex w-full max-w-[calc(100dvw-24px)] flex-1 flex-row items-stretch rounded-lg p-0.75 lg:order-none lg:max-w-[580px] lg:min-w-[580px] xl:max-w-[720px] xl:min-w-[720px]", {
|
|
78
|
+
"outline-c-danger outline": y.value
|
|
81
79
|
}])
|
|
82
80
|
}, [
|
|
83
|
-
o("div",
|
|
81
|
+
o("div", se, [
|
|
84
82
|
o("div", {
|
|
85
83
|
class: "absolute top-0 left-0 z-[1002] h-full w-full",
|
|
86
|
-
style:
|
|
84
|
+
style: P(T.value)
|
|
87
85
|
}, null, 4)
|
|
88
86
|
]),
|
|
89
|
-
o("div",
|
|
90
|
-
a(l(
|
|
87
|
+
o("div", ae, [
|
|
88
|
+
a(l(te), {
|
|
91
89
|
isEditable: e.layout !== "modal",
|
|
92
90
|
isSquare: "",
|
|
93
91
|
method: r.value ?? e.method,
|
|
94
92
|
teleport: "",
|
|
95
|
-
onChange:
|
|
93
|
+
onChange: I
|
|
96
94
|
}, null, 8, ["isEditable", "method"])
|
|
97
95
|
]),
|
|
98
|
-
o("div",
|
|
99
|
-
e.servers.length ? (
|
|
96
|
+
o("div", re, [
|
|
97
|
+
e.servers.length ? (h(), K(l(ne), {
|
|
100
98
|
key: 0,
|
|
101
99
|
layout: e.layout,
|
|
102
100
|
server: e.server,
|
|
@@ -105,9 +103,9 @@ const re = ["id"], ie = { class: "pointer-events-none absolute top-0 left-0 bloc
|
|
|
105
103
|
"onUpdate:selectedServer": t[0] || (t[0] = (s) => e.eventBus.emit("server:update:selected", s)),
|
|
106
104
|
"onUpdate:servers": t[1] || (t[1] = (s) => c("update:servers")),
|
|
107
105
|
"onUpdate:variable": t[2] || (t[2] = (s) => e.eventBus.emit("server:update:variables", s))
|
|
108
|
-
}, null, 8, ["layout", "server", "servers", "target"])) :
|
|
106
|
+
}, null, 8, ["layout", "server", "servers", "target"])) : z("", !0),
|
|
109
107
|
t[6] || (t[6] = o("div", { class: "fade-left" }, null, -1)),
|
|
110
|
-
a(l(
|
|
108
|
+
a(l(oe), {
|
|
111
109
|
ref_key: "addressBarRef",
|
|
112
110
|
ref: d,
|
|
113
111
|
alwaysEmitChange: "",
|
|
@@ -131,7 +129,7 @@ const re = ["id"], ie = { class: "pointer-events-none absolute top-0 left-0 bloc
|
|
|
131
129
|
}
|
|
132
130
|
})),
|
|
133
131
|
onSubmit: t[4] || (t[4] = (s) => c("execute")),
|
|
134
|
-
"onUpdate:modelValue":
|
|
132
|
+
"onUpdate:modelValue": L
|
|
135
133
|
}, null, 8, ["disabled", "environment", "layout", "modelValue", "placeholder"]),
|
|
136
134
|
t[7] || (t[7] = o("div", { class: "fade-right" }, null, -1))
|
|
137
135
|
]),
|
|
@@ -139,41 +137,41 @@ const re = ["id"], ie = { class: "pointer-events-none absolute top-0 left-0 bloc
|
|
|
139
137
|
class: "hover:bg-b-3 mx-1",
|
|
140
138
|
size: "xs",
|
|
141
139
|
variant: "ghost",
|
|
142
|
-
onClick:
|
|
140
|
+
onClick: M
|
|
143
141
|
}, {
|
|
144
|
-
default:
|
|
145
|
-
a(l(
|
|
142
|
+
default: E(() => [
|
|
143
|
+
a(l(J)),
|
|
146
144
|
t[8] || (t[8] = o("span", { class: "sr-only" }, "Copy URL", -1))
|
|
147
145
|
]),
|
|
148
146
|
_: 1
|
|
149
147
|
}),
|
|
150
|
-
a(
|
|
148
|
+
a(ee, {
|
|
151
149
|
history: e.history,
|
|
152
150
|
target: l(f)
|
|
153
151
|
}, null, 8, ["history", "target"]),
|
|
154
|
-
|
|
155
|
-
o("div",
|
|
156
|
-
a(l(
|
|
157
|
-
o("div",
|
|
158
|
-
t[9] || (t[9] =
|
|
152
|
+
y.value ? (h(), R("div", ie, [
|
|
153
|
+
o("div", de, [
|
|
154
|
+
a(l(X), { size: "sm" }),
|
|
155
|
+
o("div", ue, [
|
|
156
|
+
t[9] || (t[9] = x(" A ", -1)),
|
|
159
157
|
o("em", null, m(r.value?.toUpperCase() ?? e.method.toUpperCase()), 1),
|
|
160
|
-
t[10] || (t[10] =
|
|
158
|
+
t[10] || (t[10] = x(" request to ", -1)),
|
|
161
159
|
a(l(Q), {
|
|
162
160
|
text: i.value ?? e.path
|
|
163
161
|
}, null, 8, ["text"]),
|
|
164
|
-
t[11] || (t[11] =
|
|
162
|
+
t[11] || (t[11] = x(" already exists in this document ", -1))
|
|
165
163
|
])
|
|
166
164
|
])
|
|
167
|
-
])) :
|
|
165
|
+
])) : z("", !0),
|
|
168
166
|
a(l($), {
|
|
169
167
|
ref_key: "sendButtonRef",
|
|
170
168
|
ref: C,
|
|
171
169
|
class: "z-context-plus relative h-auto shrink-0 overflow-hidden py-1 pr-2.5 pl-2 font-bold",
|
|
172
|
-
disabled: l(
|
|
170
|
+
disabled: l(b) < 100,
|
|
173
171
|
onClick: t[5] || (t[5] = (s) => c("execute"))
|
|
174
172
|
}, {
|
|
175
|
-
default:
|
|
176
|
-
o("span",
|
|
173
|
+
default: E(() => [
|
|
174
|
+
o("span", me, [
|
|
177
175
|
a(l(j), {
|
|
178
176
|
class: "relative shrink-0 fill-current",
|
|
179
177
|
icon: "Play",
|
|
@@ -181,14 +179,14 @@ const re = ["id"], ie = { class: "pointer-events-none absolute top-0 left-0 bloc
|
|
|
181
179
|
}),
|
|
182
180
|
t[12] || (t[12] = o("span", { class: "text-xxs hidden lg:flex" }, "Send", -1))
|
|
183
181
|
]),
|
|
184
|
-
o("span",
|
|
182
|
+
o("span", ce, " Send " + m(e.method) + " request to " + m(e.server?.url ?? "") + m(e.path), 1)
|
|
185
183
|
]),
|
|
186
184
|
_: 1
|
|
187
185
|
}, 8, ["disabled"])
|
|
188
186
|
], 2)
|
|
189
|
-
], 8,
|
|
187
|
+
], 8, le));
|
|
190
188
|
}
|
|
191
189
|
});
|
|
192
190
|
export {
|
|
193
|
-
|
|
191
|
+
we as default
|
|
194
192
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { type Icon } from '@scalar/components';
|
|
2
|
-
import type { WorkspaceEventBus } from '@scalar/workspace-store/events';
|
|
3
|
-
import type { AuthMeta } from '@scalar/workspace-store/mutators';
|
|
2
|
+
import type { AuthMeta, WorkspaceEventBus } from '@scalar/workspace-store/events';
|
|
4
3
|
import type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments';
|
|
5
4
|
import type { OpenApiDocument, ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
|
|
6
5
|
import { type SecuritySchemeOption } from '../../../../v2/blocks/scalar-auth-selector-block/helpers/security-scheme.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthSelector.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AuthSelector.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue"],"names":[],"mappings":"AAoTA,OAAO,EAML,KAAK,IAAI,EAEV,MAAM,oBAAoB,CAAA;AAE3B,OAAO,KAAK,EACV,QAAQ,EACR,iBAAiB,EAClB,MAAM,gCAAgC,CAAA;AAGvC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AACnH,OAAO,KAAK,EACV,eAAe,EAEf,YAAY,EACb,MAAM,8DAA8D,CAAA;AAKrE,OAAO,EAIL,KAAK,oBAAoB,EAC1B,MAAM,gEAAgE,CAAA;AAKvE,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,kBAAkB,CAAA;IAC/B,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,gDAAgD;IAChD,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,IAAI,EAAE,QAAQ,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;IAChB,oBAAoB,EAAE,eAAe,CAAC,UAAU,CAAC,CAAA;IACjD,eAAe,EAAE,WAAW,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAA;IAC9E,gBAAgB,EAAE,eAAe,CAAC,4BAA4B,CAAC,CAAA;IAC/D,MAAM,EAAE,YAAY,GAAG,IAAI,CAAA;IAC3B,KAAK,EAAE,MAAM,CAAA;CACd,CAAC;;;cA+BqC,IAAI;cAAQ,MAAM;;;;;AA6bzD,wBAOG"}
|
|
@@ -18,7 +18,7 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
18
18
|
description: string;
|
|
19
19
|
flowType: keyof OAuthFlowsObject;
|
|
20
20
|
};
|
|
21
|
-
meta: import("@scalar/workspace-store/
|
|
21
|
+
meta: import("@scalar/workspace-store/events").AuthMeta;
|
|
22
22
|
}, "scopes" | "newScopePayload">) => any;
|
|
23
23
|
"update:securityScheme": (payload: ({
|
|
24
24
|
type: "http";
|
|
@@ -118,7 +118,7 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
118
118
|
description: string;
|
|
119
119
|
flowType: keyof OAuthFlowsObject;
|
|
120
120
|
};
|
|
121
|
-
meta: import("@scalar/workspace-store/
|
|
121
|
+
meta: import("@scalar/workspace-store/events").AuthMeta;
|
|
122
122
|
}, "scopes" | "newScopePayload">) => any) | undefined;
|
|
123
123
|
"onUpdate:securityScheme"?: ((payload: ({
|
|
124
124
|
type: "http";
|
|
@@ -14,7 +14,7 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
14
14
|
description: string;
|
|
15
15
|
flowType: keyof OAuthFlowsObject;
|
|
16
16
|
};
|
|
17
|
-
meta: import("@scalar/workspace-store/
|
|
17
|
+
meta: import("@scalar/workspace-store/events").AuthMeta;
|
|
18
18
|
}, "scopes" | "newScopePayload">) => any;
|
|
19
19
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
20
20
|
"onUpdate:selectedScopes"?: ((payload: Pick<{
|
|
@@ -26,7 +26,7 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
26
26
|
description: string;
|
|
27
27
|
flowType: keyof OAuthFlowsObject;
|
|
28
28
|
};
|
|
29
|
-
meta: import("@scalar/workspace-store/
|
|
29
|
+
meta: import("@scalar/workspace-store/events").AuthMeta;
|
|
30
30
|
}, "scopes" | "newScopePayload">) => any) | undefined;
|
|
31
31
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
32
32
|
export default _default;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { WorkspaceEventBus } from '@scalar/workspace-store/events';
|
|
2
|
-
import type { AuthMeta } from '@scalar/workspace-store/mutators';
|
|
1
|
+
import type { AuthMeta, WorkspaceEventBus } from '@scalar/workspace-store/events';
|
|
3
2
|
import type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments';
|
|
4
3
|
import type { ComponentsObject, ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
|
|
5
4
|
import type { SecuritySchemeOption } from '../../../../v2/blocks/scalar-auth-selector-block/helpers/security-scheme.js';
|
package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestAuthDataTable.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue"],"names":[],"mappings":"AAwJA,OAAO,KAAK,EAEV,iBAAiB,EAClB,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"RequestAuthDataTable.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue"],"names":[],"mappings":"AAwJA,OAAO,KAAK,EAEV,QAAQ,EACR,iBAAiB,EAClB,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AACnH,OAAO,KAAK,EACV,gBAAgB,EAChB,YAAY,EACb,MAAM,8DAA8D,CAAA;AAGrE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gEAAgE,CAAA;AAK1G,KAAK,WAAW,GAAG;IACjB,4CAA4C;IAC5C,WAAW,EAAE,kBAAkB,CAAA;IAC/B,mEAAmE;IACnE,QAAQ,EAAE,OAAO,CAAA;IACjB,8CAA8C;IAC9C,qBAAqB,EAAE,oBAAoB,EAAE,CAAA;IAC7C,uDAAuD;IACvD,eAAe,EAAE,MAAM,CAAA;IACvB,gBAAgB;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,0CAA0C;IAC1C,eAAe,EAAE,gBAAgB,CAAC,iBAAiB,CAAC,CAAA;IACpD,mCAAmC;IACnC,MAAM,EAAE,YAAY,GAAG,IAAI,CAAA;IAC3B,2CAA2C;IAC3C,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,0CAA0C;IAC1C,IAAI,EAAE,QAAQ,CAAA;CACf,CAAC;;;;AA2OF,wBAOG"}
|
|
@@ -19,7 +19,7 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
19
19
|
description: string;
|
|
20
20
|
flowType: keyof import("@scalar/workspace-store/schemas/v3.1/strict/oauthflows").OAuthFlowsObject;
|
|
21
21
|
};
|
|
22
|
-
meta: import("@scalar/workspace-store/
|
|
22
|
+
meta: import("@scalar/workspace-store/events").AuthMeta;
|
|
23
23
|
}, "meta">) => any;
|
|
24
24
|
"update:securityScheme": (payload: ({
|
|
25
25
|
type: "http";
|
|
@@ -119,7 +119,7 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
119
119
|
description: string;
|
|
120
120
|
flowType: keyof import("@scalar/workspace-store/schemas/v3.1/strict/oauthflows").OAuthFlowsObject;
|
|
121
121
|
};
|
|
122
|
-
meta: import("@scalar/workspace-store/
|
|
122
|
+
meta: import("@scalar/workspace-store/events").AuthMeta;
|
|
123
123
|
}, "meta">) => any) | undefined;
|
|
124
124
|
"onUpdate:securityScheme"?: ((payload: ({
|
|
125
125
|
type: "http";
|
|
@@ -86,6 +86,8 @@ declare const _default: <T extends CodeInputModelValue>(__VLS_props: NonNullable
|
|
|
86
86
|
handleFieldChange?: (value: T) => void;
|
|
87
87
|
/** Custom submit handler, prevents default emit */
|
|
88
88
|
handleFieldSubmit?: (value: string) => void;
|
|
89
|
+
/** Put a linethrough on the input text */
|
|
90
|
+
linethrough?: boolean;
|
|
89
91
|
} & Partial<{}>> & import("vue").PublicProps;
|
|
90
92
|
expose(exposed: import("vue").ShallowUnwrapRef<{
|
|
91
93
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeInput.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/code-input/CodeInput.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CodeInput.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/code-input/CodeInput.vue"],"names":[],"mappings":"AAmuBA,OAAO,EAIL,KAAK,kBAAkB,EACvB,KAAK,SAAS,EACf,MAAM,wBAAwB,CAAA;AAC/B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AAEnH,OAAO,EAAyC,KAAK,GAAG,EAAE,MAAM,KAAK,CAAA;AAIrE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAKrD,MAAM,MAAM,mBAAmB,GAC3B,MAAM,GACN,MAAM,GACN,OAAO,GACP,KAAK,CAAC,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,GAChC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAE3B;;;;;;;;;;;;;;;;;;;;;GAqBG;yBACc,CAAC,SAAS,mBAAmB,EAC7C,aAAa,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,EAC9D,YAAY,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,EAC3G,eAAe,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,EACjE;WAwxBO,mBAAmB,CAAC;;;;;;;oBAhxBd,CAAC;QACb,6FAA6F;qBAChF,kBAAkB,GAAG,SAAS;QAC3C,mEAAmE;eAC5D,MAAM,GAAG,MAAM,EAAE;QACxB,sCAAsC;mBAC3B,OAAO;QAClB,yBAAyB;gBACjB,OAAO;QACf,kDAAkD;iBACzC,YAAY;QACrB,mDAAmD;eAC5C,MAAM,EAAE;QACf,2CAA2C;mBAChC,MAAM,EAAE;QACnB,2CAA2C;;QAE3C,2CAA2C;mBAChC,OAAO;QAClB,uCAAuC;sBACzB,MAAM;QACpB,8BAA8B;mBACnB,OAAO;QAClB,oCAAoC;sBACtB,OAAO;QACrB,kCAAkC;sBACpB,OAAO;QACrB,qBAAqB;eACd,OAAO;QACd,2BAA2B;uBACZ,OAAO;QACtB,+BAA+B;mBACpB,kBAAkB;QAC7B,uCAAuC;qBAC1B,SAAS,EAAE;QACxB,sCAAsC;2BACnB,OAAO;QAC1B,wBAAwB;uBACT,OAAO;QACtB,wCAAwC;+BACjB,OAAO;QAC9B,gCAAgC;qBACnB,OAAO;QACpB,wCAAwC;wBACxB,OAAO;QACvB,oCAAoC;qBACvB,OAAO;QACpB,sDAAsD;2BACnC,OAAO;QAC1B,mDAAmD;4BAC/B,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI;QACtC,mDAAmD;4BAC/B,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI;QAC3C,0CAA0C;sBAC5B,OAAO;QA0tB0C,OAAO,IAAsB,CAAC,4BAA2B;oBACzG,OAAO,KAAK,EAAE,gBAAgB;QApZ7C;;;;WAIG;2BACgB,OAAO,GAAG,KAAK,GAAG,MAAM;;8BApPhB,MAAM,KAAG,IAAI;8BAuCb,MAAM,KAAG,IAAI;4BAWf,MAAM,KAAG,IAAI;;;;;gCA2DT,CAAC,KAAG,MAAM;kCAeR,MAAM,KAAG,CAAC;MAugB0B,GAAG,IAAI;WACpE,GAAG;;kBA3CG,CAAC,KAAK,IAAiB,KAAK,GAAG;;eAClC,CAAC,KAAK,IAAiB,KAAK,GAAG;;;EA8CtC,KACQ,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,WAAW,CAAC,CAAA;CAAE;AAnyBzE,wBAoyBC;AACD,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
|
@@ -2,7 +2,7 @@ import o from "./CodeInput.vue2.js";
|
|
|
2
2
|
/* empty css */
|
|
3
3
|
/* empty css */
|
|
4
4
|
import t from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
-
const
|
|
5
|
+
const e = /* @__PURE__ */ t(o, [["__scopeId", "data-v-e2bff922"]]);
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
e as default
|
|
8
8
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as Q, useAttrs as G, ref as d, computed as s, toRef as r, watch as X, createElementBlock as i, openBlock as
|
|
1
|
+
import { defineComponent as Q, useAttrs as G, ref as d, computed as s, toRef as r, watch as X, createElementBlock as i, openBlock as a, Fragment as Y, createBlock as y, createCommentVNode as c, normalizeClass as Z, createElementVNode as V, toDisplayString as _, mergeProps as ee, unref as O, withKeys as h, withModifiers as $, createTextVNode as p, renderSlot as I } from "vue";
|
|
2
2
|
import { isDefined as te } from "@scalar/helpers/array/is-defined";
|
|
3
|
-
import { useCodeMirror as
|
|
4
|
-
import { nanoid as
|
|
3
|
+
import { useCodeMirror as le, useDropdown as ne, colorPicker as oe } from "@scalar/use-codemirror";
|
|
4
|
+
import { nanoid as ae } from "nanoid";
|
|
5
5
|
import B from "../data-table/DataTableInputSelect.vue.js";
|
|
6
6
|
import re from "../../features/environments/components/EnvironmentVariablesDropdown.vue.js";
|
|
7
7
|
import { pillPlugin as ie, backspaceCommand as ue } from "./code-variable-widget.js";
|
|
@@ -18,10 +18,10 @@ const de = { class: "whitespace-nowrap" }, se = ["id"], ce = {
|
|
|
18
18
|
}, ye = {
|
|
19
19
|
key: 7,
|
|
20
20
|
class: "required centered-y text-xxs text-c-3 group-[.error]:text-red bg-b-1 pointer-events-none absolute right-0 mr-0.5 pt-px pr-2 opacity-100 shadow-[-8px_0_4px_var(--scalar-background-1)] transition-opacity duration-150 group-[.alert]:bg-transparent group-[.alert]:shadow-none group-[.error]:bg-transparent group-[.error]:shadow-none peer-has-[.cm-focused]:opacity-0"
|
|
21
|
-
},
|
|
21
|
+
}, he = {
|
|
22
22
|
inheritAttrs: !1
|
|
23
23
|
}, ke = /* @__PURE__ */ Q({
|
|
24
|
-
...
|
|
24
|
+
...he,
|
|
25
25
|
__name: "CodeInput",
|
|
26
26
|
props: {
|
|
27
27
|
modelValue: {},
|
|
@@ -50,34 +50,35 @@ const de = { class: "whitespace-nowrap" }, se = ["id"], ce = {
|
|
|
50
50
|
importCurl: { type: Boolean, default: !1 },
|
|
51
51
|
alwaysEmitChange: { type: Boolean, default: !1 },
|
|
52
52
|
handleFieldChange: { type: Function },
|
|
53
|
-
handleFieldSubmit: { type: Function }
|
|
53
|
+
handleFieldSubmit: { type: Function },
|
|
54
|
+
linethrough: { type: Boolean }
|
|
54
55
|
},
|
|
55
56
|
emits: ["update:modelValue", "submit", "blur", "curl", "redirectToEnvironment"],
|
|
56
57
|
setup(e, { expose: M, emit: N }) {
|
|
57
|
-
const u = N, k = G(), R = k.id || `id-${
|
|
58
|
+
const u = N, k = G(), R = k.id || `id-${ae()}`, b = d(!1), q = s(() => e.enum?.length ? !1 : e.type === "boolean" || Array.isArray(e.type) && e.type.includes("boolean")), C = s(() => e.nullable ? ["true", "false", "null"] : ["true", "false"]), z = s(() => Array.isArray(e.type) ? e.type.find((t) => t !== "null") ?? "string" : e.type), E = (t) => {
|
|
58
59
|
if (!e.alwaysEmitChange && t === f(e.modelValue))
|
|
59
60
|
return;
|
|
60
61
|
if (typeof t == "string" && e.importCurl && t.trim().toLowerCase().startsWith("curl")) {
|
|
61
|
-
u("curl", t),
|
|
62
|
+
u("curl", t), n.value && n.value.dispatch({
|
|
62
63
|
changes: {
|
|
63
64
|
from: 0,
|
|
64
|
-
to:
|
|
65
|
+
to: n.value.state.doc.length,
|
|
65
66
|
insert: f(e.modelValue)
|
|
66
67
|
}
|
|
67
68
|
});
|
|
68
69
|
return;
|
|
69
70
|
}
|
|
70
|
-
const
|
|
71
|
-
e.handleFieldChange ? e.handleFieldChange(
|
|
71
|
+
const l = T(t);
|
|
72
|
+
e.handleFieldChange ? e.handleFieldChange(l) : u("update:modelValue", l);
|
|
72
73
|
}, g = (t) => {
|
|
73
74
|
e.handleFieldSubmit ? e.handleFieldSubmit(t) : u("submit", t);
|
|
74
75
|
}, S = (t) => {
|
|
75
|
-
|
|
76
|
+
b.value = !1, e.emitOnBlur && e.modelValue && g(t), u("blur", t);
|
|
76
77
|
}, v = (t) => {
|
|
77
78
|
u("update:modelValue", t);
|
|
78
79
|
}, W = () => {
|
|
79
80
|
const t = [...e.extensions];
|
|
80
|
-
return e.colorPicker && t.push(
|
|
81
|
+
return e.colorPicker && t.push(oe), t;
|
|
81
82
|
}, K = s(
|
|
82
83
|
() => ie({
|
|
83
84
|
environment: e.environment,
|
|
@@ -88,22 +89,22 @@ const de = { class: "whitespace-nowrap" }, se = ["id"], ce = {
|
|
|
88
89
|
K.value,
|
|
89
90
|
ue
|
|
90
91
|
]), P = d(null), f = (t) => typeof t == "object" ? JSON.stringify(t) : String(t ?? ""), T = (t) => {
|
|
91
|
-
const
|
|
92
|
-
if (Array.isArray(e.modelValue) && !
|
|
93
|
-
return
|
|
94
|
-
if (
|
|
92
|
+
const l = t.trim(), o = l.startsWith("[") || l.startsWith("{"), F = typeof e.modelValue;
|
|
93
|
+
if (Array.isArray(e.modelValue) && !o && l.includes(","))
|
|
94
|
+
return l.split(",").map((H) => H.trim());
|
|
95
|
+
if (o || F === "number" || F === "boolean")
|
|
95
96
|
try {
|
|
96
97
|
return JSON.parse(t);
|
|
97
98
|
} catch {
|
|
98
99
|
}
|
|
99
100
|
return t;
|
|
100
|
-
}, { codeMirror:
|
|
101
|
+
}, { codeMirror: n } = le({
|
|
101
102
|
content: r(() => f(e.modelValue)),
|
|
102
103
|
onChange: (t) => {
|
|
103
104
|
E(t), J();
|
|
104
105
|
},
|
|
105
106
|
onFocus: () => {
|
|
106
|
-
|
|
107
|
+
b.value = !0;
|
|
107
108
|
},
|
|
108
109
|
onBlur: S,
|
|
109
110
|
codeMirrorRef: P,
|
|
@@ -116,20 +117,20 @@ const de = { class: "whitespace-nowrap" }, se = ["id"], ce = {
|
|
|
116
117
|
extensions: L,
|
|
117
118
|
placeholder: r(() => e.placeholder)
|
|
118
119
|
});
|
|
119
|
-
X(
|
|
120
|
-
|
|
120
|
+
X(n, () => {
|
|
121
|
+
n.value && Object.hasOwn(k, "autofocus") && n.value.focus();
|
|
121
122
|
});
|
|
122
|
-
const w = d(!1), A = d(""), D = d({ left: 0, top: 0 }), x = d(null), { handleDropdownSelect: j, updateDropdownVisibility: J } =
|
|
123
|
-
codeMirror:
|
|
123
|
+
const w = d(!1), A = d(""), D = d({ left: 0, top: 0 }), x = d(null), { handleDropdownSelect: j, updateDropdownVisibility: J } = ne({
|
|
124
|
+
codeMirror: n,
|
|
124
125
|
query: A,
|
|
125
126
|
showDropdown: w,
|
|
126
127
|
dropdownPosition: D
|
|
127
|
-
}), U = s(() => w.value && e.withVariables && e.layout !== "modal" && !!e.environment), m = (t,
|
|
128
|
+
}), U = s(() => w.value && e.withVariables && e.layout !== "modal" && !!e.environment), m = (t, l) => {
|
|
128
129
|
if (w.value) {
|
|
129
|
-
t === "down" || t === "up" ? (
|
|
130
|
+
t === "down" || t === "up" ? (l.preventDefault(), x.value?.handleArrowKey(t)) : t === "enter" && (l.preventDefault(), x.value?.handleSelect());
|
|
130
131
|
return;
|
|
131
132
|
}
|
|
132
|
-
t === "escape" && !e.disableTabIndent &&
|
|
133
|
+
t === "escape" && !e.disableTabIndent && l.stopPropagation(), t === "enter" && l.target instanceof HTMLDivElement && g(l.target.textContent ?? "");
|
|
133
134
|
};
|
|
134
135
|
return M({
|
|
135
136
|
/**
|
|
@@ -138,51 +139,55 @@ const de = { class: "whitespace-nowrap" }, se = ["id"], ce = {
|
|
|
138
139
|
* @param cursorAtEnd boolean place the cursor at the end of the input
|
|
139
140
|
*/
|
|
140
141
|
focus: (t) => {
|
|
141
|
-
if (!
|
|
142
|
+
if (!n.value || (n.value.focus(), !te(t)))
|
|
142
143
|
return;
|
|
143
|
-
const
|
|
144
|
-
|
|
145
|
-
selection: { anchor:
|
|
144
|
+
const l = t === "start" ? 0 : t === "end" ? n.value.state.doc.length : t;
|
|
145
|
+
n.value.dispatch({
|
|
146
|
+
selection: { anchor: l },
|
|
146
147
|
scrollIntoView: !0
|
|
147
148
|
});
|
|
148
149
|
},
|
|
149
|
-
isFocused:
|
|
150
|
+
isFocused: b,
|
|
150
151
|
handleChange: E,
|
|
151
152
|
handleSubmit: g,
|
|
152
153
|
handleBlur: S,
|
|
153
154
|
booleanOptions: C,
|
|
154
|
-
codeMirror:
|
|
155
|
+
codeMirror: n,
|
|
155
156
|
modelValue: e.modelValue,
|
|
156
|
-
cursorPosition: () =>
|
|
157
|
+
cursorPosition: () => n.value?.state.selection.main.head,
|
|
157
158
|
serializeValue: f,
|
|
158
159
|
deserializeValue: T
|
|
159
|
-
}), (t,
|
|
160
|
-
e.disabled ? (
|
|
160
|
+
}), (t, l) => (a(), i(Y, null, [
|
|
161
|
+
e.disabled ? (a(), i("div", {
|
|
161
162
|
key: 0,
|
|
162
|
-
class: Z(["text-c-2 flex cursor-default items-center justify-center",
|
|
163
|
+
class: Z(["text-c-2 flex cursor-default items-center justify-center", {
|
|
164
|
+
"font-code pr-2 pl-1 text-base": e.layout === "modal",
|
|
165
|
+
"px-2": e.layout !== "modal",
|
|
166
|
+
"line-through": e.linethrough
|
|
167
|
+
}]),
|
|
163
168
|
"data-testid": "code-input-disabled"
|
|
164
169
|
}, [
|
|
165
170
|
V("span", de, _(e.modelValue), 1)
|
|
166
|
-
], 2)) : e.enum?.length ? (
|
|
171
|
+
], 2)) : e.enum?.length ? (a(), y(B, {
|
|
167
172
|
key: 1,
|
|
168
173
|
default: e.default,
|
|
169
174
|
modelValue: e.modelValue,
|
|
170
175
|
type: z.value,
|
|
171
176
|
value: e.enum,
|
|
172
177
|
"onUpdate:modelValue": v
|
|
173
|
-
}, null, 8, ["default", "modelValue", "type", "value"])) : q.value ? (
|
|
178
|
+
}, null, 8, ["default", "modelValue", "type", "value"])) : q.value ? (a(), y(B, {
|
|
174
179
|
key: 2,
|
|
175
180
|
default: e.default,
|
|
176
181
|
modelValue: e.modelValue,
|
|
177
182
|
value: C.value,
|
|
178
183
|
"onUpdate:modelValue": v
|
|
179
|
-
}, null, 8, ["default", "modelValue", "value"])) : e.examples?.length ? (
|
|
184
|
+
}, null, 8, ["default", "modelValue", "value"])) : e.examples?.length ? (a(), y(B, {
|
|
180
185
|
key: 3,
|
|
181
186
|
default: e.default,
|
|
182
187
|
modelValue: e.modelValue,
|
|
183
188
|
value: e.examples,
|
|
184
189
|
"onUpdate:modelValue": v
|
|
185
|
-
}, null, 8, ["default", "modelValue", "value"])) : (
|
|
190
|
+
}, null, 8, ["default", "modelValue", "value"])) : (a(), i("div", ee({
|
|
186
191
|
key: 4,
|
|
187
192
|
id: O(R)
|
|
188
193
|
}, t.$attrs, {
|
|
@@ -190,16 +195,17 @@ const de = { class: "whitespace-nowrap" }, se = ["id"], ce = {
|
|
|
190
195
|
ref: P,
|
|
191
196
|
class: ["group/input group-[.alert]:outline-orange group-[.error]:outline-red font-code peer relative w-full overflow-hidden text-xs leading-[1.44] whitespace-nowrap -outline-offset-1 has-[:focus-visible]:rounded-[4px] has-[:focus-visible]:outline", {
|
|
192
197
|
"line-wrapping has-[:focus-visible]:bg-b-1 has-[:focus-visible]:absolute has-[:focus-visible]:z-1": e.lineWrapping,
|
|
193
|
-
"flow-code-input--error": e.error
|
|
198
|
+
"flow-code-input--error": e.error,
|
|
199
|
+
"line-through": e.linethrough
|
|
194
200
|
}],
|
|
195
201
|
onKeydown: [
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
202
|
+
l[0] || (l[0] = h($((o) => m("down", o), ["stop"]), ["down"])),
|
|
203
|
+
l[1] || (l[1] = h((o) => m("enter", o), ["enter"])),
|
|
204
|
+
l[2] || (l[2] = h((o) => m("escape", o), ["escape"])),
|
|
205
|
+
l[3] || (l[3] = h($((o) => m("up", o), ["stop"]), ["up"]))
|
|
200
206
|
]
|
|
201
207
|
}), [
|
|
202
|
-
e.disableTabIndent ? c("", !0) : (
|
|
208
|
+
e.disableTabIndent ? c("", !0) : (a(), i("div", ce, [...l[5] || (l[5] = [
|
|
203
209
|
p(" Press ", -1),
|
|
204
210
|
V("kbd", { class: "-mx-0.25 rounded border px-0.5 font-mono" }, "Esc", -1),
|
|
205
211
|
p(" then ", -1),
|
|
@@ -207,21 +213,21 @@ const de = { class: "whitespace-nowrap" }, se = ["id"], ce = {
|
|
|
207
213
|
p(" to exit ", -1)
|
|
208
214
|
])]))
|
|
209
215
|
], 16, se)),
|
|
210
|
-
t.$slots.warning ? (
|
|
216
|
+
t.$slots.warning ? (a(), i("div", fe, [
|
|
211
217
|
I(t.$slots, "warning", {}, void 0, !0)
|
|
212
218
|
])) : c("", !0),
|
|
213
|
-
t.$slots.icon ? (
|
|
219
|
+
t.$slots.icon ? (a(), i("div", me, [
|
|
214
220
|
I(t.$slots, "icon", {}, void 0, !0)
|
|
215
221
|
])) : c("", !0),
|
|
216
|
-
e.required ? (
|
|
217
|
-
U.value && e.environment ? (
|
|
222
|
+
e.required ? (a(), i("div", ye, " Required ")) : c("", !0),
|
|
223
|
+
U.value && e.environment ? (a(), y(re, {
|
|
218
224
|
key: 8,
|
|
219
225
|
ref_key: "dropdownRef",
|
|
220
226
|
ref: x,
|
|
221
227
|
dropdownPosition: D.value,
|
|
222
228
|
environment: e.environment,
|
|
223
229
|
query: A.value,
|
|
224
|
-
onRedirect:
|
|
230
|
+
onRedirect: l[4] || (l[4] = (o) => u("redirectToEnvironment")),
|
|
225
231
|
onSelect: O(j)
|
|
226
232
|
}, null, 8, ["dropdownPosition", "environment", "query", "onSelect"])) : c("", !0)
|
|
227
233
|
], 64));
|