@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.
Files changed (194) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/dist/browser/standalone.js +14984 -15007
  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 +1 -1
  6. package/dist/components/ApiReferenceLayout.vue2.js +148 -150
  7. package/dist/components/Content/Content.vue.d.ts.map +1 -1
  8. package/dist/components/Content/Content.vue.js +44 -51
  9. package/dist/components/Content/Models/ClassicLayout.vue.d.ts +4 -1
  10. package/dist/components/Content/Models/ClassicLayout.vue.d.ts.map +1 -1
  11. package/dist/components/Content/Models/ClassicLayout.vue.js +1 -1
  12. package/dist/components/Content/Models/ClassicLayout.vue2.js +49 -40
  13. package/dist/components/Content/Models/Models.vue.d.ts +2 -2
  14. package/dist/components/Content/Models/Models.vue.d.ts.map +1 -1
  15. package/dist/components/Content/Models/Models.vue.js +25 -23
  16. package/dist/components/Content/Models/ModernLayout.vue.d.ts +1 -0
  17. package/dist/components/Content/Models/ModernLayout.vue.d.ts.map +1 -1
  18. package/dist/components/Content/Models/ModernLayout.vue.js +2 -2
  19. package/dist/components/Content/Models/ModernLayout.vue2.js +54 -51
  20. package/dist/components/Content/Operations/TraversedEntry.vue.d.ts +1 -2
  21. package/dist/components/Content/Operations/TraversedEntry.vue.d.ts.map +1 -1
  22. package/dist/components/Content/Operations/TraversedEntry.vue.js +24 -24
  23. package/dist/components/Content/Operations/TraversedEntryContainer.vue.d.ts.map +1 -1
  24. package/dist/components/Content/Operations/TraversedEntryContainer.vue.js +1 -1
  25. package/dist/components/Content/Operations/get-current-index.d.ts +1 -1
  26. package/dist/components/Content/Operations/get-current-index.d.ts.map +1 -1
  27. package/dist/components/Content/Operations/get-current-index.js +1 -1
  28. package/dist/components/Content/Schema/Schema.vue.d.ts +3 -4
  29. package/dist/components/Content/Schema/Schema.vue.d.ts.map +1 -1
  30. package/dist/components/Content/Schema/Schema.vue.js +2 -2
  31. package/dist/components/Content/Schema/Schema.vue2.js +72 -75
  32. package/dist/components/Content/Schema/SchemaComposition.vue.d.ts +4 -5
  33. package/dist/components/Content/Schema/SchemaComposition.vue.d.ts.map +1 -1
  34. package/dist/components/Content/Schema/SchemaComposition.vue.js +46 -49
  35. package/dist/components/Content/Schema/SchemaObjectProperties.vue.d.ts +2 -7
  36. package/dist/components/Content/Schema/SchemaObjectProperties.vue.d.ts.map +1 -1
  37. package/dist/components/Content/Schema/SchemaObjectProperties.vue.js +33 -54
  38. package/dist/components/Content/Schema/SchemaProperty.vue.d.ts +4 -6
  39. package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
  40. package/dist/components/Content/Schema/SchemaProperty.vue.js +2 -2
  41. package/dist/components/Content/Schema/SchemaProperty.vue2.js +72 -76
  42. package/dist/components/Content/Schema/helpers/sort-property-names.d.ts +16 -0
  43. package/dist/components/Content/Schema/helpers/sort-property-names.d.ts.map +1 -0
  44. package/dist/components/Content/Schema/helpers/sort-property-names.js +36 -0
  45. package/dist/components/Content/Schema/types.d.ts +17 -0
  46. package/dist/components/Content/Schema/types.d.ts.map +1 -0
  47. package/dist/components/Content/Tags/ClassicLayout.vue.d.ts +1 -1
  48. package/dist/components/Content/Tags/ClassicLayout.vue.d.ts.map +1 -1
  49. package/dist/components/Content/Tags/ClassicLayout.vue.js +2 -2
  50. package/dist/components/Content/Tags/ClassicLayout.vue2.js +1 -1
  51. package/dist/components/Content/Tags/ModernLayout.vue.d.ts +1 -1
  52. package/dist/components/Content/Tags/ModernLayout.vue.d.ts.map +1 -1
  53. package/dist/components/Content/Tags/ModernLayout.vue.js +2 -2
  54. package/dist/components/Content/Tags/ModernLayout.vue2.js +2 -2
  55. package/dist/components/Content/Tags/Tag.vue.d.ts +1 -1
  56. package/dist/components/Content/Tags/Tag.vue.d.ts.map +1 -1
  57. package/dist/components/Content/Tags/TagSection.vue.d.ts +1 -1
  58. package/dist/components/Content/Tags/TagSection.vue.d.ts.map +1 -1
  59. package/dist/components/Content/Tags/TagSection.vue.js +4 -4
  60. package/dist/components/MobileHeader.vue.js +2 -2
  61. package/dist/components/MobileHeader.vue2.js +1 -1
  62. package/dist/components/OperationsList/OperationsList.vue.d.ts +1 -1
  63. package/dist/components/OperationsList/OperationsList.vue.d.ts.map +1 -1
  64. package/dist/components/OperationsList/OperationsList.vue.js +1 -1
  65. package/dist/components/OperationsList/OperationsList.vue2.js +9 -11
  66. package/dist/components/OperationsList/OperationsListItem.vue.d.ts +1 -1
  67. package/dist/components/OperationsList/OperationsListItem.vue.d.ts.map +1 -1
  68. package/dist/components/OperationsList/OperationsListItem.vue.js +2 -2
  69. package/dist/components/OperationsList/OperationsListItem.vue2.js +24 -27
  70. package/dist/components/Section/Section.vue.d.ts.map +1 -1
  71. package/dist/components/Section/Section.vue.js +2 -2
  72. package/dist/components/Section/Section.vue2.js +12 -13
  73. package/dist/components/Section/SectionAccordion.vue.d.ts.map +1 -1
  74. package/dist/components/Section/SectionAccordion.vue.js +1 -1
  75. package/dist/components/Section/SectionAccordion.vue2.js +36 -37
  76. package/dist/components/ShowMoreButton.vue.js +2 -2
  77. package/dist/components/ShowMoreButton.vue2.js +3 -3
  78. package/dist/features/Operation/Operation.vue.d.ts.map +1 -1
  79. package/dist/features/Operation/Operation.vue.js +32 -22
  80. package/dist/features/Operation/components/Header.vue.d.ts +2 -0
  81. package/dist/features/Operation/components/Header.vue.d.ts.map +1 -1
  82. package/dist/features/Operation/components/Header.vue.js +15 -10
  83. package/dist/features/Operation/components/Headers.vue.d.ts +2 -0
  84. package/dist/features/Operation/components/Headers.vue.d.ts.map +1 -1
  85. package/dist/features/Operation/components/Headers.vue.js +1 -1
  86. package/dist/features/Operation/components/Headers.vue2.js +23 -21
  87. package/dist/features/Operation/components/ParameterListItem.vue.d.ts.map +1 -1
  88. package/dist/features/Operation/components/ParameterListItem.vue.js +2 -2
  89. package/dist/features/Operation/components/ParameterListItem.vue2.js +55 -48
  90. package/dist/features/Operation/components/RequestBody.vue.d.ts.map +1 -1
  91. package/dist/features/Operation/components/RequestBody.vue.js +1 -1
  92. package/dist/features/Operation/components/RequestBody.vue2.js +74 -49
  93. package/dist/features/Operation/helpers/get-first-server.d.ts +9 -0
  94. package/dist/features/Operation/helpers/get-first-server.d.ts.map +1 -0
  95. package/dist/features/Operation/helpers/get-first-server.js +20 -0
  96. package/dist/features/Search/components/SearchButton.vue.d.ts +2 -0
  97. package/dist/features/Search/components/SearchButton.vue.d.ts.map +1 -1
  98. package/dist/features/Search/components/SearchButton.vue.js +19 -17
  99. package/dist/features/Search/components/SearchModal.vue.d.ts +2 -1
  100. package/dist/features/Search/components/SearchModal.vue.d.ts.map +1 -1
  101. package/dist/features/Search/components/SearchModal.vue.js +2 -2
  102. package/dist/features/Search/components/SearchModal.vue2.js +74 -75
  103. package/dist/features/Search/helpers/create-search-index.d.ts +2 -2
  104. package/dist/features/Search/helpers/create-search-index.d.ts.map +1 -1
  105. package/dist/features/Search/helpers/create-search-index.js +68 -66
  106. package/dist/features/Search/hooks/useSearchIndex.d.ts +3 -2
  107. package/dist/features/Search/hooks/useSearchIndex.d.ts.map +1 -1
  108. package/dist/features/Search/hooks/useSearchIndex.js +13 -13
  109. package/dist/features/Search/types.d.ts +1 -1
  110. package/dist/features/Search/types.d.ts.map +1 -1
  111. package/dist/features/api-client-modal/useApiClient.d.ts +40 -40
  112. package/dist/features/api-client-modal/useApiClient.d.ts.map +1 -1
  113. package/dist/helpers/convert-security-scheme.d.ts +1 -1
  114. package/dist/helpers/test-utils.d.ts +367 -5
  115. package/dist/helpers/test-utils.d.ts.map +1 -1
  116. package/dist/hooks/useNavState.d.ts +1 -15
  117. package/dist/hooks/useNavState.d.ts.map +1 -1
  118. package/dist/hooks/useNavState.js +29 -53
  119. package/dist/index.d.ts +5 -6
  120. package/dist/index.d.ts.map +1 -1
  121. package/dist/index.js +16 -20
  122. package/dist/style.css +1 -1
  123. package/dist/v2/blocks/scalar-request-example-block/helpers/get-secrets.d.ts.map +1 -1
  124. package/dist/v2/blocks/scalar-request-example-block/helpers/get-secrets.js +5 -6
  125. package/dist/{features/sidebar/components/Sidebar.vue.d.ts → v2/blocks/scalar-sidebar-block/components/SidebarBlock.vue.d.ts} +1 -1
  126. package/dist/v2/blocks/scalar-sidebar-block/components/SidebarBlock.vue.d.ts.map +1 -0
  127. package/dist/v2/blocks/scalar-sidebar-block/components/SidebarBlock.vue.js +7 -0
  128. package/dist/{features/sidebar/components/Sidebar.vue2.js → v2/blocks/scalar-sidebar-block/components/SidebarBlock.vue2.js} +15 -15
  129. package/dist/{features/sidebar → v2/blocks/scalar-sidebar-block}/components/SidebarElement.vue.d.ts +1 -1
  130. package/dist/v2/blocks/scalar-sidebar-block/components/SidebarElement.vue.d.ts.map +1 -0
  131. package/dist/v2/blocks/scalar-sidebar-block/components/SidebarElement.vue.js +7 -0
  132. package/dist/{features/sidebar → v2/blocks/scalar-sidebar-block}/components/SidebarElement.vue2.js +41 -43
  133. package/dist/v2/blocks/scalar-sidebar-block/components/SidebarGroup.vue.d.ts.map +1 -0
  134. package/dist/v2/blocks/scalar-sidebar-block/components/SidebarGroup.vue.js +7 -0
  135. package/dist/v2/blocks/scalar-sidebar-block/components/SidebarHttpBadge.vue.d.ts.map +1 -0
  136. package/dist/v2/blocks/scalar-sidebar-block/components/SidebarHttpBadge.vue.js +7 -0
  137. package/dist/{features/sidebar → v2/blocks/scalar-sidebar-block}/components/SidebarHttpBadge.vue2.js +1 -1
  138. package/dist/v2/blocks/scalar-sidebar-block/helpers/create-sidebar.d.ts +385 -0
  139. package/dist/v2/blocks/scalar-sidebar-block/helpers/create-sidebar.d.ts.map +1 -0
  140. package/dist/v2/blocks/scalar-sidebar-block/helpers/create-sidebar.js +35 -0
  141. package/dist/v2/blocks/scalar-sidebar-block/helpers/generate-reverse-index.d.ts +189 -0
  142. package/dist/v2/blocks/scalar-sidebar-block/helpers/generate-reverse-index.d.ts.map +1 -0
  143. package/dist/v2/blocks/scalar-sidebar-block/helpers/generate-reverse-index.js +9 -0
  144. package/dist/{features/sidebar → v2/blocks/scalar-sidebar-block}/hooks/useSidebar.d.ts +4 -8
  145. package/dist/v2/blocks/scalar-sidebar-block/hooks/useSidebar.d.ts.map +1 -0
  146. package/dist/v2/blocks/scalar-sidebar-block/hooks/useSidebar.js +18 -0
  147. package/dist/v2/blocks/scalar-sidebar-block/index.d.ts +4 -0
  148. package/dist/v2/blocks/scalar-sidebar-block/index.d.ts.map +1 -0
  149. package/dist/v2/helpers/map-configuration.d.ts.map +1 -1
  150. package/package.json +11 -11
  151. package/dist/features/sidebar/components/Sidebar.vue.d.ts.map +0 -1
  152. package/dist/features/sidebar/components/Sidebar.vue.js +0 -7
  153. package/dist/features/sidebar/components/SidebarElement.vue.d.ts.map +0 -1
  154. package/dist/features/sidebar/components/SidebarElement.vue.js +0 -7
  155. package/dist/features/sidebar/components/SidebarGroup.vue.d.ts.map +0 -1
  156. package/dist/features/sidebar/components/SidebarGroup.vue.js +0 -7
  157. package/dist/features/sidebar/components/SidebarHttpBadge.vue.d.ts.map +0 -1
  158. package/dist/features/sidebar/components/SidebarHttpBadge.vue.js +0 -7
  159. package/dist/features/sidebar/helpers/create-sidebar.d.ts +0 -28
  160. package/dist/features/sidebar/helpers/create-sidebar.d.ts.map +0 -1
  161. package/dist/features/sidebar/helpers/create-sidebar.js +0 -32
  162. package/dist/features/sidebar/hooks/useSidebar.d.ts.map +0 -1
  163. package/dist/features/sidebar/hooks/useSidebar.js +0 -18
  164. package/dist/features/sidebar/index.d.ts +0 -4
  165. package/dist/features/sidebar/index.d.ts.map +0 -1
  166. package/dist/features/traverse-schema/helpers/get-tag.d.ts +0 -6
  167. package/dist/features/traverse-schema/helpers/get-tag.d.ts.map +0 -1
  168. package/dist/features/traverse-schema/helpers/get-tag.js +0 -7
  169. package/dist/features/traverse-schema/helpers/traverse-description.d.ts +0 -11
  170. package/dist/features/traverse-schema/helpers/traverse-description.d.ts.map +0 -1
  171. package/dist/features/traverse-schema/helpers/traverse-description.js +0 -32
  172. package/dist/features/traverse-schema/helpers/traverse-document.d.ts +0 -16
  173. package/dist/features/traverse-schema/helpers/traverse-document.d.ts.map +0 -1
  174. package/dist/features/traverse-schema/helpers/traverse-document.js +0 -33
  175. package/dist/features/traverse-schema/helpers/traverse-paths.d.ts +0 -18
  176. package/dist/features/traverse-schema/helpers/traverse-paths.d.ts.map +0 -1
  177. package/dist/features/traverse-schema/helpers/traverse-paths.js +0 -30
  178. package/dist/features/traverse-schema/helpers/traverse-schemas.d.ts +0 -8
  179. package/dist/features/traverse-schema/helpers/traverse-schemas.d.ts.map +0 -1
  180. package/dist/features/traverse-schema/helpers/traverse-schemas.js +0 -21
  181. package/dist/features/traverse-schema/helpers/traverse-tags.d.ts +0 -11
  182. package/dist/features/traverse-schema/helpers/traverse-tags.d.ts.map +0 -1
  183. package/dist/features/traverse-schema/helpers/traverse-tags.js +0 -43
  184. package/dist/features/traverse-schema/helpers/traverse-webhooks.d.ts +0 -10
  185. package/dist/features/traverse-schema/helpers/traverse-webhooks.d.ts.map +0 -1
  186. package/dist/features/traverse-schema/helpers/traverse-webhooks.js +0 -24
  187. package/dist/features/traverse-schema/index.d.ts +0 -5
  188. package/dist/features/traverse-schema/index.d.ts.map +0 -1
  189. package/dist/features/traverse-schema/types.d.ts +0 -55
  190. package/dist/features/traverse-schema/types.d.ts.map +0 -1
  191. package/dist/libs/markdown.js +0 -18
  192. /package/dist/{features/sidebar → v2/blocks/scalar-sidebar-block}/components/SidebarGroup.vue.d.ts +0 -0
  193. /package/dist/{features/sidebar → v2/blocks/scalar-sidebar-block}/components/SidebarGroup.vue2.js +0 -0
  194. /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, OpenAPIV3_1 } from '@scalar/types/legacy';
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":"AAEA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAA;AAC5E,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,8DAA8D,CAAA;AAE9G,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,GAAG,EAAe,MAAM,KAAK,CAAA;AAE9D,MAAM,MAAM,QAAQ,GAAG;IACrB,0EAA0E;IAC1E,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,CA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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 { useConfig as b } from "./useConfig.js";
2
- import { combineUrlAndPath as h } from "@scalar/helpers/url/merge-urls";
3
- import { slug as s } from "github-slugger";
4
- import { inject as R, ref as i } from "vue";
5
- const k = Symbol(), y = i(!1), P = i(""), U = i(""), M = (d) => {
6
- const { isIntersectionEnabled: f, hash: r, hashPrefix: u } = R(k, {
7
- isIntersectionEnabled: y,
8
- hash: P,
9
- hashPrefix: U
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
- }, p = (e = r.value) => {
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(u.value.length)
21
- ), m = () => r.value = g(), v = (e, n = window.location.href) => {
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: r,
19
+ hash: s,
35
20
  /** Sets the prefix for the hash */
36
21
  setHashPrefix: (e) => {
37
- u.value = e;
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: w,
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: v,
57
- getReferenceId: g,
58
- getWebhookId: (e, n) => {
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
- getModelId: S,
65
- getHeadingId: I,
66
- getOperationId: (e, n) => typeof t.value.generateOperationSlug == "function" ? `${l(n)}/${t.value.generateOperationSlug({
67
- path: e.path,
68
- operationId: e.operationId,
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
- k as NAV_STATE_SYMBOL,
81
- M as useNavState
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 { createApiReference } from './standalone/lib/html-api.js';
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
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,+BAA+B,CAAA;AACvE,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,qCAAqC,CAAA;AACnF,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,gCAAgC,CAAA;AACjF,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAE7D,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAE3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAE9D,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAGxD,OAAO,EAAE,uB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