@scalar/blocks 0.11.3 → 0.11.4
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 +8 -0
- package/dist/constants.js +1 -1
- package/dist/schema/Schema.vue.d.ts.map +1 -1
- package/dist/schema/Schema.vue.js +4 -4
- package/dist/schema/Schema.vue.js.map +1 -1
- package/dist/schema/Schema3.vue.js +1 -1
- package/dist/schema/SchemaProperty.vue.d.ts +7 -2
- package/dist/schema/SchemaProperty.vue.d.ts.map +1 -1
- package/dist/schema/SchemaProperty.vue.js +257 -235
- package/dist/schema/SchemaProperty.vue.js.map +1 -1
- package/dist/schema/SchemaProperty3.vue.js +1 -1
- package/dist/schema/SchemaPropertyHeading.vue.d.ts +4 -1
- package/dist/schema/SchemaPropertyHeading.vue.d.ts.map +1 -1
- package/dist/schema/SchemaPropertyHeading.vue.js +113 -112
- package/dist/schema/SchemaPropertyHeading.vue.js.map +1 -1
- package/dist/schema/SchemaPropertyHeading3.vue.js +1 -1
- package/dist/schema/helpers/get-compositions-to-render.d.ts.map +1 -1
- package/dist/schema/helpers/get-compositions-to-render.js +34 -31
- package/dist/schema/helpers/get-compositions-to-render.js.map +1 -1
- package/dist/schema/helpers/get-ref-name.d.ts +14 -5
- package/dist/schema/helpers/get-ref-name.d.ts.map +1 -1
- package/dist/schema/helpers/get-ref-name.js +8 -11
- package/dist/schema/helpers/get-ref-name.js.map +1 -1
- package/dist/schema/helpers/index.d.ts +1 -1
- package/dist/schema/helpers/index.d.ts.map +1 -1
- package/dist/schema/helpers/index.js +3 -3
- package/dist/schema/helpers/schema-name.d.ts +7 -3
- package/dist/schema/helpers/schema-name.d.ts.map +1 -1
- package/dist/schema/helpers/schema-name.js +36 -26
- package/dist/schema/helpers/schema-name.js.map +1 -1
- package/dist/shared/ExternalDocs.vue.d.ts +2 -0
- package/dist/shared/ExternalDocs.vue.d.ts.map +1 -1
- package/dist/shared/ExternalDocs.vue.js +24 -17
- package/dist/shared/ExternalDocs.vue.js.map +1 -1
- package/dist/style.css +11 -11
- package/dist/vue-styles.css +1 -1
- package/package.json +10 -10
|
@@ -1,58 +1,62 @@
|
|
|
1
1
|
import e from "../shared/ExternalDocs2.vue.js";
|
|
2
2
|
import t from "./components/CopyLinkButton2.vue.js";
|
|
3
3
|
import n from "./components/WithBreadcrumb2.vue.js";
|
|
4
|
-
import { schemaDiscriminator as
|
|
5
|
-
import { resolveDynamicSchema as
|
|
6
|
-
import { getCompositionsToRender as
|
|
7
|
-
import { getEnumValues as
|
|
8
|
-
import { getPropertyDescriptionKey as
|
|
9
|
-
import { getRefName as
|
|
10
|
-
import { typeSignatureInlinesEnum as
|
|
11
|
-
import { hasComplexArrayItems as
|
|
12
|
-
import { isTypeObject as
|
|
13
|
-
import { normalizeObjectComposition as
|
|
14
|
-
import { optimizeValueForDisplay as
|
|
15
|
-
import { partitionAllOfCompositions as
|
|
16
|
-
import { SCHEMA_ANCESTORS_SYMBOL as
|
|
17
|
-
import { toNodeKey as
|
|
18
|
-
import { shouldDisplayDescription as
|
|
19
|
-
import { shouldDisplayHeading as
|
|
20
|
-
import { sortPropertyNames as
|
|
21
|
-
import { unwrapForRead as
|
|
22
|
-
import { useLocalization as
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
import { Fragment as
|
|
31
|
-
import { ScalarWrappingText as
|
|
32
|
-
import { resolve as
|
|
33
|
-
import { isArraySchema as
|
|
34
|
-
import { ScalarMarkdown as
|
|
35
|
-
import { isDynamicRef as
|
|
4
|
+
import { schemaDiscriminator as r } from "./discriminator-metadata.js";
|
|
5
|
+
import { resolveDynamicSchema as i } from "./helpers/dynamic-scope.js";
|
|
6
|
+
import { getCompositionsToRender as ee, inferDiscriminatorMappingComposition as te } from "./helpers/get-compositions-to-render.js";
|
|
7
|
+
import { getEnumValues as a } from "./helpers/get-enum-values.js";
|
|
8
|
+
import { getPropertyDescriptionKey as ne } from "./helpers/get-property-description.js";
|
|
9
|
+
import { getRefName as re } from "./helpers/get-ref-name.js";
|
|
10
|
+
import { typeSignatureInlinesEnum as ie } from "./helpers/get-type-signature-tokens.js";
|
|
11
|
+
import { hasComplexArrayItems as o } from "./helpers/has-complex-array-items.js";
|
|
12
|
+
import { isTypeObject as s } from "./helpers/is-type-object.js";
|
|
13
|
+
import { normalizeObjectComposition as ae } from "./helpers/normalize-object-composition.js";
|
|
14
|
+
import { optimizeValueForDisplay as c } from "./helpers/optimize-value-for-display.js";
|
|
15
|
+
import { partitionAllOfCompositions as oe } from "./helpers/partition-all-of-compositions.js";
|
|
16
|
+
import { SCHEMA_ANCESTORS_SYMBOL as se, getCycleKey as ce } from "./helpers/schema-cycle.js";
|
|
17
|
+
import { toNodeKey as le, useSchemaExpansion as ue } from "./helpers/schema-expansion.js";
|
|
18
|
+
import { shouldDisplayDescription as de } from "./helpers/should-display-description.js";
|
|
19
|
+
import { shouldDisplayHeading as fe } from "./helpers/should-display-heading.js";
|
|
20
|
+
import { sortPropertyNames as pe } from "./helpers/sort-property-names.js";
|
|
21
|
+
import { unwrapForRead as me } from "./helpers/unwrap-for-read.js";
|
|
22
|
+
import { useLocalization as he } from "./localization/index.js";
|
|
23
|
+
import ge from "./Schema3.vue.js";
|
|
24
|
+
import _e from "./SchemaCollapsedPreview2.vue.js";
|
|
25
|
+
import ve from "./SchemaComposition3.vue.js";
|
|
26
|
+
import ye from "./SchemaEnums3.vue.js";
|
|
27
|
+
import be from "./SchemaGutterToggle2.vue.js";
|
|
28
|
+
import xe from "./SchemaPropertyHeading3.vue.js";
|
|
29
|
+
import Se from "./SchemaRailPanel2.vue.js";
|
|
30
|
+
import { Fragment as Ce, computed as l, createBlock as u, createCommentVNode as d, createElementBlock as f, createElementVNode as we, createSlots as Te, createTextVNode as Ee, createVNode as p, defineComponent as m, inject as De, mergeProps as h, normalizeClass as Oe, onBeforeUnmount as ke, onScopeDispose as Ae, openBlock as g, ref as je, renderList as Me, resolveDynamicComponent as Ne, toDisplayString as Pe, toHandlers as Fe, toRef as Ie, unref as _, useId as v, useTemplateRef as Le, watch as y, withCtx as b } from "vue";
|
|
31
|
+
import { ScalarWrappingText as x } from "@scalar/components/wrapping-text";
|
|
32
|
+
import { resolve as S } from "@scalar/workspace-store/resolve";
|
|
33
|
+
import { isArraySchema as C } from "@scalar/workspace-store/schemas/v3.2/strict/type-guards";
|
|
34
|
+
import { ScalarMarkdown as Re } from "@scalar/components/markdown";
|
|
35
|
+
import { isDynamicRef as ze } from "@scalar/workspace-store/helpers/dynamic-ref";
|
|
36
|
+
import { isObjectEqual as Be } from "@scalar/helpers/object/is-object-equal";
|
|
36
37
|
// src/schema/SchemaProperty.vue?vue&type=script&setup=true&lang.ts
|
|
37
|
-
var
|
|
38
|
+
var Ve = ["id"], He = {
|
|
38
39
|
key: 0,
|
|
39
40
|
class: "property-name-pattern-properties text-c-1! border-0! p-0! before:hidden!"
|
|
40
|
-
},
|
|
41
|
+
}, Ue = {
|
|
41
42
|
key: 1,
|
|
42
43
|
class: "property-name-additional-properties text-c-1! border-0! p-0! before:hidden!"
|
|
43
|
-
},
|
|
44
|
+
}, We = ["id"], Ge = {
|
|
44
45
|
key: 0,
|
|
45
46
|
class: "property-name-pattern-properties text-c-1! border-0! p-0! before:hidden!"
|
|
46
|
-
},
|
|
47
|
+
}, Ke = {
|
|
47
48
|
key: 1,
|
|
48
49
|
class: "property-name-additional-properties text-c-1! border-0! p-0! before:hidden!"
|
|
49
|
-
},
|
|
50
|
+
}, qe = {
|
|
50
51
|
key: 2,
|
|
51
52
|
class: "property-description mt-1! has-[+.property-rule]:mb-1.5!"
|
|
52
|
-
},
|
|
53
|
-
key:
|
|
53
|
+
}, Je = {
|
|
54
|
+
key: 3,
|
|
55
|
+
class: "mt-1 flex flex-wrap items-start gap-x-2 empty:hidden"
|
|
56
|
+
}, Ye = ["id"], Xe = {
|
|
57
|
+
key: 8,
|
|
54
58
|
class: "children [.property-description+&]:mt-1.5!"
|
|
55
|
-
},
|
|
59
|
+
}, Ze = Object.freeze({}), w = /*@__PURE__*/ m({
|
|
56
60
|
__name: "SchemaProperty",
|
|
57
61
|
props: {
|
|
58
62
|
is: {},
|
|
@@ -78,6 +82,7 @@ var ze = ["id"], Be = {
|
|
|
78
82
|
default: !1
|
|
79
83
|
},
|
|
80
84
|
hideHeading: { type: Boolean },
|
|
85
|
+
model: {},
|
|
81
86
|
modelName: {},
|
|
82
87
|
variant: {},
|
|
83
88
|
breadcrumb: {},
|
|
@@ -93,109 +98,120 @@ var ze = ["id"], Be = {
|
|
|
93
98
|
specificationExtension: {},
|
|
94
99
|
expansion: {}
|
|
95
100
|
},
|
|
96
|
-
setup(
|
|
97
|
-
let
|
|
101
|
+
setup(m) {
|
|
102
|
+
let w = m, Qe = [
|
|
98
103
|
"oneOf",
|
|
99
104
|
"anyOf",
|
|
100
105
|
"allOf"
|
|
101
|
-
],
|
|
102
|
-
let { name: e } =
|
|
103
|
-
return !!e && !!t?.allOf &&
|
|
104
|
-
}),
|
|
105
|
-
let e =
|
|
106
|
-
return
|
|
107
|
-
}),
|
|
108
|
-
let e =
|
|
109
|
-
if (!e || !
|
|
110
|
-
let t =
|
|
106
|
+
], T = l(() => ae(c(i(me(w.schema))), w.name)), E = l(() => {
|
|
107
|
+
let { name: e } = w, t = T.value;
|
|
108
|
+
return !!e && !!t?.allOf && oe(t).segments.some((e) => e.kind === "object" && s(e.schema));
|
|
109
|
+
}), D = l(() => w.breadcrumb ? w.name ? [...w.breadcrumb, w.name] : w.breadcrumb : void 0), O = l(() => w.compositionPathSegment ? [...w.compositionPath ?? [], w.compositionPathSegment] : w.compositionPath ?? []), $e = l(() => [...O.value, "items"]), et = l(() => {
|
|
110
|
+
let e = w.options.linkablePropertyPath, t = D.value;
|
|
111
|
+
return w.level <= 2 || !!(e && t && e.length === t.length && e.every((e, n) => e === t[n]));
|
|
112
|
+
}), tt = l(() => et.value && (D.value?.length ?? 0) > 0), k = l(() => {
|
|
113
|
+
let e = T.value;
|
|
114
|
+
if (!e || !C(e) || !ze(e.items)) return e;
|
|
115
|
+
let t = i(e.items);
|
|
111
116
|
return t === e.items ? e : {
|
|
112
117
|
...e,
|
|
113
118
|
items: t
|
|
114
119
|
};
|
|
115
|
-
}),
|
|
116
|
-
let e =
|
|
117
|
-
if (!e || !("properties" in e || "additionalProperties" in e) || "allOf" in e || !(
|
|
120
|
+
}), nt = l(() => o(k.value)), rt = l(() => ot.value.length > 0), it = l(() => T.value ? te(T.value, w.options.document) : null), at = l(() => {
|
|
121
|
+
let e = T.value;
|
|
122
|
+
if (!e || !("properties" in e || "additionalProperties" in e) || "allOf" in e || !(w.schema && typeof w.schema == "object" && "allOf" in w.schema) && it.value) return !1;
|
|
118
123
|
let t = "type" in e ? e.type : void 0, n = typeof t == "string" && t !== "object";
|
|
119
|
-
return
|
|
120
|
-
}), A =
|
|
121
|
-
let e =
|
|
122
|
-
return !e || !
|
|
123
|
-
}),
|
|
124
|
-
let e =
|
|
124
|
+
return s(e) || !n;
|
|
125
|
+
}), A = l(() => {
|
|
126
|
+
let e = T.value;
|
|
127
|
+
return !e || !C(e) || e.items === void 0 ? !1 : nt.value;
|
|
128
|
+
}), ot = l(() => a(T.value)), st = l(() => {
|
|
129
|
+
let e = ne(T.value);
|
|
125
130
|
return e ? I(e) : null;
|
|
126
|
-
}), j =
|
|
127
|
-
let e =
|
|
131
|
+
}), j = l(() => de(T.value, w.description)), ct = l(() => {
|
|
132
|
+
let e = T.value;
|
|
128
133
|
if (!e) return e;
|
|
129
|
-
let { oneOf: t, anyOf: n, allOf:
|
|
130
|
-
if (j.value && "description" in
|
|
131
|
-
let { description: e, ...t } =
|
|
134
|
+
let { oneOf: t, anyOf: n, allOf: r, not: i, discriminator: ee, externalDocs: te, ...a } = e;
|
|
135
|
+
if (j.value && "description" in a) {
|
|
136
|
+
let { description: e, ...t } = a;
|
|
132
137
|
return t;
|
|
133
138
|
}
|
|
134
|
-
return
|
|
135
|
-
}), M =
|
|
136
|
-
...
|
|
137
|
-
...
|
|
138
|
-
} :
|
|
139
|
-
let e =
|
|
139
|
+
return a;
|
|
140
|
+
}), M = l(() => fe(T.value, w.name, w.required)), lt = l(() => B.value || E.value ? [] : ee(T.value, w.options.document, it.value)), ut = l(() => w.extensionSource ? {
|
|
141
|
+
...w.extensionSource,
|
|
142
|
+
...T.value
|
|
143
|
+
} : T.value), dt = l(() => {
|
|
144
|
+
let e = ut.value;
|
|
140
145
|
if (!e || typeof e != "object") return !1;
|
|
141
146
|
for (let t in e) if (t.startsWith("x-")) return !0;
|
|
142
147
|
return !1;
|
|
143
|
-
}),
|
|
144
|
-
let e =
|
|
145
|
-
if (!e || !
|
|
146
|
-
let t =
|
|
147
|
-
return
|
|
148
|
-
}),
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
148
|
+
}), ft = (e) => e === "allOf" ? w.schema?.discriminator ?? w.discriminator : w.schema?.discriminator, N = l(() => {
|
|
149
|
+
let e = k.value;
|
|
150
|
+
if (!e || !C(e) || e.items === void 0) return;
|
|
151
|
+
let t = S.schema(e.items);
|
|
152
|
+
return Qe.some((e) => Array.isArray(t?.[e]) && t[e]?.length === 1) ? c(t) : t;
|
|
153
|
+
}), pt = (e, t) => {
|
|
154
|
+
if (!e || !C(e) || o(e)) return [];
|
|
155
|
+
let n = [], r = t ?? S.schema(e.items);
|
|
156
|
+
for (; r && (n.push(r.externalDocs), C(r) && !o(r));) r = S.schema(r.items);
|
|
157
|
+
return n;
|
|
158
|
+
}, mt = l(() => {
|
|
159
|
+
if (E.value) return;
|
|
160
|
+
let e = pt(k.value, N.value);
|
|
161
|
+
if (!e.some(Boolean)) return;
|
|
162
|
+
let t = lt.value.find(({ composition: e }) => e === "allOf")?.value, [n] = oe(t).segments, r = n?.kind === "object" ? n.schema : void 0, i = r && !s(r) ? pt(r) : [];
|
|
163
|
+
return e.filter((e, t) => e !== void 0 && !Be(e, i[t]));
|
|
164
|
+
}), ht = l(() => {
|
|
165
|
+
let e = T.value;
|
|
166
|
+
if (e && C(e)) return ce(e.items);
|
|
167
|
+
}), P = l(() => ({
|
|
168
|
+
compact: w.compact,
|
|
169
|
+
eventBus: w.eventBus,
|
|
154
170
|
hideModelNames: L.value,
|
|
155
|
-
level:
|
|
156
|
-
name:
|
|
157
|
-
options:
|
|
158
|
-
schemaContext:
|
|
159
|
-
})),
|
|
171
|
+
level: w.level + 1,
|
|
172
|
+
name: w.name,
|
|
173
|
+
options: w.options,
|
|
174
|
+
schemaContext: w.schemaContext
|
|
175
|
+
})), gt = l(() => at.value ? {
|
|
160
176
|
...P.value,
|
|
161
|
-
breadcrumb:
|
|
162
|
-
compositionPath:
|
|
163
|
-
cycleKey:
|
|
164
|
-
schema:
|
|
165
|
-
discriminator:
|
|
166
|
-
} : null),
|
|
177
|
+
breadcrumb: D.value,
|
|
178
|
+
compositionPath: O.value,
|
|
179
|
+
cycleKey: w.cycleKey,
|
|
180
|
+
schema: ct.value,
|
|
181
|
+
discriminator: T.value?.discriminator ?? w.discriminator
|
|
182
|
+
} : null), _t = l(() => A.value && N.value ? {
|
|
167
183
|
...P.value,
|
|
168
|
-
compositionPath:
|
|
169
|
-
cycleKey:
|
|
170
|
-
schema:
|
|
171
|
-
} : null), F =
|
|
172
|
-
let { cycleKey: e } =
|
|
173
|
-
return
|
|
184
|
+
compositionPath: $e.value,
|
|
185
|
+
cycleKey: ht.value,
|
|
186
|
+
schema: S.schema(N.value)
|
|
187
|
+
} : null), F = l(() => {
|
|
188
|
+
let { cycleKey: e } = w;
|
|
189
|
+
return E.value ? {
|
|
174
190
|
...P.value,
|
|
175
|
-
breadcrumb:
|
|
176
|
-
compositionPath:
|
|
191
|
+
breadcrumb: D.value,
|
|
192
|
+
compositionPath: O.value,
|
|
177
193
|
cycleKey: e,
|
|
178
|
-
schema:
|
|
179
|
-
} :
|
|
180
|
-
}),
|
|
194
|
+
schema: T.value
|
|
195
|
+
} : gt.value ?? _t.value;
|
|
196
|
+
}), vt = l(() => !gt.value && !!_t.value), yt = l(() => w.name === w.discriminator?.propertyName ? w.discriminator?.[r]?.value : void 0), bt = l(() => !!(w.name && w.discriminator?.propertyName === w.name)), { translate: I } = he(), xt = Ie(w, "model"), St = l(() => xt.value?.label ?? w.modelName ?? null), L = l(() => w.hideModelNames || !!w.options.hideModelNames), R = l(() => E.value || at.value || A.value), Ct = De(se, void 0), z = l(() => vt.value ? ht.value : w.cycleKey), B = l(() => z.value != null && !!Ct?.has(z.value)), wt = l(() => {
|
|
181
197
|
let e = z.value;
|
|
182
198
|
if (typeof e == "string") {
|
|
183
|
-
let t =
|
|
199
|
+
let t = re(e);
|
|
184
200
|
if (t) return t;
|
|
185
201
|
}
|
|
186
|
-
return
|
|
187
|
-
}), V =
|
|
202
|
+
return St.value || w.name || I("schema.schema");
|
|
203
|
+
}), V = w.expansion ?? ue(Ie(() => w.scrollTargetId ?? "")), Tt = v(), H = l(() => le(D.value) || `~anonymous-${Tt}`), U = l(() => R.value && !w.noncollapsible && M.value && !B.value), W = l(() => R.value && !!w.noncollapsible && !!w.name && M.value && !B.value), G = l(() => U.value && V.isExpanded(H.value, {
|
|
188
204
|
cyclic: B.value,
|
|
189
|
-
defaultOpen: !!
|
|
190
|
-
})), K =
|
|
191
|
-
|
|
192
|
-
e ? K.value &&= (V.untilFound.release(), !1) : t && (K.value =
|
|
193
|
-
}),
|
|
205
|
+
defaultOpen: !!w.options.expandAllSchemaProperties
|
|
206
|
+
})), K = je(!1);
|
|
207
|
+
y(G, (e, t) => {
|
|
208
|
+
e ? K.value &&= (V.untilFound.release(), !1) : t && (K.value = Et() && V.untilFound.acquire());
|
|
209
|
+
}), Ae(() => {
|
|
194
210
|
K.value &&= (V.untilFound.release(), !1);
|
|
195
211
|
});
|
|
196
|
-
let
|
|
212
|
+
let Et = () => typeof document < "u" && "onbeforematch" in document.body, Dt = l(() => W.value || U.value && (G.value || K.value)), Ot = l(() => W.value || G.value ? void 0 : "until-found"), kt = l(() => R.value && !B.value && !U.value && !W.value), At = v(), q = v(), jt = v(), Mt = Le("treePanel"), J = Le("treeToggle"), Y = null, X = () => {
|
|
197
213
|
Y?.removeAttribute("data-heading-hovered"), Y = null;
|
|
198
|
-
},
|
|
214
|
+
}, Nt = {
|
|
199
215
|
pointerenter: (e) => {
|
|
200
216
|
X();
|
|
201
217
|
let t = e.currentTarget instanceof HTMLElement ? e.currentTarget.parentElement : null;
|
|
@@ -203,54 +219,54 @@ var ze = ["id"], Be = {
|
|
|
203
219
|
},
|
|
204
220
|
pointerleave: X
|
|
205
221
|
};
|
|
206
|
-
|
|
222
|
+
y(U, (e) => {
|
|
207
223
|
e || X();
|
|
208
|
-
}),
|
|
224
|
+
}), ke(X), y(G, (e) => {
|
|
209
225
|
if (e) return;
|
|
210
|
-
let t =
|
|
226
|
+
let t = Mt.value?.$el;
|
|
211
227
|
t?.removeAttribute("data-rail-hovered"), t?.parentElement?.removeAttribute("data-child-rail-hovered");
|
|
212
228
|
});
|
|
213
|
-
let Z =
|
|
229
|
+
let Z = l(() => vt.value ? N.value : ct.value), Pt = l(() => Z.value ? pe(Z.value, void 0, w.options) : []), Q = l(() => {
|
|
214
230
|
if (!R.value) return null;
|
|
215
231
|
let e = Z.value;
|
|
216
232
|
if (!e) return null;
|
|
217
|
-
let t =
|
|
218
|
-
return
|
|
219
|
-
}),
|
|
233
|
+
let t = w.options.hideReadOnly || w.options.hideWriteOnly ? Pt.value.length : s(e) && e.properties ? Object.keys(e.properties).length : 0, n = "patternProperties" in e && e.patternProperties ? Object.keys(e.patternProperties).length : 0, r = "additionalProperties" in e && e.additionalProperties ? 1 : 0, i = t + n + r;
|
|
234
|
+
return i === 0 ? null : I("schema.propertyCount", { count: String(i) });
|
|
235
|
+
}), Ft = l(() => ie(T.value, { hideModelNames: L.value })), It = l(() => St.value || I("schema.schema")), $ = () => {
|
|
220
236
|
let e = !G.value;
|
|
221
237
|
if (!e) {
|
|
222
238
|
let e = document.activeElement, t = J.value instanceof HTMLElement ? J.value : J.value?.$el;
|
|
223
|
-
e &&
|
|
239
|
+
e && Mt.value?.$el.contains(e) && t?.focus();
|
|
224
240
|
}
|
|
225
241
|
V.setExpanded(H.value, e);
|
|
226
|
-
},
|
|
242
|
+
}, Lt = (e) => {
|
|
227
243
|
if (!U.value) return;
|
|
228
244
|
let t = e.target;
|
|
229
245
|
t instanceof Element && t.closest("a, button, [role=\"button\"], input, select, label") || window.getSelection()?.toString() || $();
|
|
230
|
-
},
|
|
246
|
+
}, Rt = () => {
|
|
231
247
|
V.setExpanded(H.value, !0);
|
|
232
248
|
};
|
|
233
|
-
return (
|
|
234
|
-
`property--level-${
|
|
249
|
+
return (r, i) => (g(), u(Ne(m.is ?? "li"), { class: Oe(["property", [
|
|
250
|
+
`property--level-${m.level}`,
|
|
235
251
|
{
|
|
236
|
-
"property--compact":
|
|
237
|
-
"property--deprecated":
|
|
252
|
+
"property--compact": m.compact,
|
|
253
|
+
"property--deprecated": T.value?.deprecated
|
|
238
254
|
},
|
|
239
255
|
"property--tree grid! grid-cols-[minmax(0,1fr)] border-b-0! px-0! py-[var(--schema-row-pad,6px)]!",
|
|
240
256
|
{ "property--tree-container": !U.value && !B.value && (R.value || !M.value) },
|
|
241
|
-
`property--depth-${
|
|
257
|
+
`property--depth-${m.depth}`
|
|
242
258
|
]]) }, {
|
|
243
|
-
default:
|
|
244
|
-
U.value ? (
|
|
259
|
+
default: b(() => [
|
|
260
|
+
U.value ? (g(), u(be, {
|
|
245
261
|
key: 0,
|
|
246
262
|
ref: "treeToggle",
|
|
247
263
|
class: "absolute start-[calc(0px_-_var(--schema-toggle-half,12px)_-_var(--schema-gutter,16px))] top-2.5 z-[1] col-start-1 row-start-1 -translate-y-1/2 print:hidden",
|
|
248
|
-
countId: Q.value ? _(
|
|
249
|
-
fallbackLabel:
|
|
250
|
-
nameId:
|
|
264
|
+
countId: Q.value ? _(jt) : void 0,
|
|
265
|
+
fallbackLabel: It.value,
|
|
266
|
+
nameId: m.name ? _(q) : void 0,
|
|
251
267
|
open: G.value,
|
|
252
|
-
panelId: _(
|
|
253
|
-
panelRendered:
|
|
268
|
+
panelId: _(At),
|
|
269
|
+
panelRendered: Dt.value,
|
|
254
270
|
onToggle: $
|
|
255
271
|
}, null, 8, [
|
|
256
272
|
"countId",
|
|
@@ -259,82 +275,83 @@ var ze = ["id"], Be = {
|
|
|
259
275
|
"open",
|
|
260
276
|
"panelId",
|
|
261
277
|
"panelRendered"
|
|
262
|
-
])) :
|
|
263
|
-
M.value ? (
|
|
278
|
+
])) : d("", !0),
|
|
279
|
+
M.value ? (g(), u(xe, h({
|
|
264
280
|
key: 1,
|
|
265
|
-
badges:
|
|
281
|
+
badges: m.badges,
|
|
266
282
|
class: ["group", [{ "cursor-pointer": U.value }, "relative row-start-1 min-h-5 content-center [&>*:has(+.copy-link-trailing)]:me-0!"]],
|
|
267
|
-
discriminatorValue:
|
|
268
|
-
enum:
|
|
269
|
-
eventBus:
|
|
283
|
+
discriminatorValue: yt.value,
|
|
284
|
+
enum: rt.value,
|
|
285
|
+
eventBus: m.eventBus,
|
|
270
286
|
hideModelNames: L.value,
|
|
271
|
-
isDiscriminator:
|
|
272
|
-
keyKind:
|
|
287
|
+
isDiscriminator: bt.value,
|
|
288
|
+
keyKind: m.variant === "additionalProperties" ? "additional" : m.variant === "patternProperties" ? "pattern" : void 0,
|
|
289
|
+
model: xt.value,
|
|
273
290
|
modelLinkOptions: {
|
|
274
|
-
hideModels:
|
|
275
|
-
document:
|
|
291
|
+
hideModels: m.options.hideModels,
|
|
292
|
+
document: m.options.document
|
|
276
293
|
},
|
|
277
|
-
modelName:
|
|
278
|
-
propertyNames:
|
|
279
|
-
recursiveTo: B.value ?
|
|
280
|
-
required:
|
|
281
|
-
value:
|
|
282
|
-
}, Fe(U.value ?
|
|
283
|
-
|
|
294
|
+
modelName: m.modelName,
|
|
295
|
+
propertyNames: m.propertyNamesSchema,
|
|
296
|
+
recursiveTo: B.value ? wt.value : void 0,
|
|
297
|
+
required: m.required,
|
|
298
|
+
value: T.value
|
|
299
|
+
}, Fe(U.value ? Nt : _(Ze)), { onClick: Lt }), Te({ _: 2 }, [
|
|
300
|
+
m.name ? {
|
|
284
301
|
name: "name",
|
|
285
|
-
fn:
|
|
302
|
+
fn: b(() => [tt.value ? (g(), u(n, {
|
|
286
303
|
key: 0,
|
|
287
|
-
breadcrumb:
|
|
304
|
+
breadcrumb: D.value
|
|
288
305
|
}, {
|
|
289
|
-
default:
|
|
306
|
+
default: b(() => [we("span", { id: _(q) }, [m.variant === "patternProperties" ? (g(), f("span", He, [p(_(x), {
|
|
290
307
|
preset: "property",
|
|
291
|
-
text:
|
|
292
|
-
}, null, 8, ["text"])])) :
|
|
308
|
+
text: m.name
|
|
309
|
+
}, null, 8, ["text"])])) : m.variant === "additionalProperties" ? (g(), f("span", Ue, [p(_(x), {
|
|
293
310
|
preset: "property",
|
|
294
|
-
text:
|
|
295
|
-
}, null, 8, ["text"])])) : (
|
|
311
|
+
text: m.name
|
|
312
|
+
}, null, 8, ["text"])])) : (g(), u(_(x), {
|
|
296
313
|
key: 2,
|
|
297
314
|
preset: "property",
|
|
298
|
-
text:
|
|
299
|
-
}, null, 8, ["text"]))], 8,
|
|
315
|
+
text: m.name
|
|
316
|
+
}, null, 8, ["text"]))], 8, Ve)]),
|
|
300
317
|
_: 1
|
|
301
|
-
}, 8, ["breadcrumb"])) : (
|
|
318
|
+
}, 8, ["breadcrumb"])) : (g(), f("span", {
|
|
302
319
|
key: 1,
|
|
303
320
|
id: _(q)
|
|
304
|
-
}, [
|
|
321
|
+
}, [m.variant === "patternProperties" ? (g(), f("span", Ge, [p(_(x), {
|
|
305
322
|
preset: "property",
|
|
306
|
-
text:
|
|
307
|
-
}, null, 8, ["text"])])) :
|
|
323
|
+
text: m.name
|
|
324
|
+
}, null, 8, ["text"])])) : m.variant === "additionalProperties" ? (g(), f("span", Ke, [p(_(x), {
|
|
308
325
|
preset: "property",
|
|
309
|
-
text:
|
|
310
|
-
}, null, 8, ["text"])])) : (
|
|
326
|
+
text: m.name
|
|
327
|
+
}, null, 8, ["text"])])) : (g(), u(_(x), {
|
|
311
328
|
key: 2,
|
|
312
329
|
preset: "property",
|
|
313
|
-
text:
|
|
314
|
-
}, null, 8, ["text"]))], 8,
|
|
330
|
+
text: m.name
|
|
331
|
+
}, null, 8, ["text"]))], 8, We))]),
|
|
315
332
|
key: "0"
|
|
316
333
|
} : void 0,
|
|
317
|
-
|
|
334
|
+
T.value?.example === void 0 ? void 0 : {
|
|
318
335
|
name: "example",
|
|
319
|
-
fn:
|
|
336
|
+
fn: b(() => [Ee(" Example: " + Pe(T.value.example), 1)]),
|
|
320
337
|
key: "1"
|
|
321
338
|
},
|
|
322
339
|
U.value && !G.value ? {
|
|
323
340
|
name: "preview",
|
|
324
|
-
fn:
|
|
341
|
+
fn: b(() => [p(_e, {
|
|
325
342
|
"aria-hidden": "true",
|
|
326
343
|
class: "mr-0!",
|
|
327
|
-
propertyNames:
|
|
344
|
+
propertyNames: Pt.value,
|
|
328
345
|
schema: Z.value
|
|
329
346
|
}, null, 8, ["propertyNames", "schema"])]),
|
|
330
347
|
key: "2"
|
|
331
348
|
} : void 0,
|
|
332
|
-
|
|
349
|
+
m.name && et.value && D.value ? {
|
|
333
350
|
name: "trailing",
|
|
334
|
-
fn:
|
|
335
|
-
anchorId:
|
|
336
|
-
eventBus:
|
|
337
|
-
propertyName:
|
|
351
|
+
fn: b(() => [p(t, {
|
|
352
|
+
anchorId: D.value.join("."),
|
|
353
|
+
eventBus: m.eventBus,
|
|
354
|
+
propertyName: m.name
|
|
338
355
|
}, null, 8, [
|
|
339
356
|
"anchorId",
|
|
340
357
|
"eventBus",
|
|
@@ -351,94 +368,99 @@ var ze = ["id"], Be = {
|
|
|
351
368
|
"hideModelNames",
|
|
352
369
|
"isDiscriminator",
|
|
353
370
|
"keyKind",
|
|
371
|
+
"model",
|
|
354
372
|
"modelLinkOptions",
|
|
355
373
|
"modelName",
|
|
356
374
|
"propertyNames",
|
|
357
375
|
"recursiveTo",
|
|
358
376
|
"required",
|
|
359
377
|
"value"
|
|
360
|
-
])) :
|
|
361
|
-
f(
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
it.value.length > 0 && !A.value && !kt.value ? (h(), l(be, {
|
|
378
|
+
])) : d("", !0),
|
|
379
|
+
j.value || st.value ? (g(), f("div", qe, [p(_(Re), { value: j.value || st.value || "" }, null, 8, ["value"])])) : d("", !0),
|
|
380
|
+
T.value?.externalDocs || mt.value?.length ? (g(), f("div", Je, [p(e, {
|
|
381
|
+
inline: "",
|
|
382
|
+
value: T.value?.externalDocs
|
|
383
|
+
}, null, 8, ["value"]), (g(!0), f(Ce, null, Me(mt.value, (t, n) => (g(), u(e, {
|
|
384
|
+
key: n,
|
|
385
|
+
inline: "",
|
|
386
|
+
value: t
|
|
387
|
+
}, null, 8, ["value"]))), 128))])) : d("", !0),
|
|
388
|
+
m.propertyNamesEnum && m.propertyNamesEnum.length > 0 ? (g(), u(ye, {
|
|
372
389
|
key: 4,
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
390
|
+
propertyNames: "",
|
|
391
|
+
value: { enum: m.propertyNamesEnum }
|
|
392
|
+
}, null, 8, ["value"])) : d("", !0),
|
|
393
|
+
ot.value.length > 0 && !A.value && !Ft.value ? (g(), u(ye, {
|
|
376
394
|
key: 5,
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
xt.value ? (h(), l(Ce, {
|
|
395
|
+
value: T.value
|
|
396
|
+
}, null, 8, ["value"])) : d("", !0),
|
|
397
|
+
U.value && Q.value ? (g(), f("span", {
|
|
381
398
|
key: 6,
|
|
382
|
-
id: _(
|
|
399
|
+
id: _(jt),
|
|
400
|
+
class: "screenreader-only"
|
|
401
|
+
}, Pe(Q.value), 9, Ye)) : d("", !0),
|
|
402
|
+
Dt.value ? (g(), u(Se, {
|
|
403
|
+
key: 7,
|
|
404
|
+
id: _(At),
|
|
383
405
|
ref: "treePanel",
|
|
384
406
|
class: "property-children mt-1.5 mb-0.5 [&_.schema-card]:mb-0! [&_.schema-card]:pb-0! [&_.schema-properties]:mb-0! [&_.schema-properties]:pb-0! [&_ul]:my-0! [&_ul]:py-0! [&[hidden=until-found]]:my-0 [&[hidden=until-found]]:border-s-0 [&[hidden]:not([hidden=until-found])]:hidden",
|
|
385
407
|
closeOnRail: U.value,
|
|
386
|
-
depth:
|
|
387
|
-
hidden:
|
|
388
|
-
onBeforematch:
|
|
408
|
+
depth: m.depth + 1,
|
|
409
|
+
hidden: Ot.value,
|
|
410
|
+
onBeforematch: Rt,
|
|
389
411
|
onClose: $
|
|
390
412
|
}, {
|
|
391
|
-
default:
|
|
392
|
-
depth:
|
|
413
|
+
default: b(() => [F.value ? (g(), u(ge, h({ key: 0 }, F.value, {
|
|
414
|
+
depth: m.depth + 1,
|
|
393
415
|
expansion: _(V),
|
|
394
416
|
noncollapsible: "",
|
|
395
|
-
scrollTargetId:
|
|
396
|
-
specificationExtension:
|
|
417
|
+
scrollTargetId: m.scrollTargetId,
|
|
418
|
+
specificationExtension: m.specificationExtension
|
|
397
419
|
}), null, 16, [
|
|
398
420
|
"depth",
|
|
399
421
|
"expansion",
|
|
400
422
|
"scrollTargetId",
|
|
401
423
|
"specificationExtension"
|
|
402
|
-
])) :
|
|
424
|
+
])) : d("", !0)]),
|
|
403
425
|
_: 1
|
|
404
426
|
}, 8, [
|
|
405
427
|
"id",
|
|
406
428
|
"closeOnRail",
|
|
407
429
|
"depth",
|
|
408
430
|
"hidden"
|
|
409
|
-
])) :
|
|
410
|
-
|
|
411
|
-
depth:
|
|
431
|
+
])) : d("", !0),
|
|
432
|
+
kt.value ? (g(), f("div", Xe, [F.value ? (g(), u(ge, h({ key: 0 }, F.value, {
|
|
433
|
+
depth: m.depth,
|
|
412
434
|
expansion: _(V),
|
|
413
435
|
noncollapsible: "",
|
|
414
|
-
scrollTargetId:
|
|
415
|
-
specificationExtension:
|
|
436
|
+
scrollTargetId: m.scrollTargetId,
|
|
437
|
+
specificationExtension: m.specificationExtension
|
|
416
438
|
}), null, 16, [
|
|
417
439
|
"depth",
|
|
418
440
|
"expansion",
|
|
419
441
|
"scrollTargetId",
|
|
420
442
|
"specificationExtension"
|
|
421
|
-
])) :
|
|
422
|
-
(
|
|
443
|
+
])) : d("", !0)])) : d("", !0),
|
|
444
|
+
(g(!0), f(Ce, null, Me(lt.value, (e) => (g(), u(ve, {
|
|
423
445
|
key: e.composition,
|
|
424
|
-
breadcrumb:
|
|
425
|
-
compact:
|
|
446
|
+
breadcrumb: D.value,
|
|
447
|
+
compact: m.compact,
|
|
426
448
|
composition: e.composition,
|
|
427
|
-
compositionPath:
|
|
428
|
-
depth:
|
|
429
|
-
discriminator:
|
|
430
|
-
eventBus:
|
|
449
|
+
compositionPath: O.value,
|
|
450
|
+
depth: m.depth,
|
|
451
|
+
discriminator: ft(e.composition),
|
|
452
|
+
eventBus: m.eventBus,
|
|
431
453
|
expansion: _(V),
|
|
432
|
-
hideHeading:
|
|
454
|
+
hideHeading: m.hideHeading,
|
|
433
455
|
hideModelNames: L.value,
|
|
434
|
-
level:
|
|
435
|
-
name:
|
|
436
|
-
noncollapsible:
|
|
437
|
-
options:
|
|
456
|
+
level: m.level,
|
|
457
|
+
name: m.name,
|
|
458
|
+
noncollapsible: m.noncollapsible,
|
|
459
|
+
options: m.options,
|
|
438
460
|
schema: e.value,
|
|
439
|
-
schemaContext:
|
|
440
|
-
scrollTargetId:
|
|
441
|
-
specificationExtension:
|
|
461
|
+
schemaContext: m.schemaContext,
|
|
462
|
+
scrollTargetId: m.scrollTargetId,
|
|
463
|
+
specificationExtension: m.specificationExtension
|
|
442
464
|
}, null, 8, [
|
|
443
465
|
"breadcrumb",
|
|
444
466
|
"compact",
|
|
@@ -459,16 +481,16 @@ var ze = ["id"], Be = {
|
|
|
459
481
|
"scrollTargetId",
|
|
460
482
|
"specificationExtension"
|
|
461
483
|
]))), 128)),
|
|
462
|
-
|
|
463
|
-
key:
|
|
464
|
-
showExtensions:
|
|
465
|
-
value:
|
|
466
|
-
}, null, 8, ["showExtensions", "value"])) :
|
|
484
|
+
dt.value && m.specificationExtension ? (g(), u(Ne(m.specificationExtension), {
|
|
485
|
+
key: 9,
|
|
486
|
+
showExtensions: m.options.showExtensions,
|
|
487
|
+
value: ut.value
|
|
488
|
+
}, null, 8, ["showExtensions", "value"])) : d("", !0)
|
|
467
489
|
]),
|
|
468
490
|
_: 1
|
|
469
491
|
}, 8, ["class"]));
|
|
470
492
|
}
|
|
471
493
|
});
|
|
472
|
-
export {
|
|
494
|
+
export { w as default };
|
|
473
495
|
|
|
474
496
|
//# sourceMappingURL=SchemaProperty.vue.js.map
|