@scalar/blocks 0.9.0 → 0.10.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 +18 -0
- 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-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 +93 -92
- package/dist/schema/SchemaObjectProperties.vue_vue_type_script_setup_true_lang.js.map +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_vue_type_script_setup_true_lang.js +223 -223
- package/dist/schema/SchemaProperty.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/schema/SchemaPropertyHeading.vue.js +1 -1
- package/dist/schema/SchemaPropertyHeading.vue_vue_type_script_setup_true_lang.js +4 -4
- 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/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 +27 -1
- package/dist/vue-styles.css +1 -1
- package/package.json +16 -15
|
@@ -2,57 +2,57 @@ 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: {},
|
|
@@ -92,38 +92,38 @@ var We = ["id"], Ge = {
|
|
|
92
92
|
specificationExtension: {},
|
|
93
93
|
expansion: {}
|
|
94
94
|
},
|
|
95
|
-
setup(
|
|
96
|
-
let
|
|
95
|
+
setup(p) {
|
|
96
|
+
let T = p, Ye = [
|
|
97
97
|
"oneOf",
|
|
98
98
|
"anyOf",
|
|
99
99
|
"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 ? {
|
|
100
|
+
], E = c(() => se(o(r(ge(T.schema))), T.name)), D = c(() => {
|
|
101
|
+
let { name: e } = T, t = E.value;
|
|
102
|
+
return !!e && !!t?.allOf && ce(t).segments.some((e) => e.kind === "object" && a(e.schema));
|
|
103
|
+
}), 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(() => {
|
|
104
|
+
let e = T.options.linkablePropertyPath, t = O.value;
|
|
105
|
+
return T.level <= 2 || !!(e && t && e.length === t.length && e.every((e, n) => e === t[n]));
|
|
106
|
+
}), Qe = c(() => Ze.value && (O.value?.length ?? 0) > 0), $e = c(() => {
|
|
107
|
+
let e = E.value;
|
|
108
|
+
if (!e || !w(e) || !Re(e.items)) return e;
|
|
109
|
+
let t = r(e.items);
|
|
110
|
+
return t === e.items ? e : {
|
|
111
111
|
...e,
|
|
112
112
|
items: t
|
|
113
|
-
}
|
|
114
|
-
}),
|
|
115
|
-
let e =
|
|
116
|
-
if (!e || !("properties" in e || "additionalProperties" in e) || "allOf" in e || !(
|
|
113
|
+
};
|
|
114
|
+
}), et = c(() => oe($e.value)), tt = c(() => it.value.length > 0), nt = c(() => E.value ? ne(E.value, T.options.document) : null), rt = c(() => {
|
|
115
|
+
let e = E.value;
|
|
116
|
+
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
117
|
let t = "type" in e ? e.type : void 0, n = typeof t == "string" && t !== "object";
|
|
118
118
|
return a(e) || !n;
|
|
119
|
-
}), A =
|
|
120
|
-
let e =
|
|
121
|
-
return !e || !
|
|
122
|
-
}),
|
|
123
|
-
let e =
|
|
119
|
+
}), A = c(() => {
|
|
120
|
+
let e = E.value;
|
|
121
|
+
return !e || !w(e) || e.items === void 0 ? !1 : et.value;
|
|
122
|
+
}), it = c(() => i(E.value)), at = c(() => {
|
|
123
|
+
let e = re(E.value);
|
|
124
124
|
return e ? I(e) : null;
|
|
125
|
-
}), j =
|
|
126
|
-
let e =
|
|
125
|
+
}), j = c(() => pe(E.value, T.description)), ot = c(() => {
|
|
126
|
+
let e = E.value;
|
|
127
127
|
if (!e) return e;
|
|
128
128
|
let { oneOf: t, anyOf: n, allOf: ee, not: r, discriminator: te, externalDocs: ne, ...i } = e;
|
|
129
129
|
if (j.value && "description" in i) {
|
|
@@ -131,70 +131,70 @@ var We = ["id"], Ge = {
|
|
|
131
131
|
return t;
|
|
132
132
|
}
|
|
133
133
|
return i;
|
|
134
|
-
}), M =
|
|
135
|
-
...
|
|
136
|
-
...
|
|
137
|
-
} :
|
|
138
|
-
let e =
|
|
134
|
+
}), 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 ? {
|
|
135
|
+
...T.extensionSource,
|
|
136
|
+
...E.value
|
|
137
|
+
} : E.value), lt = c(() => {
|
|
138
|
+
let e = ct.value;
|
|
139
139
|
if (!e || typeof e != "object") return !1;
|
|
140
140
|
for (let t in e) if (t.startsWith("x-")) return !0;
|
|
141
141
|
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:
|
|
142
|
+
}), ut = (e) => e === "allOf" ? T.schema?.discriminator ?? T.discriminator : T.schema?.discriminator, N = c(() => {
|
|
143
|
+
let e = $e.value;
|
|
144
|
+
if (!e || !w(e) || e.items === void 0) return;
|
|
145
|
+
let t = C.schema(e.items);
|
|
146
|
+
return Ye.some((e) => Array.isArray(t?.[e]) && t[e]?.length === 1) ? o(t) : t;
|
|
147
|
+
}), dt = c(() => {
|
|
148
|
+
let e = E.value;
|
|
149
|
+
if (e && w(e)) return ue(e.items);
|
|
150
|
+
}), P = c(() => ({
|
|
151
|
+
compact: T.compact,
|
|
152
|
+
eventBus: T.eventBus,
|
|
153
153
|
hideModelNames: L.value,
|
|
154
|
-
level:
|
|
155
|
-
name:
|
|
156
|
-
options:
|
|
157
|
-
schemaContext:
|
|
158
|
-
})),
|
|
154
|
+
level: T.level + 1,
|
|
155
|
+
name: T.name,
|
|
156
|
+
options: T.options,
|
|
157
|
+
schemaContext: T.schemaContext
|
|
158
|
+
})), ft = c(() => rt.value ? {
|
|
159
159
|
...P.value,
|
|
160
|
-
breadcrumb:
|
|
161
|
-
compositionPath:
|
|
162
|
-
cycleKey:
|
|
163
|
-
schema:
|
|
164
|
-
discriminator:
|
|
165
|
-
} : null),
|
|
160
|
+
breadcrumb: O.value,
|
|
161
|
+
compositionPath: k.value,
|
|
162
|
+
cycleKey: T.cycleKey,
|
|
163
|
+
schema: ot.value,
|
|
164
|
+
discriminator: E.value?.discriminator ?? T.discriminator
|
|
165
|
+
} : null), pt = c(() => A.value && N.value ? {
|
|
166
166
|
...P.value,
|
|
167
|
-
compositionPath:
|
|
168
|
-
cycleKey:
|
|
169
|
-
schema:
|
|
170
|
-
} : null), F =
|
|
171
|
-
let { cycleKey: e } =
|
|
172
|
-
return
|
|
167
|
+
compositionPath: Xe.value,
|
|
168
|
+
cycleKey: dt.value,
|
|
169
|
+
schema: C.schema(N.value)
|
|
170
|
+
} : null), F = c(() => {
|
|
171
|
+
let { cycleKey: e } = T;
|
|
172
|
+
return D.value ? {
|
|
173
173
|
...P.value,
|
|
174
|
-
breadcrumb:
|
|
175
|
-
compositionPath:
|
|
174
|
+
breadcrumb: O.value,
|
|
175
|
+
compositionPath: k.value,
|
|
176
176
|
cycleKey: e,
|
|
177
|
-
schema:
|
|
178
|
-
} :
|
|
179
|
-
}),
|
|
177
|
+
schema: E.value
|
|
178
|
+
} : ft.value ?? pt.value;
|
|
179
|
+
}), 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
180
|
let e = z.value;
|
|
181
181
|
if (typeof e == "string") {
|
|
182
|
-
let t =
|
|
182
|
+
let t = ie(e);
|
|
183
183
|
if (t) return t;
|
|
184
184
|
}
|
|
185
|
-
return
|
|
186
|
-
}), V =
|
|
185
|
+
return T.modelName || T.name || I("schema.schema");
|
|
186
|
+
}), 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
187
|
cyclic: B.value,
|
|
188
|
-
defaultOpen: !!
|
|
189
|
-
})), K =
|
|
190
|
-
|
|
191
|
-
e ? K.value &&= (V.untilFound.release(), !1) : t && (K.value =
|
|
192
|
-
}),
|
|
188
|
+
defaultOpen: !!T.options.expandAllSchemaProperties
|
|
189
|
+
})), K = Me(!1);
|
|
190
|
+
b(G, (e, t) => {
|
|
191
|
+
e ? K.value &&= (V.untilFound.release(), !1) : t && (K.value = bt() && V.untilFound.acquire());
|
|
192
|
+
}), je(() => {
|
|
193
193
|
K.value &&= (V.untilFound.release(), !1);
|
|
194
194
|
});
|
|
195
|
-
let
|
|
195
|
+
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
196
|
Y?.removeAttribute("data-heading-hovered"), Y = null;
|
|
197
|
-
},
|
|
197
|
+
}, Dt = {
|
|
198
198
|
pointerenter: (e) => {
|
|
199
199
|
X();
|
|
200
200
|
let t = e.currentTarget instanceof HTMLElement ? e.currentTarget.parentElement : null;
|
|
@@ -202,54 +202,54 @@ var We = ["id"], Ge = {
|
|
|
202
202
|
},
|
|
203
203
|
pointerleave: X
|
|
204
204
|
};
|
|
205
|
-
|
|
205
|
+
b(U, (e) => {
|
|
206
206
|
e || X();
|
|
207
|
-
}),
|
|
207
|
+
}), Ae(X), b(G, (e) => {
|
|
208
208
|
if (e) return;
|
|
209
|
-
let t =
|
|
209
|
+
let t = Et.value?.$el;
|
|
210
210
|
t?.removeAttribute("data-rail-hovered"), t?.parentElement?.removeAttribute("data-child-rail-hovered");
|
|
211
211
|
});
|
|
212
|
-
let Z =
|
|
212
|
+
let Z = c(() => mt.value ? N.value : ot.value), Ot = c(() => Z.value ? he(Z.value, void 0, T.options) : []), Q = c(() => {
|
|
213
213
|
if (!R.value) return null;
|
|
214
214
|
let e = Z.value;
|
|
215
215
|
if (!e) return null;
|
|
216
|
-
let t =
|
|
216
|
+
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
217
|
return r === 0 ? null : I("schema.propertyCount", { count: String(r) });
|
|
218
|
-
}),
|
|
218
|
+
}), kt = c(() => ae(E.value, { hideModelNames: L.value })), At = c(() => T.modelName || I("schema.schema")), $ = () => {
|
|
219
219
|
let e = !G.value;
|
|
220
220
|
if (!e) {
|
|
221
221
|
let e = document.activeElement, t = J.value instanceof HTMLElement ? J.value : J.value?.$el;
|
|
222
|
-
e &&
|
|
222
|
+
e && Et.value?.$el.contains(e) && t?.focus();
|
|
223
223
|
}
|
|
224
224
|
V.setExpanded(H.value, e);
|
|
225
|
-
},
|
|
225
|
+
}, jt = (e) => {
|
|
226
226
|
if (!U.value) return;
|
|
227
227
|
let t = e.target;
|
|
228
228
|
t instanceof Element && t.closest("a, button, [role=\"button\"], input, select, label") || window.getSelection()?.toString() || $();
|
|
229
|
-
},
|
|
229
|
+
}, Mt = () => {
|
|
230
230
|
V.setExpanded(H.value, !0);
|
|
231
231
|
};
|
|
232
|
-
return (ee, r) => (
|
|
233
|
-
`property--level-${
|
|
232
|
+
return (ee, r) => (h(), l(Pe(p.is ?? "li"), { class: ke(["property", [
|
|
233
|
+
`property--level-${p.level}`,
|
|
234
234
|
{
|
|
235
|
-
"property--compact":
|
|
236
|
-
"property--deprecated":
|
|
235
|
+
"property--compact": p.compact,
|
|
236
|
+
"property--deprecated": E.value?.deprecated
|
|
237
237
|
},
|
|
238
238
|
"property--tree grid! grid-cols-[minmax(0,1fr)] border-b-0! px-0! py-[var(--schema-row-pad,6px)]!",
|
|
239
239
|
{ "property--tree-container": !U.value && !B.value && (R.value || !M.value) },
|
|
240
|
-
`property--depth-${
|
|
240
|
+
`property--depth-${p.depth}`
|
|
241
241
|
]]) }, {
|
|
242
|
-
default:
|
|
243
|
-
U.value ? (
|
|
242
|
+
default: x(() => [
|
|
243
|
+
U.value ? (h(), l(xe, {
|
|
244
244
|
key: 0,
|
|
245
245
|
ref: "treeToggle",
|
|
246
246
|
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:
|
|
247
|
+
countId: Q.value ? _(Tt) : void 0,
|
|
248
|
+
fallbackLabel: At.value,
|
|
249
|
+
nameId: p.name ? _(q) : void 0,
|
|
250
250
|
open: G.value,
|
|
251
|
-
panelId:
|
|
252
|
-
panelRendered:
|
|
251
|
+
panelId: _(wt),
|
|
252
|
+
panelRendered: xt.value,
|
|
253
253
|
onToggle: $
|
|
254
254
|
}, null, 8, [
|
|
255
255
|
"countId",
|
|
@@ -258,80 +258,80 @@ var We = ["id"], Ge = {
|
|
|
258
258
|
"open",
|
|
259
259
|
"panelId",
|
|
260
260
|
"panelRendered"
|
|
261
|
-
])) :
|
|
262
|
-
M.value ? (
|
|
261
|
+
])) : u("", !0),
|
|
262
|
+
M.value ? (h(), l(Se, m({
|
|
263
263
|
key: 1,
|
|
264
264
|
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:
|
|
265
|
+
discriminatorValue: ht.value,
|
|
266
|
+
enum: tt.value,
|
|
267
|
+
eventBus: p.eventBus,
|
|
268
268
|
hideModelNames: L.value,
|
|
269
|
-
isDiscriminator:
|
|
270
|
-
keyKind:
|
|
269
|
+
isDiscriminator: gt.value,
|
|
270
|
+
keyKind: p.variant === "additionalProperties" ? "additional" : p.variant === "patternProperties" ? "pattern" : void 0,
|
|
271
271
|
modelLinkOptions: {
|
|
272
|
-
hideModels:
|
|
273
|
-
document:
|
|
272
|
+
hideModels: p.options.hideModels,
|
|
273
|
+
document: p.options.document
|
|
274
274
|
},
|
|
275
|
-
modelName:
|
|
276
|
-
propertyNames:
|
|
277
|
-
recursiveTo: B.value ?
|
|
278
|
-
required:
|
|
279
|
-
value:
|
|
280
|
-
},
|
|
281
|
-
|
|
275
|
+
modelName: p.modelName,
|
|
276
|
+
propertyNames: p.propertyNamesSchema,
|
|
277
|
+
recursiveTo: B.value ? vt.value : void 0,
|
|
278
|
+
required: p.required,
|
|
279
|
+
value: E.value
|
|
280
|
+
}, Fe(U.value ? Dt : _(Je)), { onClick: jt }), Ee({ _: 2 }, [
|
|
281
|
+
p.name ? {
|
|
282
282
|
name: "name",
|
|
283
|
-
fn:
|
|
283
|
+
fn: x(() => [Qe.value ? (h(), l(n, {
|
|
284
284
|
key: 0,
|
|
285
|
-
breadcrumb:
|
|
285
|
+
breadcrumb: O.value
|
|
286
286
|
}, {
|
|
287
|
-
default:
|
|
287
|
+
default: x(() => [Te("span", { id: _(q) }, [p.variant === "patternProperties" ? (h(), d("span", Be, [f(_(S), {
|
|
288
288
|
preset: "property",
|
|
289
|
-
text:
|
|
290
|
-
}, null, 8, ["text"])])) :
|
|
289
|
+
text: p.name
|
|
290
|
+
}, null, 8, ["text"])])) : p.variant === "additionalProperties" ? (h(), d("span", Ve, [f(_(S), {
|
|
291
291
|
preset: "property",
|
|
292
|
-
text:
|
|
293
|
-
}, null, 8, ["text"])])) : (
|
|
292
|
+
text: p.name
|
|
293
|
+
}, null, 8, ["text"])])) : (h(), l(_(S), {
|
|
294
294
|
key: 2,
|
|
295
295
|
preset: "property",
|
|
296
|
-
text:
|
|
297
|
-
}, null, 8, ["text"]))], 8,
|
|
296
|
+
text: p.name
|
|
297
|
+
}, null, 8, ["text"]))], 8, ze)]),
|
|
298
298
|
_: 1
|
|
299
|
-
}, 8, ["breadcrumb"])) : (
|
|
299
|
+
}, 8, ["breadcrumb"])) : (h(), d("span", {
|
|
300
300
|
key: 1,
|
|
301
|
-
id:
|
|
302
|
-
}, [
|
|
301
|
+
id: _(q)
|
|
302
|
+
}, [p.variant === "patternProperties" ? (h(), d("span", Ue, [f(_(S), {
|
|
303
303
|
preset: "property",
|
|
304
|
-
text:
|
|
305
|
-
}, null, 8, ["text"])])) :
|
|
304
|
+
text: p.name
|
|
305
|
+
}, null, 8, ["text"])])) : p.variant === "additionalProperties" ? (h(), d("span", We, [f(_(S), {
|
|
306
306
|
preset: "property",
|
|
307
|
-
text:
|
|
308
|
-
}, null, 8, ["text"])])) : (
|
|
307
|
+
text: p.name
|
|
308
|
+
}, null, 8, ["text"])])) : (h(), l(_(S), {
|
|
309
309
|
key: 2,
|
|
310
310
|
preset: "property",
|
|
311
|
-
text:
|
|
312
|
-
}, null, 8, ["text"]))], 8,
|
|
311
|
+
text: p.name
|
|
312
|
+
}, null, 8, ["text"]))], 8, He))]),
|
|
313
313
|
key: "0"
|
|
314
314
|
} : void 0,
|
|
315
|
-
|
|
315
|
+
E.value?.example === void 0 ? void 0 : {
|
|
316
316
|
name: "example",
|
|
317
|
-
fn:
|
|
317
|
+
fn: x(() => [De(" Example: " + g(E.value.example), 1)]),
|
|
318
318
|
key: "1"
|
|
319
319
|
},
|
|
320
320
|
U.value && !G.value ? {
|
|
321
321
|
name: "preview",
|
|
322
|
-
fn:
|
|
322
|
+
fn: x(() => [f(ve, {
|
|
323
323
|
"aria-hidden": "true",
|
|
324
324
|
class: "mr-0!",
|
|
325
|
-
propertyNames:
|
|
325
|
+
propertyNames: Ot.value,
|
|
326
326
|
schema: Z.value
|
|
327
327
|
}, null, 8, ["propertyNames", "schema"])]),
|
|
328
328
|
key: "2"
|
|
329
329
|
} : void 0,
|
|
330
|
-
|
|
330
|
+
p.name && Ze.value && O.value ? {
|
|
331
331
|
name: "trailing",
|
|
332
|
-
fn:
|
|
333
|
-
anchorId:
|
|
334
|
-
eventBus:
|
|
332
|
+
fn: x(() => [f(t, {
|
|
333
|
+
anchorId: O.value.join("."),
|
|
334
|
+
eventBus: p.eventBus
|
|
335
335
|
}, null, 8, ["anchorId", "eventBus"])]),
|
|
336
336
|
key: "3"
|
|
337
337
|
} : void 0
|
|
@@ -349,88 +349,88 @@ var We = ["id"], Ge = {
|
|
|
349
349
|
"recursiveTo",
|
|
350
350
|
"required",
|
|
351
351
|
"value"
|
|
352
|
-
])) :
|
|
353
|
-
|
|
352
|
+
])) : u("", !0),
|
|
353
|
+
f(e, {
|
|
354
354
|
class: "my-2",
|
|
355
|
-
value:
|
|
355
|
+
value: E.value?.externalDocs
|
|
356
356
|
}, null, 8, ["value"]),
|
|
357
|
-
j.value ||
|
|
358
|
-
|
|
357
|
+
j.value || at.value ? (h(), d("div", Ge, [f(_(Le), { value: j.value || at.value || "" }, null, 8, ["value"])])) : u("", !0),
|
|
358
|
+
p.propertyNamesEnum && p.propertyNamesEnum.length > 0 ? (h(), l(be, {
|
|
359
359
|
key: 3,
|
|
360
360
|
propertyNames: "",
|
|
361
|
-
value: { enum:
|
|
362
|
-
}, null, 8, ["value"])) :
|
|
363
|
-
|
|
361
|
+
value: { enum: p.propertyNamesEnum }
|
|
362
|
+
}, null, 8, ["value"])) : u("", !0),
|
|
363
|
+
it.value.length > 0 && !A.value && !kt.value ? (h(), l(be, {
|
|
364
364
|
key: 4,
|
|
365
|
-
value:
|
|
366
|
-
}, null, 8, ["value"])) :
|
|
367
|
-
U.value && Q.value ? (
|
|
365
|
+
value: E.value
|
|
366
|
+
}, null, 8, ["value"])) : u("", !0),
|
|
367
|
+
U.value && Q.value ? (h(), d("span", {
|
|
368
368
|
key: 5,
|
|
369
|
-
id:
|
|
369
|
+
id: _(Tt),
|
|
370
370
|
class: "screenreader-only"
|
|
371
|
-
},
|
|
372
|
-
|
|
371
|
+
}, g(Q.value), 9, Ke)) : u("", !0),
|
|
372
|
+
xt.value ? (h(), l(Ce, {
|
|
373
373
|
key: 6,
|
|
374
|
-
id:
|
|
374
|
+
id: _(wt),
|
|
375
375
|
ref: "treePanel",
|
|
376
376
|
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
377
|
closeOnRail: U.value,
|
|
378
|
-
depth:
|
|
379
|
-
hidden:
|
|
380
|
-
onBeforematch:
|
|
378
|
+
depth: p.depth + 1,
|
|
379
|
+
hidden: St.value,
|
|
380
|
+
onBeforematch: Mt,
|
|
381
381
|
onClose: $
|
|
382
382
|
}, {
|
|
383
|
-
default:
|
|
384
|
-
depth:
|
|
385
|
-
expansion:
|
|
383
|
+
default: x(() => [F.value ? (h(), l(s, m({ key: 0 }, F.value, {
|
|
384
|
+
depth: p.depth + 1,
|
|
385
|
+
expansion: _(V),
|
|
386
386
|
noncollapsible: "",
|
|
387
|
-
scrollTargetId:
|
|
388
|
-
specificationExtension:
|
|
387
|
+
scrollTargetId: p.scrollTargetId,
|
|
388
|
+
specificationExtension: p.specificationExtension
|
|
389
389
|
}), null, 16, [
|
|
390
390
|
"depth",
|
|
391
391
|
"expansion",
|
|
392
392
|
"scrollTargetId",
|
|
393
393
|
"specificationExtension"
|
|
394
|
-
])) :
|
|
394
|
+
])) : u("", !0)]),
|
|
395
395
|
_: 1
|
|
396
396
|
}, 8, [
|
|
397
397
|
"id",
|
|
398
398
|
"closeOnRail",
|
|
399
399
|
"depth",
|
|
400
400
|
"hidden"
|
|
401
|
-
])) :
|
|
402
|
-
|
|
403
|
-
depth:
|
|
404
|
-
expansion:
|
|
401
|
+
])) : u("", !0),
|
|
402
|
+
Ct.value ? (h(), d("div", qe, [F.value ? (h(), l(s, m({ key: 0 }, F.value, {
|
|
403
|
+
depth: p.depth,
|
|
404
|
+
expansion: _(V),
|
|
405
405
|
noncollapsible: "",
|
|
406
|
-
scrollTargetId:
|
|
407
|
-
specificationExtension:
|
|
406
|
+
scrollTargetId: p.scrollTargetId,
|
|
407
|
+
specificationExtension: p.specificationExtension
|
|
408
408
|
}), null, 16, [
|
|
409
409
|
"depth",
|
|
410
410
|
"expansion",
|
|
411
411
|
"scrollTargetId",
|
|
412
412
|
"specificationExtension"
|
|
413
|
-
])) :
|
|
414
|
-
(
|
|
413
|
+
])) : u("", !0)])) : u("", !0),
|
|
414
|
+
(h(!0), d(we, null, Ne(st.value, (e) => (h(), l(ye, {
|
|
415
415
|
key: e.composition,
|
|
416
|
-
breadcrumb:
|
|
417
|
-
compact:
|
|
416
|
+
breadcrumb: O.value,
|
|
417
|
+
compact: p.compact,
|
|
418
418
|
composition: e.composition,
|
|
419
|
-
compositionPath:
|
|
420
|
-
depth:
|
|
421
|
-
discriminator:
|
|
422
|
-
eventBus:
|
|
423
|
-
expansion:
|
|
424
|
-
hideHeading:
|
|
419
|
+
compositionPath: k.value,
|
|
420
|
+
depth: p.depth,
|
|
421
|
+
discriminator: ut(e.composition),
|
|
422
|
+
eventBus: p.eventBus,
|
|
423
|
+
expansion: _(V),
|
|
424
|
+
hideHeading: p.hideHeading,
|
|
425
425
|
hideModelNames: L.value,
|
|
426
|
-
level:
|
|
427
|
-
name:
|
|
428
|
-
noncollapsible:
|
|
429
|
-
options:
|
|
426
|
+
level: p.level,
|
|
427
|
+
name: p.name,
|
|
428
|
+
noncollapsible: p.noncollapsible,
|
|
429
|
+
options: p.options,
|
|
430
430
|
schema: e.value,
|
|
431
|
-
schemaContext:
|
|
432
|
-
scrollTargetId:
|
|
433
|
-
specificationExtension:
|
|
431
|
+
schemaContext: p.schemaContext,
|
|
432
|
+
scrollTargetId: p.scrollTargetId,
|
|
433
|
+
specificationExtension: p.specificationExtension
|
|
434
434
|
}, null, 8, [
|
|
435
435
|
"breadcrumb",
|
|
436
436
|
"compact",
|
|
@@ -451,16 +451,16 @@ var We = ["id"], Ge = {
|
|
|
451
451
|
"scrollTargetId",
|
|
452
452
|
"specificationExtension"
|
|
453
453
|
]))), 128)),
|
|
454
|
-
|
|
454
|
+
lt.value && p.specificationExtension ? (h(), l(Pe(p.specificationExtension), {
|
|
455
455
|
key: 8,
|
|
456
|
-
showExtensions:
|
|
457
|
-
value:
|
|
458
|
-
}, null, 8, ["showExtensions", "value"])) :
|
|
456
|
+
showExtensions: p.options.showExtensions,
|
|
457
|
+
value: ct.value
|
|
458
|
+
}, null, 8, ["showExtensions", "value"])) : u("", !0)
|
|
459
459
|
]),
|
|
460
460
|
_: 1
|
|
461
461
|
}, 8, ["class"]));
|
|
462
462
|
}
|
|
463
463
|
});
|
|
464
|
-
export {
|
|
464
|
+
export { T as default };
|
|
465
465
|
|
|
466
466
|
//# sourceMappingURL=SchemaProperty.vue_vue_type_script_setup_true_lang.js.map
|