@scalar/api-reference 1.35.7 → 1.36.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 +23 -0
- package/dist/browser/standalone.js +7953 -7994
- 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 +148 -150
- package/dist/components/Content/Content.vue.d.ts.map +1 -1
- package/dist/components/Content/Content.vue.js +44 -51
- package/dist/components/Content/Models/ClassicLayout.vue.d.ts +2 -1
- package/dist/components/Content/Models/ClassicLayout.vue.d.ts.map +1 -1
- package/dist/components/Content/Models/ClassicLayout.vue.js +2 -2
- package/dist/components/Content/Models/ClassicLayout.vue2.js +31 -33
- package/dist/components/Content/Models/Models.vue.d.ts +2 -2
- package/dist/components/Content/Models/Models.vue.d.ts.map +1 -1
- package/dist/components/Content/Models/Models.vue.js +24 -23
- package/dist/components/Content/Models/ModernLayout.vue.d.ts +1 -0
- package/dist/components/Content/Models/ModernLayout.vue.d.ts.map +1 -1
- package/dist/components/Content/Models/ModernLayout.vue.js +2 -2
- package/dist/components/Content/Models/ModernLayout.vue2.js +40 -41
- package/dist/components/Content/Operations/TraversedEntry.vue.d.ts +1 -2
- package/dist/components/Content/Operations/TraversedEntry.vue.d.ts.map +1 -1
- package/dist/components/Content/Operations/TraversedEntry.vue.js +24 -24
- package/dist/components/Content/Operations/TraversedEntryContainer.vue.d.ts.map +1 -1
- package/dist/components/Content/Operations/TraversedEntryContainer.vue.js +1 -1
- package/dist/components/Content/Operations/get-current-index.d.ts +1 -1
- package/dist/components/Content/Operations/get-current-index.d.ts.map +1 -1
- package/dist/components/Content/Operations/get-current-index.js +1 -1
- package/dist/components/Content/Schema/SchemaObjectProperties.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaObjectProperties.vue.js +35 -45
- package/dist/components/Content/Schema/SchemaProperty.vue.d.ts +1 -1
- package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/helpers/sort-property-names.d.ts +16 -0
- package/dist/components/Content/Schema/helpers/sort-property-names.d.ts.map +1 -0
- package/dist/components/Content/Schema/helpers/sort-property-names.js +36 -0
- package/dist/components/Content/Tags/ClassicLayout.vue.d.ts +1 -1
- package/dist/components/Content/Tags/ClassicLayout.vue.d.ts.map +1 -1
- package/dist/components/Content/Tags/ClassicLayout.vue.js +2 -2
- package/dist/components/Content/Tags/ClassicLayout.vue2.js +1 -1
- package/dist/components/Content/Tags/ModernLayout.vue.d.ts +1 -1
- package/dist/components/Content/Tags/ModernLayout.vue.d.ts.map +1 -1
- package/dist/components/Content/Tags/ModernLayout.vue.js +2 -2
- package/dist/components/Content/Tags/ModernLayout.vue2.js +2 -2
- package/dist/components/Content/Tags/Tag.vue.d.ts +1 -1
- package/dist/components/Content/Tags/Tag.vue.d.ts.map +1 -1
- package/dist/components/Content/Tags/TagSection.vue.d.ts +1 -1
- package/dist/components/Content/Tags/TagSection.vue.d.ts.map +1 -1
- package/dist/components/Content/Tags/TagSection.vue.js +4 -4
- package/dist/components/MobileHeader.vue.js +2 -2
- package/dist/components/MobileHeader.vue2.js +1 -1
- package/dist/components/OperationsList/OperationsList.vue.d.ts +1 -1
- package/dist/components/OperationsList/OperationsList.vue.d.ts.map +1 -1
- package/dist/components/OperationsList/OperationsList.vue.js +1 -1
- package/dist/components/OperationsList/OperationsList.vue2.js +9 -11
- package/dist/components/OperationsList/OperationsListItem.vue.d.ts +1 -1
- package/dist/components/OperationsList/OperationsListItem.vue.d.ts.map +1 -1
- package/dist/components/OperationsList/OperationsListItem.vue.js +2 -2
- package/dist/components/OperationsList/OperationsListItem.vue2.js +24 -27
- package/dist/components/Section/Section.vue.d.ts.map +1 -1
- package/dist/components/Section/Section.vue.js +2 -2
- package/dist/components/Section/Section.vue2.js +12 -13
- package/dist/components/Section/SectionAccordion.vue.d.ts.map +1 -1
- package/dist/components/Section/SectionAccordion.vue.js +1 -1
- package/dist/components/Section/SectionAccordion.vue2.js +36 -37
- package/dist/components/ShowMoreButton.vue.js +2 -2
- package/dist/components/ShowMoreButton.vue2.js +3 -3
- package/dist/features/Operation/Operation.vue.d.ts.map +1 -1
- package/dist/features/Operation/Operation.vue.js +32 -22
- package/dist/features/Operation/components/RequestBody.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/RequestBody.vue.js +1 -1
- package/dist/features/Operation/components/RequestBody.vue2.js +59 -47
- package/dist/features/Operation/helpers/get-first-server.d.ts +9 -0
- package/dist/features/Operation/helpers/get-first-server.d.ts.map +1 -0
- package/dist/features/Operation/helpers/get-first-server.js +20 -0
- package/dist/features/Search/components/SearchButton.vue.d.ts +2 -0
- package/dist/features/Search/components/SearchButton.vue.d.ts.map +1 -1
- package/dist/features/Search/components/SearchButton.vue.js +19 -17
- package/dist/features/Search/components/SearchModal.vue.d.ts +2 -1
- package/dist/features/Search/components/SearchModal.vue.d.ts.map +1 -1
- package/dist/features/Search/components/SearchModal.vue.js +2 -2
- package/dist/features/Search/components/SearchModal.vue2.js +74 -75
- package/dist/features/Search/helpers/create-search-index.d.ts +2 -2
- package/dist/features/Search/helpers/create-search-index.d.ts.map +1 -1
- package/dist/features/Search/helpers/create-search-index.js +68 -66
- package/dist/features/Search/hooks/useSearchIndex.d.ts +3 -2
- package/dist/features/Search/hooks/useSearchIndex.d.ts.map +1 -1
- package/dist/features/Search/hooks/useSearchIndex.js +13 -13
- package/dist/features/Search/types.d.ts +1 -1
- package/dist/features/Search/types.d.ts.map +1 -1
- package/dist/features/api-client-modal/useApiClient.d.ts +20 -20
- package/dist/helpers/test-utils.d.ts +367 -5
- package/dist/helpers/test-utils.d.ts.map +1 -1
- package/dist/hooks/useNavState.d.ts +1 -15
- package/dist/hooks/useNavState.d.ts.map +1 -1
- package/dist/hooks/useNavState.js +29 -53
- package/dist/index.d.ts +5 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -20
- package/dist/style.css +1 -1
- package/dist/{features/sidebar/components/Sidebar.vue.d.ts → v2/blocks/scalar-sidebar-block/components/SidebarBlock.vue.d.ts} +1 -1
- package/dist/v2/blocks/scalar-sidebar-block/components/SidebarBlock.vue.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-sidebar-block/components/SidebarBlock.vue.js +7 -0
- package/dist/{features/sidebar/components/Sidebar.vue2.js → v2/blocks/scalar-sidebar-block/components/SidebarBlock.vue2.js} +15 -15
- package/dist/{features/sidebar → v2/blocks/scalar-sidebar-block}/components/SidebarElement.vue.d.ts +1 -1
- package/dist/v2/blocks/scalar-sidebar-block/components/SidebarElement.vue.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-sidebar-block/components/SidebarElement.vue.js +7 -0
- package/dist/{features/sidebar → v2/blocks/scalar-sidebar-block}/components/SidebarElement.vue2.js +41 -43
- package/dist/v2/blocks/scalar-sidebar-block/components/SidebarGroup.vue.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-sidebar-block/components/SidebarGroup.vue.js +7 -0
- package/dist/v2/blocks/scalar-sidebar-block/components/SidebarHttpBadge.vue.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-sidebar-block/components/SidebarHttpBadge.vue.js +7 -0
- package/dist/{features/sidebar → v2/blocks/scalar-sidebar-block}/components/SidebarHttpBadge.vue2.js +1 -1
- package/dist/v2/blocks/scalar-sidebar-block/helpers/create-sidebar.d.ts +385 -0
- package/dist/v2/blocks/scalar-sidebar-block/helpers/create-sidebar.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-sidebar-block/helpers/create-sidebar.js +35 -0
- package/dist/v2/blocks/scalar-sidebar-block/helpers/generate-reverse-index.d.ts +189 -0
- package/dist/v2/blocks/scalar-sidebar-block/helpers/generate-reverse-index.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-sidebar-block/helpers/generate-reverse-index.js +9 -0
- package/dist/{features/sidebar → v2/blocks/scalar-sidebar-block}/hooks/useSidebar.d.ts +4 -8
- package/dist/v2/blocks/scalar-sidebar-block/hooks/useSidebar.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-sidebar-block/hooks/useSidebar.js +18 -0
- package/dist/v2/blocks/scalar-sidebar-block/index.d.ts +4 -0
- package/dist/v2/blocks/scalar-sidebar-block/index.d.ts.map +1 -0
- package/dist/v2/helpers/map-configuration.d.ts.map +1 -1
- package/package.json +9 -9
- package/dist/features/sidebar/components/Sidebar.vue.d.ts.map +0 -1
- package/dist/features/sidebar/components/Sidebar.vue.js +0 -7
- package/dist/features/sidebar/components/SidebarElement.vue.d.ts.map +0 -1
- package/dist/features/sidebar/components/SidebarElement.vue.js +0 -7
- package/dist/features/sidebar/components/SidebarGroup.vue.d.ts.map +0 -1
- package/dist/features/sidebar/components/SidebarGroup.vue.js +0 -7
- package/dist/features/sidebar/components/SidebarHttpBadge.vue.d.ts.map +0 -1
- package/dist/features/sidebar/components/SidebarHttpBadge.vue.js +0 -7
- package/dist/features/sidebar/helpers/create-sidebar.d.ts +0 -28
- package/dist/features/sidebar/helpers/create-sidebar.d.ts.map +0 -1
- package/dist/features/sidebar/helpers/create-sidebar.js +0 -32
- package/dist/features/sidebar/hooks/useSidebar.d.ts.map +0 -1
- package/dist/features/sidebar/hooks/useSidebar.js +0 -18
- package/dist/features/sidebar/index.d.ts +0 -4
- package/dist/features/sidebar/index.d.ts.map +0 -1
- package/dist/features/traverse-schema/helpers/get-tag.d.ts +0 -6
- package/dist/features/traverse-schema/helpers/get-tag.d.ts.map +0 -1
- package/dist/features/traverse-schema/helpers/get-tag.js +0 -7
- package/dist/features/traverse-schema/helpers/traverse-description.d.ts +0 -11
- package/dist/features/traverse-schema/helpers/traverse-description.d.ts.map +0 -1
- package/dist/features/traverse-schema/helpers/traverse-description.js +0 -32
- package/dist/features/traverse-schema/helpers/traverse-document.d.ts +0 -16
- package/dist/features/traverse-schema/helpers/traverse-document.d.ts.map +0 -1
- package/dist/features/traverse-schema/helpers/traverse-document.js +0 -33
- package/dist/features/traverse-schema/helpers/traverse-paths.d.ts +0 -18
- package/dist/features/traverse-schema/helpers/traverse-paths.d.ts.map +0 -1
- package/dist/features/traverse-schema/helpers/traverse-paths.js +0 -30
- package/dist/features/traverse-schema/helpers/traverse-schemas.d.ts +0 -8
- package/dist/features/traverse-schema/helpers/traverse-schemas.d.ts.map +0 -1
- package/dist/features/traverse-schema/helpers/traverse-schemas.js +0 -21
- package/dist/features/traverse-schema/helpers/traverse-tags.d.ts +0 -11
- package/dist/features/traverse-schema/helpers/traverse-tags.d.ts.map +0 -1
- package/dist/features/traverse-schema/helpers/traverse-tags.js +0 -43
- package/dist/features/traverse-schema/helpers/traverse-webhooks.d.ts +0 -10
- package/dist/features/traverse-schema/helpers/traverse-webhooks.d.ts.map +0 -1
- package/dist/features/traverse-schema/helpers/traverse-webhooks.js +0 -24
- package/dist/features/traverse-schema/index.d.ts +0 -5
- package/dist/features/traverse-schema/index.d.ts.map +0 -1
- package/dist/features/traverse-schema/types.d.ts +0 -55
- package/dist/features/traverse-schema/types.d.ts.map +0 -1
- package/dist/libs/markdown.js +0 -18
- /package/dist/{features/sidebar → v2/blocks/scalar-sidebar-block}/components/SidebarGroup.vue.d.ts +0 -0
- /package/dist/{features/sidebar → v2/blocks/scalar-sidebar-block}/components/SidebarGroup.vue2.js +0 -0
- /package/dist/{features/sidebar → v2/blocks/scalar-sidebar-block}/components/SidebarHttpBadge.vue.d.ts +0 -0
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
|
|
1
2
|
type __VLS_Props = {
|
|
2
3
|
searchHotKey?: string;
|
|
3
4
|
hideModels?: boolean;
|
|
5
|
+
document?: OpenApiDocument;
|
|
4
6
|
};
|
|
5
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>;
|
|
6
8
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchButton.vue.d.ts","sourceRoot":"","sources":["../../../../src/features/Search/components/SearchButton.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SearchButton.vue.d.ts","sourceRoot":"","sources":["../../../../src/features/Search/components/SearchButton.vue"],"names":[],"mappings":"AA4FA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8DAA8D,CAAA;AAOnG,KAAK,WAAW,GAAG;IACjB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,QAAQ,CAAC,EAAE,eAAe,CAAA;CAC3B,CAAC;;AAqJF,wBAMG"}
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import { defineComponent as h, ref as S, watch as k, nextTick as w, onMounted as C, onBeforeUnmount as M, createElementBlock as a, openBlock as r, Fragment as s, createVNode as
|
|
1
|
+
import { defineComponent as h, ref as S, watch as k, nextTick as w, onMounted as C, onBeforeUnmount as M, createElementBlock as a, openBlock as r, Fragment as s, createVNode as u, unref as l, normalizeClass as v, withCtx as m, createElementVNode as n, createTextVNode as B, toDisplayString as K } from "vue";
|
|
2
2
|
import { useModal as b, ScalarSidebarSearchButton as E } from "@scalar/components";
|
|
3
|
-
import { isMacOS as
|
|
3
|
+
import { isMacOS as p } from "@scalar/helpers/general/is-mac-os";
|
|
4
4
|
import H from "./SearchModal.vue.js";
|
|
5
5
|
import { useApiClient as g } from "../../api-client-modal/useApiClient.js";
|
|
6
|
-
const
|
|
6
|
+
const O = /* @__PURE__ */ h({
|
|
7
7
|
__name: "SearchButton",
|
|
8
8
|
props: {
|
|
9
9
|
searchHotKey: { default: "k" },
|
|
10
|
-
hideModels: { type: Boolean, default: !1 }
|
|
10
|
+
hideModels: { type: Boolean, default: !1 },
|
|
11
|
+
document: {}
|
|
11
12
|
},
|
|
12
13
|
setup(f) {
|
|
13
|
-
const d = S(), t = b(), { client:
|
|
14
|
-
(
|
|
14
|
+
const d = S(), t = b(), { client: c } = g(), i = (o) => {
|
|
15
|
+
(p() ? o.metaKey : o.ctrlKey) && o.key === f.searchHotKey && !c.value?.modalState.open && (o.preventDefault(), o.stopPropagation(), t.open ? t.hide() : t.show());
|
|
15
16
|
};
|
|
16
17
|
k(
|
|
17
18
|
() => t.open,
|
|
@@ -21,18 +22,18 @@ const D = /* @__PURE__ */ h({
|
|
|
21
22
|
});
|
|
22
23
|
}
|
|
23
24
|
), C(() => window.addEventListener("keydown", i)), M(() => window.removeEventListener("keydown", i));
|
|
24
|
-
function
|
|
25
|
+
function y() {
|
|
25
26
|
t.show();
|
|
26
27
|
}
|
|
27
28
|
return (o, e) => (r(), a(s, null, [
|
|
28
|
-
|
|
29
|
+
u(l(E), {
|
|
29
30
|
ref_key: "button",
|
|
30
31
|
ref: d,
|
|
31
32
|
class: v(["w-full", o.$attrs.class]),
|
|
32
|
-
onClick:
|
|
33
|
+
onClick: y
|
|
33
34
|
}, {
|
|
34
|
-
shortcut:
|
|
35
|
-
l(
|
|
35
|
+
shortcut: m(() => [
|
|
36
|
+
l(p)() ? (r(), a(s, { key: 0 }, [
|
|
36
37
|
e[0] || (e[0] = n("span", { class: "sr-only" }, "Command", -1)),
|
|
37
38
|
e[1] || (e[1] = n("span", { "aria-hidden": "true" }, "⌘", -1))
|
|
38
39
|
], 64)) : (r(), a(s, { key: 1 }, [
|
|
@@ -41,7 +42,7 @@ const D = /* @__PURE__ */ h({
|
|
|
41
42
|
], 64)),
|
|
42
43
|
B(" " + K(o.searchHotKey), 1)
|
|
43
44
|
]),
|
|
44
|
-
default:
|
|
45
|
+
default: m(() => [
|
|
45
46
|
e[4] || (e[4] = n("span", { class: "sr-only" }, "Open Search", -1)),
|
|
46
47
|
e[5] || (e[5] = n("span", {
|
|
47
48
|
"aria-hidden": "true",
|
|
@@ -51,13 +52,14 @@ const D = /* @__PURE__ */ h({
|
|
|
51
52
|
_: 1,
|
|
52
53
|
__: [4, 5]
|
|
53
54
|
}, 8, ["class"]),
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
hideModels: o.hideModels
|
|
57
|
-
|
|
55
|
+
u(H, {
|
|
56
|
+
document: o.document,
|
|
57
|
+
hideModels: o.hideModels,
|
|
58
|
+
modalState: l(t)
|
|
59
|
+
}, null, 8, ["document", "hideModels", "modalState"])
|
|
58
60
|
], 64));
|
|
59
61
|
}
|
|
60
62
|
});
|
|
61
63
|
export {
|
|
62
|
-
|
|
64
|
+
O as default
|
|
63
65
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { type ModalState } from '@scalar/components';
|
|
2
|
+
import type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
|
|
2
3
|
type __VLS_Props = {
|
|
3
4
|
modalState: ModalState;
|
|
4
|
-
|
|
5
|
+
document?: OpenApiDocument;
|
|
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":"SearchModal.vue.d.ts","sourceRoot":"","sources":["../../../../src/features/Search/components/SearchModal.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SearchModal.vue.d.ts","sourceRoot":"","sources":["../../../../src/features/Search/components/SearchModal.vue"],"names":[],"mappings":"AAkTA,OAAO,EAKL,KAAK,UAAU,EAChB,MAAM,oBAAoB,CAAA;AAU3B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8DAA8D,CAAA;AAWnG,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,UAAU,CAAA;IACtB,QAAQ,CAAC,EAAE,eAAe,CAAA;CAC3B,CAAC;;AAiaF,wBAMG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./SearchModal.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
const m = /* @__PURE__ */
|
|
3
|
+
import a from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const m = /* @__PURE__ */ a(o, [["__scopeId", "data-v-1b57abdc"]]);
|
|
5
5
|
export {
|
|
6
6
|
m as default
|
|
7
7
|
};
|
|
@@ -1,57 +1,56 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarModal as
|
|
3
|
-
import { isDefined as
|
|
4
|
-
import { scrollToId as
|
|
5
|
-
import { ScalarIconTerminalWindow as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
const ce = { class: "sr-only" }, de = { class: "inline-flex items-center gap-1" }, me = { class: "sr-only" }, be = /* @__PURE__ */ A({
|
|
1
|
+
import { defineComponent as z, ref as A, watch as C, createBlock as T, openBlock as m, unref as a, withCtx as i, createElementVNode as n, createVNode as S, withKeys as g, withModifiers as v, isRef as Y, createElementBlock as w, Fragment as I, renderList as _, createSlots as j, normalizeClass as G, createTextVNode as l, createCommentVNode as $, toDisplayString as c } from "vue";
|
|
2
|
+
import { ScalarModal as J, ScalarSearchInput as Q, ScalarSearchResultList as X, ScalarSearchResultItem as Z } from "@scalar/components";
|
|
3
|
+
import { isDefined as ee } from "@scalar/helpers/array/is-defined";
|
|
4
|
+
import { scrollToId as E } from "@scalar/helpers/dom/scroll-to-id";
|
|
5
|
+
import { ScalarIconTerminalWindow as M, ScalarIconTag as te, ScalarIconBracketsCurly as oe, ScalarIconTextAlignLeft as ne } from "@scalar/icons";
|
|
6
|
+
import { nanoid as ae } from "nanoid";
|
|
7
|
+
import { useSearchIndex as re } from "../hooks/useSearchIndex.js";
|
|
8
|
+
import { useSidebar as N } from "../../../v2/blocks/scalar-sidebar-block/hooks/useSidebar.js";
|
|
9
|
+
import se from "../../../v2/blocks/scalar-sidebar-block/components/SidebarHttpBadge.vue.js";
|
|
10
|
+
import { lazyBus as ie } from "../../../components/Lazy/lazyBus.js";
|
|
11
|
+
const le = { class: "sr-only" }, ce = { class: "inline-flex items-center gap-1" }, de = { class: "sr-only" }, Ie = /* @__PURE__ */ z({
|
|
13
12
|
__name: "SearchModal",
|
|
14
13
|
props: {
|
|
15
14
|
modalState: {},
|
|
16
|
-
|
|
15
|
+
document: {}
|
|
17
16
|
},
|
|
18
|
-
setup(
|
|
19
|
-
const
|
|
20
|
-
resetSearch:
|
|
17
|
+
setup(V) {
|
|
18
|
+
const p = V, f = ae(), R = `${f}-search-result`, b = `${f}-search-instructions`, h = (o) => `${f}${o}`, { items: D } = N(), {
|
|
19
|
+
resetSearch: L,
|
|
21
20
|
selectedIndex: r,
|
|
22
21
|
selectedSearchResult: k,
|
|
23
22
|
searchResultsWithPlaceholderResults: d,
|
|
24
|
-
query:
|
|
25
|
-
} =
|
|
26
|
-
heading:
|
|
27
|
-
model:
|
|
28
|
-
operation:
|
|
29
|
-
tag:
|
|
30
|
-
webhook:
|
|
31
|
-
},
|
|
23
|
+
query: u
|
|
24
|
+
} = re(D, p.document), F = {
|
|
25
|
+
heading: ne,
|
|
26
|
+
model: oe,
|
|
27
|
+
operation: M,
|
|
28
|
+
tag: te,
|
|
29
|
+
webhook: M
|
|
30
|
+
}, H = {
|
|
32
31
|
heading: "Heading",
|
|
33
32
|
operation: "Operation",
|
|
34
33
|
tag: "Tag",
|
|
35
34
|
model: "Model",
|
|
36
35
|
webhook: "Webhook"
|
|
37
|
-
}, P =
|
|
36
|
+
}, P = A(null);
|
|
38
37
|
C(
|
|
39
|
-
() =>
|
|
38
|
+
() => p.modalState.open,
|
|
40
39
|
(o) => {
|
|
41
|
-
o &&
|
|
40
|
+
o && L();
|
|
42
41
|
}
|
|
43
42
|
);
|
|
44
|
-
const { setCollapsedSidebarItem: U } =
|
|
45
|
-
function
|
|
43
|
+
const { setCollapsedSidebarItem: U } = N(), K = /#(tag\/[^/]*)/;
|
|
44
|
+
function x(o) {
|
|
46
45
|
let t = "models";
|
|
47
46
|
const e = o.item.href.match(K);
|
|
48
47
|
e?.length && e.length > 1 && (t = e[1]), U(t, !0);
|
|
49
48
|
const s = o.item.href.replace("#", "");
|
|
50
49
|
if (document.getElementById(s))
|
|
51
|
-
|
|
50
|
+
E(s), p.modalState.hide();
|
|
52
51
|
else {
|
|
53
|
-
const y =
|
|
54
|
-
|
|
52
|
+
const y = ie.on((q) => {
|
|
53
|
+
q.loaded === s && (E(s), y(), p.modalState.hide());
|
|
55
54
|
});
|
|
56
55
|
}
|
|
57
56
|
}
|
|
@@ -64,7 +63,7 @@ const ce = { class: "sr-only" }, de = { class: "inline-flex items-center gap-1"
|
|
|
64
63
|
block: "nearest"
|
|
65
64
|
});
|
|
66
65
|
});
|
|
67
|
-
const
|
|
66
|
+
const B = (o) => {
|
|
68
67
|
const t = o === "up" ? -1 : 1, e = d.value.length;
|
|
69
68
|
if (typeof r.value == "number") {
|
|
70
69
|
const s = (r.value + t + e) % e;
|
|
@@ -72,77 +71,77 @@ const ce = { class: "sr-only" }, de = { class: "inline-flex items-center gap-1"
|
|
|
72
71
|
} else
|
|
73
72
|
r.value = t === -1 ? e - 1 : 0;
|
|
74
73
|
};
|
|
75
|
-
function
|
|
74
|
+
function O(o) {
|
|
76
75
|
const t = new URL(window.location.href);
|
|
77
76
|
return t.hash = o, t.toString();
|
|
78
77
|
}
|
|
79
|
-
function
|
|
80
|
-
if (!
|
|
78
|
+
function W() {
|
|
79
|
+
if (!ee(r.value))
|
|
81
80
|
return;
|
|
82
81
|
const o = d.value;
|
|
83
|
-
o.length !== 0 &&
|
|
82
|
+
o.length !== 0 && x(o[r.value]);
|
|
84
83
|
}
|
|
85
|
-
return (o, t) => (m(), T(
|
|
84
|
+
return (o, t) => (m(), T(a(J), {
|
|
86
85
|
"aria-label": "Reference Search",
|
|
87
86
|
state: o.modalState,
|
|
88
87
|
variant: "search"
|
|
89
88
|
}, {
|
|
90
89
|
default: i(() => [
|
|
91
|
-
|
|
90
|
+
n("div", {
|
|
92
91
|
ref_key: "searchModalRef",
|
|
93
92
|
ref: P,
|
|
94
93
|
class: "ref-search-container",
|
|
95
94
|
role: "search"
|
|
96
95
|
}, [
|
|
97
|
-
S(
|
|
98
|
-
modelValue:
|
|
99
|
-
"onUpdate:modelValue": t[0] || (t[0] = (e) =>
|
|
100
|
-
"aria-activedescendant":
|
|
96
|
+
S(a(Q), {
|
|
97
|
+
modelValue: a(u),
|
|
98
|
+
"onUpdate:modelValue": t[0] || (t[0] = (e) => Y(u) ? u.value = e : null),
|
|
99
|
+
"aria-activedescendant": a(k) ? h(a(k).item.href) : void 0,
|
|
101
100
|
"aria-autocomplete": "list",
|
|
102
101
|
"aria-controls": R,
|
|
103
102
|
"aria-describedby": b,
|
|
104
103
|
role: "combobox",
|
|
105
104
|
onBlur: t[1] || (t[1] = (e) => r.value = void 0),
|
|
106
105
|
onKeydown: [
|
|
107
|
-
t[2] || (t[2] = g(v((e) =>
|
|
108
|
-
g(v(
|
|
109
|
-
t[3] || (t[3] = g(v((e) =>
|
|
106
|
+
t[2] || (t[2] = g(v((e) => B("down"), ["stop", "prevent"]), ["down"])),
|
|
107
|
+
g(v(W, ["stop", "prevent"]), ["enter"]),
|
|
108
|
+
t[3] || (t[3] = g(v((e) => B("up"), ["stop", "prevent"]), ["up"]))
|
|
110
109
|
]
|
|
111
110
|
}, null, 8, ["modelValue", "aria-activedescendant", "onKeydown"])
|
|
112
111
|
], 512),
|
|
113
|
-
S(
|
|
112
|
+
S(a(X), {
|
|
114
113
|
id: R,
|
|
115
114
|
"aria-label": "Reference Search Results",
|
|
116
115
|
class: "ref-search-results custom-scroll",
|
|
117
|
-
noResults: !
|
|
116
|
+
noResults: !a(d).length
|
|
118
117
|
}, {
|
|
119
118
|
query: i(() => [
|
|
120
|
-
l(c(
|
|
119
|
+
l(c(a(u)), 1)
|
|
121
120
|
]),
|
|
122
121
|
default: i(() => [
|
|
123
|
-
(m(!0), w(I, null,
|
|
122
|
+
(m(!0), w(I, null, _(a(d), (e, s) => (m(), T(a(Z), {
|
|
124
123
|
id: h(e.item.href),
|
|
125
124
|
key: e.refIndex,
|
|
126
|
-
href:
|
|
127
|
-
icon:
|
|
128
|
-
selected:
|
|
129
|
-
onClick: (y) =>
|
|
125
|
+
href: O(e.item.href),
|
|
126
|
+
icon: F[e.item.type],
|
|
127
|
+
selected: a(r) === s,
|
|
128
|
+
onClick: (y) => x(e),
|
|
130
129
|
onFocus: (y) => r.value = s
|
|
131
|
-
},
|
|
130
|
+
}, j({
|
|
132
131
|
default: i(() => [
|
|
133
|
-
|
|
134
|
-
class:
|
|
135
|
-
deprecated:
|
|
132
|
+
n("span", {
|
|
133
|
+
class: G({
|
|
134
|
+
deprecated: e.item.entry.type === "operation" && e.item.entry.isDeprecated
|
|
136
135
|
})
|
|
137
136
|
}, [
|
|
138
|
-
|
|
139
|
-
l(c(
|
|
140
|
-
|
|
137
|
+
n("span", le, [
|
|
138
|
+
l(c(H[e.item.type]) + ": ", 1),
|
|
139
|
+
e.item.entry.type === "operation" && e.item.entry.isDeprecated ? (m(), w(I, { key: 0 }, [
|
|
141
140
|
l(" (Deprecated) ")
|
|
142
|
-
], 64)) :
|
|
141
|
+
], 64)) : $("", !0)
|
|
143
142
|
]),
|
|
144
143
|
l(" " + c(e.item.title) + " ", 1),
|
|
145
|
-
t[4] || (t[4] =
|
|
144
|
+
t[4] || (t[4] = n("span", { class: "sr-only" }, ",", -1))
|
|
146
145
|
], 2)
|
|
147
146
|
]),
|
|
148
147
|
_: 2
|
|
@@ -150,15 +149,15 @@ const ce = { class: "sr-only" }, de = { class: "inline-flex items-center gap-1"
|
|
|
150
149
|
e.item.type !== "webhook" && (e.item.method || e.item.path) && e.item.path !== e.item.title ? {
|
|
151
150
|
name: "description",
|
|
152
151
|
fn: i(() => [
|
|
153
|
-
|
|
152
|
+
n("span", ce, [
|
|
154
153
|
e.item.type === "operation" ? (m(), w(I, { key: 0 }, [
|
|
155
|
-
S(se, {
|
|
154
|
+
S(a(se), {
|
|
156
155
|
"aria-hidden": "true",
|
|
157
156
|
method: e.item.method ?? "get"
|
|
158
157
|
}, null, 8, ["method"]),
|
|
159
|
-
|
|
160
|
-
], 64)) :
|
|
161
|
-
t[5] || (t[5] =
|
|
158
|
+
n("span", de, " HTTP Method: " + c(e.item.method ?? "get"), 1)
|
|
159
|
+
], 64)) : $("", !0),
|
|
160
|
+
t[5] || (t[5] = n("span", { class: "sr-only" }, "Path: ", -1)),
|
|
162
161
|
l(" " + c(e.item.path), 1)
|
|
163
162
|
])
|
|
164
163
|
]),
|
|
@@ -166,7 +165,7 @@ const ce = { class: "sr-only" }, de = { class: "inline-flex items-center gap-1"
|
|
|
166
165
|
} : e.item.description ? {
|
|
167
166
|
name: "description",
|
|
168
167
|
fn: i(() => [
|
|
169
|
-
t[6] || (t[6] =
|
|
168
|
+
t[6] || (t[6] = n("span", { class: "sr-only" }, "Description: ", -1)),
|
|
170
169
|
l(" " + c(e.item.description), 1)
|
|
171
170
|
]),
|
|
172
171
|
key: "1"
|
|
@@ -175,18 +174,18 @@ const ce = { class: "sr-only" }, de = { class: "inline-flex items-center gap-1"
|
|
|
175
174
|
]),
|
|
176
175
|
_: 1
|
|
177
176
|
}, 8, ["noResults"]),
|
|
178
|
-
|
|
177
|
+
n("div", {
|
|
179
178
|
id: b,
|
|
180
179
|
class: "ref-search-meta"
|
|
181
180
|
}, t[7] || (t[7] = [
|
|
182
|
-
|
|
181
|
+
n("span", {
|
|
183
182
|
"aria-hidden": "true",
|
|
184
183
|
class: "contents"
|
|
185
184
|
}, [
|
|
186
|
-
|
|
187
|
-
|
|
185
|
+
n("span", null, "↑↓ Navigate"),
|
|
186
|
+
n("span", null, "⏎ Select")
|
|
188
187
|
], -1),
|
|
189
|
-
|
|
188
|
+
n("span", { class: "sr-only" }, " Press up arrow / down arrow to navigate, enter to select, type to filter results ", -1)
|
|
190
189
|
]))
|
|
191
190
|
]),
|
|
192
191
|
_: 1
|
|
@@ -194,5 +193,5 @@ const ce = { class: "sr-only" }, de = { class: "inline-flex items-center gap-1"
|
|
|
194
193
|
}
|
|
195
194
|
});
|
|
196
195
|
export {
|
|
197
|
-
|
|
196
|
+
Ie as default
|
|
198
197
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import type { OpenApiDocument, TraversedEntry } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
|
|
1
2
|
import type { FuseData } from '../../../features/Search/types';
|
|
2
|
-
import type { TraversedEntry } from '../../../features/traverse-schema';
|
|
3
3
|
/**
|
|
4
4
|
* Create a search index from a list of entries.
|
|
5
5
|
*/
|
|
6
|
-
export declare function createSearchIndex(entries: TraversedEntry[]): FuseData[];
|
|
6
|
+
export declare function createSearchIndex(entries: TraversedEntry[], document?: OpenApiDocument): FuseData[];
|
|
7
7
|
//# sourceMappingURL=create-search-index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-search-index.d.ts","sourceRoot":"","sources":["../../../../src/features/Search/helpers/create-search-index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"create-search-index.d.ts","sourceRoot":"","sources":["../../../../src/features/Search/helpers/create-search-index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,8DAA8D,CAAA;AAEnH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AAGvD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,cAAc,EAAE,EAAE,QAAQ,CAAC,EAAE,eAAe,GAAG,QAAQ,EAAE,CAoBnG"}
|
|
@@ -1,109 +1,111 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { getResolvedRef as s } from "@scalar/workspace-store/helpers/get-resolved-ref";
|
|
2
|
+
import { extractRequestBody as h, createParameterMap as a } from "../../../libs/openapi.js";
|
|
3
|
+
function f(o, i) {
|
|
4
|
+
const t = [];
|
|
5
|
+
function e(p) {
|
|
6
|
+
p.forEach((d) => {
|
|
7
|
+
c(d, t, i), "children" in d && d.children && e(d.children);
|
|
7
8
|
});
|
|
8
9
|
}
|
|
9
|
-
return e(
|
|
10
|
+
return e(o), t;
|
|
10
11
|
}
|
|
11
|
-
function
|
|
12
|
-
if ("operation"
|
|
13
|
-
const e =
|
|
14
|
-
|
|
12
|
+
function c(o, i, t) {
|
|
13
|
+
if (o.type === "operation") {
|
|
14
|
+
const e = s(t?.paths?.[o.path]?.[o.method]) ?? {}, p = h(e) || a(e), d = typeof p != "boolean" ? p : null;
|
|
15
|
+
i.push({
|
|
15
16
|
type: "operation",
|
|
16
|
-
title:
|
|
17
|
-
href: `#${
|
|
18
|
-
id:
|
|
19
|
-
description:
|
|
20
|
-
method:
|
|
21
|
-
path:
|
|
17
|
+
title: o.title,
|
|
18
|
+
href: `#${o.id}`,
|
|
19
|
+
id: e.operationId,
|
|
20
|
+
description: e.description || "",
|
|
21
|
+
method: o.method,
|
|
22
|
+
path: o.path,
|
|
22
23
|
body: d || "",
|
|
23
|
-
entry:
|
|
24
|
+
entry: o
|
|
24
25
|
});
|
|
25
26
|
return;
|
|
26
27
|
}
|
|
27
|
-
if ("webhook"
|
|
28
|
-
o.
|
|
28
|
+
if (o.type === "webhook") {
|
|
29
|
+
const e = s(t?.webhooks?.[o.name]?.[o.method]) ?? {};
|
|
30
|
+
i.push({
|
|
29
31
|
type: "webhook",
|
|
30
|
-
title:
|
|
31
|
-
href: `#${
|
|
32
|
+
title: o.title,
|
|
33
|
+
href: `#${o.id}`,
|
|
32
34
|
description: "Webhook",
|
|
33
|
-
method:
|
|
34
|
-
body:
|
|
35
|
-
entry:
|
|
35
|
+
method: o.method,
|
|
36
|
+
body: e.description || "",
|
|
37
|
+
entry: o
|
|
36
38
|
});
|
|
37
39
|
return;
|
|
38
40
|
}
|
|
39
|
-
if ("
|
|
40
|
-
const
|
|
41
|
-
|
|
41
|
+
if (o.type === "model") {
|
|
42
|
+
const p = s(t?.components?.schemas?.[o.name])?.description ?? "";
|
|
43
|
+
i.push({
|
|
42
44
|
type: "model",
|
|
43
|
-
title:
|
|
44
|
-
href: `#${
|
|
45
|
+
title: o.title,
|
|
46
|
+
href: `#${o.id}`,
|
|
45
47
|
description: "Model",
|
|
46
|
-
body:
|
|
47
|
-
entry:
|
|
48
|
+
body: p,
|
|
49
|
+
entry: o
|
|
48
50
|
});
|
|
49
51
|
return;
|
|
50
52
|
}
|
|
51
|
-
if ("
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
if (o.title === "Models") {
|
|
54
|
+
i.push({
|
|
55
|
+
type: "heading",
|
|
56
|
+
title: "Models",
|
|
57
|
+
href: `#${o.id}`,
|
|
58
|
+
description: "Heading",
|
|
57
59
|
body: "",
|
|
58
|
-
entry:
|
|
60
|
+
entry: o
|
|
59
61
|
});
|
|
60
62
|
return;
|
|
61
63
|
}
|
|
62
|
-
if ("
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
64
|
+
if (o.type === "tag" && o.isWebhooks === !0) {
|
|
65
|
+
i.push({
|
|
66
|
+
type: "heading",
|
|
67
|
+
title: "Webhooks",
|
|
68
|
+
href: `#${o.id}`,
|
|
69
|
+
description: "Heading",
|
|
68
70
|
body: "",
|
|
69
|
-
entry:
|
|
71
|
+
entry: o
|
|
70
72
|
});
|
|
71
73
|
return;
|
|
72
74
|
}
|
|
73
|
-
if ("
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
75
|
+
if (o.type === "tag" && o.isGroup === !1) {
|
|
76
|
+
i.push({
|
|
77
|
+
title: o.title,
|
|
78
|
+
href: `#${o.id}`,
|
|
79
|
+
description: o.description || "",
|
|
80
|
+
type: "tag",
|
|
79
81
|
body: "",
|
|
80
|
-
entry:
|
|
82
|
+
entry: o
|
|
81
83
|
});
|
|
82
84
|
return;
|
|
83
85
|
}
|
|
84
|
-
if (
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
86
|
+
if (o.type === "tag" && o.isGroup === !0) {
|
|
87
|
+
i.push({
|
|
88
|
+
title: o.title,
|
|
89
|
+
href: `#${o.id}`,
|
|
90
|
+
description: "Tag Group",
|
|
91
|
+
type: "tag",
|
|
90
92
|
body: "",
|
|
91
|
-
entry:
|
|
93
|
+
entry: o
|
|
92
94
|
});
|
|
93
95
|
return;
|
|
94
96
|
}
|
|
95
|
-
if (
|
|
96
|
-
|
|
97
|
+
if (o.title) {
|
|
98
|
+
i.push({
|
|
97
99
|
type: "heading",
|
|
98
|
-
title:
|
|
100
|
+
title: o.title ?? "",
|
|
99
101
|
description: "Description",
|
|
100
|
-
href: `#${
|
|
102
|
+
href: `#${o.id}`,
|
|
101
103
|
body: "",
|
|
102
|
-
entry:
|
|
104
|
+
entry: o
|
|
103
105
|
});
|
|
104
106
|
return;
|
|
105
107
|
}
|
|
106
108
|
}
|
|
107
109
|
export {
|
|
108
|
-
|
|
110
|
+
f as createSearchIndex
|
|
109
111
|
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
|
|
2
2
|
import type { FuseResult } from 'fuse.js';
|
|
3
|
+
import type { useSidebar } from '../../../v2/blocks/scalar-sidebar-block';
|
|
3
4
|
import type { FuseData } from '../types';
|
|
4
5
|
/**
|
|
5
6
|
* Creates the search index from an OpenAPI document.
|
|
6
7
|
*/
|
|
7
|
-
export declare function useSearchIndex(items: ReturnType<typeof
|
|
8
|
+
export declare function useSearchIndex(items: ReturnType<typeof useSidebar>['items'], document?: OpenApiDocument): {
|
|
8
9
|
resetSearch: () => void;
|
|
9
10
|
selectedIndex: import("vue").Ref<number | undefined, number | undefined>;
|
|
10
11
|
selectedSearchResult: import("vue").ComputedRef<FuseResult<FuseData> | undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSearchIndex.d.ts","sourceRoot":"","sources":["../../../../src/features/Search/hooks/useSearchIndex.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"useSearchIndex.d.ts","sourceRoot":"","sources":["../../../../src/features/Search/hooks/useSearchIndex.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8DAA8D,CAAA;AACnG,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAGzC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAA;AAIlE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAIxC;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC,EAAE,eAAe;uBAgC9E,IAAI;;;;;EA0D7B"}
|