@scalar/api-reference 1.28.6 → 1.28.8

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 (43) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/dist/browser/standalone.js +13884 -13880
  3. package/dist/browser/webpack-stats.json +1 -1
  4. package/dist/components/ApiReference.vue.d.ts +2 -2
  5. package/dist/components/ApiReference.vue.d.ts.map +1 -1
  6. package/dist/components/ApiReference.vue.js +26 -15
  7. package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
  8. package/dist/components/ApiReferenceLayout.vue.js +2 -2
  9. package/dist/components/ApiReferenceLayout.vue2.js +128 -129
  10. package/dist/components/Sidebar/Sidebar.vue.d.ts.map +1 -1
  11. package/dist/components/Sidebar/Sidebar.vue.js +1 -1
  12. package/dist/components/Sidebar/Sidebar.vue2.js +89 -76
  13. package/dist/components/Sidebar/SidebarElement.vue.d.ts.map +1 -1
  14. package/dist/components/Sidebar/SidebarElement.vue.js +2 -2
  15. package/dist/components/Sidebar/SidebarElement.vue2.js +38 -38
  16. package/dist/features/ExampleRequest/ExampleRequest.vue.d.ts +46 -1
  17. package/dist/features/ExampleRequest/ExampleRequest.vue.d.ts.map +1 -1
  18. package/dist/features/ExampleRequest/ExampleRequest.vue.js +2 -2
  19. package/dist/features/ExampleRequest/ExampleRequest.vue2.js +83 -74
  20. package/dist/features/Search/useSearchIndex.d.ts.map +1 -1
  21. package/dist/features/Search/useSearchIndex.js +9 -9
  22. package/dist/helpers/freeze-element.d.ts +11 -0
  23. package/dist/helpers/freeze-element.d.ts.map +1 -0
  24. package/dist/helpers/freeze-element.js +20 -0
  25. package/dist/hooks/index.d.ts +0 -2
  26. package/dist/hooks/index.d.ts.map +1 -1
  27. package/dist/hooks/useMultipleDocuments.d.ts +9 -4
  28. package/dist/hooks/useMultipleDocuments.d.ts.map +1 -1
  29. package/dist/hooks/useMultipleDocuments.js +63 -39
  30. package/dist/hooks/useNavState.d.ts +13 -4
  31. package/dist/hooks/useNavState.d.ts.map +1 -1
  32. package/dist/hooks/useNavState.js +52 -48
  33. package/dist/index.js +1 -1
  34. package/dist/standalone/lib/html-api.d.ts +5 -5
  35. package/dist/standalone/lib/html-api.d.ts.map +1 -1
  36. package/dist/style.css +1 -1
  37. package/dist/types.d.ts +3 -12
  38. package/dist/types.d.ts.map +1 -1
  39. package/package.json +12 -11
  40. package/dist/hooks/useClientStore.d.ts +0 -2
  41. package/dist/hooks/useClientStore.d.ts.map +0 -1
  42. package/dist/hooks/useRefOnMount.d.ts +0 -6
  43. package/dist/hooks/useRefOnMount.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"useNavState.d.ts","sourceRoot":"","sources":["../../src/hooks/useNavState.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,GAAG,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AA6E3F;;;;;;GAMG;AACH,eAAO,MAAM,WAAW;;IA4DpB,mCAAmC;4BACX,MAAM;IAG9B;;;;OAIG;+BAtF0B,MAAM;IAwFnC;;;;;OAKG;oCApGgC,MAAM;IAsGzC;;;OAGG;uCA3HmC,MAAM;IA6H5C,0DAA0D;;6BAnC5B;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE;yBA9BrC;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE;4BAXb,OAAO;gCA6BH,oBAAoB,aAAa,GAAG;iCAxGrC,MAAM;;oBAiGjB,GAAG;;;;CAmE3B,CAAA"}
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;AAE9E,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,CAAA;IACjB,2CAA2C;IAC3C,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IACvB,sFAAsF;IACtF,qBAAqB,EAAE,GAAG,CAAC,OAAO,CAAC,CAAA;CACpC,CAAA;AACD,eAAO,MAAM,gBAAgB,EAAe,YAAY,CAAC,QAAQ,CAAC,CAAA;AAOlE;;;;;;GAMG;AACH,eAAO,MAAM,WAAW;;IAiIpB,mCAAmC;4BACX,MAAM;IAG9B;;;;OAIG;+BA7E4B,MAAM;IA+ErC;;;;;OAKG;oCA3FkC,MAAM;IA6F3C;;;OAGG;uCAlHqC,MAAM;IAoH9C,0DAA0D;;6BAnC5B;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE;yBA9BrC;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE;4BAXb,OAAO;gCA6BH,oBAAoB,aAAa,GAAG;iCA/FnC,MAAM;;oBAwFnB,GAAG;;;CAkE3B,CAAA"}
@@ -1,76 +1,80 @@
1
- import { useConfig as f } from "./useConfig.js";
2
- import { ssrState as p, combineUrlAndPath as v } from "@scalar/oas-utils/helpers";
3
- import { slug as c } from "github-slugger";
4
- import { ref as s } from "vue";
5
- const u = s(""), l = s(p.hash ?? ""), r = s(), m = s(!1), h = (t) => {
6
- var n;
7
- if (!r.value)
8
- return "";
9
- const a = new RegExp("^" + ((n = r.value) == null ? void 0 : n.basePath) + "/?");
10
- return decodeURIComponent(t.replace(a, ""));
11
- }, w = (t = l.value) => {
12
- var i;
13
- const a = (i = t.match(/(tag\/[^/]+)/)) == null ? void 0 : i[0], n = t.startsWith("model") ? "models" : "", o = t.startsWith("webhook") ? "webhooks" : "";
14
- return a || n || o;
15
- }, I = () => {
16
- l.value = r.value ? h(window.location.pathname) : (
17
- // Must remove the prefix from the hash as the internal hash value should be pure
18
- decodeURIComponent(window.location.hash.replace(/^#/, "")).slice(u.value.length)
19
- );
20
- }, $ = (t, a = window.location.href) => {
21
- const n = new URL(a);
22
- r.value ? n.pathname = v(r.value.basePath, t) : n.hash = u.value + t, l.value = t, window.history.replaceState({}, "", n);
23
- }, S = (t, a = window.location.href, n = window.location.search) => {
24
- const o = new URL(a);
25
- return o.hash = u.value + t, o.search = n, o.toString();
26
- }, U = (t = l.value) => `${u.value}${t}`, b = () => decodeURIComponent(window.location.hash.replace(/^#/, "").slice(u.value.length)), x = () => {
27
- const t = f(), a = (e) => typeof t.value.generateHeadingSlug == "function" ? `${t.value.generateHeadingSlug(e)}` : e.slug ? `description/${e.slug}` : "", n = (e) => e != null && e.name ? typeof t.value.generateModelSlug == "function" ? `model/${t.value.generateModelSlug(e)}` : `model/${c(e.name)}` : "models", o = (e) => typeof t.value.generateTagSlug == "function" ? `tag/${t.value.generateTagSlug(e)}` : `tag/${c(e.name)}`;
1
+ import { useConfig as $ } from "./useConfig.js";
2
+ import { combineUrlAndPath as R } from "@scalar/oas-utils/helpers";
3
+ import { slug as l } from "github-slugger";
4
+ import { ref as i, inject as b } from "vue";
5
+ const y = Symbol(), U = i(!1), P = i(""), k = i(""), C = () => {
6
+ const { isIntersectionEnabled: h, hash: r, hashPrefix: o } = b(y, {
7
+ isIntersectionEnabled: U,
8
+ hash: P,
9
+ hashPrefix: k
10
+ }), t = $(), c = (e) => {
11
+ var n;
12
+ if (!t.value.pathRouting)
13
+ return "";
14
+ const a = new RegExp("^" + ((n = t.value.pathRouting) == null ? void 0 : n.basePath) + "/?");
15
+ return decodeURIComponent(e.replace(a, ""));
16
+ }, d = (e = r.value) => {
17
+ var g;
18
+ const a = (g = e.match(/(tag\/[^/]+)/)) == null ? void 0 : g[0], n = e.startsWith("model") ? "models" : "", u = e.startsWith("webhook") ? "webhooks" : "";
19
+ return a || n || u;
20
+ }, f = () => {
21
+ r.value = t.value.pathRouting ? c(window.location.pathname) : (
22
+ // Must remove the prefix from the hash as the internal hash value should be pure
23
+ decodeURIComponent(window.location.hash.replace(/^#/, "")).slice(o.value.length)
24
+ );
25
+ }, p = (e, a = window.location.href) => {
26
+ const n = new URL(a);
27
+ t.value.pathRouting ? n.pathname = R(t.value.pathRouting.basePath, e) : n.hash = o.value + e, r.value = e, window.history.replaceState({}, "", n);
28
+ }, m = (e, a = window.location.href, n = window.location.search) => {
29
+ const u = new URL(a);
30
+ return u.hash = o.value + e, u.search = n, u.toString();
31
+ }, v = (e = r.value) => `${o.value}${e}`, I = () => decodeURIComponent(window.location.hash.replace(/^#/, "").slice(o.value.length)), w = (e) => typeof t.value.generateHeadingSlug == "function" ? `${t.value.generateHeadingSlug(e)}` : e.slug ? `description/${e.slug}` : "", S = (e) => e != null && e.name ? typeof t.value.generateModelSlug == "function" ? `model/${t.value.generateModelSlug(e)}` : `model/${l(e.name)}` : "models", s = (e) => typeof t.value.generateTagSlug == "function" ? `tag/${t.value.generateTagSlug(e)}` : `tag/${l(e.name)}`;
28
32
  return {
29
- hash: l,
33
+ hash: r,
30
34
  /** Sets the prefix for the hash */
31
35
  setHashPrefix: (e) => {
32
- u.value = e;
36
+ o.value = e;
33
37
  },
34
38
  /**
35
39
  * Gets the full hash with the prefix
36
40
  * @param hashTarget The hash to target with the return
37
41
  * @returns The full hash
38
42
  */
39
- getFullHash: U,
43
+ getFullHash: v,
40
44
  /**
41
45
  * Gets the hashed url with the prefix
42
46
  * @param replacementHash The hash to replace the current hash with
43
47
  * @param url The url to get the hashed url from
44
48
  * @returns The hashed url
45
49
  */
46
- getHashedUrl: S,
50
+ getHashedUrl: m,
47
51
  /**
48
52
  * Replaces the URL state with the new url and hash
49
53
  * Replacement is used so that hash changes don't trigger the url hash watcher and cause a scroll
50
54
  */
51
- replaceUrlState: $,
55
+ replaceUrlState: p,
52
56
  /** Gets the portion of the hash used by the references */
53
- getReferenceHash: b,
54
- getWebhookId: (e) => e != null && e.name ? typeof t.value.generateWebhookSlug == "function" ? `webhook/${t.value.generateWebhookSlug(e)}` : `webhook/${e.method}/${c(e.name)}` : "webhooks",
55
- getModelId: n,
56
- getHeadingId: a,
57
- getOperationId: (e, g) => {
58
- var d;
59
- return typeof t.value.generateOperationSlug == "function" ? `${o(g)}/${t.value.generateOperationSlug({
57
+ getReferenceHash: I,
58
+ getWebhookId: (e) => e != null && e.name ? typeof t.value.generateWebhookSlug == "function" ? `webhook/${t.value.generateWebhookSlug(e)}` : `webhook/${e.method}/${l(e.name)}` : "webhooks",
59
+ getModelId: S,
60
+ getHeadingId: w,
61
+ getOperationId: (e, a) => {
62
+ var n;
63
+ return typeof t.value.generateOperationSlug == "function" ? `${s(a)}/${t.value.generateOperationSlug({
60
64
  path: e.path,
61
65
  operationId: e.operationId,
62
66
  method: e.httpVerb,
63
- summary: (d = e.information) == null ? void 0 : d.summary
64
- })}` : `${o(g)}/${e.httpVerb}${e.path}`;
67
+ summary: (n = e.information) == null ? void 0 : n.summary
68
+ })}` : `${s(a)}/${e.httpVerb}${e.path}`;
65
69
  },
66
- getPathRoutingId: h,
67
- getSectionId: w,
68
- getTagId: o,
69
- isIntersectionEnabled: m,
70
- pathRouting: r,
71
- updateHash: I
70
+ getPathRoutingId: c,
71
+ getSectionId: d,
72
+ getTagId: s,
73
+ isIntersectionEnabled: h,
74
+ updateHash: f
72
75
  };
73
76
  };
74
77
  export {
75
- x as useNavState
78
+ y as NAV_STATE_SYMBOL,
79
+ C as useNavState
76
80
  };