@scalar/api-reference 1.32.0 → 1.32.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/CHANGELOG.md +83 -0
  2. package/README.md +1 -1
  3. package/dist/browser/standalone.js +15732 -15435
  4. package/dist/browser/webpack-stats.json +1 -1
  5. package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
  6. package/dist/components/ApiReferenceLayout.vue.js +1 -1
  7. package/dist/components/ApiReferenceLayout.vue2.js +163 -158
  8. package/dist/components/Badge/Badge.vue.d.ts.map +1 -1
  9. package/dist/components/Badge/Badge.vue.js +1 -1
  10. package/dist/components/Card/CardHeader.vue.d.ts.map +1 -1
  11. package/dist/components/Card/CardHeader.vue.js +2 -2
  12. package/dist/components/Card/CardTab.vue.d.ts.map +1 -1
  13. package/dist/components/Card/CardTab.vue.js +3 -3
  14. package/dist/components/Card/CardTabHeader.vue.d.ts.map +1 -1
  15. package/dist/components/Card/CardTabHeader.vue.js +2 -2
  16. package/dist/components/Content/ClientLibraries/ClientLibraries.vue.js +1 -1
  17. package/dist/components/Content/ClientLibraries/ClientSelector.vue.js +1 -1
  18. package/dist/components/Content/Introduction/Introduction.vue.js +2 -2
  19. package/dist/components/Content/Lazy/Loading.vue.d.ts +1 -3
  20. package/dist/components/Content/Lazy/Loading.vue.d.ts.map +1 -1
  21. package/dist/components/Content/Lazy/Loading.vue.js +92 -91
  22. package/dist/components/Content/Models/Models.vue.d.ts.map +1 -1
  23. package/dist/components/Content/Models/Models.vue.js +2 -2
  24. package/dist/components/Content/Models/Models.vue2.js +59 -56
  25. package/dist/components/Content/Schema/RenderString.vue.d.ts +6 -0
  26. package/dist/components/Content/Schema/RenderString.vue.d.ts.map +1 -0
  27. package/dist/components/Content/Schema/RenderString.vue.js +14 -0
  28. package/dist/components/Content/Schema/RenderString.vue2.js +4 -0
  29. package/dist/components/Content/Schema/Schema.vue.d.ts +1 -1
  30. package/dist/components/Content/Schema/Schema.vue.d.ts.map +1 -1
  31. package/dist/components/Content/Schema/Schema.vue.js +2 -2
  32. package/dist/components/Content/Schema/Schema.vue2.js +76 -75
  33. package/dist/components/Content/Schema/SchemaComposition.vue.d.ts.map +1 -1
  34. package/dist/components/Content/Schema/SchemaComposition.vue.js +58 -66
  35. package/dist/components/Content/Schema/SchemaEnumValues.vue.d.ts +19 -0
  36. package/dist/components/Content/Schema/SchemaEnumValues.vue.d.ts.map +1 -0
  37. package/dist/components/Content/Schema/SchemaEnumValues.vue.js +7 -0
  38. package/dist/components/Content/Schema/SchemaEnumValues.vue2.js +125 -0
  39. package/dist/components/Content/Schema/SchemaProperty.vue.d.ts +2 -2
  40. package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
  41. package/dist/components/Content/Schema/SchemaProperty.vue.js +1 -1
  42. package/dist/components/Content/Schema/SchemaProperty.vue2.js +96 -170
  43. package/dist/components/Content/Schema/SchemaPropertyDescription.vue.d.ts +18 -0
  44. package/dist/components/Content/Schema/SchemaPropertyDescription.vue.d.ts.map +1 -0
  45. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts.map +1 -1
  46. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js +1 -1
  47. package/dist/components/Content/Schema/SchemaPropertyHeading.vue2.js +155 -160
  48. package/dist/components/Content/Schema/helpers/get-schema-type.d.ts +6 -0
  49. package/dist/components/Content/Schema/helpers/get-schema-type.d.ts.map +1 -0
  50. package/dist/components/Content/Schema/helpers/get-schema-type.js +20 -0
  51. package/dist/components/Content/Schema/helpers/merge-all-of-schemas.js +1 -1
  52. package/dist/components/Content/Schema/helpers/optimizeValueForDisplay.d.ts.map +1 -1
  53. package/dist/components/Content/Schema/helpers/schema-name.d.ts.map +1 -1
  54. package/dist/components/Content/Schema/helpers/schema-name.js +20 -46
  55. package/dist/features/Operation/components/ParameterListItem.vue.js +3 -3
  56. package/dist/features/Operation/layouts/ModernLayout.vue.d.ts.map +1 -1
  57. package/dist/features/Operation/layouts/ModernLayout.vue.js +2 -2
  58. package/dist/features/Operation/layouts/ModernLayout.vue2.js +13 -13
  59. package/dist/features/Search/SearchButton.vue.d.ts +1 -0
  60. package/dist/features/Search/SearchButton.vue.d.ts.map +1 -1
  61. package/dist/features/Search/SearchButton.vue.js +36 -34
  62. package/dist/features/Search/SearchModal.vue.d.ts +1 -0
  63. package/dist/features/Search/SearchModal.vue.d.ts.map +1 -1
  64. package/dist/features/Search/SearchModal.vue.js +1 -1
  65. package/dist/features/Search/SearchModal.vue2.js +112 -112
  66. package/dist/features/Search/useSearchIndex.d.ts +4 -3
  67. package/dist/features/Search/useSearchIndex.d.ts.map +1 -1
  68. package/dist/features/Search/useSearchIndex.js +119 -82
  69. package/dist/features/api-client-modal/ApiClientModal.vue.d.ts +2 -2
  70. package/dist/features/api-client-modal/ApiClientModal.vue.d.ts.map +1 -1
  71. package/dist/features/api-client-modal/ApiClientModal.vue.js +47 -38
  72. package/dist/features/api-client-modal/useApiClient.d.ts +334 -334
  73. package/dist/features/api-client-modal/useApiClient.d.ts.map +1 -1
  74. package/dist/features/base-url/BaseUrl.vue.js +1 -1
  75. package/dist/features/example-responses/ExampleResponse.vue.js +3 -3
  76. package/dist/features/example-responses/ExampleResponse.vue2.js +7 -7
  77. package/dist/features/example-responses/ExampleResponses.vue.d.ts +1 -1
  78. package/dist/features/example-responses/ExampleResponses.vue.d.ts.map +1 -1
  79. package/dist/features/example-responses/ExampleResponses.vue.js +2 -2
  80. package/dist/features/sidebar/components/SidebarElement.vue.d.ts.map +1 -1
  81. package/dist/features/sidebar/components/SidebarElement.vue.js +1 -1
  82. package/dist/features/sidebar/components/SidebarElement.vue2.js +23 -21
  83. package/dist/features/sidebar/components/SidebarHttpBadge.vue.d.ts.map +1 -1
  84. package/dist/features/sidebar/components/SidebarHttpBadge.vue.js +2 -2
  85. package/dist/features/sidebar/components/SidebarHttpBadge.vue2.js +5 -6
  86. package/dist/features/test-request-button/TestRequestButton.vue.js +2 -2
  87. package/dist/features/traverse-schema/helpers/traverse-tags.js +26 -26
  88. package/dist/features/traverse-schema/index.d.ts +1 -1
  89. package/dist/features/traverse-schema/index.d.ts.map +1 -1
  90. package/dist/index.js +1 -1
  91. package/dist/libs/openapi.d.ts +15 -1
  92. package/dist/libs/openapi.d.ts.map +1 -1
  93. package/dist/libs/openapi.js +66 -47
  94. package/dist/standalone/lib/html-api.d.ts.map +1 -1
  95. package/dist/stores/useHttpClientStore.js +2 -2
  96. package/dist/style.css +1 -1
  97. package/dist/types.d.ts +3 -3
  98. package/dist/v2/blocks/scalar-request-example-block/components/RequestExample.vue.d.ts +2 -2
  99. package/package.json +18 -18
  100. package/dist/hooks/useOperation.d.ts +0 -16
  101. package/dist/hooks/useOperation.d.ts.map +0 -1
  102. package/dist/hooks/useOperation.js +0 -27
