@scalar/api-reference 1.25.130 → 1.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/browser/standalone.js +12631 -12598
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/ApiReferenceLayout.vue.js +2 -2
- package/dist/components/ApiReferenceLayout.vue2.js +1 -1
- package/dist/components/Content/Introduction/Introduction.vue.js +1 -1
- package/dist/components/Content/Introduction/Introduction.vue2.js +45 -42
- package/dist/features/ApiClientModal/useApiClient.d.ts.map +1 -1
- package/dist/features/BaseUrl/BaseUrl.vue.js +31 -30
- package/dist/features/ExampleRequest/ExampleRequest.vue.d.ts.map +1 -1
- package/dist/features/ExampleRequest/ExampleRequest.vue.js +2 -2
- package/dist/features/TestRequestButton/TestRequestButton.vue.js +2 -2
- package/dist/features/TestRequestButton/TestRequestButton.vue2.js +16 -14
- package/dist/hooks/useConfig.d.ts +3 -3
- package/dist/hooks/useConfig.d.ts.map +1 -1
- package/dist/hooks/useConfig.js +7 -4
- package/dist/hooks/useNavState.js +38 -38
- package/dist/index.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +10 -10
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import { useConfig as
|
|
2
|
-
import { ssrState as
|
|
1
|
+
import { useConfig as f } from "./useConfig.js";
|
|
2
|
+
import { ssrState as p, combineUrlAndPath as v } from "@scalar/oas-utils/helpers";
|
|
3
3
|
import { slug as c } from "github-slugger";
|
|
4
|
-
import { ref as
|
|
5
|
-
const
|
|
4
|
+
import { ref as s } from "vue";
|
|
5
|
+
const u = s(""), l = s(p.hash ?? ""), r = s(), m = s(!1), h = (t) => {
|
|
6
6
|
var n;
|
|
7
|
-
if (!
|
|
8
|
-
const
|
|
9
|
-
return decodeURIComponent(
|
|
10
|
-
},
|
|
7
|
+
if (!r.value) return "";
|
|
8
|
+
const a = new RegExp("^" + ((n = r.value) == null ? void 0 : n.basePath) + "/?");
|
|
9
|
+
return decodeURIComponent(t.replace(a, ""));
|
|
10
|
+
}, w = (t = l.value) => {
|
|
11
11
|
var i;
|
|
12
|
-
const
|
|
13
|
-
return
|
|
14
|
-
},
|
|
15
|
-
|
|
12
|
+
const a = (i = t.match(/(tag\/[^/]+)/)) == null ? void 0 : i[0], n = t.startsWith("model") ? "models" : "", o = t.startsWith("webhook") ? "webhooks" : "";
|
|
13
|
+
return a || n || o;
|
|
14
|
+
}, I = () => {
|
|
15
|
+
l.value = r.value ? h(window.location.pathname) : (
|
|
16
16
|
// Must remove the prefix from the hash as the internal hash value should be pure
|
|
17
|
-
decodeURIComponent(window.location.hash.replace(/^#/, "")).slice(
|
|
17
|
+
decodeURIComponent(window.location.hash.replace(/^#/, "")).slice(u.value.length)
|
|
18
18
|
);
|
|
19
|
-
}, $ = (
|
|
20
|
-
const n = new URL(
|
|
21
|
-
|
|
22
|
-
}, S = (
|
|
23
|
-
const
|
|
24
|
-
return
|
|
25
|
-
}, U = (
|
|
26
|
-
const
|
|
19
|
+
}, $ = (t, a = window.location.href) => {
|
|
20
|
+
const n = new URL(a);
|
|
21
|
+
r.value ? n.pathname = v(r.value.basePath, t) : n.hash = u.value + t, l.value = t, window.history.replaceState({}, "", n);
|
|
22
|
+
}, S = (t, a = window.location.href, n = window.location.search) => {
|
|
23
|
+
const o = new URL(a);
|
|
24
|
+
return o.hash = u.value + t, o.search = n, o.toString();
|
|
25
|
+
}, U = (t = l.value) => `${u.value}${t}`, b = () => decodeURIComponent(window.location.hash.replace(/^#/, "").slice(u.value.length)), x = () => {
|
|
26
|
+
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)}`;
|
|
27
27
|
return {
|
|
28
|
-
hash:
|
|
28
|
+
hash: l,
|
|
29
29
|
/** Sets the prefix for the hash */
|
|
30
|
-
setHashPrefix: (
|
|
31
|
-
|
|
30
|
+
setHashPrefix: (e) => {
|
|
31
|
+
u.value = e;
|
|
32
32
|
},
|
|
33
33
|
/**
|
|
34
34
|
* Gets the full hash with the prefix
|
|
@@ -50,24 +50,24 @@ const s = l(""), u = l(m.hash ?? ""), o = l(), w = l(!1), h = (e) => {
|
|
|
50
50
|
replaceUrlState: $,
|
|
51
51
|
/** Gets the portion of the hash used by the references */
|
|
52
52
|
getReferenceHash: b,
|
|
53
|
-
getWebhookId: (
|
|
53
|
+
getWebhookId: (e) => e != null && e.name ? typeof t.value.generateWebhookSlug == "function" ? `webhook/${t.value.generateWebhookSlug(e)}` : `webhook/${e.method}/${c(e.name)}` : "webhooks",
|
|
54
54
|
getModelId: n,
|
|
55
|
-
getHeadingId:
|
|
56
|
-
getOperationId: (
|
|
55
|
+
getHeadingId: a,
|
|
56
|
+
getOperationId: (e, g) => {
|
|
57
57
|
var d;
|
|
58
|
-
return typeof
|
|
59
|
-
path:
|
|
60
|
-
operationId:
|
|
61
|
-
method:
|
|
62
|
-
summary: (d =
|
|
63
|
-
})}` : `${
|
|
58
|
+
return typeof t.value.generateOperationSlug == "function" ? `${o(g)}/${t.value.generateOperationSlug({
|
|
59
|
+
path: e.path,
|
|
60
|
+
operationId: e.operationId,
|
|
61
|
+
method: e.httpVerb,
|
|
62
|
+
summary: (d = e.information) == null ? void 0 : d.summary
|
|
63
|
+
})}` : `${o(g)}/${e.httpVerb}${e.path}`;
|
|
64
64
|
},
|
|
65
65
|
getPathRoutingId: h,
|
|
66
|
-
getSectionId:
|
|
67
|
-
getTagId:
|
|
68
|
-
isIntersectionEnabled:
|
|
69
|
-
pathRouting:
|
|
70
|
-
updateHash:
|
|
66
|
+
getSectionId: w,
|
|
67
|
+
getTagId: o,
|
|
68
|
+
isIntersectionEnabled: m,
|
|
69
|
+
pathRouting: r,
|
|
70
|
+
updateHash: I
|
|
71
71
|
};
|
|
72
72
|
};
|
|
73
73
|
export {
|