@scalar/api-reference 1.35.5 → 1.35.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 +21 -0
- package/dist/browser/standalone.js +18150 -18465
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/Anchor/WithBreadcrumb.vue2.js +8 -11
- package/dist/components/ApiReference.vue.js +1 -1
- package/dist/components/ApiReferenceLayout.vue.js +4 -4
- package/dist/components/ApiReferenceLayout.vue2.js +247 -268
- package/dist/components/Badge/Badge.vue.js +1 -1
- package/dist/components/ClassicHeader.vue.js +1 -1
- package/dist/components/Content/Content.vue.js +145 -169
- package/dist/components/Content/Content.vue3.js +1 -1
- package/dist/components/Content/Models/ClassicLayout.vue.js +1 -1
- package/dist/components/Content/Models/ClassicLayout.vue2.js +32 -35
- package/dist/components/Content/Models/Models.vue.js +27 -31
- package/dist/components/Content/Models/ModernLayout.vue.js +1 -1
- package/dist/components/Content/Operations/TraversedEntry.vue.js +32 -35
- package/dist/components/Content/Operations/TraversedEntryContainer.vue.js +26 -27
- package/dist/components/Content/Operations/get-current-index.js +1 -1
- package/dist/components/Content/Schema/Schema.vue.js +1 -1
- package/dist/components/Content/Schema/Schema.vue2.js +68 -74
- package/dist/components/Content/Schema/SchemaComposition.vue.js +42 -45
- package/dist/components/Content/Schema/SchemaEnumPropertyItem.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaEnumValues.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaEnumValues.vue2.js +45 -50
- package/dist/components/Content/Schema/SchemaHeading.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaObjectProperties.vue.js +41 -48
- package/dist/components/Content/Schema/SchemaProperty.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaProperty.vue2.js +142 -157
- package/dist/components/Content/Schema/SchemaPropertyDetail.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaPropertyExamples.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue2.js +160 -164
- package/dist/components/Content/Schema/helpers/get-schema-type.js +15 -17
- package/dist/components/Content/Schema/helpers/merge-all-of-schemas.js +74 -77
- package/dist/components/Content/Schema/helpers/optimize-value-for-display.js +10 -11
- package/dist/components/Content/Tags/ClassicLayout.vue.js +1 -1
- package/dist/components/Content/Tags/ClassicLayout.vue2.js +36 -39
- package/dist/components/Content/Tags/ModernLayout.vue.js +1 -1
- package/dist/components/Content/Tags/ModernLayout.vue2.js +31 -35
- package/dist/components/Content/Tags/TagSection.vue.js +86 -92
- package/dist/components/GettingStarted.vue.js +1 -1
- package/dist/components/LinkList/LinkList.vue.js +1 -1
- package/dist/components/LoadingSkeleton.vue.js +1 -1
- package/dist/components/MobileHeader.vue.d.ts.map +1 -1
- package/dist/components/MobileHeader.vue.js +3 -3
- package/dist/components/MobileHeader.vue2.js +13 -12
- package/dist/components/OperationPath.vue.js +1 -1
- package/dist/components/OperationsList/OperationsList.vue.js +1 -1
- package/dist/components/OperationsList/OperationsList.vue2.js +45 -51
- package/dist/components/OperationsList/OperationsListItem.vue.js +1 -1
- package/dist/components/ScreenReader.vue.js +1 -1
- package/dist/components/Section/CompactSection.vue.js +1 -1
- package/dist/components/Section/Section.vue.js +1 -1
- package/dist/components/Section/Section.vue2.js +13 -14
- package/dist/components/Section/SectionAccordion.vue.js +1 -1
- package/dist/components/Section/SectionAccordion.vue2.js +29 -30
- package/dist/components/Section/SectionColumn.vue.js +1 -1
- package/dist/components/Section/SectionColumns.vue.js +1 -1
- package/dist/components/Section/SectionContainer.vue.js +1 -1
- package/dist/components/Section/SectionContainerAccordion.vue.js +1 -1
- package/dist/components/Section/SectionContent.vue.js +1 -1
- package/dist/components/Section/SectionHeader.vue.js +1 -1
- package/dist/components/Section/SectionHeaderTag.vue.js +1 -1
- package/dist/components/SectionFlare/SectionFlare.vue.js +1 -1
- package/dist/components/ShowMoreButton.vue.js +1 -1
- package/dist/components/ShowMoreButton.vue2.js +12 -13
- package/dist/features/Operation/Operation.vue.js +31 -36
- package/dist/features/Operation/components/Headers.vue.js +1 -1
- package/dist/features/Operation/components/OperationParameters.vue.js +8 -11
- package/dist/features/Operation/components/ParameterList.vue.js +21 -24
- package/dist/features/Operation/components/ParameterListItem.vue.js +1 -1
- package/dist/features/Operation/components/ParameterListItem.vue2.js +36 -37
- package/dist/features/Operation/components/RequestBody.vue.js +1 -1
- package/dist/features/Operation/components/RequestBody.vue2.js +45 -52
- package/dist/features/Operation/components/callbacks/Callback.vue.js +1 -1
- package/dist/features/Operation/components/callbacks/Callback.vue2.js +32 -35
- package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts.map +1 -1
- package/dist/features/Operation/layouts/ClassicLayout.vue.js +4 -4
- package/dist/features/Operation/layouts/ClassicLayout.vue2.js +114 -119
- package/dist/features/Operation/layouts/ModernLayout.vue.d.ts.map +1 -1
- package/dist/features/Operation/layouts/ModernLayout.vue.js +3 -3
- package/dist/features/Operation/layouts/ModernLayout.vue2.js +87 -89
- package/dist/features/Search/components/SearchButton.vue.js +23 -25
- package/dist/features/Search/components/SearchModal.vue.js +1 -1
- package/dist/features/Search/components/SearchModal.vue2.js +53 -54
- package/dist/features/api-client-modal/ApiClientModal.vue.js +31 -38
- package/dist/features/document-source/hooks/useDocumentFetcher.js +17 -18
- package/dist/features/document-source/hooks/useDocumentSource.js +16 -16
- package/dist/features/example-responses/ExampleResponse.vue.js +1 -1
- package/dist/features/example-responses/ExampleResponse.vue2.js +23 -26
- package/dist/features/example-responses/ExampleResponseTab.vue.js +1 -1
- package/dist/features/example-responses/ExampleResponseTabList.vue.js +1 -1
- package/dist/features/example-responses/ExampleResponses.vue.js +1 -1
- package/dist/features/example-responses/ExampleResponses.vue2.js +128 -153
- package/dist/features/info-object/Contact.vue.js +24 -27
- package/dist/features/info-object/License.vue.js +26 -29
- package/dist/features/multiple-documents/DocumentSelector.vue.js +22 -31
- package/dist/features/multiple-documents/useMultipleDocuments.js +52 -56
- package/dist/features/sidebar/components/Sidebar.vue.d.ts.map +1 -1
- package/dist/features/sidebar/components/Sidebar.vue.js +3 -3
- package/dist/features/sidebar/components/Sidebar.vue2.js +74 -79
- package/dist/features/sidebar/components/SidebarElement.vue.js +1 -1
- package/dist/features/sidebar/components/SidebarElement.vue2.js +52 -53
- package/dist/features/sidebar/components/SidebarGroup.vue.js +1 -1
- package/dist/features/sidebar/components/SidebarHttpBadge.vue.js +1 -1
- package/dist/features/specification-extension/SpecificationExtension.vue2.js +28 -31
- package/dist/features/test-request-button/TestRequestButton.vue.js +1 -1
- package/dist/features/test-request-button/TestRequestButton.vue2.js +1 -2
- package/dist/features/traverse-schema/helpers/traverse-description.js +13 -14
- package/dist/features/traverse-schema/helpers/traverse-document.js +14 -15
- package/dist/features/traverse-schema/helpers/traverse-paths.js +20 -23
- package/dist/features/traverse-schema/helpers/traverse-schemas.js +13 -15
- package/dist/features/traverse-schema/helpers/traverse-webhooks.js +8 -10
- package/dist/hooks/useFreezing.js +14 -14
- package/dist/hooks/useNavState.js +37 -39
- package/dist/index.js +2 -2
- package/dist/libs/openapi.js +28 -31
- package/dist/style.css +1 -1
- package/dist/v2/ApiReferenceWorkspace.vue.js +68 -75
- package/dist/v2/ApiReferenceWorkspace.vue3.js +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.js +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue2.js +116 -135
- package/dist/v2/blocks/scalar-auth-selector-block/components/DeleteRequestAuthModal.vue.js +40 -47
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.js +45 -46
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.js +109 -125
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.js +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.js +84 -84
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/update-scheme.js +12 -13
- package/dist/v2/blocks/scalar-client-selector-block/components/ClientDropdown.vue.js +1 -1
- package/dist/v2/blocks/scalar-client-selector-block/components/ClientDropdown.vue2.js +1 -4
- package/dist/v2/blocks/scalar-client-selector-block/components/ClientSelector.vue.js +1 -1
- package/dist/v2/blocks/scalar-client-selector-block/components/ClientSelector.vue2.js +77 -82
- package/dist/v2/blocks/scalar-info-block/components/DownloadLink.vue.js +1 -1
- package/dist/v2/blocks/scalar-info-block/components/DownloadLink.vue2.js +46 -49
- package/dist/v2/blocks/scalar-info-block/components/InfoDescription.vue.js +1 -1
- package/dist/v2/blocks/scalar-info-block/components/IntroductionCard.vue.js +1 -1
- package/dist/v2/blocks/scalar-info-block/components/IntroductionCardItem.vue.js +1 -1
- package/dist/v2/blocks/scalar-info-block/components/IntroductionLayout.vue.js +1 -1
- package/dist/v2/blocks/scalar-info-block/components/IntroductionLayout.vue2.js +74 -89
- package/dist/v2/blocks/scalar-request-example-block/components/ExamplePicker.vue2.js +24 -27
- package/dist/v2/blocks/scalar-request-example-block/components/RequestExample.vue.js +1 -1
- package/dist/v2/blocks/scalar-request-example-block/components/RequestExample.vue2.js +106 -119
- package/dist/v2/blocks/scalar-request-example-block/helpers/find-client.js +11 -12
- package/dist/v2/blocks/scalar-request-example-block/helpers/get-secrets.js +3 -3
- package/dist/v2/blocks/scalar-server-selector-block/components/Selector.vue.js +11 -14
- package/dist/v2/blocks/scalar-server-selector-block/components/ServerSelector.vue.js +45 -48
- package/dist/v2/helpers/get-document-name.js +10 -10
- package/dist/v2/helpers/map-configuration.js +48 -51
- package/dist/v2/hooks/use-legacy-store-events.js +44 -48
- package/dist/v2/hooks/use-workspace-store-events.js +23 -26
- package/package.json +22 -22
- package/dist/components/ApiReferenceLayout.vue3.js +0 -4
- package/dist/components/ApiReferenceLayout.vue4.js +0 -4
- package/dist/components/ApiReferenceLayout.vue5.js +0 -4
- package/dist/components/ApiReferenceLayout.vue6.js +0 -4
- package/dist/components/Badge/Badge.vue3.js +0 -4
- package/dist/components/ClassicHeader.vue2.js +0 -4
- package/dist/components/Content/Content.vue2.js +0 -4
- package/dist/components/Content/Models/ClassicLayout.vue3.js +0 -4
- package/dist/components/Content/Models/ModernLayout.vue3.js +0 -4
- package/dist/components/Content/Schema/Schema.vue3.js +0 -4
- package/dist/components/Content/Schema/SchemaEnumPropertyItem.vue3.js +0 -4
- package/dist/components/Content/Schema/SchemaEnumValues.vue3.js +0 -4
- package/dist/components/Content/Schema/SchemaHeading.vue3.js +0 -4
- package/dist/components/Content/Schema/SchemaProperty.vue3.js +0 -4
- package/dist/components/Content/Schema/SchemaPropertyDetail.vue3.js +0 -4
- package/dist/components/Content/Schema/SchemaPropertyExamples.vue3.js +0 -4
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue3.js +0 -4
- package/dist/components/Content/Tags/ClassicLayout.vue3.js +0 -4
- package/dist/components/Content/Tags/ModernLayout.vue3.js +0 -4
- package/dist/components/GettingStarted.vue3.js +0 -4
- package/dist/components/LinkList/LinkList.vue3.js +0 -4
- package/dist/components/LoadingSkeleton.vue3.js +0 -4
- package/dist/components/MobileHeader.vue3.js +0 -4
- package/dist/components/OperationPath.vue3.js +0 -4
- package/dist/components/OperationsList/OperationsList.vue3.js +0 -4
- package/dist/components/OperationsList/OperationsListItem.vue3.js +0 -4
- package/dist/components/ScreenReader.vue3.js +0 -4
- package/dist/components/Section/CompactSection.vue3.js +0 -4
- package/dist/components/Section/Section.vue3.js +0 -4
- package/dist/components/Section/SectionAccordion.vue3.js +0 -4
- package/dist/components/Section/SectionColumn.vue2.js +0 -4
- package/dist/components/Section/SectionColumns.vue2.js +0 -4
- package/dist/components/Section/SectionContainer.vue3.js +0 -4
- package/dist/components/Section/SectionContainerAccordion.vue3.js +0 -4
- package/dist/components/Section/SectionContent.vue3.js +0 -4
- package/dist/components/Section/SectionHeader.vue3.js +0 -4
- package/dist/components/Section/SectionHeaderTag.vue3.js +0 -4
- package/dist/components/SectionFlare/SectionFlare.vue2.js +0 -4
- package/dist/components/ShowMoreButton.vue3.js +0 -4
- package/dist/features/Operation/components/Headers.vue3.js +0 -4
- package/dist/features/Operation/components/ParameterListItem.vue3.js +0 -4
- package/dist/features/Operation/components/RequestBody.vue3.js +0 -4
- package/dist/features/Operation/components/callbacks/Callback.vue3.js +0 -4
- package/dist/features/Operation/layouts/ClassicLayout.vue3.js +0 -4
- package/dist/features/Operation/layouts/ModernLayout.vue3.js +0 -4
- package/dist/features/Search/components/SearchModal.vue3.js +0 -4
- package/dist/features/example-responses/ExampleResponse.vue3.js +0 -4
- package/dist/features/example-responses/ExampleResponseTab.vue3.js +0 -4
- package/dist/features/example-responses/ExampleResponseTabList.vue3.js +0 -4
- package/dist/features/example-responses/ExampleResponses.vue3.js +0 -4
- package/dist/features/sidebar/components/Sidebar.vue3.js +0 -4
- package/dist/features/sidebar/components/SidebarElement.vue3.js +0 -4
- package/dist/features/sidebar/components/SidebarGroup.vue3.js +0 -4
- package/dist/features/sidebar/components/SidebarHttpBadge.vue3.js +0 -4
- package/dist/features/test-request-button/TestRequestButton.vue3.js +0 -4
- package/dist/v2/ApiReferenceWorkspace.vue2.js +0 -4
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue3.js +0 -4
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue3.js +0 -4
- package/dist/v2/blocks/scalar-client-selector-block/components/ClientDropdown.vue3.js +0 -4
- package/dist/v2/blocks/scalar-client-selector-block/components/ClientSelector.vue3.js +0 -4
- package/dist/v2/blocks/scalar-info-block/components/DownloadLink.vue3.js +0 -4
- package/dist/v2/blocks/scalar-info-block/components/InfoDescription.vue3.js +0 -4
- package/dist/v2/blocks/scalar-info-block/components/IntroductionCard.vue3.js +0 -4
- package/dist/v2/blocks/scalar-info-block/components/IntroductionCardItem.vue2.js +0 -4
- package/dist/v2/blocks/scalar-info-block/components/IntroductionLayout.vue3.js +0 -4
- package/dist/v2/blocks/scalar-request-example-block/components/RequestExample.vue3.js +0 -4
|
@@ -1,86 +1,82 @@
|
|
|
1
1
|
import { isDefined as S } from "@scalar/oas-utils/helpers";
|
|
2
|
-
import { isConfigurationWithSources as
|
|
3
|
-
import
|
|
4
|
-
import { computed as
|
|
5
|
-
const
|
|
6
|
-
if (
|
|
7
|
-
const { sources:
|
|
8
|
-
return
|
|
2
|
+
import { isConfigurationWithSources as w } from "@scalar/types/api-reference";
|
|
3
|
+
import y from "github-slugger";
|
|
4
|
+
import { computed as m, ref as R, watch as b } from "vue";
|
|
5
|
+
const v = "api", g = new y(), A = (t) => t ? (Array.isArray(t) ? t : [t]).flatMap((r) => {
|
|
6
|
+
if (w(r)) {
|
|
7
|
+
const { sources: o, ...n } = r;
|
|
8
|
+
return o?.map((p) => ({ ...n, ...p })) ?? [];
|
|
9
9
|
}
|
|
10
|
-
return [
|
|
11
|
-
}).map((
|
|
10
|
+
return [r];
|
|
11
|
+
}).map((r, o) => r && D(r, o)).filter(S) : [], D = (t, u = 0) => {
|
|
12
12
|
const e = {
|
|
13
13
|
...t,
|
|
14
14
|
// @ts-expect-error this is before parsing so we transform the old style
|
|
15
15
|
...t.spec ?? {}
|
|
16
16
|
};
|
|
17
|
-
if (!(!
|
|
18
|
-
return
|
|
17
|
+
if (!(!e?.url && !e?.content))
|
|
18
|
+
return g.reset(), e.title ? {
|
|
19
19
|
...e,
|
|
20
|
-
slug: e.slug ||
|
|
20
|
+
slug: e.slug || g.slug(e.title),
|
|
21
21
|
title: e.title
|
|
22
22
|
} : e.slug ? {
|
|
23
23
|
...e,
|
|
24
24
|
title: e.slug
|
|
25
25
|
} : {
|
|
26
26
|
...e,
|
|
27
|
-
slug: `api-${
|
|
28
|
-
title: `API #${
|
|
27
|
+
slug: `api-${u + 1}`,
|
|
28
|
+
title: `API #${u + 1}`
|
|
29
29
|
};
|
|
30
|
-
},
|
|
30
|
+
}, N = ({
|
|
31
31
|
configuration: t,
|
|
32
|
-
initialIndex:
|
|
32
|
+
initialIndex: u,
|
|
33
33
|
isIntersectionEnabled: e,
|
|
34
|
-
hash:
|
|
35
|
-
hashPrefix:
|
|
34
|
+
hash: r,
|
|
35
|
+
hashPrefix: o
|
|
36
36
|
}) => {
|
|
37
|
-
const
|
|
37
|
+
const n = m(() => A(t.value)), a = R((() => {
|
|
38
38
|
if (typeof window > "u")
|
|
39
|
-
return typeof
|
|
40
|
-
const
|
|
41
|
-
if (
|
|
42
|
-
const
|
|
43
|
-
if (
|
|
44
|
-
return
|
|
45
|
-
const
|
|
46
|
-
if (!isNaN(
|
|
47
|
-
return
|
|
39
|
+
return typeof u == "number" ? u : 0;
|
|
40
|
+
const l = new URL(window.location.href).searchParams.get(v);
|
|
41
|
+
if (l) {
|
|
42
|
+
const s = n.value.findIndex((h) => h.slug === l);
|
|
43
|
+
if (s !== -1)
|
|
44
|
+
return s;
|
|
45
|
+
const d = Number.parseInt(l, 10);
|
|
46
|
+
if (!isNaN(d) && d >= 0 && d < n.value.length)
|
|
47
|
+
return d;
|
|
48
48
|
}
|
|
49
|
-
const
|
|
50
|
-
return
|
|
51
|
-
})()),
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
...[t.value].flat()[f.value] ?? {},
|
|
59
|
-
...r.value[f.value]
|
|
60
|
-
};
|
|
49
|
+
const c = n.value.findIndex((s) => "default" in s && s.default === !0);
|
|
50
|
+
return c !== -1 ? c : typeof u == "number" ? u : 0;
|
|
51
|
+
})()), i = m(() => t.value && w(t.value) ? {
|
|
52
|
+
...t.value,
|
|
53
|
+
...t.value?.sources?.[a.value],
|
|
54
|
+
...n.value[a.value]
|
|
55
|
+
} : {
|
|
56
|
+
...[t.value].flat()[a.value] ?? {},
|
|
57
|
+
...n.value[a.value]
|
|
61
58
|
});
|
|
62
|
-
return
|
|
63
|
-
|
|
64
|
-
(
|
|
65
|
-
|
|
66
|
-
if (typeof window > "u" || r.value.length === 1)
|
|
59
|
+
return b(
|
|
60
|
+
a,
|
|
61
|
+
(f) => {
|
|
62
|
+
if (typeof window > "u" || n.value.length === 1)
|
|
67
63
|
return;
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
const
|
|
71
|
-
|
|
64
|
+
const l = new URL(window.location.href), c = n.value[f];
|
|
65
|
+
i.value.pathRouting && (l.pathname = i.value.pathRouting?.basePath ?? "");
|
|
66
|
+
const s = c?.slug ?? f.toString();
|
|
67
|
+
l.searchParams.set(v, s), l.hash = "", window.history.replaceState({}, "", l.toString()), r.value = "", o.value = "", e.value = !1, typeof window < "u" && window.scrollTo({ top: 0, behavior: "instant" }), i.value.onDocumentSelect?.();
|
|
72
68
|
},
|
|
73
69
|
{ flush: "sync" }
|
|
74
70
|
), {
|
|
75
|
-
selectedConfiguration:
|
|
76
|
-
availableDocuments:
|
|
77
|
-
selectedDocumentIndex:
|
|
71
|
+
selectedConfiguration: i,
|
|
72
|
+
availableDocuments: n,
|
|
73
|
+
selectedDocumentIndex: a,
|
|
78
74
|
isIntersectionEnabled: e,
|
|
79
|
-
hash:
|
|
80
|
-
hashPrefix:
|
|
75
|
+
hash: r,
|
|
76
|
+
hashPrefix: o
|
|
81
77
|
};
|
|
82
78
|
};
|
|
83
79
|
export {
|
|
84
|
-
|
|
85
|
-
|
|
80
|
+
A as normalizeConfigurations,
|
|
81
|
+
N as useMultipleDocuments
|
|
86
82
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sidebar.vue.d.ts","sourceRoot":"","sources":["../../../../src/features/sidebar/components/Sidebar.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Sidebar.vue.d.ts","sourceRoot":"","sources":["../../../../src/features/sidebar/components/Sidebar.vue"],"names":[],"mappings":"AAgRA,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAA;CACd,CAAC;AAmSF,QAAA,IAAI,OAAO,IAAU,EAAE,QAAQ,IAAY,CAAE;AAC7C,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,GACpD;IAAE,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AA8BtD,QAAA,MAAM,eAAe,kSAMnB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAQ1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,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 f = /* @__PURE__ */ r(o, [["__scopeId", "data-v-603204fe"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
f as default
|
|
7
7
|
};
|
|
@@ -1,119 +1,114 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { sleep as
|
|
3
|
-
import { useNavState as
|
|
4
|
-
import { useSidebar as
|
|
1
|
+
import { defineComponent as B, ref as y, watch as N, onMounted as L, onUnmounted as F, createElementBlock as n, openBlock as i, renderSlot as T, createElementVNode as C, createVNode as G, withCtx as v, Fragment as d, renderList as m, unref as a, createBlock as u, toDisplayString as V, createCommentVNode as A } from "vue";
|
|
2
|
+
import { sleep as $ } from "@scalar/helpers/testing/sleep";
|
|
3
|
+
import { useNavState as M } from "../../../hooks/useNavState.js";
|
|
4
|
+
import { useSidebar as D } from "../hooks/useSidebar.js";
|
|
5
5
|
import h from "./SidebarElement.vue.js";
|
|
6
|
-
import
|
|
7
|
-
const
|
|
6
|
+
import _ from "./SidebarGroup.vue.js";
|
|
7
|
+
const H = { class: "sidebar" }, R = ["aria-label"], U = { class: "sidebar-group-title" }, j = -160, W = /* @__PURE__ */ B({
|
|
8
8
|
__name: "Sidebar",
|
|
9
9
|
props: {
|
|
10
10
|
title: {}
|
|
11
11
|
},
|
|
12
|
-
setup(
|
|
13
|
-
const { hash:
|
|
14
|
-
|
|
15
|
-
!
|
|
12
|
+
setup(q) {
|
|
13
|
+
const { hash: o, isIntersectionEnabled: w } = M(), { items: I, toggleCollapsedSidebarItem: g, collapsedSidebarItems: E } = D(), c = y(null), l = y(!0);
|
|
14
|
+
N(o, (t) => {
|
|
15
|
+
!w.value || l.value || typeof window > "u" || S(t);
|
|
16
16
|
});
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
if (!r || !f.value)
|
|
17
|
+
const S = (t) => {
|
|
18
|
+
const s = document.getElementById(`sidebar-${t}`);
|
|
19
|
+
if (!s || !c.value)
|
|
21
20
|
return;
|
|
22
|
-
let
|
|
23
|
-
|
|
24
|
-
},
|
|
25
|
-
if (!
|
|
21
|
+
let e = j;
|
|
22
|
+
s.getAttribute("data-sidebar-type") === "heading" ? e += s.offsetTop + (s.getElementsByClassName("sidebar-heading")?.[0]).offsetHeight : e += s.offsetTop + (s.parentElement?.offsetTop ?? 0) + (s.parentElement?.parentElement?.offsetTop ?? 0), c.value.scrollTo({ top: e, behavior: "smooth" });
|
|
23
|
+
}, O = (t) => {
|
|
24
|
+
if (!c.value)
|
|
26
25
|
return;
|
|
27
|
-
const
|
|
28
|
-
document.getElementById(`sidebar-${
|
|
26
|
+
const s = new MutationObserver((e, r) => {
|
|
27
|
+
document.getElementById(`sidebar-${t}`) && (S(t), l.value = !1, r.disconnect());
|
|
29
28
|
});
|
|
30
|
-
return
|
|
29
|
+
return s.observe(c.value, {
|
|
31
30
|
childList: !0,
|
|
32
31
|
subtree: !0
|
|
33
|
-
}),
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
});
|
|
32
|
+
}), s;
|
|
33
|
+
}, p = (t) => o.value === t ? !0 : o.value.includes("/description/") ? o.value.split("/description/")[0] === t : !1, k = y(void 0);
|
|
34
|
+
L(() => {
|
|
35
|
+
k.value = O(o.value), o.value || setTimeout(() => l.value = !1, 300);
|
|
36
|
+
}), F(() => {
|
|
37
|
+
k.value?.disconnect();
|
|
40
38
|
});
|
|
41
|
-
const b = (
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
return (e, r) => (n(), a("div", R, [
|
|
46
|
-
C(e.$slots, "sidebar-start", {}, void 0, !0),
|
|
47
|
-
A("nav", {
|
|
39
|
+
const b = (t) => "children" in t && (t.children?.length ?? 0) > 0;
|
|
40
|
+
return (t, s) => (i(), n("div", H, [
|
|
41
|
+
T(t.$slots, "sidebar-start", {}, void 0, !0),
|
|
42
|
+
C("nav", {
|
|
48
43
|
ref_key: "scrollerEl",
|
|
49
|
-
ref:
|
|
50
|
-
"aria-label": `Table of contents for ${
|
|
44
|
+
ref: c,
|
|
45
|
+
"aria-label": `Table of contents for ${t.title}`,
|
|
51
46
|
class: "sidebar-pages custom-scroll custom-scroll-self-contain-overflow"
|
|
52
47
|
}, [
|
|
53
|
-
|
|
54
|
-
default:
|
|
55
|
-
(
|
|
56
|
-
key:
|
|
48
|
+
G(_, { level: 0 }, {
|
|
49
|
+
default: v(() => [
|
|
50
|
+
(i(!0), n(d, null, m(a(I).entries, (e) => (i(), n(d, {
|
|
51
|
+
key: e.id
|
|
57
52
|
}, [
|
|
58
|
-
"isGroup" in
|
|
59
|
-
|
|
60
|
-
(
|
|
61
|
-
key:
|
|
62
|
-
id: `sidebar-${
|
|
53
|
+
"isGroup" in e && e.isGroup ? (i(), n(d, { key: 0 }, [
|
|
54
|
+
C("li", U, V(e.title), 1),
|
|
55
|
+
(i(!0), n(d, null, m(e.children, (r) => (i(), u(h, {
|
|
56
|
+
key: r.id,
|
|
57
|
+
id: `sidebar-${r.id}`,
|
|
63
58
|
"data-sidebar-type": "heading",
|
|
64
|
-
hasChildren: b(
|
|
65
|
-
isActive:
|
|
66
|
-
item:
|
|
67
|
-
open:
|
|
59
|
+
hasChildren: b(r),
|
|
60
|
+
isActive: p(r.id),
|
|
61
|
+
item: r,
|
|
62
|
+
open: a(E)[r.id] ?? !1,
|
|
68
63
|
onToggleOpen: async () => {
|
|
69
|
-
l.value = !0,
|
|
64
|
+
l.value = !0, a(g)(r.id), await a($)(100), l.value = !1;
|
|
70
65
|
}
|
|
71
66
|
}, {
|
|
72
|
-
default:
|
|
73
|
-
b(
|
|
67
|
+
default: v(() => [
|
|
68
|
+
b(r) ? (i(), u(_, {
|
|
74
69
|
key: 0,
|
|
75
70
|
level: 1
|
|
76
71
|
}, {
|
|
77
|
-
default:
|
|
78
|
-
(
|
|
79
|
-
key:
|
|
80
|
-
id: `sidebar-${
|
|
81
|
-
isActive:
|
|
82
|
-
item:
|
|
72
|
+
default: v(() => [
|
|
73
|
+
(i(!0), n(d, null, m(r.children, (f) => (i(), u(h, {
|
|
74
|
+
key: f.id,
|
|
75
|
+
id: `sidebar-${f.id}`,
|
|
76
|
+
isActive: p(f.id),
|
|
77
|
+
item: f
|
|
83
78
|
}, null, 8, ["id", "isActive", "item"]))), 128))
|
|
84
79
|
]),
|
|
85
80
|
_: 2
|
|
86
|
-
}, 1024)) :
|
|
81
|
+
}, 1024)) : A("", !0)
|
|
87
82
|
]),
|
|
88
83
|
_: 2
|
|
89
84
|
}, 1032, ["id", "hasChildren", "isActive", "item", "open", "onToggleOpen"]))), 128))
|
|
90
|
-
], 64)) : (
|
|
85
|
+
], 64)) : (i(), u(h, {
|
|
91
86
|
key: 1,
|
|
92
|
-
id: `sidebar-${
|
|
87
|
+
id: `sidebar-${e.id}`,
|
|
93
88
|
"data-sidebar-type": "heading",
|
|
94
|
-
hasChildren: b(
|
|
95
|
-
isActive:
|
|
96
|
-
item:
|
|
97
|
-
open:
|
|
89
|
+
hasChildren: b(e),
|
|
90
|
+
isActive: p(e.id),
|
|
91
|
+
item: e,
|
|
92
|
+
open: a(E)[e.id] ?? !1,
|
|
98
93
|
onToggleOpen: async () => {
|
|
99
|
-
l.value = !0,
|
|
94
|
+
l.value = !0, a(g)(e.id), await a($)(100), l.value = !1;
|
|
100
95
|
}
|
|
101
96
|
}, {
|
|
102
|
-
default:
|
|
103
|
-
b(
|
|
97
|
+
default: v(() => [
|
|
98
|
+
b(e) ? (i(), u(_, {
|
|
104
99
|
key: 0,
|
|
105
100
|
level: 1
|
|
106
101
|
}, {
|
|
107
|
-
default:
|
|
108
|
-
(
|
|
109
|
-
key:
|
|
110
|
-
id: `sidebar-${
|
|
111
|
-
isActive:
|
|
112
|
-
item:
|
|
102
|
+
default: v(() => [
|
|
103
|
+
(i(!0), n(d, null, m(e.children, (r) => (i(), u(h, {
|
|
104
|
+
key: r.id,
|
|
105
|
+
id: `sidebar-${r.id}`,
|
|
106
|
+
isActive: p(r.id),
|
|
107
|
+
item: r
|
|
113
108
|
}, null, 8, ["id", "isActive", "item"]))), 128))
|
|
114
109
|
]),
|
|
115
110
|
_: 2
|
|
116
|
-
}, 1024)) :
|
|
111
|
+
}, 1024)) : A("", !0)
|
|
117
112
|
]),
|
|
118
113
|
_: 2
|
|
119
114
|
}, 1032, ["id", "hasChildren", "isActive", "item", "open", "onToggleOpen"]))
|
|
@@ -121,11 +116,11 @@ const R = { class: "sidebar" }, U = ["aria-label"], j = { class: "sidebar-group-
|
|
|
121
116
|
]),
|
|
122
117
|
_: 1
|
|
123
118
|
})
|
|
124
|
-
], 8,
|
|
125
|
-
|
|
119
|
+
], 8, R),
|
|
120
|
+
T(t.$slots, "sidebar-end", {}, void 0, !0)
|
|
126
121
|
]));
|
|
127
122
|
}
|
|
128
123
|
});
|
|
129
124
|
export {
|
|
130
|
-
|
|
125
|
+
W as default
|
|
131
126
|
};
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarSidebarGroupToggle as
|
|
3
|
-
import { scrollToId as
|
|
4
|
-
import { getHttpMethodInfo as
|
|
5
|
-
import { sleep as
|
|
6
|
-
import { ScalarIconWebhooksLogo as
|
|
7
|
-
import { isOperationDeprecated as
|
|
8
|
-
import { useConfig as
|
|
9
|
-
import { useNavState as
|
|
10
|
-
import
|
|
11
|
-
const
|
|
1
|
+
import { defineComponent as B, createElementBlock as a, openBlock as i, createElementVNode as s, renderSlot as g, createCommentVNode as l, normalizeClass as O, unref as r, createTextVNode as h, withModifiers as A, createVNode as f, withCtx as b, toDisplayString as p, createBlock as $, normalizeStyle as E } from "vue";
|
|
2
|
+
import { ScalarSidebarGroupToggle as N } from "@scalar/components";
|
|
3
|
+
import { scrollToId as V } from "@scalar/helpers/dom/scroll-to-id";
|
|
4
|
+
import { getHttpMethodInfo as H } from "@scalar/helpers/http/http-info";
|
|
5
|
+
import { sleep as k } from "@scalar/helpers/testing/sleep";
|
|
6
|
+
import { ScalarIconWebhooksLogo as I } from "@scalar/icons";
|
|
7
|
+
import { isOperationDeprecated as P, combineUrlAndPath as R } from "@scalar/oas-utils/helpers";
|
|
8
|
+
import { useConfig as U } from "../../../hooks/useConfig.js";
|
|
9
|
+
import { useNavState as D } from "../../../hooks/useNavState.js";
|
|
10
|
+
import L from "./SidebarHttpBadge.vue.js";
|
|
11
|
+
const M = ["id"], z = {
|
|
12
12
|
key: 0,
|
|
13
13
|
class: "sidebar-heading-chevron"
|
|
14
|
-
},
|
|
14
|
+
}, j = ["aria-expanded"], F = ["href", "tabindex"], G = { class: "sidebar-heading-link-title" }, W = {
|
|
15
15
|
key: 0,
|
|
16
16
|
class: "hanging-indent"
|
|
17
|
-
},
|
|
17
|
+
}, q = { key: 1 }, J = {
|
|
18
18
|
key: 0,
|
|
19
19
|
class: "sidebar-heading-link-method"
|
|
20
|
-
},
|
|
20
|
+
}, K = {
|
|
21
21
|
key: 1,
|
|
22
22
|
class: "action-menu"
|
|
23
|
-
},
|
|
23
|
+
}, ne = /* @__PURE__ */ B({
|
|
24
24
|
__name: "SidebarElement",
|
|
25
25
|
props: {
|
|
26
26
|
id: {},
|
|
@@ -30,73 +30,72 @@ const z = ["id"], j = {
|
|
|
30
30
|
open: { type: Boolean }
|
|
31
31
|
},
|
|
32
32
|
emits: ["toggleOpen"],
|
|
33
|
-
setup(
|
|
34
|
-
const
|
|
35
|
-
d.value = !1,
|
|
36
|
-
},
|
|
37
|
-
if (
|
|
38
|
-
return
|
|
33
|
+
setup(v, { emit: y }) {
|
|
34
|
+
const t = v, m = y, { getFullHash: u, isIntersectionEnabled: d, replaceUrlState: C } = D(), o = U(), w = (e) => "path" in e ? e.path.replace(/\//g, "/") : e.title, c = async () => {
|
|
35
|
+
d.value = !1, t.hasChildren && m("toggleOpen"), await k(100), d.value = !0;
|
|
36
|
+
}, S = () => {
|
|
37
|
+
if (o.value.pathRouting)
|
|
38
|
+
return R(o.value.pathRouting.basePath, t.item.id);
|
|
39
39
|
if (typeof window < "u") {
|
|
40
40
|
const e = new URL(window.location.href);
|
|
41
|
-
return e.hash = u(
|
|
41
|
+
return e.hash = u(t.item.id), `${e.search}${e.hash}`;
|
|
42
42
|
}
|
|
43
|
-
return `#${u(
|
|
44
|
-
},
|
|
45
|
-
|
|
46
|
-
(g = (t = n.value).onSidebarClick) == null || g.call(t, i.item.id), n.value.pathRouting && (e.preventDefault(), i.hasChildren && m("toggleOpen"), m("toggleOpen"), d.value = !1, w(i.item.id), H(i.item.id), await v(100), d.value = !0);
|
|
43
|
+
return `#${u(t.item.id)}`;
|
|
44
|
+
}, T = async (e) => {
|
|
45
|
+
o.value.onSidebarClick?.(t.item.id), o.value.pathRouting && (e.preventDefault(), t.hasChildren && m("toggleOpen"), m("toggleOpen"), d.value = !1, C(t.item.id), V(t.item.id), await k(100), d.value = !0);
|
|
47
46
|
};
|
|
48
|
-
return (e,
|
|
47
|
+
return (e, n) => (i(), a("li", {
|
|
49
48
|
id: e.id,
|
|
50
49
|
class: "sidebar-group-item"
|
|
51
50
|
}, [
|
|
52
51
|
s("div", {
|
|
53
|
-
class:
|
|
52
|
+
class: O(["sidebar-heading", {
|
|
54
53
|
"sidebar-group-item__folder": e.hasChildren,
|
|
55
54
|
active_page: e.isActive,
|
|
56
|
-
deprecated: "operation" in e.item && r(
|
|
55
|
+
deprecated: "operation" in e.item && r(P)(
|
|
57
56
|
e.item.operation
|
|
58
57
|
)
|
|
59
58
|
}]),
|
|
60
59
|
onClick: c
|
|
61
60
|
}, [
|
|
62
|
-
e.hasChildren && !r(
|
|
61
|
+
e.hasChildren && !r(o).defaultOpenAllTags ? (i(), a("p", z, [
|
|
63
62
|
s("button", {
|
|
64
63
|
"aria-expanded": e.open,
|
|
65
64
|
class: "toggle-nested-icon",
|
|
66
65
|
type: "button",
|
|
67
|
-
onClick:
|
|
66
|
+
onClick: A(c, ["stop"])
|
|
68
67
|
}, [
|
|
69
|
-
|
|
70
|
-
label:
|
|
68
|
+
f(r(N), { open: e.open }, {
|
|
69
|
+
label: b(() => [
|
|
71
70
|
h(p(e.open ? "Collapse" : "Expand") + " " + p(e.item.title), 1)
|
|
72
71
|
]),
|
|
73
72
|
_: 1
|
|
74
73
|
}, 8, ["open"])
|
|
75
|
-
], 8,
|
|
76
|
-
|
|
74
|
+
], 8, j),
|
|
75
|
+
n[0] || (n[0] = h(" "))
|
|
77
76
|
])) : l("", !0),
|
|
78
77
|
s("a", {
|
|
79
78
|
class: "sidebar-heading-link",
|
|
80
|
-
href:
|
|
79
|
+
href: S(),
|
|
81
80
|
tabindex: e.hasChildren ? -1 : 0,
|
|
82
|
-
onClick:
|
|
81
|
+
onClick: T
|
|
83
82
|
}, [
|
|
84
|
-
s("p",
|
|
85
|
-
r(
|
|
83
|
+
s("p", G, [
|
|
84
|
+
r(o).operationTitleSource === "path" ? (i(), a("span", W, p(w(e.item)), 1)) : (i(), a("span", q, p(e.item.title), 1))
|
|
86
85
|
]),
|
|
87
|
-
"method" in e.item && !e.hasChildren ? (
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
86
|
+
"method" in e.item && !e.hasChildren ? (i(), a("p", J, [
|
|
87
|
+
n[1] || (n[1] = h(" ")),
|
|
88
|
+
n[2] || (n[2] = s("span", { class: "sr-only" }, "HTTP Method: ", -1)),
|
|
89
|
+
f(L, {
|
|
91
90
|
active: e.isActive,
|
|
92
91
|
class: "min-w-9.75 justify-end text-right",
|
|
93
92
|
method: e.item.method
|
|
94
93
|
}, {
|
|
95
|
-
default:
|
|
96
|
-
"webhook" in e.item ? (
|
|
94
|
+
default: b(() => [
|
|
95
|
+
"webhook" in e.item ? (i(), $(r(I), {
|
|
97
96
|
key: 0,
|
|
98
|
-
style:
|
|
99
|
-
color: r(
|
|
97
|
+
style: E({
|
|
98
|
+
color: r(H)(e.item.method).colorVar
|
|
100
99
|
}),
|
|
101
100
|
weight: "bold"
|
|
102
101
|
}, null, 8, ["style"])) : l("", !0)
|
|
@@ -104,15 +103,15 @@ const z = ["id"], j = {
|
|
|
104
103
|
_: 1
|
|
105
104
|
}, 8, ["active", "method"])
|
|
106
105
|
])) : l("", !0)
|
|
107
|
-
], 8,
|
|
106
|
+
], 8, F)
|
|
108
107
|
], 2),
|
|
109
|
-
e.open ?
|
|
110
|
-
e.$slots["action-menu"] ? (
|
|
111
|
-
|
|
108
|
+
e.open ? g(e.$slots, "default", { key: 0 }, void 0, !0) : l("", !0),
|
|
109
|
+
e.$slots["action-menu"] ? (i(), a("div", K, [
|
|
110
|
+
g(e.$slots, "action-menu", {}, void 0, !0)
|
|
112
111
|
])) : l("", !0)
|
|
113
|
-
], 8,
|
|
112
|
+
], 8, M));
|
|
114
113
|
}
|
|
115
114
|
});
|
|
116
115
|
export {
|
|
117
|
-
|
|
116
|
+
ne as default
|
|
118
117
|
};
|