@scalar/blocks 0.5.2 → 0.5.4

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