@scalar/api-reference 1.25.104 → 1.25.106

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 (65) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/dist/browser/standalone.js +7083 -7073
  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 +119 -131
  7. package/dist/components/Content/Lazy/Loading.vue.js +2 -2
  8. package/dist/components/Content/Models/Models.vue.js +2 -2
  9. package/dist/components/Content/Models/Models.vue2.js +2 -2
  10. package/dist/components/Content/Models/ModelsAccordion.vue.js +2 -2
  11. package/dist/components/Content/Models/ModelsAccordion.vue2.js +2 -2
  12. package/dist/components/Content/Tag/Endpoints.vue2.js +3 -3
  13. package/dist/components/Content/Tag/TagList.vue.js +3 -3
  14. package/dist/components/Section/CompactSection.vue2.js +4 -4
  15. package/dist/components/Section/Section.vue2.js +3 -3
  16. package/dist/components/Sidebar/Sidebar.vue2.js +3 -3
  17. package/dist/components/Sidebar/SidebarElement.vue2.js +6 -6
  18. package/dist/features/ApiClientModal/useApiClient.d.ts.map +1 -1
  19. package/dist/features/DownloadLink/DownloadLink.vue.d.ts.map +1 -1
  20. package/dist/features/DownloadLink/DownloadLink.vue.js +2 -2
  21. package/dist/features/DownloadLink/DownloadLink.vue2.js +14 -21
  22. package/dist/features/Operation/Webhooks.vue.js +3 -3
  23. package/dist/features/Operation/Webhooks.vue2.js +9 -9
  24. package/dist/features/Operation/components/OperationParameters.vue.d.ts +2 -2
  25. package/dist/features/Operation/components/OperationParameters.vue.d.ts.map +1 -1
  26. package/dist/features/Operation/components/OperationParameters.vue.js +34 -49
  27. package/dist/features/Operation/components/ParameterList.vue.d.ts +2 -2
  28. package/dist/features/Operation/components/ParameterList.vue.d.ts.map +1 -1
  29. package/dist/features/Operation/components/ParameterList.vue.js +3 -3
  30. package/dist/features/Operation/components/ParameterListItem.vue.d.ts +3 -3
  31. package/dist/features/Operation/components/ParameterListItem.vue.d.ts.map +1 -1
  32. package/dist/features/Operation/components/ParameterListItem.vue.js +1 -1
  33. package/dist/features/Operation/components/ParameterListItem.vue2.js +34 -31
  34. package/dist/features/Operation/components/RequestBody.vue.d.ts.map +1 -1
  35. package/dist/features/Operation/components/RequestBody.vue.js +1 -1
  36. package/dist/features/Operation/components/RequestBody.vue2.js +37 -33
  37. package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts.map +1 -1
  38. package/dist/features/Operation/layouts/ClassicLayout.vue.js +2 -2
  39. package/dist/features/Operation/layouts/ClassicLayout.vue2.js +34 -34
  40. package/dist/features/Operation/layouts/ModernLayout.vue.js +2 -2
  41. package/dist/features/Operation/layouts/ModernLayout.vue2.js +12 -12
  42. package/dist/features/Search/useSearchIndex.js +11 -11
  43. package/dist/features/TestRequestButton/TestRequestButton.vue.d.ts.map +1 -1
  44. package/dist/features/TestRequestButton/TestRequestButton.vue.js +2 -2
  45. package/dist/features/TestRequestButton/TestRequestButton.vue2.js +21 -21
  46. package/dist/helpers/index.d.ts +0 -1
  47. package/dist/helpers/index.d.ts.map +1 -1
  48. package/dist/helpers/parse.d.ts.map +1 -1
  49. package/dist/helpers/parse.js +59 -60
  50. package/dist/hooks/useConfig.d.ts +6 -0
  51. package/dist/hooks/useConfig.d.ts.map +1 -0
  52. package/dist/hooks/useConfig.js +6 -0
  53. package/dist/hooks/useNavState.d.ts +8 -3
  54. package/dist/hooks/useNavState.d.ts.map +1 -1
  55. package/dist/hooks/useNavState.js +71 -59
  56. package/dist/hooks/useSidebar.d.ts.map +1 -1
  57. package/dist/hooks/useSidebar.js +149 -149
  58. package/dist/index.js +58 -63
  59. package/dist/style.css +1 -1
  60. package/package.json +11 -11
  61. package/dist/features/Operation/components/RequestBodyPropertiesChild.vue.d.ts +0 -7
  62. package/dist/features/Operation/components/RequestBodyPropertiesChild.vue.d.ts.map +0 -1
  63. package/dist/helpers/provideSymbols.d.ts +0 -7
  64. package/dist/helpers/provideSymbols.d.ts.map +0 -1
  65. package/dist/helpers/provideSymbols.js +0 -7
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAA;AAC1C,cAAc,aAAa,CAAA;AAC3B,cAAc,kBAAkB,CAAA;AAChC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,2BAA2B,CAAA;AACzC,cAAc,yBAAyB,CAAA;AACvC,cAAc,aAAa,CAAA;AAC3B,cAAc,oBAAoB,CAAA;AAClC,cAAc,aAAa,CAAA;AAC3B,cAAc,sBAAsB,CAAA;AACpC,cAAc,eAAe,CAAA;AAC7B,cAAc,WAAW,CAAA;AACzB,cAAc,iBAAiB,CAAA;AAC/B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,mBAAmB,CAAA;AACjC,cAAc,SAAS,CAAA;AACvB,cAAc,kBAAkB,CAAA;AAChC,cAAc,cAAc,CAAA;AAC5B,cAAc,SAAS,CAAA;AACvB,cAAc,iBAAiB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAA;AAC1C,cAAc,aAAa,CAAA;AAC3B,cAAc,kBAAkB,CAAA;AAChC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,2BAA2B,CAAA;AACzC,cAAc,yBAAyB,CAAA;AACvC,cAAc,aAAa,CAAA;AAC3B,cAAc,oBAAoB,CAAA;AAClC,cAAc,aAAa,CAAA;AAC3B,cAAc,sBAAsB,CAAA;AACpC,cAAc,eAAe,CAAA;AAC7B,cAAc,WAAW,CAAA;AACzB,cAAc,iBAAiB,CAAA;AAC/B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,mBAAmB,CAAA;AACjC,cAAc,SAAS,CAAA;AACvB,cAAc,cAAc,CAAA;AAC5B,cAAc,SAAS,CAAA;AACvB,cAAc,iBAAiB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../src/helpers/parse.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,IAAI,EAAW,MAAM,sBAAsB,CAAA;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAMxD;;;;GAIG;AACH,eAAO,MAAM,KAAK,kBACD,aAAa,GAAG,MAAM,GAAG,SAAS,kBAG9C;IACD,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,KACA,OAAO,CAAC,IAAI,CA0Dd,CAAA"}
1
+ {"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../src/helpers/parse.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAChD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAMxD;;;;GAIG;AACH,eAAO,MAAM,KAAK,kBACD,aAAa,GAAG,MAAM,GAAG,SAAS,kBAG9C;IACD,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,KACA,OAAO,CAAC,IAAI,CA0Dd,CAAA"}
@@ -5,7 +5,7 @@ import { createEmptySpecification as O } from "./createEmptySpecification.js";
5
5
  import { normalizeRequestMethod as k } from "../legacy/helpers/normalizeRequestMethod.js";
