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