@scalar/api-reference 1.28.4 → 1.28.6

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 (139) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/dist/browser/standalone.js +6206 -6147
  3. package/dist/browser/webpack-stats.json +1 -1
  4. package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
  5. package/dist/components/ApiReferenceLayout.vue.js +2 -2
  6. package/dist/components/Content/ClientLibraries/ClientLibraries.vue.d.ts.map +1 -1
  7. package/dist/components/Content/ClientLibraries/ClientLibraries.vue.js +2 -2
  8. package/dist/components/Content/Content.vue.d.ts.map +1 -1
  9. package/dist/components/Content/Content.vue.js +2 -2
  10. package/dist/components/Content/Content.vue2.js +57 -55
  11. package/dist/components/Content/Introduction/Description.vue.d.ts.map +1 -1
  12. package/dist/components/Content/Introduction/Description.vue.js +2 -2
  13. package/dist/components/Content/Introduction/Introduction.vue.d.ts.map +1 -1
  14. package/dist/components/Content/Introduction/Introduction.vue.js +2 -2
  15. package/dist/components/Content/Introduction/Introduction.vue2.js +24 -24
  16. package/dist/components/Content/Lazy/Lazy.vue.d.ts.map +1 -1
  17. package/dist/components/Content/Lazy/Loading.vue.d.ts.map +1 -1
  18. package/dist/components/Content/Lazy/Loading.vue.js +4 -2
  19. package/dist/components/Content/Models/Models.vue.d.ts.map +1 -1
  20. package/dist/components/Content/Models/Models.vue.js +2 -2
  21. package/dist/components/Content/Models/Models.vue2.js +18 -17
  22. package/dist/components/Content/Schema/Schema.vue.d.ts +1 -0
  23. package/dist/components/Content/Schema/Schema.vue.d.ts.map +1 -1
  24. package/dist/components/Content/Schema/Schema.vue.js +4 -4
  25. package/dist/components/Content/Schema/Schema.vue2.js +79 -67
  26. package/dist/components/Content/Schema/SchemaDiscriminator.vue.d.ts +12 -0
  27. package/dist/components/Content/Schema/SchemaDiscriminator.vue.d.ts.map +1 -0
  28. package/dist/components/Content/Schema/SchemaDiscriminator.vue.js +7 -0
  29. package/dist/components/Content/Schema/SchemaDiscriminator.vue2.js +109 -0
  30. package/dist/components/Content/Schema/SchemaHeading.vue.d.ts.map +1 -1
  31. package/dist/components/Content/Schema/SchemaHeading.vue.js +2 -2
  32. package/dist/components/Content/Schema/SchemaHeading.vue2.js +26 -31
  33. package/dist/components/Content/Schema/SchemaProperty.vue.d.ts +3 -0
  34. package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
  35. package/dist/components/Content/Schema/SchemaProperty.vue.js +1 -1
  36. package/dist/components/Content/Schema/SchemaProperty.vue2.js +143 -141
  37. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts.map +1 -1
  38. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js +1 -1
  39. package/dist/components/Content/Schema/SchemaPropertyHeading.vue2.js +83 -99
  40. package/dist/components/Content/Tag/OperationsList.vue.js +2 -2
  41. package/dist/components/Content/Tag/OperationsList.vue2.js +3 -3
  42. package/dist/components/Content/Tag/Tag.vue.d.ts.map +1 -1
  43. package/dist/components/Content/Tag/Tag.vue.js +41 -36
  44. package/dist/components/Content/Tag/TagList.vue.d.ts +2 -0
  45. package/dist/components/Content/Tag/TagList.vue.d.ts.map +1 -1
  46. package/dist/components/Content/Tag/TagList.vue.js +38 -36
  47. package/dist/components/Content/Tag/TagSection.vue.js +2 -2
  48. package/dist/components/Content/Tag/TagSection.vue2.js +3 -3
  49. package/dist/components/HttpMethod/HttpMethod.vue.d.ts.map +1 -1
  50. package/dist/components/Layouts/ModernLayout.vue.d.ts.map +1 -1
  51. package/dist/components/Layouts/ModernLayout.vue.js +1 -1
  52. package/dist/components/Section/CompactSection.vue.d.ts.map +1 -1
  53. package/dist/components/Section/CompactSection.vue.js +2 -2
  54. package/dist/components/Section/Section.vue.d.ts.map +1 -1
  55. package/dist/components/Section/Section.vue.js +2 -2
  56. package/dist/components/Section/SectionHeaderTag.vue.d.ts.map +1 -1
  57. package/dist/components/Section/SectionHeaderTag.vue.js +2 -2
  58. package/dist/components/Sidebar/Sidebar.vue.d.ts.map +1 -1
  59. package/dist/components/Sidebar/Sidebar.vue.js +2 -2
  60. package/dist/components/Sidebar/Sidebar.vue2.js +2 -1
  61. package/dist/components/Sidebar/SidebarElement.vue.d.ts.map +1 -1
  62. package/dist/components/Sidebar/SidebarElement.vue.js +1 -1
  63. package/dist/components/Sidebar/SidebarElement.vue2.js +2 -1
  64. package/dist/esm.d.ts.map +1 -1
  65. package/dist/features/ApiClientModal/ApiClientModal.vue.d.ts.map +1 -1
  66. package/dist/features/ApiClientModal/useApiClient.d.ts +2 -4
  67. package/dist/features/ApiClientModal/useApiClient.d.ts.map +1 -1
  68. package/dist/features/BaseUrl/BaseUrl.vue.d.ts.map +1 -1
  69. package/dist/features/BaseUrl/BaseUrl.vue.js +2 -1
  70. package/dist/features/ExampleRequest/ExampleRequest.vue.d.ts.map +1 -1
  71. package/dist/features/ExampleRequest/ExampleRequest.vue.js +1 -1
  72. package/dist/features/ExampleRequest/ExampleRequest.vue2.js +2 -1
  73. package/dist/features/ExampleResponses/ExampleResponses.vue.d.ts.map +1 -1
  74. package/dist/features/ExampleResponses/ExampleResponses.vue.js +3 -3
  75. package/dist/features/ExampleResponses/ExampleResponses.vue2.js +6 -8
  76. package/dist/features/Operation/Operation.vue.d.ts +2 -0
  77. package/dist/features/Operation/Operation.vue.d.ts.map +1 -1
  78. package/dist/features/Operation/Operation.vue.js +13 -10
  79. package/dist/features/Operation/Webhooks.vue.d.ts.map +1 -1
  80. package/dist/features/Operation/Webhooks.vue.js +2 -2
  81. package/dist/features/Operation/components/ContentTypeSelect.vue.d.ts.map +1 -1
  82. package/dist/features/Operation/components/ContentTypeSelect.vue.js +4 -4
  83. package/dist/features/Operation/components/OperationParameters.vue.d.ts +2 -0
  84. package/dist/features/Operation/components/OperationParameters.vue.d.ts.map +1 -1
  85. package/dist/features/Operation/components/OperationParameters.vue.js +37 -31
  86. package/dist/features/Operation/components/OperationResponses.vue.d.ts +2 -0
  87. package/dist/features/Operation/components/OperationResponses.vue.d.ts.map +1 -1
  88. package/dist/features/Operation/components/OperationResponses.vue.js +15 -13
  89. package/dist/features/Operation/components/ParameterList.vue.d.ts +2 -0
  90. package/dist/features/Operation/components/ParameterList.vue.d.ts.map +1 -1
  91. package/dist/features/Operation/components/ParameterList.vue.js +2 -2
  92. package/dist/features/Operation/components/ParameterList.vue2.js +14 -12
  93. package/dist/features/Operation/components/ParameterListItem.vue.d.ts +2 -0
  94. package/dist/features/Operation/components/ParameterListItem.vue.d.ts.map +1 -1
  95. package/dist/features/Operation/components/ParameterListItem.vue.js +2 -2
  96. package/dist/features/Operation/components/ParameterListItem.vue2.js +20 -18
  97. package/dist/features/Operation/components/RequestBody.vue.d.ts +2 -0
  98. package/dist/features/Operation/components/RequestBody.vue.d.ts.map +1 -1
  99. package/dist/features/Operation/components/RequestBody.vue.js +2 -2
  100. package/dist/features/Operation/components/RequestBody.vue2.js +20 -18
  101. package/dist/features/Operation/hooks/useResponses.d.ts.map +1 -1
  102. package/dist/features/Operation/hooks/useResponses.js +2 -1
  103. package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts +2 -0
  104. package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts.map +1 -1
  105. package/dist/features/Operation/layouts/ClassicLayout.vue.js +2 -2
  106. package/dist/features/Operation/layouts/ClassicLayout.vue2.js +29 -24
  107. package/dist/features/Operation/layouts/ModernLayout.vue.d.ts +2 -0
  108. package/dist/features/Operation/layouts/ModernLayout.vue.d.ts.map +1 -1
  109. package/dist/features/Operation/layouts/ModernLayout.vue.js +2 -2
  110. package/dist/features/Operation/layouts/ModernLayout.vue2.js +66 -56
  111. package/dist/features/Search/SearchModal.vue.d.ts.map +1 -1
  112. package/dist/features/Search/SearchModal.vue.js +2 -2
  113. package/dist/features/Search/SearchModal.vue2.js +2 -1
  114. package/dist/helpers/index.d.ts +4 -4
  115. package/dist/helpers/scrollToId.d.ts.map +1 -1
  116. package/dist/helpers/specHelpers.js +15 -14
  117. package/dist/hooks/index.d.ts +2 -2
  118. package/dist/hooks/useMultipleDocuments.d.ts +1 -0
  119. package/dist/hooks/useMultipleDocuments.d.ts.map +1 -1
  120. package/dist/hooks/useNavState.d.ts.map +1 -1
  121. package/dist/hooks/useNavState.js +2 -1
  122. package/dist/hooks/useReactiveSpec.d.ts.map +1 -1
  123. package/dist/hooks/useSidebar.d.ts.map +1 -1
  124. package/dist/hooks/useSidebar.js +3 -2
  125. package/dist/index.d.ts +6 -4
  126. package/dist/index.d.ts.map +1 -1
  127. package/dist/index.js +39 -76
  128. package/dist/libs/operation.d.ts.map +1 -1
  129. package/dist/standalone/lib/html-api.d.ts +4 -4
  130. package/dist/standalone/lib/html-api.d.ts.map +1 -1
  131. package/dist/stores/useHttpClientStore.d.ts.map +1 -1
  132. package/dist/style.css +1 -1
  133. package/package.json +10 -9
  134. package/dist/helpers/getVariableNames.js +0 -7
  135. package/dist/helpers/hasSecuritySchemes.js +0 -7
  136. package/dist/helpers/mapFromObject.js +0 -7
  137. package/dist/helpers/mergeAllObjects.js +0 -7
  138. package/dist/hooks/useClientStore.js +0 -5
  139. package/dist/hooks/useRefOnMount.js +0 -10
