@scalar/api-reference 1.28.13 → 1.28.15
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 +28 -0
- package/dist/browser/standalone.js +6710 -6674
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/Card/Card.vue.d.ts.map +1 -1
- package/dist/components/Card/Card.vue.js +7 -7
- 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 +18 -19
- package/dist/components/Content/Introduction/Introduction.vue.d.ts.map +1 -1
- package/dist/components/Content/Introduction/Introduction.vue.js +2 -2
- package/dist/components/Content/Introduction/Introduction.vue2.js +44 -35
- package/dist/components/Content/Lazy/Loading.vue.d.ts +8 -17
- package/dist/components/Content/Lazy/Loading.vue.d.ts.map +1 -1
- package/dist/components/Content/Lazy/Loading.vue.js +50 -44
- package/dist/components/Content/Schema/Schema.preview.d.ts +525 -0
- package/dist/components/Content/Schema/Schema.preview.d.ts.map +1 -1
- package/dist/components/Content/Schema/Schema.vue.d.ts +1 -0
- package/dist/components/Content/Schema/Schema.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/Schema.vue.js +1 -1
- package/dist/components/Content/Schema/Schema.vue2.js +86 -75
- package/dist/components/Content/Schema/SchemaDiscriminator.vue.d.ts +1 -0
- package/dist/components/Content/Schema/SchemaDiscriminator.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaDiscriminator.vue.js +2 -2
- package/dist/components/Content/Schema/SchemaDiscriminator.vue2.js +41 -56
- package/dist/components/Content/Schema/SchemaProperty.vue.d.ts +4 -1
- package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaProperty.vue.js +2 -2
- package/dist/components/Content/Schema/SchemaProperty.vue2.js +169 -153
- package/dist/components/Content/Schema/helpers/merge-all-of-schemas.d.ts +12 -0
- package/dist/components/Content/Schema/helpers/merge-all-of-schemas.d.ts.map +1 -0
- package/dist/components/Content/Schema/helpers/merge-all-of-schemas.js +70 -0
- package/dist/features/Operation/components/ParameterListItem.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/ParameterListItem.vue.js +3 -3
- package/dist/features/Operation/components/ParameterListItem.vue2.js +13 -12
- 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 +29 -26
- package/dist/features/Search/SearchButton.vue.d.ts.map +1 -1
- package/dist/features/Search/SearchButton.vue.js +2 -2
- package/dist/features/Search/SearchButton.vue2.js +42 -29
- package/dist/features/Search/SearchModal.vue.d.ts.map +1 -1
- package/dist/features/Search/SearchModal.vue.js +3 -3
- package/dist/features/Search/SearchModal.vue2.js +102 -96
- package/dist/features/Search/useSearchIndex.d.ts +2 -1
- package/dist/features/Search/useSearchIndex.d.ts.map +1 -1
- package/dist/features/Search/useSearchIndex.js +55 -52
- package/dist/hooks/useSidebar.d.ts +1 -0
- package/dist/hooks/useSidebar.d.ts.map +1 -1
- package/dist/hooks/useSidebar.js +131 -119
- package/dist/index.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +8 -8
|
@@ -1,103 +1,114 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Disclosure as
|
|
3
|
-
import { ScalarMarkdown as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
1
|
+
import { defineComponent as V, computed as E, openBlock as a, createBlock as i, unref as r, withCtx as d, createElementVNode as j, normalizeClass as v, createElementBlock as s, createCommentVNode as o, withDirectives as w, createVNode as u, createTextVNode as h, toDisplayString as f, vShow as z, normalizeStyle as T, Fragment as t, renderList as A } from "vue";
|
|
2
|
+
import { Disclosure as $, DisclosureButton as D, DisclosurePanel as F } from "@headlessui/vue";
|
|
3
|
+
import { ScalarMarkdown as I, ScalarIcon as g } from "@scalar/components";
|
|
4
|
+
import q from "../../ScreenReader.vue.js";
|
|
5
|
+
import L from "./SchemaHeading.vue.js";
|
|
6
|
+
import y from "./SchemaProperty.vue.js";
|
|
7
|
+
const M = {
|
|
7
8
|
key: 0,
|
|
8
9
|
class: "schema-card-description"
|
|
9
|
-
},
|
|
10
|
+
}, R = {
|
|
10
11
|
key: 0,
|
|
11
12
|
class: "schema-properties"
|
|
12
|
-
},
|
|
13
|
+
}, X = /* @__PURE__ */ V({
|
|
13
14
|
__name: "Schema",
|
|
14
15
|
props: {
|
|
15
16
|
value: { type: [Object, Boolean] },
|
|
16
17
|
level: { default: 0 },
|
|
17
18
|
name: {},
|
|
18
19
|
compact: { type: Boolean },
|
|
19
|
-
noncollapsible: { type: Boolean },
|
|
20
|
+
noncollapsible: { type: Boolean, default: !1 },
|
|
20
21
|
hideHeading: { type: Boolean },
|
|
21
22
|
additionalProperties: { type: Boolean },
|
|
22
23
|
schemas: {}
|
|
23
24
|
},
|
|
24
|
-
setup(
|
|
25
|
-
const
|
|
26
|
-
return (e,
|
|
25
|
+
setup(N) {
|
|
26
|
+
const k = N, b = E(() => !(k.noncollapsible || k.level === 0)), H = (e) => k.noncollapsible && e.stopPropagation();
|
|
27
|
+
return (e, P) => typeof e.value == "object" && Object.keys(e.value).length ? (a(), i(r($), {
|
|
27
28
|
key: 0,
|
|
28
29
|
defaultOpen: e.noncollapsible
|
|
29
30
|
}, {
|
|
30
|
-
default:
|
|
31
|
-
var
|
|
31
|
+
default: d(({ open: n }) => {
|
|
32
|
+
var S;
|
|
32
33
|
return [
|
|
33
|
-
|
|
34
|
-
class:
|
|
34
|
+
j("div", {
|
|
35
|
+
class: v(["schema-card", [
|
|
35
36
|
`schema-card--level-${e.level}`,
|
|
36
37
|
{ "schema-card--compact": e.compact, "schema-card--open": n },
|
|
37
38
|
{ "border-t-1/2": e.additionalProperties && n }
|
|
38
39
|
]])
|
|
39
40
|
}, [
|
|
40
|
-
(
|
|
41
|
-
e.value.enum ?
|
|
41
|
+
(S = e.value) != null && S.description && typeof e.value.description == "string" && !e.value.allOf && !e.value.oneOf && !e.value.anyOf && !e.compact ? (a(), s("div", M, [
|
|
42
|
+
e.value.enum ? o("", !0) : (a(), i(r(I), {
|
|
42
43
|
key: 0,
|
|
43
44
|
value: e.value.description
|
|
44
45
|
}, null, 8, ["value"]))
|
|
45
|
-
])) :
|
|
46
|
-
|
|
47
|
-
class:
|
|
46
|
+
])) : o("", !0),
|
|
47
|
+
j("div", {
|
|
48
|
+
class: v(["schema-properties", {
|
|
48
49
|
"schema-properties-open": n
|
|
49
50
|
}])
|
|
50
51
|
}, [
|
|
51
|
-
e.additionalProperties ?
|
|
52
|
-
|
|
52
|
+
e.additionalProperties ? w((a(), s("div", R, [
|
|
53
|
+
u(r(D), {
|
|
53
54
|
as: "button",
|
|
54
55
|
class: "schema-card-title schema-card-title--compact",
|
|
55
|
-
onClickCapture:
|
|
56
|
+
onClickCapture: H
|
|
56
57
|
}, {
|
|
57
|
-
default:
|
|
58
|
-
|
|
58
|
+
default: d(() => [
|
|
59
|
+
u(r(g), {
|
|
59
60
|
class: "schema-card-title-icon",
|
|
60
61
|
icon: "Add",
|
|
61
62
|
size: "sm"
|
|
62
63
|
}),
|
|
63
|
-
|
|
64
|
+
P[0] || (P[0] = h(" Show additional properties ")),
|
|
65
|
+
e.name ? (a(), i(q, { key: 0 }, {
|
|
66
|
+
default: d(() => [
|
|
67
|
+
h("for " + f(e.name), 1)
|
|
68
|
+
]),
|
|
69
|
+
_: 1
|
|
70
|
+
})) : o("", !0)
|
|
64
71
|
]),
|
|
65
72
|
_: 1
|
|
66
73
|
})
|
|
67
74
|
], 512)), [
|
|
68
|
-
[
|
|
69
|
-
]) :
|
|
75
|
+
[z, !n]
|
|
76
|
+
]) : b.value ? w((a(), i(r(D), {
|
|
70
77
|
key: 1,
|
|
71
78
|
as: e.noncollapsible ? "div" : "button",
|
|
72
|
-
class:
|
|
73
|
-
style:
|
|
79
|
+
class: v(["schema-card-title", { "schema-card-title--compact": e.compact }]),
|
|
80
|
+
style: T({
|
|
74
81
|
top: `calc(var(--refs-header-height) + calc(var(--schema-title-height) * ${e.level}))`
|
|
75
82
|
}),
|
|
76
|
-
onClickCapture:
|
|
83
|
+
onClickCapture: H
|
|
77
84
|
}, {
|
|
78
|
-
default:
|
|
79
|
-
var
|
|
85
|
+
default: d(() => {
|
|
86
|
+
var m, c, l;
|
|
80
87
|
return [
|
|
81
|
-
e.compact ? (a(), s(
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
class: m(["schema-card-title-icon", { "schema-card-title-icon--open": n }]),
|
|
88
|
+
e.compact ? (a(), s(t, { key: 0 }, [
|
|
89
|
+
u(r(g), {
|
|
90
|
+
class: v(["schema-card-title-icon", { "schema-card-title-icon--open": n }]),
|
|
85
91
|
icon: "Add",
|
|
86
92
|
size: "sm"
|
|
87
|
-
}, null, 8, ["class"])
|
|
88
|
-
n ? (a(), s(
|
|
89
|
-
|
|
90
|
-
], 64)) : (a(), s(
|
|
91
|
-
|
|
92
|
-
], 64))
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
93
|
+
}, null, 8, ["class"]),
|
|
94
|
+
n ? (a(), s(t, { key: 0 }, [
|
|
95
|
+
h(" Hide " + f(((m = e.value) == null ? void 0 : m.title) ?? "Child Attributes"), 1)
|
|
96
|
+
], 64)) : (a(), s(t, { key: 1 }, [
|
|
97
|
+
h(" Show " + f(((c = e.value) == null ? void 0 : c.title) ?? "Child Attributes"), 1)
|
|
98
|
+
], 64)),
|
|
99
|
+
e.name ? (a(), i(q, { key: 2 }, {
|
|
100
|
+
default: d(() => [
|
|
101
|
+
h("for " + f(e.name), 1)
|
|
102
|
+
]),
|
|
103
|
+
_: 1
|
|
104
|
+
})) : o("", !0)
|
|
105
|
+
], 64)) : (a(), s(t, { key: 1 }, [
|
|
106
|
+
u(r(g), {
|
|
107
|
+
class: v(["schema-card-title-icon", { "schema-card-title-icon--open": n }]),
|
|
97
108
|
icon: "Add",
|
|
98
109
|
size: "sm"
|
|
99
|
-
}, null, 8, ["class"])
|
|
100
|
-
|
|
110
|
+
}, null, 8, ["class"]),
|
|
111
|
+
u(L, {
|
|
101
112
|
name: ((l = e.value) == null ? void 0 : l.title) ?? e.name,
|
|
102
113
|
value: e.value
|
|
103
114
|
}, null, 8, ["name", "value"])
|
|
@@ -106,32 +117,32 @@ const L = {
|
|
|
106
117
|
}),
|
|
107
118
|
_: 2
|
|
108
119
|
}, 1032, ["as", "class", "style"])), [
|
|
109
|
-
[
|
|
110
|
-
]),
|
|
111
|
-
|
|
120
|
+
[z, !e.hideHeading && !(e.noncollapsible && e.compact)]
|
|
121
|
+
]) : o("", !0),
|
|
122
|
+
u(r(F), {
|
|
112
123
|
as: "ul",
|
|
113
|
-
static:
|
|
124
|
+
static: !b.value
|
|
114
125
|
}, {
|
|
115
|
-
default:
|
|
116
|
-
var
|
|
126
|
+
default: d(() => {
|
|
127
|
+
var m, c;
|
|
117
128
|
return [
|
|
118
|
-
e.value.properties || e.value.additionalProperties || e.value.patternProperties ? (a(), s(
|
|
119
|
-
e.value.properties ? (a(!0), s(
|
|
120
|
-
var
|
|
121
|
-
return a(), i(
|
|
129
|
+
e.value.properties || e.value.additionalProperties || e.value.patternProperties ? (a(), s(t, { key: 0 }, [
|
|
130
|
+
e.value.properties ? (a(!0), s(t, { key: 0 }, A(Object.keys((m = e.value) == null ? void 0 : m.properties), (l) => {
|
|
131
|
+
var p, C, O, B;
|
|
132
|
+
return a(), i(y, {
|
|
122
133
|
key: l,
|
|
123
134
|
compact: e.compact,
|
|
124
135
|
hideHeading: e.hideHeading,
|
|
125
136
|
level: e.level + 1,
|
|
126
137
|
name: l,
|
|
127
|
-
required: ((
|
|
138
|
+
required: ((p = e.value.required) == null ? void 0 : p.includes(l)) || ((O = (C = e.value.properties) == null ? void 0 : C[l]) == null ? void 0 : O.required) === !0,
|
|
128
139
|
schemas: e.schemas,
|
|
129
|
-
value: (
|
|
140
|
+
value: (B = e.value.properties) == null ? void 0 : B[l]
|
|
130
141
|
}, null, 8, ["compact", "hideHeading", "level", "name", "required", "schemas", "value"]);
|
|
131
|
-
}), 128)) :
|
|
132
|
-
e.value.patternProperties ? (a(!0), s(
|
|
133
|
-
var
|
|
134
|
-
return a(), i(
|
|
142
|
+
}), 128)) : o("", !0),
|
|
143
|
+
e.value.patternProperties ? (a(!0), s(t, { key: 1 }, A(Object.keys((c = e.value) == null ? void 0 : c.patternProperties), (l) => {
|
|
144
|
+
var p;
|
|
145
|
+
return a(), i(y, {
|
|
135
146
|
key: l,
|
|
136
147
|
compact: e.compact,
|
|
137
148
|
hideHeading: e.hideHeading,
|
|
@@ -139,11 +150,11 @@ const L = {
|
|
|
139
150
|
name: l,
|
|
140
151
|
pattern: "",
|
|
141
152
|
schemas: e.schemas,
|
|
142
|
-
value: (
|
|
153
|
+
value: (p = e.value.patternProperties) == null ? void 0 : p[l]
|
|
143
154
|
}, null, 8, ["compact", "hideHeading", "level", "name", "schemas", "value"]);
|
|
144
|
-
}), 128)) :
|
|
145
|
-
e.value.additionalProperties ? (a(), s(
|
|
146
|
-
e.value.additionalProperties === !0 || Object.keys(e.value.additionalProperties).length === 0 || !e.value.additionalProperties.type ? (a(), i(
|
|
155
|
+
}), 128)) : o("", !0),
|
|
156
|
+
e.value.additionalProperties ? (a(), s(t, { key: 2 }, [
|
|
157
|
+
e.value.additionalProperties === !0 || Object.keys(e.value.additionalProperties).length === 0 || !e.value.additionalProperties.type ? (a(), i(y, {
|
|
147
158
|
key: 0,
|
|
148
159
|
additional: "",
|
|
149
160
|
compact: e.compact,
|
|
@@ -155,7 +166,7 @@ const L = {
|
|
|
155
166
|
type: "anything",
|
|
156
167
|
...typeof e.value.additionalProperties == "object" ? e.value.additionalProperties : {}
|
|
157
168
|
}
|
|
158
|
-
}, null, 8, ["compact", "hideHeading", "level", "schemas", "value"])) : (a(), i(
|
|
169
|
+
}, null, 8, ["compact", "hideHeading", "level", "schemas", "value"])) : (a(), i(y, {
|
|
159
170
|
key: 1,
|
|
160
171
|
additional: "",
|
|
161
172
|
compact: e.compact,
|
|
@@ -165,8 +176,8 @@ const L = {
|
|
|
165
176
|
schemas: e.schemas,
|
|
166
177
|
value: e.value.additionalProperties
|
|
167
178
|
}, null, 8, ["compact", "hideHeading", "level", "schemas", "value"]))
|
|
168
|
-
], 64)) :
|
|
169
|
-
], 64)) : (a(), i(
|
|
179
|
+
], 64)) : o("", !0)
|
|
180
|
+
], 64)) : (a(), i(y, {
|
|
170
181
|
key: 1,
|
|
171
182
|
compact: e.compact,
|
|
172
183
|
hideHeading: e.hideHeading,
|
|
@@ -183,9 +194,9 @@ const L = {
|
|
|
183
194
|
];
|
|
184
195
|
}),
|
|
185
196
|
_: 1
|
|
186
|
-
}, 8, ["defaultOpen"])) :
|
|
197
|
+
}, 8, ["defaultOpen"])) : o("", !0);
|
|
187
198
|
}
|
|
188
199
|
});
|
|
189
200
|
export {
|
|
190
|
-
|
|
201
|
+
X as default
|
|
191
202
|
};
|
|
@@ -2,6 +2,7 @@ import type { OpenAPIV2, OpenAPIV3, OpenAPIV3_1 } from '@scalar/openapi-types';
|
|
|
2
2
|
type __VLS_Props = {
|
|
3
3
|
discriminator: string;
|
|
4
4
|
schemas?: OpenAPIV2.DefinitionsObject | Record<string, OpenAPIV3.SchemaObject> | Record<string, OpenAPIV3_1.SchemaObject> | unknown;
|
|
5
|
+
name?: string;
|
|
5
6
|
value: Record<string, any>;
|
|
6
7
|
level: number;
|
|
7
8
|
compact?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaDiscriminator.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaDiscriminator.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SchemaDiscriminator.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaDiscriminator.vue"],"names":[],"mappings":"AAgLA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAU9E,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,MAAM,CAAA;IACrB,OAAO,CAAC,EACJ,SAAS,CAAC,iBAAiB,GAC3B,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,YAAY,CAAC,GACtC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,YAAY,CAAC,GACxC,OAAO,CAAA;IACX,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC1B,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB,CAAC;;AAiOF,wBAOG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./SchemaDiscriminator.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const f = /* @__PURE__ */ r(o, [["__scopeId", "data-v-ed97a7ff"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
f as default
|
|
7
7
|
};
|
|
@@ -1,20 +1,22 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { TabGroup as
|
|
3
|
-
import { cva as
|
|
1
|
+
import { defineComponent as O, ref as S, openBlock as a, createElementBlock as c, createBlock as n, unref as r, withCtx as o, createVNode as u, createElementVNode as m, toDisplayString as d, Fragment as f, renderList as h, normalizeClass as B } from "vue";
|
|
2
|
+
import { TabGroup as T, TabList as H, Tab as N, TabPanel as V } from "@headlessui/vue";
|
|
3
|
+
import { cva as j, cx as w } from "@scalar/components";
|
|
4
4
|
import { stringify as v } from "flatted";
|
|
5
|
-
import
|
|
6
|
-
|
|
5
|
+
import { mergeAllOfSchemas as z } from "./helpers/merge-all-of-schemas.js";
|
|
6
|
+
import b from "./Schema.vue.js";
|
|
7
|
+
const L = { class: "property-rule" }, A = { class: "text-c-3" }, D = { class: "flex items-center gap-1.5" }, E = { class: "schema-tab-label z-1 relative" }, Z = /* @__PURE__ */ O({
|
|
7
8
|
__name: "SchemaDiscriminator",
|
|
8
9
|
props: {
|
|
9
10
|
discriminator: {},
|
|
10
11
|
schemas: {},
|
|
12
|
+
name: {},
|
|
11
13
|
value: {},
|
|
12
14
|
level: {},
|
|
13
15
|
compact: { type: Boolean },
|
|
14
16
|
hideHeading: { type: Boolean }
|
|
15
17
|
},
|
|
16
|
-
setup(
|
|
17
|
-
const
|
|
18
|
+
setup(y) {
|
|
19
|
+
const i = y, p = S(0), g = j({
|
|
18
20
|
base: "schema-tab",
|
|
19
21
|
variants: {
|
|
20
22
|
selected: {
|
|
@@ -22,55 +24,36 @@ const w = { class: "property-rule" }, z = { class: "text-c-3" }, L = { class: "f
|
|
|
22
24
|
false: "text-c-3"
|
|
23
25
|
}
|
|
24
26
|
}
|
|
25
|
-
}),
|
|
26
|
-
if (!Array.isArray(e) || e.length === 0)
|
|
27
|
-
return {};
|
|
28
|
-
if (e.length > 0 && e[0].allOf) {
|
|
29
|
-
const a = e.flatMap((r) => r.allOf || []);
|
|
30
|
-
return d(a);
|
|
31
|
-
}
|
|
32
|
-
return e.reduce((a, r) => {
|
|
33
|
-
if (!r || typeof r != "object")
|
|
34
|
-
return a;
|
|
35
|
-
const t = { ...a };
|
|
36
|
-
return r.properties && (t.properties = {
|
|
37
|
-
...t.properties,
|
|
38
|
-
...r.properties
|
|
39
|
-
}), r.required && Array.isArray(r.required) && (t.required = [
|
|
40
|
-
...t.required || [],
|
|
41
|
-
...r.required
|
|
42
|
-
]), r.type && !t.type && (t.type = r.type), r.description && !t.description && (t.description = r.description), t;
|
|
43
|
-
}, {});
|
|
44
|
-
}, O = (e) => {
|
|
27
|
+
}), k = (e) => {
|
|
45
28
|
if (!e)
|
|
46
29
|
return null;
|
|
47
30
|
if (e.name)
|
|
48
31
|
return e.name;
|
|
49
|
-
if (
|
|
50
|
-
for (const [
|
|
51
|
-
if (v(
|
|
52
|
-
return
|
|
32
|
+
if (i.schemas && typeof i.schemas == "object") {
|
|
33
|
+
for (const [s, t] of Object.entries(i.schemas))
|
|
34
|
+
if (v(t) === v(e))
|
|
35
|
+
return s;
|
|
53
36
|
return Object.keys(e)[0];
|
|
54
37
|
}
|
|
55
38
|
return null;
|
|
56
|
-
}, C = (e) => e.replace(/([A-Z])/g, " $1").replace(/^./, (
|
|
57
|
-
return (e,
|
|
58
|
-
e.discriminator === "oneOf" || e.discriminator === "anyOf" ? (
|
|
59
|
-
default:
|
|
60
|
-
|
|
61
|
-
default:
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
(
|
|
65
|
-
key:
|
|
66
|
-
class:
|
|
39
|
+
}, C = (e) => e.replace(/([A-Z])/g, " $1").replace(/^./, (s) => s.toUpperCase()).toLowerCase().replace(/^(\w)/, (s) => s.toUpperCase());
|
|
40
|
+
return (e, s) => (a(), c("div", L, [
|
|
41
|
+
e.discriminator === "oneOf" || e.discriminator === "anyOf" ? (a(), n(r(T), { key: 0 }, {
|
|
42
|
+
default: o(() => [
|
|
43
|
+
u(r(H), { class: "discriminator-tab-list py-1.25 flex flex-col gap-1 rounded-t-lg border border-b-0 px-2 pr-3" }, {
|
|
44
|
+
default: o(() => [
|
|
45
|
+
m("span", A, d(C(e.discriminator)), 1),
|
|
46
|
+
m("div", D, [
|
|
47
|
+
(a(!0), c(f, null, h(e.value[e.discriminator], (t, l) => (a(), n(r(N), {
|
|
48
|
+
key: l,
|
|
49
|
+
class: B([
|
|
67
50
|
"cursor-pointer",
|
|
68
|
-
|
|
51
|
+
r(w)(r(g)({ selected: p.value === l }))
|
|
69
52
|
]),
|
|
70
|
-
onClick: (
|
|
53
|
+
onClick: (F) => p.value = l
|
|
71
54
|
}, {
|
|
72
|
-
default:
|
|
73
|
-
|
|
55
|
+
default: o(() => [
|
|
56
|
+
m("span", E, d(k(t) || "Schema"), 1)
|
|
74
57
|
]),
|
|
75
58
|
_: 2
|
|
76
59
|
}, 1032, ["class", "onClick"]))), 128))
|
|
@@ -78,34 +61,36 @@ const w = { class: "property-rule" }, z = { class: "text-c-3" }, L = { class: "f
|
|
|
78
61
|
]),
|
|
79
62
|
_: 1
|
|
80
63
|
}),
|
|
81
|
-
(
|
|
82
|
-
key:
|
|
64
|
+
(a(!0), c(f, null, h(e.value[e.discriminator], (t, l) => (a(), n(r(V), {
|
|
65
|
+
key: l,
|
|
83
66
|
class: "discriminator-panel"
|
|
84
67
|
}, {
|
|
85
|
-
default:
|
|
86
|
-
|
|
68
|
+
default: o(() => [
|
|
69
|
+
u(b, {
|
|
87
70
|
compact: e.compact,
|
|
88
71
|
hideHeading: e.hideHeading,
|
|
72
|
+
name: e.name,
|
|
89
73
|
noncollapsible: !0,
|
|
90
74
|
schemas: e.schemas,
|
|
91
|
-
value:
|
|
92
|
-
}, null, 8, ["compact", "hideHeading", "schemas", "value"])
|
|
75
|
+
value: t
|
|
76
|
+
}, null, 8, ["compact", "hideHeading", "name", "schemas", "value"])
|
|
93
77
|
]),
|
|
94
78
|
_: 2
|
|
95
79
|
}, 1024))), 128))
|
|
96
80
|
]),
|
|
97
81
|
_: 1
|
|
98
|
-
})) : (
|
|
82
|
+
})) : (a(), n(b, {
|
|
99
83
|
key: 1,
|
|
100
84
|
compact: e.compact,
|
|
101
85
|
level: e.level,
|
|
86
|
+
name: e.name,
|
|
102
87
|
noncollapsible: e.level == 0,
|
|
103
88
|
schemas: e.schemas,
|
|
104
|
-
value:
|
|
105
|
-
}, null, 8, ["compact", "level", "noncollapsible", "schemas", "value"]))
|
|
89
|
+
value: r(z)(e.value[e.discriminator])
|
|
90
|
+
}, null, 8, ["compact", "level", "name", "noncollapsible", "schemas", "value"]))
|
|
106
91
|
]));
|
|
107
92
|
}
|
|
108
93
|
});
|
|
109
94
|
export {
|
|
110
|
-
|
|
95
|
+
Z as default
|
|
111
96
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { OpenAPIV2, OpenAPIV3, OpenAPIV3_1 } from '@scalar/openapi-types';
|
|
2
|
+
import { type Component } from 'vue';
|
|
2
3
|
/**
|
|
3
4
|
* Note: We’re taking in a prop called `value` which should be a JSON Schema.
|
|
4
5
|
*
|
|
@@ -6,7 +7,9 @@ import type { OpenAPIV2, OpenAPIV3, OpenAPIV3_1 } from '@scalar/openapi-types';
|
|
|
6
7
|
* So you should basically use the optimizedValue everywhere in the component.
|
|
7
8
|
*/
|
|
8
9
|
type __VLS_Props = {
|
|
10
|
+
is?: string | Component;
|
|
9
11
|
value?: Record<string, any>;
|
|
12
|
+
noncollapsible?: boolean;
|
|
10
13
|
level?: number;
|
|
11
14
|
name?: string;
|
|
12
15
|
required?: boolean;
|
|
@@ -23,6 +26,6 @@ declare const _default_1: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
|
|
|
23
26
|
level: number;
|
|
24
27
|
compact: boolean;
|
|
25
28
|
withExamples: boolean;
|
|
26
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {},
|
|
29
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
27
30
|
export default _default_1;
|
|
28
31
|
//# sourceMappingURL=SchemaProperty.vue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaProperty.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaProperty.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SchemaProperty.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaProperty.vue"],"names":[],"mappings":"AA0hBA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAC9E,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,KAAK,CAAA;AAa9C;;;;;GAKG;AAEH,KAAK,WAAW,GAAG;IACf,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC3B,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,OAAO,CAAC,EACJ,SAAS,CAAC,iBAAiB,GAC3B,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,YAAY,CAAC,GACtC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,YAAY,CAAC,GACxC,OAAO,CAAA;IACX,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB,CAAC;;cAZW,OAAO;WAFV,MAAM;aAGJ,OAAO;kBAIF,OAAO;;AAie1B,0BAQG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./SchemaProperty.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-a719d4a9"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
p as default
|
|
7
7
|
};
|