@scalar/api-reference 1.25.103 → 1.25.105

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 (85) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/dist/blocks/constants.d.ts +9 -0
  3. package/dist/blocks/constants.d.ts.map +1 -0
  4. package/dist/blocks/constants.js +8 -0
  5. package/dist/blocks/helpers/getPointer.d.ts +22 -0
  6. package/dist/blocks/helpers/getPointer.d.ts.map +1 -0
  7. package/dist/blocks/helpers/getPointer.js +12 -0
  8. package/dist/blocks/hooks/useBlockProps.d.ts +32 -0
  9. package/dist/blocks/hooks/useBlockProps.d.ts.map +1 -0
  10. package/dist/blocks/hooks/useBlockProps.js +28 -0
  11. package/dist/browser/standalone.js +12848 -12744
  12. package/dist/browser/webpack-stats.json +1 -1
  13. package/dist/components/ApiReference.vue.js +31 -31
  14. package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
  15. package/dist/components/ApiReferenceLayout.vue.js +2 -2
  16. package/dist/components/ApiReferenceLayout.vue2.js +2 -1
  17. package/dist/components/Content/Introduction/Introduction.vue.d.ts.map +1 -1
  18. package/dist/components/Content/Introduction/Introduction.vue.js +1 -1
  19. package/dist/components/Content/Introduction/Introduction.vue2.js +84 -70
  20. package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
  21. package/dist/components/Content/Schema/SchemaProperty.vue.js +1 -1
  22. package/dist/components/Content/Schema/SchemaProperty.vue2.js +94 -89
  23. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts.map +1 -1
  24. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js +3 -3
  25. package/dist/components/Content/Schema/SchemaPropertyHeading.vue2.js +91 -77
  26. package/dist/components/Content/Schema/helpers/optimizeValueForDisplay.d.ts +9 -0
  27. package/dist/components/Content/Schema/helpers/optimizeValueForDisplay.d.ts.map +1 -0
  28. package/dist/components/Content/Schema/helpers/optimizeValueForDisplay.js +20 -0
  29. package/dist/components/HttpMethod/HttpMethod.vue.d.ts +2 -1
  30. package/dist/components/HttpMethod/HttpMethod.vue.d.ts.map +1 -1
  31. package/dist/components/Layouts/ClassicLayout.vue.d.ts.map +1 -1
  32. package/dist/components/Layouts/ClassicLayout.vue.js +30 -27
  33. package/dist/components/Layouts/ModernLayout.vue.d.ts.map +1 -1
  34. package/dist/components/Layouts/ModernLayout.vue.js +2 -2
  35. package/dist/components/Layouts/ModernLayout.vue2.js +55 -50
  36. package/dist/features/ApiClientModal/useApiClient.d.ts +336 -254
  37. package/dist/features/ApiClientModal/useApiClient.d.ts.map +1 -1
  38. package/dist/features/DownloadLink/DownloadLink.vue.d.ts.map +1 -1
  39. package/dist/features/DownloadLink/DownloadLink.vue.js +2 -2
  40. package/dist/features/DownloadLink/DownloadLink.vue2.js +10 -3
  41. package/dist/features/Operation/Operation.vue.d.ts.map +1 -1
  42. package/dist/features/Operation/Operation.vue.js +37 -26
  43. package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts +3 -0
  44. package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts.map +1 -1
  45. package/dist/features/Operation/layouts/ClassicLayout.vue.js +1 -1
  46. package/dist/features/Operation/layouts/ClassicLayout.vue2.js +108 -101
  47. package/dist/features/Operation/layouts/ModernLayout.vue.d.ts +3 -0
  48. package/dist/features/Operation/layouts/ModernLayout.vue.d.ts.map +1 -1
  49. package/dist/features/Operation/layouts/ModernLayout.vue.js +2 -2
  50. package/dist/features/Operation/layouts/ModernLayout.vue2.js +54 -50
  51. package/dist/helpers/get-request.d.ts +2 -0
  52. package/dist/helpers/get-request.d.ts.map +1 -1
  53. package/dist/helpers/parse.d.ts.map +1 -1
  54. package/dist/helpers/parse.js +88 -68
  55. package/dist/index.d.ts +0 -1
  56. package/dist/index.d.ts.map +1 -1
  57. package/dist/index.js +79 -83
  58. package/dist/style.css +1 -1
  59. package/package.json +12 -13
  60. package/dist/components/DarkModeToggle/DarkModeIconToggle.vue.d.ts +0 -10
  61. package/dist/components/DarkModeToggle/DarkModeIconToggle.vue.d.ts.map +0 -1
  62. package/dist/components/DarkModeToggle/DarkModeIconToggle.vue.js +0 -7
  63. package/dist/components/DarkModeToggle/DarkModeIconToggle.vue2.js +0 -30
  64. package/dist/components/DarkModeToggle/DarkModeToggle.vue.d.ts +0 -11
  65. package/dist/components/DarkModeToggle/DarkModeToggle.vue.d.ts.map +0 -1
  66. package/dist/components/DarkModeToggle/DarkModeToggle.vue.js +0 -7
  67. package/dist/components/DarkModeToggle/DarkModeToggle.vue2.js +0 -31
  68. package/dist/components/DarkModeToggle/index.d.ts +0 -3
  69. package/dist/components/DarkModeToggle/index.d.ts.map +0 -1
  70. package/dist/embeds/ExampleRequest/ExampleRequest.vue.d.ts +0 -10
  71. package/dist/embeds/ExampleRequest/ExampleRequest.vue.d.ts.map +0 -1
  72. package/dist/embeds/ExampleRequest/index.d.ts +0 -2
  73. package/dist/embeds/ExampleRequest/index.d.ts.map +0 -1
  74. package/dist/embeds/ExampleResponses/ExampleResponses.vue.d.ts +0 -7
  75. package/dist/embeds/ExampleResponses/ExampleResponses.vue.d.ts.map +0 -1
  76. package/dist/embeds/ExampleResponses/index.d.ts +0 -2
  77. package/dist/embeds/ExampleResponses/index.d.ts.map +0 -1
  78. package/dist/embeds/OpenApiDocument/OpenApiDocument.vue.d.ts +0 -782
  79. package/dist/embeds/OpenApiDocument/OpenApiDocument.vue.d.ts.map +0 -1
  80. package/dist/embeds/OpenApiDocument/index.d.ts +0 -3
  81. package/dist/embeds/OpenApiDocument/index.d.ts.map +0 -1
  82. package/dist/embeds/OpenApiDocument/types.d.ts +0 -3
  83. package/dist/embeds/OpenApiDocument/types.d.ts.map +0 -1
  84. package/dist/embeds/index.d.ts +0 -4
  85. package/dist/embeds/index.d.ts.map +0 -1
