@scalar/api-reference 1.28.5 → 1.28.7
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 +41 -0
- package/dist/browser/standalone.js +6284 -6218
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/ApiReference.vue.d.ts.map +1 -1
- package/dist/components/ApiReference.vue.js +26 -15
- package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
- package/dist/components/ApiReferenceLayout.vue.js +2 -2
- package/dist/components/ApiReferenceLayout.vue2.js +128 -129
- package/dist/components/Content/ClientLibraries/ClientLibraries.vue.d.ts.map +1 -1
- package/dist/components/Content/ClientLibraries/ClientLibraries.vue.js +2 -2
- package/dist/components/Content/Content.vue.d.ts.map +1 -1
- package/dist/components/Content/Content.vue.js +2 -2
- package/dist/components/Content/Content.vue2.js +57 -55
- 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/Introduction/Introduction.vue.d.ts.map +1 -1
- package/dist/components/Content/Introduction/Introduction.vue.js +2 -2
- package/dist/components/Content/Introduction/Introduction.vue2.js +24 -24
- package/dist/components/Content/Lazy/Lazy.vue.d.ts.map +1 -1
- package/dist/components/Content/Lazy/Loading.vue.d.ts.map +1 -1
- package/dist/components/Content/Lazy/Loading.vue.js +4 -2
- package/dist/components/Content/Models/Models.vue.d.ts.map +1 -1
- package/dist/components/Content/Models/Models.vue.js +2 -2
- package/dist/components/Content/Models/Models.vue2.js +18 -17
- package/dist/components/Content/Schema/Schema.vue.d.ts +1 -0
- package/dist/components/Content/Schema/Schema.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/Schema.vue.js +4 -4
- package/dist/components/Content/Schema/Schema.vue2.js +79 -67
- package/dist/components/Content/Schema/SchemaDiscriminator.vue.d.ts +12 -0
- package/dist/components/Content/Schema/SchemaDiscriminator.vue.d.ts.map +1 -0
- package/dist/components/Content/Schema/SchemaDiscriminator.vue.js +7 -0
- package/dist/components/Content/Schema/SchemaDiscriminator.vue2.js +109 -0
- package/dist/components/Content/Schema/SchemaHeading.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaHeading.vue.js +2 -2
- package/dist/components/Content/Schema/SchemaHeading.vue2.js +26 -31
- package/dist/components/Content/Schema/SchemaProperty.vue.d.ts +3 -0
- package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaProperty.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaProperty.vue2.js +143 -141
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue2.js +83 -99
- package/dist/components/Content/Tag/OperationsList.vue.js +2 -2
- package/dist/components/Content/Tag/OperationsList.vue2.js +3 -3
- package/dist/components/Content/Tag/Tag.vue.d.ts.map +1 -1
- package/dist/components/Content/Tag/Tag.vue.js +41 -36
- package/dist/components/Content/Tag/TagList.vue.d.ts +2 -0
- package/dist/components/Content/Tag/TagList.vue.d.ts.map +1 -1
- package/dist/components/Content/Tag/TagList.vue.js +38 -36
- package/dist/components/Content/Tag/TagSection.vue.js +2 -2
- package/dist/components/Content/Tag/TagSection.vue2.js +3 -3
- package/dist/components/HttpMethod/HttpMethod.vue.d.ts.map +1 -1
- package/dist/components/Layouts/ModernLayout.vue.d.ts.map +1 -1
- package/dist/components/Layouts/ModernLayout.vue.js +1 -1
- package/dist/components/Section/CompactSection.vue.d.ts.map +1 -1
- package/dist/components/Section/CompactSection.vue.js +2 -2
- package/dist/components/Section/Section.vue.d.ts.map +1 -1
- package/dist/components/Section/Section.vue.js +2 -2
- package/dist/components/Section/SectionHeaderTag.vue.d.ts.map +1 -1
- package/dist/components/Section/SectionHeaderTag.vue.js +2 -2
- 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 +2 -1
- package/dist/components/Sidebar/SidebarElement.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarElement.vue.js +2 -2
- package/dist/components/Sidebar/SidebarElement.vue2.js +40 -39
- package/dist/esm.d.ts.map +1 -1
- package/dist/features/ApiClientModal/ApiClientModal.vue.d.ts.map +1 -1
- package/dist/features/ApiClientModal/useApiClient.d.ts +2 -4
- package/dist/features/ApiClientModal/useApiClient.d.ts.map +1 -1
- package/dist/features/BaseUrl/BaseUrl.vue.d.ts.map +1 -1
- package/dist/features/BaseUrl/BaseUrl.vue.js +2 -1
- 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 +2 -1
- package/dist/features/ExampleResponses/ExampleResponses.vue.d.ts.map +1 -1
- package/dist/features/ExampleResponses/ExampleResponses.vue.js +3 -3
- package/dist/features/ExampleResponses/ExampleResponses.vue2.js +6 -8
- package/dist/features/Operation/Operation.vue.d.ts +2 -0
- package/dist/features/Operation/Operation.vue.d.ts.map +1 -1
- package/dist/features/Operation/Operation.vue.js +13 -10
- package/dist/features/Operation/Webhooks.vue.d.ts.map +1 -1
- package/dist/features/Operation/Webhooks.vue.js +2 -2
- package/dist/features/Operation/components/ContentTypeSelect.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/ContentTypeSelect.vue.js +4 -4
- package/dist/features/Operation/components/OperationParameters.vue.d.ts +2 -0
- package/dist/features/Operation/components/OperationParameters.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/OperationParameters.vue.js +37 -31
- package/dist/features/Operation/components/OperationResponses.vue.d.ts +2 -0
- package/dist/features/Operation/components/OperationResponses.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/OperationResponses.vue.js +15 -13
- package/dist/features/Operation/components/ParameterList.vue.d.ts +2 -0
- package/dist/features/Operation/components/ParameterList.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/ParameterList.vue.js +2 -2
- package/dist/features/Operation/components/ParameterList.vue2.js +14 -12
- package/dist/features/Operation/components/ParameterListItem.vue.d.ts +2 -0
- package/dist/features/Operation/components/ParameterListItem.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/ParameterListItem.vue.js +2 -2
- package/dist/features/Operation/components/ParameterListItem.vue2.js +20 -18
- package/dist/features/Operation/components/RequestBody.vue.d.ts +2 -0
- package/dist/features/Operation/components/RequestBody.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/RequestBody.vue.js +2 -2
- package/dist/features/Operation/components/RequestBody.vue2.js +20 -18
- package/dist/features/Operation/hooks/useResponses.d.ts.map +1 -1
- package/dist/features/Operation/hooks/useResponses.js +2 -1
- package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts +2 -0
- package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts.map +1 -1
- package/dist/features/Operation/layouts/ClassicLayout.vue.js +2 -2
- package/dist/features/Operation/layouts/ClassicLayout.vue2.js +29 -24
- package/dist/features/Operation/layouts/ModernLayout.vue.d.ts +2 -0
- package/dist/features/Operation/layouts/ModernLayout.vue.d.ts.map +1 -1
- package/dist/features/Operation/layouts/ModernLayout.vue.js +2 -2
- package/dist/features/Operation/layouts/ModernLayout.vue2.js +66 -56
- 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 +2 -1
- package/dist/features/Search/useSearchIndex.d.ts.map +1 -1
- package/dist/features/Search/useSearchIndex.js +9 -9
- package/dist/helpers/index.d.ts +4 -4
- package/dist/helpers/scrollToId.d.ts.map +1 -1
- package/dist/helpers/specHelpers.js +15 -14
- package/dist/hooks/index.d.ts +0 -2
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/useMultipleDocuments.d.ts +7 -2
- package/dist/hooks/useMultipleDocuments.d.ts.map +1 -1
- package/dist/hooks/useMultipleDocuments.js +43 -33
- package/dist/hooks/useNavState.d.ts +13 -4
- package/dist/hooks/useNavState.d.ts.map +1 -1
- package/dist/hooks/useNavState.js +52 -47
- package/dist/hooks/useReactiveSpec.d.ts.map +1 -1
- package/dist/hooks/useSidebar.d.ts.map +1 -1
- package/dist/hooks/useSidebar.js +3 -2
- package/dist/index.d.ts +6 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +39 -76
- package/dist/libs/operation.d.ts.map +1 -1
- package/dist/standalone/lib/html-api.d.ts +4 -4
- package/dist/standalone/lib/html-api.d.ts.map +1 -1
- package/dist/stores/useHttpClientStore.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types.d.ts +1 -10
- package/dist/types.d.ts.map +1 -1
- package/package.json +12 -10
- package/dist/helpers/getVariableNames.js +0 -7
- package/dist/helpers/hasSecuritySchemes.js +0 -7
- package/dist/helpers/mapFromObject.js +0 -7
- package/dist/helpers/mergeAllObjects.js +0 -7
- package/dist/hooks/useClientStore.d.ts +0 -2
- package/dist/hooks/useClientStore.d.ts.map +0 -1
- package/dist/hooks/useClientStore.js +0 -5
- package/dist/hooks/useRefOnMount.d.ts +0 -6
- package/dist/hooks/useRefOnMount.d.ts.map +0 -1
- package/dist/hooks/useRefOnMount.js +0 -10
|
@@ -1,57 +1,67 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
const f = "api", p = new S(), R = (e, s = 0) => {
|
|
1
|
+
import { isDefined as S } from "@scalar/oas-utils/helpers";
|
|
2
|
+
import { isConfigurationWithSources as p, apiReferenceConfigurationSchema as m } from "@scalar/types/api-reference";
|
|
3
|
+
import y from "github-slugger";
|
|
4
|
+
import { computed as v, ref as R, watch as b } from "vue";
|
|
5
|
+
const d = "api", w = new y(), A = (e, r = 0) => {
|
|
7
6
|
if (!(!(e != null && e.url) && !(e != null && e.content)))
|
|
8
|
-
return
|
|
7
|
+
return w.reset(), e.title ? {
|
|
9
8
|
...e,
|
|
10
|
-
slug: e.slug ||
|
|
9
|
+
slug: e.slug || w.slug(e.title),
|
|
11
10
|
title: e.title
|
|
12
11
|
} : e.slug ? {
|
|
13
12
|
...e,
|
|
14
13
|
title: e.slug
|
|
15
14
|
} : {
|
|
16
15
|
...e,
|
|
17
|
-
slug: `api-${
|
|
18
|
-
title: `API #${
|
|
16
|
+
slug: `api-${r + 1}`,
|
|
17
|
+
title: `API #${r + 1}`
|
|
19
18
|
};
|
|
20
|
-
},
|
|
21
|
-
|
|
19
|
+
}, N = ({
|
|
20
|
+
configuration: e,
|
|
21
|
+
initialIndex: r,
|
|
22
|
+
isIntersectionEnabled: s,
|
|
23
|
+
hash: o,
|
|
24
|
+
hashPrefix: f
|
|
25
|
+
}) => {
|
|
26
|
+
const a = v(() => {
|
|
22
27
|
var l;
|
|
23
|
-
return e.value ? (
|
|
24
|
-
}),
|
|
25
|
-
if (
|
|
28
|
+
return e.value ? (p(e.value) ? ((l = e.value) == null ? void 0 : l.sources) ?? [] : [e.value].flat().map((t) => t)).map((t, n) => t && A(t, n)).filter(S) : [];
|
|
29
|
+
}), g = (i) => {
|
|
30
|
+
if (typeof window > "u" || a.value.length === 1)
|
|
26
31
|
return;
|
|
27
|
-
const l = new URL(window.location.href), t =
|
|
28
|
-
l.searchParams.set(
|
|
29
|
-
},
|
|
30
|
-
|
|
32
|
+
const l = new URL(window.location.href), t = a.value[i], n = (t == null ? void 0 : t.slug) ?? i.toString();
|
|
33
|
+
l.searchParams.set(d, n), l.hash = "", window.history.replaceState({}, "", l.toString()), o.value = "", f.value = "", s.value = !1, typeof window < "u" && window.scrollTo({ top: 0, behavior: "instant" });
|
|
34
|
+
}, u = R((() => {
|
|
35
|
+
if (typeof window > "u")
|
|
36
|
+
return typeof r == "number" ? r : 0;
|
|
37
|
+
const l = new URL(window.location.href).searchParams.get(d) || "0", t = a.value.findIndex((h) => h.slug === l);
|
|
31
38
|
if (t !== -1)
|
|
32
39
|
return t;
|
|
33
|
-
const
|
|
34
|
-
return !isNaN(
|
|
35
|
-
})()),
|
|
40
|
+
const n = Number.parseInt(l, 10);
|
|
41
|
+
return !isNaN(n) && n >= 0 && n < a.value.length ? n : typeof r == "number" ? r : 0;
|
|
42
|
+
})()), c = v(() => {
|
|
36
43
|
var l, t;
|
|
37
|
-
if (e.value &&
|
|
44
|
+
if (e.value && p(e.value))
|
|
38
45
|
return m.parse({
|
|
39
46
|
...e.value,
|
|
40
|
-
...(t = (l = e.value) == null ? void 0 : l.sources) == null ? void 0 : t[
|
|
41
|
-
...
|
|
47
|
+
...(t = (l = e.value) == null ? void 0 : l.sources) == null ? void 0 : t[u.value],
|
|
48
|
+
...a.value[u.value]
|
|
42
49
|
});
|
|
43
|
-
const
|
|
50
|
+
const i = [e.value].flat()[u.value] ?? {};
|
|
44
51
|
return m.parse({
|
|
45
|
-
...
|
|
46
|
-
...
|
|
52
|
+
...i,
|
|
53
|
+
...a.value[u.value]
|
|
47
54
|
});
|
|
48
55
|
});
|
|
49
|
-
return b(
|
|
50
|
-
selectedConfiguration:
|
|
51
|
-
availableDocuments:
|
|
52
|
-
selectedDocumentIndex:
|
|
56
|
+
return b(u, g, { flush: "sync" }), {
|
|
57
|
+
selectedConfiguration: c,
|
|
58
|
+
availableDocuments: a,
|
|
59
|
+
selectedDocumentIndex: u,
|
|
60
|
+
isIntersectionEnabled: s,
|
|
61
|
+
hash: o,
|
|
62
|
+
hashPrefix: f
|
|
53
63
|
};
|
|
54
64
|
};
|
|
55
65
|
export {
|
|
56
|
-
|
|
66
|
+
N as useMultipleDocuments
|
|
57
67
|
};
|
|
@@ -1,4 +1,14 @@
|
|
|
1
|
-
import type { Heading,
|
|
1
|
+
import type { Heading, Tag, TransformedOperation } from '@scalar/types/legacy';
|
|
2
|
+
import { type InjectionKey, type Ref } from 'vue';
|
|
3
|
+
export type NavState = {
|
|
4
|
+
/** The URL hash without the #, also the "hash" pulled from pathRouting */
|
|
5
|
+
hash: Ref<string>;
|
|
6
|
+
/** The prefix for the hash, used in ORG */
|
|
7
|
+
hashPrefix: Ref<string>;
|
|
8
|
+
/** Whether the intersection observer is enabled and updating the hash as we scroll */
|
|
9
|
+
isIntersectionEnabled: Ref<boolean>;
|
|
10
|
+
};
|
|
11
|
+
export declare const NAV_STATE_SYMBOL: InjectionKey<NavState>;
|
|
2
12
|
/**
|
|
3
13
|
* Hook which provides reactive hash state from the URL
|
|
4
14
|
* Also hash is only readable by the client so keep that in mind for SSR
|
|
@@ -7,7 +17,7 @@ import type { Heading, PathRouting, Tag, TransformedOperation } from '@scalar/ty
|
|
|
7
17
|
* when clicking on sidebar links or going backwards
|
|
8
18
|
*/
|
|
9
19
|
export declare const useNavState: () => {
|
|
10
|
-
hash:
|
|
20
|
+
hash: Ref<string, string>;
|
|
11
21
|
/** Sets the prefix for the hash */
|
|
12
22
|
setHashPrefix: (prefix: string) => void;
|
|
13
23
|
/**
|
|
@@ -42,8 +52,7 @@ export declare const useNavState: () => {
|
|
|
42
52
|
getPathRoutingId: (pathName: string) => string;
|
|
43
53
|
getSectionId: (hashStr?: string) => string;
|
|
44
54
|
getTagId: (tag: Tag) => string;
|
|
45
|
-
isIntersectionEnabled:
|
|
46
|
-
pathRouting: import("vue").Ref<PathRouting | undefined, PathRouting | undefined>;
|
|
55
|
+
isIntersectionEnabled: Ref<boolean, boolean>;
|
|
47
56
|
updateHash: () => void;
|
|
48
57
|
};
|
|
49
58
|
//# sourceMappingURL=useNavState.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useNavState.d.ts","sourceRoot":"","sources":["../../src/hooks/useNavState.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"useNavState.d.ts","sourceRoot":"","sources":["../../src/hooks/useNavState.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,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
|
2
|
+
import { combineUrlAndPath as R } from "@scalar/oas-utils/helpers";
|
|
3
|
+
import { slug as l } from "github-slugger";
|
|
4
|
+
import { ref as i, inject as b } from "vue";
|
|
5
|
+
const y = Symbol(), U = i(!1), P = i(""), k = i(""), C = () => {
|
|
6
|
+
const { isIntersectionEnabled: h, hash: r, hashPrefix: o } = b(y, {
|
|
7
|
+
isIntersectionEnabled: U,
|
|
8
|
+
hash: P,
|
|
9
|
+
hashPrefix: k
|
|
10
|
+
}), t = $(), c = (e) => {
|
|
11
|
+
var n;
|
|
12
|
+
if (!t.value.pathRouting)
|
|
13
|
+
return "";
|
|
14
|
+
const a = new RegExp("^" + ((n = t.value.pathRouting) == null ? void 0 : n.basePath) + "/?");
|
|
15
|
+
return decodeURIComponent(e.replace(a, ""));
|
|
16
|
+
}, d = (e = r.value) => {
|
|
17
|
+
var g;
|
|
18
|
+
const a = (g = e.match(/(tag\/[^/]+)/)) == null ? void 0 : g[0], n = e.startsWith("model") ? "models" : "", u = e.startsWith("webhook") ? "webhooks" : "";
|
|
19
|
+
return a || n || u;
|
|
20
|
+
}, f = () => {
|
|
21
|
+
r.value = t.value.pathRouting ? c(window.location.pathname) : (
|
|
22
|
+
// Must remove the prefix from the hash as the internal hash value should be pure
|
|
23
|
+
decodeURIComponent(window.location.hash.replace(/^#/, "")).slice(o.value.length)
|
|
24
|
+
);
|
|
25
|
+
}, p = (e, a = window.location.href) => {
|
|
26
|
+
const n = new URL(a);
|
|
27
|
+
t.value.pathRouting ? n.pathname = R(t.value.pathRouting.basePath, e) : n.hash = o.value + e, r.value = e, window.history.replaceState({}, "", n);
|
|
28
|
+
}, m = (e, a = window.location.href, n = window.location.search) => {
|
|
29
|
+
const u = new URL(a);
|
|
30
|
+
return u.hash = o.value + e, u.search = n, u.toString();
|
|
31
|
+
}, v = (e = r.value) => `${o.value}${e}`, I = () => decodeURIComponent(window.location.hash.replace(/^#/, "").slice(o.value.length)), w = (e) => typeof t.value.generateHeadingSlug == "function" ? `${t.value.generateHeadingSlug(e)}` : e.slug ? `description/${e.slug}` : "", S = (e) => e != null && e.name ? typeof t.value.generateModelSlug == "function" ? `model/${t.value.generateModelSlug(e)}` : `model/${l(e.name)}` : "models", s = (e) => typeof t.value.generateTagSlug == "function" ? `tag/${t.value.generateTagSlug(e)}` : `tag/${l(e.name)}`;
|
|
27
32
|
return {
|
|
28
|
-
hash:
|
|
33
|
+
hash: r,
|
|
29
34
|
/** Sets the prefix for the hash */
|
|
30
35
|
setHashPrefix: (e) => {
|
|
31
|
-
|
|
36
|
+
o.value = e;
|
|
32
37
|
},
|
|
33
38
|
/**
|
|
34
39
|
* Gets the full hash with the prefix
|
|
35
40
|
* @param hashTarget The hash to target with the return
|
|
36
41
|
* @returns The full hash
|
|
37
42
|
*/
|
|
38
|
-
getFullHash:
|
|
43
|
+
getFullHash: v,
|
|
39
44
|
/**
|
|
40
45
|
* Gets the hashed url with the prefix
|
|
41
46
|
* @param replacementHash The hash to replace the current hash with
|
|
42
47
|
* @param url The url to get the hashed url from
|
|
43
48
|
* @returns The hashed url
|
|
44
49
|
*/
|
|
45
|
-
getHashedUrl:
|
|
50
|
+
getHashedUrl: m,
|
|
46
51
|
/**
|
|
47
52
|
* Replaces the URL state with the new url and hash
|
|
48
53
|
* Replacement is used so that hash changes don't trigger the url hash watcher and cause a scroll
|
|
49
54
|
*/
|
|
50
|
-
replaceUrlState:
|
|
55
|
+
replaceUrlState: p,
|
|
51
56
|
/** Gets the portion of the hash used by the references */
|
|
52
|
-
getReferenceHash:
|
|
53
|
-
getWebhookId: (e) => e != null && e.name ? typeof t.value.generateWebhookSlug == "function" ? `webhook/${t.value.generateWebhookSlug(e)}` : `webhook/${e.method}/${
|
|
54
|
-
getModelId:
|
|
55
|
-
getHeadingId:
|
|
56
|
-
getOperationId: (e,
|
|
57
|
-
var
|
|
58
|
-
return typeof t.value.generateOperationSlug == "function" ? `${
|
|
57
|
+
getReferenceHash: I,
|
|
58
|
+
getWebhookId: (e) => e != null && e.name ? typeof t.value.generateWebhookSlug == "function" ? `webhook/${t.value.generateWebhookSlug(e)}` : `webhook/${e.method}/${l(e.name)}` : "webhooks",
|
|
59
|
+
getModelId: S,
|
|
60
|
+
getHeadingId: w,
|
|
61
|
+
getOperationId: (e, a) => {
|
|
62
|
+
var n;
|
|
63
|
+
return typeof t.value.generateOperationSlug == "function" ? `${s(a)}/${t.value.generateOperationSlug({
|
|
59
64
|
path: e.path,
|
|
60
65
|
operationId: e.operationId,
|
|
61
66
|
method: e.httpVerb,
|
|
62
|
-
summary: (
|
|
63
|
-
})}` : `${
|
|
67
|
+
summary: (n = e.information) == null ? void 0 : n.summary
|
|
68
|
+
})}` : `${s(a)}/${e.httpVerb}${e.path}`;
|
|
64
69
|
},
|
|
65
|
-
getPathRoutingId:
|
|
66
|
-
getSectionId:
|
|
67
|
-
getTagId:
|
|
68
|
-
isIntersectionEnabled:
|
|
69
|
-
|
|
70
|
-
updateHash: I
|
|
70
|
+
getPathRoutingId: c,
|
|
71
|
+
getSectionId: d,
|
|
72
|
+
getTagId: s,
|
|
73
|
+
isIntersectionEnabled: h,
|
|
74
|
+
updateHash: f
|
|
71
75
|
};
|
|
72
76
|
};
|
|
73
77
|
export {
|
|
74
|
-
|
|
78
|
+
y as NAV_STATE_SYMBOL,
|
|
79
|
+
C as useNavState
|
|
75
80
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useReactiveSpec.d.ts","sourceRoot":"","sources":["../../src/hooks/useReactiveSpec.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AACpE,OAAO,EAAE,KAAK,gBAAgB,EAAiC,MAAM,KAAK,CAAA;AAoD1E;;GAEG;AACH,wBAAgB,eAAe,CAAC,EAC9B,UAAU,EACV,QAAQ,GACT,EAAE;IACD,UAAU,CAAC,EAAE,gBAAgB,CAAC,iBAAiB,CAAC,CAAA;IAChD,QAAQ,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAA;CACpC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"useReactiveSpec.d.ts","sourceRoot":"","sources":["../../src/hooks/useReactiveSpec.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AACpE,OAAO,EAAE,KAAK,gBAAgB,EAAiC,MAAM,KAAK,CAAA;AAoD1E;;GAEG;AACH,wBAAgB,eAAe,CAAC,EAC9B,UAAU,EACV,QAAQ,GACT,EAAE;IACD,UAAU,CAAC,EAAE,gBAAgB,CAAC,iBAAiB,CAAC,CAAA;IAChD,QAAQ,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAA;CACpC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyDA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSidebar.d.ts","sourceRoot":"","sources":["../../src/hooks/useSidebar.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAa3E,MAAM,MAAM,YAAY,GAAG;IACzB,EAAE,EAAE,MAAM,C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AAA;AAIpD,iBAAS,0BAA0B,CAAC,GAAG,EAAE,MAAM,QAE9C;AAED,iBAAS,uBAAuB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,QAE3D;AAkOD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,UAAU,EAAE,IAAI,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,YAAY,GAAG;IACzB,UAAU,CAAC,EAAE,OAAO,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,KAAK,MAAM,CAAC,CAAA;IACnD,gBAAgB,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,CAAC,CAAC,CAAC,EAAE,oBAAoB,EAAE,CAAC,EAAE,oBAAoB,KAAK,MAAM,CAAC,CAAA;CACvG,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,gBAAiB,MAAM,UAAU,OAAO,SAiBrE,CAAA;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,OAAO,CAAC,EAAE,gBAAgB,GAAG,YAAY;;;;;;;;;;;;;qCAtBrB,MAAM,UAAU,OAAO;EAiFrE"}
|
package/dist/hooks/useSidebar.js
CHANGED
|
@@ -7,8 +7,8 @@ import { getLowestHeadingLevel as K } from "../helpers/getLowestHeadingLevel.js"
|
|
|
7
7
|
import { hasModels as ee } from "../helpers/hasModels.js";
|
|
8
8
|
import { getModels as P } from "../helpers/getModels.js";
|
|
9
9
|
import { hasWebhooks as te } from "../helpers/hasWebhooks.js";
|
|
10
|
-
import { scrollToId as R } from "../helpers/scrollToId.js";
|
|
11
10
|
import { getHeadingsFromMarkdown as se } from "../helpers/getHeadingsFromMarkdown.js";
|
|
11
|
+
import { scrollToId as R } from "../helpers/scrollToId.js";
|
|
12
12
|
const y = S(null), u = S(void 0), v = q({});
|
|
13
13
|
function _(t) {
|
|
14
14
|
var p, r, i;
|
|
@@ -41,7 +41,8 @@ function oe(t) {
|
|
|
41
41
|
}
|
|
42
42
|
const U = J(() => {
|
|
43
43
|
var C, H, B, E, j, V, D, G, L, W;
|
|
44
|
-
if (!y.value)
|
|
44
|
+
if (!y.value)
|
|
45
|
+
return { entries: [], titles: {} };
|
|
45
46
|
const { getHeadingId: t, getModelId: a, getOperationId: l, getTagId: c, getWebhookId: p } = y.value, r = {}, i = [];
|
|
46
47
|
let s = null;
|
|
47
48
|
k.value.forEach((e) => {
|
package/dist/index.d.ts
CHANGED
|
@@ -8,9 +8,11 @@ export { type ApiReferenceInstance, createApiReference } from './standalone/lib/
|
|
|
8
8
|
export { Sidebar } from './components/Sidebar';
|
|
9
9
|
export { Card, CardHeader, CardContent, CardFooter, CardTabHeader, CardTab } from './components/Card';
|
|
10
10
|
export { Layouts } from './components/Layouts';
|
|
11
|
-
export
|
|
12
|
-
export
|
|
13
|
-
export
|
|
14
|
-
export
|
|
11
|
+
export { parse } from './helpers/parse.js';
|
|
12
|
+
export { createEmptySpecification } from './helpers/createEmptySpecification.js';
|
|
13
|
+
export { useNavState } from './hooks/useNavState.js';
|
|
14
|
+
export { useSidebar } from './hooks/useSidebar.js';
|
|
15
|
+
export { useHttpClientStore } from './stores/useHttpClientStore.js';
|
|
16
|
+
export type { ApiReferenceConfiguration, ReferenceProps, ReferenceConfiguration, } from './types';
|
|
15
17
|
export { createScalarReferences } from './esm.js';
|
|
16
18
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,+BAA+B,CAAA;AACvE,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,qCAAqC,CAAA;AACnF,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,uCAAuC,CAAA;AAC/E,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;
|
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