6
6
  import { validRequestMethods as F } from "../legacy/fixtures/httpRequestMethods.js";
7
7
  const H = (m, {
8
- proxyUrl: e
8
+ proxyUrl: t
9
9
  } = {}) => new Promise(async (o, E) => {
10
10
  var h;
11
11
  try {
@@ -13,51 +13,51 @@ const H = (m, {
13
13
  return o(
14
14
  I(O())
15
15
  );
16
- const s = performance.now(), { filesystem: i } = await M(m, {
16
+ const f = performance.now(), { filesystem: s } = await M(m, {
17
17
  plugins: [
18
18
  C({
19
- fetch: (c) => fetch(e ? R(e, c) : c)
19
+ fetch: (n) => fetch(t ? R(t, n) : n)
20
20
  })
21
21
  ]
22
- }), { schema: r, errors: t } = await q(i), n = performance.now();
23
- return console.log(`dereference: ${Math.round(n - s)} ms`), t != null && t.length && console.warn(
22
+ }), { schema: a, errors: r } = await q(s), e = performance.now();
23
+ return console.log(`dereference: ${Math.round(e - f)} ms`), r != null && r.length && console.warn(
24
24
  `Please open an issue on https://github.com/scalar/scalar
25
25
  `,
26
26
  `Scalar OpenAPI Parser Warning:
27
27
  `,
28
- t
29
- ), r === void 0 ? (E(((h = t == null ? void 0 : t[0]) == null ? void 0 : h.message) ?? "Failed to parse the OpenAPI file."), o(
28
+ r
29
+ ), a === void 0 ? (E(((h = r == null ? void 0 : r[0]) == null ? void 0 : h.message) ?? "Failed to parse the OpenAPI file."), o(
30
30
  I(O())
31
- )) : o(I(r));
32
- } catch (s) {
31
+ )) : o(I(a));
32
+ } catch (f) {
33
33
  console.error(
34
34
  "[@scalar/api-reference]",
35
35
  "Failed to parse the OpenAPI document. It might be invalid?"
36
- ), console.error(s), E(s);
36
+ ), console.error(f), E(f);
37
37
  }
38
38
  return o(
39
39
  I(O())
40
40
  );
41
41
  }), I = (m) => {
42
- var h;
43
- let e = {};
44
- m && typeof m == "object" ? e = structuredClone(m) : e = O(), e.tags || (e.tags = []), e.paths || (e.paths = {});
42
+ var h, f;
43
+ let t = {};
44
+ m && typeof m == "object" ? t = structuredClone(m) : t = O(), t.tags || (t.tags = []), t.paths || (t.paths = {});
45
45
  const o = {};
46
- return Object.keys(e.webhooks ?? {}).forEach((s) => {
47
- var i;
48
- Object.keys(((i = e.webhooks) == null ? void 0 : i[s]) ?? {}).forEach((r) => {
49
- var n, c, l, g;
50
- const t = (n = e.webhooks) == null ? void 0 : n[s][r];
51
- if (!(!t || u(t))) {
52
- if (Array.isArray(t.tags)) {
53
- const a = (c = t.tags) == null ? void 0 : c.map((f) => {
54
- var y;
55
- return (y = e.tags) == null ? void 0 : y.find((w) => w.name === f);
46
+ return Object.keys(t.webhooks ?? {}).forEach((s) => {
47
+ var a;
48
+ Object.keys(((a = t.webhooks) == null ? void 0 : a[s]) ?? {}).forEach((r) => {
49
+ var n, l, g, y;
50
+ const e = (n = t.webhooks) == null ? void 0 : n[s][r];
51
+ if (!(!e || u(e))) {
52
+ if (Array.isArray(e.tags)) {
53
+ const i = (l = e.tags) == null ? void 0 : l.map((c) => {
54
+ var w;
55
+ return (w = t.tags) == null ? void 0 : w.find((p) => p.name === c);
56
56
  });
57
- if (t.tags = a == null ? void 0 : a.filter(
58
- (f) => !u(f)
59
- ), a != null && a.some(
60
- (f) => u(f)
57
+ if (e.tags = i == null ? void 0 : i.filter(
58
+ (c) => !u(c)
59
+ ), i != null && i.some(
60
+ (c) => u(c)
61
61
  ))
62
62
  return;
63
63
  }
@@ -65,70 +65,69 @@ const H = (m, {
65
65
  // Transformed data
66
66
  httpVerb: k(r),
67
67
  path: s,
68
- operationId: (t == null ? void 0 : t.operationId) || s,
69
- name: (t == null ? void 0 : t.summary) || s || "",
70
- description: (t == null ? void 0 : t.description) || "",
71
- pathParameters: (g = (l = e.paths) == null ? void 0 : l[s]) == null ? void 0 : g.parameters,
68
+ operationId: (e == null ? void 0 : e.operationId) || s,
69
+ name: (e == null ? void 0 : e.summary) || s || "",
70
+ description: (e == null ? void 0 : e.description) || "",
71
+ pathParameters: (y = (g = t.paths) == null ? void 0 : g[s]) == null ? void 0 : y.parameters,
72
72
  // Original webhook
73
73
  information: {
74
- ...t
74
+ ...e
75
75
  }
76
76
  };
77
77
  }
78
78
  });
79
- }), Object.keys(((h = e.components) == null ? void 0 : h.schemas) ?? {}).forEach((s) => {
80
- var i, r, t, n;
81
- u((r = (i = e.components) == null ? void 0 : i.schemas) == null ? void 0 : r[s]) && ((n = (t = e.components) == null ? void 0 : t.schemas) == null || delete n[s]);
82
- }), Object.keys(e.paths).forEach((s) => {
83
- Object.keys(e.paths[s]).filter(
79
+ }), Object.keys(((h = t.components) == null ? void 0 : h.schemas) ?? {}).forEach((s) => {
80
+ var a, r, e, n;
81
+ u((r = (a = t.components) == null ? void 0 : a.schemas) == null ? void 0 : r[s]) && ((n = (e = t.components) == null ? void 0 : e.schemas) == null || delete n[s]);
82
+ }), Object.keys(t.paths).forEach((s) => {
83
+ Object.keys(t.paths[s]).filter(
84
84
  (r) => F.includes(r.toUpperCase())
85
85
  ).forEach((r) => {
86
- var c, l, g, a, f, y, w;
87
- const t = e.paths[s][r];
88
- if (t === void 0 || u(t))
86
+ var l, g, y, i, c, w;
87
+ const e = t.paths[s][r];
88
+ if (e === void 0 || u(e))
89
89
  return;
90
90
  const n = {
91
91
  httpVerb: k(r),
92
92
  path: s,
93
- operationId: t.operationId || s,
94
- name: t.summary || s || "",
95
- description: t.description || "",
93
+ operationId: e.operationId || s,
94
+ name: e.summary || s || "",
95
+ description: e.description || "",
96
96
  information: {
97
- ...t
97
+ ...e
98
98
  },
99
- pathParameters: (l = (c = e.paths) == null ? void 0 : c[s]) == null ? void 0 : l.parameters
99
+ pathParameters: (g = (l = t.paths) == null ? void 0 : l[s]) == null ? void 0 : g.parameters
100
100
  };
101
- if (!t.tags || t.tags.length === 0) {
102
- (g = e.tags) != null && g.find(
101
+ if (!e.tags || e.tags.length === 0) {
102
+ (y = t.tags) != null && y.find(
103
103
  (d) => d.name === "default"
104
- ) || (a = e.tags) == null || a.push({
104
+ ) || (i = t.tags) == null || i.push({
105
105
  name: "default",
106
106
  description: "",
107
107
  operations: []
108
108
  });
109
- const p = (f = e.tags) == null ? void 0 : f.findIndex(
109
+ const p = (c = t.tags) == null ? void 0 : c.findIndex(
110
110
  (d) => d.name === "default"
111
111
  );
112
- p >= 0 && ((y = e.tags[p]) == null || y.operations.push(n));
112
+ p >= 0 && ((w = t.tags[p]) == null || w.operations.push(n));
113
113
  } else
114
- t.tags.forEach((p) => {
114
+ e.tags.forEach((p) => {
115
115
  var b, x, j;
116
- const d = (b = e.tags) == null ? void 0 : b.findIndex(
116
+ const d = (b = t.tags) == null ? void 0 : b.findIndex(
117
117
  (A) => A.name === p
118
118
  );
119
- d === -1 && ((x = e.tags) == null || x.push({
119
+ d === -1 && ((x = t.tags) == null || x.push({
120
120
  name: p,
121
121
  description: ""
122
122
  }));
123
- const P = d !== -1 ? d : e.tags.length - 1;
124
- typeof ((j = e.tags[P]) == null ? void 0 : j.operations) > "u" && (e.tags[P].operations = []), e.tags[P].operations.push(n);
123
+ const P = d !== -1 ? d : t.tags.length - 1;
124
+ typeof ((j = t.tags[P]) == null ? void 0 : j.operations) > "u" && (t.tags[P].operations = []), t.tags[P].operations.push(n);
125
125
  });
126
- e.tags = (w = e.tags) == null ? void 0 : w.filter(
127
- (p) => !u(p)
128
- );
129
126
  });
130
- }), {
131
- ...e,
127
+ }), t.tags = (f = t.tags) == null ? void 0 : f.filter(
128
+ (s) => !u(s)
129
+ ), {
130
+ ...t,
132
131
  webhooks: o
133
132
  };
134
133
  };
@@ -0,0 +1,6 @@
1
+ import type { ReferenceConfiguration } from '../types';
2
+ import { type InjectionKey } from 'vue';
3
+ export declare const CONFIGURATION_SYMBOL: InjectionKey<ReferenceConfiguration>;
4
+ /** Hook for easy access to the reference configuration */
5
+ export declare const useConfig: () => ReferenceConfiguration | undefined;
6
+ //# sourceMappingURL=useConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useConfig.d.ts","sourceRoot":"","sources":["../../src/hooks/useConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AACrD,OAAO,EAAE,KAAK,YAAY,EAAU,MAAM,KAAK,CAAA;AAE/C,eAAO,MAAM,oBAAoB,EACnB,YAAY,CAAC,sBAAsB,CAAC,CAAA;AAElD,0DAA0D;AAC1D,eAAO,MAAM,SAAS,0CAGrB,CAAA"}
@@ -0,0 +1,6 @@
1
+ import { inject as o } from "vue";
2
+ const n = Symbol(), i = () => o(n, void 0);
3
+ export {
4
+ n as CONFIGURATION_SYMBOL,
5
+ i as useConfig
6
+ };
@@ -31,13 +31,18 @@ export declare const useNavState: () => {
31
31
  replaceUrlState: (replacementHash: string, url?: string) => void;
32
32
  /** Gets the portion of the hash used by the references */
33
33
  getReferenceHash: () => string;
34
- getWebhookId: (name?: string, httpVerb?: string) => string;
35
- getModelId: (name?: string) => string;
34
+ getWebhookId: (webhook?: {
35
+ name: string;
36
+ method?: string;
37
+ }) => string;
38
+ getModelId: (model?: {
39
+ name: string;
40
+ }) => string;
36
41
  getHeadingId: (heading: Heading) => string;
37
42
  getOperationId: (operation: TransformedOperation, parentTag: Tag) => string;
38
43
  getPathRoutingId: (pathName: string) => string;
39
44
  getSectionId: (hashStr?: string) => string;
40
- getTagId: ({ name }: Tag) => string;
45
+ getTagId: (tag: Tag) => string;
41
46
  isIntersectionEnabled: import("vue").Ref<boolean, boolean>;
42
47
  pathRouting: import("vue").Ref<PathRouting | undefined, PathRouting | undefined>;
43
48
  updateHash: () => void;
@@ -1 +1 @@
1
- {"version":3,"file":"useNavState.d.ts","sourceRoot":"","sources":["../../src/hooks/useNavState.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAI9E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAwH3C;;;;;;GAMG;AACH,eAAO,MAAM,WAAW;;IAEtB,mCAAmC;4BACX,MAAM;IAG9B;;;;OAIG;+BAhC4B,MAAM;IAkCrC;;;;;OAKG;oCAjDc,MAAM;IAmDvB;;;OAGG;uCA3Ec,MAAM;IA6EvB,0DAA0D;;0BAxH/B,MAAM,aAAa,MAAM;wBAQ3B,MAAM;4BAvBF,OAAO;gCA+BH,oBAAoB,aAAa,GAAG;iCAvBnC,MAAM;;yBA0Bd,GAAG;;;;CAiH7B,CAAA"}
1
+ {"version":3,"file":"useNavState.d.ts","sourceRoot":"","sources":["../../src/hooks/useNavState.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAI9E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAqF3C;;;;;;GAMG;AACH,eAAO,MAAM,WAAW;;IAsDpB,mCAAmC;4BACX,MAAM;IAG9B;;;;OAIG;+BAnF0B,MAAM;IAqFnC;;;;;OAKG;oCApGY,MAAM;IAsGrB;;;OAGG;uCA9HY,MAAM;IAgIrB,0DAA0D;;6BAjC5B;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE;yBA5BrC;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE;4BATb,OAAO;gCAyBH,oBAAoB,aAAa,GAAG;iCA9GrC,MAAM;;oBAuGjB,GAAG;;;;CAiE3B,CAAA"}
@@ -1,68 +1,80 @@
1
- import { ssrState as d } from "@scalar/oas-utils/helpers";
1
+ import { useConfig as p } from "./useConfig.js";
2
+ import { ssrState as m } from "@scalar/oas-utils/helpers";
2
3
  import { slug as c } from "github-slugger";
3
4
  import { ref as l } from "vue";
4
- import { joinWithSlash as g } from "../helpers/joinWithSlash.js";
5
- const a = l(""), r = l(d.hash ?? ""), n = l(), w = l(!1), p = (e) => e.slug ? `description/${e.slug}` : "", h = (e) => {
6
- var o;
7
- if (!n.value) return "";
8
- const t = new RegExp("^" + ((o = n.value) == null ? void 0 : o.basePath) + "/?");
9
- return decodeURIComponent(e.replace(t, ""));
10
- }, f = (e, t) => e ? `webhook/${t}/${c(e)}` : "webhooks", v = (e) => e ? `model/${c(e)}` : "models", m = (e, t) => `${u(t)}/${e.httpVerb}${e.path}`, u = ({ name: e }) => `tag/${c(e)}`, I = (e = r.value) => {
5
+ import { joinWithSlash as f } from "../helpers/joinWithSlash.js";
6
+ const s = l(""), u = l(m.hash ?? ""), a = l(), w = l(!1), d = (e) => {
7
+ var n;
8
+ if (!a.value) return "";
9
+ const r = new RegExp("^" + ((n = a.value) == null ? void 0 : n.basePath) + "/?");
10
+ return decodeURIComponent(e.replace(r, ""));
11
+ }, I = (e = u.value) => {
11
12
  var i;
12
- const t = (i = e.match(/(tag\/[^/]+)/)) == null ? void 0 : i[0], o = e.startsWith("model") ? "models" : "", s = e.startsWith("webhook") ? "webhooks" : "";
13
- return t || o || s;
14
- }, b = () => {
15
- r.value = n.value ? h(window.location.pathname) : (
13
+ const r = (i = e.match(/(tag\/[^/]+)/)) == null ? void 0 : i[0], n = e.startsWith("model") ? "models" : "", o = e.startsWith("webhook") ? "webhooks" : "";
14
+ return r || n || o;
15
+ }, v = () => {
16
+ u.value = a.value ? d(window.location.pathname) : (
16
17
  // Must remove the prefix from the hash as the internal hash value should be pure
17
18
  decodeURIComponent(window.location.hash.replace(/^#/, "")).slice(
18
- a.value.length
19
+ s.value.length
19
20
  )
20
21
  );
21
- }, $ = (e, t = window.location.href) => {
22
- const o = new URL(t);
23
- n.value ? o.pathname = g(n.value.basePath, e) : o.hash = a.value + e, r.value = e, window.history.replaceState({}, "", o);
24
- }, R = (e, t = window.location.href, o = window.location.search) => {
25
- const s = new URL(t);
26
- return s.hash = a.value + e, s.search = o, s.toString();
27
- }, U = (e = r.value) => `${a.value}${e}`, k = () => decodeURIComponent(
28
- window.location.hash.replace(/^#/, "").slice(a.value.length)
29
- ), W = () => ({
30
- hash: r,
31
- /** Sets the prefix for the hash */
32
- setHashPrefix: (e) => {
33
- a.value = e;
34
- },
35
- /**
36
- * Gets the full hash with the prefix
37
- * @param hashTarget The hash to target with the return
38
- * @returns The full hash
39
- */
40
- getFullHash: U,
41
- /**
42
- * Gets the hashed url with the prefix
43
- * @param replacementHash The hash to replace the current hash with
44
- * @param url The url to get the hashed url from
45
- * @returns The hashed url
46
- */
47
- getHashedUrl: R,
48
- /**
49
- * Replaces the URL state with the new url and hash
50
- * Replacement is used so that hash changes don't trigger the url hash watcher and cause a scroll
51
- */
52
- replaceUrlState: $,
53
- /** Gets the portion of the hash used by the references */
54
- getReferenceHash: k,
55
- getWebhookId: f,
56
- getModelId: v,
57
- getHeadingId: p,
58
- getOperationId: m,
59
- getPathRoutingId: h,
60
- getSectionId: I,
61
- getTagId: u,
62
- isIntersectionEnabled: w,
63
- pathRouting: n,
64
- updateHash: b
65
- });
22
+ }, $ = (e, r = window.location.href) => {
23
+ const n = new URL(r);
24
+ a.value ? n.pathname = f(a.value.basePath, e) : n.hash = s.value + e, u.value = e, window.history.replaceState({}, "", n);
25
+ }, S = (e, r = window.location.href, n = window.location.search) => {
26
+ const o = new URL(r);
27
+ return o.hash = s.value + e, o.search = n, o.toString();
28
+ }, y = (e = u.value) => `${s.value}${e}`, R = () => decodeURIComponent(
29
+ window.location.hash.replace(/^#/, "").slice(s.value.length)
30
+ ), C = () => {
31
+ const e = p(), r = (t) => typeof (e == null ? void 0 : e.generateHeadingSlug) == "function" ? `${e.generateHeadingSlug(t)}` : t.slug ? `description/${t.slug}` : "", n = (t) => t != null && t.name ? typeof (e == null ? void 0 : e.generateModelSlug) == "function" ? `model/${e.generateModelSlug(t)}` : `model/${c(t.name)}` : "models", o = (t) => typeof (e == null ? void 0 : e.generateTagSlug) == "function" ? `tag/${e.generateTagSlug(t)}` : `tag/${c(t.name)}`;
32
+ return {
33
+ hash: u,
34
+ /** Sets the prefix for the hash */
35
+ setHashPrefix: (t) => {
36
+ s.value = t;
37
+ },
38
+ /**
39
+ * Gets the full hash with the prefix
40
+ * @param hashTarget The hash to target with the return
41
+ * @returns The full hash
42
+ */
43
+ getFullHash: y,
44
+ /**
45
+ * Gets the hashed url with the prefix
46
+ * @param replacementHash The hash to replace the current hash with
47
+ * @param url The url to get the hashed url from
48
+ * @returns The hashed url
49
+ */
50
+ getHashedUrl: S,
51
+ /**
52
+ * Replaces the URL state with the new url and hash
53
+ * Replacement is used so that hash changes don't trigger the url hash watcher and cause a scroll
54
+ */
55
+ replaceUrlState: $,
56
+ /** Gets the portion of the hash used by the references */
57
+ getReferenceHash: R,
58
+ getWebhookId: (t) => t != null && t.name ? typeof (e == null ? void 0 : e.generateWebhookSlug) == "function" ? `webhook/${e.generateWebhookSlug(t)}` : `webhook/${t.method}/${c(t.name)}` : "webhooks",
59
+ getModelId: n,
60
+ getHeadingId: r,
61
+ getOperationId: (t, g) => {
62
+ var h;
63
+ return typeof (e == null ? void 0 : e.generateOperationSlug) == "function" ? `${o(g)}/${e.generateOperationSlug({
64
+ path: t.path,
65
+ operationId: t.operationId,
66
+ method: t.httpVerb,
67
+ summary: (h = t.information) == null ? void 0 : h.summary
68
+ })}` : `${o(g)}/${t.httpVerb}${t.path}`;
69
+ },
70
+ getPathRoutingId: d,
71
+ getSectionId: I,
72
+ getTagId: o,
73
+ isIntersectionEnabled: w,
74
+ pathRouting: a,
75
+ updateHash: v
76
+ };
77
+ };
66
78
  export {
67
- W as useNavState
79
+ C as useNavState
68
80
  };
@@ -1 +1 @@
1
- {"version":3,"file":"useSidebar.d.ts","sourceRoot":"","sources":["../../src/hooks/useSidebar.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAc3E,MAAM,MAAM,YAAY,GAAG;IACzB,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAA;IACzB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,OAAO,CAAA;IACb,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAA;AAkBD,uDAAuD;AACvD,iBAAS,aAAa,CAAC,IAAI,EAAE,IAAI,QA6ChC;AAMD,KAAK,qBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAMpD,iBAAS,0BAA0B,CAAC,GAAG,EAAE,M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