@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.
Files changed (139) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/dist/code-example/components/CodeExample.vue.d.ts +2 -0
  3. package/dist/code-example/components/CodeExample.vue.d.ts.map +1 -1
  4. package/dist/code-example/components/CodeExample.vue.js +1 -1
  5. package/dist/code-example/components/CodeExample.vue.js.map +1 -1
  6. package/dist/code-example/components/CodeExample.vue.script.js +71 -68
  7. package/dist/code-example/components/CodeExample.vue.script.js.map +1 -1
  8. package/dist/code-example/helpers/generate-client-options.d.ts.map +1 -1
  9. package/dist/code-example/helpers/generate-client-options.js.map +1 -1
  10. package/dist/code-example/helpers/get-clients.d.ts.map +1 -1
  11. package/dist/code-example/helpers/get-clients.js.map +1 -1
  12. package/dist/code-example/helpers/operation-to-har/process-body.d.ts.map +1 -1
  13. package/dist/code-example/helpers/operation-to-har/process-body.js +42 -42
  14. package/dist/code-example/helpers/operation-to-har/process-body.js.map +1 -1
  15. package/dist/code-example/helpers/operation-to-har/process-parameters.d.ts.map +1 -1
  16. package/dist/code-example/helpers/operation-to-har/process-parameters.js +63 -62
  17. package/dist/code-example/helpers/operation-to-har/process-parameters.js.map +1 -1
  18. package/dist/code-example/mount.d.ts.map +1 -1
  19. package/dist/code-example/mount.js +1 -1
  20. package/dist/code-example/mount.js.map +1 -1
  21. package/dist/constants.js +1 -1
  22. package/dist/schema/Schema.vue.d.ts.map +1 -1
  23. package/dist/schema/Schema.vue.js +1 -1
  24. package/dist/schema/Schema.vue.js.map +1 -1
  25. package/dist/schema/Schema.vue.script.js +122 -116
  26. package/dist/schema/Schema.vue.script.js.map +1 -1
  27. package/dist/schema/SchemaComposition.vue.d.ts.map +1 -1
  28. package/dist/schema/SchemaComposition.vue.js +1 -1
  29. package/dist/schema/SchemaComposition.vue.js.map +1 -1
  30. package/dist/schema/SchemaComposition.vue.script.js +110 -106
  31. package/dist/schema/SchemaComposition.vue.script.js.map +1 -1
  32. package/dist/schema/SchemaEnumPropertyItem.vue.js.map +1 -1
  33. package/dist/schema/SchemaEnumPropertyItem.vue.script.js +2 -2
  34. package/dist/schema/SchemaEnumPropertyItem.vue.script.js.map +1 -1
  35. package/dist/schema/SchemaObjectProperties.vue.js.map +1 -1
  36. package/dist/schema/SchemaObjectProperties.vue.script.js +1 -1
  37. package/dist/schema/SchemaObjectProperties.vue.script.js.map +1 -1
  38. package/dist/schema/SchemaProperty.vue.d.ts +1 -1
  39. package/dist/schema/SchemaProperty.vue.d.ts.map +1 -1
  40. package/dist/schema/SchemaProperty.vue.js +1 -1
  41. package/dist/schema/SchemaProperty.vue.js.map +1 -1
  42. package/dist/schema/SchemaProperty.vue.script.js +179 -164
  43. package/dist/schema/SchemaProperty.vue.script.js.map +1 -1
  44. package/dist/schema/SchemaPropertyHeading.vue.d.ts +5 -3
  45. package/dist/schema/SchemaPropertyHeading.vue.d.ts.map +1 -1
  46. package/dist/schema/SchemaPropertyHeading.vue.js +1 -1
  47. package/dist/schema/SchemaPropertyHeading.vue.js.map +1 -1
  48. package/dist/schema/SchemaPropertyHeading.vue.script.js +122 -117
  49. package/dist/schema/SchemaPropertyHeading.vue.script.js.map +1 -1
  50. package/dist/schema/SchemaPropertyPattern.vue.js +1 -1
  51. package/dist/schema/SchemaPropertyPattern.vue.js.map +1 -1
  52. package/dist/schema/SchemaPropertyPattern.vue.script.js +1 -1
  53. package/dist/schema/SchemaPropertyPattern.vue.script.js.map +1 -1
  54. package/dist/schema/discriminator-metadata.d.ts +13 -0
  55. package/dist/schema/discriminator-metadata.d.ts.map +1 -0
  56. package/dist/schema/discriminator-metadata.js +6 -0
  57. package/dist/schema/discriminator-metadata.js.map +1 -0
  58. package/dist/schema/helpers/get-compositions-to-render.d.ts +3 -1
  59. package/dist/schema/helpers/get-compositions-to-render.d.ts.map +1 -1
  60. package/dist/schema/helpers/get-compositions-to-render.js +25 -24
  61. package/dist/schema/helpers/get-compositions-to-render.js.map +1 -1
  62. package/dist/schema/helpers/get-property-description.d.ts +6 -3
  63. package/dist/schema/helpers/get-property-description.d.ts.map +1 -1
  64. package/dist/schema/helpers/get-property-description.js +10 -10
  65. package/dist/schema/helpers/get-property-description.js.map +1 -1
  66. package/dist/schema/helpers/has-complex-array-items.d.ts.map +1 -1
  67. package/dist/schema/helpers/has-complex-array-items.js +6 -2
  68. package/dist/schema/helpers/has-complex-array-items.js.map +1 -1
  69. package/dist/schema/helpers/merge-all-of-schemas.d.ts.map +1 -1
  70. package/dist/schema/helpers/merge-all-of-schemas.js +2 -2
  71. package/dist/schema/helpers/merge-all-of-schemas.js.map +1 -1
  72. package/dist/schema/helpers/optimize-value-for-display.d.ts.map +1 -1
  73. package/dist/schema/helpers/optimize-value-for-display.js +34 -33
  74. package/dist/schema/helpers/optimize-value-for-display.js.map +1 -1
  75. package/dist/schema/helpers/partition-all-of-compositions.d.ts.map +1 -1
  76. package/dist/schema/helpers/partition-all-of-compositions.js +39 -27
  77. package/dist/schema/helpers/partition-all-of-compositions.js.map +1 -1
  78. package/dist/schema/helpers/schema-name.js +1 -1
  79. package/dist/schema/helpers/schema-name.js.map +1 -1
  80. package/dist/schema/index.d.ts +2 -0
  81. package/dist/schema/index.d.ts.map +1 -1
  82. package/dist/schema/index.js +13 -11
  83. package/dist/schema/localization/index.d.ts +11 -1
  84. package/dist/schema/localization/index.d.ts.map +1 -1
  85. package/dist/schema/localization/locales/ar.d.ts +10 -0
  86. package/dist/schema/localization/locales/ar.d.ts.map +1 -1
  87. package/dist/schema/localization/locales/ar.js +11 -1
  88. package/dist/schema/localization/locales/ar.js.map +1 -1
  89. package/dist/schema/localization/locales/de.d.ts +10 -0
  90. package/dist/schema/localization/locales/de.d.ts.map +1 -1
  91. package/dist/schema/localization/locales/de.js +11 -1
  92. package/dist/schema/localization/locales/de.js.map +1 -1
  93. package/dist/schema/localization/locales/en.d.ts +10 -0
  94. package/dist/schema/localization/locales/en.d.ts.map +1 -1
  95. package/dist/schema/localization/locales/en.js +11 -1
  96. package/dist/schema/localization/locales/en.js.map +1 -1
  97. package/dist/schema/localization/locales/es.d.ts +10 -0
  98. package/dist/schema/localization/locales/es.d.ts.map +1 -1
  99. package/dist/schema/localization/locales/es.js +11 -1
  100. package/dist/schema/localization/locales/es.js.map +1 -1
  101. package/dist/schema/localization/locales/fr.d.ts +10 -0
  102. package/dist/schema/localization/locales/fr.d.ts.map +1 -1
  103. package/dist/schema/localization/locales/fr.js +11 -1
  104. package/dist/schema/localization/locales/fr.js.map +1 -1
  105. package/dist/schema/localization/locales/pt.d.ts +10 -0
  106. package/dist/schema/localization/locales/pt.d.ts.map +1 -1
  107. package/dist/schema/localization/locales/pt.js +11 -1
  108. package/dist/schema/localization/locales/pt.js.map +1 -1
  109. package/dist/schema/localization/locales/ru.d.ts +10 -0
  110. package/dist/schema/localization/locales/ru.d.ts.map +1 -1
  111. package/dist/schema/localization/locales/ru.js +11 -1
  112. package/dist/schema/localization/locales/ru.js.map +1 -1
  113. package/dist/schema/localization/locales/zh-cn.d.ts +10 -0
  114. package/dist/schema/localization/locales/zh-cn.d.ts.map +1 -1
  115. package/dist/schema/localization/locales/zh-cn.js +11 -1
  116. package/dist/schema/localization/locales/zh-cn.js.map +1 -1
  117. package/dist/schema/localization/locales/zh-tw.d.ts +69 -0
  118. package/dist/schema/localization/locales/zh-tw.d.ts.map +1 -0
  119. package/dist/schema/localization/locales/zh-tw.js +70 -0
  120. package/dist/schema/localization/locales/zh-tw.js.map +1 -0
  121. package/dist/schema/localization/translations.d.ts +147 -0
  122. package/dist/schema/localization/translations.d.ts.map +1 -1
  123. package/dist/schema/localization/translations.js +5 -3
  124. package/dist/schema/localization/translations.js.map +1 -1
  125. package/dist/schema/types.d.ts +2 -0
  126. package/dist/schema/types.d.ts.map +1 -1
  127. package/dist/shared/ExternalDocs.vue.d.ts +9 -0
  128. package/dist/shared/ExternalDocs.vue.d.ts.map +1 -0
  129. package/dist/shared/ExternalDocs.vue.js +7 -0
  130. package/dist/shared/ExternalDocs.vue.js.map +1 -0
  131. package/dist/shared/ExternalDocs.vue.script.js +46 -0
  132. package/dist/shared/ExternalDocs.vue.script.js.map +1 -0
  133. package/dist/shared/index.d.ts +1 -0
  134. package/dist/shared/index.d.ts.map +1 -1
  135. package/dist/shared/index.js +4 -3
  136. package/dist/style.css +63 -19
  137. package/dist/styles/schema-tree.css +3 -1
  138. package/dist/vue-styles.css +1 -1
  139. 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 { 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 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,105 +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(() => w.level <= 2), $e = s(() => Qe.value && (O.value?.length ?? 0) > 0), et = s(() => {
102
- let e = E.value;
103
- if (!e || !S(e) || !Re(e.items)) return e;
104
- 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 || !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
- }), tt = s(() => ee(et.value)), nt = s(() => at.value.length > 0), rt = s(() => E.value ? i(E.value, w.options.document) : null), it = s(() => {
110
- let e = E.value;
111
- 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;
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 = E.value;
116
- return !e || !S(e) || typeof e.items != "object" ? !1 : tt.value;
117
- }), at = s(() => pe(E.value)), ot = s(() => me(E.value)), j = s(() => _e(E.value, w.description)), st = s(() => {
118
- let e = E.value;
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(() => 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 ? {
127
- ...w.extensionSource,
128
- ...E.value
129
- } : E.value), ut = s(() => {
130
- 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;
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
- }), dt = (e) => e === "allOf" ? w.schema?.discriminator ?? w.discriminator : w.schema?.discriminator, N = s(() => {
135
- let e = et.value;
136
- if (!e || !S(e) || typeof e.items != "object") return;
137
- let t = x.schema(e.items);
138
- return Xe.some((e) => Array.isArray(t?.[e]) && t[e]?.length === 1) ? o(t) : t;
139
- }), ft = s(() => {
140
- let e = E.value;
141
- 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 || !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: w.compact,
144
- eventBus: w.eventBus,
151
+ compact: S.compact,
152
+ eventBus: S.eventBus,
145
153
  hideModelNames: L.value,
146
- level: w.level + 1,
147
- name: w.name,
148
- options: w.options,
149
- schemaContext: w.schemaContext
150
- })), 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 ? {
151
159
  ...P.value,
152
- breadcrumb: O.value,
153
- compositionPath: k.value,
154
- cycleKey: w.cycleKey,
155
- schema: st.value
156
- } : 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 ? {
157
166
  ...P.value,
158
- compositionPath: Ze.value,
159
- cycleKey: ft.value,
160
- schema: x.schema(N.value)
167
+ compositionPath: nt.value,
168
+ cycleKey: mt.value,
169
+ schema: Be.schema(N.value)
161
170
  } : null), F = s(() => {
162
- let { cycleKey: e } = w;
163
- return D.value ? {
171
+ let { cycleKey: e } = S;
172
+ return w.value ? {
164
173
  ...P.value,
165
- breadcrumb: O.value,
166
- compositionPath: k.value,
174
+ breadcrumb: T.value,
175
+ compositionPath: E.value,
167
176
  cycleKey: e,
168
- schema: E.value
169
- } : pt.value ?? mt.value;
170
- }), 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(() => {
171
180
  let e = z.value;
172
181
  if (typeof e == "string") {
173
- let t = n(e);
174
- if (t) return t;
182
+ let n = t(e);
183
+ if (n) return n;
175
184
  }
176
- return w.modelName || w.name || I("schema.schema");
177
- }), 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, {
178
187
  cyclic: B.value,
179
- defaultOpen: !!w.options.expandAllSchemaProperties
180
- })), K = Me(!1);
181
- y(G, (e, t) => {
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 = bt() && V.untilFound.acquire());
187
- }), je(() => {
195
+ t && (K.value = Ct() && V.untilFound.acquire());
196
+ }), Ne(() => {
188
197
  K.value &&= (V.untilFound.release(), !1);
189
198
  });
