@scalar/api-reference 1.26.2 → 1.28.2
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 +71 -0
- package/README.md +2 -6
- package/dist/browser/standalone.js +11517 -11467
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/Content/ClientLibraries/ClientLibraries.vue.d.ts.map +1 -1
- package/dist/components/Content/ClientLibraries/ClientLibraries.vue.js +2 -2
- package/dist/components/Content/ClientLibraries/ClientLibraries.vue2.js +48 -40
- package/dist/components/Content/ClientLibraries/ClientSelector.vue.d.ts.map +1 -1
- package/dist/components/Content/ClientLibraries/ClientSelector.vue.js +2 -2
- package/dist/components/Content/ClientLibraries/ClientSelector.vue2.js +6 -7
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue2.js +77 -77
- package/dist/components/Content/Tag/OperationsListItem.vue.js +2 -2
- package/dist/components/Content/Tag/OperationsListItem.vue2.js +1 -1
- package/dist/components/Layouts/ModernLayout.vue.js +2 -2
- package/dist/components/Layouts/ModernLayout.vue2.js +9 -12
- package/dist/components/Section/CompactSection.vue.d.ts.map +1 -1
- package/dist/components/Section/CompactSection.vue.js +1 -1
- 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 +41 -40
- 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 +1 -1
- package/dist/features/Operation/components/ParameterListItem.vue2.js +37 -34
- 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/features/Operation/layouts/ModernLayout.vue.d.ts.map +1 -1
- package/dist/features/Operation/layouts/ModernLayout.vue.js +1 -1
- package/dist/features/Operation/layouts/ModernLayout.vue2.js +9 -8
- package/dist/helpers/scrollToId.d.ts +3 -1
- package/dist/helpers/scrollToId.d.ts.map +1 -1
- package/dist/helpers/scrollToId.js +4 -4
- 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/hooks/useSidebar.d.ts +2 -2
- package/dist/hooks/useSidebar.d.ts.map +1 -1
- package/dist/hooks/useSidebar.js +84 -84
- 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 +11 -10
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarSidebarGroupToggle as
|
|
3
|
-
import { combineUrlAndPath as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
1
|
+
import { defineComponent as A, openBlock as n, createElementBlock as l, createElementVNode as a, normalizeClass as T, unref as m, withModifiers as V, createVNode as b, withCtx as E, createTextVNode as c, toDisplayString as h, createCommentVNode as s, createBlock as N, renderSlot as v } from "vue";
|
|
2
|
+
import { ScalarSidebarGroupToggle as O, ScalarIcon as U } from "@scalar/components";
|
|
3
|
+
import { combineUrlAndPath as H } from "@scalar/oas-utils/helpers";
|
|
4
|
+
import { useConfig as I } from "../../hooks/useConfig.js";
|
|
5
|
+
import P from "./SidebarHttpBadge.vue.js";
|
|
6
|
+
import { sleep as C } from "../../helpers/sleep.js";
|
|
7
|
+
import { useNavState as D } from "../../hooks/useNavState.js";
|
|
8
|
+
import { scrollToId as L } from "../../helpers/scrollToId.js";
|
|
9
|
+
const M = ["id"], R = {
|
|
9
10
|
key: 0,
|
|
10
11
|
class: "sidebar-heading-chevron"
|
|
11
|
-
},
|
|
12
|
+
}, z = ["aria-expanded"], F = ["href", "tabindex"], G = { class: "sidebar-heading-link-title" }, j = {
|
|
12
13
|
key: 1,
|
|
13
14
|
class: "sidebar-heading-link-method"
|
|
14
|
-
},
|
|
15
|
+
}, q = {
|
|
15
16
|
key: 1,
|
|
16
17
|
class: "action-menu"
|
|
17
|
-
},
|
|
18
|
+
}, x = /* @__PURE__ */ A({
|
|
18
19
|
__name: "SidebarElement",
|
|
19
20
|
props: {
|
|
20
21
|
id: {},
|
|
@@ -24,81 +25,81 @@ const D = ["id"], L = {
|
|
|
24
25
|
open: { type: Boolean }
|
|
25
26
|
},
|
|
26
27
|
emits: ["toggleOpen"],
|
|
27
|
-
setup(
|
|
28
|
-
const i =
|
|
28
|
+
setup(k, { emit: y }) {
|
|
29
|
+
const i = k, d = y, { getFullHash: u, isIntersectionEnabled: r, pathRouting: p, replaceUrlState: w } = D(), S = I(), f = async () => {
|
|
29
30
|
var e, t;
|
|
30
|
-
i.hasChildren && d("toggleOpen"), (t = (e = i.item) == null ? void 0 : e.select) == null || t.call(e), i.open && (r.value = !1, await
|
|
31
|
-
},
|
|
31
|
+
i.hasChildren && d("toggleOpen"), (t = (e = i.item) == null ? void 0 : e.select) == null || t.call(e), i.open && (r.value = !1, await C(100), r.value = !0);
|
|
32
|
+
}, B = () => {
|
|
32
33
|
if (p.value)
|
|
33
|
-
return
|
|
34
|
+
return H(p.value.basePath, i.item.id);
|
|
34
35
|
if (typeof window < "u") {
|
|
35
36
|
const e = new URL(window.location.href);
|
|
36
|
-
return e.hash =
|
|
37
|
-
} else return `#${
|
|
38
|
-
},
|
|
37
|
+
return e.hash = u(i.item.id), `${e.pathname}${e.search}${e.hash}`;
|
|
38
|
+
} else return `#${u(i.item.id)}`;
|
|
39
|
+
}, $ = async (e) => {
|
|
39
40
|
var t, o;
|
|
40
|
-
p.value && (e.preventDefault(), i.hasChildren && d("toggleOpen"), (o = (t = i.item) == null ? void 0 : t.select) == null || o.call(t), d("toggleOpen"), r.value = !1, w(i.item.id),
|
|
41
|
+
p.value && (e.preventDefault(), i.hasChildren && d("toggleOpen"), (o = (t = i.item) == null ? void 0 : t.select) == null || o.call(t), d("toggleOpen"), r.value = !1, w(i.item.id), L(i.item.id), await C(100), r.value = !0);
|
|
41
42
|
};
|
|
42
43
|
return (e, t) => {
|
|
43
|
-
var o,
|
|
44
|
+
var o, g;
|
|
44
45
|
return n(), l("li", {
|
|
45
46
|
id: e.id,
|
|
46
47
|
class: "sidebar-group-item"
|
|
47
48
|
}, [
|
|
48
49
|
a("div", {
|
|
49
|
-
class:
|
|
50
|
+
class: T(["sidebar-heading", {
|
|
50
51
|
"sidebar-group-item__folder": e.hasChildren,
|
|
51
52
|
active_page: e.isActive,
|
|
52
53
|
deprecated: e.item.deprecated ?? !1
|
|
53
54
|
}]),
|
|
54
|
-
onClick:
|
|
55
|
+
onClick: f
|
|
55
56
|
}, [
|
|
56
|
-
e.hasChildren ? (n(), l("p",
|
|
57
|
+
e.hasChildren && !m(S).defaultOpenAllTags ? (n(), l("p", R, [
|
|
57
58
|
a("button", {
|
|
58
59
|
"aria-expanded": e.open,
|
|
59
60
|
class: "toggle-nested-icon",
|
|
60
61
|
type: "button",
|
|
61
|
-
onClick:
|
|
62
|
+
onClick: V(f, ["stop"])
|
|
62
63
|
}, [
|
|
63
|
-
|
|
64
|
+
b(m(O), { open: e.open }, {
|
|
64
65
|
label: E(() => [
|
|
65
|
-
|
|
66
|
+
c(h(e.open ? "Collapse" : "Expand") + " " + h(e.item.title), 1)
|
|
66
67
|
]),
|
|
67
68
|
_: 1
|
|
68
69
|
}, 8, ["open"])
|
|
69
|
-
], 8,
|
|
70
|
-
t[0] || (t[0] =
|
|
70
|
+
], 8, z),
|
|
71
|
+
t[0] || (t[0] = c(" "))
|
|
71
72
|
])) : s("", !0),
|
|
72
73
|
a("a", {
|
|
73
74
|
class: "sidebar-heading-link",
|
|
74
|
-
href:
|
|
75
|
+
href: B(),
|
|
75
76
|
tabindex: e.hasChildren ? -1 : 0,
|
|
76
|
-
onClick:
|
|
77
|
+
onClick: $
|
|
77
78
|
}, [
|
|
78
|
-
(
|
|
79
|
+
(g = (o = e.item) == null ? void 0 : o.icon) != null && g.src ? (n(), N(m(U), {
|
|
79
80
|
key: 0,
|
|
80
81
|
class: "sidebar-icon",
|
|
81
82
|
icon: e.item.icon.src
|
|
82
83
|
}, null, 8, ["icon"])) : s("", !0),
|
|
83
|
-
a("p",
|
|
84
|
-
e.item.httpVerb && !e.hasChildren ? (n(), l("p",
|
|
85
|
-
t[1] || (t[1] =
|
|
84
|
+
a("p", G, h(e.item.title), 1),
|
|
85
|
+
e.item.httpVerb && !e.hasChildren ? (n(), l("p", j, [
|
|
86
|
+
t[1] || (t[1] = c(" ")),
|
|
86
87
|
t[2] || (t[2] = a("span", { class: "sr-only" }, "HTTP Method: ", -1)),
|
|
87
|
-
|
|
88
|
+
b(P, {
|
|
88
89
|
active: e.isActive,
|
|
89
90
|
method: e.item.httpVerb
|
|
90
91
|
}, null, 8, ["active", "method"])
|
|
91
92
|
])) : s("", !0)
|
|
92
|
-
], 8,
|
|
93
|
+
], 8, F)
|
|
93
94
|
], 2),
|
|
94
95
|
e.open ? v(e.$slots, "default", { key: 0 }, void 0, !0) : s("", !0),
|
|
95
|
-
e.$slots["action-menu"] ? (n(), l("div",
|
|
96
|
+
e.$slots["action-menu"] ? (n(), l("div", q, [
|
|
96
97
|
v(e.$slots, "action-menu", {}, void 0, !0)
|
|
97
98
|
])) : s("", !0)
|
|
98
|
-
], 8,
|
|
99
|
+
], 8, M);
|
|
99
100
|
};
|
|
100
101
|
}
|
|
101
102
|
});
|
|
102
103
|
export {
|
|
103
|
-
|
|
104
|
+
x as default
|
|
104
105
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SingleApiReference.vue.d.ts","sourceRoot":"","sources":["../../src/components/SingleApiReference.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SingleApiReference.vue.d.ts","sourceRoot":"","sources":["../../src/components/SingleApiReference.vue"],"names":[],"mappings":"AA6EA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAA;AAW5E,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,yBAAyB,CAAA;CACzC,CAAC;AAyCF,iBAAS,cAAc;WAgGT,OAAO,IAA6B;;wBAVrB,GAAG;wBACH,GAAG;qCACU,GAAG;;;;EAa5C;AAcD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;kFAOnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAWpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -11,7 +11,7 @@ const z = /* @__PURE__ */ p({
|
|
|
11
11
|
},
|
|
12
12
|
emits: ["updateContent"],
|
|
13
13
|
setup(e) {
|
|
14
|
-
const { toggleColorMode:
|
|
14
|
+
const { toggleColorMode: d, isDarkMode: a } = N({
|
|
15
15
|
initialColorMode: e.configuration.darkMode ? "dark" : void 0,
|
|
16
16
|
overrideColorMode: e.configuration.forceDarkModeState
|
|
17
17
|
});
|
|
@@ -19,9 +19,9 @@ const z = /* @__PURE__ */ p({
|
|
|
19
19
|
() => e.configuration.darkMode,
|
|
20
20
|
(o) => a.value = !!o
|
|
21
21
|
), e.configuration.metaData && R(e.configuration.metaData);
|
|
22
|
-
const { parsedSpec:
|
|
22
|
+
const { parsedSpec: m, rawSpec: s } = V({
|
|
23
23
|
proxyUrl: f(() => e.configuration.proxyUrl || ""),
|
|
24
|
-
specConfig: f(() => e.configuration
|
|
24
|
+
specConfig: f(() => e.configuration || {})
|
|
25
25
|
}), l = k(() => e.configuration.favicon);
|
|
26
26
|
return U(l), (o, n) => {
|
|
27
27
|
var c;
|
|
@@ -35,9 +35,9 @@ const z = /* @__PURE__ */ p({
|
|
|
35
35
|
B(t(F), {
|
|
36
36
|
configuration: o.configuration,
|
|
37
37
|
isDark: t(a),
|
|
38
|
-
parsedSpec: t(
|
|
39
|
-
rawSpec: t(
|
|
40
|
-
onToggleDarkMode: n[0] || (n[0] = () => t(
|
|
38
|
+
parsedSpec: t(m),
|
|
39
|
+
rawSpec: t(s),
|
|
40
|
+
onToggleDarkMode: n[0] || (n[0] = () => t(d)()),
|
|
41
41
|
onUpdateContent: n[1] || (n[1] = (g) => o.$emit("updateContent", g))
|
|
42
42
|
}, {
|
|
43
43
|
footer: r(() => [
|
package/dist/esm.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import type { ApiReferenceConfiguration, SpecConfiguration } from '@scalar/types/api-reference';
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* Initialize Scalar References
|
|
4
|
+
*
|
|
5
|
+
* @deprecated please import { createApiReference } from '@scalar/api-reference' instead
|
|
6
|
+
*/
|
|
3
7
|
export declare function createScalarReferences(
|
|
4
8
|
/** Element to mount the references to */
|
|
5
9
|
el: HTMLElement | null,
|
package/dist/esm.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"esm.d.ts","sourceRoot":"","sources":["../src/esm.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,yBAAyB,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AAM/F
|
|
1
|
+
{"version":3,"file":"esm.d.ts","sourceRoot":"","sources":["../src/esm.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,yBAAyB,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AAM/F;;;;GAIG;AACH,wBAAgB,sBAAsB;AACpC,yCAAyC;AACzC,EAAE,EAAE,WAAW,GAAG,IAAI;AACtB,iDAAiD;AACjD,aAAa,EAAE,OAAO,CAAC,yBAAyB,CAAC,GAAG,OAAO,CAAC,yBAAyB,CAAC,EAAE;AACxF;;;GAGG;AACH,iBAAiB,UAAO;IAsBtB,uDAAuD;4BAC/B,OAAO,CAAC,yBAAyB,CAAC;qBAOzC,iBAAiB;IAOlC,8CAA8C;;IAE9C,sCAAsC;;EAGzC"}
|
package/dist/esm.js
CHANGED
|
@@ -1,27 +1,30 @@
|
|
|
1
1
|
import { objectMerge as f } from "@scalar/oas-utils/helpers";
|
|
2
2
|
import { createHead as p } from "@unhead/vue";
|
|
3
|
-
import { reactive as
|
|
3
|
+
import { reactive as u, createApp as m } from "vue";
|
|
4
4
|
import l from "./components/ApiReference.vue.js";
|
|
5
|
-
function S(
|
|
6
|
-
|
|
5
|
+
function S(o, a, c = !0) {
|
|
6
|
+
console.warn(
|
|
7
|
+
"createScalarReferences is deprecated. Please import { createApiReference } from '@scalar/api-reference' instead."
|
|
8
|
+
);
|
|
9
|
+
const r = u(a), t = m(l, { configuration: r }), i = p();
|
|
7
10
|
t.use(i);
|
|
8
|
-
function
|
|
11
|
+
function n(e = o) {
|
|
9
12
|
if (!e) {
|
|
10
13
|
console.warn("Invalid HTML element provided. Cannot mount Scalar References");
|
|
11
14
|
return;
|
|
12
15
|
}
|
|
13
16
|
t.mount(e);
|
|
14
17
|
}
|
|
15
|
-
return c &&
|
|
18
|
+
return c && n(), {
|
|
16
19
|
/** Update the configuration for a mounted reference */
|
|
17
|
-
updateConfig(e,
|
|
18
|
-
|
|
20
|
+
updateConfig(e, s = !0) {
|
|
21
|
+
s ? Object.assign(r, e) : f(r, e);
|
|
19
22
|
},
|
|
20
23
|
updateSpec(e) {
|
|
21
|
-
Array.isArray(r) ? console.error("Cannot update the content for multiple configurations.") : r
|
|
24
|
+
Array.isArray(r) ? console.error("Cannot update the content for multiple configurations.") : Object.assign(r, e);
|
|
22
25
|
},
|
|
23
26
|
/** Mount the references to a given element */
|
|
24
|
-
mount:
|
|
27
|
+
mount: n,
|
|
25
28
|
/** Unmount the app from an element */
|
|
26
29
|
unmount: () => t.unmount()
|
|
27
30
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./DownloadLink.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
4
|
+
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-227fe8c2"]]);
|
|
5
5
|
export {
|
|
6
6
|
m as default
|
|
7
7
|
};
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useConfig as
|
|
3
|
-
import { downloadSpecBus as
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as i, openBlock as o, createElementBlock as e, unref as t, Fragment as p, createCommentVNode as u } from "vue";
|
|
2
|
+
import { useConfig as m } from "../../hooks/useConfig.js";
|
|
3
|
+
import { downloadSpecBus as f } from "../../helpers/specDownloads.js";
|
|
4
|
+
const _ = { class: "download" }, k = ["href"], g = /* @__PURE__ */ i({
|
|
5
5
|
__name: "DownloadLink",
|
|
6
6
|
props: {
|
|
7
7
|
specTitle: {}
|
|
8
8
|
},
|
|
9
|
-
setup(
|
|
10
|
-
const
|
|
11
|
-
|
|
9
|
+
setup(d) {
|
|
10
|
+
const r = d, n = m(), s = () => {
|
|
11
|
+
f.emit({ id: "", specTitle: r.specTitle });
|
|
12
12
|
};
|
|
13
|
-
return (
|
|
14
|
-
var
|
|
15
|
-
return o(), e("div",
|
|
16
|
-
(
|
|
17
|
-
(
|
|
13
|
+
return (w, h) => {
|
|
14
|
+
var l, c, a;
|
|
15
|
+
return o(), e("div", _, [
|
|
16
|
+
(l = t(n)) != null && l.hideDownloadButton ? u("", !0) : (o(), e(p, { key: 0 }, [
|
|
17
|
+
(c = t(n)) != null && c.url ? (o(), e("a", {
|
|
18
18
|
key: 0,
|
|
19
19
|
class: "download-button",
|
|
20
20
|
download: "",
|
|
21
|
-
href: (
|
|
21
|
+
href: (a = t(n)) == null ? void 0 : a.url,
|
|
22
22
|
target: "_blank"
|
|
23
|
-
}, " Download OpenAPI Document ", 8,
|
|
23
|
+
}, " Download OpenAPI Document ", 8, k)) : (o(), e("button", {
|
|
24
24
|
key: 1,
|
|
25
25
|
class: "download-button",
|
|
26
26
|
role: "link",
|
|
27
27
|
type: "button",
|
|
28
|
-
onClick:
|
|
28
|
+
onClick: s
|
|
29
29
|
}, " Download OpenAPI Document "))
|
|
30
30
|
], 64))
|
|
31
31
|
]);
|
|
@@ -33,5 +33,5 @@ const w = { class: "download" }, h = ["href"], B = /* @__PURE__ */ u({
|
|
|
33
33
|
}
|
|
34
34
|
});
|
|
35
35
|
export {
|
|
36
|
-
|
|
36
|
+
g as default
|
|
37
37
|
};
|
|
@@ -11,6 +11,6 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
11
11
|
onSelectContentType?: ((payload: {
|
|
12
12
|
contentType: ContentType;
|
|
13
13
|
}) => any) | undefined;
|
|
14
|
-
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {},
|
|
14
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
15
15
|
export default _default;
|
|
16
16
|
//# sourceMappingURL=ContentTypeSelect.vue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentTypeSelect.vue.d.ts","sourceRoot":"","sources":["../../../../src/features/Operation/components/ContentTypeSelect.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ContentTypeSelect.vue.d.ts","sourceRoot":"","sources":["../../../../src/features/Operation/components/ContentTypeSelect.vue"],"names":[],"mappings":"AAoGA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAOpE,KAAK,WAAW,GAAG;IACjB,WAAW,CAAC,EAAE,WAAW,CAAA;IACzB,YAAY,CAAC,EAAE,WAAW,CAAA;CAC3B,CAAC;;;qBAIiD,WAAW;;;;qBAAX,WAAW;;;AAqK9D,wBAOG"}
|
|
@@ -1,7 +1,82 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as S, computed as s, ref as B, openBlock as p, createBlock as V, unref as n, withCtx as r, createVNode as c, normalizeClass as m, createTextVNode as k, createElementVNode as f, toDisplayString as v, createElementBlock as g } from "vue";
|
|
2
|
+
import { cva as h, ScalarListbox as w, ScalarButton as _, ScalarIcon as q } from "@scalar/components";
|
|
3
|
+
import N from "../../../components/ScreenReader.vue.js";
|
|
4
|
+
const O = /* @__PURE__ */ S({
|
|
5
|
+
__name: "ContentTypeSelect",
|
|
6
|
+
props: {
|
|
7
|
+
requestBody: {},
|
|
8
|
+
defaultValue: {}
|
|
9
|
+
},
|
|
10
|
+
emits: ["selectContentType"],
|
|
11
|
+
setup(y, { emit: x }) {
|
|
12
|
+
const t = y, C = x, T = (e) => {
|
|
13
|
+
e != null && e.id && C("selectContentType", { contentType: e.id });
|
|
14
|
+
}, a = s(() => {
|
|
15
|
+
var e;
|
|
16
|
+
return (e = t.requestBody) != null && e.content ? Object.keys(t.requestBody.content) : [];
|
|
17
|
+
}), l = B(
|
|
18
|
+
t.defaultValue || a.value[0]
|
|
19
|
+
), u = s({
|
|
20
|
+
get: () => d.value.find((e) => e.id === l.value),
|
|
21
|
+
set: (e) => {
|
|
22
|
+
e && (l.value = e.id);
|
|
23
|
+
}
|
|
24
|
+
}), d = s(() => a.value.map((e) => ({
|
|
25
|
+
id: e,
|
|
26
|
+
label: e
|
|
27
|
+
}))), i = h({
|
|
28
|
+
base: "font-normal text-c-2 bg-b-2 py-0.75 flex cursor-pointer items-center gap-1 rounded-full text-xs",
|
|
29
|
+
variants: {
|
|
30
|
+
dropdown: {
|
|
31
|
+
true: "border hover:text-c-1 pl-2 pr-1.5",
|
|
32
|
+
false: "px-2"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
return (e, o) => t != null && t.requestBody && a.value.length > 1 ? (p(), V(n(w), {
|
|
37
|
+
key: 0,
|
|
38
|
+
modelValue: u.value,
|
|
39
|
+
"onUpdate:modelValue": [
|
|
40
|
+
o[0] || (o[0] = (b) => u.value = b),
|
|
41
|
+
T
|
|
42
|
+
],
|
|
43
|
+
options: d.value,
|
|
44
|
+
placement: "bottom-end",
|
|
45
|
+
class: "font-normal"
|
|
46
|
+
}, {
|
|
47
|
+
default: r(() => [
|
|
48
|
+
c(n(_), {
|
|
49
|
+
variant: "ghost",
|
|
50
|
+
class: m(["h-fit", n(i)({ dropdown: !0 })])
|
|
51
|
+
}, {
|
|
52
|
+
default: r(() => [
|
|
53
|
+
c(N, null, {
|
|
54
|
+
default: r(() => o[1] || (o[1] = [
|
|
55
|
+
k("Selected Content Type:")
|
|
56
|
+
])),
|
|
57
|
+
_: 1
|
|
58
|
+
}),
|
|
59
|
+
f("span", null, v(l.value), 1),
|
|
60
|
+
c(n(q), {
|
|
61
|
+
class: "ui-open:rotate-180 ml-auto",
|
|
62
|
+
icon: "ChevronDown",
|
|
63
|
+
size: "sm",
|
|
64
|
+
thickness: "2"
|
|
65
|
+
})
|
|
66
|
+
]),
|
|
67
|
+
_: 1
|
|
68
|
+
}, 8, ["class"])
|
|
69
|
+
]),
|
|
70
|
+
_: 1
|
|
71
|
+
}, 8, ["modelValue", "options"])) : (p(), g("div", {
|
|
72
|
+
key: 1,
|
|
73
|
+
class: m(n(i)({ dropdown: !1 })),
|
|
74
|
+
tabindex: "0"
|
|
75
|
+
}, [
|
|
76
|
+
f("span", null, v(l.value), 1)
|
|
77
|
+
], 2));
|
|
78
|
+
}
|
|
79
|
+
});
|
|
5
80
|
export {
|
|
6
|
-
|
|
81
|
+
O as default
|
|
7
82
|
};
|
|
@@ -1,45 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
const h = ["value"], w = ["value"], b = /* @__PURE__ */ f({
|
|
3
|
-
__name: "ContentTypeSelect",
|
|
4
|
-
props: {
|
|
5
|
-
requestBody: {},
|
|
6
|
-
defaultValue: {}
|
|
7
|
-
},
|
|
8
|
-
emits: ["selectContentType"],
|
|
9
|
-
setup(i, { emit: y }) {
|
|
10
|
-
const e = i, m = y, v = (n) => {
|
|
11
|
-
const o = n.target.value;
|
|
12
|
-
u.value = o, m("selectContentType", { contentType: o });
|
|
13
|
-
}, r = g(() => {
|
|
14
|
-
var n;
|
|
15
|
-
return (n = e.requestBody) != null && n.content ? Object.keys(e.requestBody.content) : [];
|
|
16
|
-
}), u = C(
|
|
17
|
-
e.defaultValue || r.value[0]
|
|
18
|
-
);
|
|
19
|
-
return (n, t) => {
|
|
20
|
-
var o;
|
|
21
|
-
return l(), s("label", {
|
|
22
|
-
class: B(["content-type-select", { "content-type-no-select": r.value.length <= 1 }])
|
|
23
|
-
}, [
|
|
24
|
-
T("span", null, d(u.value), 1),
|
|
25
|
-
e != null && e.requestBody && r.value.length > 1 ? (l(), s("select", {
|
|
26
|
-
key: 0,
|
|
27
|
-
value: u.value,
|
|
28
|
-
onChange: t[1] || (t[1] = (c) => v(c)),
|
|
29
|
-
onKeydown: t[2] || (t[2] = p(() => {
|
|
30
|
-
}, ["stop"]))
|
|
31
|
-
}, [
|
|
32
|
-
(l(!0), s(q, null, _((o = e.requestBody) == null ? void 0 : o.content, (c, a) => (l(), s("option", {
|
|
33
|
-
key: a,
|
|
34
|
-
value: a,
|
|
35
|
-
onKeydown: t[0] || (t[0] = p(() => {
|
|
36
|
-
}, ["stop"]))
|
|
37
|
-
}, d(a), 41, w))), 128))
|
|
38
|
-
], 40, h)) : V("", !0)
|
|
39
|
-
], 2);
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
});
|
|
1
|
+
import f from "./ContentTypeSelect.vue.js";
|
|
43
2
|
export {
|
|
44
|
-
|
|
3
|
+
f as default
|
|
45
4
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ParameterListItem.vue.d.ts","sourceRoot":"","sources":["../../../../src/features/Operation/components/ParameterListItem.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ParameterListItem.vue.d.ts","sourceRoot":"","sources":["../../../../src/features/Operation/components/ParameterListItem.vue"],"names":[],"mappings":"AAyOA,OAAO,KAAK,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iCAAiC,CAAA;AAY/E,KAAK,WAAW,GAAG;IACf,SAAS,EACL,WAAW,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,GAChD,WAAW,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAA;IACnD,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB,CAAC;;kBADe,OAAO;kBAFP,OAAO;sBACH,OAAO;;AAkQ9B,wBAOG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import t from "./ParameterListItem.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import o from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const e = /* @__PURE__ */ o(t, [["__scopeId", "data-v-
|
|
4
|
+
const e = /* @__PURE__ */ o(t, [["__scopeId", "data-v-d846a784"]]);
|
|
5
5
|
export {
|
|
6
6
|
e as default
|
|
7
7
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Disclosure as
|
|
1
|
+
import { defineComponent as w, computed as i, ref as C, openBlock as o, createElementBlock as g, createVNode as m, unref as t, withCtx as u, createBlock as p, normalizeClass as B, createElementVNode as c, toDisplayString as b, createCommentVNode as n } from "vue";
|
|
2
|
+
import { Disclosure as E, DisclosureButton as S, DisclosurePanel as q } from "@headlessui/vue";
|
|
3
3
|
import { ScalarIcon as D, ScalarMarkdown as P } from "@scalar/components";
|
|
4
4
|
import V from "./ContentTypeSelect.vue.js";
|
|
5
5
|
import I from "./ParameterHeaders.vue.js";
|
|
6
|
-
import
|
|
7
|
-
const
|
|
6
|
+
import j from "../../../components/Content/Schema/SchemaProperty.vue.js";
|
|
7
|
+
const N = {
|
|
8
8
|
key: 0,
|
|
9
|
-
class: "parameter-item"
|
|
10
|
-
},
|
|
9
|
+
class: "parameter-item group/parameter-item relative"
|
|
10
|
+
}, T = { class: "parameter-item-name" }, _ = { class: "parameter-item-type" }, O = { class: "absolute right-0 top-2.5 opacity-0 group-focus-within/parameter-item:opacity-100 group-hover/parameter-item:opacity-100" }, A = /* @__PURE__ */ w({
|
|
11
11
|
__name: "ParameterListItem",
|
|
12
12
|
props: {
|
|
13
13
|
parameter: {},
|
|
@@ -16,62 +16,56 @@ const j = {
|
|
|
16
16
|
withExamples: { type: Boolean, default: !0 }
|
|
17
17
|
},
|
|
18
18
|
setup(y) {
|
|
19
|
-
const
|
|
19
|
+
const a = y, v = i(() => a.parameter.content ? Object.keys(a.parameter.content) : []), l = C(
|
|
20
20
|
v.value[0]
|
|
21
21
|
);
|
|
22
|
-
|
|
23
|
-
const r = i(() => !!(
|
|
24
|
-
return (e, d) =>
|
|
25
|
-
m(
|
|
26
|
-
default: u(({ open:
|
|
27
|
-
r.value ? (o(), p(
|
|
22
|
+
a.parameter.content && "application/json" in a.parameter.content && (l.value = "application/json");
|
|
23
|
+
const r = i(() => !!(a.collapsableItems && a.parameter.content)), k = i(() => a.parameter.readOnly !== !0);
|
|
24
|
+
return (e, d) => k.value ? (o(), g("li", N, [
|
|
25
|
+
m(t(E), null, {
|
|
26
|
+
default: u(({ open: s }) => [
|
|
27
|
+
r.value ? (o(), p(t(S), {
|
|
28
28
|
key: 0,
|
|
29
|
-
class: B(["parameter-item-trigger
|
|
29
|
+
class: B(["parameter-item-trigger flex", { "parameter-item-trigger-open": s }])
|
|
30
30
|
}, {
|
|
31
31
|
default: u(() => [
|
|
32
|
-
m(
|
|
32
|
+
m(t(D), {
|
|
33
33
|
class: "parameter-item-icon",
|
|
34
|
-
icon:
|
|
34
|
+
icon: s ? "ChevronDown" : "ChevronRight",
|
|
35
35
|
thickness: "1.5"
|
|
36
36
|
}, null, 8, ["icon"]),
|
|
37
|
-
c("span",
|
|
38
|
-
c("span",
|
|
39
|
-
e.parameter.description ? (o(), p(
|
|
37
|
+
c("span", T, b(e.parameter.name), 1),
|
|
38
|
+
c("span", _, [
|
|
39
|
+
e.parameter.description ? (o(), p(t(P), {
|
|
40
40
|
key: 0,
|
|
41
41
|
class: "markdown",
|
|
42
42
|
value: e.parameter.description
|
|
43
43
|
}, null, 8, ["value"])) : n("", !0)
|
|
44
|
-
]),
|
|
45
|
-
c("div", _, [
|
|
46
|
-
r.value && t.parameter.content ? (o(), p(V, {
|
|
47
|
-
key: 0,
|
|
48
|
-
class: "parameter-item-content-type",
|
|
49
|
-
defaultValue: l.value,
|
|
50
|
-
requestBody: t.parameter,
|
|
51
|
-
onSelectContentType: d[0] || (d[0] = ({ contentType: s }) => l.value = s)
|
|
52
|
-
}, null, 8, ["defaultValue", "requestBody"])) : n("", !0)
|
|
53
44
|
])
|
|
54
45
|
]),
|
|
55
46
|
_: 2
|
|
56
47
|
}, 1032, ["class"])) : n("", !0),
|
|
57
|
-
m(
|
|
48
|
+
m(t(q), {
|
|
58
49
|
class: "parameter-item-container parameter-item-container-markdown",
|
|
59
50
|
static: !r.value
|
|
60
51
|
}, {
|
|
61
52
|
default: u(() => {
|
|
62
|
-
var
|
|
53
|
+
var f, h;
|
|
63
54
|
return [
|
|
64
55
|
e.parameter.headers ? (o(), p(I, {
|
|
65
56
|
key: 0,
|
|
66
57
|
headers: e.parameter.headers
|
|
67
58
|
}, null, 8, ["headers"])) : n("", !0),
|
|
68
|
-
m(
|
|
59
|
+
m(t(j), {
|
|
69
60
|
compact: "",
|
|
70
61
|
description: r.value ? "" : e.parameter.description,
|
|
71
62
|
name: r.value ? "" : e.parameter.name,
|
|
72
63
|
noncollapsible: e.showChildren,
|
|
73
64
|
required: e.parameter.required,
|
|
74
|
-
value:
|
|
65
|
+
value: {
|
|
66
|
+
deprecated: e.parameter.deprecated,
|
|
67
|
+
...e.parameter.content ? (h = (f = e.parameter.content) == null ? void 0 : f[l.value]) == null ? void 0 : h.schema : e.parameter.schema
|
|
68
|
+
},
|
|
75
69
|
withExamples: e.withExamples
|
|
76
70
|
}, null, 8, ["description", "name", "noncollapsible", "required", "value", "withExamples"])
|
|
77
71
|
];
|
|
@@ -80,10 +74,19 @@ const j = {
|
|
|
80
74
|
}, 8, ["static"])
|
|
81
75
|
]),
|
|
82
76
|
_: 1
|
|
83
|
-
})
|
|
77
|
+
}),
|
|
78
|
+
c("div", O, [
|
|
79
|
+
r.value && a.parameter.content ? (o(), p(V, {
|
|
80
|
+
key: 0,
|
|
81
|
+
class: "parameter-item-content-type",
|
|
82
|
+
defaultValue: l.value,
|
|
83
|
+
requestBody: a.parameter,
|
|
84
|
+
onSelectContentType: d[0] || (d[0] = ({ contentType: s }) => l.value = s)
|
|
85
|
+
}, null, 8, ["defaultValue", "requestBody"])) : n("", !0)
|
|
86
|
+
])
|
|
84
87
|
])) : n("", !0);
|
|
85
88
|
}
|
|
86
89
|
});
|
|
87
90
|
export {
|
|
88
|
-
|
|
91
|
+
A as default
|
|
89
92
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestBody.vue.d.ts","sourceRoot":"","sources":["../../../../src/features/Operation/components/RequestBody.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RequestBody.vue.d.ts","sourceRoot":"","sources":["../../../../src/features/Operation/components/RequestBody.vue"],"names":[],"mappings":"AAmIA,OAAO,KAAK,EAAe,WAAW,EAAE,MAAM,sBAAsB,CAAA;AASpE,KAAK,WAAW,GAAG;IAAE,WAAW,CAAC,EAAE,WAAW,CAAA;CAAE,CAAC;AAqBjD,iBAAS,cAAc;WAyFT,OAAO,IAA6B;;uBARvB,GAAG;;;;EAa7B;AAWD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe,kSAMnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAWpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./RequestBody.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-1e0d96b3"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
p as default
|
|
7
7
|
};
|