@scalar/api-reference 1.33.0 → 1.34.1

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 (148) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/dist/browser/standalone.js +13276 -13205
  3. package/dist/browser/webpack-stats.json +1 -1
  4. package/dist/components/Anchor/WithBreadcrumb.vue.d.ts +24 -0
  5. package/dist/components/Anchor/WithBreadcrumb.vue.d.ts.map +1 -0
  6. package/dist/components/Anchor/WithBreadcrumb.vue.js +4 -0
  7. package/dist/components/Anchor/WithBreadcrumb.vue2.js +46 -0
  8. package/dist/components/Anchor/index.d.ts +1 -0
  9. package/dist/components/Anchor/index.d.ts.map +1 -1
  10. package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
  11. package/dist/components/ApiReferenceLayout.vue.js +1 -1
  12. package/dist/components/ApiReferenceLayout.vue2.js +184 -201
  13. package/dist/components/Content/Introduction/Introduction.vue.d.ts.map +1 -1
  14. package/dist/components/Content/Introduction/Introduction.vue.js +1 -1
  15. package/dist/components/Content/Introduction/Introduction.vue2.js +1 -0
  16. package/dist/components/Content/Operations/TraversedEntry.vue.d.ts +1 -0
  17. package/dist/components/Content/Operations/TraversedEntry.vue.d.ts.map +1 -1
  18. package/dist/components/Content/Operations/TraversedEntry.vue.js +34 -32
  19. package/dist/components/Content/Operations/TraversedEntryContainer.vue.d.ts.map +1 -1
  20. package/dist/components/Content/Operations/TraversedEntryContainer.vue.js +33 -29
  21. package/dist/components/Content/Operations/get-current-index.d.ts +4 -0
  22. package/dist/components/Content/Operations/get-current-index.d.ts.map +1 -0
  23. package/dist/components/Content/Operations/get-current-index.js +16 -0
  24. package/dist/components/Content/Schema/Schema.preview.d.ts +28 -0
  25. package/dist/components/Content/Schema/Schema.preview.d.ts.map +1 -1
  26. package/dist/components/Content/Schema/Schema.vue.d.ts +2 -0
  27. package/dist/components/Content/Schema/Schema.vue.d.ts.map +1 -1
  28. package/dist/components/Content/Schema/Schema.vue.js +2 -2
  29. package/dist/components/Content/Schema/Schema.vue2.js +164 -157
  30. package/dist/components/Content/Schema/SchemaComposition.vue.d.ts +1 -0
  31. package/dist/components/Content/Schema/SchemaComposition.vue.d.ts.map +1 -1
  32. package/dist/components/Content/Schema/SchemaComposition.vue.js +58 -53
  33. package/dist/components/Content/Schema/SchemaObjectProperties.vue.d.ts +1 -0
  34. package/dist/components/Content/Schema/SchemaObjectProperties.vue.d.ts.map +1 -1
  35. package/dist/components/Content/Schema/SchemaObjectProperties.vue.js +52 -40
  36. package/dist/components/Content/Schema/SchemaProperty.vue.d.ts +1 -0
  37. package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
  38. package/dist/components/Content/Schema/SchemaProperty.vue.js +2 -2
  39. package/dist/components/Content/Schema/SchemaProperty.vue2.js +100 -87
  40. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts.map +1 -1
  41. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js +3 -3
  42. package/dist/components/Content/Schema/SchemaPropertyHeading.vue2.js +4 -1
  43. package/dist/components/Lazy/Lazy.vue.d.ts +1 -0
  44. package/dist/components/Lazy/Lazy.vue.d.ts.map +1 -1
  45. package/dist/components/Lazy/Lazy.vue2.js +12 -11
  46. package/dist/components/Lazy/lazyBus.d.ts +5 -3
  47. package/dist/components/Lazy/lazyBus.d.ts.map +1 -1
  48. package/dist/components/OperationsList/OperationsListItem.vue.d.ts.map +1 -1
  49. package/dist/components/OperationsList/OperationsListItem.vue.js +1 -1
  50. package/dist/features/Operation/components/ContentTypeSelect.vue.d.ts +4 -4
  51. package/dist/features/Operation/components/ContentTypeSelect.vue.d.ts.map +1 -1
  52. package/dist/features/Operation/components/OperationParameters.vue.d.ts +1 -0
  53. package/dist/features/Operation/components/OperationParameters.vue.d.ts.map +1 -1
  54. package/dist/features/Operation/components/OperationParameters.vue.js +49 -43
  55. package/dist/features/Operation/components/OperationResponses.vue.d.ts +1 -0
  56. package/dist/features/Operation/components/OperationResponses.vue.d.ts.map +1 -1
  57. package/dist/features/Operation/components/OperationResponses.vue.js +4 -3
  58. package/dist/features/Operation/components/ParameterHeaders.vue.d.ts +1 -0
  59. package/dist/features/Operation/components/ParameterHeaders.vue.d.ts.map +1 -1
  60. package/dist/features/Operation/components/ParameterHeaders.vue.js +2 -2
  61. package/dist/features/Operation/components/ParameterHeaders.vue2.js +28 -26
  62. package/dist/features/Operation/components/ParameterList.vue.d.ts +1 -0
  63. package/dist/features/Operation/components/ParameterList.vue.d.ts.map +1 -1
  64. package/dist/features/Operation/components/ParameterList.vue.js +2 -2
  65. package/dist/features/Operation/components/ParameterList.vue2.js +17 -15
  66. package/dist/features/Operation/components/ParameterListItem.vue.d.ts +1 -0
  67. package/dist/features/Operation/components/ParameterListItem.vue.d.ts.map +1 -1
  68. package/dist/features/Operation/components/ParameterListItem.vue.js +2 -2
  69. package/dist/features/Operation/components/ParameterListItem.vue2.js +17 -16
  70. package/dist/features/Operation/components/RequestBody.vue.d.ts +2 -2
  71. package/dist/features/Operation/components/RequestBody.vue.d.ts.map +1 -1
  72. package/dist/features/Operation/components/RequestBody.vue.js +2 -2
  73. package/dist/features/Operation/components/RequestBody.vue2.js +47 -39
  74. package/dist/features/Operation/components/callbacks/Callback.vue.d.ts +1 -0
  75. package/dist/features/Operation/components/callbacks/Callback.vue.d.ts.map +1 -1
  76. package/dist/features/Operation/components/callbacks/Callback.vue.js +3 -3
  77. package/dist/features/Operation/components/callbacks/Callback.vue2.js +12 -11
  78. package/dist/features/Operation/components/callbacks/Callback.vue3.js +2 -2
  79. package/dist/features/Operation/layouts/ModernLayout.vue.d.ts.map +1 -1
  80. package/dist/features/Operation/layouts/ModernLayout.vue.js +1 -1
  81. package/dist/features/Operation/layouts/ModernLayout.vue2.js +63 -61
  82. package/dist/features/Search/{SearchButton.vue.d.ts → components/SearchButton.vue.d.ts} +0 -2
  83. package/dist/features/Search/components/SearchButton.vue.d.ts.map +1 -0
  84. package/dist/features/Search/components/SearchButton.vue.js +65 -0
  85. package/dist/features/Search/{SearchModal.vue.d.ts → components/SearchModal.vue.d.ts} +0 -2
  86. package/dist/features/Search/components/SearchModal.vue.d.ts.map +1 -0
  87. package/dist/features/Search/components/SearchModal.vue.js +7 -0
  88. package/dist/features/Search/components/SearchModal.vue2.js +199 -0
  89. package/dist/features/Search/helpers/create-fuse-instance.d.ts +9 -0
  90. package/dist/features/Search/helpers/create-fuse-instance.d.ts.map +1 -0
  91. package/dist/features/Search/helpers/create-fuse-instance.js +46 -0
  92. package/dist/features/Search/helpers/create-search-index.d.ts +7 -0
  93. package/dist/features/Search/helpers/create-search-index.d.ts.map +1 -0
  94. package/dist/features/Search/helpers/create-search-index.js +109 -0
  95. package/dist/features/Search/hooks/useSearchIndex.d.ts +14 -0
  96. package/dist/features/Search/hooks/useSearchIndex.d.ts.map +1 -0
  97. package/dist/features/Search/hooks/useSearchIndex.js +46 -0
  98. package/dist/features/Search/index.d.ts +2 -2
  99. package/dist/features/Search/index.d.ts.map +1 -1
  100. package/dist/features/Search/types.d.ts +15 -0
  101. package/dist/features/Search/types.d.ts.map +1 -0
  102. package/dist/features/api-client-modal/ApiClientModal.vue.d.ts.map +1 -1
  103. package/dist/features/api-client-modal/ApiClientModal.vue.js +45 -45
  104. package/dist/features/api-client-modal/useApiClient.d.ts +14 -14
  105. package/dist/features/api-client-modal/useApiClient.d.ts.map +1 -1
  106. package/dist/features/traverse-schema/helpers/traverse-paths.d.ts +3 -1
  107. package/dist/features/traverse-schema/helpers/traverse-paths.d.ts.map +1 -1
  108. package/dist/features/traverse-schema/helpers/traverse-schemas.d.ts.map +1 -1
  109. package/dist/features/traverse-schema/helpers/traverse-schemas.js +18 -18
  110. package/dist/features/traverse-schema/helpers/traverse-tags.d.ts.map +1 -1
  111. package/dist/features/traverse-schema/helpers/traverse-webhooks.d.ts.map +1 -1
  112. package/dist/features/traverse-schema/types.d.ts +10 -6
  113. package/dist/features/traverse-schema/types.d.ts.map +1 -1
  114. package/dist/helpers/test-utils.d.ts +9 -0
  115. package/dist/helpers/test-utils.d.ts.map +1 -1
  116. package/dist/hooks/useNavState.d.ts +4 -1
  117. package/dist/hooks/useNavState.d.ts.map +1 -1
  118. package/dist/index.d.ts +0 -1
  119. package/dist/index.d.ts.map +1 -1
  120. package/dist/index.js +17 -19
  121. package/dist/libs/openapi.d.ts +11 -8
  122. package/dist/libs/openapi.d.ts.map +1 -1
  123. package/dist/libs/openapi.js +34 -55
  124. package/dist/style.css +1 -1
  125. package/dist/types.d.ts +1 -6
  126. package/dist/types.d.ts.map +1 -1
  127. package/dist/v2/ApiReferenceWorkspace.vue.d.ts.map +1 -1
  128. package/dist/v2/ApiReferenceWorkspace.vue.js +120 -111
  129. package/dist/v2/helpers/get-document-name.d.ts +13 -0
  130. package/dist/v2/helpers/get-document-name.d.ts.map +1 -0
  131. package/dist/v2/helpers/get-document-name.js +15 -0
  132. package/dist/v2/helpers/normalize-content.d.ts +3 -0
  133. package/dist/v2/helpers/normalize-content.d.ts.map +1 -0
  134. package/dist/v2/helpers/normalize-content.js +8 -0
  135. package/package.json +16 -10
  136. package/dist/features/Search/SearchButton.vue.d.ts.map +0 -1
  137. package/dist/features/Search/SearchButton.vue.js +0 -66
  138. package/dist/features/Search/SearchModal.vue.d.ts.map +0 -1
  139. package/dist/features/Search/SearchModal.vue.js +0 -7
  140. package/dist/features/Search/SearchModal.vue2.js +0 -207
  141. package/dist/features/Search/useSearchIndex.d.ts +0 -32
  142. package/dist/features/Search/useSearchIndex.d.ts.map +0 -1
  143. package/dist/features/Search/useSearchIndex.js +0 -170
  144. package/dist/helpers/parse.d.ts +0 -10
  145. package/dist/helpers/parse.d.ts.map +0 -1
  146. package/dist/helpers/parse.js +0 -81
  147. /package/dist/features/Search/{SearchButton.vue2.js → components/SearchButton.vue2.js} +0 -0
  148. /package/dist/features/Search/{SearchModal.vue3.js → components/SearchModal.vue3.js} +0 -0
