@scalar/api-reference 1.30.0 → 1.31.1

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 (167) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/dist/browser/standalone.js +6690 -6569
  3. package/dist/browser/webpack-stats.json +1 -1
  4. package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
  5. package/dist/components/ApiReferenceLayout.vue.js +1 -1
  6. package/dist/components/ApiReferenceLayout.vue2.js +164 -181
  7. package/dist/components/Content/ClientLibraries/ClientLibraries.vue.d.ts.map +1 -1
  8. package/dist/components/Content/ClientLibraries/ClientLibraries.vue.js +2 -2
  9. package/dist/components/Content/ClientLibraries/ClientLibraries.vue2.js +56 -51
  10. package/dist/components/Content/Content.vue.d.ts.map +1 -1
  11. package/dist/components/Content/Content.vue.js +1 -1
  12. package/dist/components/Content/Content.vue2.js +5 -5
  13. package/dist/components/Content/Introduction/Introduction.vue.d.ts +2 -2
  14. package/dist/components/Content/Introduction/Introduction.vue.d.ts.map +1 -1
  15. package/dist/components/Content/Introduction/Introduction.vue.js +2 -2
  16. package/dist/components/Content/Introduction/Introduction.vue2.js +57 -63
  17. package/dist/components/Content/Lazy/Loading.vue.d.ts.map +1 -1
  18. package/dist/components/Content/Lazy/Loading.vue.js +46 -46
  19. package/dist/components/Content/Models/Models.vue.d.ts +2 -2
  20. package/dist/components/Content/Models/Models.vue.d.ts.map +1 -1
  21. package/dist/components/Content/Models/Models.vue.js +2 -2
  22. package/dist/components/Content/Models/Models.vue2.js +9 -7
  23. package/dist/components/Content/Models/ModelsAccordion.vue.d.ts +2 -2
  24. package/dist/components/Content/Models/ModelsAccordion.vue.d.ts.map +1 -1
  25. package/dist/components/Content/Models/ModelsAccordion.vue.js +2 -2
  26. package/dist/components/Content/Schema/Schema.preview.d.ts +294 -84
  27. package/dist/components/Content/Schema/Schema.preview.d.ts.map +1 -1
  28. package/dist/components/Content/Schema/Schema.vue.d.ts +21 -4
  29. package/dist/components/Content/Schema/Schema.vue.d.ts.map +1 -1
  30. package/dist/components/Content/Schema/Schema.vue.js +2 -2
  31. package/dist/components/Content/Schema/Schema.vue2.js +158 -131
  32. package/dist/components/Content/Schema/SchemaComposition.vue.d.ts +2 -2
  33. package/dist/components/Content/Schema/SchemaComposition.vue.d.ts.map +1 -1
  34. package/dist/components/Content/Schema/SchemaComposition.vue.js +57 -53
  35. package/dist/components/Content/Schema/SchemaDiscriminator.vue.d.ts +2 -3
  36. package/dist/components/Content/Schema/SchemaDiscriminator.vue.d.ts.map +1 -1
  37. package/dist/components/Content/Schema/SchemaDiscriminator.vue.js +29 -29
  38. package/dist/components/Content/Schema/SchemaHeading.vue.d.ts +2 -2
  39. package/dist/components/Content/Schema/SchemaHeading.vue.d.ts.map +1 -1
  40. package/dist/components/Content/Schema/SchemaHeading.vue.js +1 -1
  41. package/dist/components/Content/Schema/SchemaProperty.vue.d.ts +12 -3
  42. package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
  43. package/dist/components/Content/Schema/SchemaProperty.vue.js +1 -1
  44. package/dist/components/Content/Schema/SchemaProperty.vue2.js +133 -103
  45. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts +3 -2
  46. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts.map +1 -1
  47. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js +2 -2
  48. package/dist/components/Content/Schema/SchemaPropertyHeading.vue2.js +133 -126
  49. package/dist/components/Content/Schema/helpers/merge-all-of-schemas.d.ts +2 -2
  50. package/dist/components/Content/Schema/helpers/merge-all-of-schemas.d.ts.map +1 -1
  51. package/dist/components/Content/Tag/TagList.vue.d.ts +2 -2
  52. package/dist/components/Content/Tag/TagList.vue.d.ts.map +1 -1
  53. package/dist/components/DocumentSelector/DocumentSelector.vue.js +3 -3
  54. package/dist/components/Layouts/ClassicLayout.vue.d.ts.map +1 -1
  55. package/dist/components/Layouts/ClassicLayout.vue.js +19 -17
  56. package/dist/components/Layouts/Layouts.vue.js +11 -9
  57. package/dist/components/Layouts/ModernLayout.vue2.js +22 -20
  58. package/dist/components/Section/SectionAccordion.vue.d.ts.map +1 -1
  59. package/dist/components/Section/SectionAccordion.vue.js +2 -2
  60. package/dist/components/Section/SectionAccordion.vue2.js +1 -1
  61. package/dist/components/Section/SectionContainerAccordion.vue.d.ts.map +1 -1
  62. package/dist/components/Section/SectionContainerAccordion.vue.js +2 -2
  63. package/dist/components/Section/SectionContainerAccordion.vue2.js +4 -4
  64. package/dist/components/Section/SectionHeader.vue.d.ts.map +1 -1
  65. package/dist/components/Section/SectionHeader.vue.js +2 -2
  66. package/dist/components/Sidebar/Sidebar.vue.d.ts.map +1 -1
  67. package/dist/components/Sidebar/Sidebar.vue.js +2 -2
  68. package/dist/components/Sidebar/Sidebar.vue2.js +56 -56
  69. package/dist/components/SingleApiReference.vue.d.ts.map +1 -1
  70. package/dist/components/SingleApiReference.vue.js +27 -33
  71. package/dist/esm.d.ts.map +1 -1
  72. package/dist/features/ApiClientModal/ApiClientModal.vue.d.ts +2 -2
  73. package/dist/features/ApiClientModal/ApiClientModal.vue.d.ts.map +1 -1
  74. package/dist/features/ApiClientModal/ApiClientModal.vue.js +49 -50
  75. package/dist/features/ApiClientModal/useApiClient.d.ts +196 -196
  76. package/dist/features/ApiClientModal/useApiClient.d.ts.map +1 -1
  77. package/dist/features/DocumentSource/hooks/useDocumentFetcher.d.ts +11 -0
  78. package/dist/features/DocumentSource/hooks/useDocumentFetcher.d.ts.map +1 -0
  79. package/dist/features/DocumentSource/hooks/useDocumentFetcher.js +38 -0
  80. package/dist/features/DocumentSource/hooks/useDocumentSource.d.ts +21 -0
  81. package/dist/features/DocumentSource/hooks/useDocumentSource.d.ts.map +1 -0
  82. package/dist/features/DocumentSource/hooks/useDocumentSource.js +94 -0
  83. package/dist/features/DocumentSource/index.d.ts +2 -0
  84. package/dist/features/DocumentSource/index.d.ts.map +1 -0
  85. package/dist/features/DownloadLink/DownloadLink.vue.d.ts +1 -1
  86. package/dist/features/DownloadLink/DownloadLink.vue.d.ts.map +1 -1
  87. package/dist/features/DownloadLink/DownloadLink.vue.js +1 -1
  88. package/dist/features/DownloadLink/DownloadLink.vue2.js +18 -17
  89. package/dist/features/DownloadLink/index.d.ts +1 -0
  90. package/dist/features/DownloadLink/index.d.ts.map +1 -1
  91. package/dist/features/DownloadLink/openapi-version-symbol.d.ts +2 -0
  92. package/dist/features/DownloadLink/openapi-version-symbol.d.ts.map +1 -0
  93. package/dist/features/DownloadLink/openapi-version-symbol.js +4 -0
  94. package/dist/features/ExampleRequest/ExampleRequest.vue.d.ts +2 -0
  95. package/dist/features/ExampleRequest/ExampleRequest.vue.d.ts.map +1 -1
  96. package/dist/features/ExampleRequest/ExampleRequest.vue.js +2 -2
  97. package/dist/features/ExampleRequest/ExampleRequest.vue2.js +178 -127
  98. package/dist/features/Operation/Operation.vue.d.ts +2 -2
  99. package/dist/features/Operation/Operation.vue.d.ts.map +1 -1
  100. package/dist/features/Operation/Operation.vue.js +29 -23
  101. package/dist/features/Operation/components/OperationParameters.vue.d.ts +7 -3
  102. package/dist/features/Operation/components/OperationParameters.vue.d.ts.map +1 -1
  103. package/dist/features/Operation/components/OperationParameters.vue.js +28 -24
  104. package/dist/features/Operation/components/OperationResponses.vue.d.ts +2 -2
  105. package/dist/features/Operation/components/OperationResponses.vue.d.ts.map +1 -1
  106. package/dist/features/Operation/components/ParameterHeaders.vue.d.ts +2 -2
  107. package/dist/features/Operation/components/ParameterHeaders.vue.d.ts.map +1 -1
  108. package/dist/features/Operation/components/ParameterHeaders.vue.js +2 -2
  109. package/dist/features/Operation/components/ParameterList.vue.d.ts +2 -2
  110. package/dist/features/Operation/components/ParameterList.vue.d.ts.map +1 -1
  111. package/dist/features/Operation/components/ParameterList.vue.js +2 -2
  112. package/dist/features/Operation/components/ParameterListItem.vue.d.ts +2 -2
  113. package/dist/features/Operation/components/ParameterListItem.vue.d.ts.map +1 -1
  114. package/dist/features/Operation/components/ParameterListItem.vue.js +3 -3
  115. package/dist/features/Operation/components/ParameterListItem.vue2.js +6 -6
  116. package/dist/features/Operation/components/RequestBody.vue.d.ts +7 -3
  117. package/dist/features/Operation/components/RequestBody.vue.d.ts.map +1 -1
  118. package/dist/features/Operation/components/RequestBody.vue.js +2 -2
  119. package/dist/features/Operation/components/RequestBody.vue2.js +41 -36
  120. package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts +7 -3
  121. package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts.map +1 -1
  122. package/dist/features/Operation/layouts/ClassicLayout.vue.js +2 -2
  123. package/dist/features/Operation/layouts/ClassicLayout.vue2.js +84 -79
  124. package/dist/features/Operation/layouts/ModernLayout.vue.d.ts +5 -1
  125. package/dist/features/Operation/layouts/ModernLayout.vue.d.ts.map +1 -1
  126. package/dist/features/Operation/layouts/ModernLayout.vue.js +2 -2
  127. package/dist/features/Operation/layouts/ModernLayout.vue2.js +66 -57
  128. package/dist/features/Operation/types/schemas.d.ts +2 -2
  129. package/dist/features/Operation/types/schemas.d.ts.map +1 -1
  130. package/dist/features/Search/SearchButton.vue.js +2 -2
  131. package/dist/helpers/local-storage.d.ts +8 -0
  132. package/dist/helpers/local-storage.d.ts.map +1 -0
  133. package/dist/helpers/local-storage.js +6 -0
  134. package/dist/helpers/measure.d.ts +21 -0
  135. package/dist/helpers/measure.d.ts.map +1 -0
  136. package/dist/helpers/measure.js +7 -0
  137. package/dist/helpers/parse.d.ts +3 -5
  138. package/dist/helpers/parse.d.ts.map +1 -1
  139. package/dist/helpers/parse.js +64 -86
  140. package/dist/helpers/scroll-to-id.d.ts.map +1 -1
  141. package/dist/helpers/scroll-to-id.js +18 -4
  142. package/dist/hooks/useDiscriminator.d.ts +53 -0
  143. package/dist/hooks/useDiscriminator.d.ts.map +1 -0
  144. package/dist/hooks/useDiscriminator.js +149 -0
  145. package/dist/hooks/useOperationDiscriminator.d.ts +8 -0
  146. package/dist/hooks/useOperationDiscriminator.d.ts.map +1 -0
  147. package/dist/hooks/useOperationDiscriminator.js +57 -0
  148. package/dist/index.d.ts +0 -1
  149. package/dist/index.d.ts.map +1 -1
  150. package/dist/index.js +33 -35
  151. package/dist/libs/openapi.d.ts +3 -3
  152. package/dist/libs/openapi.d.ts.map +1 -1
  153. package/dist/libs/openapi.js +35 -42
  154. package/dist/standalone/lib/html-api.d.ts.map +1 -1
  155. package/dist/standalone/lib/html-api.js +15 -15
  156. package/dist/stores/useHttpClientStore.d.ts.map +1 -1
  157. package/dist/stores/useHttpClientStore.js +19 -18
  158. package/dist/style.css +1 -1
  159. package/dist/types.d.ts +27 -3
  160. package/dist/types.d.ts.map +1 -1
  161. package/package.json +15 -16
  162. package/dist/components/Content/Schema/helpers/schema-discriminator.d.ts +0 -12
  163. package/dist/components/Content/Schema/helpers/schema-discriminator.d.ts.map +0 -1
  164. package/dist/components/Content/Schema/helpers/schema-discriminator.js +0 -45
  165. package/dist/hooks/useReactiveSpec.d.ts +0 -448
  166. package/dist/hooks/useReactiveSpec.d.ts.map +0 -1
  167. package/dist/hooks/useReactiveSpec.js +0 -59
