@scalar/api-reference 1.31.2 → 1.31.4

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.
Files changed (140) hide show
  1. package/CHANGELOG.md +58 -0
  2. package/dist/browser/standalone.js +9428 -9384
  3. package/dist/browser/webpack-stats.json +1 -1
  4. package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
  5. package/dist/components/ApiReferenceLayout.vue.js +2 -2
  6. package/dist/components/ApiReferenceLayout.vue2.js +72 -73
  7. package/dist/components/Badge/Badge.vue.d.ts.map +1 -1
  8. package/dist/components/Badge/Badge.vue.js +1 -1
  9. package/dist/components/Content/ClientLibraries/ClientLibraries.vue.js +2 -2
  10. package/dist/components/Content/ClientLibraries/ClientLibraries.vue2.js +1 -1
  11. package/dist/components/Content/Introduction/Description.vue.d.ts.map +1 -1
  12. package/dist/components/Content/Introduction/Description.vue.js +2 -2
  13. package/dist/components/Content/Lazy/Loading.vue.d.ts.map +1 -1
  14. package/dist/components/Content/Lazy/Loading.vue.js +1 -1
  15. package/dist/components/Content/Schema/SchemaComposition.vue.d.ts.map +1 -1
  16. package/dist/components/Content/Schema/SchemaComposition.vue.js +77 -113
  17. package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
  18. package/dist/components/Content/Schema/SchemaProperty.vue.js +2 -2
  19. package/dist/components/Content/Schema/SchemaProperty.vue2.js +114 -105
  20. package/dist/components/Content/Schema/helpers/merge-all-of-schemas.js +35 -35
  21. package/dist/components/Content/Schema/helpers/optimizeValueForDisplay.d.ts.map +1 -1
  22. package/dist/components/Content/Schema/helpers/optimizeValueForDisplay.js +17 -15
  23. package/dist/components/Content/Schema/helpers/schema-name.d.ts +16 -0
  24. package/dist/components/Content/Schema/helpers/schema-name.d.ts.map +1 -0
  25. package/dist/components/Content/Schema/helpers/schema-name.js +32 -0
  26. package/dist/components/Content/Tag/OperationsList.vue.d.ts.map +1 -1
  27. package/dist/components/Content/Tag/OperationsList.vue.js +1 -1
  28. package/dist/components/Content/Tag/OperationsList.vue2.js +10 -9
  29. package/dist/components/Content/Tag/OperationsListItem.vue.d.ts.map +1 -1
  30. package/dist/components/Content/Tag/OperationsListItem.vue.js +1 -1
  31. package/dist/components/Content/Tag/OperationsListItem.vue2.js +29 -28
  32. package/dist/components/Content/Tag/TagList.vue.d.ts.map +1 -1
  33. package/dist/components/Content/Tag/TagList.vue.js +35 -34
  34. package/dist/components/DocumentSelector/DocumentSelector.vue.d.ts.map +1 -1
  35. package/dist/components/DocumentSelector/DocumentSelector.vue.js +21 -28
  36. package/dist/components/HttpMethod/HttpMethod.vue.d.ts +1 -20
  37. package/dist/components/HttpMethod/HttpMethod.vue.d.ts.map +1 -1
  38. package/dist/components/HttpMethod/HttpMethod.vue.js +12 -13
  39. package/dist/components/Section/CompactSection.vue.js +2 -2
  40. package/dist/components/Section/CompactSection.vue2.js +6 -6
  41. package/dist/components/Sidebar/Sidebar.vue.d.ts.map +1 -1
  42. package/dist/components/Sidebar/Sidebar.vue.js +2 -2
  43. package/dist/components/Sidebar/Sidebar.vue2.js +1 -1
  44. package/dist/components/Sidebar/SidebarElement.vue.js +1 -1
  45. package/dist/components/Sidebar/SidebarElement.vue2.js +5 -5
  46. package/dist/esm.d.ts.map +1 -1
  47. package/dist/features/DocumentSource/hooks/useDocumentFetcher.js +1 -1
  48. package/dist/features/DocumentSource/hooks/useDocumentSource.d.ts +1 -1
  49. package/dist/features/DocumentSource/hooks/useDocumentSource.d.ts.map +1 -1
  50. package/dist/features/DocumentSource/hooks/useDocumentSource.js +11 -11
  51. package/dist/features/DownloadLink/DownloadLink.vue.d.ts +1 -1
  52. package/dist/features/DownloadLink/DownloadLink.vue.d.ts.map +1 -1
  53. package/dist/features/DownloadLink/DownloadLink.vue.js +1 -1
  54. package/dist/features/DownloadLink/DownloadLink.vue2.js +45 -28
  55. package/dist/features/ExampleRequest/ExampleRequest.vue.d.ts.map +1 -1
  56. package/dist/features/ExampleRequest/ExampleRequest.vue.js +1 -1
  57. package/dist/features/ExampleRequest/ExampleRequest.vue2.js +1 -1
  58. package/dist/features/Operation/components/ParameterHeaders.vue.d.ts.map +1 -1
  59. package/dist/features/Operation/components/ParameterHeaders.vue.js +2 -2
  60. package/dist/features/Search/SearchButton.vue.d.ts.map +1 -1
  61. package/dist/features/Search/SearchButton.vue.js +2 -2
  62. package/dist/features/Search/SearchButton.vue2.js +16 -16
  63. package/dist/features/Search/SearchModal.vue.d.ts.map +1 -1
  64. package/dist/features/Search/SearchModal.vue.js +2 -2
  65. package/dist/features/Search/SearchModal.vue2.js +1 -1
  66. package/dist/features/Search/useSearchIndex.d.ts.map +1 -1
  67. package/dist/features/Search/useSearchIndex.js +29 -28
  68. package/dist/features/sidebar/helpers/create-sidebar.d.ts +26 -0
  69. package/dist/features/sidebar/helpers/create-sidebar.d.ts.map +1 -0
  70. package/dist/features/sidebar/hooks/useSidebar.d.ts +23 -0
  71. package/dist/features/sidebar/hooks/useSidebar.d.ts.map +1 -0
  72. package/dist/features/sidebar/index.d.ts +2 -0
  73. package/dist/features/sidebar/index.d.ts.map +1 -0
  74. package/dist/features/traverse-schema/helpers/get-tag.d.ts +4 -0
  75. package/dist/features/traverse-schema/helpers/get-tag.d.ts.map +1 -0
  76. package/dist/features/traverse-schema/helpers/operation-id-params.d.ts +8 -0
  77. package/dist/features/traverse-schema/helpers/operation-id-params.d.ts.map +1 -0
  78. package/dist/features/traverse-schema/helpers/operation-id-params.js +8 -0
  79. package/dist/features/traverse-schema/helpers/traverse-description.d.ts +9 -0
  80. package/dist/features/traverse-schema/helpers/traverse-description.d.ts.map +1 -0
  81. package/dist/features/traverse-schema/helpers/traverse-document.d.ts +16 -0
  82. package/dist/features/traverse-schema/helpers/traverse-document.d.ts.map +1 -0
  83. package/dist/features/traverse-schema/helpers/traverse-paths.d.ts +11 -0
  84. package/dist/features/traverse-schema/helpers/traverse-paths.d.ts.map +1 -0
  85. package/dist/features/traverse-schema/helpers/traverse-schemas.d.ts +6 -0
  86. package/dist/features/traverse-schema/helpers/traverse-schemas.d.ts.map +1 -0
  87. package/dist/features/traverse-schema/helpers/traverse-tags.d.ts +9 -0
  88. package/dist/features/traverse-schema/helpers/traverse-tags.d.ts.map +1 -0
  89. package/dist/features/traverse-schema/helpers/traverse-webhooks.d.ts +6 -0
  90. package/dist/features/traverse-schema/helpers/traverse-webhooks.d.ts.map +1 -0
  91. package/dist/features/traverse-schema/index.d.ts +4 -0
  92. package/dist/features/traverse-schema/index.d.ts.map +1 -0
  93. package/dist/features/traverse-schema/types.d.ts +51 -0
  94. package/dist/features/traverse-schema/types.d.ts.map +1 -0
  95. package/dist/helpers/parse.d.ts.map +1 -1
  96. package/dist/helpers/parse.js +16 -16
  97. package/dist/hooks/useNavState.d.ts +9 -4
  98. package/dist/hooks/useNavState.d.ts.map +1 -1
  99. package/dist/hooks/useNavState.js +31 -29
  100. package/dist/hooks/useSidebar.d.ts.map +1 -1
  101. package/dist/hooks/useSidebar.js +69 -68
  102. package/dist/index.js +1 -1
  103. package/dist/legacy/fixtures/httpRequestMethods.js +2 -6
  104. package/dist/libs/download.d.ts +2 -1
  105. package/dist/libs/download.d.ts.map +1 -1
  106. package/dist/libs/download.js +23 -11
  107. package/dist/stores/useHttpClientStore.js +18 -18
  108. package/dist/style.css +1 -1
  109. package/dist/types.d.ts +0 -1
  110. package/dist/types.d.ts.map +1 -1
  111. package/package.json +12 -11
  112. package/dist/components/HttpMethod/constants.d.ts +0 -9
  113. package/dist/components/HttpMethod/constants.d.ts.map +0 -1
  114. package/dist/components/HttpMethod/constants.js +0 -36
  115. package/dist/components/HttpMethod/utils/isRequestMethod.d.ts +0 -4
  116. package/dist/components/HttpMethod/utils/isRequestMethod.d.ts.map +0 -1
  117. package/dist/components/HttpMethod/utils/isRequestMethod.js +0 -7
  118. package/dist/helpers/freeze-element.d.ts +0 -11
  119. package/dist/helpers/freeze-element.d.ts.map +0 -1
  120. package/dist/helpers/freeze-element.js +0 -20
  121. package/dist/helpers/is-mac-os.d.ts +0 -5
  122. package/dist/helpers/is-mac-os.d.ts.map +0 -1
  123. package/dist/helpers/is-mac-os.js +0 -4
  124. package/dist/helpers/local-storage.d.ts +0 -8
  125. package/dist/helpers/local-storage.d.ts.map +0 -1
  126. package/dist/helpers/local-storage.js +0 -6
  127. package/dist/helpers/measure.d.ts +0 -21
  128. package/dist/helpers/measure.d.ts.map +0 -1
  129. package/dist/helpers/measure.js +0 -7
  130. package/dist/helpers/scroll-to-id.d.ts +0 -7
  131. package/dist/helpers/scroll-to-id.d.ts.map +0 -1
  132. package/dist/helpers/scroll-to-id.js +0 -21
  133. package/dist/helpers/sleep.d.ts +0 -6
  134. package/dist/helpers/sleep.d.ts.map +0 -1
  135. package/dist/helpers/sleep.js +0 -4
  136. package/dist/legacy/helpers/index.d.ts +0 -2
  137. package/dist/legacy/helpers/index.d.ts.map +0 -1
  138. package/dist/legacy/helpers/normalizeRequestMethod.d.ts +0 -6
  139. package/dist/legacy/helpers/normalizeRequestMethod.d.ts.map +0 -1
  140. package/dist/legacy/helpers/normalizeRequestMethod.js +0 -10
