@scalar/api-reference 1.32.6 → 1.32.7

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 (67) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/browser/standalone.js +1813 -1790
  3. package/dist/browser/webpack-stats.json +1 -1
  4. package/dist/components/ApiReference.vue.d.ts.map +1 -1
  5. package/dist/components/ApiReference.vue.js +8 -8
  6. package/dist/components/Badge/Badge.vue.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 +97 -156
  10. package/dist/components/Content/Schema/SchemaEnumPropertyItem.vue.d.ts +7 -0
  11. package/dist/components/Content/Schema/SchemaEnumPropertyItem.vue.d.ts.map +1 -0
  12. package/dist/components/Content/Schema/SchemaEnumPropertyItem.vue.js +7 -0
  13. package/dist/components/Content/Schema/SchemaEnumPropertyItem.vue2.js +25 -0
  14. package/dist/components/Content/Schema/SchemaEnumValues.vue.d.ts.map +1 -1
  15. package/dist/components/Content/Schema/SchemaEnumValues.vue.js +1 -1
  16. package/dist/components/Content/Schema/SchemaEnumValues.vue2.js +73 -90
  17. package/dist/components/Content/Schema/SchemaObjectProperties.vue.d.ts +21 -0
  18. package/dist/components/Content/Schema/SchemaObjectProperties.vue.d.ts.map +1 -0
  19. package/dist/components/Content/Schema/SchemaObjectProperties.vue.js +92 -0
  20. package/dist/components/Content/Schema/SchemaObjectProperties.vue2.js +4 -0
  21. package/dist/components/Content/Schema/SchemaProperty.vue.d.ts +1 -2
  22. package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
  23. package/dist/components/Content/Schema/SchemaProperty.vue.js +2 -2
  24. package/dist/components/Content/Schema/SchemaProperty.vue2.js +54 -55
  25. package/dist/components/Content/Schema/SchemaPropertyExamples.vue.js +2 -2
  26. package/dist/components/Content/Schema/SchemaPropertyExamples.vue2.js +1 -1
  27. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts +0 -2
  28. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts.map +1 -1
  29. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js +1 -1
  30. package/dist/components/Content/Schema/SchemaPropertyHeading.vue2.js +81 -97
  31. package/dist/components/Content/Schema/helpers/{formatExample.d.ts → format-example.d.ts} +1 -1
  32. package/dist/components/Content/Schema/helpers/format-example.d.ts.map +1 -0
  33. package/dist/components/Content/Schema/helpers/is-type-object.d.ts +3 -0
  34. package/dist/components/Content/Schema/helpers/is-type-object.d.ts.map +1 -0
  35. package/dist/components/Content/Schema/helpers/is-type-object.js +17 -0
  36. package/dist/components/Content/Schema/helpers/{optimizeValueForDisplay.d.ts → optimize-value-for-display.d.ts} +1 -1
  37. package/dist/components/Content/Schema/helpers/optimize-value-for-display.d.ts.map +1 -0
  38. package/dist/components/HttpMethod/HttpMethod.vue.d.ts +2 -2
  39. package/dist/components/HttpMethod/HttpMethod.vue.d.ts.map +1 -1
  40. package/dist/features/Operation/components/ParameterListItem.vue.js +1 -1
  41. package/dist/features/example-request/ExampleRequest.vue.d.ts.map +1 -1
  42. package/dist/features/example-request/ExampleRequest.vue.js +1 -1
  43. package/dist/features/example-request/ExampleRequest.vue2.js +126 -124
  44. package/dist/features/example-responses/ExampleResponse.vue.js +2 -2
  45. package/dist/features/example-responses/ExampleResponses.vue.js +2 -2
  46. package/dist/helpers/convert-security-scheme.d.ts +9 -0
  47. package/dist/helpers/convert-security-scheme.d.ts.map +1 -0
  48. package/dist/index.js +1 -1
  49. package/dist/style.css +1 -1
  50. package/dist/v2/ApiReferenceWorkspace.vue.d.ts.map +1 -1
  51. package/dist/v2/ApiReferenceWorkspace.vue.js +18 -17
  52. package/dist/v2/blocks/scalar-request-example-block/components/ExamplePicker.vue.d.ts +6 -1
  53. package/dist/v2/blocks/scalar-request-example-block/components/ExamplePicker.vue.d.ts.map +1 -1
  54. package/dist/v2/blocks/scalar-request-example-block/helpers/find-client.d.ts +3 -1
  55. package/dist/v2/blocks/scalar-request-example-block/helpers/find-client.d.ts.map +1 -1
  56. package/dist/v2/blocks/scalar-request-example-block/helpers/find-client.js +5 -0
  57. package/dist/v2/blocks/scalar-request-example-block/index.d.ts +1 -0
  58. package/dist/v2/blocks/scalar-request-example-block/index.d.ts.map +1 -1
  59. package/dist/v2/events/definitions.d.ts +6 -6
  60. package/dist/v2/events/definitions.d.ts.map +1 -1
  61. package/dist/v2/hooks/useStore.d.ts +9 -0
  62. package/dist/v2/hooks/useStore.d.ts.map +1 -0
  63. package/package.json +11 -11
  64. package/dist/components/Content/Schema/helpers/formatExample.d.ts.map +0 -1
  65. package/dist/components/Content/Schema/helpers/optimizeValueForDisplay.d.ts.map +0 -1
  66. /package/dist/components/Content/Schema/helpers/{formatExample.js → format-example.js} +0 -0
  67. /package/dist/components/Content/Schema/helpers/{optimizeValueForDisplay.js → optimize-value-for-display.js} +0 -0
