@scalar/blocks 0.11.3 → 0.11.4

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