@scalar/api-reference 1.29.2 → 1.30.0

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 (45) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/README.md +13 -114
  3. package/dist/browser/standalone.js +2402 -2306
  4. package/dist/browser/webpack-stats.json +1 -1
  5. package/dist/components/Content/Introduction/Introduction.vue.js +2 -2
  6. package/dist/components/Content/Introduction/Introduction.vue2.js +1 -1
  7. package/dist/components/Content/Schema/Schema.vue.d.ts.map +1 -1
  8. package/dist/components/Content/Schema/Schema.vue.js +2 -2
  9. package/dist/components/Content/Schema/Schema.vue2.js +118 -84
  10. package/dist/components/Content/Schema/SchemaComposition.vue.d.ts.map +1 -1
  11. package/dist/components/Content/Schema/SchemaComposition.vue.js +62 -60
  12. package/dist/components/Content/Schema/SchemaDiscriminator.vue.d.ts +13 -0
  13. package/dist/components/Content/Schema/SchemaDiscriminator.vue.d.ts.map +1 -0
  14. package/dist/components/Content/Schema/SchemaDiscriminator.vue.js +49 -0
  15. package/dist/components/Content/Schema/SchemaDiscriminator.vue2.js +4 -0
  16. package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
  17. package/dist/components/Content/Schema/SchemaProperty.vue.js +2 -2
  18. package/dist/components/Content/Schema/SchemaProperty.vue2.js +40 -39
  19. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts.map +1 -1
  20. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js +2 -2
  21. package/dist/components/Content/Schema/SchemaPropertyHeading.vue2.js +133 -114
  22. package/dist/components/Content/Schema/helpers/schema-discriminator.d.ts +9 -1
  23. package/dist/components/Content/Schema/helpers/schema-discriminator.d.ts.map +1 -1
  24. package/dist/components/Content/Schema/helpers/schema-discriminator.js +45 -0
  25. package/dist/components/Section/SectionHeaderTag.vue.d.ts.map +1 -1
  26. package/dist/components/Section/SectionHeaderTag.vue.js +2 -2
  27. package/dist/features/ApiClientModal/useApiClient.d.ts +28 -8
  28. package/dist/features/ApiClientModal/useApiClient.d.ts.map +1 -1
  29. package/dist/features/Operation/components/callbacks/Callback.vue.d.ts +14 -0
  30. package/dist/features/Operation/components/callbacks/Callback.vue.d.ts.map +1 -0
  31. package/dist/features/Operation/components/callbacks/Callback.vue.js +7 -0
  32. package/dist/features/Operation/components/callbacks/Callback.vue2.js +62 -0
  33. package/dist/features/Operation/components/callbacks/Callbacks.vue.d.ts +10 -0
  34. package/dist/features/Operation/components/callbacks/Callbacks.vue.d.ts.map +1 -0
  35. package/dist/features/Operation/components/callbacks/Callbacks.vue.js +30 -0
  36. package/dist/features/Operation/components/callbacks/Callbacks.vue2.js +4 -0
  37. package/dist/features/Operation/layouts/ModernLayout.vue.d.ts +2 -2
  38. package/dist/features/Operation/layouts/ModernLayout.vue.d.ts.map +1 -1
  39. package/dist/features/Operation/layouts/ModernLayout.vue.js +1 -1
  40. package/dist/features/Operation/layouts/ModernLayout.vue2.js +86 -74
  41. package/dist/features/Operation/types/schemas.d.ts +3 -0
  42. package/dist/features/Operation/types/schemas.d.ts.map +1 -0
  43. package/dist/index.js +1 -1
  44. package/dist/style.css +1 -1
  45. package/package.json +8 -8
@@ -1,7 +1,7 @@
1
1
  import o from "./Introduction.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-35f3c001"]]);
4
+ const _ = /* @__PURE__ */ t(o, [["__scopeId", "data-v-b6809143"]]);
5
5
  export {
6
- m as default
6
+ _ as default
7
7
  };