@@ -1,43 +1,44 @@
1
- import { defineComponent as Q, computed as y, openBlock as l, createElementBlock as t, normalizeClass as M, createVNode as n, createSlots as W, withCtx as v, createTextVNode as b, toDisplayString as r, unref as u, createCommentVNode as s, createElementVNode as c, Fragment as i, renderList as m, createBlock as E } from "vue";
2
- import { formatExample as X } from "./helpers/formatExample.js";
3
- import { Disclosure as Y, DisclosurePanel as _, DisclosureButton as x } from "@headlessui/vue";
4
- import { ScalarMarkdown as S, ScalarIcon as ee } from "@scalar/components";
5
- import f from "./Schema.vue.js";
6
- import le from "./SchemaPropertyHeading.vue.js";
7
- const te = {
1
+ import { defineComponent as W, computed as v, openBlock as l, createElementBlock as t, normalizeClass as G, createVNode as n, createSlots as X, withCtx as y, createTextVNode as E, toDisplayString as r, unref as i, createCommentVNode as s, createElementVNode as c, Fragment as u, renderList as m, createBlock as S } from "vue";
2
+ import { formatExample as Y } from "./helpers/formatExample.js";
3
+ import { optimizeValueForDisplay as _, discriminators as x } from "./helpers/optimizeValueForDisplay.js";
4
+ import { Disclosure as ee, DisclosurePanel as le, DisclosureButton as te } from "@headlessui/vue";
5
+ import { ScalarMarkdown as B, ScalarIcon as ae } from "@scalar/components";
6
+ import h from "./Schema.vue.js";
7
+ import oe from "./SchemaPropertyHeading.vue.js";
8
+ const se = {
8
9
  key: 0,
9
10
  class: "property-description"
10
- }, ae = {
11
+ }, ne = {
11
12
  key: 1,
12
13
  class: "property-description"
13
- }, oe = {
14
+ }, re = {
14
15
  key: 2,
15
16
  class: "property-example custom-scroll"
16
- }, se = { class: "property-example-value" }, ne = {
17
+ }, ie = { class: "property-example-value" }, ue = {
17
18
  key: 3,
18
19
  class: "property-example custom-scroll"
19
- }, re = { class: "property-example-label" }, ie = {
20
+ }, pe = { class: "property-example-label" }, me = {
20
21
  key: 4,
21
22
  class: "property-enum"
22
- }, ue = {
23
+ }, de = {
23
24
  key: 0,
24
25
  class: "property-list"
25
- }, pe = { class: "property-heading" }, me = { class: "property-name" }, de = { class: "property-description" }, ce = {
26
+ }, ce = { class: "property-heading" }, ve = { class: "property-name" }, ye = { class: "property-description" }, fe = {
26
27
  key: 1,
27
28
  class: "property-enum-values"
28
- }, ve = {
29
+ }, he = {
29
30
  key: 5,
30
31
  class: "children"
31
- }, ye = {
32
+ }, ge = {
32
33
  key: 0,
33
34
  class: "children"
34
- }, fe = {
35
+ }, ke = {
35
36
  key: 0,
36
37
  class: "property-rule"
37
- }, he = {
38
+ }, be = {
38
39
  key: 1,
39
40
  class: "property-rule"
40
- }, De = /* @__PURE__ */ Q({
41
+ }, je = /* @__PURE__ */ W({
41
42
  __name: "SchemaProperty",
42
43
  props: {
43
44
  value: {},
@@ -49,8 +50,8 @@ const te = {
49
50
  additional: { type: Boolean },
50
51
  withExamples: { type: Boolean, default: !0 }
51
52
  },
52
- setup($) {
53
- const h = $, B = {
53
+ setup(J) {
54
+ const f = J, D = {
54
55
  integer: {
55
56
  _default: "Integer numbers.",
56
57
  int32: "Signed 32-bit integers (commonly used integer type).",
@@ -63,109 +64,109 @@ const te = {
63
64
  byte: "base64-encoded characters, for example, U3dhZ2dlciByb2Nrcw==",
64
65
  binary: "binary data, used to describe files"
65
66
  }
66
- }, D = function(e, o) {
67
+ }, w = function(e, o) {
67
68
  return o != null && o.properties || o != null && o.additionalProperties ? null : e || (o == null ? void 0 : o.description) || null;
68
- }, w = function(e) {
69
- return !e || !B[e.type] ? null : B[e.type][e.format || "_default"];
69
+ }, C = function(e) {
70
+ return !e || !D[e.type] ? null : D[e.type][e.format || "_default"];
70
71
  }, d = function(e) {
71
72
  var o;
72
73
  return (e == null ? void 0 : e.enum) || ((o = e == null ? void 0 : e.items) == null ? void 0 : o.enum) || [];
73
- }, G = ["oneOf", "anyOf", "allOf", "not"], C = y(() => d(h.value).length > 9), P = y(() => C.value ? 5 : 9), J = y(
74
- () => d(h.value).slice(0, P.value)
75
- ), K = y(
76
- () => d(h.value).slice(P.value)
77
- );
74
+ }, P = v(() => d(f.value).length > 9), j = v(() => P.value ? 5 : 9), K = v(
75
+ () => d(f.value).slice(0, j.value)
76
+ ), Q = v(
77
+ () => d(f.value).slice(j.value)
78
+ ), g = v(() => _(f.value));
78
79
  return (e, o) => {
79
- var j, N, O, q, F, I, L, V, z, H, R, T, U;
80
+ var F, N, V, q, z, I, L, H, O, R, T, U, Z;
80
81
  return l(), t("div", {
81
- class: M(["property", [
82
+ class: G(["property", [
82
83
  `property--level-${e.level}`,
83
84
  {
84
85
  "property--compact": e.compact,
85
- "property--deprecated": (j = e.value) == null ? void 0 : j.deprecated
86
+ "property--deprecated": (F = e.value) == null ? void 0 : F.deprecated
86
87
  }
87
88
  ]])
88
89
  }, [
89
- n(le, {
90
+ n(oe, {
90
91
  additional: e.additional,
91
92
  enum: d(e.value).length > 0,
92
93
  required: e.required,
93
- value: e.value
94
- }, W({ _: 2 }, [
94
+ value: g.value
95
+ }, X({ _: 2 }, [
95
96
  e.name ? {
96
97
  name: "name",
97
- fn: v(() => [
98
- b(r(e.name), 1)
98
+ fn: y(() => [
99
+ E(r(e.name), 1)
99
100
  ]),
100
101
  key: "0"
101
102
  } : void 0,
102
103
  (N = e.value) != null && N.example ? {
103
104
  name: "example",
104
- fn: v(() => [
105
- b(" Example: " + r(e.value.example), 1)
105
+ fn: y(() => [
106
+ E(" Example: " + r(e.value.example), 1)
106
107
  ]),
107
108
  key: "1"
108
109
  } : void 0
109
110
  ]), 1032, ["additional", "enum", "required", "value"]),
110
- D(e.description, e.value) ? (l(), t("div", te, [
111
- n(u(S), {
112
- value: D(e.description, e.value)
111
+ w(e.description, e.value) ? (l(), t("div", se, [
112
+ n(i(B), {
113
+ value: w(e.description, e.value)
113
114
  }, null, 8, ["value"])
114
- ])) : w(e.value) ? (l(), t("div", ae, [
115
- n(u(S), {
116
- value: w(e.value) || ""
115
+ ])) : C(e.value) ? (l(), t("div", ne, [
116
+ n(i(B), {
117
+ value: C(e.value) || ""
117
118
  }, null, 8, ["value"])
118
119
  ])) : s("", !0),
119
- e.withExamples && ((O = e.value) != null && O.example || (F = (q = e.value) == null ? void 0 : q.items) != null && F.example) ? (l(), t("div", oe, [
120
+ e.withExamples && ((V = e.value) != null && V.example || (z = (q = e.value) == null ? void 0 : q.items) != null && z.example) ? (l(), t("div", re, [
120
121
  o[0] || (o[0] = c("span", { class: "property-example-label" }, "Example", -1)),
121
- c("code", se, r(u(X)(e.value.example || ((I = e.value) == null ? void 0 : I.items.example))), 1)
122
+ c("code", ie, r(i(Y)(e.value.example || ((I = e.value) == null ? void 0 : I.items.example))), 1)
122
123
  ])) : s("", !0),
123
- (L = e.value) != null && L.examples && typeof e.value.examples == "object" && Object.keys(e.value.examples).length > 0 ? (l(), t("div", ne, [
124
- c("span", re, r(Object.keys(e.value.examples).length === 1 ? "Example" : "Examples"), 1),
125
- (l(!0), t(i, null, m(e.value.examples, (a, p) => (l(), t("code", {
124
+ (L = e.value) != null && L.examples && typeof e.value.examples == "object" && Object.keys(e.value.examples).length > 0 ? (l(), t("div", ue, [
125
+ c("span", pe, r(Object.keys(e.value.examples).length === 1 ? "Example" : "Examples"), 1),
126
+ (l(!0), t(u, null, m(e.value.examples, (a, p) => (l(), t("code", {
126
127
  key: p,
127
128
  class: "property-example-value"
128
129
  }, r(a), 1))), 128))
129
130
  ])) : s("", !0),
130
- ((V = d(e.value)) == null ? void 0 : V.length) > 0 ? (l(), t("div", ie, [
131
- (z = e.value) != null && z["x-enumDescriptions"] ? (l(), t("div", ue, [
132
- (l(!0), t(i, null, m(d(e.value), (a) => (l(), t("div", {
131
+ ((H = d(e.value)) == null ? void 0 : H.length) > 0 ? (l(), t("div", me, [
132
+ (O = e.value) != null && O["x-enumDescriptions"] ? (l(), t("div", de, [
133
+ (l(!0), t(u, null, m(d(e.value), (a) => (l(), t("div", {
133
134
  key: a,
134
135
  class: "property"
135
136
  }, [
136
- c("div", pe, [
137
- c("div", me, r(a), 1)
137
+ c("div", ce, [
138
+ c("div", ve, r(a), 1)
138
139
  ]),
139
- c("div", de, [
140
- n(u(S), {
140
+ c("div", ye, [
141
+ n(i(B), {
141
142
  value: e.value["x-enumDescriptions"][a]
142
143
  }, null, 8, ["value"])
143
144
  ])
144
145
  ]))), 128))
145
- ])) : (l(), t("ul", ce, [
146
- (l(!0), t(i, null, m(J.value, (a) => (l(), t("li", {
146
+ ])) : (l(), t("ul", fe, [
147
+ (l(!0), t(u, null, m(K.value, (a) => (l(), t("li", {
147
148
  key: a,
148
149
  class: "property-enum-value"
149
150
  }, r(a), 1))), 128)),
150
- C.value ? (l(), E(u(Y), { key: 0 }, {
151
- default: v(({ open: a }) => [
152
- n(u(_), null, {
153
- default: v(() => [
154
- (l(!0), t(i, null, m(K.value, (p) => (l(), t("li", {
151
+ P.value ? (l(), S(i(ee), { key: 0 }, {
152
+ default: y(({ open: a }) => [
153
+ n(i(le), null, {
154
+ default: y(() => [
155
+ (l(!0), t(u, null, m(Q.value, (p) => (l(), t("li", {
155
156
  key: p,
156
157
  class: "property-enum-value"
157
158
  }, r(p), 1))), 128))
158
159
  ]),
159
160
  _: 1
160
161
  }),
161
- n(u(x), { class: "enum-toggle-button" }, {
162
- default: v(() => [
163
- n(u(ee), {
164
- class: M(["enum-toggle-button-icon", { "enum-toggle-button-icon--open": a }]),
162
+ n(i(te), { class: "enum-toggle-button" }, {
163
+ default: y(() => [
164
+ n(i(ae), {
165
+ class: G(["enum-toggle-button-icon", { "enum-toggle-button-icon--open": a }]),
165
166
  icon: "Add",
166
167
  size: "sm"
167
168
  }, null, 8, ["class"]),
168
- b(" " + r(a ? "Hide values" : "Show all values"), 1)
169
+ E(" " + r(a ? "Hide values" : "Show all values"), 1)
169
170
  ]),
170
171
  _: 2
171
172
  }, 1024)
@@ -174,47 +175,51 @@ const te = {
174
175
  })) : s("", !0)
175
176
  ]))
176
177
  ])) : s("", !0),
177
- ((H = e.value) == null ? void 0 : H.type) === "object" && ((R = e.value) != null && R.properties || (T = e.value) != null && T.additionalProperties) ? (l(), t("div", ve, [
178
- n(f, {
178
+ ((R = e.value) == null ? void 0 : R.type) === "object" && ((T = e.value) != null && T.properties || (U = e.value) != null && U.additionalProperties) ? (l(), t("div", he, [
179
+ n(h, {
179
180
  compact: e.compact,
180
181
  level: e.level + 1,
181
182
  value: e.value
182
183
  }, null, 8, ["compact", "level", "value"])
183
184
  ])) : s("", !0),
184
- (U = e.value) != null && U.items ? (l(), t(i, { key: 6 }, [
185
- ["object"].includes(e.value.items.type) ? (l(), t("div", ye, [
186
- n(f, {
185
+ (Z = e.value) != null && Z.items ? (l(), t(u, { key: 6 }, [
186
+ ["object"].includes(e.value.items.type) ? (l(), t("div", ge, [
187
+ n(h, {
187
188
  compact: e.compact,
188
189
  level: e.level + 1,
189
190
  value: e.value.items
190
191
  }, null, 8, ["compact", "level", "value"])
191
192
  ])) : s("", !0)
192
193
  ], 64)) : s("", !0),
193
- (l(), t(i, null, m(G, (a) => {
194
- var p, Z, A;
195
- return l(), t(i, { key: a }, [
196
- (p = e.value) != null && p[a] ? (l(), t("div", fe, [
197
- (l(!0), t(i, null, m(e.value[a], (g, k) => (l(), E(f, {
198
- key: k,
199
- compact: e.compact,
200
- level: e.level + 1,
201
- value: g
202
- }, null, 8, ["compact", "level", "value"]))), 128))
194
+ (l(!0), t(u, null, m(i(x), (a) => {
195
+ var p, A, M;
196
+ return l(), t(u, { key: a }, [
197
+ (p = g.value) != null && p[a] ? (l(), t("div", ke, [
198
+ (l(!0), t(u, null, m(g.value[a], (k, b) => {
199
+ var $;
200
+ return l(), S(h, {
201
+ key: b,
202
+ compact: e.compact,
203
+ level: e.level + 1,
204
+ noncollapsible: (($ = e.value) == null ? void 0 : $[a].length) === 1,
205
+ value: k
206
+ }, null, 8, ["compact", "level", "noncollapsible", "value"]);
207
+ }), 128))
203
208
  ])) : s("", !0),
204
- (A = (Z = e.value) == null ? void 0 : Z.items) != null && A[a] && e.level < 3 ? (l(), t("div", he, [
205
- (l(!0), t(i, null, m(e.value.items[a], (g, k) => (l(), E(f, {
206
- key: k,
209
+ (M = (A = e.value) == null ? void 0 : A.items) != null && M[a] && e.level < 3 ? (l(), t("div", be, [
210
+ (l(!0), t(u, null, m(e.value.items[a], (k, b) => (l(), S(h, {
211
+ key: b,
207
212
  compact: e.compact,
208
213
  level: e.level + 1,
209
- value: g
214
+ value: k
210
215
  }, null, 8, ["compact", "level", "value"]))), 128))
211
216
  ])) : s("", !0)
212
217
  ], 64);
213
- }), 64))
218
+ }), 128))
214
219
  ], 2);
215
220
  };
216
221
  }
217
222
  });
218
223
  export {
219
- De as default
224
+ je as default
220
225
  };
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaPropertyHeading.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaPropertyHeading.vue"],"names":[],"mappings":"AAiNA,KAAK,WAAW,GAAG;IACf,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC3B,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,CAAC;AA0BJ,iBAAS,cAAc;WA0QT,OAAO,IAA6B;;sBARxB,GAAG;;;;EAa5B;AAaD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;cAzTN,OAAO;wFAiUpB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAgBpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"SchemaPropertyHeading.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaPropertyHeading.vue"],"names":[],"mappings":"AA2NA,KAAK,WAAW,GAAG;IACf,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC3B,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,CAAC;AA0BJ,iBAAS,cAAc;WA0RT,OAAO,IAA6B;;sBARxB,GAAG;;;;EAa5B;AAaD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;cAzUN,OAAO;wFAiVpB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAgBpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import o from "./SchemaPropertyHeading.vue2.js";
2
2
  /* empty css */
3
- import r from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const e = /* @__PURE__ */ r(o, [["__scopeId", "data-v-3cb6c79a"]]);
3
+ import a from "../../../_virtual/_plugin-vue_export-helper.js";
4
+ const m = /* @__PURE__ */ a(o, [["__scopeId", "data-v-e3aa4b0d"]]);
5
5
  export {
6
- e as default
6
+ m as default
7
7
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent as P, openBlock as u, createElementBlock as n, renderSlot as S, createCommentVNode as t, Fragment as s, createTextVNode as a, toDisplayString as i, createVNode as v, unref as O, withCtx as l, createBlock as d, renderList as V } from "vue";
1
+ import { defineComponent as P, openBlock as u, createElementBlock as n, renderSlot as S, createCommentVNode as t, Fragment as s, createTextVNode as l, toDisplayString as i, createVNode as v, unref as b, withCtx as r, createBlock as d, renderList as V } from "vue";
2
2
  import o from "./SchemaPropertyDetail.vue.js";
3
3
  import w from "../../Badge/Badge.vue.js";
4
4
  const C = { class: "property-heading" }, D = {
@@ -7,22 +7,22 @@ const C = { class: "property-heading" }, D = {
7
7
  }, $ = {
8
8
  key: 1,
9
9
  class: "property-additional"
10
- }, b = {
10
+ }, j = {
11
11
  key: 2,
12
12
  class: "property-deprecated"
13
- }, j = {
13
+ }, E = {
14
14
  key: 3,
15
15
  class: "property-const"
16
- }, E = {
17
- key: 5,
18
- class: "property-write-only"
19
16
  }, F = {
20
17
  key: 6,
21
- class: "property-read-only"
18
+ class: "property-write-only"
22
19
  }, H = {
23
20
  key: 7,
21
+ class: "property-read-only"
22
+ }, T = {
23
+ key: 8,
24
24
  class: "property-required"
25
- }, K = /* @__PURE__ */ P({
25
+ }, Q = /* @__PURE__ */ P({
26
26
  __name: "SchemaPropertyHeading",
27
27
  props: {
28
28
  value: {},
@@ -30,119 +30,119 @@ const C = { class: "property-heading" }, D = {
30
30
  required: { type: Boolean, default: !1 },
31
31
  additional: { type: Boolean }
32
32
  },
33
- setup(T) {
33
+ setup(z) {
34
34
  const A = ["oneOf", "anyOf", "allOf", "not"], M = (e) => Array.isArray(e == null ? void 0 : e.default) && e.default.length === 1 ? e.default[0] : e == null ? void 0 : e.default;
35
- return (e, r) => {
36
- var f, k, g, B, q, I, L;
35
+ return (e, a) => {
36
+ var f, k, g, B, q, I, L, N;
37
37
  return u(), n("div", C, [
38
38
  e.$slots.name ? (u(), n("div", D, [
39
39
  S(e.$slots, "name", {}, void 0, !0)
40
40
  ])) : t("", !0),
41
41
  e.additional ? (u(), n("div", $, [
42
42
  (f = e.value) != null && f["x-additionalPropertiesName"] ? (u(), n(s, { key: 0 }, [
43
- a(i(e.value["x-additionalPropertiesName"]), 1)
43
+ l(i(e.value["x-additionalPropertiesName"]), 1)
44
44
  ], 64)) : (u(), n(s, { key: 1 }, [
45
- a("additional properties")
45
+ l("additional properties")
46
46
  ], 64))
47
47
  ])) : t("", !0),
48
- (k = e.value) != null && k.deprecated ? (u(), n("div", b, [
49
- v(O(w), null, {
50
- default: l(() => r[0] || (r[0] = [
51
- a("deprecated")
48
+ (k = e.value) != null && k.deprecated ? (u(), n("div", j, [
49
+ v(b(w), null, {
50
+ default: r(() => a[0] || (a[0] = [
51
+ l("deprecated")
52
52
  ])),
53
53
  _: 1
54
54
  })
55
55
  ])) : t("", !0),
56
- (g = e.value) != null && g.const || (B = e.value) != null && B.enum && e.value.enum.length === 1 ? (u(), n("div", j, [
56
+ (g = e.value) != null && g.const || (B = e.value) != null && B.enum && e.value.enum.length === 1 ? (u(), n("div", E, [
57
57
  v(o, { truncate: "" }, {
58
- prefix: l(() => r[1] || (r[1] = [
59
- a("const:")
58
+ prefix: r(() => a[1] || (a[1] = [
59
+ l("const:")
60
60
  ])),
61
- default: l(() => [
62
- a(" " + i(e.value.const ?? e.value.enum[0]), 1)
61
+ default: r(() => [
62
+ l(" " + i(e.value.const ?? e.value.enum[0]), 1)
63
63
  ]),
64
64
  _: 1
65
65
  })
66
66
  ])) : (q = e.value) != null && q.type ? (u(), n(s, { key: 4 }, [
67
67
  v(o, null, {
68
- default: l(() => {
69
- var m, p, y;
68
+ default: r(() => {
69
+ var m, y, p;
70
70
  return [
71
- (p = (m = e.value) == null ? void 0 : m.items) != null && p.type ? (u(), n(s, { key: 0 }, [
72
- a(i(e.value.type) + " " + i(e.value.items.type) + "[] ", 1)
71
+ (y = (m = e.value) == null ? void 0 : m.items) != null && y.type ? (u(), n(s, { key: 0 }, [
72
+ l(i(e.value.type) + " " + i(e.value.items.type) + "[] ", 1)
73
73
  ], 64)) : (u(), n(s, { key: 1 }, [
74
- a(i(Array.isArray(e.value.type) ? e.value.type.join(" | ") : e.value.type) + " " + i((y = e.value) != null && y.nullable ? " | nullable" : ""), 1)
74
+ l(i(Array.isArray(e.value.type) ? e.value.type.join(" | ") : e.value.type) + " " + i((p = e.value) != null && p.nullable ? " | nullable" : ""), 1)
75
75
  ], 64)),
76
76
  e.value.minItems || e.value.maxItems ? (u(), n(s, { key: 2 }, [
77
- a(i(e.value.minItems) + "…" + i(e.value.maxItems), 1)
77
+ l(i(e.value.minItems) + "…" + i(e.value.maxItems), 1)
78
78
  ], 64)) : t("", !0)
79
79
  ];
80
80
  }),
81
81
  _: 1
82
82
  }),
83
83
  e.value.minLength ? (u(), d(o, { key: 0 }, {
84
- prefix: l(() => r[2] || (r[2] = [
85
- a("min:")
84
+ prefix: r(() => a[2] || (a[2] = [
85
+ l("min:")
86
86
  ])),
87
- default: l(() => [
88
- a(" " + i(e.value.minLength), 1)
87
+ default: r(() => [
88
+ l(" " + i(e.value.minLength), 1)
89
89
  ]),
90
90
  _: 1
91
91
  })) : t("", !0),
92
92
  e.value.maxLength ? (u(), d(o, { key: 1 }, {
93
- prefix: l(() => r[3] || (r[3] = [
94
- a("max:")
93
+ prefix: r(() => a[3] || (a[3] = [
94
+ l("max:")
95
95
  ])),
96
- default: l(() => [
97
- a(" " + i(e.value.maxLength), 1)
96
+ default: r(() => [
97
+ l(" " + i(e.value.maxLength), 1)
98
98
  ]),
99
99
  _: 1
100
100
  })) : t("", !0),
101
101
  e.value.uniqueItems ? (u(), d(o, { key: 2 }, {
102
- default: l(() => r[4] || (r[4] = [
103
- a(" unique! ")
102
+ default: r(() => a[4] || (a[4] = [
103
+ l(" unique! ")
104
104
  ])),
105
105
  _: 1
106
106
  })) : t("", !0),
107
107
  e.value.format ? (u(), d(o, { key: 3 }, {
108
- default: l(() => [
109
- a(i(e.value.format), 1)
108
+ default: r(() => [
109
+ l(i(e.value.format), 1)
110
110
  ]),
111
111
  _: 1
112
112
  })) : t("", !0),
113
113
  e.value.minimum !== void 0 && e.value.exclusiveMinimum ? (u(), d(o, { key: 4 }, {
114
- prefix: l(() => r[5] || (r[5] = [
115
- a("greater than:")
114
+ prefix: r(() => a[5] || (a[5] = [
115
+ l("greater than:")
116
116
  ])),
117
- default: l(() => [
118
- a(" " + i(e.value.minimum), 1)
117
+ default: r(() => [
118
+ l(" " + i(e.value.minimum), 1)
119
119
  ]),
120
120
  _: 1
121
121
  })) : t("", !0),
122
122
  e.value.minimum !== void 0 && !e.value.exclusiveMinimum ? (u(), d(o, { key: 5 }, {
123
- prefix: l(() => r[6] || (r[6] = [
124
- a("min:")
123
+ prefix: r(() => a[6] || (a[6] = [
124
+ l("min:")
125
125
  ])),
126
- default: l(() => [
127
- a(" " + i(e.value.minimum), 1)
126
+ default: r(() => [
127
+ l(" " + i(e.value.minimum), 1)
128
128
  ]),
129
129
  _: 1
130
130
  })) : t("", !0),
131
131
  e.value.maximum !== void 0 && e.value.exclusiveMaximum ? (u(), d(o, { key: 6 }, {
132
- prefix: l(() => r[7] || (r[7] = [
133
- a("less than:")
132
+ prefix: r(() => a[7] || (a[7] = [
133
+ l("less than:")
134
134
  ])),
135
- default: l(() => [
136
- a(" " + i(e.value.maximum), 1)
135
+ default: r(() => [
136
+ l(" " + i(e.value.maximum), 1)
137
137
  ]),
138
138
  _: 1
139
139
  })) : t("", !0),
140
140
  e.value.maximum !== void 0 && !e.value.exclusiveMaximum ? (u(), d(o, { key: 7 }, {
141
- prefix: l(() => r[8] || (r[8] = [
142
- a("max:")
141
+ prefix: r(() => a[8] || (a[8] = [
142
+ l("max:")
143
143
  ])),
144
- default: l(() => [
145
- a(" " + i(e.value.maximum), 1)
144
+ default: r(() => [
145
+ l(" " + i(e.value.maximum), 1)
146
146
  ]),
147
147
  _: 1
148
148
  })) : t("", !0),
@@ -151,14 +151,14 @@ const C = { class: "property-heading" }, D = {
151
151
  code: "",
152
152
  truncate: ""
153
153
  }, {
154
- default: l(() => [
155
- a(i(e.value.pattern), 1)
154
+ default: r(() => [
155
+ l(i(e.value.pattern), 1)
156
156
  ]),
157
157
  _: 1
158
158
  })) : t("", !0),
159
159
  e.$props.enum ? (u(), d(o, { key: 9 }, {
160
- default: l(() => r[9] || (r[9] = [
161
- a("enum")
160
+ default: r(() => a[9] || (a[9] = [
161
+ l("enum")
162
162
  ])),
163
163
  _: 1
164
164
  })) : t("", !0),
@@ -166,30 +166,44 @@ const C = { class: "property-heading" }, D = {
166
166
  key: 10,
167
167
  truncate: ""
168
168
  }, {
169
- prefix: l(() => r[10] || (r[10] = [
170
- a("default:")
169
+ prefix: r(() => a[10] || (a[10] = [
170
+ l("default:")
171
171
  ])),
172
- default: l(() => [
173
- a(" " + i(M(e.value)), 1)
172
+ default: r(() => [
173
+ l(" " + i(M(e.value)), 1)
174
174
  ]),
175
175
  _: 1
176
176
  })) : t("", !0)
177
- ], 64)) : t("", !0),
178
- (I = e.value) != null && I.writeOnly ? (u(), n("div", E, " write-only ")) : (L = e.value) != null && L.readOnly ? (u(), n("div", F, " read-only ")) : t("", !0),
179
- (u(!0), n(s, null, V(A.filter((m) => {
180
- var p, y, N;
181
- return ((p = e.value) == null ? void 0 : p[m]) || ((N = (y = e.value) == null ? void 0 : y.items) == null ? void 0 : N[m]);
182
- }), (m) => (u(), d(O(w), { key: m }, {
183
- default: l(() => [
184
- a(i(m), 1)
185
- ]),
186
- _: 2
187
- }, 1024))), 128)),
188
- e.required ? (u(), n("div", H, " required ")) : t("", !0)
177
+ ], 64)) : (u(), n(s, { key: 5 }, [
178
+ ((I = e.value) == null ? void 0 : I.nullable) === !0 ? (u(), d(o, { key: 0 }, {
179
+ default: r(() => a[11] || (a[11] = [
180
+ l(" nullable ")
181
+ ])),
182
+ _: 1
183
+ })) : t("", !0)
184
+ ], 64)),
185
+ (L = e.value) != null && L.writeOnly ? (u(), n("div", F, " write-only ")) : (N = e.value) != null && N.readOnly ? (u(), n("div", H, " read-only ")) : t("", !0),
186
+ (u(!0), n(s, null, V(A.filter(
187
+ (m) => {
188
+ var y, p, O;
189
+ return ((y = e.value) == null ? void 0 : y[m]) || ((O = (p = e.value) == null ? void 0 : p.items) == null ? void 0 : O[m]);
190
+ }
191
+ ), (m) => {
192
+ var y, p;
193
+ return u(), n(s, { key: m }, [
194
+ ((p = (y = e.value) == null ? void 0 : y[m]) == null ? void 0 : p.length) > 1 ? (u(), d(b(w), { key: 0 }, {
195
+ default: r(() => [
196
+ l(i(m), 1)
197
+ ]),
198
+ _: 2
199
+ }, 1024)) : t("", !0)
200
+ ], 64);
201
+ }), 128)),
202
+ e.required ? (u(), n("div", T, " required ")) : t("", !0)
189
203
  ]);
190
204
  };
191
205
  }
192
206
  });
193
207
  export {
194
- K as default
208
+ Q as default
195
209
  };
@@ -0,0 +1,9 @@
1
+ import type { UnknownObject } from '@scalar/types/utils';
2
+ export declare const discriminators: string[];
3
+ /**
4
+ * Optimize the value by removing nulls from discriminators.
5
+ */
6
+ export declare function optimizeValueForDisplay(value: UnknownObject | undefined): {
7
+ [x: string]: unknown;
8
+ } | undefined;
9
+ //# sourceMappingURL=optimizeValueForDisplay.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"optimizeValueForDisplay.d.ts","sourceRoot":"","sources":["../../../../../src/components/Content/Schema/helpers/optimizeValueForDisplay.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAExD,eAAO,MAAM,cAAc,UAAqC,CAAA;AAEhE;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,aAAa,GAAG,SAAS;;cAwDvE"}
@@ -0,0 +1,20 @@
1
+ const c = ["oneOf", "anyOf", "allOf", "not"];
2
+ function y(o) {
3
+ var s;
4
+ if (!o || typeof o != "object")
5
+ return o;
6
+ let r = { ...o };
7
+ const t = c.find((i) => r == null ? void 0 : r[i]);
8
+ if (!t || t === "not")
9
+ return r;
10
+ const f = r == null ? void 0 : r[t];
11
+ if (!Array.isArray(f))
12
+ return r;
13
+ f.some((i) => i.type === "null") && (r.nullable = !0);
14
+ const n = f.filter((i) => i.type !== "null");
15
+ return n.length === 1 && (r != null && r[t]) ? (r = { ...r, ...n[0] }, r == null || delete r[t], r) : (Array.isArray(r == null ? void 0 : r[t]) && ((s = r == null ? void 0 : r[t]) == null ? void 0 : s.length) > 1 && (r[t] = n), r);
16
+ }
17
+ export {
18
+ c as discriminators,
19
+ y as optimizeValueForDisplay
20
+ };