@@ -1,11 +1,11 @@
1
1
  import { createWorkspaceStore as V, createActiveEntitiesStore as b } from "@scalar/api-client/store";
2
- import { normalize as E, dereference as F, upgrade as O } from "@scalar/openapi-parser";
3
- import { apiReferenceConfigurationSchema as S } from "@scalar/types/api-reference";
4
- import { computed as g, toValue as t, ref as m, watch as p } from "vue";
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 = g(() => l ? t(l) : t(v)), i = m(""), s = g(() => c ? t(c) : t(d)), d = m({
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
- y("upgrade", () => {
36
- const { specification: a } = O(e);
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 y("dereference", async () => {
43
- const { schema: a, errors: o } = await F(A);
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) ?? S.parse({})
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) ?? S.parse({})
69
+ ...t(n) ?? g.parse({})
70
70
  });
71
71
  }
72
72
  );
@@ -1,6 +1,6 @@
1
1
  type __VLS_Props = {
2
2
  title?: string;
3
3
  };
4
- declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, HTMLDivElement>;
4
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
5
5
  export default _default;
6
6
  //# sourceMappingURL=DownloadLink.vue.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DownloadLink.vue.d.ts","sourceRoot":"","sources":["../../../src/features/DownloadLink/DownloadLink.vue"],"names":[],"mappings":"AA8EA,KAAK,WAAW,GAAG;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAC;;AAmFF,wBAOG"}
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 m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-58f87f8a"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-3d92d514"]]);
5
5
  export {
6
6
  m as default
7
7
  };
