@scalar/blocks 0.5.1 → 0.5.3
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 +25 -0
- package/dist/code-example/components/CodeExample.vue.d.ts +2 -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.js.map +1 -1
- package/dist/code-example/components/CodeExample.vue.script.js +71 -68
- package/dist/code-example/components/CodeExample.vue.script.js.map +1 -1
- package/dist/code-example/helpers/generate-client-options.d.ts.map +1 -1
- package/dist/code-example/helpers/generate-client-options.js.map +1 -1
- package/dist/code-example/helpers/get-clients.d.ts.map +1 -1
- package/dist/code-example/helpers/get-clients.js.map +1 -1
- 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/helpers/operation-to-har/process-parameters.d.ts.map +1 -1
- package/dist/code-example/helpers/operation-to-har/process-parameters.js +63 -62
- package/dist/code-example/helpers/operation-to-har/process-parameters.js.map +1 -1
- package/dist/code-example/mount.d.ts.map +1 -1
- package/dist/code-example/mount.js +1 -1
- 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 +2 -2
- package/dist/schema/SchemaEnumPropertyItem.vue.script.js.map +1 -1
- package/dist/schema/SchemaObjectProperties.vue.js.map +1 -1
- package/dist/schema/SchemaObjectProperties.vue.script.js +1 -1
- package/dist/schema/SchemaObjectProperties.vue.script.js.map +1 -1
- 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 -164
- 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/has-complex-array-items.d.ts.map +1 -1
- package/dist/schema/helpers/has-complex-array-items.js +6 -2
- package/dist/schema/helpers/has-complex-array-items.js.map +1 -1
- package/dist/schema/helpers/merge-all-of-schemas.d.ts.map +1 -1
- package/dist/schema/helpers/merge-all-of-schemas.js +2 -2
- package/dist/schema/helpers/merge-all-of-schemas.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/helpers/partition-all-of-compositions.d.ts.map +1 -1
- package/dist/schema/helpers/partition-all-of-compositions.js +39 -27
- package/dist/schema/helpers/partition-all-of-compositions.js.map +1 -1
- package/dist/schema/helpers/schema-name.js +1 -1
- package/dist/schema/helpers/schema-name.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 +69 -0
- package/dist/schema/localization/locales/zh-tw.d.ts.map +1 -0
- package/dist/schema/localization/locales/zh-tw.js +70 -0
- package/dist/schema/localization/locales/zh-tw.js.map +1 -0
- package/dist/schema/localization/translations.d.ts +147 -0
- package/dist/schema/localization/translations.d.ts.map +1 -1
- package/dist/schema/localization/translations.js +5 -3
- package/dist/schema/localization/translations.js.map +1 -1
- package/dist/schema/types.d.ts +2 -0
- package/dist/schema/types.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 -19
- package/dist/styles/schema-tree.css +3 -1
- 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 { ScalarWrappingText as
|
|
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 { resolve as Be } from "@scalar/workspace-store/resolve";
|
|
32
|
+
import { isArraySchema as b } from "@scalar/workspace-store/schemas/v3.2/strict/type-guards";
|
|
33
|
+
import { ScalarMarkdown as Ve } from "@scalar/components/markdown";
|
|
34
|
+
import { isDynamicRef as He, resolveDynamicRef as Ue } from "@scalar/workspace-store/helpers/dynamic-ref";
|
|
35
|
+
import { ScalarWrappingText as x } from "@scalar/components/wrapping-text";
|
|
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,105 +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
|
-
|
|
104
|
-
|
|
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 || !b(e) || !He(e.items)) return e;
|
|
109
|
+
let t = Ue(e.items.$dynamicRef, tt);
|
|
105
110
|
return t ? {
|
|
106
111
|
...e,
|
|
107
112
|
items: t
|
|
108
113
|
} : e;
|
|
109
|
-
}),
|
|
110
|
-
let e =
|
|
111
|
-
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;
|
|
112
117
|
let t = "type" in e ? e.type : void 0, n = typeof t == "string" && t !== "object";
|
|
113
118
|
return a(e) || !n;
|
|
114
119
|
}), A = s(() => {
|
|
115
|
-
let e =
|
|
116
|
-
return !e || !
|
|
117
|
-
}),
|
|
118
|
-
let e =
|
|
120
|
+
let e = C.value;
|
|
121
|
+
return !e || !b(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;
|
|
119
127
|
if (!e) return e;
|
|
120
|
-
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;
|
|
121
129
|
if (j.value && "description" in i) {
|
|
122
130
|
let { description: e, ...t } = i;
|
|
123
131
|
return t;
|
|
124
132
|
}
|
|
125
133
|
return i;
|
|
126
|
-
}), M = s(() =>
|
|
127
|
-
...
|
|
128
|
-
...
|
|
129
|
-
} :
|
|
130
|
-
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;
|
|
131
139
|
if (!e || typeof e != "object") return !1;
|
|
132
140
|
for (let t in e) if (t.startsWith("x-")) return !0;
|
|
133
141
|
return !1;
|
|
134
|
-
}),
|
|
135
|
-
let e =
|
|
136
|
-
if (!e || !
|
|
137
|
-
let t =
|
|
138
|
-
return
|
|
139
|
-
}),
|
|
140
|
-
let e =
|
|
141
|
-
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 || !b(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 || !b(e))) return oe(e.items);
|
|
142
150
|
}), P = s(() => ({
|
|
143
|
-
compact:
|
|
144
|
-
eventBus:
|
|
151
|
+
compact: S.compact,
|
|
152
|
+
eventBus: S.eventBus,
|
|
145
153
|
hideModelNames: L.value,
|
|
146
|
-
level:
|
|
147
|
-
name:
|
|
148
|
-
options:
|
|
149
|
-
schemaContext:
|
|
150
|
-
})),
|
|
154
|
+
level: S.level + 1,
|
|
155
|
+
name: S.name,
|
|
156
|
+
options: S.options,
|
|
157
|
+
schemaContext: S.schemaContext
|
|
158
|
+
})), ht = s(() => k.value ? {
|
|
151
159
|
...P.value,
|
|
152
|
-
breadcrumb:
|
|
153
|
-
compositionPath:
|
|
154
|
-
cycleKey:
|
|
155
|
-
schema:
|
|
156
|
-
|
|
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 ? {
|
|
157
166
|
...P.value,
|
|
158
|
-
compositionPath:
|
|
159
|
-
cycleKey:
|
|
160
|
-
schema:
|
|
167
|
+
compositionPath: nt.value,
|
|
168
|
+
cycleKey: mt.value,
|
|
169
|
+
schema: Be.schema(N.value)
|
|
161
170
|
} : null), F = s(() => {
|
|
162
|
-
let { cycleKey: e } =
|
|
163
|
-
return
|
|
171
|
+
let { cycleKey: e } = S;
|
|
172
|
+
return w.value ? {
|
|
164
173
|
...P.value,
|
|
165
|
-
breadcrumb:
|
|
166
|
-
compositionPath:
|
|
174
|
+
breadcrumb: T.value,
|
|
175
|
+
compositionPath: E.value,
|
|
167
176
|
cycleKey: e,
|
|
168
|
-
schema:
|
|
169
|
-
} :
|
|
170
|
-
}),
|
|
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(() => {
|
|
171
180
|
let e = z.value;
|
|
172
181
|
if (typeof e == "string") {
|
|
173
|
-
let
|
|
174
|
-
if (
|
|
182
|
+
let n = t(e);
|
|
183
|
+
if (n) return n;
|
|
175
184
|
}
|
|
176
|
-
return
|
|
177
|
-
}), 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, {
|
|
178
187
|
cyclic: B.value,
|
|
179
|
-
defaultOpen: !!
|
|
180
|
-
})), K =
|
|
181
|
-
|
|
188
|
+
defaultOpen: !!S.options.expandAllSchemaProperties
|
|
189
|
+
})), K = Pe(!1);
|
|
190
|
+
v(G, (e, t) => {
|
|
182
191
|
if (e) {
|
|
183
192
|
K.value &&= (V.untilFound.release(), !1);
|
|
184
193
|
return;
|
|
185
194
|
}
|
|
186
|
-
t && (K.value =
|
|
187
|
-
}),
|
|
195
|
+
t && (K.value = Ct() && V.untilFound.acquire());
|
|
196
|
+
}), Ne(() => {
|
|
188
197
|
K.value &&= (V.untilFound.release(), !1);
|
|
189
198
|
});
|
|
190
|
-
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 = () => {
|
|
191
200
|
Y?.removeAttribute("data-heading-hovered"), Y = null;
|
|
192
|
-
},
|
|
201
|
+
}, At = {
|
|
193
202
|
pointerenter: (e) => {
|
|
194
203
|
X();
|
|
195
204
|
let t = e.currentTarget instanceof HTMLElement ? e.currentTarget.parentElement : null;
|
|
@@ -197,54 +206,54 @@ var Be = ["id"], Ve = {
|
|
|
197
206
|
},
|
|
198
207
|
pointerleave: X
|
|
199
208
|
};
|
|
200
|
-
|
|
209
|
+
v(U, (e) => {
|
|
201
210
|
e || X();
|
|
202
|
-
}),
|
|
211
|
+
}), Me(X), v(G, (e) => {
|
|
203
212
|
if (e) return;
|
|
204
|
-
let t =
|
|
213
|
+
let t = kt.value?.$el;
|
|
205
214
|
t?.removeAttribute("data-rail-hovered"), t?.parentElement?.removeAttribute("data-child-rail-hovered");
|
|
206
215
|
});
|
|
207
|
-
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(() => {
|
|
208
217
|
if (!R.value) return null;
|
|
209
218
|
let e = Z.value;
|
|
210
219
|
if (!e) return null;
|
|
211
|
-
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;
|
|
212
221
|
return r === 0 ? null : I("schema.propertyCount", { count: String(r) });
|
|
213
|
-
}),
|
|
222
|
+
}), Mt = s(() => _e(C.value, { hideModelNames: L.value })), Nt = s(() => S.modelName || I("schema.schema")), $ = () => {
|
|
214
223
|
let e = !G.value;
|
|
215
224
|
if (!e) {
|
|
216
225
|
let e = document.activeElement, t = J.value instanceof HTMLElement ? J.value : J.value?.$el;
|
|
217
|
-
e &&
|
|
226
|
+
e && kt.value?.$el.contains(e) && t?.focus();
|
|
218
227
|
}
|
|
219
228
|
V.setExpanded(H.value, e);
|
|
220
|
-
},
|
|
229
|
+
}, Pt = (e) => {
|
|
221
230
|
if (!U.value) return;
|
|
222
231
|
let t = e.target;
|
|
223
232
|
t instanceof Element && t.closest("a, button, [role=\"button\"], input, select, label") || window.getSelection()?.toString() || $();
|
|
224
|
-
},
|
|
233
|
+
}, Ft = () => {
|
|
225
234
|
V.setExpanded(H.value, !0);
|
|
226
235
|
};
|
|
227
|
-
return (e, t) => (m(), c(
|
|
236
|
+
return (e, t) => (m(), c(Ie(f.is ?? "li"), { class: je(["property", [
|
|
228
237
|
`property--level-${f.level}`,
|
|
229
238
|
{
|
|
230
239
|
"property--compact": f.compact,
|
|
231
|
-
"property--deprecated":
|
|
240
|
+
"property--deprecated": C.value?.deprecated
|
|
232
241
|
},
|
|
233
242
|
"property--tree grid! grid-cols-[minmax(0,1fr)] border-b-0! px-0! py-[var(--schema-row-pad,6px)]!",
|
|
234
243
|
{ "property--tree-container": !U.value && !B.value && (R.value || !M.value) },
|
|
235
244
|
`property--depth-${f.depth}`
|
|
236
245
|
]]) }, {
|
|
237
|
-
default:
|
|
238
|
-
U.value ? (m(), c(
|
|
246
|
+
default: y(() => [
|
|
247
|
+
U.value ? (m(), c(Ce, {
|
|
239
248
|
key: 0,
|
|
240
249
|
ref: "treeToggle",
|
|
241
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",
|
|
242
|
-
countId: Q.value ?
|
|
243
|
-
fallbackLabel:
|
|
244
|
-
nameId: f.name ?
|
|
251
|
+
countId: Q.value ? h(Ot) : void 0,
|
|
252
|
+
fallbackLabel: Nt.value,
|
|
253
|
+
nameId: f.name ? h(q) : void 0,
|
|
245
254
|
open: G.value,
|
|
246
|
-
panelId:
|
|
247
|
-
panelRendered:
|
|
255
|
+
panelId: h(Dt),
|
|
256
|
+
panelRendered: wt.value,
|
|
248
257
|
onToggle: $
|
|
249
258
|
}, null, 8, [
|
|
250
259
|
"countId",
|
|
@@ -254,13 +263,14 @@ var Be = ["id"], Ve = {
|
|
|
254
263
|
"panelId",
|
|
255
264
|
"panelRendered"
|
|
256
265
|
])) : l("", !0),
|
|
257
|
-
M.value ? (m(), c(
|
|
266
|
+
M.value ? (m(), c(we, p({
|
|
258
267
|
key: 1,
|
|
259
268
|
class: ["group", [{ "cursor-pointer": U.value }, "relative row-start-1 min-h-5 content-center [&>*:has(+.copy-link-trailing)]:me-0!"]],
|
|
260
|
-
|
|
269
|
+
discriminatorValue: vt.value,
|
|
270
|
+
enum: at.value,
|
|
261
271
|
eventBus: f.eventBus,
|
|
262
272
|
hideModelNames: L.value,
|
|
263
|
-
isDiscriminator:
|
|
273
|
+
isDiscriminator: yt.value,
|
|
264
274
|
keyKind: f.variant === "additionalProperties" ? "additional" : f.variant === "patternProperties" ? "pattern" : void 0,
|
|
265
275
|
modelLinkOptions: {
|
|
266
276
|
hideModels: f.options.hideModels,
|
|
@@ -268,69 +278,70 @@ var Be = ["id"], Ve = {
|
|
|
268
278
|
},
|
|
269
279
|
modelName: f.modelName,
|
|
270
280
|
propertyNames: f.propertyNamesSchema,
|
|
271
|
-
recursiveTo: B.value ?
|
|
281
|
+
recursiveTo: B.value ? xt.value : void 0,
|
|
272
282
|
required: f.required,
|
|
273
|
-
value:
|
|
274
|
-
},
|
|
283
|
+
value: C.value
|
|
284
|
+
}, Re(U.value ? At : h($e)), { onClick: Pt }), Oe({ _: 2 }, [
|
|
275
285
|
f.name ? {
|
|
276
286
|
name: "name",
|
|
277
|
-
fn:
|
|
287
|
+
fn: y(() => [rt.value ? (m(), c(me, {
|
|
278
288
|
key: 0,
|
|
279
|
-
breadcrumb:
|
|
289
|
+
breadcrumb: T.value
|
|
280
290
|
}, {
|
|
281
|
-
default:
|
|
291
|
+
default: y(() => [De("span", { id: h(q) }, [f.variant === "patternProperties" ? (m(), u("span", Ge, [d(h(x), {
|
|
282
292
|
preset: "property",
|
|
283
293
|
text: f.name
|
|
284
|
-
}, null, 8, ["text"])])) : f.variant === "additionalProperties" ? (m(), u("span",
|
|
294
|
+
}, null, 8, ["text"])])) : f.variant === "additionalProperties" ? (m(), u("span", Ke, [d(h(x), {
|
|
285
295
|
preset: "property",
|
|
286
296
|
text: f.name
|
|
287
|
-
}, null, 8, ["text"])])) : (m(), c(
|
|
297
|
+
}, null, 8, ["text"])])) : (m(), c(h(x), {
|
|
288
298
|
key: 2,
|
|
289
299
|
preset: "property",
|
|
290
300
|
text: f.name
|
|
291
|
-
}, null, 8, ["text"]))], 8,
|
|
301
|
+
}, null, 8, ["text"]))], 8, We)]),
|
|
292
302
|
_: 1
|
|
293
303
|
}, 8, ["breadcrumb"])) : (m(), u("span", {
|
|
294
304
|
key: 1,
|
|
295
|
-
id:
|
|
296
|
-
}, [f.variant === "patternProperties" ? (m(), u("span",
|
|
305
|
+
id: h(q)
|
|
306
|
+
}, [f.variant === "patternProperties" ? (m(), u("span", Je, [d(h(x), {
|
|
297
307
|
preset: "property",
|
|
298
308
|
text: f.name
|
|
299
|
-
}, null, 8, ["text"])])) : f.variant === "additionalProperties" ? (m(), u("span",
|
|
309
|
+
}, null, 8, ["text"])])) : f.variant === "additionalProperties" ? (m(), u("span", Ye, [d(h(x), {
|
|
300
310
|
preset: "property",
|
|
301
311
|
text: f.name
|
|
302
|
-
}, null, 8, ["text"])])) : (m(), c(
|
|
312
|
+
}, null, 8, ["text"])])) : (m(), c(h(x), {
|
|
303
313
|
key: 2,
|
|
304
314
|
preset: "property",
|
|
305
315
|
text: f.name
|
|
306
|
-
}, null, 8, ["text"]))], 8,
|
|
316
|
+
}, null, 8, ["text"]))], 8, qe))]),
|
|
307
317
|
key: "0"
|
|
308
318
|
} : void 0,
|
|
309
|
-
|
|
319
|
+
C.value?.example === void 0 ? void 0 : {
|
|
310
320
|
name: "example",
|
|
311
|
-
fn:
|
|
321
|
+
fn: y(() => [ke(" Example: " + Le(C.value.example), 1)]),
|
|
312
322
|
key: "1"
|
|
313
323
|
},
|
|
314
324
|
U.value && !G.value ? {
|
|
315
325
|
name: "preview",
|
|
316
|
-
fn:
|
|
326
|
+
fn: y(() => [d(xe, {
|
|
317
327
|
"aria-hidden": "true",
|
|
318
328
|
class: "mr-0!",
|
|
319
|
-
propertyNames:
|
|
329
|
+
propertyNames: jt.value,
|
|
320
330
|
schema: Z.value
|
|
321
331
|
}, null, 8, ["propertyNames", "schema"])]),
|
|
322
332
|
key: "2"
|
|
323
333
|
} : void 0,
|
|
324
|
-
f.name &&
|
|
334
|
+
f.name && D.value && T.value ? {
|
|
325
335
|
name: "trailing",
|
|
326
|
-
fn:
|
|
327
|
-
anchorId:
|
|
336
|
+
fn: y(() => [d(pe, {
|
|
337
|
+
anchorId: T.value.join("."),
|
|
328
338
|
eventBus: f.eventBus
|
|
329
339
|
}, null, 8, ["anchorId", "eventBus"])]),
|
|
330
340
|
key: "3"
|
|
331
341
|
} : void 0
|
|
332
342
|
]), 1040, [
|
|
333
343
|
"class",
|
|
344
|
+
"discriminatorValue",
|
|
334
345
|
"enum",
|
|
335
346
|
"eventBus",
|
|
336
347
|
"hideModelNames",
|
|
@@ -343,35 +354,39 @@ var Be = ["id"], Ve = {
|
|
|
343
354
|
"required",
|
|
344
355
|
"value"
|
|
345
356
|
])) : l("", !0),
|
|
346
|
-
|
|
347
|
-
|
|
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, {
|
|
348
363
|
key: 3,
|
|
349
364
|
propertyNames: "",
|
|
350
365
|
value: { enum: f.propertyNamesEnum }
|
|
351
366
|
}, null, 8, ["value"])) : l("", !0),
|
|
352
|
-
|
|
367
|
+
st.value.length > 0 && !A.value && !Mt.value ? (m(), c(Se, {
|
|
353
368
|
key: 4,
|
|
354
|
-
value:
|
|
369
|
+
value: C.value
|
|
355
370
|
}, null, 8, ["value"])) : l("", !0),
|
|
356
371
|
U.value && Q.value ? (m(), u("span", {
|
|
357
372
|
key: 5,
|
|
358
|
-
id:
|
|
373
|
+
id: h(Ot),
|
|
359
374
|
class: "screenreader-only"
|
|
360
|
-
},
|
|
361
|
-
|
|
375
|
+
}, Le(Q.value), 9, Ze)) : l("", !0),
|
|
376
|
+
wt.value ? (m(), c(ue, {
|
|
362
377
|
key: 6,
|
|
363
|
-
id:
|
|
378
|
+
id: h(Dt),
|
|
364
379
|
ref: "treePanel",
|
|
365
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",
|
|
366
381
|
closeOnRail: U.value,
|
|
367
382
|
depth: f.depth + 1,
|
|
368
|
-
hidden:
|
|
369
|
-
onBeforematch:
|
|
383
|
+
hidden: Tt.value,
|
|
384
|
+
onBeforematch: Ft,
|
|
370
385
|
onClose: $
|
|
371
386
|
}, {
|
|
372
|
-
default:
|
|
387
|
+
default: y(() => [F.value ? (m(), c(Te, p({ key: 0 }, F.value, {
|
|
373
388
|
depth: f.depth + 1,
|
|
374
|
-
expansion:
|
|
389
|
+
expansion: h(V),
|
|
375
390
|
noncollapsible: "",
|
|
376
391
|
scrollTargetId: f.scrollTargetId,
|
|
377
392
|
specificationExtension: f.specificationExtension
|
|
@@ -388,9 +403,9 @@ var Be = ["id"], Ve = {
|
|
|
388
403
|
"depth",
|
|
389
404
|
"hidden"
|
|
390
405
|
])) : l("", !0),
|
|
391
|
-
|
|
406
|
+
Et.value ? (m(), u("div", Qe, [F.value ? (m(), c(Te, p({ key: 0 }, F.value, {
|
|
392
407
|
depth: f.depth,
|
|
393
|
-
expansion:
|
|
408
|
+
expansion: h(V),
|
|
394
409
|
noncollapsible: "",
|
|
395
410
|
scrollTargetId: f.scrollTargetId,
|
|
396
411
|
specificationExtension: f.specificationExtension
|
|
@@ -400,16 +415,16 @@ var Be = ["id"], Ve = {
|
|
|
400
415
|
"scrollTargetId",
|
|
401
416
|
"specificationExtension"
|
|
402
417
|
])) : l("", !0)])) : l("", !0),
|
|
403
|
-
(m(!0), u(
|
|
418
|
+
(m(!0), u(Ee, null, Fe(ut.value, (e) => (m(), c(de, {
|
|
404
419
|
key: e.composition,
|
|
405
|
-
breadcrumb:
|
|
420
|
+
breadcrumb: T.value,
|
|
406
421
|
compact: f.compact,
|
|
407
422
|
composition: e.composition,
|
|
408
|
-
compositionPath:
|
|
423
|
+
compositionPath: E.value,
|
|
409
424
|
depth: f.depth,
|
|
410
|
-
discriminator:
|
|
425
|
+
discriminator: pt(e.composition),
|
|
411
426
|
eventBus: f.eventBus,
|
|
412
|
-
expansion:
|
|
427
|
+
expansion: h(V),
|
|
413
428
|
hideHeading: f.hideHeading,
|
|
414
429
|
hideModelNames: L.value,
|
|
415
430
|
level: f.level,
|
|
@@ -440,10 +455,10 @@ var Be = ["id"], Ve = {
|
|
|
440
455
|
"scrollTargetId",
|
|
441
456
|
"specificationExtension"
|
|
442
457
|
]))), 128)),
|
|
443
|
-
|
|
458
|
+
ft.value && f.specificationExtension ? (m(), c(Ie(f.specificationExtension), {
|
|
444
459
|
key: 8,
|
|
445
460
|
showExtensions: f.options.showExtensions,
|
|
446
|
-
value:
|
|
461
|
+
value: dt.value
|
|
447
462
|
}, null, 8, ["showExtensions", "value"])) : l("", !0)
|
|
448
463
|
]),
|
|
449
464
|
_: 1
|
|
@@ -451,6 +466,6 @@ var Be = ["id"], Ve = {
|
|
|
451
466
|
}
|
|
452
467
|
});
|
|
453
468
|
//#endregion
|
|
454
|
-
export {
|
|
469
|
+
export { S as default };
|
|
455
470
|
|
|
456
471
|
//# sourceMappingURL=SchemaProperty.vue.script.js.map
|