@scalar/api-reference 1.31.3 → 1.31.6
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 +55 -0
- package/dist/browser/standalone.js +15752 -15637
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/ApiReference.vue.js +6 -6
- package/dist/components/ApiReferenceLayout.vue.d.ts +6 -3
- package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
- package/dist/components/ApiReferenceLayout.vue.js +4 -2
- package/dist/components/ApiReferenceLayout.vue2.js +230 -153
- package/dist/components/Content/ClientLibraries/ClientLibraries.vue.js +2 -2
- package/dist/components/Content/ClientLibraries/ClientLibraries.vue2.js +1 -1
- package/dist/components/Content/Introduction/Description.vue.d.ts.map +1 -1
- package/dist/components/Content/Introduction/Description.vue.js +2 -2
- package/dist/components/Content/Lazy/Loading.vue.d.ts.map +1 -1
- package/dist/components/Content/Lazy/Loading.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaComposition.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaComposition.vue.js +81 -101
- package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaProperty.vue.js +2 -2
- package/dist/components/Content/Schema/SchemaProperty.vue2.js +114 -105
- package/dist/components/Content/Schema/helpers/merge-all-of-schemas.js +35 -35
- package/dist/components/Content/Schema/helpers/optimizeValueForDisplay.d.ts.map +1 -1
- package/dist/components/Content/Schema/helpers/optimizeValueForDisplay.js +17 -15
- package/dist/components/Content/Schema/helpers/schema-name.js +13 -21
- package/dist/components/Content/Tag/OperationsList.vue.d.ts.map +1 -1
- package/dist/components/Content/Tag/OperationsList.vue.js +1 -1
- package/dist/components/Content/Tag/OperationsList.vue2.js +10 -9
- package/dist/components/Content/Tag/OperationsListItem.vue.d.ts.map +1 -1
- package/dist/components/Content/Tag/OperationsListItem.vue.js +1 -1
- package/dist/components/Content/Tag/OperationsListItem.vue2.js +29 -28
- package/dist/components/Content/Tag/TagList.vue.d.ts.map +1 -1
- package/dist/components/Content/Tag/TagList.vue.js +35 -34
- package/dist/components/DocumentSelector/DocumentSelector.vue.d.ts.map +1 -1
- package/dist/components/DocumentSelector/DocumentSelector.vue.js +21 -28
- package/dist/components/GettingStarted.vue.d.ts.map +1 -1
- package/dist/components/GettingStarted.vue.js +3 -3
- package/dist/components/GettingStarted.vue2.js +23 -23
- package/dist/components/HttpMethod/HttpMethod.vue.d.ts +1 -20
- package/dist/components/HttpMethod/HttpMethod.vue.d.ts.map +1 -1
- package/dist/components/HttpMethod/HttpMethod.vue.js +12 -13
- package/dist/components/Section/CompactSection.vue.js +2 -2
- package/dist/components/Section/CompactSection.vue2.js +6 -6
- package/dist/components/Sidebar/Sidebar.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/Sidebar.vue.js +2 -2
- package/dist/components/Sidebar/Sidebar.vue2.js +1 -1
- package/dist/components/Sidebar/SidebarElement.vue.js +1 -1
- package/dist/components/Sidebar/SidebarElement.vue2.js +5 -5
- package/dist/esm.d.ts.map +1 -1
- package/dist/features/DocumentSource/hooks/useDocumentFetcher.js +1 -1
- package/dist/features/DocumentSource/hooks/useDocumentSource.d.ts +1 -1
- package/dist/features/DocumentSource/hooks/useDocumentSource.d.ts.map +1 -1
- package/dist/features/DocumentSource/hooks/useDocumentSource.js +11 -11
- package/dist/features/DownloadLink/DownloadLink.vue.d.ts.map +1 -1
- package/dist/features/DownloadLink/DownloadLink.vue.js +2 -2
- package/dist/features/DownloadLink/DownloadLink.vue2.js +21 -21
- package/dist/features/ExampleRequest/ExampleRequest.vue.d.ts.map +1 -1
- package/dist/features/ExampleRequest/ExampleRequest.vue.js +1 -1
- package/dist/features/ExampleRequest/ExampleRequest.vue2.js +1 -1
- package/dist/features/Search/SearchButton.vue.d.ts.map +1 -1
- package/dist/features/Search/SearchButton.vue.js +2 -2
- package/dist/features/Search/SearchButton.vue2.js +16 -16
- package/dist/features/Search/SearchModal.vue.d.ts.map +1 -1
- package/dist/features/Search/SearchModal.vue.js +2 -2
- package/dist/features/Search/SearchModal.vue2.js +1 -1
- package/dist/features/Search/useSearchIndex.d.ts.map +1 -1
- package/dist/features/Search/useSearchIndex.js +29 -28
- package/dist/features/sidebar/helpers/create-sidebar.d.ts +26 -0
- package/dist/features/sidebar/helpers/create-sidebar.d.ts.map +1 -0
- package/dist/features/sidebar/hooks/useSidebar.d.ts +23 -0
- package/dist/features/sidebar/hooks/useSidebar.d.ts.map +1 -0
- package/dist/features/sidebar/index.d.ts +2 -0
- package/dist/features/sidebar/index.d.ts.map +1 -0
- package/dist/features/traverse-schema/helpers/get-tag.d.ts +4 -0
- package/dist/features/traverse-schema/helpers/get-tag.d.ts.map +1 -0
- package/dist/features/traverse-schema/helpers/operation-id-params.d.ts +8 -0
- package/dist/features/traverse-schema/helpers/operation-id-params.d.ts.map +1 -0
- package/dist/features/traverse-schema/helpers/operation-id-params.js +8 -0
- package/dist/features/traverse-schema/helpers/traverse-description.d.ts +9 -0
- package/dist/features/traverse-schema/helpers/traverse-description.d.ts.map +1 -0
- package/dist/features/traverse-schema/helpers/traverse-document.d.ts +16 -0
- package/dist/features/traverse-schema/helpers/traverse-document.d.ts.map +1 -0
- package/dist/features/traverse-schema/helpers/traverse-paths.d.ts +11 -0
- package/dist/features/traverse-schema/helpers/traverse-paths.d.ts.map +1 -0
- package/dist/features/traverse-schema/helpers/traverse-schemas.d.ts +6 -0
- package/dist/features/traverse-schema/helpers/traverse-schemas.d.ts.map +1 -0
- package/dist/features/traverse-schema/helpers/traverse-tags.d.ts +9 -0
- package/dist/features/traverse-schema/helpers/traverse-tags.d.ts.map +1 -0
- package/dist/features/traverse-schema/helpers/traverse-webhooks.d.ts +6 -0
- package/dist/features/traverse-schema/helpers/traverse-webhooks.d.ts.map +1 -0
- package/dist/features/traverse-schema/index.d.ts +4 -0
- package/dist/features/traverse-schema/index.d.ts.map +1 -0
- package/dist/features/traverse-schema/types.d.ts +51 -0
- package/dist/features/traverse-schema/types.d.ts.map +1 -0
- package/dist/helpers/parse.d.ts.map +1 -1
- package/dist/helpers/parse.js +16 -16
- package/dist/hooks/useNavState.d.ts +9 -4
- package/dist/hooks/useNavState.d.ts.map +1 -1
- package/dist/hooks/useNavState.js +31 -29
- package/dist/hooks/useSidebar.d.ts.map +1 -1
- package/dist/hooks/useSidebar.js +69 -68
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +37 -44
- package/dist/legacy/fixtures/httpRequestMethods.js +2 -6
- package/dist/libs/openapi.js +32 -32
- package/dist/stores/useHttpClientStore.js +9 -8
- package/dist/style.css +1 -1
- package/dist/types.d.ts +0 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/v2/ApiReferenceWorkspace.vue.d.ts +40 -0
- package/dist/v2/ApiReferenceWorkspace.vue.d.ts.map +1 -0
- package/dist/v2/ApiReferenceWorkspace.vue.js +65 -0
- package/dist/v2/ApiReferenceWorkspace.vue3.js +5 -0
- package/dist/v2/events/definitions.d.ts +35 -0
- package/dist/v2/events/definitions.d.ts.map +1 -0
- package/dist/v2/events/index.d.ts +3 -0
- package/dist/v2/events/index.d.ts.map +1 -0
- package/dist/v2/events/listeners.d.ts +8 -0
- package/dist/v2/events/listeners.d.ts.map +1 -0
- package/dist/v2/events/listeners.js +15 -0
- package/dist/v2/styles.d.ts +2 -0
- package/dist/v2/styles.d.ts.map +1 -0
- package/package.json +13 -11
- package/dist/components/HttpMethod/constants.d.ts +0 -9
- package/dist/components/HttpMethod/constants.d.ts.map +0 -1
- package/dist/components/HttpMethod/constants.js +0 -36
- package/dist/components/HttpMethod/utils/isRequestMethod.d.ts +0 -4
- package/dist/components/HttpMethod/utils/isRequestMethod.d.ts.map +0 -1
- package/dist/components/HttpMethod/utils/isRequestMethod.js +0 -7
- package/dist/components/Layouts/ClassicLayout.vue.d.ts +0 -23
- package/dist/components/Layouts/ClassicLayout.vue.d.ts.map +0 -1
- package/dist/components/Layouts/ClassicLayout.vue.js +0 -67
- package/dist/components/Layouts/ClassicLayout.vue2.js +0 -4
- package/dist/components/Layouts/Layouts.vue.d.ts +0 -26
- package/dist/components/Layouts/Layouts.vue.d.ts.map +0 -1
- package/dist/components/Layouts/Layouts.vue.js +0 -35
- package/dist/components/Layouts/Layouts.vue2.js +0 -4
- package/dist/components/Layouts/ModernLayout.vue.d.ts +0 -23
- package/dist/components/Layouts/ModernLayout.vue.d.ts.map +0 -1
- package/dist/components/Layouts/ModernLayout.vue.js +0 -8
- package/dist/components/Layouts/ModernLayout.vue2.js +0 -102
- package/dist/components/Layouts/index.d.ts +0 -2
- package/dist/components/Layouts/index.d.ts.map +0 -1
- package/dist/components/SingleApiReference.vue.d.ts +0 -29
- package/dist/components/SingleApiReference.vue.d.ts.map +0 -1
- package/dist/components/SingleApiReference.vue.js +0 -57
- package/dist/components/SingleApiReference.vue3.js +0 -5
- package/dist/helpers/freeze-element.d.ts +0 -11
- package/dist/helpers/freeze-element.d.ts.map +0 -1
- package/dist/helpers/freeze-element.js +0 -20
- package/dist/helpers/is-mac-os.d.ts +0 -5
- package/dist/helpers/is-mac-os.d.ts.map +0 -1
- package/dist/helpers/is-mac-os.js +0 -4
- package/dist/helpers/measure.d.ts +0 -21
- package/dist/helpers/measure.d.ts.map +0 -1
- package/dist/helpers/measure.js +0 -7
- package/dist/helpers/scroll-to-id.d.ts +0 -7
- package/dist/helpers/scroll-to-id.d.ts.map +0 -1
- package/dist/helpers/scroll-to-id.js +0 -21
- package/dist/helpers/sleep.d.ts +0 -6
- package/dist/helpers/sleep.d.ts.map +0 -1
- package/dist/helpers/sleep.js +0 -4
- package/dist/legacy/helpers/index.d.ts +0 -2
- package/dist/legacy/helpers/index.d.ts.map +0 -1
- package/dist/legacy/helpers/normalizeRequestMethod.d.ts +0 -6
- package/dist/legacy/helpers/normalizeRequestMethod.d.ts.map +0 -1
- package/dist/legacy/helpers/normalizeRequestMethod.js +0 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sidebar.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Sidebar/Sidebar.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Sidebar.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Sidebar/Sidebar.vue"],"names":[],"mappings":"AA2RA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAMhD,OAAO,EAAc,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAIlE,KAAK,WAAW,GAAG;IACf,UAAU,EAAE,IAAI,CAAA;CACjB,GAAG,YAAY,CAAC;AAqHnB,iBAAS,cAAc;WA4NT,OAAO,IAA6B;;iCAVb,GAAG;+BACJ,GAAG;;;;;;EActC;AAiBD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe,6SAOnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAWpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./Sidebar.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-277426a8"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
p as default
|
|
7
7
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent as F, ref as w, watch as N, onMounted as L, onUnmounted as G, createElementBlock as n, openBlock as s, renderSlot as V, createElementVNode as A, createVNode as M, withCtx as v, Fragment as d, renderList as m, unref as u, toDisplayString as D, createBlock as f, createCommentVNode as h } from "vue";
|
|
2
|
+
import { sleep as C } from "@scalar/helpers/testing/sleep";
|
|
2
3
|
import S from "./SidebarElement.vue.js";
|
|
3
4
|
import T from "./SidebarGroup.vue.js";
|
|
4
|
-
import { sleep as C } from "../../helpers/sleep.js";
|
|
5
5
|
import { useNavState as H } from "../../hooks/useNavState.js";
|
|
6
6
|
import { useSidebar as R } from "../../hooks/useSidebar.js";
|
|
7
7
|
const U = { class: "sidebar" }, j = ["aria-label"], q = { class: "sidebar-group-title" }, x = -160, X = /* @__PURE__ */ F({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./SidebarElement.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
4
|
+
const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-666e87c6"]]);
|
|
5
5
|
export {
|
|
6
6
|
a as default
|
|
7
7
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defineComponent as A, createElementBlock as p, openBlock as s, createElementVNode as r, renderSlot as v, createCommentVNode as l, normalizeClass as T, unref as c, createTextVNode as h, withModifiers as V, createVNode as C, withCtx as E, toDisplayString as u, createBlock as N } from "vue";
|
|
2
2
|
import { ScalarSidebarGroupToggle as O, ScalarIcon as R } from "@scalar/components";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { scrollToId as U } from "@scalar/helpers/dom/scroll-to-id";
|
|
4
|
+
import { sleep as k } from "@scalar/helpers/testing/sleep";
|
|
5
|
+
import { combineUrlAndPath as H } from "@scalar/oas-utils/helpers";
|
|
6
6
|
import { useConfig as I } from "../../hooks/useConfig.js";
|
|
7
7
|
import { useNavState as P } from "../../hooks/useNavState.js";
|
|
8
8
|
import D from "./SidebarHttpBadge.vue.js";
|
|
@@ -31,7 +31,7 @@ const L = ["id"], M = {
|
|
|
31
31
|
d.value = !1, i.hasChildren && m("toggleOpen"), (t = (e = i.item) == null ? void 0 : e.select) == null || t.call(e), await k(100), d.value = !0;
|
|
32
32
|
}, B = () => {
|
|
33
33
|
if (n.value.pathRouting)
|
|
34
|
-
return
|
|
34
|
+
return H(n.value.pathRouting.basePath, i.item.id);
|
|
35
35
|
if (typeof window < "u") {
|
|
36
36
|
const e = new URL(window.location.href);
|
|
37
37
|
return e.hash = f(i.item.id), `${e.pathname}${e.search}${e.hash}`;
|
|
@@ -39,7 +39,7 @@ const L = ["id"], M = {
|
|
|
39
39
|
return `#${f(i.item.id)}`;
|
|
40
40
|
}, $ = async (e) => {
|
|
41
41
|
var t, a, o, b;
|
|
42
|
-
(a = (t = n.value).onSidebarClick) == null || a.call(t, i.item.id), n.value.pathRouting && (e.preventDefault(), i.hasChildren && m("toggleOpen"), (b = (o = i.item) == null ? void 0 : o.select) == null || b.call(o), m("toggleOpen"), d.value = !1, S(i.item.id),
|
|
42
|
+
(a = (t = n.value).onSidebarClick) == null || a.call(t, i.item.id), n.value.pathRouting && (e.preventDefault(), i.hasChildren && m("toggleOpen"), (b = (o = i.item) == null ? void 0 : o.select) == null || b.call(o), m("toggleOpen"), d.value = !1, S(i.item.id), U(i.item.id), await k(100), d.value = !0);
|
|
43
43
|
};
|
|
44
44
|
return (e, t) => {
|
|
45
45
|
var a, o;
|
package/dist/esm.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"esm.d.ts","sourceRoot":"","sources":["../src/esm.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"esm.d.ts","sourceRoot":"","sources":["../src/esm.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AAO/F;;;;GAIG;AACH,wBAAgB,sBAAsB;AACpC,yCAAyC;AACzC,EAAE,EAAE,WAAW,GAAG,IAAI;AACtB,iDAAiD;AACjD,aAAa,EAAE,OAAO,CAAC,yBAAyB,CAAC,GAAG,OAAO,CAAC,yBAAyB,CAAC,EAAE;AACxF;;;GAGG;AACH,iBAAiB,UAAO;IA2BtB,uDAAuD;4BAC/B,OAAO,CAAC,yBAAyB,CAAC;qBAOzC,iBAAiB;IAOlC,8CAA8C;;IAE9C,sCAAsC;;EAGzC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { measure as i } from "
|
|
1
|
+
import { measure as i } from "@scalar/helpers/testing/measure";
|
|
2
2
|
import { fetchDocument as f, prettyPrintJson as s } from "@scalar/oas-utils/helpers";
|
|
3
3
|
import { ref as u, watch as a, toValue as c } from "vue";
|
|
4
4
|
function l({
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createActiveEntitiesStore, createWorkspaceStore } from '@scalar/api-client/store';
|
|
2
2
|
import type { OpenAPIV3_1 } from '@scalar/openapi-types';
|
|
3
|
+
import type { Spec } from '@scalar/types/legacy';
|
|
3
4
|
import { type ApiReferenceConfiguration } from '@scalar/types/api-reference';
|
|
4
5
|
import { type MaybeRefOrGetter, type Ref } from 'vue';
|
|
5
|
-
import type { Spec } from '@scalar/types/legacy';
|
|
6
6
|
/**
|
|
7
7
|
* Pass any data source, retrieve all the data stores and whatever we need to render the API reference.
|
|
8
8
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDocumentSource.d.ts","sourceRoot":"","sources":["../../../../src/features/DocumentSource/hooks/useDocumentSource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AAE1F,OAAO,KAAK,EAAW,WAAW,EAAE,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"useDocumentSource.d.ts","sourceRoot":"","sources":["../../../../src/features/DocumentSource/hooks/useDocumentSource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AAE1F,OAAO,KAAK,EAAW,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAEjE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAChD,OAAO,EAAE,KAAK,yBAAyB,EAAmC,MAAM,6BAA6B,CAAA;AAC7G,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,GAAG,EAAiC,MAAM,KAAK,CAAA;AAQpF;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,gBAAgB,EAAE,wBAAwB,EAC1C,oBAAoB,EAAE,4BAA4B,EAClD,aAAa,GACd,EAAE;IACD,gBAAgB,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAA;IAC3C,oBAAoB,CAAC,EAAE,gBAAgB,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAA;IAC7D,aAAa,CAAC,EAAE,gBAAgB,CAAC,yBAAyB,CAAC,CAAA;CAC5D,GAAG;IACF,gBAAgB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAC7B,sBAAsB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IACnC,oBAAoB,EAAE,GAAG,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAA;IAC/C,cAAc,EAAE,GAAG,CAAC,IAAI,CAAC,CAAA;IACzB,cAAc,EAAE,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAA;IACvD,mBAAmB,EAAE,UAAU,CAAC,OAAO,yBAAyB,CAAC,CAAA;CAClE,CA6IA"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { createWorkspaceStore as V, createActiveEntitiesStore as b } from "@scalar/api-client/store";
|
|
2
|
-
import { normalize as E,
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { normalize as E, upgrade as F, dereference as O } from "@scalar/openapi-parser";
|
|
3
|
+
import { measure as S } from "@scalar/helpers/testing/measure";
|
|
4
|
+
import { apiReferenceConfigurationSchema as g } from "@scalar/types/api-reference";
|
|
5
|
+
import { computed as y, toValue as t, ref as m, watch as p } from "vue";
|
|
5
6
|
import { parse as W } from "../../../helpers/parse.js";
|
|
6
7
|
import { useSidebar as k } from "../../../hooks/useSidebar.js";
|
|
7
8
|
import { createEmptySpecification as C } from "../../../libs/openapi.js";
|
|
8
|
-
import { measure as y } from "../../../helpers/measure.js";
|
|
9
9
|
import { useDocumentFetcher as I } from "./useDocumentFetcher.js";
|
|
10
10
|
function J({
|
|
11
11
|
originalDocument: l,
|
|
@@ -14,7 +14,7 @@ function J({
|
|
|
14
14
|
}) {
|
|
15
15
|
const { originalDocument: v } = I({
|
|
16
16
|
configuration: n
|
|
17
|
-
}), f =
|
|
17
|
+
}), f = y(() => l ? t(l) : t(v)), i = m(""), s = y(() => c ? t(c) : t(d)), d = m({
|
|
18
18
|
openapi: "3.1.0",
|
|
19
19
|
info: {
|
|
20
20
|
title: "",
|
|
@@ -32,15 +32,15 @@ function J({
|
|
|
32
32
|
return;
|
|
33
33
|
const A = !i.value.startsWith("3.1") ? (
|
|
34
34
|
// Upgrade needed
|
|
35
|
-
|
|
36
|
-
const { specification: a } =
|
|
35
|
+
S("upgrade", () => {
|
|
36
|
+
const { specification: a } = F(e);
|
|
37
37
|
return a;
|
|
38
38
|
})
|
|
39
39
|
) : (
|
|
40
40
|
// Skip the upgrade
|
|
41
41
|
e
|
|
42
|
-
), D = await
|
|
43
|
-
const { schema: a, errors: o } = await
|
|
42
|
+
), D = await S("dereference", async () => {
|
|
43
|
+
const { schema: a, errors: o } = await O(A);
|
|
44
44
|
return o != null && o.length && console.warn(
|
|
45
45
|
`Please open an issue on https://github.com/scalar/scalar
|
|
46
46
|
`,
|
|
@@ -55,7 +55,7 @@ function J({
|
|
|
55
55
|
);
|
|
56
56
|
const u = V({
|
|
57
57
|
useLocalStorage: !1,
|
|
58
|
-
...t(n) ??
|
|
58
|
+
...t(n) ?? g.parse({})
|
|
59
59
|
});
|
|
60
60
|
p(
|
|
61
61
|
() => t(s),
|
|
@@ -66,7 +66,7 @@ function J({
|
|
|
66
66
|
shouldLoad: !1,
|
|
67
67
|
documentUrl: (e = t(n)) == null ? void 0 : e.url,
|
|
68
68
|
useCollectionSecurity: !0,
|
|
69
|
-
...t(n) ??
|
|
69
|
+
...t(n) ?? g.parse({})
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
72
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DownloadLink.vue.d.ts","sourceRoot":"","sources":["../../../src/features/DownloadLink/DownloadLink.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DownloadLink.vue.d.ts","sourceRoot":"","sources":["../../../src/features/DownloadLink/DownloadLink.vue"],"names":[],"mappings":"AAuKA,KAAK,WAAW,GAAG;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAC;;AA8HF,wBAMG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./DownloadLink.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-3d92d514"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { useConfig as
|
|
1
|
+
import { defineComponent as w, computed as v, createElementBlock as x, createCommentVNode as b, unref as k, openBlock as C, createElementVNode as t, withModifiers as r, createVNode as i, withCtx as s, createTextVNode as d } from "vue";
|
|
2
|
+
import D from "github-slugger";
|
|
3
|
+
import u from "../../components/Badge/Badge.vue.js";
|
|
4
|
+
import { useConfig as c } from "../../hooks/useConfig.js";
|
|
5
5
|
import { downloadEventBus as y } from "../../libs/download.js";
|
|
6
6
|
const B = {
|
|
7
7
|
key: 0,
|
|
8
|
-
class: "download-container"
|
|
9
|
-
}, I = /* @__PURE__ */
|
|
8
|
+
class: "download-container group"
|
|
9
|
+
}, I = /* @__PURE__ */ w({
|
|
10
10
|
__name: "DownloadLink",
|
|
11
11
|
props: {
|
|
12
12
|
title: {}
|
|
13
13
|
},
|
|
14
|
-
setup(
|
|
15
|
-
const m =
|
|
16
|
-
y.emit({ id: "", filename: f.value, format:
|
|
14
|
+
setup(a) {
|
|
15
|
+
const m = c(), p = new D(), f = v(() => p.slug(a.title ?? "")), e = (n) => {
|
|
16
|
+
y.emit({ id: "", filename: f.value, format: n });
|
|
17
17
|
};
|
|
18
|
-
return (
|
|
18
|
+
return (n, o) => {
|
|
19
19
|
var l;
|
|
20
|
-
return (l =
|
|
21
|
-
|
|
20
|
+
return (l = k(m)) != null && l.hideDownloadButton ? b("", !0) : (C(), x("div", B, [
|
|
21
|
+
t("button", {
|
|
22
22
|
type: "button",
|
|
23
23
|
class: "download-button",
|
|
24
|
-
onClick:
|
|
24
|
+
onClick: o[0] || (o[0] = r((g) => e("json"), ["prevent"])),
|
|
25
25
|
variant: "ghost"
|
|
26
26
|
}, [
|
|
27
|
-
|
|
28
|
-
i(
|
|
29
|
-
default:
|
|
27
|
+
o[3] || (o[3] = t("span", null, " Download OpenAPI Document ", -1)),
|
|
28
|
+
i(u, { class: "extension hidden group-hover:flex" }, {
|
|
29
|
+
default: s(() => o[2] || (o[2] = [
|
|
30
30
|
d("json")
|
|
31
31
|
])),
|
|
32
32
|
_: 1
|
|
33
33
|
})
|
|
34
34
|
]),
|
|
35
|
-
|
|
35
|
+
t("button", {
|
|
36
36
|
type: "button",
|
|
37
37
|
class: "download-button",
|
|
38
|
-
onClick:
|
|
38
|
+
onClick: o[1] || (o[1] = r((g) => e("yaml"), ["prevent"])),
|
|
39
39
|
variant: "ghost"
|
|
40
40
|
}, [
|
|
41
|
-
|
|
42
|
-
i(
|
|
43
|
-
default:
|
|
41
|
+
o[5] || (o[5] = t("span", null, " Download OpenAPI Document ", -1)),
|
|
42
|
+
i(u, { class: "extension hidden group-hover:flex" }, {
|
|
43
|
+
default: s(() => o[4] || (o[4] = [
|
|
44
44
|
d("yaml")
|
|
45
45
|
])),
|
|
46
46
|
_: 1
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExampleRequest.vue.d.ts","sourceRoot":"","sources":["../../../src/features/ExampleRequest/ExampleRequest.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ExampleRequest.vue.d.ts","sourceRoot":"","sources":["../../../src/features/ExampleRequest/ExampleRequest.vue"],"names":[],"mappings":"AA2hBA,OAAO,KAAK,EACV,UAAU,EACV,SAAS,EACT,MAAM,EACP,MAAM,iCAAiC,CAAA;AAExC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAChE,OAAO,EAOL,KAAK,uBAAuB,EAC7B,MAAM,KAAK,CAAA;AAKZ,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAA;AAiBjE,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,SAAS,CAAA;IACpB,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,UAAU,EAAE,UAAU,CAAA;IACtB,yDAAyD;IACzD,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,0CAA0C;IAC1C,oBAAoB,EAAE,oBAAoB,CAAA;IAC1C,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAC;AA8VF,iBAAS,cAAc;WAoOT,OAAO,IAA6B;;wBAZrB,GAAG;wBAEH,GAAG;wBADH,GAAG;wBAEH,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCApM7B,GAAE,8CACO,GAAG,yBAAyB,GAAG,6DACV,GAAG;;;;;;;;EAgNnC;AAkCD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe,kSAMnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAWpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./ExampleRequest.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
4
|
+
const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-1940a6fa"]]);
|
|
5
5
|
export {
|
|
6
6
|
p as default
|
|
7
7
|
};
|
|
@@ -3,8 +3,8 @@ import { useWorkspace as pe } from "@scalar/api-client/store";
|
|
|
3
3
|
import { getSnippet as fe } from "@scalar/api-client/views/Components/CodeSnippet";
|
|
4
4
|
import { filterSecurityRequirements as ye } from "@scalar/api-client/views/Request/RequestSection";
|
|
5
5
|
import { ScalarCodeBlock as ve } from "@scalar/components";
|
|
6
|
+
import { freezeElement as ge } from "@scalar/helpers/dom/freeze-element";
|
|
6
7
|
import J from "../../components/ScreenReader.vue.js";
|
|
7
|
-
import { freezeElement as ge } from "../../helpers/freeze-element.js";
|
|
8
8
|
import { useConfig as xe } from "../../hooks/useConfig.js";
|
|
9
9
|
import { EXAMPLE_CONTEXT as he, DISCRIMINATOR_CONTEXT as Ee } from "../../hooks/useDiscriminator.js";
|
|
10
10
|
import { useHttpClientStore as Ke } from "../../stores/useHttpClientStore.js";
|
|
@@ -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":"AAyJA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAQhD,KAAK,WAAW,GAAG;IACf,IAAI,EAAE,IAAI,CAAA;IACV,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,CAAC;;kBADe,MAAM;;AAsJzB,wBAOG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./SearchButton.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-065378cc"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as S, ref as b, watch as w, nextTick as v, onMounted as K, onBeforeUnmount as g, createElementBlock as a, openBlock as n, Fragment as r, createElementVNode as
|
|
1
|
+
import { defineComponent as S, ref as b, watch as w, nextTick as v, onMounted as K, onBeforeUnmount as g, createElementBlock as a, openBlock as n, Fragment as r, createElementVNode as t, createVNode as p, normalizeClass as C, unref as l, createTextVNode as u, toDisplayString as M } from "vue";
|
|
2
2
|
import { useModal as B } from "@scalar/components";
|
|
3
|
+
import { isMacOS as m } from "@scalar/helpers/general/is-mac-os";
|
|
3
4
|
import { ScalarIconMagnifyingGlass as E } from "@scalar/icons";
|
|
4
5
|
import H from "./SearchModal.vue.js";
|
|
5
|
-
import { isMacOs as m } from "../../helpers/is-mac-os.js";
|
|
6
6
|
import { useApiClient as L } from "../ApiClientModal/useApiClient.js";
|
|
7
7
|
const N = { class: "sidebar-search-input" }, T = { class: "sidebar-search-shortcut" }, V = { class: "sidebar-search-key" }, G = /* @__PURE__ */ S({
|
|
8
8
|
__name: "SearchButton",
|
|
@@ -11,12 +11,12 @@ const N = { class: "sidebar-search-input" }, T = { class: "sidebar-search-shortc
|
|
|
11
11
|
searchHotKey: { default: "k" }
|
|
12
12
|
},
|
|
13
13
|
setup(f) {
|
|
14
|
-
const h = f, i = b(),
|
|
14
|
+
const h = f, i = b(), s = B(), { client: y } = L(), d = (o) => {
|
|
15
15
|
var e;
|
|
16
|
-
(m() ? o.metaKey : o.ctrlKey) && o.key === h.searchHotKey && !((e = y.value) != null && e.modalState.open) && (o.preventDefault(), o.stopPropagation(),
|
|
16
|
+
(m() ? o.metaKey : o.ctrlKey) && o.key === h.searchHotKey && !((e = y.value) != null && e.modalState.open) && (o.preventDefault(), o.stopPropagation(), s.open ? s.hide() : s.show());
|
|
17
17
|
};
|
|
18
18
|
w(
|
|
19
|
-
() =>
|
|
19
|
+
() => s.open,
|
|
20
20
|
(o, e) => {
|
|
21
21
|
!o && e && v(() => {
|
|
22
22
|
var c;
|
|
@@ -25,10 +25,10 @@ const N = { class: "sidebar-search-input" }, T = { class: "sidebar-search-shortc
|
|
|
25
25
|
}
|
|
26
26
|
), K(() => window.addEventListener("keydown", d)), g(() => window.removeEventListener("keydown", d));
|
|
27
27
|
function k() {
|
|
28
|
-
|
|
28
|
+
s.show();
|
|
29
29
|
}
|
|
30
30
|
return (o, e) => (n(), a(r, null, [
|
|
31
|
-
|
|
31
|
+
t("button", {
|
|
32
32
|
ref_key: "button",
|
|
33
33
|
ref: i,
|
|
34
34
|
class: C(["sidebar-search", o.$attrs.class]),
|
|
@@ -40,20 +40,20 @@ const N = { class: "sidebar-search-input" }, T = { class: "sidebar-search-shortc
|
|
|
40
40
|
class: "scalar-search-icon",
|
|
41
41
|
weight: "bold"
|
|
42
42
|
}),
|
|
43
|
-
|
|
44
|
-
e[3] || (e[3] =
|
|
45
|
-
e[4] || (e[4] =
|
|
43
|
+
t("div", N, [
|
|
44
|
+
e[3] || (e[3] = t("span", { class: "sr-only" }, "Open Search", -1)),
|
|
45
|
+
e[4] || (e[4] = t("span", {
|
|
46
46
|
"aria-hidden": "true",
|
|
47
47
|
class: "sidebar-search-placeholder"
|
|
48
48
|
}, " Search ", -1)),
|
|
49
|
-
|
|
50
|
-
e[2] || (e[2] =
|
|
51
|
-
|
|
49
|
+
t("span", T, [
|
|
50
|
+
e[2] || (e[2] = t("span", { class: "sr-only" }, "Keyboard Shortcut:", -1)),
|
|
51
|
+
t("kbd", V, [
|
|
52
52
|
l(m)() ? (n(), a(r, { key: 0 }, [
|
|
53
53
|
u("⌘")
|
|
54
54
|
], 64)) : (n(), a(r, { key: 1 }, [
|
|
55
|
-
e[0] || (e[0] =
|
|
56
|
-
e[1] || (e[1] =
|
|
55
|
+
e[0] || (e[0] = t("span", { class: "sr-only" }, "CTRL", -1)),
|
|
56
|
+
e[1] || (e[1] = t("span", { "aria-hidden": "true" }, "⌃", -1))
|
|
57
57
|
], 64)),
|
|
58
58
|
u(" " + M(o.searchHotKey), 1)
|
|
59
59
|
])
|
|
@@ -61,7 +61,7 @@ const N = { class: "sidebar-search-input" }, T = { class: "sidebar-search-shortc
|
|
|
61
61
|
])
|
|
62
62
|
], 2),
|
|
63
63
|
p(H, {
|
|
64
|
-
modalState: l(
|
|
64
|
+
modalState: l(s),
|
|
65
65
|
parsedSpec: o.spec
|
|
66
66
|
}, null, 8, ["modalState", "parsedSpec"])
|
|
67
67
|
], 64));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchModal.vue.d.ts","sourceRoot":"","sources":["../../../src/features/Search/SearchModal.vue"],"names":[],"mappings":"AAqSA,OAAO,EAML,KAAK,UAAU,EAChB,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"SearchModal.vue.d.ts","sourceRoot":"","sources":["../../../src/features/Search/SearchModal.vue"],"names":[],"mappings":"AAqSA,OAAO,EAML,KAAK,UAAU,EAChB,MAAM,oBAAoB,CAAA;AAE3B,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAgBhD,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,IAAI,CAAA;IAChB,UAAU,EAAE,UAAU,CAAA;CACvB,CAAC;;AA6ZF,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
|
|
4
|
+
const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-b601e986"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { defineComponent as Y, toRef as A, ref as W, watch as x, createBlock as $, openBlock as h, unref as s, withCtx as l, createElementVNode as n, createVNode as g, withKeys as b, withModifiers as R, isRef as j, createElementBlock as y, Fragment as E, renderList as G, createSlots as J, normalizeClass as Q, createTextVNode as d, createCommentVNode as X, toDisplayString as c } from "vue";
|
|
2
2
|
import { ScalarModal as Z, ScalarSearchInput as _, ScalarSearchResultList as ee, ScalarSearchResultItem as te } from "@scalar/components";
|
|
3
|
+
import { scrollToId as N } from "@scalar/helpers/dom/scroll-to-id";
|
|
3
4
|
import { nanoid as oe } from "nanoid";
|
|
4
5
|
import { lazyBus as ae } from "../../components/Content/Lazy/lazyBus.js";
|
|
5
6
|
import se from "../../components/Sidebar/SidebarHttpBadge.vue.js";
|
|
6
7
|
import { useSearchIndex as ne } from "./useSearchIndex.js";
|
|
7
|
-
import { scrollToId as N } from "../../helpers/scroll-to-id.js";
|
|
8
8
|
import { useSidebar as re } from "../../hooks/useSidebar.js";
|
|
9
9
|
const le = { class: "sr-only" }, ie = { class: "sr-only" }, ve = /* @__PURE__ */ Y({
|
|
10
10
|
__name: "SearchModal",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSearchIndex.d.ts","sourceRoot":"","sources":["../../../src/features/Search/useSearchIndex.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AACtE,OAAa,EAAE,KAAK,UAAU,EAAE,MAAM,SAAS,CAAA;AAC/C,OAAO,EAAE,KAAK,GAAG,EAAwB,MAAM,KAAK,CAAA;AAGpD,OAAO,EAAE,KAAK,QAAQ,EAAgB,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"useSearchIndex.d.ts","sourceRoot":"","sources":["../../../src/features/Search/useSearchIndex.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AACtE,OAAa,EAAE,KAAK,UAAU,EAAE,MAAM,SAAS,CAAA;AAC/C,OAAO,EAAE,KAAK,GAAG,EAAwB,MAAM,KAAK,CAAA;AAGpD,OAAO,EAAE,KAAK,QAAQ,EAAgB,MAAM,sBAAsB,CAAA;AAMlE,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;uBA0ByB,IAAI;sBAbL,IAAI;;;;;EA0K5B"}
|
|
@@ -1,38 +1,39 @@
|
|
|
1
1
|
import N from "fuse.js";
|
|
2
|
-
import { ref as
|
|
3
|
-
import { useNavState as
|
|
4
|
-
import { useOperation as
|
|
5
|
-
import { useSidebar as
|
|
6
|
-
import { getHeadingsFromMarkdown as
|
|
2
|
+
import { ref as h, watch as E, computed as O } from "vue";
|
|
3
|
+
import { useNavState as P } from "../../hooks/useNavState.js";
|
|
4
|
+
import { useOperation as V } from "../../hooks/useOperation.js";
|
|
5
|
+
import { useSidebar as A } from "../../hooks/useSidebar.js";
|
|
6
|
+
import { getHeadingsFromMarkdown as B } from "../../libs/markdown.js";
|
|
7
7
|
import { extractRequestBody as z, getModels as G } from "../../libs/openapi.js";
|
|
8
|
-
|
|
8
|
+
import { operationIdParams as J } from "../traverse-schema/helpers/operation-id-params.js";
|
|
9
|
+
function S({
|
|
9
10
|
specification: R
|
|
10
11
|
}) {
|
|
11
|
-
const { hideModels: T } =
|
|
12
|
+
const { hideModels: T } = A(), { getHeadingId: j, getWebhookId: L, getModelId: W, getOperationId: q, getTagId: C } = P(), a = h([]), l = h([]), s = h(), r = h(""), c = new N(a.value, {
|
|
12
13
|
keys: ["title", "description", "body"]
|
|
13
|
-
}),
|
|
14
|
-
|
|
14
|
+
}), m = () => {
|
|
15
|
+
s.value = 0, l.value = c.search(r.value);
|
|
15
16
|
};
|
|
16
17
|
E(r, (e) => {
|
|
17
|
-
e.length ?
|
|
18
|
+
e.length ? m() : l.value = [];
|
|
18
19
|
});
|
|
19
20
|
function F() {
|
|
20
|
-
r.value = "",
|
|
21
|
+
r.value = "", s.value = void 0, l.value = [];
|
|
21
22
|
}
|
|
22
|
-
const
|
|
23
|
+
const v = O(() => r.value.length === 0 ? a.value.slice(0, 25).map((i) => ({
|
|
23
24
|
item: i
|
|
24
25
|
})) : l.value.slice(0, 25)), H = O(
|
|
25
|
-
() => typeof
|
|
26
|
+
() => typeof s.value == "number" ? v.value[s.value] : void 0
|
|
26
27
|
);
|
|
27
28
|
return E(
|
|
28
29
|
R,
|
|
29
30
|
(e) => {
|
|
30
31
|
var I, p, k, M;
|
|
31
|
-
if (
|
|
32
|
+
if (a.value = [], !((I = e == null ? void 0 : e.tags) != null && I.length) && !((p = e == null ? void 0 : e.webhooks) != null && p.length)) {
|
|
32
33
|
c.setCollection([]);
|
|
33
34
|
return;
|
|
34
35
|
}
|
|
35
|
-
const i = [], b =
|
|
36
|
+
const i = [], b = B(((k = e == null ? void 0 : e.info) == null ? void 0 : k.description) ?? "");
|
|
36
37
|
b.length && (b.forEach((t) => {
|
|
37
38
|
i.push({
|
|
38
39
|
type: "heading",
|
|
@@ -42,7 +43,7 @@ function _({
|
|
|
42
43
|
tag: t.slug,
|
|
43
44
|
body: ""
|
|
44
45
|
});
|
|
45
|
-
}),
|
|
46
|
+
}), a.value = a.value.concat(i)), (M = e == null ? void 0 : e.tags) == null || M.forEach((t) => {
|
|
46
47
|
const D = {
|
|
47
48
|
title: t["x-displayName"] ?? t.name,
|
|
48
49
|
href: `#${C(t)}`,
|
|
@@ -51,14 +52,14 @@ function _({
|
|
|
51
52
|
tag: t.name,
|
|
52
53
|
body: ""
|
|
53
54
|
};
|
|
54
|
-
|
|
55
|
-
const { parameterMap:
|
|
55
|
+
a.value.push(D), t.operations && t.operations.forEach((o) => {
|
|
56
|
+
const { parameterMap: d } = V(o), $ = z(o) || d.value;
|
|
56
57
|
let f = null;
|
|
57
58
|
typeof $ != "boolean" && (f = $);
|
|
58
59
|
const x = {
|
|
59
60
|
type: "req",
|
|
60
61
|
title: o.name ?? o.path,
|
|
61
|
-
href: `#${q(o, t)}`,
|
|
62
|
+
href: `#${q(J(o), t)}`,
|
|
62
63
|
operationId: o.operationId,
|
|
63
64
|
description: o.description ?? "",
|
|
64
65
|
httpVerb: o.httpVerb,
|
|
@@ -66,23 +67,23 @@ function _({
|
|
|
66
67
|
tag: t.name,
|
|
67
68
|
operation: o
|
|
68
69
|
};
|
|
69
|
-
f && (x.body = f),
|
|
70
|
+
f && (x.body = f), a.value.push(x);
|
|
70
71
|
});
|
|
71
72
|
});
|
|
72
73
|
const u = e == null ? void 0 : e.webhooks, y = [];
|
|
73
74
|
u && Object.keys(u).forEach((t) => {
|
|
74
75
|
Object.keys(u[t]).forEach((o) => {
|
|
75
|
-
var
|
|
76
|
+
var d;
|
|
76
77
|
y.push({
|
|
77
78
|
type: "webhook",
|
|
78
79
|
title: "Webhook",
|
|
79
80
|
href: `#${L({ name: t, method: o })}`,
|
|
80
|
-
description: `${(
|
|
81
|
+
description: `${(d = u[t][o]) == null ? void 0 : d.name}`,
|
|
81
82
|
httpVerb: o,
|
|
82
83
|
tag: t,
|
|
83
84
|
body: ""
|
|
84
85
|
});
|
|
85
|
-
}),
|
|
86
|
+
}), a.value = a.value.concat(y);
|
|
86
87
|
});
|
|
87
88
|
const n = T.value ? {} : G(e), g = [];
|
|
88
89
|
n && (Object.keys(n).forEach((t) => {
|
|
@@ -94,18 +95,18 @@ function _({
|
|
|
94
95
|
tag: t,
|
|
95
96
|
body: ""
|
|
96
97
|
});
|
|
97
|
-
}),
|
|
98
|
+
}), a.value = a.value.concat(g)), c.setCollection(a.value);
|
|
98
99
|
},
|
|
99
100
|
{ immediate: !0 }
|
|
100
101
|
), {
|
|
101
102
|
resetSearch: F,
|
|
102
|
-
fuseSearch:
|
|
103
|
-
selectedSearchIndex:
|
|
103
|
+
fuseSearch: m,
|
|
104
|
+
selectedSearchIndex: s,
|
|
104
105
|
selectedSearchResult: H,
|
|
105
|
-
searchResultsWithPlaceholderResults:
|
|
106
|
+
searchResultsWithPlaceholderResults: v,
|
|
106
107
|
searchText: r
|
|
107
108
|
};
|
|
108
109
|
}
|
|
109
110
|
export {
|
|
110
|
-
|
|
111
|
+
S as useSearchIndex
|
|
111
112
|
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { OpenAPIV3_1 } from '@scalar/openapi-types';
|
|
2
|
+
import { type Ref } from 'vue';
|
|
3
|
+
import type { TraverseSpecOptions } from '../../../features/traverse-schema';
|
|
4
|
+
/** Track which sidebar items are opened */
|
|
5
|
+
type CollapsedSidebarItems = Record<string, boolean>;
|
|
6
|
+
/**
|
|
7
|
+
* Creating sidebar with only one traversal of the spec
|
|
8
|
+
*
|
|
9
|
+
* TODO:
|
|
10
|
+
* - add the search index creation as well
|
|
11
|
+
* - update docs
|
|
12
|
+
* - tagged models
|
|
13
|
+
*/
|
|
14
|
+
export declare const createSidebar: (dereferencedDocument: Ref<OpenAPIV3_1.Document>, options: TraverseSpecOptions) => {
|
|
15
|
+
collapsedSidebarItems: CollapsedSidebarItems;
|
|
16
|
+
isSidebarOpen: Ref<boolean, boolean>;
|
|
17
|
+
items: import("vue").ComputedRef<{
|
|
18
|
+
entries: import("../../traverse-schema/types").TraversedEntry[];
|
|
19
|
+
titles: Map<string, string>;
|
|
20
|
+
}>;
|
|
21
|
+
scrollToOperation: (operationId: string, focus?: boolean) => void;
|
|
22
|
+
setCollapsedSidebarItem: (key: string, value: boolean) => boolean;
|
|
23
|
+
toggleCollapsedSidebarItem: (key: string) => boolean;
|
|
24
|
+
};
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=create-sidebar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-sidebar.d.ts","sourceRoot":"","sources":["../../../../src/features/sidebar/helpers/create-sidebar.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAExD,OAAO,EAA2B,KAAK,GAAG,EAAE,MAAM,KAAK,CAAA;AAGvD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAA;AAKrE,2CAA2C;AAC3C,KAAK,qBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAEpD;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,yBAA0B,GAAG,CAAC,WAAW,CAAC,QAAQ,CAAC,WAAW,mBAAmB;;;;;;;qCAajE,MAAM,UAAU,OAAO;mCARzB,MAAM,SAAS,OAAO;sCADnB,MAAM;CAgDhD,CAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { OpenAPIV3_1 } from '@scalar/openapi-types';
|
|
2
|
+
import { type InjectionKey, type Ref } from 'vue';
|
|
3
|
+
import { createSidebar } from '../../../features/sidebar/helpers/create-sidebar';
|
|
4
|
+
import type { TraverseSpecOptions } from '../../../features/traverse-schema';
|
|
5
|
+
type Sidebar = ReturnType<typeof createSidebar>;
|
|
6
|
+
/**
|
|
7
|
+
* Injection key for the sidebar instance.
|
|
8
|
+
* This ensures type safety when injecting the sidebar.
|
|
9
|
+
*/
|
|
10
|
+
export declare const SIDEBAR_SYMBOL: InjectionKey<Sidebar>;
|
|
11
|
+
type UseSidebar = {
|
|
12
|
+
(): Sidebar;
|
|
13
|
+
(content: Ref<OpenAPIV3_1.Document>, options: TraverseSpecOptions): Sidebar;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Composable for managing the sidebar state.
|
|
17
|
+
*
|
|
18
|
+
* When called with a collection and options, it creates and provides a new sidebar instance.
|
|
19
|
+
* When called without parameters, it returns the injected sidebar state.
|
|
20
|
+
*/
|
|
21
|
+
export declare const useSidebar: UseSidebar;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=useSidebar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSidebar.d.ts","sourceRoot":"","sources":["../../../../src/features/sidebar/hooks/useSidebar.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,GAAG,EAAmB,MAAM,KAAK,CAAA;AAElE,OAAO,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAA;AACzE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAA;AAErE,KAAK,OAAO,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAA;AAE/C;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,YAAY,CAAC,OAAO,CAAY,CAAA;AAE7D,KAAK,UAAU,GAAG;IAChB,IAAI,OAAO,CAAA;IACX,CAAC,OAAO,EAAE,GAAG,CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAA;CAC5E,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,UAAU,EAAE,UAuBxB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/features/sidebar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { OpenAPIV3_1 } from '@scalar/openapi-types';
|
|
2
|
+
/** Grabs the tag from the dict or creates one if it doesn't exist */
|
|
3
|
+
export declare const getTag: (tagsDict: Map<string, OpenAPIV3_1.TagObject>, name: string) => import("@scalar/openapi-types").OpenAPIV3.TagObject;
|
|
4
|
+
//# sourceMappingURL=get-tag.d.ts.map
|