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