@@ -1,17 +1,17 @@
1
- import { defineComponent as E, ref as F, computed as m, resolveComponent as I, createElementBlock as u, openBlock as s, createCommentVNode as p, createBlock as f, Fragment as A, renderList as M, createVNode as b, createElementVNode as d, unref as v, withCtx as $, toDisplayString as B } from "vue";
2
- import { ScalarListbox as Z, ScalarMarkdown as G } from "@scalar/components";
3
- import { ScalarIconCaretDown as J } from "@scalar/icons";
4
- import { stringify as T } from "flatted";
5
- import { mergeAllOfSchemas as K } from "./helpers/merge-all-of-schemas.js";
1
+ import { defineComponent as U, ref as D, computed as s, resolveComponent as E, createElementBlock as u, openBlock as m, createCommentVNode as p, createBlock as f, Fragment as H, renderList as F, createVNode as b, createElementVNode as d, unref as v, withCtx as I, toDisplayString as w } from "vue";
2
+ import { ScalarListbox as M, ScalarMarkdown as $ } from "@scalar/components";
3
+ import { ScalarIconCaretDown as R } from "@scalar/icons";
4
+ import { stringify as j } from "flatted";
5
+ import { mergeAllOfSchemas as Z } from "./helpers/merge-all-of-schemas.js";
6
6
  import { hasComposition as g } from "./helpers/schema-composition.js";