@@ -1,4 +1,4 @@
1
- import { defineComponent as Q, inject as W, computed as p, createBlock as n, createCommentVNode as d, openBlock as i, unref as u, withCtx as v, createElementVNode as I, normalizeClass as M, createElementBlock as t, withDirectives as E, createVNode as h, createTextVNode as P, toDisplayString as H, vShow as R, normalizeStyle as Y, Fragment as m, renderList as $ } from "vue";
1
+ import { defineComponent as Q, inject as W, computed as p, createBlock as s, createCommentVNode as n, openBlock as i, unref as u, withCtx as v, createElementVNode as I, normalizeClass as P, createElementBlock as d, withDirectives as E, createVNode as k, createTextVNode as M, toDisplayString as H, vShow as R, normalizeStyle as Y, Fragment as m, renderList as $ } from "vue";
2
2
  import { Disclosure as Z, DisclosureButton as F, DisclosurePanel as _ } from "@headlessui/vue";
3
3
  import { ScalarMarkdown as x, ScalarIcon as V } from "@scalar/components";
4
4
  import L from "../../ScreenReader.vue.js";
@@ -30,7 +30,7 @@ const ie = {
30
30
  },
31
31
  emits: ["update:modelValue"],
32
32
  setup(X, { emit: G }) {
33
- const o = X, J = G, r = W(ee, null), y = p(
33
+ const o = X, J = G, r = W(ee, null), h = p(
34
34
  () => {
35
35
  var e;
36
36
  return ((e = r == null ? void 0 : r.value) == null ? void 0 : e.discriminatorMapping) || o.discriminatorMapping || {};
@@ -46,100 +46,100 @@ const ie = {
46
46
  return ((e = r == null ? void 0 : r.value) == null ? void 0 : e.selectedType) || o.discriminator;
47
47
  }
48
48
  ), O = (e) => e !== null && typeof e == "object" && "type" in e && e.type === "object", a = p(() => {
49
- var s;
50
- const e = (s = r == null ? void 0 : r.value) == null ? void 0 : s.mergedSchema, S = o.value;
49
+ var t;
50
+ const e = (t = r == null ? void 0 : r.value) == null ? void 0 : t.mergedSchema, S = o.value;
51
51
  return e && o.level === 0 && o.hasDiscriminator && O(S) && O(e) ? e : o.value;
52
52
  }), j = p(() => !(o.noncollapsible || o.level === 0)), K = p(() => {
53
53
  var e;
54
- return !(!((e = a.value) != null && e.description) || typeof a.value.description != "string" || a.value.allOf || a.value.oneOf || a.value.anyOf || a.value.enum || o.level === 0);
55
- }), B = (e) => o.noncollapsible && e.stopPropagation(), g = (e) => {
54
+ return !(!((e = a.value) != null && e.description) || typeof a.value.description != "string" || a.value.allOf || a.value.oneOf || a.value.anyOf || a.value.enum || !a.value.properties && !a.value.patternProperties && !a.value.additionalProperties || o.level === 0);
55
+ }), B = (e) => o.noncollapsible && e.stopPropagation(), y = (e) => {
56
56
  J("update:modelValue", e);
57
57
  };
58
- return (e, S) => typeof e.value == "object" && Object.keys(e.value).length ? (i(), n(u(Z), {
58
+ return (e, S) => typeof e.value == "object" && Object.keys(e.value).length ? (i(), s(u(Z), {
59
59
  key: 0,
60
60
  defaultOpen: e.noncollapsible
61
61
  }, {
62
- default: v(({ open: s }) => {
62
+ default: v(({ open: t }) => {
63
63
  var w, C;
64
64
  return [
65
65
  I("div", {
66
- class: M(["schema-card", [
66
+ class: P(["schema-card", [
67
67
  `schema-card--level-${e.level}`,
68
- { "schema-card--compact": e.compact, "schema-card--open": s },
69
- { "border-t": e.additionalProperties && s }
68
+ { "schema-card--compact": e.compact, "schema-card--open": t },
69
+ { "border-t": e.additionalProperties && t }
70
70
  ]])
71
71
  }, [
72
- K.value ? (i(), t("div", ie, [
73
- (w = a.value) != null && w.enum ? d("", !0) : (i(), n(u(x), {
72
+ K.value ? (i(), d("div", ie, [
73
+ (w = a.value) != null && w.enum ? n("", !0) : (i(), s(u(x), {
74
74
  key: 0,
75
75
  value: (C = a.value) == null ? void 0 : C.description
76
76
  }, null, 8, ["value"]))
77
- ])) : d("", !0),
77
+ ])) : n("", !0),
78
78
  I("div", {
79
- class: M(["schema-properties", {
80
- "schema-properties-open": s
79
+ class: P(["schema-properties", {
80
+ "schema-properties-open": t
81
81
  }])
82
82
  }, [
83
- e.additionalProperties ? E((i(), t("div", le, [
84
- h(u(F), {
83
+ e.additionalProperties ? E((i(), d("div", le, [
84
+ k(u(F), {
85
85
  as: "button",
86
86
  class: "schema-card-title schema-card-title--compact",
87
87
  onClickCapture: B
88
88
  }, {
89
89
  default: v(() => [
90
- h(u(V), {
90
+ k(u(V), {
91
91
  class: "schema-card-title-icon",
92
92
  icon: "Add",
93
93
  size: "sm"
94
94
  }),
95
- S[0] || (S[0] = P(" Show additional properties ")),
96
- e.name ? (i(), n(L, { key: 0 }, {
95
+ S[0] || (S[0] = M(" Show additional properties ")),
96
+ e.name ? (i(), s(L, { key: 0 }, {
97
97
  default: v(() => [
98
- P("for " + H(e.name), 1)
98
+ M("for " + H(e.name), 1)
99
99
  ]),
100
100
  _: 1
101
- })) : d("", !0)
101
+ })) : n("", !0)
102
102
  ]),
103
103
  _: 1
104
104
  })
105
105
  ], 512)), [
106
- [R, !s]
107
- ]) : j.value ? E((i(), n(u(F), {
106
+ [R, !t]
107
+ ]) : j.value ? E((i(), s(u(F), {
108
108
  key: 1,
109
109
  as: e.noncollapsible ? "div" : "button",
110
- class: M(["schema-card-title", { "schema-card-title--compact": e.compact }]),
110
+ class: P(["schema-card-title", { "schema-card-title--compact": e.compact }]),
111
111
  style: Y({
112
112
  top: `calc(var(--refs-header-height) + calc(var(--schema-title-height) * ${e.level}))`
113
113
  }),
114
114
  onClickCapture: B
115
115
  }, {
116
116
  default: v(() => {
117
- var f, N, l;
117
+ var f, g, l;
118
118
  return [
119
- e.compact ? (i(), t(m, { key: 0 }, [
120
- h(u(V), {
121
- class: M(["schema-card-title-icon", { "schema-card-title-icon--open": s }]),
119
+ e.compact ? (i(), d(m, { key: 0 }, [
120
+ k(u(V), {
121
+ class: P(["schema-card-title-icon", { "schema-card-title-icon--open": t }]),
122
122
  icon: "Add",
123
123
  size: "sm"
124
124
  }, null, 8, ["class"]),
125
- s ? (i(), t(m, { key: 0 }, [
126
- P(" Hide " + H(((f = e.value) == null ? void 0 : f.title) ?? "Child Attributes"), 1)
127
- ], 64)) : (i(), t(m, { key: 1 }, [
128
- P(" Show " + H(((N = e.value) == null ? void 0 : N.title) ?? "Child Attributes"), 1)
125
+ t ? (i(), d(m, { key: 0 }, [
126
+ M(" Hide " + H(((f = e.value) == null ? void 0 : f.title) ?? "Child Attributes"), 1)
127
+ ], 64)) : (i(), d(m, { key: 1 }, [
128
+ M(" Show " + H(((g = e.value) == null ? void 0 : g.title) ?? "Child Attributes"), 1)
129
129
  ], 64)),
130
- e.name ? (i(), n(L, { key: 2 }, {
130
+ e.name ? (i(), s(L, { key: 2 }, {
131
131
  default: v(() => [
132
- P("for " + H(e.name), 1)
132
+ M("for " + H(e.name), 1)
133
133
  ]),
134
134
  _: 1
135
- })) : d("", !0)
136
- ], 64)) : (i(), t(m, { key: 1 }, [
137
- h(u(V), {
138
- class: M(["schema-card-title-icon", { "schema-card-title-icon--open": s }]),
135
+ })) : n("", !0)
136
+ ], 64)) : (i(), d(m, { key: 1 }, [
137
+ k(u(V), {
138
+ class: P(["schema-card-title-icon", { "schema-card-title-icon--open": t }]),
139
139
  icon: "Add",
140
140
  size: "sm"
141
141
  }, null, 8, ["class"]),
142
- h(ae, {
142
+ k(ae, {
143
143
  name: ((l = e.value) == null ? void 0 : l.title) ?? e.name,
144
144
  value: e.value
145
145
  }, null, 8, ["name", "value"])
@@ -149,25 +149,26 @@ const ie = {
149
149
  _: 2
150
150
  }, 1032, ["as", "class", "style"])), [
151
151
  [R, !e.hideHeading && !(e.noncollapsible && e.compact)]
152
- ]) : d("", !0),
153
- h(u(_), {
152
+ ]) : n("", !0),
153
+ !e.additionalProperties || t ? (i(), s(u(_), {
154
+ key: 2,
154
155
  as: "ul",
155
156
  static: !j.value
156
157
  }, {
157
158
  default: v(() => {
158
- var f, N;
159
+ var f, g;
159
160
  return [
160
- a.value && typeof a.value == "object" && ("properties" in a.value || "additionalProperties" in a.value || "patternProperties" in a.value) ? (i(), t(m, { key: 0 }, [
161
- a.value.properties ? (i(!0), t(m, { key: 0 }, $(Object.keys(a.value.properties), (l) => {
162
- var k, A, T, z, U, q;
163
- return i(), n(b, {
161
+ a.value && typeof a.value == "object" && ("properties" in a.value || "additionalProperties" in a.value || "patternProperties" in a.value) ? (i(), d(m, { key: 0 }, [
162
+ a.value.properties ? (i(!0), d(m, { key: 0 }, $(Object.keys(a.value.properties), (l) => {
163
+ var N, A, T, z, U, q;
164
+ return i(), s(b, {
164
165
  key: l,
165
166
  compact: e.compact,
166
167
  hideHeading: e.hideHeading,
167
168
  level: e.level + 1,
168
169
  name: l,
169
170
  hideModelNames: e.hideModelNames,
170
- required: ((k = a.value.required) == null ? void 0 : k.includes(l)) || ((A = a.value.properties[l]) == null ? void 0 : A.required) === !0,
171
+ required: ((N = a.value.required) == null ? void 0 : N.includes(l)) || ((A = a.value.properties[l]) == null ? void 0 : A.required) === !0,
171
172
  schemas: e.schemas,
172
173
  resolvedSchema: a.value.properties[l],
173
174
  value: {
@@ -175,16 +176,16 @@ const ie = {
175
176
  parent: a.value,
176
177
  isDiscriminator: l === c.value || ((T = a.value.discriminator) == null ? void 0 : T.propertyName) === l
177
178
  },
178
- discriminatorMapping: ((z = a.value.discriminator) == null ? void 0 : z.mapping) || y.value,
179
+ discriminatorMapping: ((z = a.value.discriminator) == null ? void 0 : z.mapping) || h.value,
179
180
  discriminatorPropertyName: ((U = a.value.discriminator) == null ? void 0 : U.propertyName) || c.value,
180
181
  isDiscriminator: l === (((q = a.value.discriminator) == null ? void 0 : q.propertyName) || c.value),
181
182
  modelValue: D.value,
182
- "onUpdate:modelValue": g
183
+ "onUpdate:modelValue": y
183
184
  }, null, 8, ["compact", "hideHeading", "level", "name", "hideModelNames", "required", "schemas", "resolvedSchema", "value", "discriminatorMapping", "discriminatorPropertyName", "isDiscriminator", "modelValue"]);
184
- }), 128)) : d("", !0),
185
- a.value.patternProperties ? (i(!0), t(m, { key: 1 }, $(Object.keys(a.value.patternProperties), (l) => {
186
- var k;
187
- return i(), n(b, {
185
+ }), 128)) : n("", !0),
186
+ a.value.patternProperties ? (i(!0), d(m, { key: 1 }, $(Object.keys(a.value.patternProperties), (l) => {
187
+ var N;
188
+ return i(), s(b, {
188
189
  key: l,
189
190
  compact: e.compact,
190
191
  hideHeading: e.hideHeading,
@@ -193,14 +194,14 @@ const ie = {
193
194
  hideModelNames: e.hideModelNames,
194
195
  pattern: "",
195
196
  schemas: e.schemas,
196
- value: ((k = e.value.discriminator) == null ? void 0 : k.propertyName) === l ? e.value : a.value.patternProperties[l],
197
- discriminatorMapping: y.value,
197
+ value: ((N = e.value.discriminator) == null ? void 0 : N.propertyName) === l ? e.value : a.value.patternProperties[l],
198
+ discriminatorMapping: h.value,
198
199
  discriminatorPropertyName: c.value,
199
- "onUpdate:modelValue": g
200
+ "onUpdate:modelValue": y
200
201
  }, null, 8, ["compact", "hideHeading", "level", "name", "hideModelNames", "schemas", "value", "discriminatorMapping", "discriminatorPropertyName"]);
201
- }), 128)) : d("", !0),
202
- a.value.additionalProperties ? (i(), t(m, { key: 2 }, [
203
- a.value.additionalProperties === !0 || Object.keys(a.value.additionalProperties).length === 0 || !("type" in a.value.additionalProperties) ? (i(), n(b, {
202
+ }), 128)) : n("", !0),
203
+ a.value.additionalProperties ? (i(), d(m, { key: 2 }, [
204
+ a.value.additionalProperties === !0 || Object.keys(a.value.additionalProperties).length === 0 || !("type" in a.value.additionalProperties) ? (i(), s(b, {
204
205
  key: 0,
205
206
  additional: "",
206
207
  compact: e.compact,
@@ -213,10 +214,10 @@ const ie = {
213
214
  type: "anything",
214
215
  ...typeof a.value.additionalProperties == "object" ? a.value.additionalProperties : {}
215
216
  },
216
- discriminatorMapping: y.value,
217
+ discriminatorMapping: h.value,
217
218
  discriminatorPropertyName: c.value,
218
- "onUpdate:modelValue": g
219
- }, null, 8, ["compact", "hideHeading", "hideModelNames", "level", "schemas", "value", "discriminatorMapping", "discriminatorPropertyName"])) : (i(), n(b, {
219
+ "onUpdate:modelValue": y
220
+ }, null, 8, ["compact", "hideHeading", "hideModelNames", "level", "schemas", "value", "discriminatorMapping", "discriminatorPropertyName"])) : (i(), s(b, {
220
221
  key: 1,
221
222
  additional: "",
222
223
  compact: e.compact,
@@ -226,13 +227,13 @@ const ie = {
226
227
  noncollapsible: "",
227
228
  schemas: e.schemas,
228
229
  value: ((f = e.value.discriminator) == null ? void 0 : f.propertyName) === e.name ? e.value : a.value.additionalProperties,
229
- discriminatorMapping: y.value,
230
+ discriminatorMapping: h.value,
230
231
  discriminatorPropertyName: c.value,
231
- "onUpdate:modelValue": g
232
+ "onUpdate:modelValue": y
232
233
  }, null, 8, ["compact", "hideHeading", "hideModelNames", "level", "schemas", "value", "discriminatorMapping", "discriminatorPropertyName"]))
233
- ], 64)) : d("", !0)
234
- ], 64)) : (i(), t(m, { key: 1 }, [
235
- a.value ? (i(), n(b, {
234
+ ], 64)) : n("", !0)
235
+ ], 64)) : (i(), d(m, { key: 1 }, [
236
+ a.value ? (i(), s(b, {
236
237
  key: 0,
237
238
  compact: e.compact,
238
239
  hideHeading: e.hideHeading,
@@ -240,23 +241,23 @@ const ie = {
240
241
  level: e.level,
241
242
  name: a.value.name,
242
243
  schemas: e.schemas,
243
- value: ((N = e.value.discriminator) == null ? void 0 : N.propertyName) === e.name ? e.value : a.value,
244
- discriminatorMapping: y.value,
244
+ value: ((g = e.value.discriminator) == null ? void 0 : g.propertyName) === e.name ? e.value : a.value,
245
+ discriminatorMapping: h.value,
245
246
  discriminatorPropertyName: c.value,
246
247
  modelValue: D.value,
247
- "onUpdate:modelValue": g
248
- }, null, 8, ["compact", "hideHeading", "hideModelNames", "level", "name", "schemas", "value", "discriminatorMapping", "discriminatorPropertyName", "modelValue"])) : d("", !0)
248
+ "onUpdate:modelValue": y
249
+ }, null, 8, ["compact", "hideHeading", "hideModelNames", "level", "name", "schemas", "value", "discriminatorMapping", "discriminatorPropertyName", "modelValue"])) : n("", !0)
249
250
  ], 64))
250
251
  ];
251
252
  }),
252
253
  _: 1
253
- }, 8, ["static"])
254
+ }, 8, ["static"])) : n("", !0)
254
255
  ], 2)
255
256
  ], 2)
256
257
  ];
257
258
  }),
258
259
  _: 1
259
- }, 8, ["defaultOpen"])) : d("", !0);
260
+ }, 8, ["defaultOpen"])) : n("", !0);
260
261
  }
261
262
  });
262
263
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaComposition.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaComposition.vue"],"names":[],"mappings":"AA8QA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAA;AAEjE,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,8BAA8B,CAAA;AAKrC,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,kBAAkB,CAAA;IAC/B,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC1B,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB,CAAC;;AA+TF,wBAOG"}
1
+ {"version":3,"file":"SchemaComposition.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaComposition.vue"],"names":[],"mappings":"AAyQA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAA;AAEjE,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,8BAA8B,CAAA;AAKrC,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,kBAAkB,CAAA;IAC/B,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC1B,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB,CAAC;;AAiTF,wBAOG"}
@@ -1,17 +1,14 @@
1
- import { defineComponent as F, ref as M, computed as t, resolveComponent as T, createElementBlock as c, openBlock as r, createCommentVNode as u, createBlock as p, Fragment as N, renderList as j, createVNode as y, createElementVNode as f, unref as d, withCtx as R, toDisplayString as V } from "vue";
2
- import { ScalarListbox as Z, ScalarMarkdown as $ } from "@scalar/components";
3
- import { ScalarIconCaretDown as G } from "@scalar/icons";
4
- import { mergeAllOfSchemas as w } from "./helpers/merge-all-of-schemas.js";
5
- import { getModelNameFromSchema as J } from "./helpers/schema-name.js";
6
- import { hasComposition as b } from "./helpers/schema-composition.js";
7
- import g from "./Schema.vue.js";
8
- const K = { class: "property-rule" }, P = {
1
+ import { defineComponent as z, ref as E, computed as t, resolveComponent as j, createElementBlock as d, openBlock as r, createCommentVNode as O, createBlock as c, Fragment as A, renderList as F, createVNode as H, createElementVNode as u, unref as h, withCtx as R, toDisplayString as N } from "vue";
2
+ import { ScalarListbox as Z } from "@scalar/components";
3
+ import { ScalarIconCaretDown as $ } from "@scalar/icons";
4
+ import { getSchemaType as G } from "./helpers/get-schema-type.js";
5
+ import { mergeAllOfSchemas as V } from "./helpers/merge-all-of-schemas.js";
6
+ import { hasComposition as y } from "./helpers/schema-composition.js";
7
+ import b from "./Schema.vue.js";
8
+ const J = { class: "property-rule" }, K = {
9
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
- }, Q = { class: "text-c-2" }, X = { class: "composition-selector-label text-c-1" }, Y = { class: "composition-panel" }, W = {
12
- key: 0,
13
- class: "property-description border-x border-t p-2"
14
- }, te = /* @__PURE__ */ F({
11
+ }, M = { class: "text-c-2" }, P = { class: "composition-selector-label text-c-1" }, Q = { class: "composition-panel" }, le = /* @__PURE__ */ z({
15
12
  __name: "SchemaComposition",
16
13
  props: {
17
14
  composition: {},
@@ -23,32 +20,32 @@ const K = { class: "property-rule" }, P = {
23
20
  hideHeading: { type: Boolean }
24
21
  },
25
22
  setup(s) {
26
- const v = M(0), B = t(() => k.value), C = t(
27
- () => B.value.map(
23
+ const p = E(0), w = t(() => S.value), g = t(
24
+ () => w.value.map(
28
25
  (e, o) => ({
29
26
  id: String(o),
30
- label: J(e) || "Schema"
27
+ label: G(e) || "Schema"
31
28
  })
32
29
  )
33
- ), O = t({
34
- get: () => C.value.find(
35
- (e) => e.id === String(v.value)
30
+ ), f = t({
31
+ get: () => g.value.find(
32
+ (e) => e.id === String(p.value)
36
33
  ),
37
- set: (e) => v.value = Number(e.id)
38
- }), D = t(() => {
34
+ set: (e) => p.value = Number(e.id)
35
+ }), B = t(() => {
39
36
  var i;
40
- const e = ["oneOf", "anyOf"].includes(s.composition), o = s.composition === "allOf" && ((i = s.value[s.composition]) == null ? void 0 : i.some((l) => b(l)));
37
+ const e = ["oneOf", "anyOf"].includes(s.composition), o = s.composition === "allOf" && ((i = s.value[s.composition]) == null ? void 0 : i.some((l) => y(l)));
41
38
  return e || o;
42
- }), I = (e) => e.find((o) => b(o)), L = (e) => !e.allOf || !Array.isArray(e.allOf) ? !1 : e.allOf.some(
39
+ }), D = (e) => e.find((o) => y(o)), I = (e) => !e.allOf || !Array.isArray(e.allOf) ? !1 : e.allOf.some(
43
40
  (o) => o.oneOf || o.anyOf || o.allOf
44
- ), S = (e) => e.allOf && Array.isArray(e.allOf) ? L(e) ? e : w(e.allOf) : e, k = t(() => {
45
- const e = s.value[s.composition], o = I(e);
46
- return !o || s.composition !== "allOf" && o.allOf ? e.map(S) : (o.oneOf || o.anyOf || o.allOf).map(S);
47
- }), U = (e) => {
41
+ ), C = (e) => e.allOf && Array.isArray(e.allOf) ? I(e) ? e : V(e.allOf) : e, S = t(() => {
42
+ const e = s.value[s.composition], o = D(e);
43
+ return !o || s.composition !== "allOf" && o.allOf ? e.map(C) : (o.oneOf || o.anyOf || o.allOf).map(C);
44
+ }), L = (e) => {
48
45
  var o, i;
49
46
  if (e === "allOf") {
50
47
  const l = (i = (o = s.value) == null ? void 0 : o[e]) == null ? void 0 : i.find(
51
- (m) => b(m)
48
+ (m) => y(m)
52
49
  );
53
50
  if (l != null && l.oneOf)
54
51
  return "One of";
@@ -57,99 +54,94 @@ const K = { class: "property-rule" }, P = {
57
54
  }
58
55
  return e.replace(/([A-Z])/g, " $1").replace(/^./, (l) => l.toUpperCase()).toLowerCase().replace(/^(\w)/, (l) => l.toUpperCase());
59
56
  }, a = t(
60
- () => k.value[v.value]
61
- ), h = t(() => {
57
+ () => S.value[p.value]
58
+ ), v = t(() => {
62
59
  var e;
63
60
  return (e = a.value) != null && e.oneOf ? "oneOf" : "anyOf";
64
- }), q = t(() => {
61
+ }), T = t(() => {
65
62
  var o;
66
- const e = h.value;
63
+ const e = v.value;
67
64
  return (o = a.value) == null ? void 0 : o[e];
68
- }), z = t(() => {
65
+ }), U = t(() => {
69
66
  const e = a.value;
70
67
  return e ? !!(e.properties || e.type || e.nullable || e.const !== void 0 || e.enum || e.allOf || e.oneOf || e.anyOf || e.items) : !1;
71
68
  });
72
69
  return (e, o) => {
73
- var l, m, A, H;
74
- const i = T("SchemaComposition", !0);
75
- return r(), c("div", K, [
76
- e.composition === "allOf" && e.value[e.composition].some((n) => n.oneOf || n.anyOf) ? (r(!0), c(N, { key: 0 }, j(e.value[e.composition].filter(
70
+ var l, m, k;
71
+ const i = j("SchemaComposition", !0);
72
+ return r(), d("div", J, [
73
+ e.composition === "allOf" && e.value[e.composition].some((n) => n.oneOf || n.anyOf) ? (r(!0), d(A, { key: 0 }, F(e.value[e.composition].filter(
77
74
  (n) => !n.oneOf && !n.anyOf
78
- ), (n, E) => (r(), p(g, {
79
- key: E,
75
+ ), (n, q) => (r(), c(b, {
76
+ key: q,
80
77
  compact: e.compact,
81
78
  level: e.level,
82
79
  name: e.name,
83
80
  noncollapsible: e.level == 0,
84
81
  schemas: e.schemas,
85
82
  value: n
86
- }, null, 8, ["compact", "level", "name", "noncollapsible", "schemas", "value"]))), 128)) : u("", !0),
87
- D.value ? (r(), c(N, { key: 1 }, [
88
- y(d(Z), {
89
- modelValue: O.value,
90
- "onUpdate:modelValue": o[0] || (o[0] = (n) => O.value = n),
91
- options: C.value,
83
+ }, null, 8, ["compact", "level", "name", "noncollapsible", "schemas", "value"]))), 128)) : O("", !0),
84
+ B.value ? (r(), d(A, { key: 1 }, [
85
+ H(h(Z), {
86
+ modelValue: f.value,
87
+ "onUpdate:modelValue": o[0] || (o[0] = (n) => f.value = n),
88
+ options: g.value,
92
89
  resize: ""
93
90
  }, {
94
91
  default: R(() => {
95
92
  var n;
96
93
  return [
97
- f("button", P, [
98
- f("span", Q, V(U(e.composition)), 1),
99
- f("span", X, V(((n = O.value) == null ? void 0 : n.label) || "Schema"), 1),
100
- y(d(G))
94
+ u("button", K, [
95
+ u("span", M, N(L(e.composition)), 1),
96
+ u("span", P, N(((n = f.value) == null ? void 0 : n.label) || "Schema"), 1),
97
+ H(h($))
101
98
  ])
102
99
  ];
103
100
  }),
104
101
  _: 1
105
102
  }, 8, ["modelValue", "options"]),
106
- f("div", Y, [
107
- (l = a.value) != null && l.description ? (r(), c("div", W, [
108
- y(d($), {
109
- value: a.value.description
110
- }, null, 8, ["value"])
111
- ])) : u("", !0),
112
- z.value ? (r(), p(g, {
113
- key: 1,
103
+ u("div", Q, [
104
+ U.value ? (r(), c(b, {
105
+ key: 0,
114
106
  compact: e.compact,
115
107
  level: e.level + 1,
116
108
  hideHeading: e.hideHeading,
117
109
  name: e.name,
118
110
  noncollapsible: !0,
119
111
  schemas: e.schemas,
120
- value: (m = a.value) != null && m.properties ? {
112
+ value: (l = a.value) != null && l.properties ? {
121
113
  type: "object",
122
114
  properties: a.value.properties,
123
115
  required: a.value.required
124
116
  } : a.value
125
- }, null, 8, ["compact", "level", "hideHeading", "name", "schemas", "value"])) : u("", !0),
126
- (A = a.value) != null && A.oneOf || (H = a.value) != null && H.anyOf ? (r(), p(i, {
127
- key: 2,
117
+ }, null, 8, ["compact", "level", "hideHeading", "name", "schemas", "value"])) : O("", !0),
118
+ (m = a.value) != null && m.oneOf || (k = a.value) != null && k.anyOf ? (r(), c(i, {
119
+ key: 1,
128
120
  compact: e.compact,
129
- composition: h.value,
121
+ composition: v.value,
130
122
  hideHeading: e.hideHeading,
131
123
  level: e.level + 1,
132
124
  name: e.name,
133
125
  noncollapsible: !0,
134
126
  schemas: e.schemas,
135
127
  value: {
136
- [h.value]: q.value
128
+ [v.value]: T.value
137
129
  }
138
- }, null, 8, ["compact", "composition", "hideHeading", "level", "name", "schemas", "value"])) : u("", !0)
130
+ }, null, 8, ["compact", "composition", "hideHeading", "level", "name", "schemas", "value"])) : O("", !0)
139
131
  ])
140
- ], 64)) : (r(), p(g, {
132
+ ], 64)) : (r(), c(b, {
141
133
  key: 2,
142
134
  compact: e.compact,
143
135
  level: e.level,
144
136
  name: e.name,
145
137
  noncollapsible: e.level == 0,
146
138
  schemas: e.schemas,
147
- value: d(w)(e.value[e.composition])
139
+ value: h(V)(e.value[e.composition])
148
140
  }, null, 8, ["compact", "level", "name", "noncollapsible", "schemas", "value"]))
149
141
  ]);
150
142
  };
151
143
  }
152
144
  });
153
145
  export {
154
- te as default
146
+ le as default
155
147
  };
@@ -0,0 +1,19 @@
1
+ type SchemaValue = {
2
+ 'enum'?: any[];
3
+ 'items'?: {
4
+ enum?: any[];
5
+ };
6
+ 'x-enumDescriptions'?: Record<string, string> | string[];
7
+ 'x-enum-descriptions'?: Record<string, string> | string[];
8
+ 'x-enum-varnames'?: string[];
9
+ 'x-enumNames'?: string[];
10
+ } & Record<string, any>;
11
+ type __VLS_Props = {
12
+ /** The schema object containing enum values and metadata */
13
+ value?: SchemaValue;
14
+ /** Whether this enum is used as a discriminator property */
15
+ isDiscriminator?: boolean;
16
+ };
17
+ 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>;
18
+ export default _default;
19
+ //# sourceMappingURL=SchemaEnumValues.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SchemaEnumValues.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaEnumValues.vue"],"names":[],"mappings":"AA6TA,KAAK,WAAW,GAAG;IACjB,MAAM,CAAC,EAAE,GAAG,EAAE,CAAA;IACd,OAAO,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,GAAG,EAAE,CAAA;KAAE,CAAA;IAC1B,oBAAoB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,EAAE,CAAA;IACxD,qBAAqB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,EAAE,CAAA;IACzD,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC5B,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;CACzB,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;AAGvB,KAAK,WAAW,GAAG;IACjB,4DAA4D;IAC5D,KAAK,CAAC,EAAE,WAAW,CAAA;IACnB,4DAA4D;IAC5D,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B,CAAC;;AAkUF,wBAMG"}
@@ -0,0 +1,7 @@
1
+ import o from "./SchemaEnumValues.vue2.js";
2
+ /* empty css */
3
+ import a from "../../../_virtual/_plugin-vue_export-helper.js";
4
+ const r = /* @__PURE__ */ a(o, [["__scopeId", "data-v-ec7a8d6d"]]);
5
+ export {
6
+ r as default
7
+ };