@scalar/api-reference 1.32.0 → 1.32.4
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 +83 -0
- package/README.md +1 -1
- package/dist/browser/standalone.js +15732 -15435
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
- package/dist/components/ApiReferenceLayout.vue.js +1 -1
- package/dist/components/ApiReferenceLayout.vue2.js +163 -158
- package/dist/components/Badge/Badge.vue.d.ts.map +1 -1
- package/dist/components/Badge/Badge.vue.js +1 -1
- package/dist/components/Card/CardHeader.vue.d.ts.map +1 -1
- package/dist/components/Card/CardHeader.vue.js +2 -2
- package/dist/components/Card/CardTab.vue.d.ts.map +1 -1
- package/dist/components/Card/CardTab.vue.js +3 -3
- package/dist/components/Card/CardTabHeader.vue.d.ts.map +1 -1
- package/dist/components/Card/CardTabHeader.vue.js +2 -2
- package/dist/components/Content/ClientLibraries/ClientLibraries.vue.js +1 -1
- package/dist/components/Content/ClientLibraries/ClientSelector.vue.js +1 -1
- package/dist/components/Content/Introduction/Introduction.vue.js +2 -2
- package/dist/components/Content/Lazy/Loading.vue.d.ts +1 -3
- package/dist/components/Content/Lazy/Loading.vue.d.ts.map +1 -1
- package/dist/components/Content/Lazy/Loading.vue.js +92 -91
- package/dist/components/Content/Models/Models.vue.d.ts.map +1 -1
- package/dist/components/Content/Models/Models.vue.js +2 -2
- package/dist/components/Content/Models/Models.vue2.js +59 -56
- package/dist/components/Content/Schema/RenderString.vue.d.ts +6 -0
- package/dist/components/Content/Schema/RenderString.vue.d.ts.map +1 -0
- package/dist/components/Content/Schema/RenderString.vue.js +14 -0
- package/dist/components/Content/Schema/RenderString.vue2.js +4 -0
- package/dist/components/Content/Schema/Schema.vue.d.ts +1 -1
- package/dist/components/Content/Schema/Schema.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/Schema.vue.js +2 -2
- package/dist/components/Content/Schema/Schema.vue2.js +76 -75
- package/dist/components/Content/Schema/SchemaComposition.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaComposition.vue.js +58 -66
- package/dist/components/Content/Schema/SchemaEnumValues.vue.d.ts +19 -0
- package/dist/components/Content/Schema/SchemaEnumValues.vue.d.ts.map +1 -0
- package/dist/components/Content/Schema/SchemaEnumValues.vue.js +7 -0
- package/dist/components/Content/Schema/SchemaEnumValues.vue2.js +125 -0
- package/dist/components/Content/Schema/SchemaProperty.vue.d.ts +2 -2
- package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaProperty.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaProperty.vue2.js +96 -170
- package/dist/components/Content/Schema/SchemaPropertyDescription.vue.d.ts +18 -0
- package/dist/components/Content/Schema/SchemaPropertyDescription.vue.d.ts.map +1 -0
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue2.js +155 -160
- package/dist/components/Content/Schema/helpers/get-schema-type.d.ts +6 -0
- package/dist/components/Content/Schema/helpers/get-schema-type.d.ts.map +1 -0
- package/dist/components/Content/Schema/helpers/get-schema-type.js +20 -0
- package/dist/components/Content/Schema/helpers/merge-all-of-schemas.js +1 -1
- package/dist/components/Content/Schema/helpers/optimizeValueForDisplay.d.ts.map +1 -1
- package/dist/components/Content/Schema/helpers/schema-name.d.ts.map +1 -1
- package/dist/components/Content/Schema/helpers/schema-name.js +20 -46
- package/dist/features/Operation/components/ParameterListItem.vue.js +3 -3
- package/dist/features/Operation/layouts/ModernLayout.vue.d.ts.map +1 -1
- package/dist/features/Operation/layouts/ModernLayout.vue.js +2 -2
- package/dist/features/Operation/layouts/ModernLayout.vue2.js +13 -13
- package/dist/features/Search/SearchButton.vue.d.ts +1 -0
- package/dist/features/Search/SearchButton.vue.d.ts.map +1 -1
- package/dist/features/Search/SearchButton.vue.js +36 -34
- package/dist/features/Search/SearchModal.vue.d.ts +1 -0
- package/dist/features/Search/SearchModal.vue.d.ts.map +1 -1
- package/dist/features/Search/SearchModal.vue.js +1 -1
- package/dist/features/Search/SearchModal.vue2.js +112 -112
- package/dist/features/Search/useSearchIndex.d.ts +4 -3
- package/dist/features/Search/useSearchIndex.d.ts.map +1 -1
- package/dist/features/Search/useSearchIndex.js +119 -82
- package/dist/features/api-client-modal/ApiClientModal.vue.d.ts +2 -2
- package/dist/features/api-client-modal/ApiClientModal.vue.d.ts.map +1 -1
- package/dist/features/api-client-modal/ApiClientModal.vue.js +47 -38
- package/dist/features/api-client-modal/useApiClient.d.ts +334 -334
- package/dist/features/api-client-modal/useApiClient.d.ts.map +1 -1
- package/dist/features/base-url/BaseUrl.vue.js +1 -1
- package/dist/features/example-responses/ExampleResponse.vue.js +3 -3
- package/dist/features/example-responses/ExampleResponse.vue2.js +7 -7
- package/dist/features/example-responses/ExampleResponses.vue.d.ts +1 -1
- package/dist/features/example-responses/ExampleResponses.vue.d.ts.map +1 -1
- package/dist/features/example-responses/ExampleResponses.vue.js +2 -2
- package/dist/features/sidebar/components/SidebarElement.vue.d.ts.map +1 -1
- package/dist/features/sidebar/components/SidebarElement.vue.js +1 -1
- package/dist/features/sidebar/components/SidebarElement.vue2.js +23 -21
- package/dist/features/sidebar/components/SidebarHttpBadge.vue.d.ts.map +1 -1
- package/dist/features/sidebar/components/SidebarHttpBadge.vue.js +2 -2
- package/dist/features/sidebar/components/SidebarHttpBadge.vue2.js +5 -6
- package/dist/features/test-request-button/TestRequestButton.vue.js +2 -2
- package/dist/features/traverse-schema/helpers/traverse-tags.js +26 -26
- package/dist/features/traverse-schema/index.d.ts +1 -1
- package/dist/features/traverse-schema/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/libs/openapi.d.ts +15 -1
- package/dist/libs/openapi.d.ts.map +1 -1
- package/dist/libs/openapi.js +66 -47
- package/dist/standalone/lib/html-api.d.ts.map +1 -1
- package/dist/stores/useHttpClientStore.js +2 -2
- package/dist/style.css +1 -1
- package/dist/types.d.ts +3 -3
- package/dist/v2/blocks/scalar-request-example-block/components/RequestExample.vue.d.ts +2 -2
- package/package.json +18 -18
- package/dist/hooks/useOperation.d.ts +0 -16
- package/dist/hooks/useOperation.d.ts.map +0 -1
- package/dist/hooks/useOperation.js +0 -27
|
@@ -3,12 +3,12 @@ import { ScalarMarkdown as D, ScalarErrorBoundary as p } from "@scalar/component
|
|
|
3
3
|
import { ScalarIconWebhooksLogo as L } from "@scalar/icons";
|
|
4
4
|
import P from "../../../components/OperationPath.vue.js";
|
|
5
5
|
import { useConfig as R } from "../../../hooks/useConfig.js";
|
|
6
|
-
import { getOperationStability as C, getOperationStabilityColor as $, isOperationDeprecated as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
6
|
+
import { getOperationStability as C, getOperationStabilityColor as $, isOperationDeprecated as z } from "../../../libs/openapi.js";
|
|
7
|
+
import A from "../components/callbacks/Callbacks.vue.js";
|
|
8
|
+
import H from "../components/OperationParameters.vue.js";
|
|
9
|
+
import M from "../components/OperationResponses.vue.js";
|
|
10
|
+
import U from "../../../components/Section/Section.vue.js";
|
|
11
|
+
import j from "../../../components/Section/SectionContent.vue.js";
|
|
12
12
|
import B from "../../../components/Badge/Badge.vue.js";
|
|
13
13
|
import F from "../../../components/Section/SectionHeader.vue.js";
|
|
14
14
|
import G from "../../../components/Anchor/Anchor.vue.js";
|
|
@@ -39,20 +39,20 @@ const Z = { class: "operation-details" }, _ = { class: "examples" }, ke = /* @__
|
|
|
39
39
|
}), T = w, c = O(), E = R(), f = (e) => {
|
|
40
40
|
T("update:modelValue", e);
|
|
41
41
|
};
|
|
42
|
-
return (e, h) => (s(), l(o(
|
|
42
|
+
return (e, h) => (s(), l(o(U), {
|
|
43
43
|
id: e.id,
|
|
44
44
|
"aria-labelledby": o(c),
|
|
45
45
|
label: u.value,
|
|
46
46
|
tabindex: "-1"
|
|
47
47
|
}, {
|
|
48
48
|
default: r(() => [
|
|
49
|
-
a(o(
|
|
49
|
+
a(o(j), {
|
|
50
50
|
loading: o(E).isLoading
|
|
51
51
|
}, {
|
|
52
52
|
default: r(() => [
|
|
53
53
|
o(C)(e.operation) ? (s(), l(o(B), {
|
|
54
54
|
key: 0,
|
|
55
|
-
class: S(o($)(e.operation))
|
|
55
|
+
class: S(["capitalize", o($)(e.operation)])
|
|
56
56
|
}, {
|
|
57
57
|
default: r(() => [
|
|
58
58
|
m(q(o(C)(e.operation)), 1)
|
|
@@ -70,7 +70,7 @@ const Z = { class: "operation-details" }, _ = { class: "examples" }, ke = /* @__
|
|
|
70
70
|
_: 1
|
|
71
71
|
})) : i("", !0),
|
|
72
72
|
n("div", {
|
|
73
|
-
class: S(o(
|
|
73
|
+
class: S(o(z)(e.operation) ? "deprecated" : "")
|
|
74
74
|
}, [
|
|
75
75
|
a(o(F), null, {
|
|
76
76
|
default: r(() => [
|
|
@@ -106,13 +106,13 @@ const Z = { class: "operation-details" }, _ = { class: "examples" }, ke = /* @__
|
|
|
106
106
|
transformType: "heading",
|
|
107
107
|
anchorPrefix: e.id
|
|
108
108
|
}, null, 8, ["value", "anchorPrefix"]),
|
|
109
|
-
a(
|
|
109
|
+
a(H, {
|
|
110
110
|
parameters: (b = e.operation) == null ? void 0 : b.parameters,
|
|
111
111
|
requestBody: (y = e.operation) == null ? void 0 : y.requestBody,
|
|
112
112
|
schemas: e.schemas,
|
|
113
113
|
"onUpdate:modelValue": f
|
|
114
114
|
}, null, 8, ["parameters", "requestBody", "schemas"]),
|
|
115
|
-
a(
|
|
115
|
+
a(M, {
|
|
116
116
|
responses: (g = e.operation) == null ? void 0 : g.responses,
|
|
117
117
|
schemas: e.schemas
|
|
118
118
|
}, null, 8, ["responses", "schemas"]),
|
|
@@ -120,7 +120,7 @@ const Z = { class: "operation-details" }, _ = { class: "examples" }, ke = /* @__
|
|
|
120
120
|
default: r(() => {
|
|
121
121
|
var k, v;
|
|
122
122
|
return [
|
|
123
|
-
(k = e.operation) != null && k.callbacks ? (s(), l(
|
|
123
|
+
(k = e.operation) != null && k.callbacks ? (s(), l(A, {
|
|
124
124
|
key: 0,
|
|
125
125
|
callbacks: (v = e.operation) == null ? void 0 : v.callbacks,
|
|
126
126
|
collection: e.collection,
|
|
@@ -2,6 +2,7 @@ import type { Spec } from '@scalar/types/legacy';
|
|
|
2
2
|
type __VLS_Props = {
|
|
3
3
|
spec: Spec;
|
|
4
4
|
searchHotKey?: string;
|
|
5
|
+
hideModels?: boolean;
|
|
5
6
|
};
|
|
6
7
|
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
8
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchButton.vue.d.ts","sourceRoot":"","sources":["../../../src/features/Search/SearchButton.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SearchButton.vue.d.ts","sourceRoot":"","sources":["../../../src/features/Search/SearchButton.vue"],"names":[],"mappings":"AAmFA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAQhD,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,IAAI,CAAA;IACV,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,CAAC;;AAiJF,wBAMG"}
|
|
@@ -1,63 +1,65 @@
|
|
|
1
|
-
import { defineComponent as k, ref as w, watch as
|
|
2
|
-
import { useModal as
|
|
1
|
+
import { defineComponent as k, ref as w, watch as M, nextTick as C, onMounted as v, onBeforeUnmount as B, createElementBlock as n, openBlock as r, Fragment as s, createVNode as u, unref as l, normalizeClass as K, withCtx as c, createElementVNode as a, createTextVNode as m, toDisplayString as b } from "vue";
|
|
2
|
+
import { useModal as E, ScalarSidebarSearchButton as H } from "@scalar/components";
|
|
3
3
|
import { isMacOS as f } from "@scalar/helpers/general/is-mac-os";
|
|
4
4
|
import g from "./SearchModal.vue.js";
|
|
5
5
|
import { useApiClient as L } from "../api-client-modal/useApiClient.js";
|
|
6
|
-
const
|
|
6
|
+
const $ = /* @__PURE__ */ k({
|
|
7
7
|
__name: "SearchButton",
|
|
8
8
|
props: {
|
|
9
9
|
spec: {},
|
|
10
|
-
searchHotKey: { default: "k" }
|
|
10
|
+
searchHotKey: { default: "k" },
|
|
11
|
+
hideModels: { type: Boolean, default: !1 }
|
|
11
12
|
},
|
|
12
|
-
setup(
|
|
13
|
-
const
|
|
13
|
+
setup(h) {
|
|
14
|
+
const d = w(), t = E(), { client: y } = L(), i = (o) => {
|
|
14
15
|
var e;
|
|
15
|
-
(f() ?
|
|
16
|
+
(f() ? o.metaKey : o.ctrlKey) && o.key === h.searchHotKey && !((e = y.value) != null && e.modalState.open) && (o.preventDefault(), o.stopPropagation(), t.open ? t.hide() : t.show());
|
|
16
17
|
};
|
|
17
|
-
|
|
18
|
-
() =>
|
|
19
|
-
(
|
|
20
|
-
!
|
|
18
|
+
M(
|
|
19
|
+
() => t.open,
|
|
20
|
+
(o, e) => {
|
|
21
|
+
!o && e && C(() => {
|
|
21
22
|
var p;
|
|
22
|
-
(p =
|
|
23
|
+
(p = d.value) == null || p.$el.focus();
|
|
23
24
|
});
|
|
24
25
|
}
|
|
25
|
-
),
|
|
26
|
-
function
|
|
27
|
-
|
|
26
|
+
), v(() => window.addEventListener("keydown", i)), B(() => window.removeEventListener("keydown", i));
|
|
27
|
+
function S() {
|
|
28
|
+
t.show();
|
|
28
29
|
}
|
|
29
|
-
return (
|
|
30
|
-
|
|
30
|
+
return (o, e) => (r(), n(s, null, [
|
|
31
|
+
u(l(H), {
|
|
31
32
|
ref_key: "button",
|
|
32
|
-
ref:
|
|
33
|
-
class:
|
|
34
|
-
onClick:
|
|
33
|
+
ref: d,
|
|
34
|
+
class: K(["w-full", o.$attrs.class]),
|
|
35
|
+
onClick: S
|
|
35
36
|
}, {
|
|
36
|
-
shortcut:
|
|
37
|
-
l(f)() ? (r(),
|
|
37
|
+
shortcut: c(() => [
|
|
38
|
+
l(f)() ? (r(), n(s, { key: 0 }, [
|
|
38
39
|
m("⌘")
|
|
39
|
-
], 64)) : (r(),
|
|
40
|
-
e[0] || (e[0] =
|
|
41
|
-
e[1] || (e[1] =
|
|
40
|
+
], 64)) : (r(), n(s, { key: 1 }, [
|
|
41
|
+
e[0] || (e[0] = a("span", { class: "sr-only" }, "CTRL", -1)),
|
|
42
|
+
e[1] || (e[1] = a("span", { "aria-hidden": "true" }, "⌃", -1))
|
|
42
43
|
], 64)),
|
|
43
|
-
m(" " +
|
|
44
|
+
m(" " + b(o.searchHotKey), 1)
|
|
44
45
|
]),
|
|
45
|
-
default:
|
|
46
|
-
e[2] || (e[2] =
|
|
47
|
-
e[3] || (e[3] =
|
|
46
|
+
default: c(() => [
|
|
47
|
+
e[2] || (e[2] = a("span", { class: "sr-only" }, "Open Search", -1)),
|
|
48
|
+
e[3] || (e[3] = a("span", {
|
|
48
49
|
"aria-hidden": "true",
|
|
49
50
|
class: "sidebar-search-placeholder"
|
|
50
51
|
}, " Search ", -1))
|
|
51
52
|
]),
|
|
52
53
|
_: 1
|
|
53
54
|
}, 8, ["class"]),
|
|
54
|
-
|
|
55
|
-
modalState: l(
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
u(g, {
|
|
56
|
+
modalState: l(t),
|
|
57
|
+
hideModels: o.hideModels,
|
|
58
|
+
parsedSpec: o.spec
|
|
59
|
+
}, null, 8, ["modalState", "hideModels", "parsedSpec"])
|
|
58
60
|
], 64));
|
|
59
61
|
}
|
|
60
62
|
});
|
|
61
63
|
export {
|
|
62
|
-
|
|
64
|
+
$ as default
|
|
63
65
|
};
|
|
@@ -3,6 +3,7 @@ import type { Spec } from '@scalar/types/legacy';
|
|
|
3
3
|
type __VLS_Props = {
|
|
4
4
|
parsedSpec: Spec;
|
|
5
5
|
modalState: ModalState;
|
|
6
|
+
hideModels: boolean;
|
|
6
7
|
};
|
|
7
8
|
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
8
9
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchModal.vue.d.ts","sourceRoot":"","sources":["../../../src/features/Search/SearchModal.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SearchModal.vue.d.ts","sourceRoot":"","sources":["../../../src/features/Search/SearchModal.vue"],"names":[],"mappings":"AA8SA,OAAO,EAKL,KAAK,UAAU,EAChB,MAAM,oBAAoB,CAAA;AAU3B,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAgBhD,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,IAAI,CAAA;IAChB,UAAU,EAAE,UAAU,CAAA;IACtB,UAAU,EAAE,OAAO,CAAA;CACpB,CAAC;;AA8ZF,wBAOG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./SearchModal.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-
|
|
4
|
+
const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-92d07cc9"]]);
|
|
5
5
|
export {
|
|
6
6
|
m as default
|
|
7
7
|
};
|
|
@@ -1,154 +1,156 @@
|
|
|
1
|
-
import { defineComponent as Y, toRef as
|
|
2
|
-
import { ScalarModal as Z, ScalarSearchInput as
|
|
1
|
+
import { defineComponent as Y, toRef as _, ref as j, watch as M, createBlock as $, openBlock as p, unref as n, withCtx as i, createElementVNode as a, createVNode as g, withKeys as I, withModifiers as b, isRef as G, createElementBlock as R, Fragment as w, renderList as J, createSlots as Q, normalizeClass as X, createTextVNode as c, createCommentVNode as E, toDisplayString as d } from "vue";
|
|
2
|
+
import { ScalarModal as Z, ScalarSearchInput as ee, ScalarSearchResultList as te, ScalarSearchResultItem as oe } from "@scalar/components";
|
|
3
|
+
import { isDefined as ae } from "@scalar/helpers/array/is-defined";
|
|
3
4
|
import { scrollToId as N } from "@scalar/helpers/dom/scroll-to-id";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
|
|
5
|
+
import { ScalarIconTerminalWindow as L, ScalarIconTag as se, ScalarIconBracketsCurly as ne, ScalarIconTextAlignLeft as re } from "@scalar/icons";
|
|
6
|
+
import { nanoid as le } from "nanoid";
|
|
7
|
+
import { lazyBus as ie } from "../../components/Content/Lazy/lazyBus.js";
|
|
8
|
+
import { useSearchIndex as ce } from "./useSearchIndex.js";
|
|
9
|
+
import de from "../sidebar/components/SidebarHttpBadge.vue.js";
|
|
10
|
+
import { useSidebar as me } from "../sidebar/hooks/useSidebar.js";
|
|
11
|
+
const ue = { class: "sr-only" }, pe = { class: "inline-flex items-center gap-1" }, fe = { class: "sr-only" }, Be = /* @__PURE__ */ Y({
|
|
10
12
|
__name: "SearchModal",
|
|
11
13
|
props: {
|
|
12
14
|
parsedSpec: {},
|
|
13
|
-
modalState: {}
|
|
15
|
+
modalState: {},
|
|
16
|
+
hideModels: { type: Boolean }
|
|
14
17
|
},
|
|
15
|
-
setup(
|
|
16
|
-
const m =
|
|
17
|
-
resetSearch:
|
|
18
|
-
fuseSearch:
|
|
18
|
+
setup(q) {
|
|
19
|
+
const m = q, D = _(m, "parsedSpec"), S = le(), k = `${S}-search-result`, x = `${S}-search-instructions`, v = (o) => `${S}${o}`, {
|
|
20
|
+
resetSearch: F,
|
|
21
|
+
fuseSearch: H,
|
|
19
22
|
selectedSearchIndex: r,
|
|
20
|
-
selectedSearchResult:
|
|
23
|
+
selectedSearchResult: B,
|
|
21
24
|
searchResultsWithPlaceholderResults: u,
|
|
22
|
-
searchText:
|
|
23
|
-
} =
|
|
24
|
-
specification:
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
searchText: f
|
|
26
|
+
} = ce({
|
|
27
|
+
specification: D,
|
|
28
|
+
hideModels: m.hideModels
|
|
29
|
+
}), P = {
|
|
30
|
+
heading: re,
|
|
31
|
+
model: ne,
|
|
32
|
+
req: L,
|
|
33
|
+
tag: se,
|
|
34
|
+
webhook: L
|
|
35
|
+
}, U = {
|
|
32
36
|
heading: "Document Heading",
|
|
33
37
|
req: "Request",
|
|
34
38
|
tag: "Tag",
|
|
35
|
-
model: "",
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}, H = W(null);
|
|
40
|
-
x(
|
|
39
|
+
model: "Model",
|
|
40
|
+
webhook: "Webhook"
|
|
41
|
+
}, K = j(null);
|
|
42
|
+
M(
|
|
41
43
|
() => m.modalState.open,
|
|
42
44
|
(o) => {
|
|
43
|
-
o &&
|
|
45
|
+
o && F();
|
|
44
46
|
}
|
|
45
47
|
);
|
|
46
|
-
const { setCollapsedSidebarItem:
|
|
47
|
-
function
|
|
48
|
+
const { setCollapsedSidebarItem: W } = me(), z = /#(tag\/[^/]*)/;
|
|
49
|
+
function T(o) {
|
|
48
50
|
let t = "models";
|
|
49
|
-
const e = o.item.href.match(
|
|
50
|
-
e != null && e.length && e.length > 1 && (t = e[1]),
|
|
51
|
-
const
|
|
52
|
-
if (document.getElementById(
|
|
53
|
-
N(
|
|
51
|
+
const e = o.item.href.match(z);
|
|
52
|
+
e != null && e.length && e.length > 1 && (t = e[1]), W(t, !0);
|
|
53
|
+
const s = o.item.href.replace("#", "");
|
|
54
|
+
if (document.getElementById(s))
|
|
55
|
+
N(s), m.modalState.hide();
|
|
54
56
|
else {
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
+
const l = ie.on((h) => {
|
|
58
|
+
h.id === s && (N(s), l(), m.modalState.hide());
|
|
57
59
|
});
|
|
58
60
|
}
|
|
59
61
|
}
|
|
60
|
-
|
|
61
|
-
var
|
|
62
|
+
M(r, (o) => {
|
|
63
|
+
var s;
|
|
62
64
|
if (typeof o != "number")
|
|
63
65
|
return;
|
|
64
66
|
const t = u.value[o], e = v(t == null ? void 0 : t.item.href);
|
|
65
|
-
(
|
|
67
|
+
(s = document.getElementById(e)) == null || s.scrollIntoView({
|
|
66
68
|
behavior: "smooth",
|
|
67
69
|
block: "nearest"
|
|
68
70
|
});
|
|
69
71
|
});
|
|
70
|
-
const
|
|
72
|
+
const V = (o) => {
|
|
71
73
|
const t = o === "up" ? -1 : 1, e = u.value.length;
|
|
72
74
|
if (typeof r.value == "number") {
|
|
73
|
-
const
|
|
74
|
-
r.value =
|
|
75
|
+
const s = (r.value + t + e) % e;
|
|
76
|
+
r.value = s;
|
|
75
77
|
} else
|
|
76
78
|
r.value = t === -1 ? e - 1 : 0;
|
|
77
79
|
};
|
|
78
|
-
function
|
|
80
|
+
function A(o) {
|
|
79
81
|
const t = new URL(window.location.href);
|
|
80
82
|
return t.hash = o, t.toString();
|
|
81
83
|
}
|
|
82
84
|
function O() {
|
|
83
|
-
if (!r.value)
|
|
85
|
+
if (!ae(r.value))
|
|
84
86
|
return;
|
|
85
87
|
const o = u.value;
|
|
86
|
-
|
|
88
|
+
T(o[r.value]);
|
|
87
89
|
}
|
|
88
|
-
return (o, t) => (
|
|
90
|
+
return (o, t) => (p(), $(n(Z), {
|
|
89
91
|
"aria-label": "Reference Search",
|
|
90
92
|
state: o.modalState,
|
|
91
93
|
variant: "search"
|
|
92
94
|
}, {
|
|
93
|
-
default:
|
|
94
|
-
|
|
95
|
+
default: i(() => [
|
|
96
|
+
a("div", {
|
|
95
97
|
ref_key: "searchModalRef",
|
|
96
|
-
ref:
|
|
98
|
+
ref: K,
|
|
97
99
|
class: "ref-search-container",
|
|
98
100
|
role: "search"
|
|
99
101
|
}, [
|
|
100
|
-
g(
|
|
101
|
-
modelValue:
|
|
102
|
-
"onUpdate:modelValue": t[0] || (t[0] = (e) =>
|
|
103
|
-
"aria-activedescendant":
|
|
102
|
+
g(n(ee), {
|
|
103
|
+
modelValue: n(f),
|
|
104
|
+
"onUpdate:modelValue": t[0] || (t[0] = (e) => G(f) ? f.value = e : null),
|
|
105
|
+
"aria-activedescendant": n(B) ? v(n(B).item.href) : void 0,
|
|
104
106
|
"aria-autocomplete": "list",
|
|
105
|
-
"aria-controls":
|
|
106
|
-
"aria-describedby":
|
|
107
|
+
"aria-controls": k,
|
|
108
|
+
"aria-describedby": x,
|
|
107
109
|
role: "combobox",
|
|
108
110
|
onBlur: t[1] || (t[1] = (e) => r.value = void 0),
|
|
109
|
-
onInput:
|
|
111
|
+
onInput: n(H),
|
|
110
112
|
onKeydown: [
|
|
111
|
-
t[2] || (t[2] = b(
|
|
112
|
-
b(
|
|
113
|
-
t[3] || (t[3] = b(
|
|
113
|
+
t[2] || (t[2] = I(b((e) => V("down"), ["stop", "prevent"]), ["down"])),
|
|
114
|
+
I(b(O, ["stop", "prevent"]), ["enter"]),
|
|
115
|
+
t[3] || (t[3] = I(b((e) => V("up"), ["stop", "prevent"]), ["up"]))
|
|
114
116
|
]
|
|
115
117
|
}, null, 8, ["modelValue", "aria-activedescendant", "onInput", "onKeydown"])
|
|
116
118
|
], 512),
|
|
117
|
-
g(
|
|
118
|
-
id:
|
|
119
|
+
g(n(te), {
|
|
120
|
+
id: k,
|
|
119
121
|
"aria-label": "Reference Search Results",
|
|
120
122
|
class: "ref-search-results custom-scroll",
|
|
121
|
-
noResults: !
|
|
123
|
+
noResults: !n(u).length
|
|
122
124
|
}, {
|
|
123
|
-
query:
|
|
124
|
-
d(
|
|
125
|
+
query: i(() => [
|
|
126
|
+
c(d(n(f)), 1)
|
|
125
127
|
]),
|
|
126
|
-
default:
|
|
127
|
-
(
|
|
128
|
+
default: i(() => [
|
|
129
|
+
(p(!0), R(w, null, J(n(u), (e, s) => (p(), $(n(oe), {
|
|
128
130
|
id: v(e.item.href),
|
|
129
131
|
key: e.refIndex,
|
|
130
|
-
href:
|
|
131
|
-
icon:
|
|
132
|
-
selected:
|
|
133
|
-
onClick: (
|
|
134
|
-
onFocus: (
|
|
135
|
-
},
|
|
136
|
-
default:
|
|
137
|
-
var
|
|
132
|
+
href: A(e.item.href),
|
|
133
|
+
icon: P[e.item.type],
|
|
134
|
+
selected: n(r) === s,
|
|
135
|
+
onClick: (l) => T(e),
|
|
136
|
+
onFocus: (l) => r.value = s
|
|
137
|
+
}, Q({
|
|
138
|
+
default: i(() => {
|
|
139
|
+
var l, h, y, C;
|
|
138
140
|
return [
|
|
139
|
-
|
|
140
|
-
class:
|
|
141
|
-
deprecated: (
|
|
141
|
+
a("span", {
|
|
142
|
+
class: X({
|
|
143
|
+
deprecated: (h = (l = e.item.operation) == null ? void 0 : l.information) == null ? void 0 : h.deprecated
|
|
142
144
|
})
|
|
143
145
|
}, [
|
|
144
|
-
|
|
145
|
-
d(
|
|
146
|
-
(
|
|
147
|
-
|
|
148
|
-
], 64)) :
|
|
146
|
+
a("span", ue, [
|
|
147
|
+
c(d(U[e.item.type]) + ": ", 1),
|
|
148
|
+
(C = (y = e.item.operation) == null ? void 0 : y.information) != null && C.deprecated ? (p(), R(w, { key: 0 }, [
|
|
149
|
+
c(" (Deprecated) ")
|
|
150
|
+
], 64)) : E("", !0)
|
|
149
151
|
]),
|
|
150
|
-
|
|
151
|
-
t[4] || (t[4] =
|
|
152
|
+
c(" " + d(e.item.title) + " ", 1),
|
|
153
|
+
t[4] || (t[4] = a("span", { class: "sr-only" }, ",", -1))
|
|
152
154
|
], 2)
|
|
153
155
|
];
|
|
154
156
|
}),
|
|
@@ -156,46 +158,44 @@ const le = { class: "sr-only" }, ie = { class: "sr-only" }, ve = /* @__PURE__ */
|
|
|
156
158
|
}, [
|
|
157
159
|
e.item.type !== "webhook" && (e.item.httpVerb || e.item.path) && e.item.path !== e.item.title ? {
|
|
158
160
|
name: "description",
|
|
159
|
-
fn:
|
|
160
|
-
|
|
161
|
-
|
|
161
|
+
fn: i(() => [
|
|
162
|
+
a("span", pe, [
|
|
163
|
+
e.item.type === "req" ? (p(), R(w, { key: 0 }, [
|
|
164
|
+
g(de, {
|
|
165
|
+
"aria-hidden": "true",
|
|
166
|
+
method: e.item.httpVerb ?? "get"
|
|
167
|
+
}, null, 8, ["method"]),
|
|
168
|
+
a("span", fe, " HTTP Method: " + d(e.item.httpVerb ?? "get"), 1)
|
|
169
|
+
], 64)) : E("", !0),
|
|
170
|
+
t[5] || (t[5] = a("span", { class: "sr-only" }, "Path: ", -1)),
|
|
171
|
+
c(" " + d(e.item.path), 1)
|
|
172
|
+
])
|
|
162
173
|
]),
|
|
163
174
|
key: "0"
|
|
164
175
|
} : e.item.description ? {
|
|
165
176
|
name: "description",
|
|
166
|
-
fn:
|
|
167
|
-
t[6] || (t[6] =
|
|
168
|
-
|
|
177
|
+
fn: i(() => [
|
|
178
|
+
t[6] || (t[6] = a("span", { class: "sr-only" }, "Description: ", -1)),
|
|
179
|
+
c(" " + d(e.item.description), 1)
|
|
169
180
|
]),
|
|
170
181
|
key: "1"
|
|
171
|
-
} : void 0,
|
|
172
|
-
e.item.type === "req" ? {
|
|
173
|
-
name: "addon",
|
|
174
|
-
fn: l(() => [
|
|
175
|
-
g(ne, {
|
|
176
|
-
"aria-hidden": "true",
|
|
177
|
-
method: e.item.httpVerb ?? "get"
|
|
178
|
-
}, null, 8, ["method"]),
|
|
179
|
-
n("span", ie, " HTTP Method: " + c(e.item.httpVerb ?? "get") + ", ", 1)
|
|
180
|
-
]),
|
|
181
|
-
key: "2"
|
|
182
182
|
} : void 0
|
|
183
183
|
]), 1032, ["id", "href", "icon", "selected", "onClick", "onFocus"]))), 128))
|
|
184
184
|
]),
|
|
185
185
|
_: 1
|
|
186
186
|
}, 8, ["noResults"]),
|
|
187
|
-
|
|
188
|
-
id:
|
|
187
|
+
a("div", {
|
|
188
|
+
id: x,
|
|
189
189
|
class: "ref-search-meta"
|
|
190
190
|
}, t[7] || (t[7] = [
|
|
191
|
-
|
|
191
|
+
a("span", {
|
|
192
192
|
"aria-hidden": "true",
|
|
193
193
|
class: "contents"
|
|
194
194
|
}, [
|
|
195
|
-
|
|
196
|
-
|
|
195
|
+
a("span", null, "↑↓ Navigate"),
|
|
196
|
+
a("span", null, "⏎ Select")
|
|
197
197
|
], -1),
|
|
198
|
-
|
|
198
|
+
a("span", { class: "sr-only" }, " Press up arrow / down arrow to navigate, enter to select, type to filter results ", -1)
|
|
199
199
|
]))
|
|
200
200
|
]),
|
|
201
201
|
_: 1
|
|
@@ -203,5 +203,5 @@ const le = { class: "sr-only" }, ie = { class: "sr-only" }, ve = /* @__PURE__ */
|
|
|
203
203
|
}
|
|
204
204
|
});
|
|
205
205
|
export {
|
|
206
|
-
|
|
206
|
+
Be as default
|
|
207
207
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { type ParameterMap } from '../../libs/openapi.js';
|
|
1
2
|
import type { Spec, TransformedOperation } from '@scalar/types/legacy';
|
|
2
3
|
import { type FuseResult } from 'fuse.js';
|
|
3
4
|
import { type Ref } from 'vue';
|
|
4
|
-
import { type ParamMap } from '../../hooks/useOperation.js';
|
|
5
5
|
export type EntryType = 'req' | 'webhook' | 'model' | 'heading' | 'tag';
|
|
6
6
|
export type FuseData = {
|
|
7
7
|
title: string;
|
|
@@ -9,7 +9,7 @@ export type FuseData = {
|
|
|
9
9
|
type: EntryType;
|
|
10
10
|
operationId?: string;
|
|
11
11
|
description: string;
|
|
12
|
-
body?: string | string[] |
|
|
12
|
+
body?: string | string[] | ParameterMap;
|
|
13
13
|
httpVerb?: string;
|
|
14
14
|
path?: string;
|
|
15
15
|
tag?: string;
|
|
@@ -18,8 +18,9 @@ export type FuseData = {
|
|
|
18
18
|
/**
|
|
19
19
|
* Creates the search index from an OpenAPI document.
|
|
20
20
|
*/
|
|
21
|
-
export declare function useSearchIndex({ specification, }: {
|
|
21
|
+
export declare function useSearchIndex({ specification, hideModels, }: {
|
|
22
22
|
specification: Ref<Spec>;
|
|
23
|
+
hideModels?: boolean;
|
|
23
24
|
}): {
|
|
24
25
|
resetSearch: () => void;
|
|
25
26
|
fuseSearch: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSearchIndex.d.ts","sourceRoot":"","sources":["../../../src/features/Search/useSearchIndex.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useSearchIndex.d.ts","sourceRoot":"","sources":["../../../src/features/Search/useSearchIndex.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAAqD,MAAM,gBAAgB,CAAA;AAErG,OAAO,KAAK,EAAe,IAAI,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AACnF,OAAa,EAAE,KAAK,UAAU,EAAE,MAAM,SAAS,CAAA;AAC/C,OAAO,EAAE,KAAK,GAAG,EAAwB,MAAM,KAAK,CAAA;AAIpD,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,KAAK,CAAA;AAEvE,MAAM,MAAM,QAAQ,GAAG;IACrB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,SAAS,CAAA;IACf,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,WAAW,EAAE,MAAM,CAAA;IACnB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,YAAY,CAAA;IACvC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,SAAS,CAAC,EAAE,oBAAoB,CAAA;CACjC,CAAA;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,EAC7B,aAAa,EACb,UAAkB,GACnB,EAAE;IACD,aAAa,EAAE,GAAG,CAAC,IAAI,CAAC,CAAA;IACxB,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB;uBAsEyB,IAAI;sBAbL,IAAI;;;;;EAoM5B"}
|