190
- 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 = () => {
191
200
  Y?.removeAttribute("data-heading-hovered"), Y = null;
192
- }, Dt = {
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
- y(U, (e) => {
209
+ v(U, (e) => {
201
210
  e || X();
202
- }), Ae(X), y(G, (e) => {
211
+ }), Me(X), v(G, (e) => {
203
212
  if (e) return;
204
- let t = Et.value?.$el;
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(() => 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(() => {
208
217
  if (!R.value) return null;
209
218
  let e = Z.value;
210
219
  if (!e) return null;
211
- 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;
212
221
  return r === 0 ? null : I("schema.propertyCount", { count: String(r) });
213
- }), 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")), $ = () => {
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 && Et.value?.$el.contains(e) && t?.focus();
226
+ e && kt.value?.$el.contains(e) && t?.focus();
218
227
  }
219
228
  V.setExpanded(H.value, e);
220
- }, jt = (e) => {
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
- }, Mt = () => {
233
+ }, Ft = () => {
225
234
  V.setExpanded(H.value, !0);
226
235
  };
227
- 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", [
228
237
  `property--level-${f.level}`,
229
238
  {
230
239
  "property--compact": f.compact,
231
- "property--deprecated": E.value?.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: b(() => [
238
- U.value ? (m(), c(xe, {
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 ? g(Tt) : void 0,
243
- fallbackLabel: At.value,
244
- 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,
245
254
  open: G.value,
246
- panelId: g(wt),
247
- panelRendered: xt.value,
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(Se, p({
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
- enum: nt.value,
269
+ discriminatorValue: vt.value,
270
+ enum: at.value,
261
271
  eventBus: f.eventBus,
262
272
  hideModelNames: L.value,
263
- isDiscriminator: gt.value,
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 ? vt.value : void 0,
281
+ recursiveTo: B.value ? xt.value : void 0,
272
282
  required: f.required,
273
- value: E.value
274
- }, 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 }, [
275
285
  f.name ? {
276
286
  name: "name",
277
- fn: b(() => [$e.value ? (m(), c(fe, {
287
+ fn: y(() => [rt.value ? (m(), c(me, {
278
288
  key: 0,
279
- breadcrumb: O.value
289
+ breadcrumb: T.value
280
290
  }, {
281
- 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(x), {
282
292
  preset: "property",
283
293
  text: f.name
284
- }, 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(x), {
285
295
  preset: "property",
286
296
  text: f.name
287
- }, null, 8, ["text"])])) : (m(), c(g(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, Be)]),
301
+ }, null, 8, ["text"]))], 8, We)]),
292
302
  _: 1
293
303
  }, 8, ["breadcrumb"])) : (m(), u("span", {
294
304
  key: 1,
295
- id: g(q)
296
- }, [f.variant === "patternProperties" ? (m(), u("span", We, [d(g(C), {
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", Ge, [d(g(C), {
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(g(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, Ue))]),
316
+ }, null, 8, ["text"]))], 8, qe))]),
307
317
  key: "0"
308
318
  } : void 0,
309
- E.value?.example === void 0 ? void 0 : {
319
+ C.value?.example === void 0 ? void 0 : {
310
320
  name: "example",
311
- fn: b(() => [De(" Example: " + Pe(E.value.example), 1)]),
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: b(() => [d(ye, {
326
+ fn: y(() => [d(xe, {
317
327
  "aria-hidden": "true",
318
328
  class: "mr-0!",
319
- propertyNames: Ot.value,
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 && Qe.value && O.value ? {
334
+ f.name && D.value && T.value ? {
325
335
  name: "trailing",
326
- fn: b(() => [d(de, {
327
- anchorId: O.value.join("."),
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
- j.value || ot.value ? (m(), u("div", Ke, [d(g(Le), { value: j.value || ot.value || "" }, null, 8, ["value"])])) : l("", !0),
347
- 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, {
348
363
  key: 3,
349
364
  propertyNames: "",
350
365
  value: { enum: f.propertyNamesEnum }
351
366
  }, null, 8, ["value"])) : l("", !0),
352
- at.value.length > 0 && !A.value && !kt.value ? (m(), c(be, {
367
+ st.value.length > 0 && !A.value && !Mt.value ? (m(), c(Se, {
353
368
  key: 4,
354
- value: E.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: g(Tt),
373
+ id: h(Ot),
359
374
  class: "screenreader-only"
360
- }, Pe(Q.value), 9, qe)) : l("", !0),
361
- xt.value ? (m(), c(ce, {
375
+ }, Le(Q.value), 9, Ze)) : l("", !0),
376
+ wt.value ? (m(), c(ue, {
362
377
  key: 6,
363
- id: g(wt),
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: St.value,
369
- onBeforematch: Mt,
383
+ hidden: Tt.value,
384
+ onBeforematch: Ft,
370
385
  onClose: $
371
386
  }, {
372
- 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, {
373
388
  depth: f.depth + 1,
374
- expansion: g(V),
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
- 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, {
392
407
  depth: f.depth,
393
- expansion: g(V),
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(we, null, Ne(ct.value, (e) => (m(), c(le, {
418
+ (m(!0), u(Ee, null, Fe(ut.value, (e) => (m(), c(de, {
404
419
  key: e.composition,
405
- breadcrumb: O.value,
420
+ breadcrumb: T.value,
406
421
  compact: f.compact,
407
422
  composition: e.composition,
408
- compositionPath: k.value,
423
+ compositionPath: E.value,
409
424
  depth: f.depth,
410
- discriminator: dt(e.composition),
425
+ discriminator: pt(e.composition),
411
426
  eventBus: f.eventBus,
412
- expansion: g(V),
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
- ut.value && f.specificationExtension ? (m(), c(h(f.specificationExtension), {
458
+ ft.value && f.specificationExtension ? (m(), c(Ie(f.specificationExtension), {
444
459
  key: 8,
445
460
  showExtensions: f.options.showExtensions,
446
- value: lt.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 { w as default };
469
+ export { S as default };
455
470
 
456
471
  //# sourceMappingURL=SchemaProperty.vue.script.js.map