@@ -1,38 +1,55 @@
1
- import { defineComponent as u, computed as m, createElementBlock as o, openBlock as e, createCommentVNode as f, unref as t, Fragment as p } from "vue";
2
- import w from "github-slugger";
3
- import { useConfig as _ } from "../../hooks/useConfig.js";
4
- import { downloadEventBus as k } from "../../libs/download.js";
5
- const g = { class: "download" }, h = ["href"], x = /* @__PURE__ */ u({
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
+ import { downloadEventBus as y } from "../../libs/download.js";
6
+ const B = {
7
+ key: 0,
8
+ class: "download-container group"
9
+ }, I = /* @__PURE__ */ w({
6
10
  __name: "DownloadLink",
7
11
  props: {
8
12
  title: {}
9
13
  },
10
- setup(d) {
11
- const n = _(), c = new w(), i = m(() => c.slug(d.title ?? "")), s = () => {
12
- k.emit({ id: "", filename: i.value });
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 });
13
17
  };
14
- return (D, b) => {
15
- var l, a, r;
16
- return e(), o("div", g, [
17
- (l = t(n)) != null && l.hideDownloadButton ? f("", !0) : (e(), o(p, { key: 0 }, [
18
- (a = t(n)) != null && a.url ? (e(), o("a", {
19
- key: 0,
20
- class: "download-button",
21
- download: "",
22
- href: (r = t(n)) == null ? void 0 : r.url,
23
- target: "_blank"
24
- }, " Download OpenAPI Document ", 8, h)) : (e(), o("button", {
25
- key: 1,
26
- class: "download-button",
27
- role: "link",
28
- type: "button",
29
- onClick: s
30
- }, " Download OpenAPI Document "))
31
- ], 64))
32
- ]);
18
+ return (n, o) => {
19
+ var l;
20
+ return (l = k(m)) != null && l.hideDownloadButton ? b("", !0) : (C(), x("div", B, [
21
+ t("button", {
22
+ type: "button",
23
+ class: "download-button",
24
+ onClick: o[0] || (o[0] = r((g) => e("json"), ["prevent"])),
25
+ variant: "ghost"
26
+ }, [
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
+ d("json")
31
+ ])),
32
+ _: 1
33
+ })
34
+ ]),
35
+ t("button", {
36
+ type: "button",
37
+ class: "download-button",
38
+ onClick: o[1] || (o[1] = r((g) => e("yaml"), ["prevent"])),
39
+ variant: "ghost"
40
+ }, [
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
+ d("yaml")
45
+ ])),
46
+ _: 1
47
+ })
48
+ ])
49
+ ]));
33
50
  };