@@ -1,19 +1,19 @@
1
- import { defineComponent as U, inject as F, computed as c, createBlock as t, createCommentVNode as n, openBlock as l, unref as s, withCtx as d, createElementVNode as C, normalizeClass as p, createElementBlock as m, withDirectives as T, createVNode as h, createTextVNode as v, toDisplayString as g, vShow as A, normalizeStyle as X, Fragment as f } from "vue";
2
- import { Disclosure as q, DisclosureButton as j, DisclosurePanel as G } from "@headlessui/vue";
3
- import { ScalarMarkdown as J, ScalarIcon as k } from "@scalar/components";
4
- import z from "../../ScreenReader.vue.js";
5
- import { DISCRIMINATOR_CONTEXT as K } from "../../../hooks/useDiscriminator.js";
6
- import { isTypeObject as N } from "./helpers/is-type-object.js";
7
- import L from "./SchemaHeading.vue.js";
8
- import Q from "./SchemaObjectProperties.vue.js";
9
- import W from "./SchemaProperty.vue.js";
10
- const Y = {
1
+ import { defineComponent as E, inject as $, computed as u, createBlock as c, createCommentVNode as m, openBlock as l, unref as s, withCtx as p, createElementVNode as A, normalizeClass as v, createElementBlock as d, createVNode as h, withDirectives as w, createTextVNode as f, toDisplayString as g, vShow as C, normalizeStyle as U, Fragment as y } from "vue";
2
+ import { Disclosure as q, DisclosureButton as T, DisclosurePanel as F } from "@headlessui/vue";
3
+ import { ScalarMarkdown as X, ScalarIcon as b } from "@scalar/components";
4
+ import j from "../../ScreenReader.vue.js";
5
+ import { DISCRIMINATOR_CONTEXT as G } from "../../../hooks/useDiscriminator.js";
6
+ import { isTypeObject as k } from "./helpers/is-type-object.js";
7
+ import J from "./SchemaHeading.vue.js";
8
+ import K from "./SchemaObjectProperties.vue.js";
9
+ import L from "./SchemaProperty.vue.js";
10
+ const Q = {
11
11
  key: 0,
12
12
  class: "schema-card-description"
13
- }, Z = {
13
+ }, Y = {
14
14
  key: 0,
15
15
  class: "schema-properties"
16
- }, te = /* @__PURE__ */ U({
16
+ }, oe = /* @__PURE__ */ E({
17
17
  __name: "Schema",
18
18
  props: {
19
19
  value: { type: [Object, Boolean] },
@@ -28,180 +28,187 @@ const Y = {
28
28
  discriminator: {},
29
29
  discriminatorMapping: {},
30
30
  discriminatorPropertyName: {},
31
- hasDiscriminator: { type: Boolean }
31
+ hasDiscriminator: { type: Boolean },
32
+ breadcrumb: {}
32
33
  },
33
34
  emits: ["update:modelValue"],
34
- setup(I, { emit: E }) {
35
- const r = I, R = E, i = F(K, null), M = c(
35
+ setup(z, { emit: I }) {
36
+ const r = z, R = I, o = $(G, null), N = u(
36
37
  () => {
37
38
  var e;
38
- return ((e = i == null ? void 0 : i.value) == null ? void 0 : e.discriminatorMapping) || r.discriminatorMapping || {};
39
+ return ((e = o == null ? void 0 : o.value) == null ? void 0 : e.discriminatorMapping) || r.discriminatorMapping || {};
39
40
  }
40
- ), P = c(
41
+ ), M = u(
41
42
  () => {
42
43
  var e;
43
- return ((e = i == null ? void 0 : i.value) == null ? void 0 : e.discriminatorPropertyName) || r.discriminatorPropertyName || "";
44
+ return ((e = o == null ? void 0 : o.value) == null ? void 0 : e.discriminatorPropertyName) || r.discriminatorPropertyName || "";
44
45
  }
45
- ), S = c(
46
+ ), P = u(
46
47
  () => {
47
48
  var e;
48
- return ((e = i == null ? void 0 : i.value) == null ? void 0 : e.selectedType) || r.discriminator;
49
+ return ((e = o == null ? void 0 : o.value) == null ? void 0 : e.selectedType) || r.discriminator;
49
50
  }
50
- ), a = c(() => {
51
- var o;
52
- const e = (o = i == null ? void 0 : i.value) == null ? void 0 : o.mergedSchema, y = r.value;
53
- return e && r.level === 0 && r.hasDiscriminator && N(y) && N(e) ? e : r.value;
54
- }), b = c(() => !(r.noncollapsible || r.level === 0)), $ = c(() => {
55
- var e;
56
- return !(!((e = a.value) != null && e.description) || typeof a.value.description != "string" || a.value.allOf || a.value.oneOf || a.value.anyOf || a.value.enum || !a.value.properties && !a.value.patternProperties && !a.value.additionalProperties || r.level === 0);
57
- }), D = (e) => r.noncollapsible && e.stopPropagation(), B = (e) => {
51
+ ), a = u(() => {
52
+ var i;
53
+ const e = (i = o == null ? void 0 : o.value) == null ? void 0 : i.mergedSchema, n = r.value;
54
+ return e && r.level === 0 && r.hasDiscriminator && k(n) && k(e) ? e : r.value;
55
+ }), S = u(() => !(r.noncollapsible || r.level === 0)), B = u(() => {
56
+ var e, n;
57
+ if ((e = a.value) != null && e.allOf && Array.isArray(a.value.allOf) && // Because we don't want it to show in models
58
+ r.name === "Request Body") {
59
+ if (a.value.description)
60
+ return a.value.description;
61
+ const i = a.value.allOf.find(
62
+ (t) => t.description && typeof t.description == "string"
63
+ );
64
+ if (i != null && i.description)
65
+ return i.description;
66
+ }
67
+ return !((n = a.value) != null && n.description) || typeof a.value.description != "string" || a.value.oneOf || a.value.anyOf || a.value.enum || !a.value.properties && !a.value.patternProperties && !a.value.additionalProperties || r.level === 0 ? null : a.value.description;
68
+ }), D = (e) => r.noncollapsible && e.stopPropagation(), O = (e) => {
58
69
  R("update:modelValue", e);
59
70
  };
60
- return (e, y) => typeof e.value == "object" && Object.keys(e.value).length ? (l(), t(s(q), {
71
+ return (e, n) => typeof e.value == "object" && Object.keys(e.value).length ? (l(), c(s(q), {
61
72
  key: 0,
62
73
  defaultOpen: e.noncollapsible
63
74
  }, {
64
- default: d(({ open: o }) => {
65
- var H, O;
66
- return [
67
- C("div", {
68
- class: p(["schema-card", [
69
- `schema-card--level-${e.level}`,
70
- { "schema-card--compact": e.compact, "schema-card--open": o },
71
- { "border-t": e.additionalProperties && o }
72
- ]])
75
+ default: p(({ open: i }) => [
76
+ A("div", {
77
+ class: v(["schema-card", [
78
+ `schema-card--level-${e.level}`,
79
+ { "schema-card--compact": e.compact, "schema-card--open": i },
80
+ { "border-t": e.additionalProperties && i }
81
+ ]])
82
+ }, [
83
+ B.value ? (l(), d("div", Q, [
84
+ h(s(X), { value: B.value }, null, 8, ["value"])
85
+ ])) : m("", !0),
86
+ A("div", {
87
+ class: v(["schema-properties", {
88
+ "schema-properties-open": i
89
+ }])
73
90
  }, [
74
- $.value ? (l(), m("div", Y, [
75
- (H = a.value) != null && H.enum ? n("", !0) : (l(), t(s(J), {
76
- key: 0,
77
- value: (O = a.value) == null ? void 0 : O.description
78
- }, null, 8, ["value"]))
79
- ])) : n("", !0),
80
- C("div", {
81
- class: p(["schema-properties", {
82
- "schema-properties-open": o
83
- }])
84
- }, [
85
- e.additionalProperties ? T((l(), m("div", Z, [
86
- h(s(j), {
87
- as: "button",
88
- class: "schema-card-title schema-card-title--compact",
89
- onClickCapture: D
90
- }, {
91
- default: d(() => [
92
- h(s(k), {
93
- class: "schema-card-title-icon",
91
+ e.additionalProperties ? w((l(), d("div", Y, [
92
+ h(s(T), {
93
+ as: "button",
94
+ class: "schema-card-title schema-card-title--compact",
95
+ onClickCapture: D
96
+ }, {
97
+ default: p(() => [
98
+ h(s(b), {
99
+ class: "schema-card-title-icon",
100
+ icon: "Add",
101
+ size: "sm"
102
+ }),
103
+ n[0] || (n[0] = f(" Show additional properties ")),
104
+ e.name ? (l(), c(j, { key: 0 }, {
105
+ default: p(() => [
106
+ f("for " + g(e.name), 1)
107
+ ]),
108
+ _: 1
109
+ })) : m("", !0)
110
+ ]),
111
+ _: 1,
112
+ __: [0]
113
+ })
114
+ ], 512)), [
115
+ [C, !i]
116
+ ]) : S.value ? w((l(), c(s(T), {
117
+ key: 1,
118
+ as: e.noncollapsible ? "div" : "button",
119
+ class: v(["schema-card-title", { "schema-card-title--compact": e.compact }]),
120
+ style: U({
121
+ top: `calc(var(--refs-header-height) + calc(var(--schema-title-height) * ${e.level}))`
122
+ }),
123
+ onClickCapture: D
124
+ }, {
125
+ default: p(() => {
126
+ var t, H, V;
127
+ return [
128
+ e.compact ? (l(), d(y, { key: 0 }, [
129
+ h(s(b), {
130
+ class: v(["schema-card-title-icon", { "schema-card-title-icon--open": i }]),
94
131
  icon: "Add",
95
132
  size: "sm"
96
- }),
97
- y[0] || (y[0] = v(" Show additional properties ")),
98
- e.name ? (l(), t(z, { key: 0 }, {
99
- default: d(() => [
100
- v("for " + g(e.name), 1)
133
+ }, null, 8, ["class"]),
134
+ i ? (l(), d(y, { key: 0 }, [
135
+ f(" Hide " + g(((t = e.value) == null ? void 0 : t.title) ?? "Child Attributes"), 1)
136
+ ], 64)) : (l(), d(y, { key: 1 }, [
137
+ f(" Show " + g(((H = e.value) == null ? void 0 : H.title) ?? "Child Attributes"), 1)
138
+ ], 64)),
139
+ e.name ? (l(), c(j, { key: 2 }, {
140
+ default: p(() => [
141
+ f("for " + g(e.name), 1)
101
142
  ]),
102
143
  _: 1
103
- })) : n("", !0)
104
- ]),
105
- _: 1,
106
- __: [0]
107
- })
108
- ], 512)), [
109
- [A, !o]
110
- ]) : b.value ? T((l(), t(s(j), {
111
- key: 1,
112
- as: e.noncollapsible ? "div" : "button",
113
- class: p(["schema-card-title", { "schema-card-title--compact": e.compact }]),
114
- style: X({
115
- top: `calc(var(--refs-header-height) + calc(var(--schema-title-height) * ${e.level}))`
116
- }),
117
- onClickCapture: D
118
- }, {
119
- default: d(() => {
120
- var u, V, w;
121
- return [
122
- e.compact ? (l(), m(f, { key: 0 }, [
123
- h(s(k), {
124
- class: p(["schema-card-title-icon", { "schema-card-title-icon--open": o }]),
125
- icon: "Add",
126
- size: "sm"
127
- }, null, 8, ["class"]),
128
- o ? (l(), m(f, { key: 0 }, [
129
- v(" Hide " + g(((u = e.value) == null ? void 0 : u.title) ?? "Child Attributes"), 1)
130
- ], 64)) : (l(), m(f, { key: 1 }, [
131
- v(" Show " + g(((V = e.value) == null ? void 0 : V.title) ?? "Child Attributes"), 1)
132
- ], 64)),
133
- e.name ? (l(), t(z, { key: 2 }, {
134
- default: d(() => [
135
- v("for " + g(e.name), 1)
136
- ]),
137
- _: 1
138
- })) : n("", !0)
139
- ], 64)) : (l(), m(f, { key: 1 }, [
140
- h(s(k), {
141
- class: p(["schema-card-title-icon", { "schema-card-title-icon--open": o }]),
142
- icon: "Add",
143
- size: "sm"
144
- }, null, 8, ["class"]),
145
- h(L, {
146
- name: ((w = e.value) == null ? void 0 : w.title) ?? e.name,
147
- value: e.value
148
- }, null, 8, ["name", "value"])
149
- ], 64))
150
- ];
151
- }),
152
- _: 2
153
- }, 1032, ["as", "class", "style"])), [
154
- [A, !e.hideHeading && !(e.noncollapsible && e.compact)]
155
- ]) : n("", !0),
156
- !e.additionalProperties || o ? (l(), t(s(G), {
157
- key: 2,
158
- as: "ul",
159
- static: !b.value
160
- }, {
161
- default: d(() => {
162
- var u;
163
- return [
164
- s(N)(a.value) ? (l(), t(Q, {
144
+ })) : m("", !0)
145
+ ], 64)) : (l(), d(y, { key: 1 }, [
146
+ h(s(b), {
147
+ class: v(["schema-card-title-icon", { "schema-card-title-icon--open": i }]),
148
+ icon: "Add",
149
+ size: "sm"
150
+ }, null, 8, ["class"]),
151
+ h(J, {
152
+ name: ((V = e.value) == null ? void 0 : V.title) ?? e.name,
153
+ value: e.value
154
+ }, null, 8, ["name", "value"])
155
+ ], 64))
156
+ ];
157
+ }),
158
+ _: 2
159
+ }, 1032, ["as", "class", "style"])), [
160
+ [C, !e.hideHeading && !(e.noncollapsible && e.compact)]
161
+ ]) : m("", !0),
162
+ !e.additionalProperties || i ? (l(), c(s(F), {
163
+ key: 2,
164
+ as: "ul",
165
+ static: !S.value
166
+ }, {
167
+ default: p(() => {
168
+ var t;
169
+ return [
170
+ s(k)(a.value) ? (l(), c(K, {
171
+ key: 0,
172
+ breadcrumb: e.breadcrumb,
173
+ schema: a.value,
174
+ compact: e.compact,
175
+ hideHeading: e.hideHeading,
176
+ level: e.level + 1,
177
+ hideModelNames: e.hideModelNames,
178
+ schemas: e.schemas,
179
+ discriminator: P.value,
180
+ discriminatorMapping: N.value,
181
+ discriminatorPropertyName: M.value,
182
+ hasDiscriminator: e.hasDiscriminator,
183
+ "onUpdate:modelValue": O
184
+ }, null, 8, ["breadcrumb", "schema", "compact", "hideHeading", "level", "hideModelNames", "schemas", "discriminator", "discriminatorMapping", "discriminatorPropertyName", "hasDiscriminator"])) : (l(), d(y, { key: 1 }, [
185
+ a.value ? (l(), c(L, {
165
186
  key: 0,
166
- schema: a.value,
187
+ breadcrumb: e.breadcrumb,
167
188
  compact: e.compact,
168
189
  hideHeading: e.hideHeading,
169
- level: e.level + 1,
170
190
  hideModelNames: e.hideModelNames,
191
+ level: e.level,
192
+ name: a.value.name,
171
193
  schemas: e.schemas,
172
- discriminator: S.value,
173
- discriminatorMapping: M.value,
174
- discriminatorPropertyName: P.value,
175
- hasDiscriminator: e.hasDiscriminator,
176
- "onUpdate:modelValue": B
177
- }, null, 8, ["schema", "compact", "hideHeading", "level", "hideModelNames", "schemas", "discriminator", "discriminatorMapping", "discriminatorPropertyName", "hasDiscriminator"])) : (l(), m(f, { key: 1 }, [
178
- a.value ? (l(), t(W, {
179
- key: 0,
180
- compact: e.compact,
181
- hideHeading: e.hideHeading,
182
- hideModelNames: e.hideModelNames,
183
- level: e.level,
184
- name: a.value.name,
185
- schemas: e.schemas,
186
- value: ((u = e.value.discriminator) == null ? void 0 : u.propertyName) === e.name ? e.value : a.value,
187
- discriminatorMapping: M.value,
188
- discriminatorPropertyName: P.value,
189
- modelValue: S.value,
190
- "onUpdate:modelValue": B
191
- }, null, 8, ["compact", "hideHeading", "hideModelNames", "level", "name", "schemas", "value", "discriminatorMapping", "discriminatorPropertyName", "modelValue"])) : n("", !0)
192
- ], 64))
193
- ];
194
- }),
195
- _: 1
196
- }, 8, ["static"])) : n("", !0)
197
- ], 2)
194
+ value: ((t = e.value.discriminator) == null ? void 0 : t.propertyName) === e.name ? e.value : a.value,
195
+ discriminatorMapping: N.value,
196
+ discriminatorPropertyName: M.value,
197
+ modelValue: P.value,
198
+ "onUpdate:modelValue": O
199
+ }, null, 8, ["breadcrumb", "compact", "hideHeading", "hideModelNames", "level", "name", "schemas", "value", "discriminatorMapping", "discriminatorPropertyName", "modelValue"])) : m("", !0)
200
+ ], 64))
201
+ ];
202
+ }),
203
+ _: 1
204
+ }, 8, ["static"])) : m("", !0)
198
205
  ], 2)
199
- ];
200
- }),
206
+ ], 2)
207
+ ]),
201
208
  _: 1
202
- }, 8, ["defaultOpen"])) : n("", !0);
209
+ }, 8, ["defaultOpen"])) : m("", !0);
203
210
  }
204
211
  });
205
212
  export {
206
- te as default
213
+ oe as default
207
214
  };
@@ -8,6 +8,7 @@ type __VLS_Props = {
8
8
  level: number;
9
9
  compact?: boolean;
10
10
  hideHeading?: boolean;
11
+ breadcrumb?: string[];
11
12
  };
12
13
  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>;
13
14
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaComposition.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaComposition.vue"],"names":[],"mappings":"AA+PA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAA;AAIjE,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,8BAA8B,CAAA;AAKrC,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,kBAAkB,CAAA;IAC/B,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC1B,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB,CAAC;;AAiTF,wBAOG"}
1
+ {"version":3,"file":"SchemaComposition.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaComposition.vue"],"names":[],"mappings":"AAoQA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAA;AAIjE,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,8BAA8B,CAAA;AAKrC,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,kBAAkB,CAAA;IAC/B,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC1B,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;CACtB,CAAC;;AAiTF,wBAOG"}
@@ -1,14 +1,14 @@
1
- import { defineComponent as z, ref as E, computed as t, resolveComponent as j, createElementBlock as d, openBlock as r, createCommentVNode as O, createBlock as c, Fragment as A, renderList as F, createVNode as H, createElementVNode as u, unref as h, withCtx as R, toDisplayString as N } from "vue";
1
+ import { defineComponent as z, ref as E, computed as t, resolveComponent as j, createElementBlock as v, openBlock as i, createCommentVNode as b, createBlock as c, Fragment as A, renderList as F, createVNode as H, createElementVNode as u, unref as O, withCtx as R, toDisplayString as N } from "vue";
2
2
  import { ScalarListbox as Z } from "@scalar/components";
3
3
  import { ScalarIconCaretDown as $ } from "@scalar/icons";
4
4
  import { getSchemaType as G } from "./helpers/get-schema-type.js";
5
5
  import { mergeAllOfSchemas as V } from "./helpers/merge-all-of-schemas.js";
6
- import { hasComposition as y } from "./helpers/schema-composition.js";
7
- import b from "./Schema.vue.js";
6
+ import { hasComposition as h } from "./helpers/schema-composition.js";
7
+ import y from "./Schema.vue.js";
8
8
  const J = { class: "property-rule" }, K = {
9
9
  class: "composition-selector bg-b-1.5 hover:bg-b-2 flex w-full cursor-pointer items-center gap-1 rounded-t-lg border border-b-0 px-2 py-1.25 pr-3 text-left",
10
10
  type: "button"
11
- }, M = { class: "text-c-2" }, P = { class: "composition-selector-label text-c-1" }, Q = { class: "composition-panel" }, le = /* @__PURE__ */ z({
11
+ }, M = { class: "text-c-2" }, P = { class: "composition-selector-label text-c-1" }, Q = { class: "composition-panel" }, ae = /* @__PURE__ */ z({
12
12
  __name: "SchemaComposition",
13
13
  props: {
14
14
  composition: {},
@@ -17,9 +17,10 @@ const J = { class: "property-rule" }, K = {
17
17
  value: {},
18
18
  level: {},
19
19
  compact: { type: Boolean },
20
- hideHeading: { type: Boolean }
20
+ hideHeading: { type: Boolean },
21
+ breadcrumb: {}
21
22
  },
22
- setup(s) {
23
+ setup(r) {
23
24
  const p = E(0), w = t(() => S.value), g = t(
24
25
  () => w.value.map(
25
26
  (e, o) => ({
@@ -27,121 +28,125 @@ const J = { class: "property-rule" }, K = {
27
28
  label: G(e) || "Schema"
28
29
  })
29
30
  )
30
- ), f = t({
31
+ ), d = t({
31
32
  get: () => g.value.find(
32
33
  (e) => e.id === String(p.value)
33
34
  ),
34
35
  set: (e) => p.value = Number(e.id)
35
36
  }), B = t(() => {
36
- var i;
37
- const e = ["oneOf", "anyOf"].includes(s.composition), o = s.composition === "allOf" && ((i = s.value[s.composition]) == null ? void 0 : i.some((l) => y(l)));
37
+ var s;
38
+ const e = ["oneOf", "anyOf"].includes(r.composition), o = r.composition === "allOf" && ((s = r.value[r.composition]) == null ? void 0 : s.some((a) => h(a)));
38
39
  return e || o;
39
- }), D = (e) => e.find((o) => y(o)), I = (e) => !e.allOf || !Array.isArray(e.allOf) ? !1 : e.allOf.some(
40
+ }), D = (e) => e.find((o) => h(o)), I = (e) => !e.allOf || !Array.isArray(e.allOf) ? !1 : e.allOf.some(
40
41
  (o) => o.oneOf || o.anyOf || o.allOf
41
42
  ), C = (e) => e.allOf && Array.isArray(e.allOf) ? I(e) ? e : V(e.allOf) : e, S = t(() => {
42
- const e = s.value[s.composition], o = D(e);
43
- return !o || s.composition !== "allOf" && o.allOf ? e.map(C) : (o.oneOf || o.anyOf || o.allOf).map(C);
43
+ const e = r.value[r.composition], o = D(e);
44
+ return !o || r.composition !== "allOf" && o.allOf ? e.map(C) : (o.oneOf || o.anyOf || o.allOf).map(C);
44
45
  }), L = (e) => {
45
- var o, i;
46
+ var o, s;
46
47
  if (e === "allOf") {
47
- const l = (i = (o = s.value) == null ? void 0 : o[e]) == null ? void 0 : i.find(
48
- (m) => y(m)
48
+ const a = (s = (o = r.value) == null ? void 0 : o[e]) == null ? void 0 : s.find(
49
+ (m) => h(m)
49
50
  );
50
- if (l != null && l.oneOf)
51
+ if (a != null && a.oneOf)
51
52
  return "One of";
52
- if (l != null && l.anyOf)
53
+ if (a != null && a.anyOf)
53
54
  return "Any of";
54
55
  }
55
- return e.replace(/([A-Z])/g, " $1").replace(/^./, (l) => l.toUpperCase()).toLowerCase().replace(/^(\w)/, (l) => l.toUpperCase());
56
- }, a = t(
56
+ return e.replace(/([A-Z])/g, " $1").replace(/^./, (a) => a.toUpperCase()).toLowerCase().replace(/^(\w)/, (a) => a.toUpperCase());
57
+ }, n = t(
57
58
  () => S.value[p.value]
58
- ), v = t(() => {
59
+ ), f = t(() => {
59
60
  var e;
60
- return (e = a.value) != null && e.oneOf ? "oneOf" : "anyOf";
61
+ return (e = n.value) != null && e.oneOf ? "oneOf" : "anyOf";
61
62
  }), T = t(() => {
62
63
  var o;
63
- const e = v.value;
64
- return (o = a.value) == null ? void 0 : o[e];
64
+ const e = f.value;
65
+ return (o = n.value) == null ? void 0 : o[e];
65
66
  }), U = t(() => {
66
- const e = a.value;
67
+ const e = n.value;
67
68
  return e ? !!(e.properties || e.type || e.nullable || e.const !== void 0 || e.enum || e.allOf || e.oneOf || e.anyOf || e.items) : !1;
68
69
  });
69
70
  return (e, o) => {
70
- var l, m, k;
71
- const i = j("SchemaComposition", !0);
72
- return r(), d("div", J, [
73
- e.composition === "allOf" && e.value[e.composition].some((n) => n.oneOf || n.anyOf) ? (r(!0), d(A, { key: 0 }, F(e.value[e.composition].filter(
74
- (n) => !n.oneOf && !n.anyOf
75
- ), (n, q) => (r(), c(b, {
71
+ var a, m, k;
72
+ const s = j("SchemaComposition", !0);
73
+ return i(), v("div", J, [
74
+ e.composition === "allOf" && e.value[e.composition].some((l) => l.oneOf || l.anyOf) ? (i(!0), v(A, { key: 0 }, F(e.value[e.composition].filter(
75
+ (l) => !l.oneOf && !l.anyOf
76
+ ), (l, q) => (i(), c(y, {
76
77
  key: q,
78
+ breadcrumb: e.breadcrumb,
77
79
  compact: e.compact,
78
80
  level: e.level,
79
81
  name: e.name,
80
82
  noncollapsible: e.level == 0,
81
83
  schemas: e.schemas,
82
- value: n
83
- }, null, 8, ["compact", "level", "name", "noncollapsible", "schemas", "value"]))), 128)) : O("", !0),
84
- B.value ? (r(), d(A, { key: 1 }, [
85
- H(h(Z), {
86
- modelValue: f.value,
87
- "onUpdate:modelValue": o[0] || (o[0] = (n) => f.value = n),
84
+ value: l
85
+ }, null, 8, ["breadcrumb", "compact", "level", "name", "noncollapsible", "schemas", "value"]))), 128)) : b("", !0),
86
+ B.value ? (i(), v(A, { key: 1 }, [
87
+ H(O(Z), {
88
+ modelValue: d.value,
89
+ "onUpdate:modelValue": o[0] || (o[0] = (l) => d.value = l),
88
90
  options: g.value,
89
91
  resize: ""
90
92
  }, {
91
93
  default: R(() => {
92
- var n;
94
+ var l;
93
95
  return [
94
96
  u("button", K, [
95
97
  u("span", M, N(L(e.composition)), 1),
96
- u("span", P, N(((n = f.value) == null ? void 0 : n.label) || "Schema"), 1),
97
- H(h($))
98
+ u("span", P, N(((l = d.value) == null ? void 0 : l.label) || "Schema"), 1),
99
+ H(O($))
98
100
  ])
99
101
  ];
100
102
  }),
101
103
  _: 1
102
104
  }, 8, ["modelValue", "options"]),
103
105
  u("div", Q, [
104
- U.value ? (r(), c(b, {
106
+ U.value ? (i(), c(y, {
105
107
  key: 0,
108
+ breadcrumb: e.breadcrumb,
106
109
  compact: e.compact,
107
110
  level: e.level + 1,
108
111
  hideHeading: e.hideHeading,
109
112
  name: e.name,
110
113
  noncollapsible: !0,
111
114
  schemas: e.schemas,
112
- value: (l = a.value) != null && l.properties ? {
115
+ value: (a = n.value) != null && a.properties ? {
113
116
  type: "object",
114
- properties: a.value.properties,
115
- required: a.value.required
116
- } : a.value
117
- }, null, 8, ["compact", "level", "hideHeading", "name", "schemas", "value"])) : O("", !0),
118
- (m = a.value) != null && m.oneOf || (k = a.value) != null && k.anyOf ? (r(), c(i, {
117
+ properties: n.value.properties,
118
+ required: n.value.required
119
+ } : n.value
120
+ }, null, 8, ["breadcrumb", "compact", "level", "hideHeading", "name", "schemas", "value"])) : b("", !0),
121
+ (m = n.value) != null && m.oneOf || (k = n.value) != null && k.anyOf ? (i(), c(s, {
119
122
  key: 1,
123
+ breadcrumb: e.breadcrumb,
120
124
  compact: e.compact,
121
- composition: v.value,
125
+ composition: f.value,
122
126
  hideHeading: e.hideHeading,
123
127
  level: e.level + 1,
124
128
  name: e.name,
125
129
  noncollapsible: !0,
126
130
  schemas: e.schemas,
127
131
  value: {
128
- [v.value]: T.value
132
+ [f.value]: T.value
129
133
  }
130
- }, null, 8, ["compact", "composition", "hideHeading", "level", "name", "schemas", "value"])) : O("", !0)
134
+ }, null, 8, ["breadcrumb", "compact", "composition", "hideHeading", "level", "name", "schemas", "value"])) : b("", !0)
131
135
  ])
132
- ], 64)) : (r(), c(b, {
136
+ ], 64)) : (i(), c(y, {
133
137
  key: 2,
138
+ breadcrumb: e.breadcrumb,
134
139
  compact: e.compact,
135
140
  level: e.level,
136
141
  name: e.name,
137
142
  noncollapsible: e.level == 0,
138
143
  schemas: e.schemas,
139
- value: h(V)(e.value[e.composition])
140
- }, null, 8, ["compact", "level", "name", "noncollapsible", "schemas", "value"]))
144
+ value: O(V)(e.value[e.composition])
145
+ }, null, 8, ["breadcrumb", "compact", "level", "name", "noncollapsible", "schemas", "value"]))
141
146
  ]);
142
147
  };
143
148
  }
144
149
  });
145
150
  export {
146
- le as default
151
+ ae as default
147
152
  };
@@ -11,6 +11,7 @@ type __VLS_Props = {
11
11
  discriminatorMapping?: Record<string, string>;
12
12
  discriminatorPropertyName?: string;
13
13
  hasDiscriminator?: boolean;
14
+ breadcrumb?: string[];
14
15
  };
15
16
  declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
16
17
  "update:modelValue": (value: string) => any;
@@ -1 +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"}
1
+ {"version":3,"file":"SchemaObjectProperties.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/Schema/SchemaObjectProperties.vue"],"names":[],"mappings":"AAAA,OAmMO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAGxD,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;IAC1B,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;CACtB,CAAC;;;;;;AAgQF,wBAOG"}