@scalar/api-reference 1.35.7 → 1.36.1
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 +39 -0
- package/dist/browser/standalone.js +14984 -15007
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
- package/dist/components/ApiReferenceLayout.vue.js +1 -1
- package/dist/components/ApiReferenceLayout.vue2.js +148 -150
- package/dist/components/Content/Content.vue.d.ts.map +1 -1
- package/dist/components/Content/Content.vue.js +44 -51
- package/dist/components/Content/Models/ClassicLayout.vue.d.ts +4 -1
- package/dist/components/Content/Models/ClassicLayout.vue.d.ts.map +1 -1
- package/dist/components/Content/Models/ClassicLayout.vue.js +1 -1
- package/dist/components/Content/Models/ClassicLayout.vue2.js +49 -40
- package/dist/components/Content/Models/Models.vue.d.ts +2 -2
- package/dist/components/Content/Models/Models.vue.d.ts.map +1 -1
- package/dist/components/Content/Models/Models.vue.js +25 -23
- package/dist/components/Content/Models/ModernLayout.vue.d.ts +1 -0
- package/dist/components/Content/Models/ModernLayout.vue.d.ts.map +1 -1
- package/dist/components/Content/Models/ModernLayout.vue.js +2 -2
- package/dist/components/Content/Models/ModernLayout.vue2.js +54 -51
- package/dist/components/Content/Operations/TraversedEntry.vue.d.ts +1 -2
- package/dist/components/Content/Operations/TraversedEntry.vue.d.ts.map +1 -1
- package/dist/components/Content/Operations/TraversedEntry.vue.js +24 -24
- package/dist/components/Content/Operations/TraversedEntryContainer.vue.d.ts.map +1 -1
- package/dist/components/Content/Operations/TraversedEntryContainer.vue.js +1 -1
- package/dist/components/Content/Operations/get-current-index.d.ts +1 -1
- package/dist/components/Content/Operations/get-current-index.d.ts.map +1 -1
- package/dist/components/Content/Operations/get-current-index.js +1 -1
- package/dist/components/Content/Schema/Schema.vue.d.ts +3 -4
- package/dist/components/Content/Schema/Schema.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/Schema.vue.js +2 -2
- package/dist/components/Content/Schema/Schema.vue2.js +72 -75
- package/dist/components/Content/Schema/SchemaComposition.vue.d.ts +4 -5
- package/dist/components/Content/Schema/SchemaComposition.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaComposition.vue.js +46 -49
- package/dist/components/Content/Schema/SchemaObjectProperties.vue.d.ts +2 -7
- package/dist/components/Content/Schema/SchemaObjectProperties.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaObjectProperties.vue.js +33 -54
- package/dist/components/Content/Schema/SchemaProperty.vue.d.ts +4 -6
- 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 +72 -76
- package/dist/components/Content/Schema/helpers/sort-property-names.d.ts +16 -0
- package/dist/components/Content/Schema/helpers/sort-property-names.d.ts.map +1 -0
- package/dist/components/Content/Schema/helpers/sort-property-names.js +36 -0
- package/dist/components/Content/Schema/types.d.ts +17 -0
- package/dist/components/Content/Schema/types.d.ts.map +1 -0
- package/dist/components/Content/Tags/ClassicLayout.vue.d.ts +1 -1
- package/dist/components/Content/Tags/ClassicLayout.vue.d.ts.map +1 -1
- package/dist/components/Content/Tags/ClassicLayout.vue.js +2 -2
- package/dist/components/Content/Tags/ClassicLayout.vue2.js +1 -1
- package/dist/components/Content/Tags/ModernLayout.vue.d.ts +1 -1
- package/dist/components/Content/Tags/ModernLayout.vue.d.ts.map +1 -1
- package/dist/components/Content/Tags/ModernLayout.vue.js +2 -2
- package/dist/components/Content/Tags/ModernLayout.vue2.js +2 -2
- package/dist/components/Content/Tags/Tag.vue.d.ts +1 -1
- package/dist/components/Content/Tags/Tag.vue.d.ts.map +1 -1
- package/dist/components/Content/Tags/TagSection.vue.d.ts +1 -1
- package/dist/components/Content/Tags/TagSection.vue.d.ts.map +1 -1
- package/dist/components/Content/Tags/TagSection.vue.js +4 -4
- package/dist/components/MobileHeader.vue.js +2 -2
- package/dist/components/MobileHeader.vue2.js +1 -1
- package/dist/components/OperationsList/OperationsList.vue.d.ts +1 -1
- package/dist/components/OperationsList/OperationsList.vue.d.ts.map +1 -1
- package/dist/components/OperationsList/OperationsList.vue.js +1 -1
- package/dist/components/OperationsList/OperationsList.vue2.js +9 -11
- package/dist/components/OperationsList/OperationsListItem.vue.d.ts +1 -1
- package/dist/components/OperationsList/OperationsListItem.vue.d.ts.map +1 -1
- package/dist/components/OperationsList/OperationsListItem.vue.js +2 -2
- package/dist/components/OperationsList/OperationsListItem.vue2.js +24 -27
- package/dist/components/Section/Section.vue.d.ts.map +1 -1
- package/dist/components/Section/Section.vue.js +2 -2
- package/dist/components/Section/Section.vue2.js +12 -13
- package/dist/components/Section/SectionAccordion.vue.d.ts.map +1 -1
- package/dist/components/Section/SectionAccordion.vue.js +1 -1
- package/dist/components/Section/SectionAccordion.vue2.js +36 -37
- package/dist/components/ShowMoreButton.vue.js +2 -2
- package/dist/components/ShowMoreButton.vue2.js +3 -3
- package/dist/features/Operation/Operation.vue.d.ts.map +1 -1
- package/dist/features/Operation/Operation.vue.js +32 -22
- package/dist/features/Operation/components/Header.vue.d.ts +2 -0
- package/dist/features/Operation/components/Header.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/Header.vue.js +15 -10
- package/dist/features/Operation/components/Headers.vue.d.ts +2 -0
- package/dist/features/Operation/components/Headers.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/Headers.vue.js +1 -1
- package/dist/features/Operation/components/Headers.vue2.js +23 -21
- 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 +55 -48
- package/dist/features/Operation/components/RequestBody.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/RequestBody.vue.js +1 -1
- package/dist/features/Operation/components/RequestBody.vue2.js +74 -49
- package/dist/features/Operation/helpers/get-first-server.d.ts +9 -0
- package/dist/features/Operation/helpers/get-first-server.d.ts.map +1 -0
- package/dist/features/Operation/helpers/get-first-server.js +20 -0
- package/dist/features/Search/components/SearchButton.vue.d.ts +2 -0
- package/dist/features/Search/components/SearchButton.vue.d.ts.map +1 -1
- package/dist/features/Search/components/SearchButton.vue.js +19 -17
- package/dist/features/Search/components/SearchModal.vue.d.ts +2 -1
- package/dist/features/Search/components/SearchModal.vue.d.ts.map +1 -1
- package/dist/features/Search/components/SearchModal.vue.js +2 -2
- package/dist/features/Search/components/SearchModal.vue2.js +74 -75
- package/dist/features/Search/helpers/create-search-index.d.ts +2 -2
- package/dist/features/Search/helpers/create-search-index.d.ts.map +1 -1
- package/dist/features/Search/helpers/create-search-index.js +68 -66
- package/dist/features/Search/hooks/useSearchIndex.d.ts +3 -2
- package/dist/features/Search/hooks/useSearchIndex.d.ts.map +1 -1
- package/dist/features/Search/hooks/useSearchIndex.js +13 -13
- package/dist/features/Search/types.d.ts +1 -1
- package/dist/features/Search/types.d.ts.map +1 -1
- package/dist/features/api-client-modal/useApiClient.d.ts +40 -40
- package/dist/features/api-client-modal/useApiClient.d.ts.map +1 -1
- package/dist/helpers/convert-security-scheme.d.ts +1 -1
- package/dist/helpers/test-utils.d.ts +367 -5
- package/dist/helpers/test-utils.d.ts.map +1 -1
- package/dist/hooks/useNavState.d.ts +1 -15
- package/dist/hooks/useNavState.d.ts.map +1 -1
- package/dist/hooks/useNavState.js +29 -53
- package/dist/index.d.ts +5 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -20
- package/dist/style.css +1 -1
- package/dist/v2/blocks/scalar-request-example-block/helpers/get-secrets.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-request-example-block/helpers/get-secrets.js +5 -6
- package/dist/{features/sidebar/components/Sidebar.vue.d.ts → v2/blocks/scalar-sidebar-block/components/SidebarBlock.vue.d.ts} +1 -1
- package/dist/v2/blocks/scalar-sidebar-block/components/SidebarBlock.vue.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-sidebar-block/components/SidebarBlock.vue.js +7 -0
- package/dist/{features/sidebar/components/Sidebar.vue2.js → v2/blocks/scalar-sidebar-block/components/SidebarBlock.vue2.js} +15 -15
- package/dist/{features/sidebar → v2/blocks/scalar-sidebar-block}/components/SidebarElement.vue.d.ts +1 -1
- package/dist/v2/blocks/scalar-sidebar-block/components/SidebarElement.vue.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-sidebar-block/components/SidebarElement.vue.js +7 -0
- package/dist/{features/sidebar → v2/blocks/scalar-sidebar-block}/components/SidebarElement.vue2.js +41 -43
- package/dist/v2/blocks/scalar-sidebar-block/components/SidebarGroup.vue.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-sidebar-block/components/SidebarGroup.vue.js +7 -0
- package/dist/v2/blocks/scalar-sidebar-block/components/SidebarHttpBadge.vue.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-sidebar-block/components/SidebarHttpBadge.vue.js +7 -0
- package/dist/{features/sidebar → v2/blocks/scalar-sidebar-block}/components/SidebarHttpBadge.vue2.js +1 -1
- package/dist/v2/blocks/scalar-sidebar-block/helpers/create-sidebar.d.ts +385 -0
- package/dist/v2/blocks/scalar-sidebar-block/helpers/create-sidebar.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-sidebar-block/helpers/create-sidebar.js +35 -0
- package/dist/v2/blocks/scalar-sidebar-block/helpers/generate-reverse-index.d.ts +189 -0
- package/dist/v2/blocks/scalar-sidebar-block/helpers/generate-reverse-index.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-sidebar-block/helpers/generate-reverse-index.js +9 -0
- package/dist/{features/sidebar → v2/blocks/scalar-sidebar-block}/hooks/useSidebar.d.ts +4 -8
- package/dist/v2/blocks/scalar-sidebar-block/hooks/useSidebar.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-sidebar-block/hooks/useSidebar.js +18 -0
- package/dist/v2/blocks/scalar-sidebar-block/index.d.ts +4 -0
- package/dist/v2/blocks/scalar-sidebar-block/index.d.ts.map +1 -0
- package/dist/v2/helpers/map-configuration.d.ts.map +1 -1
- package/package.json +11 -11
- package/dist/features/sidebar/components/Sidebar.vue.d.ts.map +0 -1
- package/dist/features/sidebar/components/Sidebar.vue.js +0 -7
- package/dist/features/sidebar/components/SidebarElement.vue.d.ts.map +0 -1
- package/dist/features/sidebar/components/SidebarElement.vue.js +0 -7
- package/dist/features/sidebar/components/SidebarGroup.vue.d.ts.map +0 -1
- package/dist/features/sidebar/components/SidebarGroup.vue.js +0 -7
- package/dist/features/sidebar/components/SidebarHttpBadge.vue.d.ts.map +0 -1
- package/dist/features/sidebar/components/SidebarHttpBadge.vue.js +0 -7
- package/dist/features/sidebar/helpers/create-sidebar.d.ts +0 -28
- package/dist/features/sidebar/helpers/create-sidebar.d.ts.map +0 -1
- package/dist/features/sidebar/helpers/create-sidebar.js +0 -32
- package/dist/features/sidebar/hooks/useSidebar.d.ts.map +0 -1
- package/dist/features/sidebar/hooks/useSidebar.js +0 -18
- package/dist/features/sidebar/index.d.ts +0 -4
- package/dist/features/sidebar/index.d.ts.map +0 -1
- package/dist/features/traverse-schema/helpers/get-tag.d.ts +0 -6
- package/dist/features/traverse-schema/helpers/get-tag.d.ts.map +0 -1
- package/dist/features/traverse-schema/helpers/get-tag.js +0 -7
- package/dist/features/traverse-schema/helpers/traverse-description.d.ts +0 -11
- package/dist/features/traverse-schema/helpers/traverse-description.d.ts.map +0 -1
- package/dist/features/traverse-schema/helpers/traverse-description.js +0 -32
- package/dist/features/traverse-schema/helpers/traverse-document.d.ts +0 -16
- package/dist/features/traverse-schema/helpers/traverse-document.d.ts.map +0 -1
- package/dist/features/traverse-schema/helpers/traverse-document.js +0 -33
- package/dist/features/traverse-schema/helpers/traverse-paths.d.ts +0 -18
- package/dist/features/traverse-schema/helpers/traverse-paths.d.ts.map +0 -1
- package/dist/features/traverse-schema/helpers/traverse-paths.js +0 -30
- package/dist/features/traverse-schema/helpers/traverse-schemas.d.ts +0 -8
- package/dist/features/traverse-schema/helpers/traverse-schemas.d.ts.map +0 -1
- package/dist/features/traverse-schema/helpers/traverse-schemas.js +0 -21
- package/dist/features/traverse-schema/helpers/traverse-tags.d.ts +0 -11
- package/dist/features/traverse-schema/helpers/traverse-tags.d.ts.map +0 -1
- package/dist/features/traverse-schema/helpers/traverse-tags.js +0 -43
- package/dist/features/traverse-schema/helpers/traverse-webhooks.d.ts +0 -10
- package/dist/features/traverse-schema/helpers/traverse-webhooks.d.ts.map +0 -1
- package/dist/features/traverse-schema/helpers/traverse-webhooks.js +0 -24
- package/dist/features/traverse-schema/index.d.ts +0 -5
- package/dist/features/traverse-schema/index.d.ts.map +0 -1
- package/dist/features/traverse-schema/types.d.ts +0 -55
- package/dist/features/traverse-schema/types.d.ts.map +0 -1
- package/dist/libs/markdown.js +0 -18
- /package/dist/{features/sidebar → v2/blocks/scalar-sidebar-block}/components/SidebarGroup.vue.d.ts +0 -0
- /package/dist/{features/sidebar → v2/blocks/scalar-sidebar-block}/components/SidebarGroup.vue2.js +0 -0
- /package/dist/{features/sidebar → v2/blocks/scalar-sidebar-block}/components/SidebarHttpBadge.vue.d.ts +0 -0
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { ApiReferenceConfiguration } from '@scalar/types/api-reference';
|
|
2
|
-
import type { Heading
|
|
3
|
-
import type { OperationObject, TagObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
|
|
2
|
+
import type { Heading } from '@scalar/types/legacy';
|
|
4
3
|
import { type InjectionKey, type Ref } from 'vue';
|
|
5
4
|
export type NavState = {
|
|
6
5
|
/** The URL hash without the #, also the "hash" pulled from pathRouting */
|
|
@@ -43,21 +42,8 @@ export declare const useNavState: (_config?: Ref<ApiReferenceConfiguration>) =>
|
|
|
43
42
|
*/
|
|
44
43
|
replaceUrlState: (replacementHash: string, url?: string) => void;
|
|
45
44
|
getReferenceId: () => string;
|
|
46
|
-
getWebhookId: (webhook?: {
|
|
47
|
-
name: string;
|
|
48
|
-
method?: string;
|
|
49
|
-
}, parentTag?: OpenAPIV3_1.TagObject) => string;
|
|
50
|
-
getModelId: (model?: {
|
|
51
|
-
name: string;
|
|
52
|
-
}, parentTag?: OpenAPIV3_1.TagObject) => string;
|
|
53
45
|
getHeadingId: (heading: Heading) => string;
|
|
54
|
-
getOperationId: (operation: {
|
|
55
|
-
path: string;
|
|
56
|
-
method: OpenAPIV3_1.HttpMethods;
|
|
57
|
-
} & OperationObject, parentTag: TagObject) => string;
|
|
58
46
|
getPathRoutingId: (pathName: string) => string;
|
|
59
|
-
getSectionId: (hashStr?: string) => string;
|
|
60
|
-
getTagId: (tag: OpenAPIV3_1.TagObject) => string;
|
|
61
47
|
isIntersectionEnabled: Ref<boolean, boolean>;
|
|
62
48
|
updateHash: () => string;
|
|
63
49
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useNavState.d.ts","sourceRoot":"","sources":["../../src/hooks/useNavState.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useNavState.d.ts","sourceRoot":"","sources":["../../src/hooks/useNavState.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAA;AAC5E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AACnD,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,GAAG,EAAe,MAAM,KAAK,CAAA;AAI9D,MAAM,MAAM,QAAQ,GAAG;IACrB,0EAA0E;IAC1E,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IACjB,2CAA2C;IAC3C,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IACvB,sFAAsF;IACtF,qBAAqB,EAAE,GAAG,CAAC,OAAO,CAAC,CAAA;CACpC,CAAA;AACD,eAAO,MAAM,gBAAgB,EAAe,YAAY,CAAC,QAAQ,CAAC,CAAA;AAOlE;;;;;;;;GAQG;AACH,eAAO,MAAM,WAAW,GAAI,UAAU,GAAG,CAAC,yBAAyB,CAAC;;IAqFhE,mCAAmC;4BACX,MAAM;IAG9B;;;;OAIG;+BA5B4B,MAAM;IA8BrC;;;;;OAKG;oCAlDkC,MAAM;IAoD3C;;;OAGG;uCAzEqC,MAAM;;4BAwCjB,OAAO;iCA/DF,MAAM;;;CAwG3C,CAAA;AAED,mCAAmC;AACnC,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAA"}
|
|
@@ -1,82 +1,58 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}), t = d ?? b(), c = (e) => {
|
|
1
|
+
import { combineUrlAndPath as c } from "@scalar/helpers/url/merge-urls";
|
|
2
|
+
import { inject as p, ref as i } from "vue";
|
|
3
|
+
import { useConfig as d } from "./useConfig.js";
|
|
4
|
+
const f = Symbol(), v = i(!1), w = i(""), R = i(""), E = (h) => {
|
|
5
|
+
const { isIntersectionEnabled: g, hash: s, hashPrefix: a } = p(f, {
|
|
6
|
+
isIntersectionEnabled: v,
|
|
7
|
+
hash: w,
|
|
8
|
+
hashPrefix: R
|
|
9
|
+
}), t = h ?? d(), l = (e) => {
|
|
11
10
|
if (!t.value.pathRouting)
|
|
12
11
|
return "";
|
|
13
12
|
const n = new RegExp("^" + t.value.pathRouting?.basePath + "/?");
|
|
14
13
|
return decodeURIComponent(e.replace(n, ""));
|
|
15
|
-
},
|
|
16
|
-
const n = e.match(/(tag\/[^/]+)/)?.[0], o = e.startsWith("model") ? "models" : "", a = e.startsWith("webhook") ? "webhooks" : "";
|
|
17
|
-
return n || o || a;
|
|
18
|
-
}, g = () => t.value.pathRouting ? c(window.location.pathname) : (
|
|
14
|
+
}, u = () => t.value.pathRouting ? l(window.location.pathname) : (
|
|
19
15
|
// Must remove the prefix from the hash as the internal hash value should be pure
|
|
20
|
-
decodeURIComponent(window.location.hash.replace(/^#/, "")).slice(
|
|
21
|
-
)
|
|
22
|
-
const o = new URL(n);
|
|
23
|
-
t.value.pathRouting ? o.pathname = h(t.value.pathRouting.basePath, e) : o.hash = u.value + e, r.value = e, window.history.replaceState({}, "", o);
|
|
24
|
-
}, $ = (e, n = window.location.href, o = window.location.search) => {
|
|
25
|
-
const a = new URL(n);
|
|
26
|
-
return t.value.pathRouting ? a.pathname = h(t.value.pathRouting.basePath, e) : a.hash = u.value + e, a.search = o, a.toString();
|
|
27
|
-
}, w = (e = r.value) => `${u.value}${e}`, I = (e) => typeof t.value.generateHeadingSlug == "function" ? `${t.value.generateHeadingSlug(e)}` : e.slug ? `description/${e.slug}` : "", S = (e, n) => {
|
|
28
|
-
if (!e?.name)
|
|
29
|
-
return "models";
|
|
30
|
-
const o = n ? `${l(n)}/` : "";
|
|
31
|
-
return typeof t.value.generateModelSlug == "function" ? `${o}model/${t.value.generateModelSlug(e)}` : `${o}model/${s(e.name)}`;
|
|
32
|
-
}, l = (e) => typeof t.value.generateTagSlug == "function" ? `tag/${t.value.generateTagSlug(e)}` : `tag/${s(e.name ?? "")}`;
|
|
16
|
+
decodeURIComponent(window.location.hash.replace(/^#/, "")).slice(a.value.length)
|
|
17
|
+
);
|
|
33
18
|
return {
|
|
34
|
-
hash:
|
|
19
|
+
hash: s,
|
|
35
20
|
/** Sets the prefix for the hash */
|
|
36
21
|
setHashPrefix: (e) => {
|
|
37
|
-
|
|
22
|
+
a.value = e;
|
|
38
23
|
},
|
|
39
24
|
/**
|
|
40
25
|
* Gets the full hash with the prefix
|
|
41
26
|
* @param hashTarget The hash to target with the return
|
|
42
27
|
* @returns The full hash
|
|
43
28
|
*/
|
|
44
|
-
getFullHash:
|
|
29
|
+
getFullHash: (e = s.value) => `${a.value}${e}`,
|
|
45
30
|
/**
|
|
46
31
|
* Gets the hashed url with the prefix
|
|
47
32
|
* @param replacementHash The hash to replace the current hash with
|
|
48
33
|
* @param url The url to get the hashed url from
|
|
49
34
|
* @returns The hashed url
|
|
50
35
|
*/
|
|
51
|
-
getHashedUrl:
|
|
36
|
+
getHashedUrl: (e, n = window.location.href, o = window.location.search) => {
|
|
37
|
+
const r = new URL(n);
|
|
38
|
+
return t.value.pathRouting ? r.pathname = c(t.value.pathRouting.basePath, e) : r.hash = a.value + e, r.search = o, r.toString();
|
|
39
|
+
},
|
|
52
40
|
/**
|
|
53
41
|
* Replaces the URL state with the new url and hash
|
|
54
42
|
* Replacement is used so that hash changes don't trigger the url hash watcher and cause a scroll
|
|
55
43
|
*/
|
|
56
|
-
replaceUrlState:
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
if (!e?.name)
|
|
60
|
-
return "webhooks";
|
|
61
|
-
const o = n ? `${l(n)}/` : "";
|
|
62
|
-
return typeof t.value.generateWebhookSlug == "function" ? `${o}webhook/${t.value.generateWebhookSlug(e)}` : `${o}webhook/${e.method}/${s(e.name)}`;
|
|
44
|
+
replaceUrlState: (e, n = window.location.href) => {
|
|
45
|
+
const o = new URL(n);
|
|
46
|
+
t.value.pathRouting ? o.pathname = c(t.value.pathRouting.basePath, e) : o.hash = a.value + e, s.value = e, window.history.replaceState({}, "", o);
|
|
63
47
|
},
|
|
64
|
-
|
|
65
|
-
getHeadingId:
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
method: e.method,
|
|
70
|
-
summary: e.summary
|
|
71
|
-
})}` : `${l(n)}/${e.method}${e.path}`,
|
|
72
|
-
getPathRoutingId: c,
|
|
73
|
-
getSectionId: p,
|
|
74
|
-
getTagId: l,
|
|
75
|
-
isIntersectionEnabled: f,
|
|
76
|
-
updateHash: m
|
|
48
|
+
getReferenceId: u,
|
|
49
|
+
getHeadingId: (e) => typeof t.value.generateHeadingSlug == "function" ? `${t.value.generateHeadingSlug(e)}` : e.slug ? `description/${e.slug}` : "",
|
|
50
|
+
getPathRoutingId: l,
|
|
51
|
+
isIntersectionEnabled: g,
|
|
52
|
+
updateHash: () => s.value = u()
|
|
77
53
|
};
|
|
78
54
|
};
|
|
79
55
|
export {
|
|
80
|
-
|
|
81
|
-
|
|
56
|
+
f as NAV_STATE_SYMBOL,
|
|
57
|
+
E as useNavState
|
|
82
58
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
export { default as ApiReference } from './components/ApiReference.vue.js';
|
|
2
2
|
export { default as ApiReferenceLayout } from './components/ApiReferenceLayout.vue.js';
|
|
3
|
-
export { default as ApiReferenceWorkspace } from './v2/ApiReferenceWorkspace.vue.js';
|
|
4
|
-
export { SearchButton, SearchModal } from './features/Search';
|
|
5
3
|
export { default as GettingStarted } from './components/GettingStarted.vue.js';
|
|
6
|
-
export {
|
|
7
|
-
export { useSidebar, Sidebar } from './features/sidebar';
|
|
8
|
-
export { useWorkspaceStoreEvents } from './v2/hooks/use-workspace-store-events.js';
|
|
9
|
-
export { createEmptySpecification } from './libs/openapi.js';
|
|
4
|
+
export { SearchButton, SearchModal } from './features/Search';
|
|
10
5
|
export { useNavState } from './hooks/useNavState.js';
|
|
6
|
+
export { createEmptySpecification } from './libs/openapi.js';
|
|
7
|
+
export { createApiReference } from './standalone/lib/html-api.js';
|
|
11
8
|
export type { ApiReferenceConfiguration, ReferenceProps, } from './types';
|
|
9
|
+
export { default as ApiReferenceWorkspace } from './v2/ApiReferenceWorkspace.vue.js';
|
|
10
|
+
export { useWorkspaceStoreEvents } from './v2/hooks/use-workspace-store-events.js';
|
|
12
11
|
//# 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":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,+BAA+B,CAAA;AACvE,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,qCAAqC,CAAA;AAEnF,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAC3E,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAEjD,OAAO,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAA;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAC9D,YAAY,EACV,yBAAyB,EACzB,cAAc,GACf,MAAM,SAAS,CAAA;AAChB,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,gCAAgC,CAAA;AAEjF,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAA"}
|