34
51
  }
35
52
  });
36
53
  export {
37
- x as default
54
+ I as default
38
55
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ExampleRequest.vue.d.ts","sourceRoot":"","sources":["../../../src/features/ExampleRequest/ExampleRequest.vue"],"names":[],"mappings":"AA0hBA,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;AAkBjE,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCApMV,GAAG,8CACO,GAAG,yBACpB,GAAG,6DACP,GAAG;;;;;;;;EA+Mb;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
+ {"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-b74e39ac"]]);
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":"ParameterHeaders.vue.d.ts","sourceRoot":"","sources":["../../../../src/features/Operation/components/ParameterHeaders.vue"],"names":[],"mappings":"AA4HA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAMxD,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW,CAAC,YAAY,CAAA;KAAE,CAAA;CACrD,CAAC;;AAiJF,wBAOG"}
1
+ {"version":3,"file":"ParameterHeaders.vue.d.ts","sourceRoot":"","sources":["../../../../src/features/Operation/components/ParameterHeaders.vue"],"names":[],"mappings":"AAwHA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAMxD,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW,CAAC,YAAY,CAAA;KAAE,CAAA;CACrD,CAAC;;AAiJF,wBAOG"}
@@ -1,7 +1,7 @@
1
1
  import r from "./ParameterHeaders.vue2.js";
2
2
  /* empty css */