@@ -1,12 +1,12 @@
1
- import { defineComponent as q, computed as z, openBlock as l, createBlock as t, unref as n, withCtx as y, createElementVNode as S, normalizeClass as d, createElementBlock as o, createVNode as m, createCommentVNode as r, withDirectives as A, normalizeStyle as H, Fragment as i, createTextVNode as C, toDisplayString as B, vShow as N, renderList as j } from "vue";
1
+ import { defineComponent as D, computed as q, openBlock as a, createBlock as s, unref as r, withCtx as y, createElementVNode as P, normalizeClass as m, createElementBlock as i, createVNode as v, createCommentVNode as n, withDirectives as z, normalizeStyle as A, Fragment as o, createTextVNode as O, toDisplayString as S, vShow as N, renderList as C } from "vue";
2
2
  import { Disclosure as V, DisclosureButton as E, DisclosurePanel as T } from "@headlessui/vue";
3
- import { ScalarMarkdown as $, ScalarIcon as O } from "@scalar/components";
3
+ import { ScalarMarkdown as $, ScalarIcon as B } from "@scalar/components";
4
4
  import F from "./SchemaHeading.vue.js";
5
- import v from "./SchemaProperty.vue.js";
5
+ import p from "./SchemaProperty.vue.js";
6
6
  const I = {
7
7
  key: 0,
8
8
  class: "schema-card-description"
9
- }, R = /* @__PURE__ */ q({
9
+ }, R = /* @__PURE__ */ D({
10
10
  __name: "Schema",
11
11
  props: {
12
12
  value: { type: [Object, Boolean] },
@@ -14,63 +14,66 @@ const I = {
14
14
  name: {},
15
15
  compact: { type: Boolean },
16
16
  noncollapsible: { type: Boolean },
17
- hideHeading: { type: Boolean }
17
+ hideHeading: { type: Boolean },
18
+ schemas: {}
18
19
  },
19
- setup(w) {
20
- const h = w, k = z(() => !(h.noncollapsible || h.level === 0)), D = (e) => h.noncollapsible && e.stopPropagation();
21
- return (e, L) => typeof e.value == "object" && Object.keys(e.value).length ? (l(), t(n(V), {
20
+ setup(j) {
21
+ const h = j, g = q(() => !(h.noncollapsible || h.level === 0)), w = (e) => h.noncollapsible && e.stopPropagation();
22
+ return (e, L) => typeof e.value == "object" && Object.keys(e.value).length ? (a(), s(r(V), {
22
23
  key: 0,
23
24
  defaultOpen: e.noncollapsible
24
25
  }, {
25
- default: y(({ open: s }) => {
26
- var f;
26
+ default: y(({ open: t }) => {
27
+ var k;
27
28
  return [
28
- S("div", {
29
- class: d(["schema-card", [
29
+ P("div", {
30
+ class: m(["schema-card", [
30
31
  `schema-card--level-${e.level}`,
31
- { "schema-card--compact": e.compact, "schema-card--open": s }
32
+ { "schema-card--compact": e.compact, "schema-card--open": t }
32
33
  ]])
33
34
  }, [
34
- (f = e.value) != null && f.description && typeof e.value.description == "string" ? (l(), o("div", I, [
35
- m(n($), {
35
+ (k = e.value) != null && k.description && typeof e.value.description == "string" && !e.value.allOf && !e.value.oneOf && !e.value.anyOf && !e.compact ? (a(), i("div", I, [
36
+ v(r($), {
36
37
  value: e.value.description
37
38
  }, null, 8, ["value"])
38
- ])) : r("", !0),
39
- S("div", {
40
- class: d(["schema-properties", { "schema-properties-open": s }])
39
+ ])) : n("", !0),
40
+ P("div", {
41
+ class: m(["schema-properties", {
42
+ "schema-properties-open": t
43
+ }])
41
44
  }, [
42
- A(m(n(E), {
45
+ z(v(r(E), {
43
46
  as: e.noncollapsible ? "div" : "button",
44
- class: d(["schema-card-title", { "schema-card-title--compact": e.compact }]),
45
- style: H({
47
+ class: m(["schema-card-title", { "schema-card-title--compact": e.compact }]),
48
+ style: A({
46
49
  top: `calc(var(--refs-header-height) + calc(var(--schema-title-height) * ${e.level}))`
47
50
  }),
48
- onClickCapture: D
51
+ onClickCapture: w
49
52
  }, {
50
53
  default: y(() => {
51
- var u, c, a;
54
+ var d, u, l;
52
55
  return [
53
- e.compact ? (l(), o(i, { key: 0 }, [
54
- k.value ? (l(), t(n(O), {
56
+ e.compact ? (a(), i(o, { key: 0 }, [
57
+ g.value ? (a(), s(r(B), {
55
58
  key: 0,
56
- class: d(["schema-card-title-icon", { "schema-card-title-icon--open": s }]),
59
+ class: m(["schema-card-title-icon", { "schema-card-title-icon--open": t }]),
57
60
  icon: "Add",
58
61
  size: "sm"
59
- }, null, 8, ["class"])) : r("", !0),
60
- s ? (l(), o(i, { key: 1 }, [
61
- C(" Hide " + B(((u = e.value) == null ? void 0 : u.title) ?? "Child Attributes"), 1)
62
- ], 64)) : (l(), o(i, { key: 2 }, [
63
- C(" Show " + B(((c = e.value) == null ? void 0 : c.title) ?? "Child Attributes"), 1)
62
+ }, null, 8, ["class"])) : n("", !0),
63
+ t ? (a(), i(o, { key: 1 }, [
64
+ O(" Hide " + S(((d = e.value) == null ? void 0 : d.title) ?? "Child Attributes"), 1)
65
+ ], 64)) : (a(), i(o, { key: 2 }, [
66
+ O(" Show " + S(((u = e.value) == null ? void 0 : u.title) ?? "Child Attributes"), 1)
64
67
  ], 64))
65
- ], 64)) : (l(), o(i, { key: 1 }, [
66
- k.value ? (l(), t(n(O), {
68
+ ], 64)) : (a(), i(o, { key: 1 }, [
69
+ g.value ? (a(), s(r(B), {
67
70
  key: 0,
68
- class: d(["schema-card-title-icon", { "schema-card-title-icon--open": s }]),
71
+ class: m(["schema-card-title-icon", { "schema-card-title-icon--open": t }]),
69
72
  icon: "Add",
70
73
  size: "sm"
71
- }, null, 8, ["class"])) : r("", !0),
72
- m(F, {
73
- name: ((a = e.value) == null ? void 0 : a.title) ?? e.name,
74
+ }, null, 8, ["class"])) : n("", !0),
75
+ v(F, {
76
+ name: ((l = e.value) == null ? void 0 : l.title) ?? e.name,
74
77
  value: e.value
75
78
  }, null, 8, ["name", "value"])
76
79
  ], 64))
@@ -80,63 +83,72 @@ const I = {
80
83
  }, 1032, ["as", "class", "style"]), [
81
84
  [N, !e.hideHeading && !(e.noncollapsible && e.compact)]
82
85
  ]),
83
- m(n(T), {
86
+ v(r(T), {
84
87
  as: "ul",
85
88
  static: e.noncollapsible
86
89
  }, {
87
90
  default: y(() => {
88
- var u, c;
91
+ var d, u;
89
92
  return [
90
- e.value.properties || e.value.additionalProperties || e.value.patternProperties ? (l(), o(i, { key: 0 }, [
91
- e.value.properties ? (l(!0), o(i, { key: 0 }, j(Object.keys((u = e.value) == null ? void 0 : u.properties), (a) => {
92
- var p, b, P, g;
93
- return l(), t(v, {
94
- key: a,
93
+ e.value.properties || e.value.additionalProperties || e.value.patternProperties ? (a(), i(o, { key: 0 }, [
94
+ e.value.properties ? (a(!0), i(o, { key: 0 }, C(Object.keys((d = e.value) == null ? void 0 : d.properties), (l) => {
95
+ var c, f, b, H;
96
+ return a(), s(p, {
97
+ key: l,
95
98
  compact: e.compact,
96
- level: e.level,
97
- name: a,
98
- required: ((p = e.value.required) == null ? void 0 : p.includes(a)) || ((P = (b = e.value.properties) == null ? void 0 : b[a]) == null ? void 0 : P.required) === !0,
99
- value: (g = e.value.properties) == null ? void 0 : g[a]
100
- }, null, 8, ["compact", "level", "name", "required", "value"]);
101
- }), 128)) : r("", !0),
102
- e.value.patternProperties ? (l(!0), o(i, { key: 1 }, j(Object.keys((c = e.value) == null ? void 0 : c.patternProperties), (a) => {
103
- var p;
104
- return l(), t(v, {
105
- key: a,
99
+ hideHeading: e.hideHeading,
100
+ level: e.level + 1,
101
+ name: l,
102
+ required: ((c = e.value.required) == null ? void 0 : c.includes(l)) || ((b = (f = e.value.properties) == null ? void 0 : f[l]) == null ? void 0 : b.required) === !0,
103
+ schemas: e.schemas,
104
+ value: (H = e.value.properties) == null ? void 0 : H[l]
105
+ }, null, 8, ["compact", "hideHeading", "level", "name", "required", "schemas", "value"]);
106
+ }), 128)) : n("", !0),
107
+ e.value.patternProperties ? (a(!0), i(o, { key: 1 }, C(Object.keys((u = e.value) == null ? void 0 : u.patternProperties), (l) => {
108
+ var c;
109
+ return a(), s(p, {
110
+ key: l,
106
111
  compact: e.compact,
112
+ hideHeading: e.hideHeading,
107
113
  level: e.level,
108
- name: a,
114
+ name: l,
109
115
  pattern: "",
110
- value: (p = e.value.patternProperties) == null ? void 0 : p[a]
111
- }, null, 8, ["compact", "level", "name", "value"]);
112
- }), 128)) : r("", !0),
113
- e.value.additionalProperties ? (l(), o(i, { key: 2 }, [
114
- e.value.additionalProperties === !0 || Object.keys(e.value.additionalProperties).length === 0 || !e.value.additionalProperties.type ? (l(), t(v, {
116
+ schemas: e.schemas,
117
+ value: (c = e.value.patternProperties) == null ? void 0 : c[l]
118
+ }, null, 8, ["compact", "hideHeading", "level", "name", "schemas", "value"]);
119
+ }), 128)) : n("", !0),
120
+ e.value.additionalProperties ? (a(), i(o, { key: 2 }, [
121
+ e.value.additionalProperties === !0 || Object.keys(e.value.additionalProperties).length === 0 || !e.value.additionalProperties.type ? (a(), s(p, {
115
122
  key: 0,
116
123
  additional: "",
117
124
  compact: e.compact,
125
+ hideHeading: e.hideHeading,
118
126
  level: e.level,
119
127
  noncollapsible: "",
128
+ schemas: e.schemas,
120
129
  value: {
121
130
  type: "anything",
122
131
  ...typeof e.value.additionalProperties == "object" ? e.value.additionalProperties : {}
123
132
  }
124
- }, null, 8, ["compact", "level", "value"])) : (l(), t(v, {
133
+ }, null, 8, ["compact", "hideHeading", "level", "schemas", "value"])) : (a(), s(p, {
125
134
  key: 1,
126
135
  additional: "",
127
136
  compact: e.compact,
137
+ hideHeading: e.hideHeading,
128
138
  level: e.level,
129
139
  noncollapsible: "",
140
+ schemas: e.schemas,
130
141
  value: e.value.additionalProperties
131
- }, null, 8, ["compact", "level", "value"]))
132
- ], 64)) : r("", !0)
133
- ], 64)) : (l(), t(v, {
142
+ }, null, 8, ["compact", "hideHeading", "level", "schemas", "value"]))
143
+ ], 64)) : n("", !0)
144
+ ], 64)) : (a(), s(p, {
134
145
  key: 1,
135
146
  compact: e.compact,
136
- level: e.level,
147
+ hideHeading: e.hideHeading,
137
148
  name: e.value.name,
149
+ schemas: e.schemas,
138
150
  value: e.value
139
- }, null, 8, ["compact", "level", "name", "value"]))
151
+ }, null, 8, ["compact", "hideHeading", "name", "schemas", "value"]))
140
152
  ];
141
153
  }),
142
154
  _: 1
@@ -146,7 +158,7 @@ const I = {
146
158
  ];
147
159
  }),
148
160
  _: 1
149
- }, 8, ["defaultOpen"])) : r("", !0);
161
+ }, 8, ["defaultOpen"])) : n("", !0);
150
162
  }
151
163
  });
152
164
  export {
@@ -0,0 +1,12 @@
1
+ import type { OpenAPIV2, OpenAPIV3, OpenAPIV3_1 } from '@scalar/openapi-types';
2
+ type __VLS_Props = {
3
+ discriminator: string;
4
+ schemas?: OpenAPIV2.DefinitionsObject | Record<string, OpenAPIV3.SchemaObject> | Record<string, OpenAPIV3_1.SchemaObject> | unknown;
5
+ value: Record<string, any>;
6
+ level: number;
7
+ compact?: boolean;
8
+ hideHeading?: boolean;
9
+ };
10
+ 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, {}, HTMLDivElement>;
11
+ export default _default;
12
+ //# 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":"AA+KA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAQ9E,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,MAAM,CAAA;IACrB,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,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;;AAkQF,wBAOG"}
@@ -0,0 +1,7 @@
1
+ import o from "./SchemaDiscriminator.vue2.js";
2
+ /* empty css */
3
+ import r from "../../../_virtual/_plugin-vue_export-helper.js";
4
+ const c = /* @__PURE__ */ r(o, [["__scopeId", "data-v-18cf8f87"]]);
5
+ export {
6
+ c as default
7
+ };
@@ -0,0 +1,109 @@
1
+ import { defineComponent as S, ref as A, openBlock as a, createElementBlock as c, createBlock as n, unref as i, withCtx as l, createVNode as d, createElementVNode as m, toDisplayString as f, Fragment as y, renderList as v, normalizeClass as T, createTextVNode as q } from "vue";
2
+ import { TabGroup as B, TabList as N, Tab as V, TabPanel as j } from "@headlessui/vue";
3
+ import { cva as w, cx as H } from "@scalar/components";
4
+ import { stringify as b } from "flatted";
5
+ import g from "./Schema.vue.js";
6
+ const L = { class: "property-rule" }, z = { class: "flex items-center gap-1.5 overflow-x-auto" }, G = /* @__PURE__ */ S({
7
+ __name: "SchemaDiscriminator",
8
+ props: {
9
+ discriminator: {},
10
+ schemas: {},
11
+ value: {},
12
+ level: {},
13
+ compact: { type: Boolean },
14
+ hideHeading: { type: Boolean }
15
+ },
16
+ setup(h) {
17
+ const s = h, p = A(0), k = w({
18
+ base: "py-0.75 h-fit rounded-full border px-2 text-sm font-medium transition-colors",
19
+ variants: {
20
+ selected: {
21
+ true: "bg-b-accent text-c-accent hover:text-c-accent",
22
+ false: "bg-transparent text-c-2 hover:text-c-1"
23
+ }
24
+ }
25
+ }), u = (e) => {
26
+ if (!Array.isArray(e) || e.length === 0)
27
+ return {};
28
+ if (e.length > 0 && e[0].allOf) {
29
+ const o = e.flatMap((r) => r.allOf || []);
30
+ return u(o);
31
+ }
32
+ return e.reduce((o, r) => {
33
+ if (!r || typeof r != "object")
34
+ return o;
35
+ const t = { ...o };
36
+ return r.properties && (t.properties = {
37
+ ...t.properties,
38
+ ...r.properties
39
+ }), r.required && Array.isArray(r.required) && (t.required = [
40
+ ...t.required || [],
41
+ ...r.required
42
+ ]), r.type && !t.type && (t.type = r.type), r.description && !t.description && (t.description = r.description), t;
43
+ }, {});
44
+ }, O = (e) => {
45
+ if (!e)
46
+ return null;
47
+ if (s.schemas && typeof s.schemas == "object") {
48
+ for (const [o, r] of Object.entries(s.schemas))
49
+ if (b(r) === b(e))
50
+ return o;
51
+ return Object.keys(e)[0];
52
+ }
53
+ return null;
54
+ }, C = (e) => e.replace(/([A-Z])/g, " $1").replace(/^./, (o) => o.toUpperCase()).toLowerCase().replace(/^(\w)/, (o) => o.toUpperCase());
55
+ return (e, o) => (a(), c("div", L, [
56
+ e.discriminator === "oneOf" || e.discriminator === "anyOf" ? (a(), n(i(B), { key: 0 }, {
57
+ default: l(() => [
58
+ d(i(N), { class: "discriminator-tab-list py-1.25 flex items-center gap-2 rounded-t-lg border border-b-0 px-2 pr-3" }, {
59
+ default: l(() => [
60
+ m("span", null, f(C(e.discriminator)), 1),
61
+ m("div", z, [
62
+ (a(!0), c(y, null, v(e.value[e.discriminator], (r, t) => (a(), n(i(V), {
63
+ key: t,
64
+ class: T([
65
+ "cursor-pointer",
66
+ i(H)(i(k)({ selected: p.value === t }))
67
+ ]),
68
+ onClick: (D) => p.value = t
69
+ }, {
70
+ default: l(() => [
71
+ q(f(O(r) || "Schema"), 1)
72
+ ]),
73
+ _: 2
74
+ }, 1032, ["class", "onClick"]))), 128))
75
+ ])
76
+ ]),
77
+ _: 1
78
+ }),
79
+ (a(!0), c(y, null, v(e.value[e.discriminator], (r, t) => (a(), n(i(j), {
80
+ key: t,
81
+ class: "discriminator-panel"
82
+ }, {
83
+ default: l(() => [
84
+ d(g, {
85
+ compact: e.compact,
86
+ hideHeading: e.hideHeading,
87
+ noncollapsible: !0,
88
+ schemas: e.schemas,
89
+ value: r
90
+ }, null, 8, ["compact", "hideHeading", "schemas", "value"])
91
+ ]),
92
+ _: 2
93
+ }, 1024))), 128))
94
+ ]),
95
+ _: 1
96
+ })) : (a(), n(g, {
97
+ key: 1,
98
+ compact: e.compact,
99
+ level: e.level,
100
+ noncollapsible: e.level == 0,
101
+ schemas: e.schemas,
102
+ value: u(e.value[e.discriminator])
103
+ }, null, 8, ["compact", "level", "noncollapsible", "schemas", "value"]))
104
+ ]));
105
+ }
106
+ });
107
+ export {
108
+ G as default
109
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaHeading.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaHeading.vue"],"names":[],"mappings":"AAwDA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAI9E,KAAK,WAAW,GAAG;IACjB,KAAK,EACD,SAAS,CAAC,iBAAiB,GAC3B,SAAS,CAAC,YAAY,GACtB,SAAS,CAAC,iBAAiB,GAC3B,SAAS,CAAC,oBAAoB,GAC9B,WAAW,CAAC,YAAY,GACxB,WAAW,CAAC,iBAAiB,GAC7B,WAAW,CAAC,oBAAoB,CAAA;IACpC,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,CAAC;;AAmFF,wBAMG"}
1
+ {"version":3,"file":"SchemaHeading.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaHeading.vue"],"names":[],"mappings":"AAqDA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAI9E,KAAK,WAAW,GAAG;IACjB,KAAK,EACD,SAAS,CAAC,iBAAiB,GAC3B,SAAS,CAAC,YAAY,GACtB,SAAS,CAAC,iBAAiB,GAC3B,SAAS,CAAC,oBAAoB,GAC9B,WAAW,CAAC,YAAY,GACxB,WAAW,CAAC,iBAAiB,GAC7B,WAAW,CAAC,oBAAoB,CAAA;IACpC,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,CAAC;;AAgFF,wBAMG"}
@@ -1,7 +1,7 @@
1
1
  import o from "./SchemaHeading.vue2.js";
2
2
  /* empty css */
3
- import a from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const r = /* @__PURE__ */ a(o, [["__scopeId", "data-v-2a52eb0b"]]);
3
+ import e from "../../../_virtual/_plugin-vue_export-helper.js";
4
+ const r = /* @__PURE__ */ e(o, [["__scopeId", "data-v-e45fe752"]]);
5
5
  export {
6
6
  r as default
7
7
  };
@@ -1,42 +1,37 @@
1
- import { defineComponent as v, openBlock as a, createElementBlock as t, createElementVNode as k, Fragment as n, createTextVNode as o, createCommentVNode as l, toDisplayString as r } from "vue";
2
- const d = {
1
+ import { defineComponent as y, openBlock as t, createElementBlock as a, createElementVNode as l, Fragment as n, createTextVNode as o, createCommentVNode as r, toDisplayString as p } from "vue";
2
+ const s = {
3
3
  key: 0,
4
4
  class: "schema-type"
5
- }, c = ["title"], j = /* @__PURE__ */ v({
5
+ }, u = ["title"], v = /* @__PURE__ */ y({
6
6
  __name: "SchemaHeading",
7
7
  props: {
8
8
  value: { type: [Object, Boolean] },
9
9
  name: {}
10
10
  },
11
- setup(f) {
12
- return (e, h) => {
13
- var p, u, m, y, s, i;
14
- return typeof e.value == "object" ? (a(), t("span", d, [
15
- k("span", {
16
- class: "schema-type-icon",
17
- title: typeof e.value.type == "string" ? e.value.type : Array.isArray(e.value.type) ? e.value.type.join(" | ") : "unkown type"
18
- }, [
19
- e.value.type === "object" ? (a(), t(n, { key: 0 }, [
20
- o(" {} ")
21
- ], 64)) : l("", !0),
22
- e.value.type === "array" ? (a(), t(n, { key: 1 }, [
23
- o(" [] ")
24
- ], 64)) : l("", !0),
25
- e.value.enum ? (a(), t(n, { key: 2 }, [
26
- o(" enum ")
27
- ], 64)) : l("", !0)
28
- ], 8, c),
29
- (u = (p = e.value) == null ? void 0 : p.xml) != null && u.name && ((y = (m = e.value) == null ? void 0 : m.xml) == null ? void 0 : y.name) !== "##default" ? (a(), t(n, { key: 0 }, [
30
- o(" <" + r((i = (s = e.value) == null ? void 0 : s.xml) == null ? void 0 : i.name) + " /> ", 1)
31
- ], 64)) : e.name ? (a(), t(n, { key: 1 }, [
32
- o(r(e.name), 1)
33
- ], 64)) : (a(), t(n, { key: 2 }, [
34
- o(r(e.value.type), 1)
35
- ], 64))
36
- ])) : l("", !0);
37
- };
11
+ setup(m) {
12
+ return (e, i) => typeof e.value == "object" ? (t(), a("span", s, [
13
+ l("span", {
14
+ class: "schema-type-icon",
15
+ title: typeof e.value.type == "string" ? e.value.type : Array.isArray(e.value.type) ? e.value.type.join(" | ") : "unkown type"
16
+ }, [
17
+ e.value.type === "object" ? (t(), a(n, { key: 0 }, [
18
+ o(" {} ")
19
+ ], 64)) : r("", !0),
20
+ e.value.type === "array" ? (t(), a(n, { key: 1 }, [
21
+ o(" [] ")
22
+ ], 64)) : r("", !0),
23
+ e.value.enum ? (t(), a(n, { key: 2 }, [
24
+ o(" enum ")
25
+ ], 64)) : r("", !0)
26
+ ], 8, u),
27
+ e.name ? (t(), a(n, { key: 0 }, [
28
+ o(p(e.name), 1)
29
+ ], 64)) : (t(), a(n, { key: 1 }, [
30
+ o(p(e.value.type), 1)
31
+ ], 64))
32
+ ])) : r("", !0);
38
33
  }
39
34
  });
40
35
  export {
41
- j as default
36
+ v as default
42
37
  };
@@ -1,3 +1,4 @@
1
+ import type { OpenAPIV2, OpenAPIV3, OpenAPIV3_1 } from '@scalar/openapi-types';
1
2
  /**
2
3
  * Note: We’re taking in a prop called `value` which should be a JSON Schema.
3
4
  *
@@ -14,6 +15,8 @@ type __VLS_Props = {
14
15
  additional?: boolean;
15
16
  pattern?: boolean;
16
17
  withExamples?: boolean;
18
+ schemas?: OpenAPIV2.DefinitionsObject | Record<string, OpenAPIV3.SchemaObject> | Record<string, OpenAPIV3_1.SchemaObject> | unknown;
19
+ hideHeading?: boolean;
17
20
  };
18
21
  declare const _default_1: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
19
22
  required: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaProperty.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaProperty.vue"],"names":[],"mappings":"AAsfA;;;;;GAKG;AAEH,KAAK,WAAW,GAAG;IACf,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC3B,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;CACvB,CAAC;;cANW,OAAO;WAFV,MAAM;aAGJ,OAAO;kBAIF,OAAO;;AA0b1B,0BAQG"}
1
+ {"version":3,"file":"SchemaProperty.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaProperty.vue"],"names":[],"mappings":"AAwhBA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAe9E;;;;;GAKG;AAEH,KAAK,WAAW,GAAG;IACf,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,OAAO,CAAC,EACJ,SAAS,CAAC,iBAAiB,GAC3B,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,YAAY,CAAC,GACtC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,YAAY,CAAC,GACxC,OAAO,CAAA;IACX,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB,CAAC;;cAZW,OAAO;WAFV,MAAM;aAGJ,OAAO;kBAIF,OAAO;;AAkf1B,0BAQG"}
@@ -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 p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-8c997c80"]]);
4
+ const p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-46e92dc2"]]);
5
5
  export {
6
6
  p as default
7
7
  };