@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.
- package/CHANGELOG.md +38 -0
- package/dist/browser/standalone.js +13884 -13880
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/ApiReference.vue.d.ts +2 -2
- package/dist/components/ApiReference.vue.d.ts.map +1 -1
- package/dist/components/ApiReference.vue.js +26 -15
- package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
- package/dist/components/ApiReferenceLayout.vue.js +2 -2
- package/dist/components/ApiReferenceLayout.vue2.js +128 -129
- package/dist/components/Sidebar/Sidebar.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/Sidebar.vue.js +1 -1
- package/dist/components/Sidebar/Sidebar.vue2.js +89 -76
- package/dist/components/Sidebar/SidebarElement.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarElement.vue.js +2 -2
- package/dist/components/Sidebar/SidebarElement.vue2.js +38 -38
- package/dist/features/ExampleRequest/ExampleRequest.vue.d.ts +46 -1
- package/dist/features/ExampleRequest/ExampleRequest.vue.d.ts.map +1 -1
- package/dist/features/ExampleRequest/ExampleRequest.vue.js +2 -2
- package/dist/features/ExampleRequest/ExampleRequest.vue2.js +83 -74
- package/dist/features/Search/useSearchIndex.d.ts.map +1 -1
- package/dist/features/Search/useSearchIndex.js +9 -9
- package/dist/helpers/freeze-element.d.ts +11 -0
- package/dist/helpers/freeze-element.d.ts.map +1 -0
- package/dist/helpers/freeze-element.js +20 -0
- package/dist/hooks/index.d.ts +0 -2
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/useMultipleDocuments.d.ts +9 -4
- package/dist/hooks/useMultipleDocuments.d.ts.map +1 -1
- package/dist/hooks/useMultipleDocuments.js +63 -39
- package/dist/hooks/useNavState.d.ts +13 -4
- package/dist/hooks/useNavState.d.ts.map +1 -1
- package/dist/hooks/useNavState.js +52 -48
- package/dist/index.js +1 -1
- package/dist/standalone/lib/html-api.d.ts +5 -5
- package/dist/standalone/lib/html-api.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types.d.ts +3 -12
- package/dist/types.d.ts.map +1 -1
- package/package.json +12 -11
- package/dist/hooks/useClientStore.d.ts +0 -2
- package/dist/hooks/useClientStore.d.ts.map +0 -1
- package/dist/hooks/useRefOnMount.d.ts +0 -6
- 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,
|
|
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
|
|
2
|
-
import {
|
|
3
|
-
import { slug as
|
|
4
|
-
import { ref as
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
},
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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:
|
|
33
|
+
hash: r,
|
|
30
34
|
/** Sets the prefix for the hash */
|
|
31
35
|
setHashPrefix: (e) => {
|
|
32
|
-
|
|
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:
|
|
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:
|
|
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:
|
|
54
|
-
getWebhookId: (e) => e != null && e.name ? typeof t.value.generateWebhookSlug == "function" ? `webhook/${t.value.generateWebhookSlug(e)}` : `webhook/${e.method}/${
|
|
55
|
-
getModelId:
|
|
56
|
-
getHeadingId:
|
|
57
|
-
getOperationId: (e,
|
|
58
|
-
var
|
|
59
|
-
return typeof t.value.generateOperationSlug == "function" ? `${
|
|
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: (
|
|
64
|
-
})}` : `${
|
|
67
|
+
summary: (n = e.information) == null ? void 0 : n.summary
|
|
68
|
+
})}` : `${s(a)}/${e.httpVerb}${e.path}`;
|
|
65
69
|
},
|
|
66
|
-
getPathRoutingId:
|
|
67
|
-
getSectionId:
|
|
68
|
-
getTagId:
|
|
69
|
-
isIntersectionEnabled:
|
|
70
|
-
|
|
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
|
-
|
|
78
|
+
y as NAV_STATE_SYMBOL,
|
|
79
|
+
C as useNavState
|
|
76
80
|
};
|