3
- import o from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ o(r, [["__scopeId", "data-v-109720f0"]]);
3
+ import a from "../../../_virtual/_plugin-vue_export-helper.js";
4
+ const m = /* @__PURE__ */ a(r, [["__scopeId", "data-v-9293fa9e"]]);
5
5
  export {
6
6
  m as default
7
7
  };
@@ -1 +1 @@
1
- {"version":3,"file":"SearchButton.vue.d.ts","sourceRoot":"","sources":["../../../src/features/Search/SearchButton.vue"],"names":[],"mappings":"AAwJA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAShD,KAAK,WAAW,GAAG;IACf,IAAI,EAAE,IAAI,CAAA;IACV,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,CAAC;;kBADe,MAAM;;AAsJzB,wBAOG"}
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 e = /* @__PURE__ */ t(o, [["__scopeId", "data-v-ec9c0928"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-065378cc"]]);
5
5
  export {
6
- e as default
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 s, createVNode as p, normalizeClass as C, unref as l, createTextVNode as u, toDisplayString as M } from "vue";
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(), t = B(), { client: y } = L(), d = (o) => {
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(), t.open ? t.hide() : t.show());
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
- () => t.open,
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
- t.show();
28
+ s.show();
29
29
  }
30
30
  return (o, e) => (n(), a(r, null, [
31
- s("button", {
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
- s("div", N, [
44
- e[3] || (e[3] = s("span", { class: "sr-only" }, "Open Search", -1)),
45
- e[4] || (e[4] = s("span", {
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
- s("span", T, [
50
- e[2] || (e[2] = s("span", { class: "sr-only" }, "Keyboard Shortcut:", -1)),
51
- s("kbd", V, [
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] = s("span", { class: "sr-only" }, "CTRL", -1)),
56
- e[1] || (e[1] = s("span", { "aria-hidden": "true" }, "⌃", -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(t),
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;AAC3B,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAiBhD,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,IAAI,CAAA;IAChB,UAAU,EAAE,UAAU,CAAA;CACvB,CAAC;;AA6ZF,wBAOG"}
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 p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-587d8690"]]);
4
+ const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-b601e986"]]);
5
5
  export {
6
- p as default
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;AAKlE,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
+ {"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 d, watch as E, computed as O } from "vue";
3
- import { useNavState as V } from "../../hooks/useNavState.js";
4
- import { useOperation as A } from "../../hooks/useOperation.js";
5
- import { useSidebar as B } from "../../hooks/useSidebar.js";
6
- import { getHeadingsFromMarkdown as P } from "../../libs/markdown.js";
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
- function _({
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 } = B(), { getHeadingId: j, getWebhookId: L, getModelId: W, getOperationId: q, getTagId: C } = V(), s = d([]), l = d([]), a = d(), r = d(""), c = new N(s.value, {
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
- }), v = () => {
14
- a.value = 0, l.value = c.search(r.value);
14
+ }), m = () => {
15
+ s.value = 0, l.value = c.search(r.value);
15
16
  };
16
17
  E(r, (e) => {
17
- e.length ? v() : l.value = [];
18
+ e.length ? m() : l.value = [];
18
19
  });
19
20
  function F() {
20
- r.value = "", a.value = void 0, l.value = [];
21
+ r.value = "", s.value = void 0, l.value = [];
21
22
  }
22
- const m = O(() => r.value.length === 0 ? s.value.slice(0, 25).map((i) => ({
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 a.value == "number" ? m.value[a.value] : void 0
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 (s.value = [], !((I = e == null ? void 0 : e.tags) != null && I.length) && !((p = e == null ? void 0 : e.webhooks) != null && p.length)) {
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 = P(((k = e == null ? void 0 : e.info) == null ? void 0 : k.description) ?? "");
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
- }), s.value = s.value.concat(i)), (M = e == null ? void 0 : e.tags) == null || M.forEach((t) => {
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
- s.value.push(D), t.operations && t.operations.forEach((o) => {
55
- const { parameterMap: h } = A(o), $ = z(o) || h.value;
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), s.value.push(x);
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 h;
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: `${(h = u[t][o]) == null ? void 0 : h.name}`,
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
- }), s.value = s.value.concat(y);
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
- }), s.value = s.value.concat(g)), c.setCollection(s.value);
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: v,
103
- selectedSearchIndex: a,
103
+ fuseSearch: m,
104
+ selectedSearchIndex: s,
104
105
  selectedSearchResult: H,
105
- searchResultsWithPlaceholderResults: m,
106
+ searchResultsWithPlaceholderResults: v,
106
107
  searchText: r
107
108
  };
108
109
  }
109
110
  export {
110
- _ as useSearchIndex
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,2 @@
1
+ export { useSidebar, SIDEBAR_SYMBOL } from './hooks/useSidebar';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-tag.d.ts","sourceRoot":"","sources":["../../../../src/features/traverse-schema/helpers/get-tag.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAExD,qEAAqE;AACrE,eAAO,MAAM,MAAM,aAAc,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,SAAS,CAAC,QAAQ,MAAM,wDAWhF,CAAA"}
@@ -0,0 +1,8 @@
1
+ import type { OpenAPIV3_1 } from '@scalar/openapi-types';
2
+ import type { TransformedOperation } from '@scalar/types/legacy';
3
+ /** Temp helper for converting transformed operation to operationId payload */
4
+ export declare const operationIdParams: (transformedOperation: TransformedOperation) => {
5
+ path: string;
6
+ method: OpenAPIV3_1.HttpMethods;
7
+ } & OpenAPIV3_1.OperationObject;
8
+ //# sourceMappingURL=operation-id-params.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operation-id-params.d.ts","sourceRoot":"","sources":["../../../../src/features/traverse-schema/helpers/operation-id-params.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAEhE,8EAA8E;AAC9E,eAAO,MAAM,iBAAiB,yBACN,oBAAoB,KACzC;IACD,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,WAAW,CAAC,WAAW,CAAA;CAChC,GAAG,WAAW,CAAC,eAId,CAAA"}
@@ -0,0 +1,8 @@
1
+ const o = (t) => ({
2
+ ...t.information,
3
+ path: t.path,
4
+ method: t.httpVerb.toLowerCase()
5
+ });
6
+ export {
7
+ o as operationIdParams
8
+ };
@@ -0,0 +1,9 @@
1
+ import type { TraversedDescription } from '../../../features/traverse-schema/types';
2
+ import type { Heading } from '@scalar/types/legacy';
3
+ export declare const DEFAULT_INTRODUCTION_SLUG = "introduction";
4
+ /**
5
+ * Creates sidebar entries from markdown headings in the OpenAPI description.
6
+ * Only includes the top two levels of headings for a clean hierarchy.
7
+ */
8
+ export declare const traverseDescription: (description: string | undefined, titlesMap: Map<string, string>, getHeadingId: (heading: Heading) => string) => TraversedDescription[];
9
+ //# sourceMappingURL=traverse-description.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"traverse-description.d.ts","sourceRoot":"","sources":["../../../../src/features/traverse-schema/helpers/traverse-description.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAA;AAE5E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAEnD,eAAO,MAAM,yBAAyB,iBAAiB,CAAA;AAEvD;;;GAGG;AACH,eAAO,MAAM,mBAAmB,gBACjB,MAAM,GAAG,SAAS,aAEpB,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,gBAChB,CAAC,OAAO,EAAE,OAAO,KAAK,MAAM,KACzC,oBAAoB,EAmDtB,CAAA"}
@@ -0,0 +1,16 @@
1
+ import type { OpenAPIV3_1 } from '@scalar/openapi-types';
2
+ import type { TraverseSpecOptions, TraversedEntry } from '../../../features/traverse-schema/types';
3
+ /**
4
+ * Travers the OpenAPI Document and ensure we only do it once
5
+ *
6
+ * We are generating the following:
7
+ * - the sidebar
8
+ * - the search index (todo)
9
+ *
10
+ * Currently its called by createSidebar, but we can move this into the de-reference process as a plugin for even more gains
11
+ */
12
+ export declare const traverseDocument: (document: OpenAPIV3_1.Document, { config, getHeadingId, getOperationId, getWebhookId, getModelId, getTagId }: TraverseSpecOptions) => {
13
+ entries: TraversedEntry[];
14
+ titles: Map<string, string>;
15
+ };
16
+ //# sourceMappingURL=traverse-document.d.ts.map