@scalar/api-reference 1.24.56 → 1.24.58
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 +25 -0
- package/dist/browser/standalone.js +9377 -9359
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/Content/Operation/EndpointDetails.vue.js +3 -3
- package/dist/components/Layouts/ClassicLayout.vue.d.ts.map +1 -1
- package/dist/components/Layouts/ClassicLayout.vue.js +13 -13
- package/dist/components/Layouts/ModernLayout.vue.d.ts.map +1 -1
- package/dist/components/Layouts/ModernLayout.vue.js +2 -2
- package/dist/components/Layouts/ModernLayout.vue2.js +11 -11
- package/dist/components/Section/Section.vue2.js +4 -4
- package/dist/esm.d.ts +1 -1
- package/dist/esm.d.ts.map +1 -1
- package/dist/features/Search/Search.vue.d.ts +20 -0
- package/dist/features/Search/Search.vue.d.ts.map +1 -0
- package/dist/features/Search/Search.vue.js +18 -0
- package/dist/features/Search/Search.vue2.js +4 -0
- package/dist/features/Search/SearchButton.vue.d.ts.map +1 -0
- package/dist/features/Search/SearchButton.vue.js +7 -0
- package/dist/features/Search/SearchButton.vue2.js +59 -0
- package/dist/features/Search/SearchModal.vue.d.ts.map +1 -0
- package/dist/features/Search/SearchModal.vue.js +7 -0
- package/dist/features/Search/SearchModal.vue2.js +127 -0
- package/dist/features/Search/index.d.ts +4 -0
- package/dist/features/Search/index.d.ts.map +1 -0
- package/dist/features/Search/useKeyboardNavigation.d.ts +13 -0
- package/dist/features/Search/useKeyboardNavigation.d.ts.map +1 -0
- package/dist/features/Search/useKeyboardNavigation.js +30 -0
- package/dist/features/Search/useSearchIndex.d.ts +30 -0
- package/dist/features/Search/useSearchIndex.d.ts.map +1 -0
- package/dist/features/Search/useSearchIndex.js +115 -0
- package/dist/helpers/createEmptySpecification.d.ts +2 -1
- package/dist/helpers/createEmptySpecification.d.ts.map +1 -1
- package/dist/hooks/useDarkModeState.d.ts.map +1 -1
- package/dist/hooks/useDarkModeState.js +5 -5
- package/dist/hooks/useReactiveSpec.d.ts +4 -4
- package/dist/hooks/useReactiveSpec.d.ts.map +1 -1
- package/dist/hooks/useReactiveSpec.js +33 -31
- package/dist/index.d.ts +1 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +103 -101
- package/dist/style.css +1 -1
- package/package.json +6 -6
- package/dist/components/SearchButton.vue.d.ts.map +0 -1
- package/dist/components/SearchButton.vue.js +0 -7
- package/dist/components/SearchButton.vue2.js +0 -59
- package/dist/components/SearchModal.vue.d.ts.map +0 -1
- package/dist/components/SearchModal.vue.js +0 -7
- package/dist/components/SearchModal.vue2.js +0 -219
- /package/dist/{components → features/Search}/SearchButton.vue.d.ts +0 -0
- /package/dist/{components → features/Search}/SearchModal.vue.d.ts +0 -0
|
@@ -2,15 +2,15 @@ import { defineComponent as u, openBlock as d, createElementBlock as _, createEl
|
|
|
2
2
|
import { ScalarMarkdown as B } from "@scalar/components";
|
|
3
3
|
import o from "./Parameters.vue.js";
|
|
4
4
|
import q from "./RequestBody.vue.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { useResponses as k } from "../../../hooks/useResponses.js";
|
|
6
|
+
import { useOperation as P } from "../../../hooks/useOperation.js";
|
|
7
7
|
const v = { class: "endpoint-details" }, w = { class: "endpoint-description" }, b = /* @__PURE__ */ u({
|
|
8
8
|
__name: "EndpointDetails",
|
|
9
9
|
props: {
|
|
10
10
|
operation: {}
|
|
11
11
|
},
|
|
12
12
|
setup(l) {
|
|
13
|
-
const n = l, { parameterMap: s } =
|
|
13
|
+
const n = l, { parameterMap: s } = P(n), { responses: c } = k(n.operation);
|
|
14
14
|
return (p, C) => {
|
|
15
15
|
var i, m;
|
|
16
16
|
return d(), _("div", v, [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClassicLayout.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Layouts/ClassicLayout.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ClassicLayout.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Layouts/ClassicLayout.vue"],"names":[],"mappings":"AAuDA,OAAO,KAAK,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AA0B7E,iBAAS,cAAc,0DA8HtB;AACD,QAAA,MAAM,eAAe;;;;;;UAOnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAAvG,wBAAwG;AAOxG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACpC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC;AAEN,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as u, useSlots as f, computed as m, openBlock as g, createBlock as S, createSlots as k, withCtx as t, createVNode as n, unref as p, renderList as D, renderSlot as C, normalizeProps as w, guardReactiveProps as y } from "vue";
|
|
2
2
|
import M from "../ApiReferenceLayout.vue.js";
|
|
3
3
|
import v from "../ClassicHeader.vue.js";
|
|
4
|
-
import B from "../
|
|
5
|
-
import H from "
|
|
6
|
-
const P = /* @__PURE__ */
|
|
4
|
+
import B from "../DarkModeToggle/DarkModeIconToggle.vue.js";
|
|
5
|
+
import H from "../../features/Search/SearchButton.vue.js";
|
|
6
|
+
const P = /* @__PURE__ */ u({
|
|
7
7
|
__name: "ClassicLayout",
|
|
8
8
|
props: {
|
|
9
9
|
configuration: {},
|
|
@@ -12,24 +12,24 @@ const P = /* @__PURE__ */ c({
|
|
|
12
12
|
isDark: { type: Boolean }
|
|
13
13
|
},
|
|
14
14
|
emits: ["toggleDarkMode", "updateContent"],
|
|
15
|
-
setup(
|
|
16
|
-
const
|
|
17
|
-
return (e, o) => (
|
|
15
|
+
setup(i) {
|
|
16
|
+
const l = i, d = f(), s = m(() => ({ ...l.configuration, showSidebar: !1 }));
|
|
17
|
+
return (e, o) => (g(), S(M, {
|
|
18
18
|
configuration: s.value,
|
|
19
19
|
parsedSpec: e.parsedSpec,
|
|
20
20
|
rawSpec: e.rawSpec,
|
|
21
21
|
onUpdateContent: o[1] || (o[1] = (r) => e.$emit("updateContent", r))
|
|
22
|
-
},
|
|
22
|
+
}, k({
|
|
23
23
|
"content-start": t(({ spec: r }) => [
|
|
24
24
|
n(v, null, {
|
|
25
25
|
"dark-mode-toggle": t(() => [
|
|
26
|
-
n(
|
|
26
|
+
n(p(B), {
|
|
27
27
|
isDarkMode: e.isDark,
|
|
28
28
|
onToggleDarkMode: o[0] || (o[0] = (a) => e.$emit("toggleDarkMode"))
|
|
29
29
|
}, null, 8, ["isDarkMode"])
|
|
30
30
|
]),
|
|
31
31
|
default: t(() => [
|
|
32
|
-
n(
|
|
32
|
+
n(p(H), {
|
|
33
33
|
class: "t-doc__sidebar",
|
|
34
34
|
searchHotKey: s.value.searchHotKey,
|
|
35
35
|
spec: r
|
|
@@ -40,10 +40,10 @@ const P = /* @__PURE__ */ c({
|
|
|
40
40
|
]),
|
|
41
41
|
_: 2
|
|
42
42
|
}, [
|
|
43
|
-
D(
|
|
43
|
+
D(d, (r, a) => ({
|
|
44
44
|
name: a,
|
|
45
|
-
fn: t((
|
|
46
|
-
C(e.$slots, a, w(y(
|
|
45
|
+
fn: t((c) => [
|
|
46
|
+
C(e.$slots, a, w(y(c || {})))
|
|
47
47
|
])
|
|
48
48
|
}))
|
|
49
49
|
]), 1032, ["configuration", "parsedSpec", "rawSpec"]));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModernLayout.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Layouts/ModernLayout.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ModernLayout.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Layouts/ModernLayout.vue"],"names":[],"mappings":"AA0FA,OAAO,KAAK,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAqC7E,iBAAS,cAAc,0DAiJtB;AACD,QAAA,MAAM,eAAe;;;;;;UAOnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAAvG,wBAAwG;AAOxG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACpC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC;AAEN,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
|
|
@@ -2,7 +2,7 @@ import o from "./ModernLayout.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-29ebaf8d"]]);
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
e as default
|
|
8
8
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as k, useSlots as M, watch as
|
|
1
|
+
import { defineComponent as k, useSlots as M, watch as p, openBlock as l, createBlock as d, normalizeClass as b, createSlots as h, withCtx as n, unref as s, isRef as v, createCommentVNode as w, createElementVNode as y, createVNode as u, renderList as D, renderSlot as C, normalizeProps as B, guardReactiveProps as N } from "vue";
|
|
2
2
|
import { useMediaQuery as $ } from "@vueuse/core";
|
|
3
3
|
import H from "../ApiReferenceLayout.vue.js";
|
|
4
4
|
import K from "../MobileHeader.vue.js";
|
|
5
|
-
import L from "
|
|
5
|
+
import L from "../../features/Search/SearchButton.vue.js";
|
|
6
6
|
import R from "../DarkModeToggle/DarkModeToggle.vue.js";
|
|
7
7
|
import { useSidebar as V } from "../../hooks/useSidebar.js";
|
|
8
8
|
import { useNavState as z } from "../../hooks/useNavState.js";
|
|
@@ -16,14 +16,14 @@ const P = { class: "scalar-api-references-standalone-search" }, F = /* @__PURE__
|
|
|
16
16
|
},
|
|
17
17
|
emits: ["toggleDarkMode", "updateContent"],
|
|
18
18
|
setup(c) {
|
|
19
|
-
const
|
|
20
|
-
|
|
19
|
+
const i = c, f = M(), m = $("(max-width: 1000px)"), { isSidebarOpen: a } = V();
|
|
20
|
+
p(m, (e, o) => {
|
|
21
21
|
e && !o && (a.value = !1);
|
|
22
22
|
});
|
|
23
23
|
const { hash: S } = z();
|
|
24
|
-
return
|
|
24
|
+
return p(S, (e, o) => {
|
|
25
25
|
e && e !== o && (a.value = !1);
|
|
26
|
-
}), (e, o) => (
|
|
26
|
+
}), (e, o) => (l(), d(H, {
|
|
27
27
|
class: b({
|
|
28
28
|
"scalar-api-references-standalone-mobile": e.configuration.showSidebar
|
|
29
29
|
}),
|
|
@@ -33,9 +33,9 @@ const P = { class: "scalar-api-references-standalone-search" }, F = /* @__PURE__
|
|
|
33
33
|
onUpdateContent: o[2] || (o[2] = (r) => e.$emit("updateContent", r))
|
|
34
34
|
}, h({
|
|
35
35
|
header: n(() => [
|
|
36
|
-
|
|
36
|
+
i.configuration.showSidebar ? (l(), d(K, {
|
|
37
37
|
key: 0,
|
|
38
|
-
open:
|
|
38
|
+
open: s(a),
|
|
39
39
|
"onUpdate:open": o[0] || (o[0] = (r) => v(a) ? a.value = r : null)
|
|
40
40
|
}, null, 8, ["open"])) : w("", !0)
|
|
41
41
|
]),
|
|
@@ -43,15 +43,15 @@ const P = { class: "scalar-api-references-standalone-search" }, F = /* @__PURE__
|
|
|
43
43
|
var t;
|
|
44
44
|
return [
|
|
45
45
|
y("div", P, [
|
|
46
|
-
u(L, {
|
|
47
|
-
searchHotKey: (t =
|
|
46
|
+
u(s(L), {
|
|
47
|
+
searchHotKey: (t = i.configuration) == null ? void 0 : t.searchHotKey,
|
|
48
48
|
spec: r
|
|
49
49
|
}, null, 8, ["searchHotKey", "spec"])
|
|
50
50
|
])
|
|
51
51
|
];
|
|
52
52
|
}),
|
|
53
53
|
"sidebar-end": n(() => [
|
|
54
|
-
u(
|
|
54
|
+
u(s(R), {
|
|
55
55
|
isDarkMode: e.isDark,
|
|
56
56
|
onToggleDarkMode: o[1] || (o[1] = (r) => e.$emit("toggleDarkMode"))
|
|
57
57
|
}, null, 8, ["isDarkMode"])
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent as m, openBlock as p, createBlock as u, withCtx as f, renderSlot as S } from "vue";
|
|
2
2
|
import w from "../IntersectionObserver.vue.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { joinWithSlash as b } from "../../helpers/joinWithSlash.js";
|
|
4
|
+
import { useSidebar as _ } from "../../hooks/useSidebar.js";
|
|
5
5
|
import { useNavState as v } from "../../hooks/useNavState.js";
|
|
6
6
|
const B = /* @__PURE__ */ m({
|
|
7
7
|
__name: "Section",
|
|
@@ -10,12 +10,12 @@ const B = /* @__PURE__ */ m({
|
|
|
10
10
|
label: {}
|
|
11
11
|
},
|
|
12
12
|
setup(s) {
|
|
13
|
-
const t = s, { getSectionId: r, hash: l, isIntersectionEnabled: d, pathRouting: i } = v(), { setCollapsedSidebarItem: c } =
|
|
13
|
+
const t = s, { getSectionId: r, hash: l, isIntersectionEnabled: d, pathRouting: i } = v(), { setCollapsedSidebarItem: c } = _();
|
|
14
14
|
function h() {
|
|
15
15
|
var n, a;
|
|
16
16
|
if (!t.label || !d.value) return;
|
|
17
17
|
const e = new URL(window.location.href), o = t.id ?? "";
|
|
18
|
-
i.value ? e.pathname =
|
|
18
|
+
i.value ? e.pathname = b(i.value.basePath, o) : e.hash = o, l.value = o, window.history.replaceState({}, "", e), ((n = t.id) != null && n.startsWith("model") || (a = t.id) != null && a.startsWith("webhook")) && c(r(t.id), !0);
|
|
19
19
|
}
|
|
20
20
|
return (e, o) => (p(), u(w, {
|
|
21
21
|
is: "section",
|
package/dist/esm.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { SpecConfiguration } from '@scalar/oas-utils';
|
|
2
2
|
import type { ReferenceConfiguration } from './types';
|
|
3
|
-
/** Initialize Scalar References
|
|
3
|
+
/** Initialize Scalar References */
|
|
4
4
|
export declare function createScalarReferences(
|
|
5
5
|
/** Element to mount the references to */
|
|
6
6
|
el: HTMLElement | null,
|
package/dist/esm.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"esm.d.ts","sourceRoot":"","sources":["../src/esm.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAM1D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AAErD,
|
|
1
|
+
{"version":3,"file":"esm.d.ts","sourceRoot":"","sources":["../src/esm.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAM1D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AAErD,mCAAmC;AACnC,wBAAgB,sBAAsB;AACpC,yCAAyC;AACzC,EAAE,EAAE,WAAW,GAAG,IAAI;AACtB,iDAAiD;AACjD,aAAa,EAAE,sBAAsB;AACrC;;;GAGG;AACH,iBAAiB,UAAO;IAsBtB,uDAAuD;4BAC/B,sBAAsB;qBAO7B,iBAAiB;IAGlC,8CAA8C;;IAE9C,sCAAsC;;EAGzC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ModalState } from '@scalar/components';
|
|
2
|
+
import type { Spec } from '@scalar/oas-utils';
|
|
3
|
+
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<{
|
|
4
|
+
parsedSpec: Spec;
|
|
5
|
+
modalState: ModalState;
|
|
6
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<{
|
|
7
|
+
parsedSpec: Spec;
|
|
8
|
+
modalState: ModalState;
|
|
9
|
+
}>>>, {}, {}>;
|
|
10
|
+
export default _default;
|
|
11
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
12
|
+
type __VLS_TypePropsToOption<T> = {
|
|
13
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
14
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
15
|
+
} : {
|
|
16
|
+
type: import('vue').PropType<T[K]>;
|
|
17
|
+
required: true;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=Search.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Search.vue.d.ts","sourceRoot":"","sources":["../../../src/features/Search/Search.vue"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;;gBAO/B,IAAI;gBACJ,UAAU;;gBADV,IAAI;gBACJ,UAAU;;AA+CxB,wBAMG;AAOH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { defineComponent as a, openBlock as o, createBlock as p } from "vue";
|
|
2
|
+
import r from "./SearchModal.vue.js";
|
|
3
|
+
const l = /* @__PURE__ */ a({
|
|
4
|
+
__name: "Search",
|
|
5
|
+
props: {
|
|
6
|
+
parsedSpec: {},
|
|
7
|
+
modalState: {}
|
|
8
|
+
},
|
|
9
|
+
setup(t) {
|
|
10
|
+
return (e, c) => (o(), p(r, {
|
|
11
|
+
modalState: e.modalState,
|
|
12
|
+
parsedSpec: e.parsedSpec
|
|
13
|
+
}, null, 8, ["modalState", "parsedSpec"]));
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
export {
|
|
17
|
+
l as default
|
|
18
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchButton.vue.d.ts","sourceRoot":"","sources":["../../../src/features/Search/SearchButton.vue"],"names":[],"mappings":"AAkIA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;;UAWnC,IAAI;mBACK,MAAM;;;;UADf,IAAI;mBACK,MAAM;;;;kBAAN,MAAM;;AA4HzB,wBAMG;AAOH,KAAK,kBAAkB,CAAC,CAAC,EAAE,CAAC,IAAI;KAC1B,CAAC,IAAI,MAAM,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,SAAS,MAAM,CAAC,GAC7C,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG;QAAE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;KAAC,CAAC,GACvC,CAAC,CAAC,CAAC,CAAC;CACP,CAAC;AAEN,KAAK,cAAc,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC;AAExD,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { defineComponent as m, ref as u, onMounted as f, openBlock as S, createElementBlock as _, Fragment as y, createElementVNode as a, normalizeClass as k, unref as t, createVNode as i, toDisplayString as l, pushScopeId as v, popScopeId as b } from "vue";
|
|
2
|
+
import { useModal as K, ScalarIcon as w } from "@scalar/components";
|
|
3
|
+
import { isMacOS as r } from "@scalar/use-tooltip";
|
|
4
|
+
import { useMagicKeys as M, whenever as g } from "@vueuse/core";
|
|
5
|
+
import { modalStateBus as B } from "../../components/api-client-bus.js";
|
|
6
|
+
import C from "./Search.vue.js";
|
|
7
|
+
const H = (o) => (v("data-v-d3992930"), o = o(), b(), o), I = { class: "sidebar-search-input" }, $ = /* @__PURE__ */ H(() => /* @__PURE__ */ a("span", { class: "sidebar-search-placeholder" }, "Search", -1)), E = { class: "sidebar-search-shortcut" }, z = { class: "sidebar-search-key" }, j = /* @__PURE__ */ m({
|
|
8
|
+
__name: "SearchButton",
|
|
9
|
+
props: {
|
|
10
|
+
spec: {},
|
|
11
|
+
searchHotKey: { default: "k" }
|
|
12
|
+
},
|
|
13
|
+
setup(o) {
|
|
14
|
+
const c = o, s = K(), n = u(null), d = M({
|
|
15
|
+
passive: !1,
|
|
16
|
+
onEventFired(e) {
|
|
17
|
+
!r() && e.ctrlKey && e.key === c.searchHotKey && (e.preventDefault(), e.stopPropagation());
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
return f(() => {
|
|
21
|
+
B.on((e) => {
|
|
22
|
+
n.value = e;
|
|
23
|
+
});
|
|
24
|
+
}), g(
|
|
25
|
+
d[`${r() ? "meta" : "control"}_${c.searchHotKey}`],
|
|
26
|
+
() => {
|
|
27
|
+
var e;
|
|
28
|
+
(e = n.value) != null && e.open || (s.open ? s.hide() : s.show());
|
|
29
|
+
}
|
|
30
|
+
), (e, p) => (S(), _(y, null, [
|
|
31
|
+
a("button", {
|
|
32
|
+
class: k(["sidebar-search", e.$attrs.class]),
|
|
33
|
+
type: "button",
|
|
34
|
+
onClick: p[0] || (p[0] = //@ts-ignore
|
|
35
|
+
(...h) => t(s).show && t(s).show(...h))
|
|
36
|
+
}, [
|
|
37
|
+
i(t(w), {
|
|
38
|
+
class: "search-icon",
|
|
39
|
+
icon: "Search",
|
|
40
|
+
size: "sm",
|
|
41
|
+
thickness: "2.5"
|
|
42
|
+
}),
|
|
43
|
+
a("div", I, [
|
|
44
|
+
$,
|
|
45
|
+
a("span", E, [
|
|
46
|
+
a("span", z, l(t(r)() ? "⌘" : "⌃") + l(e.searchHotKey), 1)
|
|
47
|
+
])
|
|
48
|
+
])
|
|
49
|
+
], 2),
|
|
50
|
+
i(C, {
|
|
51
|
+
modalState: t(s),
|
|
52
|
+
parsedSpec: e.spec
|
|
53
|
+
}, null, 8, ["modalState", "parsedSpec"])
|
|
54
|
+
], 64));
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
export {
|
|
58
|
+
j as default
|
|
59
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchModal.vue.d.ts","sourceRoot":"","sources":["../../../src/features/Search/SearchModal.vue"],"names":[],"mappings":"AAoKA,OAAO,EAEL,KAAK,UAAU,EAKhB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;;gBAY/B,IAAI;gBACJ,UAAU;;gBADV,IAAI;gBACJ,UAAU;;AAgRxB,wBAMG;AAOH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { defineComponent as F, toRef as g, ref as B, watch as T, openBlock as u, createBlock as v, unref as t, withCtx as l, createElementVNode as d, createVNode as h, isRef as U, createTextVNode as i, toDisplayString as n, createElementBlock as q, Fragment as E, renderList as L, createSlots as M, pushScopeId as D, popScopeId as H } from "vue";
|
|
2
|
+
import { ScalarModal as O, ScalarSearchInput as P, ScalarSearchResultList as $, ScalarSearchResultItem as K } from "@scalar/components";
|
|
3
|
+
import W from "../../components/Sidebar/SidebarHttpBadge.vue.js";
|
|
4
|
+
import { useKeyboardNavigation as Y } from "./useKeyboardNavigation.js";
|
|
5
|
+
import { useSearchIndex as j } from "./useSearchIndex.js";
|
|
6
|
+
import { useSidebar as z } from "../../hooks/useSidebar.js";
|
|
7
|
+
const A = (r) => (D("data-v-9653f2de"), r = r(), H(), r), G = /* @__PURE__ */ A(() => /* @__PURE__ */ d("div", { class: "ref-search-meta" }, [
|
|
8
|
+
/* @__PURE__ */ d("span", null, "↑↓ Navigate"),
|
|
9
|
+
/* @__PURE__ */ d("span", null, "⏎ Select")
|
|
10
|
+
], -1)), te = /* @__PURE__ */ F({
|
|
11
|
+
__name: "SearchModal",
|
|
12
|
+
props: {
|
|
13
|
+
parsedSpec: {},
|
|
14
|
+
modalState: {}
|
|
15
|
+
},
|
|
16
|
+
setup(r) {
|
|
17
|
+
const s = r, R = g(s, "parsedSpec"), k = g(s.modalState.open), {
|
|
18
|
+
resetSearch: I,
|
|
19
|
+
fuseSearch: _,
|
|
20
|
+
selectedSearchResult: m,
|
|
21
|
+
searchResultsWithPlaceholderResults: p,
|
|
22
|
+
searchText: c
|
|
23
|
+
} = j({
|
|
24
|
+
specification: R
|
|
25
|
+
});
|
|
26
|
+
Y({
|
|
27
|
+
selectedSearchResult: m,
|
|
28
|
+
active: k,
|
|
29
|
+
searchResultsWithPlaceholderResults: p,
|
|
30
|
+
onSearchResultClick: f
|
|
31
|
+
});
|
|
32
|
+
const w = {
|
|
33
|
+
heading: "DocsPage",
|
|
34
|
+
model: "Brackets",
|
|
35
|
+
req: "Terminal",
|
|
36
|
+
tag: "CodeFolder",
|
|
37
|
+
webhook: "Terminal"
|
|
38
|
+
}, C = B(null);
|
|
39
|
+
T(
|
|
40
|
+
() => s.modalState.open,
|
|
41
|
+
(o) => {
|
|
42
|
+
o && I();
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
const { setCollapsedSidebarItem: V } = z(), b = /#(tag\/[^/]*)/;
|
|
46
|
+
function f(o) {
|
|
47
|
+
let a = "models";
|
|
48
|
+
const e = o.item.href.match(b);
|
|
49
|
+
e != null && e.length && e.length > 1 && (a = e[1]), V(a, !0), s.modalState.hide();
|
|
50
|
+
}
|
|
51
|
+
function N(o) {
|
|
52
|
+
const a = new URL(window.location.href);
|
|
53
|
+
return a.hash = o, a.toString();
|
|
54
|
+
}
|
|
55
|
+
return (o, a) => (u(), v(t(O), {
|
|
56
|
+
state: o.modalState,
|
|
57
|
+
variant: "search"
|
|
58
|
+
}, {
|
|
59
|
+
default: l(() => [
|
|
60
|
+
d("div", {
|
|
61
|
+
ref_key: "searchModalRef",
|
|
62
|
+
ref: C,
|
|
63
|
+
class: "ref-search-container"
|
|
64
|
+
}, [
|
|
65
|
+
h(t(P), {
|
|
66
|
+
modelValue: t(c),
|
|
67
|
+
"onUpdate:modelValue": a[0] || (a[0] = (e) => U(c) ? c.value = e : null),
|
|
68
|
+
onInput: t(_)
|
|
69
|
+
}, null, 8, ["modelValue", "onInput"])
|
|
70
|
+
], 512),
|
|
71
|
+
h(t($), {
|
|
72
|
+
class: "ref-search-results custom-scroll",
|
|
73
|
+
noResults: !t(p).length
|
|
74
|
+
}, {
|
|
75
|
+
query: l(() => [
|
|
76
|
+
i(n(t(c)), 1)
|
|
77
|
+
]),
|
|
78
|
+
default: l(() => [
|
|
79
|
+
(u(!0), q(E, null, L(t(p), (e, S) => (u(), v(t(K), {
|
|
80
|
+
id: e.item.href,
|
|
81
|
+
key: e.refIndex,
|
|
82
|
+
active: t(m) === S,
|
|
83
|
+
href: N(e.item.href),
|
|
84
|
+
icon: w[e.item.type],
|
|
85
|
+
onClick: (x) => f(e),
|
|
86
|
+
onFocus: (x) => m.value = S
|
|
87
|
+
}, M({
|
|
88
|
+
default: l(() => [
|
|
89
|
+
i(n(e.item.title) + " ", 1)
|
|
90
|
+
]),
|
|
91
|
+
_: 2
|
|
92
|
+
}, [
|
|
93
|
+
(e.item.httpVerb || e.item.path) && e.item.path !== e.item.title ? {
|
|
94
|
+
name: "description",
|
|
95
|
+
fn: l(() => [
|
|
96
|
+
i(n(e.item.path), 1)
|
|
97
|
+
]),
|
|
98
|
+
key: "0"
|
|
99
|
+
} : e.item.description ? {
|
|
100
|
+
name: "description",
|
|
101
|
+
fn: l(() => [
|
|
102
|
+
i(n(e.item.description), 1)
|
|
103
|
+
]),
|
|
104
|
+
key: "1"
|
|
105
|
+
} : void 0,
|
|
106
|
+
e.item.type === "req" ? {
|
|
107
|
+
name: "addon",
|
|
108
|
+
fn: l(() => [
|
|
109
|
+
h(W, {
|
|
110
|
+
method: e.item.httpVerb ?? "get"
|
|
111
|
+
}, null, 8, ["method"])
|
|
112
|
+
]),
|
|
113
|
+
key: "2"
|
|
114
|
+
} : void 0
|
|
115
|
+
]), 1032, ["id", "active", "href", "icon", "onClick", "onFocus"]))), 128))
|
|
116
|
+
]),
|
|
117
|
+
_: 1
|
|
118
|
+
}, 8, ["noResults"]),
|
|
119
|
+
G
|
|
120
|
+
]),
|
|
121
|
+
_: 1
|
|
122
|
+
}, 8, ["state"]));
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
export {
|
|
126
|
+
te as default
|
|
127
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/features/Search/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,cAAc,CAAA;AAChD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAC5D,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,mBAAmB,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { FuseResult } from 'fuse.js';
|
|
2
|
+
import { type Ref } from 'vue';
|
|
3
|
+
import type { FuseData } from './useSearchIndex.js';
|
|
4
|
+
/**
|
|
5
|
+
* Use keyboard navigation for search results
|
|
6
|
+
*/
|
|
7
|
+
export declare function useKeyboardNavigation({ active, selectedSearchResult, searchResultsWithPlaceholderResults, onSearchResultClick, }: {
|
|
8
|
+
active: Ref<boolean>;
|
|
9
|
+
selectedSearchResult: Ref<number>;
|
|
10
|
+
searchResultsWithPlaceholderResults: Ref<FuseResult<FuseData>[]>;
|
|
11
|
+
onSearchResultClick: (entry: FuseResult<FuseData>) => void;
|
|
12
|
+
}): void;
|
|
13
|
+
//# sourceMappingURL=useKeyboardNavigation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useKeyboardNavigation.d.ts","sourceRoot":"","sources":["../../../src/features/Search/useKeyboardNavigation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACzC,OAAO,EAAE,KAAK,GAAG,EAAY,MAAM,KAAK,CAAA;AAExC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAEhD;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,MAAM,EACN,oBAAoB,EACpB,mCAAmC,EACnC,mBAAmB,GACpB,EAAE;IACD,MAAM,EAAE,GAAG,CAAC,OAAO,CAAC,CAAA;IACpB,oBAAoB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IACjC,mCAAmC,EAAE,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAA;IAChE,mBAAmB,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,QAAQ,CAAC,KAAK,IAAI,CAAA;CAC3D,QAoEA"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { useMagicKeys as f, whenever as v } from "@vueuse/core";
|
|
2
|
+
import { computed as m } from "vue";
|
|
3
|
+
function l({
|
|
4
|
+
active: i,
|
|
5
|
+
selectedSearchResult: o,
|
|
6
|
+
searchResultsWithPlaceholderResults: e,
|
|
7
|
+
onSearchResultClick: t
|
|
8
|
+
}) {
|
|
9
|
+
const u = f(), r = m(
|
|
10
|
+
() => e.value[o.value]
|
|
11
|
+
);
|
|
12
|
+
v(u.enter, () => {
|
|
13
|
+
i && window && (t(r.value), window.location.hash = r.value.item.href);
|
|
14
|
+
}), v(u.ArrowDown, () => {
|
|
15
|
+
var n;
|
|
16
|
+
i && window && (o.value < e.value.length - 1 ? o.value++ : o.value = 0, (n = document.getElementById(r.value.item.href)) == null || n.scrollIntoView({
|
|
17
|
+
behavior: "smooth",
|
|
18
|
+
block: "center"
|
|
19
|
+
}));
|
|
20
|
+
}), v(u.ArrowUp, () => {
|
|
21
|
+
var n;
|
|
22
|
+
i && window && (o.value > 0 ? o.value-- : o.value = e.value.length - 1, (n = document.getElementById(r.value.item.href)) == null || n.scrollIntoView({
|
|
23
|
+
behavior: "smooth",
|
|
24
|
+
block: "center"
|
|
25
|
+
}));
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
export {
|
|
29
|
+
l as useKeyboardNavigation
|
|
30
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Spec, TransformedOperation } from '@scalar/oas-utils';
|
|
2
|
+
import { type FuseResult } from 'fuse.js';
|
|
3
|
+
import { type Ref } from 'vue';
|
|
4
|
+
import { type ParamMap } from '../../hooks';
|
|
5
|
+
export type EntryType = 'req' | 'webhook' | 'model' | 'heading' | 'tag';
|
|
6
|
+
export type FuseData = {
|
|
7
|
+
title: string;
|
|
8
|
+
href: string;
|
|
9
|
+
type: EntryType;
|
|
10
|
+
operationId?: string;
|
|
11
|
+
description: string;
|
|
12
|
+
body?: string | string[] | ParamMap;
|
|
13
|
+
httpVerb?: string;
|
|
14
|
+
path?: string;
|
|
15
|
+
tag?: string;
|
|
16
|
+
operation?: TransformedOperation;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Creates the search index from an OpenAPI document.
|
|
20
|
+
*/
|
|
21
|
+
export declare function useSearchIndex({ specification, }: {
|
|
22
|
+
specification: Ref<Spec>;
|
|
23
|
+
}): {
|
|
24
|
+
resetSearch: () => void;
|
|
25
|
+
fuseSearch: () => void;
|
|
26
|
+
selectedSearchResult: Ref<number>;
|
|
27
|
+
searchResultsWithPlaceholderResults: import("vue").ComputedRef<FuseResult<FuseData>[]>;
|
|
28
|
+
searchText: Ref<string>;
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=useSearchIndex.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSearchIndex.d.ts","sourceRoot":"","sources":["../../../src/features/Search/useSearchIndex.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;AAEnE,OAAa,EAAE,KAAK,UAAU,EAAE,MAAM,SAAS,CAAA;AAC/C,OAAO,EAAE,KAAK,GAAG,EAAwB,MAAM,KAAK,CAAA;AAIpD,OAAO,EACL,KAAK,QAAQ,EAId,MAAM,aAAa,CAAA;AAEpB,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,QAAQ,CAAA;IACnC,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,GACd,EAAE;IACD,aAAa,EAAE,GAAG,CAAC,IAAI,CAAC,CAAA;CACzB;uBAoByB,IAAI;sBALL,IAAI;;;;EAyK5B"}
|