@scalar/api-reference 1.26.1 → 1.28.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.
- package/CHANGELOG.md +59 -0
- package/README.md +2 -6
- package/dist/browser/standalone.js +3306 -3283
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/Layouts/ModernLayout.vue.js +2 -2
- package/dist/components/Layouts/ModernLayout.vue2.js +9 -12
- package/dist/components/SingleApiReference.vue.d.ts.map +1 -1
- package/dist/components/SingleApiReference.vue.js +6 -6
- package/dist/esm.d.ts +5 -1
- package/dist/esm.d.ts.map +1 -1
- package/dist/esm.js +12 -9
- package/dist/features/DownloadLink/DownloadLink.vue.js +1 -1
- package/dist/features/DownloadLink/DownloadLink.vue2.js +16 -16
- package/dist/features/Operation/components/ContentTypeSelect.vue.d.ts +1 -1
- package/dist/features/Operation/components/ContentTypeSelect.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/ContentTypeSelect.vue.js +80 -5
- package/dist/features/Operation/components/ContentTypeSelect.vue2.js +2 -43
- package/dist/features/Operation/components/ParameterListItem.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/ParameterListItem.vue.js +2 -2
- package/dist/features/Operation/components/ParameterListItem.vue2.js +33 -33
- package/dist/features/Operation/components/RequestBody.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/RequestBody.vue.js +2 -2
- package/dist/features/Operation/components/RequestBody.vue2.js +15 -15
- package/dist/hooks/useMultipleDocuments.d.ts +9 -5
- package/dist/hooks/useMultipleDocuments.d.ts.map +1 -1
- package/dist/hooks/useMultipleDocuments.js +38 -38
- package/dist/index.d.ts +6 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +74 -72
- package/dist/standalone/lib/html-api.d.ts +30 -1
- package/dist/standalone/lib/html-api.d.ts.map +1 -1
- package/dist/standalone/lib/html-api.js +54 -0
- package/dist/standalone/lib/register-globals.d.ts +11 -0
- package/dist/standalone/lib/register-globals.d.ts.map +1 -0
- package/dist/style.css +1 -1
- package/package.json +8 -8
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
import { isDefined as
|
|
2
|
-
import { isConfigurationWithSources as
|
|
3
|
-
import
|
|
4
|
-
import { computed as m, ref as
|
|
5
|
-
const
|
|
6
|
-
if (!(!(
|
|
7
|
-
return f.reset(),
|
|
8
|
-
...
|
|
9
|
-
slug:
|
|
10
|
-
title:
|
|
11
|
-
} :
|
|
12
|
-
...
|
|
13
|
-
title:
|
|
1
|
+
import { isDefined as c } from "@scalar/oas-utils/helpers";
|
|
2
|
+
import { isConfigurationWithSources as i, apiReferenceConfigurationSchema as o } from "@scalar/types/api-reference";
|
|
3
|
+
import h from "github-slugger";
|
|
4
|
+
import { computed as m, ref as w, watch as S } from "vue";
|
|
5
|
+
const p = "api", f = new h(), I = (t, a = 0) => {
|
|
6
|
+
if (!(!(t != null && t.url) && !(t != null && t.content)))
|
|
7
|
+
return f.reset(), t.title ? {
|
|
8
|
+
...t,
|
|
9
|
+
slug: t.slug || f.slug(t.title),
|
|
10
|
+
title: t.title
|
|
11
|
+
} : t.slug ? {
|
|
12
|
+
...t,
|
|
13
|
+
title: t.slug
|
|
14
14
|
} : {
|
|
15
|
-
...
|
|
16
|
-
slug: `api-${
|
|
17
|
-
title: `API #${
|
|
15
|
+
...t,
|
|
16
|
+
slug: `api-${a + 1}`,
|
|
17
|
+
title: `API #${a + 1}`
|
|
18
18
|
};
|
|
19
|
-
}, U = ({ configuration:
|
|
20
|
-
const
|
|
21
|
-
var
|
|
22
|
-
return
|
|
23
|
-
}), v = (
|
|
24
|
-
if (
|
|
19
|
+
}, U = ({ configuration: t, initialIndex: a }) => {
|
|
20
|
+
const s = m(() => {
|
|
21
|
+
var e;
|
|
22
|
+
return t.value ? (i(t.value) ? ((e = t.value) == null ? void 0 : e.sources) ?? [] : [t.value].flat().map((l) => l)).map((l, r) => l && I(l, r)).filter(c) : [];
|
|
23
|
+
}), v = (n) => {
|
|
24
|
+
if (s.value.length === 1)
|
|
25
25
|
return;
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
},
|
|
29
|
-
const
|
|
30
|
-
if (
|
|
31
|
-
return
|
|
32
|
-
const
|
|
33
|
-
return !isNaN(
|
|
26
|
+
const e = new URL(window.location.href), l = s.value[n], r = (l == null ? void 0 : l.slug) ?? n.toString();
|
|
27
|
+
e.searchParams.set(p, r), e.hash = "", window.scrollTo({ top: 0, behavior: "instant" }), window.history.replaceState({}, "", e.toString());
|
|
28
|
+
}, u = w((() => {
|
|
29
|
+
const e = new URL(window.location.href).searchParams.get(p) || "0", l = s.value.findIndex((d) => d.slug === e);
|
|
30
|
+
if (l !== -1)
|
|
31
|
+
return l;
|
|
32
|
+
const r = Number.parseInt(e, 10);
|
|
33
|
+
return !isNaN(r) && r >= 0 && r < s.value.length ? r : typeof a == "number" ? a : 0;
|
|
34
34
|
})()), g = m(() => {
|
|
35
|
-
var
|
|
36
|
-
return
|
|
37
|
-
...
|
|
38
|
-
|
|
39
|
-
}) :
|
|
35
|
+
var n, e;
|
|
36
|
+
return t.value && i(t.value) ? o.parse({
|
|
37
|
+
...t.value,
|
|
38
|
+
...(e = (n = t.value) == null ? void 0 : n.sources) == null ? void 0 : e[u.value]
|
|
39
|
+
}) : o.parse([t.value].flat()[u.value] ?? {});
|
|
40
40
|
});
|
|
41
|
-
return
|
|
41
|
+
return S(u, v, { flush: "sync" }), {
|
|
42
42
|
selectedConfiguration: g,
|
|
43
|
-
availableDocuments:
|
|
44
|
-
selectedDocumentIndex:
|
|
43
|
+
availableDocuments: s,
|
|
44
|
+
selectedDocumentIndex: u
|
|
45
45
|
};
|
|
46
46
|
};
|
|
47
47
|
export {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
export { default as ApiReference } from './components/ApiReference.vue.js';
|
|
2
2
|
export { default as ApiReferenceLayout } from './components/ApiReferenceLayout.vue.js';
|
|
3
3
|
export { default as ModernLayout } from './components/Layouts/ModernLayout.vue.js';
|
|
4
|
-
export
|
|
4
|
+
export { SearchButton, SearchModal } from './features/Search';
|
|
5
5
|
export { default as GettingStarted } from './components/GettingStarted.vue.js';
|
|
6
|
-
export { createScalarReferences } from './esm.js';
|
|
7
6
|
export { useReactiveSpec } from './hooks/useReactiveSpec.js';
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
7
|
+
export { createApiReference } from './standalone/lib/html-api.js';
|
|
8
|
+
export { Sidebar } from './components/Sidebar';
|
|
9
|
+
export { Card, CardHeader, CardContent, CardFooter, CardTabHeader, CardTab } from './components/Card';
|
|
10
|
+
export { Layouts } from './components/Layouts';
|
|
11
11
|
export * from './stores';
|
|
12
12
|
export * from './helpers';
|
|
13
13
|
export * from './types';
|
|
14
14
|
export * from './hooks';
|
|
15
|
+
export { createScalarReferences } from './esm.js';
|
|
15
16
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -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,YAAY,EAAE,MAAM,uCAAuC,CAAA;AAC/E,
|
|
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,YAAY,EAAE,MAAM,uCAAuC,CAAA;AAC/E,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC7D,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAE3E,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAE9D,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAC9C,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AACrG,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAE9C,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA;AAGvB,OAAO,EAAE,sBAAsB,EAAE,MAAM,OAAO,CAAA"}
|