@@ -81,11 +81,11 @@ const M = { class: "flex gap-1" }, R = { class: "sticky-cards" }, ne = /* @__PUR
81
81
  ]),
82
82
  _: 1
83
83
  }, 8, ["loading"]),
84
- i(B, { filename: $.value }, null, 8, ["filename"]),
85
84
  i(o(G), null, {
86
85
  default: t(() => [
87
86
  i(o(h), null, {
88
87
  default: t(() => [
88
+ i(B, { filename: $.value }, null, 8, ["filename"]),
89
89
  i(O, {
90
90
  value: e.info.description
91
91
  }, null, 8, ["value"])
@@ -1 +1 @@
1
- {"version":3,"file":"Schema.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/Schema.vue"],"names":[],"mappings":"AAuVA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAU9E,KAAK,WAAW,GAAG;IACf,KAAK,CAAC,EACF,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,gCAAgC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAA;IAEd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,+DAA+D;IAC/D,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,2CAA2C;IAC3C,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,+FAA+F;IAC/F,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B,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;CACZ,CAAC;;WAfQ,MAAM;oBAMG,OAAO;;AA4X5B,wBAOG"}
1
+ {"version":3,"file":"Schema.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/Schema.vue"],"names":[],"mappings":"AA+bA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAgB9E,KAAK,WAAW,GAAG;IACf,KAAK,CAAC,EACF,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,gCAAgC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAA;IAEd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,+DAA+D;IAC/D,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,2CAA2C;IAC3C,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,+FAA+F;IAC/F,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B,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;CACZ,CAAC;;WAfQ,MAAM;oBAMG,OAAO;;AA0e5B,wBAOG"}
@@ -1,7 +1,7 @@
1
1
  import o from "./Schema.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-f3594262"]]);
4
+ const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-fce8655f"]]);
5
5
  export {
6
- f as default
6
+ a as default
7
7
  };
@@ -1,16 +1,18 @@
1
- import { defineComponent as V, computed as E, createBlock as i, createCommentVNode as o, openBlock as a, unref as r, withCtx as d, createElementVNode as j, normalizeClass as v, createElementBlock as s, withDirectives as w, createVNode as u, createTextVNode as h, toDisplayString as f, vShow as z, normalizeStyle as T, Fragment as t, renderList as A } from "vue";
2
- import { Disclosure as $, DisclosureButton as D, DisclosurePanel as F } from "@headlessui/vue";
3
- import { ScalarMarkdown as I, ScalarIcon as g } from "@scalar/components";
4
- import q from "../../ScreenReader.vue.js";
5
- import L from "./SchemaHeading.vue.js";
6
- import y from "./SchemaProperty.vue.js";
7
- const M = {
1
+ import { defineComponent as F, ref as I, computed as k, watch as L, createBlock as t, createCommentVNode as o, openBlock as l, unref as n, withCtx as p, createElementVNode as V, normalizeClass as P, createElementBlock as s, withDirectives as z, createVNode as v, createTextVNode as b, toDisplayString as C, vShow as A, normalizeStyle as R, Fragment as u, renderList as M } from "vue";
2
+ import { Disclosure as U, DisclosureButton as q, DisclosurePanel as G } from "@headlessui/vue";
3
+ import { ScalarMarkdown as J, ScalarIcon as D } from "@scalar/components";
4
+ import { getDiscriminatorMapping as K, getDiscriminatorPropertyName as Q, mergeDiscriminatorSchemas as W } from "./helpers/schema-discriminator.js";
5
+ import X from "./SchemaDiscriminator.vue.js";
6
+ import T from "../../ScreenReader.vue.js";
7
+ import Y from "./SchemaHeading.vue.js";
8
+ import H from "./SchemaProperty.vue.js";
9
+ const Z = {
8
10
  key: 0,
9
11
  class: "schema-card-description"
10
- }, R = {
12
+ }, _ = {
11
13
  key: 0,
12
14
  class: "schema-properties"
13
- }, X = /* @__PURE__ */ V({
15
+ }, se = /* @__PURE__ */ F({
14
16
  __name: "Schema",
15
17
  props: {
16
18
  value: { type: [Object, Boolean] },
@@ -22,49 +24,68 @@ const M = {
22
24
  additionalProperties: { type: Boolean },
23
25
  schemas: {}
24
26
  },
25
- setup(N) {
26
- const k = N, b = E(() => !(k.noncollapsible || k.level === 0)), H = (e) => k.noncollapsible && e.stopPropagation();
27
- return (e, P) => typeof e.value == "object" && Object.keys(e.value).length ? (a(), i(r($), {
27
+ setup($) {
28
+ const r = $, c = I(""), m = k(() => {
29
+ if (r.value)
30
+ return K(r.value);
31
+ }), E = k(() => m.value && Object.keys(m.value)[0] || ""), N = k(() => {
32
+ if (r.value)
33
+ return Q(r.value);
34
+ }), a = k(() => {
35
+ if (r.value)
36
+ return !m.value || !c.value ? r.value : W(
37
+ r.value,
38
+ c.value,
39
+ r.schemas
40
+ ) || r.value;
41
+ }), O = k(() => !(r.noncollapsible || r.level === 0)), B = (e) => r.noncollapsible && e.stopPropagation();
42
+ return L(
43
+ m,
44
+ (e) => {
45
+ e && !c.value && (c.value = E.value);
46
+ },
47
+ { immediate: !0 }
48
+ ), (e, S) => typeof e.value == "object" && Object.keys(e.value).length ? (l(), t(n(U), {
28
49
  key: 0,
29
50
  defaultOpen: e.noncollapsible
30
51
  }, {
31
- default: d(({ open: n }) => {
32
- var S;
52
+ default: p(({ open: d }) => {
53
+ var j;
33
54
  return [
34
- j("div", {
35
- class: v(["schema-card", [
55
+ V("div", {
56
+ class: P(["schema-card", [
36
57
  `schema-card--level-${e.level}`,
37
- { "schema-card--compact": e.compact, "schema-card--open": n },
38
- { "border-t-1/2": e.additionalProperties && n }
58
+ { "schema-card--compact": e.compact, "schema-card--open": d },
59
+ { "border-t-1/2": e.additionalProperties && d }
39
60
  ]])
40
61
  }, [
41
- (S = e.value) != null && S.description && typeof e.value.description == "string" && !e.value.allOf && !e.value.oneOf && !e.value.anyOf && !e.compact ? (a(), s("div", M, [
42
- e.value.enum ? o("", !0) : (a(), i(r(I), {
62
+ (j = a.value) != null && j.description && typeof a.value.description == "string" && !a.value.allOf && !a.value.oneOf && !a.value.anyOf && !e.compact ? (l(), s("div", Z, [
63
+ a.value.enum ? o("", !0) : (l(), t(n(J), {
43
64
  key: 0,
44
- value: e.value.description
65
+ value: a.value.description
45
66
  }, null, 8, ["value"]))
46
67
  ])) : o("", !0),
47
- j("div", {
48
- class: v(["schema-properties", {
49
- "schema-properties-open": n
68
+ V("div", {
69
+ class: P(["schema-properties", {
70
+ "schema-properties-open": d
50
71
  }])
51
72
  }, [
52
- e.additionalProperties ? w((a(), s("div", R, [
53
- u(r(D), {
73
+ e.additionalProperties ? z((l(), s("div", _, [
74
+ v(n(q), {
54
75
  as: "button",
55
76
  class: "schema-card-title schema-card-title--compact",
56
- onClickCapture: H
77
+ onClickCapture: B
57
78
  }, {
58
- default: d(() => [
59
- u(r(g), {
79
+ default: p(() => [
80
+ v(n(D), {
60
81
  class: "schema-card-title-icon",
61
82
  icon: "Add",
62
83
  size: "sm"
63
84
  }),
64
- P[0] || (P[0] = h(" Show additional properties ")),
65
- e.name ? (a(), i(q, { key: 0 }, {
66
- default: d(() => [
67
- h("for " + f(e.name), 1)
85
+ S[1] || (S[1] = b(" Show additional properties ")),
86
+ e.name ? (l(), t(T, { key: 0 }, {
87
+ default: p(() => [
88
+ b("for " + C(e.name), 1)
68
89
  ]),
69
90
  _: 1
70
91
  })) : o("", !0)
@@ -72,44 +93,44 @@ const M = {
72
93
  _: 1
73
94
  })
74
95
  ], 512)), [
75
- [z, !n]
76
- ]) : b.value ? w((a(), i(r(D), {
96
+ [A, !d]
97
+ ]) : O.value ? z((l(), t(n(q), {
77
98
  key: 1,
78
99
  as: e.noncollapsible ? "div" : "button",
79
- class: v(["schema-card-title", { "schema-card-title--compact": e.compact }]),
80
- style: T({
100
+ class: P(["schema-card-title", { "schema-card-title--compact": e.compact }]),
101
+ style: R({
81
102
  top: `calc(var(--refs-header-height) + calc(var(--schema-title-height) * ${e.level}))`
82
103
  }),
83
- onClickCapture: H
104
+ onClickCapture: B
84
105
  }, {
85
- default: d(() => {
86
- var m, c, l;
106
+ default: p(() => {
107
+ var h, y, f;
87
108
  return [
88
- e.compact ? (a(), s(t, { key: 0 }, [
89
- u(r(g), {
90
- class: v(["schema-card-title-icon", { "schema-card-title-icon--open": n }]),
109
+ e.compact ? (l(), s(u, { key: 0 }, [
110
+ v(n(D), {
111
+ class: P(["schema-card-title-icon", { "schema-card-title-icon--open": d }]),
91
112
  icon: "Add",
92
113
  size: "sm"
93
114
  }, null, 8, ["class"]),
94
- n ? (a(), s(t, { key: 0 }, [
95
- h(" Hide " + f(((m = e.value) == null ? void 0 : m.title) ?? "Child Attributes"), 1)
96
- ], 64)) : (a(), s(t, { key: 1 }, [
97
- h(" Show " + f(((c = e.value) == null ? void 0 : c.title) ?? "Child Attributes"), 1)
115
+ d ? (l(), s(u, { key: 0 }, [
116
+ b(" Hide " + C(((h = e.value) == null ? void 0 : h.title) ?? "Child Attributes"), 1)
117
+ ], 64)) : (l(), s(u, { key: 1 }, [
118
+ b(" Show " + C(((y = e.value) == null ? void 0 : y.title) ?? "Child Attributes"), 1)
98
119
  ], 64)),
99
- e.name ? (a(), i(q, { key: 2 }, {
100
- default: d(() => [
101
- h("for " + f(e.name), 1)
120
+ e.name ? (l(), t(T, { key: 2 }, {
121
+ default: p(() => [
122
+ b("for " + C(e.name), 1)
102
123
  ]),
103
124
  _: 1
104
125
  })) : o("", !0)
105
- ], 64)) : (a(), s(t, { key: 1 }, [
106
- u(r(g), {
107
- class: v(["schema-card-title-icon", { "schema-card-title-icon--open": n }]),
126
+ ], 64)) : (l(), s(u, { key: 1 }, [
127
+ v(n(D), {
128
+ class: P(["schema-card-title-icon", { "schema-card-title-icon--open": d }]),
108
129
  icon: "Add",
109
130
  size: "sm"
110
131
  }, null, 8, ["class"]),
111
- u(L, {
112
- name: ((l = e.value) == null ? void 0 : l.title) ?? e.name,
132
+ v(Y, {
133
+ name: ((f = e.value) == null ? void 0 : f.title) ?? e.name,
113
134
  value: e.value
114
135
  }, null, 8, ["name", "value"])
115
136
  ], 64))
@@ -117,44 +138,57 @@ const M = {
117
138
  }),
118
139
  _: 2
119
140
  }, 1032, ["as", "class", "style"])), [
120
- [z, !e.hideHeading && !(e.noncollapsible && e.compact)]
141
+ [A, !e.hideHeading && !(e.noncollapsible && e.compact)]
121
142
  ]) : o("", !0),
122
- u(r(F), {
143
+ v(n(G), {
123
144
  as: "ul",
124
- static: !b.value
145
+ static: !O.value
125
146
  }, {
126
- default: d(() => {
127
- var m, c;
147
+ default: p(() => {
148
+ var h, y, f;
128
149
  return [
129
- e.value.properties || e.value.additionalProperties || e.value.patternProperties ? (a(), s(t, { key: 0 }, [
130
- e.value.properties ? (a(!0), s(t, { key: 0 }, A(Object.keys((m = e.value) == null ? void 0 : m.properties), (l) => {
131
- var p, C, O, B;
132
- return a(), i(y, {
133
- key: l,
150
+ m.value && ((h = a.value) != null && h.properties) ? (l(), t(X, {
151
+ key: 0,
152
+ modelValue: c.value,
153
+ "onUpdate:modelValue": S[0] || (S[0] = (i) => c.value = i),
154
+ discriminatorMapping: m.value,
155
+ discriminatorPropertyName: N.value
156
+ }, null, 8, ["modelValue", "discriminatorMapping", "discriminatorPropertyName"])) : o("", !0),
157
+ a.value && ("properties" in a.value || "additionalProperties" in a.value || "patternProperties" in a.value) ? (l(), s(u, { key: 1 }, [
158
+ a.value.properties ? (l(!0), s(u, { key: 0 }, M(Object.keys(a.value.properties), (i) => {
159
+ var g, w;
160
+ return l(), t(H, {
161
+ key: i,
134
162
  compact: e.compact,
135
163
  hideHeading: e.hideHeading,
136
164
  level: e.level + 1,
137
- name: l,
138
- required: ((p = e.value.required) == null ? void 0 : p.includes(l)) || ((O = (C = e.value.properties) == null ? void 0 : C[l]) == null ? void 0 : O.required) === !0,
165
+ name: i,
166
+ required: ((g = a.value.required) == null ? void 0 : g.includes(i)) || ((w = a.value.properties[i]) == null ? void 0 : w.required) === !0,
139
167
  schemas: e.schemas,
140
- value: (B = e.value.properties) == null ? void 0 : B[l]
168
+ value: {
169
+ ...a.value.properties[i],
170
+ parent: a.value,
171
+ isDiscriminator: i === N.value
172
+ }
141
173
  }, null, 8, ["compact", "hideHeading", "level", "name", "required", "schemas", "value"]);
142
174
  }), 128)) : o("", !0),
143
- e.value.patternProperties ? (a(!0), s(t, { key: 1 }, A(Object.keys((c = e.value) == null ? void 0 : c.patternProperties), (l) => {
144
- var p;
145
- return a(), i(y, {
146
- key: l,
175
+ a.value.patternProperties ? (l(!0), s(u, { key: 1 }, M(Object.keys(
176
+ a.value.patternProperties
177
+ ), (i) => {
178
+ var g;
179
+ return l(), t(H, {
180
+ key: i,
147
181
  compact: e.compact,
148
182
  hideHeading: e.hideHeading,
149
183
  level: e.level,
150
- name: l,
184
+ name: i,
151
185
  pattern: "",
152
186
  schemas: e.schemas,
153
- value: (p = e.value.patternProperties) == null ? void 0 : p[l]
187
+ value: ((g = e.value.discriminator) == null ? void 0 : g.propertyName) === i ? e.value : a.value.patternProperties[i]
154
188
  }, null, 8, ["compact", "hideHeading", "level", "name", "schemas", "value"]);
155
189
  }), 128)) : o("", !0),
156
- e.value.additionalProperties ? (a(), s(t, { key: 2 }, [
157
- e.value.additionalProperties === !0 || Object.keys(e.value.additionalProperties).length === 0 || !e.value.additionalProperties.type ? (a(), i(y, {
190
+ a.value.additionalProperties ? (l(), s(u, { key: 2 }, [
191
+ a.value.additionalProperties === !0 || Object.keys(a.value.additionalProperties).length === 0 || !("type" in a.value.additionalProperties) ? (l(), t(H, {
158
192
  key: 0,
159
193
  additional: "",
160
194
  compact: e.compact,
@@ -164,9 +198,9 @@ const M = {
164
198
  schemas: e.schemas,
165
199
  value: {
166
200
  type: "anything",
167
- ...typeof e.value.additionalProperties == "object" ? e.value.additionalProperties : {}
201
+ ...typeof a.value.additionalProperties == "object" ? a.value.additionalProperties : {}
168
202
  }
169
- }, null, 8, ["compact", "hideHeading", "level", "schemas", "value"])) : (a(), i(y, {
203
+ }, null, 8, ["compact", "hideHeading", "level", "schemas", "value"])) : (l(), t(H, {
170
204
  key: 1,
171
205
  additional: "",
172
206
  compact: e.compact,
@@ -174,17 +208,17 @@ const M = {
174
208
  level: e.level,
175
209
  noncollapsible: "",
176
210
  schemas: e.schemas,
177
- value: e.value.additionalProperties
211
+ value: ((y = e.value.discriminator) == null ? void 0 : y.propertyName) === e.name ? e.value : a.value.additionalProperties
178
212
  }, null, 8, ["compact", "hideHeading", "level", "schemas", "value"]))
179
213
  ], 64)) : o("", !0)
180
- ], 64)) : (a(), i(y, {
181
- key: 1,
214
+ ], 64)) : (l(), t(H, {
215
+ key: 2,
182
216
  compact: e.compact,
183
217
  hideHeading: e.hideHeading,
184
218
  level: e.level,
185
- name: e.value.name,
219
+ name: a.value.name,
186
220
  schemas: e.schemas,
187
- value: e.value
221
+ value: ((f = e.value.discriminator) == null ? void 0 : f.propertyName) === e.name ? e.value : a.value
188
222
  }, null, 8, ["compact", "hideHeading", "level", "name", "schemas", "value"]))
189
223
  ];
190
224
  }),
@@ -199,5 +233,5 @@ const M = {
199
233
  }
200
234
  });
201
235
  export {
202
- X as default
236
+ se as default
203
237
  };
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaComposition.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaComposition.vue"],"names":[],"mappings":"AA+QA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAM9E,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,8BAA8B,CAAA;AAKrC,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,kBAAkB,CAAA;IAC/B,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,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;;AA8TF,wBAOG"}
1
+ {"version":3,"file":"SchemaComposition.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaComposition.vue"],"names":[],"mappings":"AAwRA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAM9E,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,8BAA8B,CAAA;AAKrC,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,kBAAkB,CAAA;IAC/B,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,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;;AA2UF,wBAOG"}
@@ -1,17 +1,17 @@
1
- import { defineComponent as L, ref as U, computed as m, resolveComponent as D, createElementBlock as u, openBlock as s, createCommentVNode as p, createBlock as f, Fragment as V, renderList as E, createVNode as b, createElementVNode as d, unref as v, withCtx as F, toDisplayString as H } from "vue";
2
- import { ScalarListbox as I, ScalarMarkdown as M } from "@scalar/components";
3
- import { ScalarIconCaretDown as $ } from "@scalar/icons";
4
- import { stringify as w } from "flatted";
5
- import { mergeAllOfSchemas as Z } from "./helpers/merge-all-of-schemas.js";
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";
6
6
  import { hasComposition as g } from "./helpers/schema-composition.js";
7
7
  import S from "./Schema.vue.js";
8
- const G = { class: "property-rule" }, J = {
8
+ const P = { class: "property-rule" }, Q = {
9
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",
10
10
  type: "button"
11
- }, K = { class: "text-c-2" }, P = { class: "composition-selector-label text-c-1 relative" }, Q = { class: "composition-panel" }, R = {
11
+ }, R = { class: "text-c-2" }, X = { class: "composition-selector-label text-c-1 relative" }, Y = { class: "composition-panel" }, W = {
12
12
  key: 0,
13
13
  class: "property-description border-x border-t p-2"
14
- }, ne = /* @__PURE__ */ L({
14
+ }, ae = /* @__PURE__ */ E({
15
15
  __name: "SchemaComposition",
16
16
  props: {
17
17
  composition: {},
@@ -23,21 +23,21 @@ const G = { class: "property-rule" }, J = {
23
23
  hideHeading: { type: Boolean }
24
24
  },
25
25
  setup(l) {
26
- const y = U(0), C = m(
27
- () => k.value.map((e, o) => ({
26
+ const y = F(0), C = m(
27
+ () => N.value.map((e, o) => ({
28
28
  id: String(o),
29
- label: A(e) || "Schema"
29
+ label: z(e) || "Schema"
30
30
  }))
31
31
  ), O = m({
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
- }), j = m(() => {
36
+ }), q = m(() => {
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
- }), A = (e) => {
40
+ }), z = (e) => {
41
41
  if (!e)
42
42
  return null;
43
43
  if (e.title)
@@ -46,7 +46,7 @@ const G = { class: "property-rule" }, J = {
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 (w(t) === w(e))
49
+ if (T(t) === T(e))
50
50
  return o;
51
51
  }
52
52
  if (e.type === "array" && e.items)
@@ -59,32 +59,34 @@ const G = { class: "property-rule" }, J = {
59
59
  return o[0];
60
60
  }
61
61
  return null;
62
- }, B = (e) => e.find((o) => g(o)), k = m(() => {
63
- const e = B(l.value[l.composition]);
64
- return e ? (e.oneOf || e.anyOf).map((t) => {
62
+ }, k = (e) => e.find((o) => g(o)), N = m(() => {
63
+ if (!k(l.value[l.composition]))
64
+ return l.value[l.composition];
65
+ const e = k(l.value[l.composition]);
66
+ return (e.oneOf || e.anyOf).map((t) => {
65
67
  if (t.allOf) {
66
- const n = t.allOf.find((c) => c.title), i = t.allOf.find((c) => !c.title);
67
- return n && i ? {
68
+ const n = t.allOf.find((c) => c.title), r = t.allOf.find((c) => !c.title);
69
+ return n && r ? {
68
70
  ...n,
69
71
  properties: {
70
72
  ...n.properties,
71
- ...i.properties
73
+ ...r.properties
72
74
  },
73
75
  required: [
74
76
  ...n.required || [],
75
- ...i.required || []
77
+ ...r.required || []
76
78
  ],
77
- oneOf: i.oneOf,
78
- anyOf: i.anyOf
79
+ oneOf: r.oneOf,
80
+ anyOf: r.anyOf
79
81
  } : n || t;
80
82
  }
81
83
  return t;
82
- }) : l.value[l.composition];
83
- }), T = (e) => {
84
+ });
85
+ }), L = (e) => {
84
86
  var o, t;
85
87
  if (e === "allOf") {
86
88
  const n = (t = (o = l.value) == null ? void 0 : o[e]) == null ? void 0 : t.find(
87
- (i) => g(i)
89
+ (r) => g(r)
88
90
  );
89
91
  if (n != null && n.oneOf)
90
92
  return "One of";
@@ -92,57 +94,57 @@ const G = { class: "property-rule" }, J = {
92
94
  return "Any of";
93
95
  }
94
96
  return e.replace(/([A-Z])/g, " $1").replace(/^./, (n) => n.toUpperCase()).toLowerCase().replace(/^(\w)/, (n) => n.toUpperCase());
95
- }, r = m(
96
- () => k.value[y.value]
97
+ }, a = m(
98
+ () => N.value[y.value]
97
99
  ), h = m(() => {
98
100
  var e;
99
- return (e = r.value) != null && e.oneOf ? "oneOf" : "anyOf";
100
- }), q = m(() => {
101
+ return (e = a.value) != null && e.oneOf ? "oneOf" : "anyOf";
102
+ }), U = m(() => {
101
103
  var o;
102
104
  const e = h.value;
103
- return (o = r.value) == null ? void 0 : o[e];
105
+ return (o = a.value) == null ? void 0 : o[e];
104
106
  });
105
107
  return (e, o) => {
106
- var n, i, c, N;
107
- const t = D("SchemaComposition", !0);
108
- return s(), u("div", G, [
109
- e.composition === "allOf" && e.value[e.composition].some((a) => a.oneOf || a.anyOf) ? (s(!0), u(V, { key: 0 }, E(e.value[e.composition].filter(
110
- (a) => !a.oneOf && !a.anyOf
111
- ), (a, z) => (s(), f(S, {
112
- key: z,
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,
113
115
  compact: e.compact,
114
116
  level: e.level,
115
117
  name: e.name,
116
118
  noncollapsible: e.level == 0,
117
119
  schemas: e.schemas,
118
- value: a
120
+ value: i
119
121
  }, null, 8, ["compact", "level", "name", "noncollapsible", "schemas", "value"]))), 128)) : p("", !0),
120
- j.value ? (s(), u(V, { key: 1 }, [
121
- b(v(I), {
122
+ q.value ? (s(), u(A, { key: 1 }, [
123
+ b(v(Z), {
122
124
  modelValue: O.value,
123
- "onUpdate:modelValue": o[0] || (o[0] = (a) => O.value = a),
125
+ "onUpdate:modelValue": o[0] || (o[0] = (i) => O.value = i),
124
126
  options: C.value,
125
127
  resize: ""
126
128
  }, {
127
- default: F(() => {
128
- var a;
129
+ default: $(() => {
130
+ var i;
129
131
  return [
130
- d("button", J, [
131
- d("span", K, H(T(e.composition)), 1),
132
- d("span", P, H(((a = O.value) == null ? void 0 : a.label) || "Schema"), 1),
133
- b(v($), { class: "z-1" })
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" })
134
136
  ])
135
137
  ];
136
138
  }),
137
139
  _: 1
138
140
  }, 8, ["modelValue", "options"]),
139
- d("div", Q, [
140
- (n = r.value) != null && n.description ? (s(), u("div", R, [
141
- b(v(M), {
142
- value: r.value.description
141
+ d("div", Y, [
142
+ (n = a.value) != null && n.description ? (s(), u("div", W, [
143
+ b(v(G), {
144
+ value: a.value.description
143
145
  }, null, 8, ["value"])
144
146
  ])) : p("", !0),
145
- (i = r.value) != null && i.properties ? (s(), f(S, {
147
+ (r = a.value) != null && r.properties || (c = a.value) != null && c.type || (V = a.value) != null && V.nullable ? (s(), f(S, {
146
148
  key: 1,
147
149
  compact: e.compact,
148
150
  level: e.level + 1,
@@ -150,12 +152,12 @@ const G = { class: "property-rule" }, J = {
150
152
  name: e.name,
151
153
  noncollapsible: !0,
152
154
  schemas: e.schemas,
153
- value: {
155
+ value: (H = a.value) != null && H.properties ? {
154
156
  type: "object",
155
- properties: r.value.properties
156
- }
157
+ properties: a.value.properties
158
+ } : a.value
157
159
  }, null, 8, ["compact", "level", "hideHeading", "name", "schemas", "value"])) : p("", !0),
158
- (c = r.value) != null && c.oneOf || (N = r.value) != null && N.anyOf ? (s(), f(t, {
160
+ (w = a.value) != null && w.oneOf || (j = a.value) != null && j.anyOf ? (s(), f(t, {
159
161
  key: 2,
160
162
  compact: e.compact,
161
163
  composition: h.value,
@@ -165,7 +167,7 @@ const G = { class: "property-rule" }, J = {
165
167
  noncollapsible: !0,
166
168
  schemas: e.schemas,
167
169
  value: {
168
- [h.value]: q.value
170
+ [h.value]: U.value
169
171
  }
170
172
  }, null, 8, ["compact", "composition", "hideHeading", "level", "name", "schemas", "value"])) : p("", !0)
171
173
  ])
@@ -176,12 +178,12 @@ const G = { class: "property-rule" }, J = {
176
178
  name: e.name,
177
179
  noncollapsible: e.level == 0,
178
180
  schemas: e.schemas,
179
- value: v(Z)(e.value[e.composition])
181
+ value: v(K)(e.value[e.composition])
180
182
  }, null, 8, ["compact", "level", "name", "noncollapsible", "schemas", "value"]))
181
183
  ]);
182
184
  };
183
185
  }
184
186
  });
185
187
  export {
186
- ne as default
188
+ ae as default
187
189
  };
@@ -0,0 +1,13 @@
1
+ import type { DiscriminatorMapping, DiscriminatorPropertyName } from './helpers/schema-discriminator.js';
2
+ type __VLS_Props = {
3
+ discriminatorMapping: DiscriminatorMapping;
4
+ modelValue: string;
5
+ discriminatorPropertyName?: DiscriminatorPropertyName;
6
+ };
7
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
8
+ "update:modelValue": (value: string) => any;
9
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
10
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
11
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
12
+ export default _default;
13
+ //# sourceMappingURL=SchemaDiscriminator.vue.d.ts.map
@@ -0,0 +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"}