@@ -1,125 +1,108 @@
1
- import { defineComponent as w, computed as a, createElementBlock as l, createCommentVNode as _, openBlock as u, Fragment as y, renderList as h, createElementVNode as i, toDisplayString as d, createVNode as v, unref as c, createBlock as H, withCtx as D, createTextVNode as O, normalizeClass as $ } from "vue";
2
- import { Disclosure as F, DisclosurePanel as P, DisclosureButton as U } from "@headlessui/vue";
3
- import { ScalarMarkdown as b, ScalarIcon as z } from "@scalar/components";
4
- const M = {
1
+ import { defineComponent as j, computed as i, createElementBlock as o, createCommentVNode as k, openBlock as l, Fragment as y, renderList as p, createBlock as m, unref as v, withCtx as f, createVNode as D, createTextVNode as H, normalizeClass as O, toDisplayString as P } from "vue";
2
+ import { Disclosure as $, DisclosurePanel as F, DisclosureButton as U } from "@headlessui/vue";
3
+ import { ScalarIcon as w } from "@scalar/components";
4
+ import A from "./SchemaEnumPropertyItem.vue.js";
5
+ const z = {
5
6
  key: 0,
6
7
  class: "property-enum"
7
8
  }, R = {
8
9
  key: 0,
9
- class: "property-list"
10
- }, K = { class: "property-heading" }, W = { class: "property-name" }, Y = { class: "property-description" }, q = {
10
+ class: "property-enum-values"
11
+ }, M = {
11
12
  key: 1,
12
13
  class: "property-enum-values"
13
- }, G = { class: "property-enum-value-content" }, J = { class: "property-enum-value-label" }, Q = { class: "property-enum-value-description" }, X = { class: "property-enum-value-label" }, k = 9, Z = 5, N = " ", ne = /* @__PURE__ */ w({
14
+ }, N = 9, W = 5, S = " ", K = /* @__PURE__ */ j({
14
15
  __name: "SchemaEnumValues",
15
16
  props: {
16
17
  value: {},
17
18
  isDiscriminator: { type: Boolean }
18
19
  },
19
- setup(r) {
20
- const S = (t) => {
21
- var s;
22
- return t ? t.enum || ((s = t.items) == null ? void 0 : s.enum) || [] : [];
23
- }, f = (t, s) => {
24
- var n, o, g, x;
25
- const e = ((o = (n = r.value) == null ? void 0 : n["x-enum-varnames"]) == null ? void 0 : o[s]) ?? ((x = (g = r.value) == null ? void 0 : g["x-enumNames"]) == null ? void 0 : x[s]);
26
- return e ? `${t}${N}=${N}${e}` : String(t);
27
- }, A = (t) => {
28
- var n, o;
29
- const s = (n = r.value) == null ? void 0 : n["x-enum-descriptions"];
30
- if (Array.isArray(s))
31
- return s[t];
32
- const e = (o = r.value) == null ? void 0 : o["x-enumDescriptions"];
20
+ setup(s) {
21
+ const I = (t) => {
22
+ var n;
23
+ return t ? t.enum || ((n = t.items) == null ? void 0 : n.enum) || [] : [];
24
+ }, E = (t, n) => {
25
+ var r, u, h, x;
26
+ const e = ((u = (r = s.value) == null ? void 0 : r["x-enum-varnames"]) == null ? void 0 : u[n]) ?? ((x = (h = s.value) == null ? void 0 : h["x-enumNames"]) == null ? void 0 : x[n]);
27
+ return e ? `${t}${S}=${S}${e}` : String(t);
28
+ }, d = (t) => {
29
+ var r, u;
30
+ const n = (r = s.value) == null ? void 0 : r["x-enum-descriptions"];
31
+ if (Array.isArray(n))
32
+ return n[t];
33
+ const e = (u = s.value) == null ? void 0 : u["x-enumDescriptions"];
33
34
  if (Array.isArray(e))
34
35
  return e[t];
35
- }, I = (t) => {
36
- var n, o;
37
- const s = (n = r.value) == null ? void 0 : n["x-enumDescriptions"];
38
- if (s && !Array.isArray(s))
39
- return s[t];
40
- const e = (o = r.value) == null ? void 0 : o["x-enum-descriptions"];
36
+ }, C = (t) => {
37
+ var r, u;
38
+ const n = (r = s.value) == null ? void 0 : r["x-enumDescriptions"];
39
+ if (n && !Array.isArray(n))
40
+ return n[t];
41
+ const e = (u = s.value) == null ? void 0 : u["x-enum-descriptions"];
41
42
  if (e && !Array.isArray(e))
42
43
  return e[t];
43
- }, m = a(() => S(r.value)), V = a(() => m.value.length > 0), E = a(
44
- () => m.value.length > k
45
- ), p = a(
46
- () => E.value ? Z : k
47
- ), C = a(
48
- () => m.value.slice(0, p.value)
49
- ), L = a(
50
- () => m.value.slice(p.value)
51
- ), B = a(() => {
52
- var s, e;
53
- const t = ((s = r.value) == null ? void 0 : s["x-enumDescriptions"]) ?? ((e = r.value) == null ? void 0 : e["x-enum-descriptions"]);
44
+ }, a = i(() => I(s.value)), L = i(() => a.value.length > 0), b = i(
45
+ () => a.value.length > N
46
+ ), c = i(
47
+ () => b.value ? W : N
48
+ ), B = i(
49
+ () => a.value.slice(0, c.value)
50
+ ), V = i(
51
+ () => a.value.slice(c.value)
52
+ );
53
+ i(() => {
54
+ var n, e;
55
+ const t = ((n = s.value) == null ? void 0 : n["x-enumDescriptions"]) ?? ((e = s.value) == null ? void 0 : e["x-enum-descriptions"]);
54
56
  return t && typeof t == "object" && !Array.isArray(t);
55
- }), T = a(() => {
56
- var s, e;
57
- const t = ((s = r.value) == null ? void 0 : s["x-enumDescriptions"]) ?? ((e = r.value) == null ? void 0 : e["x-enum-descriptions"]);
57
+ });
58
+ const g = i(() => {
59
+ var n, e;
60
+ const t = ((n = s.value) == null ? void 0 : n["x-enumDescriptions"]) ?? ((e = s.value) == null ? void 0 : e["x-enum-descriptions"]);
58
61
  return t && typeof t == "object" && !Array.isArray(t);
59
- }), j = a(() => V.value && !r.isDiscriminator);
60
- return (t, s) => j.value ? (u(), l("div", M, [
61
- B.value ? (u(), l("div", R, [
62
- (u(!0), l(y, null, h(m.value, (e, n) => (u(), l("div", {
62
+ }), T = i(() => L.value && !s.isDiscriminator);
63
+ return (t, n) => T.value ? (l(), o("div", z, [
64
+ g.value ? (l(), o("ul", R, [
65
+ (l(!0), o(y, null, p(a.value, (e, r) => (l(), m(A, {
63
66
  key: e,
64
- class: "property"
65
- }, [
66
- i("div", K, [
67
- i("div", W, d(e), 1)
68
- ]),
69
- i("div", Y, [
70
- v(c(b), {
71
- value: T.value ? I(e) : A(n)
72
- }, null, 8, ["value"])
73
- ])
74
- ]))), 128))
75
- ])) : (u(), l("ul", q, [
76
- (u(!0), l(y, null, h(C.value, (e, n) => (u(), l("li", {
67
+ label: e,
68
+ description: g.value ? C(e) : d(r)
69
+ }, null, 8, ["label", "description"]))), 128))
70
+ ])) : (l(), o("ul", M, [
71
+ (l(!0), o(y, null, p(B.value, (e, r) => (l(), m(A, {
77
72
  key: e,
78
- class: "property-enum-value"
79
- }, [
80
- i("div", G, [
81
- i("span", J, d(f(e, n)), 1),
82
- i("span", Q, [
83
- v(c(b), {
84
- value: A(n)
85
- }, null, 8, ["value"])
86
- ])
87
- ])
88
- ]))), 128)),
89
- E.value ? (u(), H(c(F), { key: 0 }, {
90
- default: D(({ open: e }) => [
91
- v(c(P), null, {
92
- default: D(() => [
93
- (u(!0), l(y, null, h(L.value, (n, o) => (u(), l("li", {
94
- key: n,
95
- class: "property-enum-value"
96
- }, [
97
- i("span", X, d(f(
98
- n,
99
- p.value + o
100
- )), 1)
101
- ]))), 128))
73
+ label: E(e, r),
74
+ description: d(r)
75
+ }, null, 8, ["label", "description"]))), 128)),
76
+ b.value ? (l(), m(v($), { key: 0 }, {
77
+ default: f(({ open: e }) => [
78
+ D(v(F), null, {
79
+ default: f(() => [
80
+ (l(!0), o(y, null, p(V.value, (r, u) => (l(), m(A, {
81
+ key: r,
82
+ label: E(r, c.value + u),
83
+ description: d(c.value + u)
84
+ }, null, 8, ["label", "description"]))), 128))
102
85
  ]),
103
86
  _: 1
104
87
  }),
105
- v(c(U), { class: "enum-toggle-button" }, {
106
- default: D(() => [
107
- v(c(z), {
108
- class: $(["enum-toggle-button-icon", { "enum-toggle-button-icon--open": e }]),
88
+ D(v(U), { class: "enum-toggle-button" }, {
89
+ default: f(() => [
90
+ D(v(w), {
91
+ class: O(["enum-toggle-button-icon", { "enum-toggle-button-icon--open": e }]),
109
92
  icon: "Add",
110
93
  size: "sm"
111
94
  }, null, 8, ["class"]),
112
- O(" " + d(e ? "Hide values" : "Show all values"), 1)
95
+ H(" " + P(e ? "Hide values" : "Show all values"), 1)
113
96
  ]),
114
97
  _: 2
115
98
  }, 1024)
116
99
  ]),
117
100
  _: 1
118
- })) : _("", !0)
101
+ })) : k("", !0)
119
102
  ]))
120
- ])) : _("", !0);
103
+ ])) : k("", !0);
121
104
  }
122
105
  });
123
106
  export {
124
- ne as default
107
+ K as default
125
108
  };
@@ -0,0 +1,21 @@
1
+ import type { OpenAPIV3_1 } from '@scalar/openapi-types';
2
+ import type { Schemas } from '../../../features/Operation/types/schemas';
3
+ type __VLS_Props = {
4
+ schema: OpenAPIV3_1.SchemaObject;
5
+ compact?: boolean;
6
+ hideHeading?: boolean;
7
+ level?: number;
8
+ hideModelNames?: boolean;
9
+ schemas?: Schemas;
10
+ discriminator?: string;
11
+ discriminatorMapping?: Record<string, string>;
12
+ discriminatorPropertyName?: string;
13
+ hasDiscriminator?: boolean;
14
+ };
15
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
16
+ "update:modelValue": (value: string) => any;
17
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
18
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
19
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
20
+ export default _default;
21
+ //# sourceMappingURL=SchemaObjectProperties.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SchemaObjectProperties.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaObjectProperties.vue"],"names":[],"mappings":"AAAA,OAkKO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAExD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAA;AAMjE,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,WAAW,CAAC,YAAY,CAAA;IAChC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,oBAAoB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC7C,yBAAyB,CAAC,EAAE,MAAM,CAAA;IAClC,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B,CAAC;;;;;;AAkOF,wBAOG"}
@@ -0,0 +1,92 @@
1
+ import { defineComponent as P, createElementBlock as m, openBlock as i, Fragment as o, createCommentVNode as s, createBlock as n, renderList as g } from "vue";
2
+ import t from "./SchemaProperty.vue.js";
3
+ const H = /* @__PURE__ */ P({
4
+ __name: "SchemaObjectProperties",
5
+ props: {
6
+ schema: { type: [Object, Boolean] },
7
+ compact: { type: Boolean },
8
+ hideHeading: { type: Boolean },
9
+ level: { default: 0 },
10
+ hideModelNames: { type: Boolean, default: !1 },
11
+ schemas: {},
12
+ discriminator: {},
13
+ discriminatorMapping: {},
14
+ discriminatorPropertyName: {},
15
+ hasDiscriminator: { type: Boolean }
16
+ },
17
+ emits: ["update:modelValue"],
18
+ setup(f, { emit: y }) {
19
+ const v = y, r = (e) => {
20
+ v("update:modelValue", e);
21
+ }, M = (e) => typeof e == "object" && typeof e["x-additionalPropertiesName"] == "string" && e["x-additionalPropertiesName"].trim().length > 0 ? `${e["x-additionalPropertiesName"].trim()}*` : "propertyName*", d = (e) => e === !0 || typeof e == "object" && Object.keys(e).length === 0 || typeof e != "object" || !("type" in e) ? {
22
+ type: "anything",
23
+ ...typeof e == "object" ? e : {}
24
+ } : e;
25
+ return (e, V) => (i(), m(o, null, [
26
+ e.schema.properties ? (i(!0), m(o, { key: 0 }, g(Object.keys(e.schema.properties), (a) => {
27
+ var l, p, c, h, u, N;
28
+ return i(), n(t, {
29
+ key: a,
30
+ compact: e.compact,
31
+ hideHeading: e.hideHeading,
32
+ level: e.level,
33
+ name: a,
34
+ hideModelNames: e.hideModelNames,
35
+ required: ((l = e.schema.required) == null ? void 0 : l.includes(a)) || ((p = e.schema.properties[a]) == null ? void 0 : p.required) === !0,
36
+ schemas: e.schemas,
37
+ resolvedSchema: e.schema.properties[a],
38
+ value: {
39
+ ...e.schema.properties[a],
40
+ parent: e.schema,
41
+ isDiscriminator: a === e.discriminatorPropertyName || ((c = e.schema.discriminator) == null ? void 0 : c.propertyName) === a
42
+ },
43
+ discriminatorMapping: ((h = e.schema.discriminator) == null ? void 0 : h.mapping) || e.discriminatorMapping,
44
+ discriminatorPropertyName: ((u = e.schema.discriminator) == null ? void 0 : u.propertyName) || e.discriminatorPropertyName,
45
+ isDiscriminator: a === (((N = e.schema.discriminator) == null ? void 0 : N.propertyName) || e.discriminatorPropertyName),
46
+ modelValue: e.discriminator,
47
+ "onUpdate:modelValue": r
48
+ }, null, 8, ["compact", "hideHeading", "level", "name", "hideModelNames", "required", "schemas", "resolvedSchema", "value", "discriminatorMapping", "discriminatorPropertyName", "isDiscriminator", "modelValue"]);
49
+ }), 128)) : s("", !0),
50
+ e.schema.patternProperties ? (i(!0), m(o, { key: 1 }, g(Object.keys(e.schema.patternProperties), (a) => (i(), n(t, {
51
+ key: a,
52
+ variant: "patternProperties",
53
+ compact: e.compact,
54
+ hideHeading: e.hideHeading,
55
+ level: e.level,
56
+ name: a,
57
+ hideModelNames: e.hideModelNames,
58
+ schemas: e.schemas,
59
+ resolvedSchema: e.schema.patternProperties[a],
60
+ value: {
61
+ ...e.schema.patternProperties[a]
62
+ },
63
+ discriminatorMapping: e.discriminatorMapping,
64
+ discriminatorPropertyName: e.discriminatorPropertyName,
65
+ isDiscriminator: !1,
66
+ modelValue: e.discriminator,
67
+ "onUpdate:modelValue": r
68
+ }, null, 8, ["compact", "hideHeading", "level", "name", "hideModelNames", "schemas", "resolvedSchema", "value", "discriminatorMapping", "discriminatorPropertyName", "modelValue"]))), 128)) : s("", !0),
69
+ e.schema.additionalProperties ? (i(), n(t, {
70
+ key: 2,
71
+ variant: "additionalProperties",
72
+ compact: e.compact,
73
+ hideHeading: e.hideHeading,
74
+ level: e.level,
75
+ name: M(e.schema.additionalProperties),
76
+ hideModelNames: e.hideModelNames,
77
+ schemas: e.schemas,
78
+ resolvedSchema: d(e.schema.additionalProperties),
79
+ value: d(e.schema.additionalProperties),
80
+ discriminatorMapping: e.discriminatorMapping,
81
+ discriminatorPropertyName: e.discriminatorPropertyName,
82
+ isDiscriminator: !1,
83
+ modelValue: e.discriminator,
84
+ noncollapsible: "",
85
+ "onUpdate:modelValue": r
86
+ }, null, 8, ["compact", "hideHeading", "level", "name", "hideModelNames", "schemas", "resolvedSchema", "value", "discriminatorMapping", "discriminatorPropertyName", "modelValue"])) : s("", !0)
87
+ ], 64));
88
+ }
89
+ });
90
+ export {
91
+ H as default
92
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./SchemaObjectProperties.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -15,8 +15,6 @@ type __VLS_Props = {
15
15
  required?: boolean;
16
16
  compact?: boolean;
17
17
  description?: string;
18
- additional?: boolean;
19
- pattern?: boolean;
20
18
  withExamples?: boolean;
21
19
  hideModelNames?: boolean;
22
20
  schemas?: Schemas;
@@ -24,6 +22,7 @@ type __VLS_Props = {
24
22
  discriminatorMapping?: Record<string, string>;
25
23
  discriminatorPropertyName?: string;
26
24
  isDiscriminator?: boolean;
25
+ variant?: 'additionalProperties' | 'patternProperties';
27
26
  };
28
27
  declare const _default_1: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
29
28
  "update:modelValue": (value: string) => any;
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaProperty.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaProperty.vue"],"names":[],"mappings":"AA8gBA,OAAO,EAAoB,KAAK,SAAS,EAAE,MAAM,KAAK,CAAA;AAOtD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAA;AAWjE;;;;;GAKG;AAEH,KAAK,WAAW,GAAG;IACf,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC3B,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,oBAAoB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC7C,yBAAyB,CAAC,EAAE,MAAM,CAAA;IAClC,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B,CAAC;;;;;;cAZW,OAAO;WAFV,MAAM;aAGJ,OAAO;oBAKA,OAAO;kBADT,OAAO;;AAohB1B,0BASG"}
1
+ {"version":3,"file":"SchemaProperty.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaProperty.vue"],"names":[],"mappings":"AAshBA,OAAO,EAAoB,KAAK,SAAS,EAAE,MAAM,KAAK,CAAA;AAOtD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAA;AAWjE;;;;;GAKG;AAEH,KAAK,WAAW,GAAG;IACf,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC3B,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,oBAAoB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC7C,yBAAyB,CAAC,EAAE,MAAM,CAAA;IAClC,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,OAAO,CAAC,EAAE,sBAAsB,GAAG,mBAAmB,CAAA;CACvD,CAAC;;;;;;cAXW,OAAO;WAFV,MAAM;aAGJ,OAAO;oBAGA,OAAO;kBADT,OAAO;;AAshB1B,0BASG"}
@@ -1,7 +1,7 @@
1
1
  import o from "./SchemaProperty.vue2.js";
2
2
  /* empty css */
3
3
  import r from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-4a4e028a"]]);
4
+ const a = /* @__PURE__ */ r(o, [["__scopeId", "data-v-7f7d1229"]]);
5
5
  export {
6
- m as default
6
+ a as default
7
7
  };
@@ -1,6 +1,6 @@
1
- import { defineComponent as $, computed as p, inject as z, createBlock as c, openBlock as a, resolveDynamicComponent as Z, normalizeClass as L, withCtx as v, createCommentVNode as s, createElementBlock as l, createVNode as d, createSlots as X, createTextVNode as O, toDisplayString as V, unref as h, Fragment as k, renderList as G } from "vue";
1
+ import { defineComponent as $, computed as p, inject as z, createBlock as c, openBlock as r, resolveDynamicComponent as Z, normalizeClass as L, withCtx as v, createCommentVNode as l, createElementBlock as t, createVNode as d, createSlots as X, toDisplayString as y, Fragment as f, createTextVNode as V, unref as h, renderList as G } from "vue";
2
2
  import { ScalarMarkdown as D } from "@scalar/components";
3
- import { optimizeValueForDisplay as J, compositions as K } from "./helpers/optimizeValueForDisplay.js";
3
+ import { optimizeValueForDisplay as J, compositions as K } from "./helpers/optimize-value-for-display.js";
4
4
  import Q from "./SchemaEnumValues.vue.js";
5
5
  import { DISCRIMINATOR_CONTEXT as W } from "../../../hooks/useDiscriminator.js";
6
6
  import C from "./Schema.vue.js";
@@ -9,18 +9,24 @@ import Y from "./SchemaDiscriminator.vue.js";
9
9
  import _ from "./SchemaPropertyHeading.vue.js";
10
10
  import x from "../../../features/specification-extension/SpecificationExtension.vue.js";
11
11
  const ee = {
12
+ key: 0,
13
+ class: "property-name-pattern-properties"
14
+ }, ie = {
15
+ key: 1,
16
+ class: "property-name-additional-properties"
17
+ }, ne = {
12
18
  key: 1,
13
19
  class: "property-description"
14
- }, ie = {
20
+ }, re = {
15
21
  key: 2,
16
22
  class: "property-description"
17
- }, ne = {
23
+ }, ae = {
18
24
  key: 3,
19
25
  class: "children"
20
- }, ae = {
26
+ }, te = {
21
27
  key: 0,
22
28
  class: "children"
23
- }, ye = /* @__PURE__ */ $({
29
+ }, he = /* @__PURE__ */ $({
24
30
  __name: "SchemaProperty",
25
31
  props: {
26
32
  is: {},
@@ -31,19 +37,18 @@ const ee = {
31
37
  required: { type: Boolean, default: !1 },
32
38
  compact: { type: Boolean, default: !1 },
33
39
  description: {},
34
- additional: { type: Boolean },
35
- pattern: { type: Boolean },
36
40
  withExamples: { type: Boolean, default: !0 },
37
41
  hideModelNames: { type: Boolean, default: !1 },
38
42
  schemas: {},
39
43
  hideHeading: { type: Boolean },
40
44
  discriminatorMapping: {},
41
45
  discriminatorPropertyName: {},
42
- isDiscriminator: { type: Boolean }
46
+ isDiscriminator: { type: Boolean },
47
+ variant: {}
43
48
  },
44
49
  emits: ["update:modelValue"],
45
50
  setup(R, { emit: T }) {
46
- const u = R, w = T, N = {
51
+ const u = R, w = T, k = {
47
52
  integer: {
48
53
  _default: "Integer numbers.",
49
54
  int32: "Signed 32-bit integers (commonly used integer type).",
@@ -57,16 +62,16 @@ const ee = {
57
62
  byte: "base64-encoded characters, for example, U3dhZ2dlciByb2Nrcw==",
58
63
  binary: "binary data, used to describe files"
59
64
  }
60
- }, g = (e, i) => i != null && i.properties || i != null && i.additionalProperties || i != null && i.patternProperties || i != null && i.allOf ? null : e || (i == null ? void 0 : i.description) || null, M = (e) => !e || !N[e.type] ? null : N[e.type][e.format || e.contentEncoding || "_default"], E = (e) => {
65
+ }, g = (e, i) => i != null && i.properties || i != null && i.additionalProperties || i != null && i.patternProperties || i != null && i.allOf ? null : e || (i == null ? void 0 : i.description) || null, N = (e) => !e || !k[e.type] ? null : k[e.type][e.format || e.contentEncoding || "_default"], E = (e) => {
61
66
  var i;
62
67
  return (e == null ? void 0 : e.enum) || ((i = e == null ? void 0 : e.items) == null ? void 0 : i.enum) || [];
63
- }, n = p(() => J(u.value)), t = z(W, null), r = p(() => {
68
+ }, n = p(() => J(u.value)), o = z(W, null), a = p(() => {
64
69
  var e;
65
- return u.level > 0 ? n.value : (e = t == null ? void 0 : t.value) != null && e.mergedSchema ? t.value.mergedSchema : n.value;
70
+ return u.level > 0 ? n.value : (e = o == null ? void 0 : o.value) != null && e.mergedSchema ? o.value.mergedSchema : n.value;
66
71
  }), I = p(() => {
67
72
  var e;
68
- return ((e = t == null ? void 0 : t.value) == null ? void 0 : e.selectedType) || (u.discriminatorMapping ? Object.keys(u.discriminatorMapping)[0] : "");
69
- }), A = (e, i, m, y, f) => i || m || y || (e == null ? void 0 : e.deprecated) || (e == null ? void 0 : e.const) !== void 0 || (e == null ? void 0 : e.enum) && e.enum.length === 1 || (e == null ? void 0 : e.type) || (e == null ? void 0 : e.nullable) === !0 || (e == null ? void 0 : e.writeOnly) || (e == null ? void 0 : e.readOnly) || f, b = (e) => {
73
+ return ((e = o == null ? void 0 : o.value) == null ? void 0 : e.selectedType) || (u.discriminatorMapping ? Object.keys(u.discriminatorMapping)[0] : "");
74
+ }), A = (e, i, m) => i || (e == null ? void 0 : e.deprecated) || (e == null ? void 0 : e.const) !== void 0 || (e == null ? void 0 : e.enum) && e.enum.length === 1 || (e == null ? void 0 : e.type) || (e == null ? void 0 : e.nullable) === !0 || (e == null ? void 0 : e.writeOnly) || (e == null ? void 0 : e.readOnly) || m, b = (e) => {
70
75
  w("update:modelValue", e);
71
76
  }, P = p(() => {
72
77
  const e = n.value;
@@ -85,7 +90,7 @@ const ee = {
85
90
  });
86
91
  return (e, i) => {
87
92
  var m;
88
- return a(), c(Z(e.is ?? "li"), {
93
+ return r(), c(Z(e.is ?? "li"), {
89
94
  class: L(["property", [
90
95
  (g(e.description, n.value), ""),
91
96
  `property--level-${e.level}`,
@@ -96,19 +101,11 @@ const ee = {
96
101
  ]])
97
102
  }, {
98
103
  default: v(() => {
99
- var y, f;
104
+ var M, S;
100
105
  return [
101
- A(
102
- n.value,
103
- e.name,
104
- e.additional,
105
- e.pattern,
106
- e.required
107
- ) ? (a(), c(_, {
106
+ A(n.value, e.name, e.required) ? (r(), c(_, {
108
107
  key: 0,
109
- additional: e.additional,
110
108
  enum: E(n.value).length > 0,
111
- pattern: e.pattern,
112
109
  required: e.required,
113
110
  value: n.value,
114
111
  schemas: e.schemas,
@@ -117,90 +114,92 @@ const ee = {
117
114
  e.name ? {
118
115
  name: "name",
119
116
  fn: v(() => [
120
- O(V(e.name), 1)
117
+ e.variant === "patternProperties" ? (r(), t("span", ee, y(e.name), 1)) : e.variant === "additionalProperties" ? (r(), t("span", ie, y(e.name), 1)) : (r(), t(f, { key: 2 }, [
118
+ V(y(e.name), 1)
119
+ ], 64))
121
120
  ]),
122
121
  key: "0"
123
122
  } : void 0,
124
- (y = n.value) != null && y.example ? {
123
+ (M = n.value) != null && M.example ? {
125
124
  name: "example",
126
125
  fn: v(() => [
127
- O(" Example: " + V(n.value.example), 1)
126
+ V(" Example: " + y(n.value.example), 1)
128
127
  ]),
129
128
  key: "1"
130
129
  } : void 0
131
- ]), 1032, ["additional", "enum", "pattern", "required", "value", "schemas", "hideModelNames"])) : s("", !0),
132
- g(e.description, n.value) ? (a(), l("div", ee, [
130
+ ]), 1032, ["enum", "required", "value", "schemas", "hideModelNames"])) : l("", !0),
131
+ g(e.description, n.value) ? (r(), t("div", ne, [
133
132
  d(h(D), {
134
133
  value: g(e.description, n.value)
135
134
  }, null, 8, ["value"])
136
- ])) : M(n.value) ? (a(), l("div", ie, [
135
+ ])) : N(n.value) ? (r(), t("div", re, [
137
136
  d(h(D), {
138
- value: M(n.value) || ""
137
+ value: N(n.value) || ""
139
138
  }, null, 8, ["value"])
140
- ])) : s("", !0),
139
+ ])) : l("", !0),
141
140
  d(Q, { value: n.value }, null, 8, ["value"]),
142
- F.value ? (a(), l("div", ne, [
141
+ F.value ? (r(), t("div", ae, [
143
142
  d(C, {
144
143
  compact: e.compact,
145
144
  level: e.level + 1,
146
145
  name: e.name,
147
146
  noncollapsible: e.noncollapsible,
148
- value: r.value,
149
- resolvedSchema: r.value,
147
+ value: a.value,
148
+ resolvedSchema: a.value,
150
149
  discriminatorMapping: e.discriminatorMapping,
151
150
  discriminatorPropertyName: e.discriminatorPropertyName,
152
151
  schemas: e.schemas,
153
152
  "onUpdate:modelValue": b
154
153
  }, null, 8, ["compact", "level", "name", "noncollapsible", "value", "resolvedSchema", "discriminatorMapping", "discriminatorPropertyName", "schemas"])
155
- ])) : s("", !0),
156
- (f = n.value) != null && f.items && typeof n.value.items == "object" ? (a(), l(k, { key: 4 }, [
157
- q.value ? (a(), l("div", ae, [
154
+ ])) : l("", !0),
155
+ (S = n.value) != null && S.items && typeof n.value.items == "object" ? (r(), t(f, { key: 4 }, [
156
+ q.value ? (r(), t("div", te, [
158
157
  d(C, {
159
158
  compact: e.compact,
160
159
  level: e.level + 1,
161
160
  name: e.name,
162
161
  noncollapsible: e.noncollapsible,
163
- value: r.value && typeof r.value == "object" && "items" in r.value ? r.value.items : n.value.items,
164
- resolvedSchema: r.value && typeof r.value == "object" && "items" in r.value ? r.value.items : n.value.items,
162
+ value: a.value && typeof a.value == "object" && "items" in a.value ? a.value.items : n.value.items,
163
+ resolvedSchema: a.value && typeof a.value == "object" && "items" in a.value ? a.value.items : n.value.items,
165
164
  discriminatorMapping: e.discriminatorMapping,
166
165
  discriminatorPropertyName: e.discriminatorPropertyName,
167
166
  schemas: e.schemas,
168
167
  "onUpdate:modelValue": b
169
168
  }, null, 8, ["compact", "level", "name", "noncollapsible", "value", "resolvedSchema", "discriminatorMapping", "discriminatorPropertyName", "schemas"])
170
- ])) : s("", !0)
171
- ], 64)) : s("", !0),
172
- (a(!0), l(k, null, G(h(K), (o) => {
173
- var S, j, B;
174
- return a(), l(k, { key: o }, [
175
- (S = n.value) != null && S[o] && !((j = n.value) != null && j.items && typeof o == "string" && typeof n.value.items == "object" && o in n.value.items) ? (a(), c(H, {
169
+ ])) : l("", !0)
170
+ ], 64)) : l("", !0),
171
+ (r(!0), t(f, null, G(h(K), (s) => {
172
+ var j, O, B;
173
+ return r(), t(f, { key: s }, [
174
+ (j = n.value) != null && j[s] && !((O = n.value) != null && O.items && typeof s == "string" && typeof n.value.items == "object" && s in n.value.items) ? (r(), c(H, {
176
175
  key: 0,
177
176
  compact: e.compact,
178
- composition: o,
177
+ composition: s,
179
178
  hideHeading: e.hideHeading,
180
179
  level: e.level,
181
180
  name: e.name,
182
181
  noncollapsible: e.noncollapsible,
183
182
  schemas: e.schemas,
184
183
  value: n.value
185
- }, null, 8, ["compact", "composition", "hideHeading", "level", "name", "noncollapsible", "schemas", "value"])) : U(o) ? (a(), c(H, {
184
+ }, null, 8, ["compact", "composition", "hideHeading", "level", "name", "noncollapsible", "schemas", "value"])) : U(s) ? (r(), c(H, {
186
185
  key: 1,
187
186
  compact: e.compact,
188
- composition: o,
187
+ composition: s,
189
188
  hideHeading: e.hideHeading,
190
189
  level: e.level,
191
190
  name: e.name,
192
191
  noncollapsible: e.noncollapsible,
193
192
  schemas: e.schemas,
194
193
  value: (B = n.value) == null ? void 0 : B.items
195
- }, null, 8, ["compact", "composition", "hideHeading", "level", "name", "noncollapsible", "schemas", "value"])) : s("", !0)
194
+ }, null, 8, ["compact", "composition", "hideHeading", "level", "name", "noncollapsible", "schemas", "value"])) : l("", !0)
196
195
  ], 64);
197
196
  }), 128)),
198
- e.isDiscriminator && e.discriminatorMapping && e.compact ? (a(), c(Y, {
197
+ e.isDiscriminator && e.discriminatorMapping && e.compact ? (r(), c(Y, {
199
198
  key: 5,
200
199
  "discriminator-mapping": e.discriminatorMapping,
201
200
  discriminator: I.value,
202
201
  "onUpdate:modelValue": b
203
- }, null, 8, ["discriminator-mapping", "discriminator"])) : s("", !0),
202
+ }, null, 8, ["discriminator-mapping", "discriminator"])) : l("", !0),
204
203
  d(h(x), { value: n.value }, null, 8, ["value"])
205
204
  ];
206
205
  }),
@@ -210,5 +209,5 @@ const ee = {
210
209
  }
211
210
  });
212
211
  export {
213
- ye as default
212
+ he as default
214
213
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./SchemaPropertyExamples.vue2.js";
2
2
  /* empty css */
3
3
  import r from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-1b238a2e"]]);
4
+ const p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-1c1ebd80"]]);
5
5
  export {
6
- m as default
6
+ p as default
7
7
  };
@@ -1,7 +1,7 @@
1
1
  import { defineComponent as y, createElementBlock as l, openBlock as p, Fragment as i, createCommentVNode as u, createElementVNode as e, unref as o, createVNode as c, toDisplayString as n, renderList as b } from "vue";
2
2
  import { ScalarIcon as x } from "@scalar/components";
3
3
  import { useClipboard as v } from "@scalar/use-hooks/useClipboard";
4
- import { formatExample as r } from "./helpers/formatExample.js";
4
+ import { formatExample as r } from "./helpers/format-example.js";
5
5
  const f = {
6
6
  key: 0,
7
7
  class: "property-example"