7
7
  import S from "./Schema.vue.js";
8
- const P = { class: "property-rule" }, Q = {
9
- class: "composition-selector bg-b-1.5 hover:bg-b-2 py-1.25 flex w-full cursor-pointer items-center gap-1 rounded-t-lg border border-b-0 px-2 pr-3 text-left",
8
+ const G = { class: "property-rule" }, J = {
9
+ class: "composition-selector bg-b-1.5 hover:bg-b-2 flex w-full cursor-pointer items-center gap-1 rounded-t-lg border border-b-0 px-2 py-1.25 pr-3 text-left",
10
10
  type: "button"
11
- }, R = { class: "text-c-2" }, X = { class: "composition-selector-label text-c-1 relative" }, Y = { class: "composition-panel" }, W = {
11
+ }, K = { class: "text-c-2" }, P = { class: "composition-selector-label text-c-1 relative" }, Q = { class: "composition-panel" }, X = {
12
12
  key: 0,
13
13
  class: "property-description border-x border-t p-2"
14
- }, ae = /* @__PURE__ */ E({
14
+ }, te = /* @__PURE__ */ U({
15
15
  __name: "SchemaComposition",
16
16
  props: {
17
17
  composition: {},
@@ -23,21 +23,21 @@ const P = { class: "property-rule" }, Q = {
23
23
  hideHeading: { type: Boolean }
24
24
  },
25
25
  setup(l) {
26
- const y = F(0), C = m(
26
+ const y = D(0), C = s(
27
27
  () => N.value.map((e, o) => ({
28
28
  id: String(o),
29
- label: z(e) || "Schema"
29
+ label: A(e) || "Schema"
30
30
  }))
31
- ), O = m({
31
+ ), O = s({
32
32
  get: () => C.value.find(
33
33
  (e) => e.id === String(y.value)
34
34
  ),
35
35
  set: (e) => y.value = Number(e.id)
36
- }), q = m(() => {
36
+ }), q = s(() => {
37
37
  var t;
38
38
  const e = ["oneOf", "anyOf"].includes(l.composition), o = l.composition === "allOf" && ((t = l.value[l.composition]) == null ? void 0 : t.some((n) => g(n)));
39
39
  return e || o;
40
- }), z = (e) => {
40
+ }), A = (e) => {
41
41
  if (!e)
42
42
  return null;
43
43
  if (e.title)
@@ -46,7 +46,7 @@ const P = { class: "property-rule" }, Q = {
46
46
  return e.name;
47
47
  if (l.schemas && typeof l.schemas == "object") {
48
48
  for (const [o, t] of Object.entries(l.schemas))
49
- if (T(t) === T(e))
49
+ if (j(t) === j(e))
50
50
  return o;
51
51
  }
52
52
  if (e.type === "array" && e.items)
@@ -59,11 +59,11 @@ const P = { class: "property-rule" }, Q = {
59
59
  return o[0];
60
60
  }
61
61
  return null;
62
- }, k = (e) => e.find((o) => g(o)), N = m(() => {
62
+ }, k = (e) => e.find((o) => g(o)), N = s(() => {
63
63
  if (!k(l.value[l.composition]))
64
64
  return l.value[l.composition];
65
65
  const e = k(l.value[l.composition]);
66
- return (e.oneOf || e.anyOf).map((t) => {
66
+ return (e.oneOf || e.anyOf || e.allOf).map((t) => {
67
67
  if (t.allOf) {
68
68
  const n = t.allOf.find((c) => c.title), r = t.allOf.find((c) => !c.title);
69
69
  return n && r ? {
@@ -82,7 +82,7 @@ const P = { class: "property-rule" }, Q = {
82
82
  }
83
83
  return t;
84
84
  });
85
- }), L = (e) => {
85
+ }), B = (e) => {
86
86
  var o, t;
87
87
  if (e === "allOf") {
88
88
  const n = (t = (o = l.value) == null ? void 0 : o[e]) == null ? void 0 : t.find(
@@ -94,57 +94,60 @@ const P = { class: "property-rule" }, Q = {
94
94
  return "Any of";
95
95
  }
96
96
  return e.replace(/([A-Z])/g, " $1").replace(/^./, (n) => n.toUpperCase()).toLowerCase().replace(/^(\w)/, (n) => n.toUpperCase());
97
- }, a = m(
97
+ }, i = s(
98
98
  () => N.value[y.value]
99
- ), h = m(() => {
99
+ ), h = s(() => {
100
100
  var e;
101
- return (e = a.value) != null && e.oneOf ? "oneOf" : "anyOf";
102
- }), U = m(() => {
101
+ return (e = i.value) != null && e.oneOf ? "oneOf" : "anyOf";
102
+ }), T = s(() => {
103
103
  var o;
104
104
  const e = h.value;
105
- return (o = a.value) == null ? void 0 : o[e];
105
+ return (o = i.value) == null ? void 0 : o[e];
106
+ }), z = s(() => {
107
+ const e = i.value;
108
+ return e ? !!(e.properties || e.type || e.nullable || e.const !== void 0 || e.enum || e.allOf || e.oneOf || e.anyOf || e.items) : !1;
106
109
  });
107
110
  return (e, o) => {
108
- var n, r, c, V, H, w, j;
109
- const t = I("SchemaComposition", !0);
110
- return s(), u("div", P, [
111
- e.composition === "allOf" && e.value[e.composition].some((i) => i.oneOf || i.anyOf) ? (s(!0), u(A, { key: 0 }, M(e.value[e.composition].filter(
112
- (i) => !i.oneOf && !i.anyOf
113
- ), (i, D) => (s(), f(S, {
114
- key: D,
111
+ var n, r, c, V;
112
+ const t = E("SchemaComposition", !0);
113
+ return m(), u("div", G, [
114
+ e.composition === "allOf" && e.value[e.composition].some((a) => a.oneOf || a.anyOf) ? (m(!0), u(H, { key: 0 }, F(e.value[e.composition].filter(
115
+ (a) => !a.oneOf && !a.anyOf
116
+ ), (a, L) => (m(), f(S, {
117
+ key: L,
115
118
  compact: e.compact,
116
119
  level: e.level,
117
120
  name: e.name,
118
121
  noncollapsible: e.level == 0,
119
122
  schemas: e.schemas,
120
- value: i
123
+ value: a
121
124
  }, null, 8, ["compact", "level", "name", "noncollapsible", "schemas", "value"]))), 128)) : p("", !0),
122
- q.value ? (s(), u(A, { key: 1 }, [
123
- b(v(Z), {
125
+ q.value ? (m(), u(H, { key: 1 }, [
126
+ b(v(M), {
124
127
  modelValue: O.value,
125
- "onUpdate:modelValue": o[0] || (o[0] = (i) => O.value = i),
128
+ "onUpdate:modelValue": o[0] || (o[0] = (a) => O.value = a),
126
129
  options: C.value,
127
130
  resize: ""
128
131
  }, {
129
- default: $(() => {
130
- var i;
132
+ default: I(() => {
133
+ var a;
131
134
  return [
132
- d("button", Q, [
133
- d("span", R, B(L(e.composition)), 1),
134
- d("span", X, B(((i = O.value) == null ? void 0 : i.label) || "Schema"), 1),
135
- b(v(J), { class: "z-1" })
135
+ d("button", J, [
136
+ d("span", K, w(B(e.composition)), 1),
137
+ d("span", P, w(((a = O.value) == null ? void 0 : a.label) || "Schema"), 1),
138
+ b(v(R), { class: "z-1" })
136
139
  ])
137
140
  ];
138
141
  }),
139
142
  _: 1
140
143
  }, 8, ["modelValue", "options"]),
141
- d("div", Y, [
142
- (n = a.value) != null && n.description ? (s(), u("div", W, [
143
- b(v(G), {
144
- value: a.value.description
144
+ d("div", Q, [
145
+ (n = i.value) != null && n.description ? (m(), u("div", X, [
146
+ b(v($), {
147
+ value: i.value.description
145
148
  }, null, 8, ["value"])
146
149
  ])) : p("", !0),
147
- (r = a.value) != null && r.properties || (c = a.value) != null && c.type || (V = a.value) != null && V.nullable ? (s(), f(S, {
150
+ z.value ? (m(), f(S, {
148
151
  key: 1,
149
152
  compact: e.compact,
150
153
  level: e.level + 1,
@@ -152,12 +155,13 @@ const P = { class: "property-rule" }, Q = {
152
155
  name: e.name,
153
156
  noncollapsible: !0,
154
157
  schemas: e.schemas,
155
- value: (H = a.value) != null && H.properties ? {
158
+ value: (r = i.value) != null && r.properties ? {
156
159
  type: "object",
157
- properties: a.value.properties
158
- } : a.value
160
+ properties: i.value.properties,
161
+ required: i.value.required
162
+ } : i.value
159
163
  }, null, 8, ["compact", "level", "hideHeading", "name", "schemas", "value"])) : p("", !0),
160
- (w = a.value) != null && w.oneOf || (j = a.value) != null && j.anyOf ? (s(), f(t, {
164
+ (c = i.value) != null && c.oneOf || (V = i.value) != null && V.anyOf ? (m(), f(t, {
161
165
  key: 2,
162
166
  compact: e.compact,
163
167
  composition: h.value,
@@ -167,23 +171,23 @@ const P = { class: "property-rule" }, Q = {
167
171
  noncollapsible: !0,
168
172
  schemas: e.schemas,
169
173
  value: {
170
- [h.value]: U.value
174
+ [h.value]: T.value
171
175
  }
172
176
  }, null, 8, ["compact", "composition", "hideHeading", "level", "name", "schemas", "value"])) : p("", !0)
173
177
  ])
174
- ], 64)) : (s(), f(S, {
178
+ ], 64)) : (m(), f(S, {
175
179
  key: 2,
176
180
  compact: e.compact,
177
181
  level: e.level,
178
182
  name: e.name,
179
183
  noncollapsible: e.level == 0,
180
184
  schemas: e.schemas,
181
- value: v(K)(e.value[e.composition])
185
+ value: v(Z)(e.value[e.composition])
182
186
  }, null, 8, ["compact", "level", "name", "noncollapsible", "schemas", "value"]))
183
187
  ]);
184
188
  };
185
189
  }
186
190
  });
187
191
  export {
188
- ae as default
192
+ te as default
189
193
  };
@@ -1,8 +1,7 @@
1
- import type { DiscriminatorMapping, DiscriminatorPropertyName } from './helpers/schema-discriminator.js';
1
+ import type { DiscriminatorMapping } from '../../../hooks/useDiscriminator.js';
2
2
  type __VLS_Props = {
3
3
  discriminatorMapping: DiscriminatorMapping;
4
- modelValue: string;
5
- discriminatorPropertyName?: DiscriminatorPropertyName;
4
+ discriminator: string;
6
5
  };
7
6
  declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
8
7
  "update:modelValue": (value: string) => any;
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaDiscriminator.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaDiscriminator.vue"],"names":[],"mappings":"AA2DA,OAAO,KAAK,EACV,oBAAoB,EACpB,yBAAyB,EAC1B,MAAM,gCAAgC,CAAA;AAIvC,KAAK,WAAW,GAAG;IACf,oBAAoB,EAAE,oBAAoB,CAAA;IAC1C,UAAU,EAAE,MAAM,CAAA;IAClB,yBAAyB,CAAC,EAAE,yBAAyB,CAAA;CACtD,CAAC;;;;;;AAiHJ,wBAQG"}
1
+ {"version":3,"file":"SchemaDiscriminator.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaDiscriminator.vue"],"names":[],"mappings":"AAqEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AAIpE,KAAK,WAAW,GAAG;IACjB,oBAAoB,EAAE,oBAAoB,CAAA;IAC1C,aAAa,EAAE,MAAM,CAAA;CACtB,CAAC;;;;;;AA+HF,wBAQG"}
@@ -1,42 +1,42 @@
1
- import { defineComponent as c, computed as n, createBlock as u, openBlock as b, unref as s, withCtx as f, createElementVNode as i, createVNode as V, toDisplayString as m } from "vue";
2
- import { ScalarListbox as x } from "@scalar/components";
3
- import { ScalarIconCaretDown as g } from "@scalar/icons";
4
- const v = {
5
- class: "bg-b-1.5 hover:bg-b-2 py-1.25 flex w-full items-center gap-1 border-b px-2",
1
+ import { defineComponent as p, ref as f, computed as n, createBlock as b, openBlock as g, unref as s, withCtx as v, createElementVNode as l, createVNode as x, toDisplayString as h } from "vue";
2
+ import { ScalarListbox as V } from "@scalar/components";
3
+ import { ScalarIconCaretDown as D } from "@scalar/icons";
4
+ const S = {
5
+ class: "bg-b-1.5 hover:bg-b-2 flex w-full items-center gap-1 rounded border px-2 py-1.25",
6
6
  type: "button"
7
- }, y = { class: "composition-selector-label text-c-1 relative" }, _ = /* @__PURE__ */ c({
7
+ }, _ = { class: "composition-selector-label text-c-1 relative" }, M = /* @__PURE__ */ p({
8
8
  __name: "SchemaDiscriminator",
9
9
  props: {
10
10
  discriminatorMapping: {},
11
- modelValue: {},
12
- discriminatorPropertyName: {}
11
+ discriminator: {}
13
12
  },
14
13
  emits: ["update:modelValue"],
15
- setup(l, { emit: p }) {
16
- const d = p, r = n(
17
- () => Object.keys(l.discriminatorMapping).map((e) => ({
18
- id: e,
19
- label: e
20
- }))
21
- ), a = n({
22
- get: () => r.value.find(
23
- (e) => e.id === l.modelValue
14
+ setup(i, { emit: c }) {
15
+ const m = f(""), d = c, u = (e) => {
16
+ m.value = e, d("update:modelValue", e);
17
+ }, a = n(() => i.discriminatorMapping ? Object.keys(i.discriminatorMapping).map((e) => ({
18
+ id: e,
19
+ label: e
20
+ })) : []), o = n({
21
+ get: () => a.value.find(
22
+ (e) => e.id === i.discriminator
24
23
  ),
25
- set: (e) => d("update:modelValue", e.id)
24
+ set: (e) => {
25
+ e != null && e.id && u(e.id);
26
+ }
26
27
  });
27
- return (e, t) => (b(), u(s(x), {
28
- modelValue: a.value,
29
- "onUpdate:modelValue": t[0] || (t[0] = (o) => a.value = o),
30
- options: r.value,
28
+ return (e, r) => (g(), b(s(V), {
29
+ modelValue: o.value,
30
+ "onUpdate:modelValue": r[0] || (r[0] = (t) => o.value = t),
31
+ options: a.value,
31
32
  resize: ""
32
33
  }, {
33
- default: f(() => {
34
- var o;
34
+ default: v(() => {
35
+ var t;
35
36
  return [
36
- i("button", v, [
37
- t[1] || (t[1] = i("span", { class: "text-c-2" }, "Discriminator", -1)),
38
- i("span", y, m(e.discriminatorPropertyName) + " " + m((o = a.value) == null ? void 0 : o.label), 1),
39
- V(s(g))
37
+ l("button", S, [
38
+ l("span", _, h(((t = o.value) == null ? void 0 : t.label) || "Schema"), 1),
39
+ x(s(D), { class: "z-1" })
40
40
  ])
41
41
  ];
42
42
  }),
@@ -45,5 +45,5 @@ const v = {
45
45
  }
46
46
  });
47
47
  export {
48
- _ as default
48
+ M as default
49
49
  };
@@ -1,6 +1,6 @@
1
- import type { OpenAPIV2, OpenAPIV3, OpenAPIV3_1 } from '@scalar/openapi-types';
1
+ import type { OpenAPIV3_1 } from '@scalar/openapi-types';
2
2
  type __VLS_Props = {
3
- value: OpenAPIV2.DefinitionsObject | OpenAPIV3.SchemaObject | OpenAPIV3.ArraySchemaObject | OpenAPIV3.NonArraySchemaObject | OpenAPIV3_1.SchemaObject | OpenAPIV3_1.ArraySchemaObject | OpenAPIV3_1.NonArraySchemaObject;
3
+ value: OpenAPIV3_1.SchemaObject | OpenAPIV3_1.ArraySchemaObject | OpenAPIV3_1.NonArraySchemaObject;
4
4
  name?: string;
5
5
  };
6
6
  declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaHeading.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaHeading.vue"],"names":[],"mappings":"AAqDA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAI9E,KAAK,WAAW,GAAG;IACjB,KAAK,EACD,SAAS,CAAC,iBAAiB,GAC3B,SAAS,CAAC,YAAY,GACtB,SAAS,CAAC,iBAAiB,GAC3B,SAAS,CAAC,oBAAoB,GAC9B,WAAW,CAAC,YAAY,GACxB,WAAW,CAAC,iBAAiB,GAC7B,WAAW,CAAC,oBAAoB,CAAA;IACpC,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,CAAC;;AAgFF,wBAMG"}
1
+ {"version":3,"file":"SchemaHeading.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaHeading.vue"],"names":[],"mappings":"AAiDA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAIxD,KAAK,WAAW,GAAG;IACjB,KAAK,EACD,WAAW,CAAC,YAAY,GACxB,WAAW,CAAC,iBAAiB,GAC7B,WAAW,CAAC,oBAAoB,CAAA;IACpC,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,CAAC;;AAgFF,wBAMG"}
@@ -1,7 +1,7 @@
1
1
  import o from "./SchemaHeading.vue2.js";
2
2
  /* empty css */
3
3
  import e from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const r = /* @__PURE__ */ e(o, [["__scopeId", "data-v-e45fe752"]]);
4
+ const r = /* @__PURE__ */ e(o, [["__scopeId", "data-v-eec32394"]]);
5
5
  export {
6
6
  r as default
7
7
  };
@@ -1,5 +1,5 @@
1
- import type { OpenAPIV2, OpenAPIV3, OpenAPIV3_1 } from '@scalar/openapi-types';
2
1
  import { type Component } from 'vue';
2
+ import type { Schemas } from '../../../features/Operation/types/schemas';
3
3
  /**
4
4
  * Note: We’re taking in a prop called `value` which should be a JSON Schema.
5
5
  *
@@ -18,13 +18,22 @@ type __VLS_Props = {
18
18
  additional?: boolean;
19
19
  pattern?: boolean;
20
20
  withExamples?: boolean;
21
- schemas?: OpenAPIV2.DefinitionsObject | Record<string, OpenAPIV3.SchemaObject> | Record<string, OpenAPIV3_1.SchemaObject> | unknown;
21
+ hideModelNames?: boolean;
22
+ schemas?: Schemas;
22
23
  hideHeading?: boolean;
24
+ discriminatorMapping?: Record<string, string>;
25
+ discriminatorPropertyName?: string;
26
+ isDiscriminator?: boolean;
23
27
  };
24
- declare const _default_1: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
28
+ declare const _default_1: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
29
+ "update:modelValue": (value: string) => any;
30
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
31
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
32
+ }>, {
25
33
  required: boolean;
26
34
  level: number;
27
35
  compact: boolean;
36
+ hideModelNames: boolean;
28
37
  withExamples: boolean;
29
38
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
30
39
  export default _default_1;
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaProperty.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaProperty.vue"],"names":[],"mappings":"AA+gBA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAC9E,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,KAAK,CAAA;AAc9C;;;;;GAKG;AAEH,KAAK,WAAW,GAAG;IACf,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC3B,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,OAAO,CAAC,EACJ,SAAS,CAAC,iBAAiB,GAC3B,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,YAAY,CAAC,GACtC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,YAAY,CAAC,GACxC,OAAO,CAAA;IACX,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB,CAAC;;cAZW,OAAO;WAFV,MAAM;aAGJ,OAAO;kBAIF,OAAO;;AAmd1B,0BAQG"}
1
+ {"version":3,"file":"SchemaProperty.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaProperty.vue"],"names":[],"mappings":"AA0kBA,OAAO,EAAoB,KAAK,SAAS,EAAE,MAAM,KAAK,CAAA;AAOtD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAA;AAUjE;;;;;GAKG;AAEH,KAAK,WAAW,GAAG;IACf,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC3B,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,oBAAoB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC7C,yBAAyB,CAAC,EAAE,MAAM,CAAA;IAClC,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B,CAAC;;;;;;cAZW,OAAO;WAFV,MAAM;aAGJ,OAAO;oBAKA,OAAO;kBADT,OAAO;;AAmkB1B,0BASG"}
@@ -1,7 +1,7 @@
1
1
  import o from "./SchemaProperty.vue2.js";
2
2
  /* empty css */
3
3
  import r from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const a = /* @__PURE__ */ r(o, [["__scopeId", "data-v-689c7117"]]);
4
+ const a = /* @__PURE__ */ r(o, [["__scopeId", "data-v-9998b466"]]);
5
5
  export {
6
6
  a as default
7
7
  };