@scalar/api-reference 1.5.0 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/dist/browser/standalone.js +7 -7
  3. package/dist/components/Anchor/Anchor.vue.d.ts.map +1 -1
  4. package/dist/components/ApiClientModal.vue.d.ts +2 -0
  5. package/dist/components/ApiClientModal.vue.d.ts.map +1 -1
  6. package/dist/components/ApiReference.vue.d.ts.map +1 -1
  7. package/dist/components/ApiReferenceBase.vue.d.ts.map +1 -1
  8. package/dist/components/ApiReferenceLayout.vue.d.ts +2 -2
  9. package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
  10. package/dist/components/Badge/Badge.stories.d.ts +8 -0
  11. package/dist/components/Badge/Badge.stories.d.ts.map +1 -0
  12. package/dist/components/Badge/Badge.vue.d.ts +10 -0
  13. package/dist/components/Badge/Badge.vue.d.ts.map +1 -0
  14. package/dist/components/Badge/index.d.ts +2 -0
  15. package/dist/components/Badge/index.d.ts.map +1 -0
  16. package/dist/components/Content/Content.vue.d.ts +2 -2
  17. package/dist/components/Content/Content.vue.d.ts.map +1 -1
  18. package/dist/components/Content/Introduction/DownloadSpec.vue.d.ts.map +1 -1
  19. package/dist/components/Content/Introduction/Introduction.vue.d.ts.map +1 -1
  20. package/dist/components/Content/MarkdownRenderer.vue.d.ts.map +1 -1
  21. package/dist/components/Content/ReferenceEndpoint/{Copy.vue.d.ts → EndpointDetails.vue.d.ts} +1 -1
  22. package/dist/components/Content/ReferenceEndpoint/EndpointDetails.vue.d.ts.map +1 -0
  23. package/dist/components/Content/ReferenceEndpoint/EndpointDetailsCard.vue.d.ts +17 -0
  24. package/dist/components/Content/ReferenceEndpoint/EndpointDetailsCard.vue.d.ts.map +1 -0
  25. package/dist/components/Content/ReferenceEndpoint/ExampleRequest.vue.d.ts.map +1 -1
  26. package/dist/components/Content/ReferenceEndpoint/Parameters.vue.d.ts +9 -4
  27. package/dist/components/Content/ReferenceEndpoint/Parameters.vue.d.ts.map +1 -1
  28. package/dist/components/Content/ReferenceEndpoint/ReferenceEndpoint.vue.d.ts.map +1 -1
  29. package/dist/components/Content/ReferenceEndpoint/ReferenceEndpointAccordion.vue.d.ts +19 -0
  30. package/dist/components/Content/ReferenceEndpoint/ReferenceEndpointAccordion.vue.d.ts.map +1 -0
  31. package/dist/components/Content/ReferenceEndpoint/RequestBody.vue.d.ts +9 -2
  32. package/dist/components/Content/ReferenceEndpoint/RequestBody.vue.d.ts.map +1 -1
  33. package/dist/components/Content/ReferenceTag.vue.d.ts +28 -0
  34. package/dist/components/Content/ReferenceTag.vue.d.ts.map +1 -0
  35. package/dist/components/Content/ReferenceTagAccordion.vue.d.ts +28 -0
  36. package/dist/components/Content/ReferenceTagAccordion.vue.d.ts.map +1 -0
  37. package/dist/components/Content/Schema.stories.d.ts.map +1 -1
  38. package/dist/components/Content/SchemaProperty.vue.d.ts.map +1 -1
  39. package/dist/components/Content/ShowMoreButton.vue.d.ts.map +1 -1
  40. package/dist/components/DarkModeIconToggle.vue.d.ts.map +1 -1
  41. package/dist/components/FlowButton.vue.d.ts.map +1 -1
  42. package/dist/components/GettingStarted.vue.d.ts.map +1 -1
  43. package/dist/components/Layouts/BaseLayout.vue.d.ts +18 -0
  44. package/dist/components/Layouts/BaseLayout.vue.d.ts.map +1 -0
  45. package/dist/components/Layouts/index.d.ts +4 -3
  46. package/dist/components/Layouts/index.d.ts.map +1 -1
  47. package/dist/components/ScreenReader.vue.d.ts +37 -0
  48. package/dist/components/ScreenReader.vue.d.ts.map +1 -0
  49. package/dist/components/Section/SectionAccordion.vue.d.ts +25 -0
  50. package/dist/components/{Content/ReferenceEndpoint/Copy.vue.d.ts.map → Section/SectionAccordion.vue.d.ts.map} +1 -1
  51. package/dist/components/Section/SectionContainer.vue.d.ts.map +1 -1
  52. package/dist/components/Section/SectionContainerAccordion.vue.d.ts +11 -0
  53. package/dist/components/Section/SectionContainerAccordion.vue.d.ts.map +1 -0
  54. package/dist/components/Section/index.d.ts +2 -0
  55. package/dist/components/Section/index.d.ts.map +1 -1
  56. package/dist/components/Sidebar.vue.d.ts.map +1 -1
  57. package/dist/components/SidebarElement.vue.d.ts +2 -0
  58. package/dist/components/SidebarElement.vue.d.ts.map +1 -1
  59. package/dist/helpers/getApiClientRequest.d.ts.map +1 -1
  60. package/dist/helpers/getExampleFromSchema.d.ts.map +1 -1
  61. package/dist/helpers/getParametersFromOperation.d.ts +13 -0
  62. package/dist/helpers/getParametersFromOperation.d.ts.map +1 -0
  63. package/dist/helpers/getRequestFromOperation.d.ts.map +1 -1
  64. package/dist/helpers/index.d.ts +2 -1
  65. package/dist/helpers/index.d.ts.map +1 -1
  66. package/dist/helpers/openClientFor.d.ts +3 -0
  67. package/dist/helpers/openClientFor.d.ts.map +1 -0
  68. package/dist/hooks/index.d.ts +1 -0
  69. package/dist/hooks/index.d.ts.map +1 -1
  70. package/dist/hooks/useNavigation.d.ts +1 -0
  71. package/dist/hooks/useNavigation.d.ts.map +1 -1
  72. package/dist/hooks/useParser.d.ts +24 -9
  73. package/dist/hooks/useParser.d.ts.map +1 -1
  74. package/dist/hooks/useResponses.d.ts +11 -0
  75. package/dist/hooks/useResponses.d.ts.map +1 -0
  76. package/dist/{index-1820592b.js → index-0548261f.js} +10909 -10548
  77. package/dist/{index-06c444c3.js → index-99107dc9.js} +173 -170
  78. package/dist/index.d.ts +1 -0
  79. package/dist/index.d.ts.map +1 -1
  80. package/dist/index.js +20 -14
  81. package/dist/types.d.ts +15 -7
  82. package/dist/types.d.ts.map +1 -1
  83. package/package.json +5 -5
  84. package/dist/helpers/showItemInClient.d.ts +0 -3
  85. package/dist/helpers/showItemInClient.d.ts.map +0 -1
@@ -1,7 +1,7 @@
1
- import { defineComponent as R, useCssVars as ae, openBlock as f, createElementBlock as g, normalizeClass as T, createElementVNode as v, createCommentVNode as _, createStaticVNode as re, renderSlot as E, toDisplayString as x, createBlock as A, useAttrs as ie, ref as b, onMounted as le, resolveDynamicComponent as ce, mergeProps as de, unref as y, withKeys as ue, watch as W, Fragment as P, createTextVNode as C, createVNode as S, withCtx as U, computed as he, isRef as pe } from "vue";
2
- import { _ as F, n as fe, u as me, H as X, F as ge, f as ye, r as Z, c as B, U as K, a as z, b as J, E as H, d as oe, V as q, A as ne, e as se, R as ve, g as ee, m as we, h as Se, D as M, W as _e, i as N, t as I, j as D, k as be, l as ke, o as Ce } from "./index-1820592b.js";
3
- import { p as Xt } from "./index-1820592b.js";
4
- import { useTextareaAutosize as xe, useMediaQuery as Fe, useFileDialog as $e } from "@vueuse/core";
1
+ import { defineComponent as R, useCssVars as ae, openBlock as f, createElementBlock as g, normalizeClass as T, createElementVNode as w, createCommentVNode as _, createStaticVNode as re, renderSlot as E, toDisplayString as F, createBlock as A, useAttrs as ie, ref as b, onMounted as le, resolveDynamicComponent as ce, mergeProps as de, unref as y, withKeys as ue, watch as W, Fragment as P, createTextVNode as C, createVNode as v, withCtx as x, computed as he, isRef as pe } from "vue";
2
+ import { _ as M, n as fe, u as me, H as X, F as ge, f as ye, r as Z, c as I, U as K, a as z, b as J, E as H, d as oe, V as q, A as ne, e as se, R as ve, g as ee, m as we, h as Se, D as U, W as _e, i as N, t as B, j as D, k as be, l as ke, o as Ce, p as xe } from "./index-0548261f.js";
3
+ import { q as Gt } from "./index-0548261f.js";
4
+ import { useTextareaAutosize as Fe, useMediaQuery as Me, useFileDialog as $e } from "@vueuse/core";
5
5
  import "@headlessui/vue";
6
6
  import "axios";
7
7
  import "@vcarl/remark-headings";
@@ -11,6 +11,7 @@ import "remark-stringify";
11
11
  import "unified";
12
12
  import "js-yaml";
13
13
  import "unhead";
14
+ import "httpsnippet-lite";
14
15
  import "rehype-external-links";
15
16
  import "rehype-format";
16
17
  import "rehype-highlight";
@@ -18,9 +19,8 @@ import "rehype-sanitize";
18
19
  import "rehype-stringify";
19
20
  import "remark-gfm";
20
21
  import "remark-rehype";
21
- import "httpsnippet-lite";
22
22
  import "fuse.js";
23
- const Me = (r) => {
23
+ const Ue = (r) => {
24
24
  if (typeof r != "string")
25
25
  return !1;
26
26
  try {
@@ -29,13 +29,13 @@ const Me = (r) => {
29
29
  return !1;
30
30
  }
31
31
  return !0;
32
- }, Ue = {
32
+ }, Re = {
33
33
  key: 0,
34
34
  class: "loader-wrapper"
35
- }, Re = /* @__PURE__ */ re('<path class="svg-path svg-check-mark" d="m 0 60 l 30 30 l 70 -80" data-v-f02d7027></path><path class="svg-path svg-x-mark" d="m 50 50 l 40 -40" data-v-f02d7027></path><path class="svg-path svg-x-mark" d="m 50 50 l 40 40" data-v-f02d7027></path><path class="svg-path svg-x-mark" d="m 50 50 l -40 -40" data-v-f02d7027></path><path class="svg-path svg-x-mark" d="m 50 50 l -40 40" data-v-f02d7027></path>', 5), Ee = {
35
+ }, Ee = /* @__PURE__ */ re('<path class="svg-path svg-check-mark" d="m 0 60 l 30 30 l 70 -80" data-v-f02d7027></path><path class="svg-path svg-x-mark" d="m 50 50 l 40 -40" data-v-f02d7027></path><path class="svg-path svg-x-mark" d="m 50 50 l 40 40" data-v-f02d7027></path><path class="svg-path svg-x-mark" d="m 50 50 l -40 -40" data-v-f02d7027></path><path class="svg-path svg-x-mark" d="m 50 50 l -40 40" data-v-f02d7027></path>', 5), Te = {
36
36
  key: 0,
37
37
  class: "circular-loader"
38
- }, Te = /* @__PURE__ */ R({
38
+ }, Ie = /* @__PURE__ */ R({
39
39
  __name: "FlowLoader",
40
40
  props: {
41
41
  loaderState: {},
@@ -44,7 +44,7 @@ const Me = (r) => {
44
44
  setup(r) {
45
45
  return ae((e) => ({
46
46
  "0a23b95e": e.size
47
- })), (e, t) => e.loaderState ? (f(), g("div", Ue, [
47
+ })), (e, t) => e.loaderState ? (f(), g("div", Re, [
48
48
  (f(), g("svg", {
49
49
  class: T(["svg-loader", {
50
50
  "icon-is-valid": e.loaderState.valid,
@@ -54,9 +54,9 @@ const Me = (r) => {
54
54
  xmlns: "http://www.w3.org/2000/svg",
55
55
  "xmlns:xlink": "http://www.w3.org/1999/xlink"
56
56
  }, [
57
- Re,
58
- e.loaderState.isLoading ? (f(), g("g", Ee, [
59
- v("circle", {
57
+ Ee,
58
+ e.loaderState.isLoading ? (f(), g("g", Te, [
59
+ w("circle", {
60
60
  class: T(["loader-path", {
61
61
  "loader-path-off": e.loaderState.valid || e.loaderState.invalid
62
62
  }]),
@@ -70,18 +70,17 @@ const Me = (r) => {
70
70
  ], 2))
71
71
  ])) : _("", !0);
72
72
  }
73
- }), Be = /* @__PURE__ */ F(Te, [["__scopeId", "data-v-f02d7027"]]), Ie = ["title"], De = {
73
+ }), Be = /* @__PURE__ */ M(Ie, [["__scopeId", "data-v-f02d7027"]]), De = ["title"], Ae = {
74
74
  key: 0,
75
75
  class: "flow-button-decorator"
76
- }, Ae = { class: "flow-button-loader" }, Oe = /* @__PURE__ */ R({
76
+ }, Oe = { class: "flow-button-loader" }, Ve = /* @__PURE__ */ R({
77
77
  __name: "FlowButton",
78
78
  props: {
79
79
  label: {},
80
80
  error: { type: Boolean },
81
81
  loaderState: {},
82
82
  variant: {},
83
- title: {},
84
- icon: { type: Boolean }
83
+ title: {}
85
84
  },
86
85
  setup(r) {
87
86
  return (e, t) => (f(), g("button", {
@@ -89,30 +88,27 @@ const Me = (r) => {
89
88
  "flow-button-outlined": !e.error && e.variant === "outlined",
90
89
  "flow-button-clear": !e.error && e.variant === "clear",
91
90
  "flow-button-text": !e.error && e.variant === "text",
92
- "flow-button--delete": e.error,
93
- "flow-button-icon-only": e.icon
91
+ "flow-button--delete": e.error
94
92
  }]),
95
93
  title: e.title || e.label,
96
94
  type: "button"
97
95
  }, [
98
- e.$slots.default ? (f(), g("div", De, [
96
+ e.$slots.default ? (f(), g("div", Ae, [
99
97
  E(e.$slots, "default", {}, void 0, !0)
100
98
  ])) : _("", !0),
101
- v("span", {
102
- class: T({ "sr-only": e.icon })
103
- }, x(e.label), 3),
104
- v("div", Ae, [
99
+ w("span", null, F(e.label), 1),
100
+ w("div", Oe, [
105
101
  e.loaderState ? (f(), A(Be, {
106
102
  key: 0,
107
103
  loaderState: e.loaderState
108
104
  }, null, 8, ["loaderState"])) : _("", !0)
109
105
  ])
110
- ], 10, Ie));
106
+ ], 10, De));
111
107
  }
112
- }), te = /* @__PURE__ */ F(Oe, [["__scopeId", "data-v-48c181db"]]), Ve = { class: "flow-input-cont" }, Le = ["for"], Ye = { class: "icon-slot" }, Ne = { class: "helper-text" }, Pe = {
108
+ }), te = /* @__PURE__ */ M(Ve, [["__scopeId", "data-v-34b7939e"]]), Le = { class: "flow-input-cont" }, Ye = ["for"], Ne = { class: "icon-slot" }, Pe = { class: "helper-text" }, ze = {
113
109
  inheritAttrs: !1
114
- }, ze = /* @__PURE__ */ R({
115
- ...Pe,
110
+ }, Je = /* @__PURE__ */ R({
111
+ ...ze,
116
112
  __name: "FlowTextField",
117
113
  props: {
118
114
  modelValue: {},
@@ -129,30 +125,30 @@ const Me = (r) => {
129
125
  emits: ["submit", "update:modelValue"],
130
126
  setup(r, { emit: e }) {
131
127
  const t = r, s = ie(), i = s.id || `id-${fe()}`, a = b(), l = b(!1);
132
- let u;
128
+ let h;
133
129
  if (t.isMultiline) {
134
- const { triggerResize: o } = xe({
130
+ const { triggerResize: o } = Fe({
135
131
  element: a,
136
132
  input: t.modelValue
137
133
  });
138
- u = o;
134
+ h = o;
139
135
  }
140
136
  function d(o) {
141
137
  const n = o.target.value;
142
- t.isMultiline && u(), t.handleFieldChange ? t.handleFieldChange(n) : e("update:modelValue", n);
138
+ t.isMultiline && h(), t.handleFieldChange ? t.handleFieldChange(n) : e("update:modelValue", n);
143
139
  }
144
140
  function c(o) {
145
- const n = o.target, p = t.disableTrim || t.isMultiline ? n.value : n.value.trim();
146
- t.handleFieldSubmit ? t.handleFieldSubmit(p) : e("submit", p);
141
+ const n = o.target, u = t.disableTrim || t.isMultiline ? n.value : n.value.trim();
142
+ t.handleFieldSubmit ? t.handleFieldSubmit(u) : e("submit", u);
147
143
  }
148
- function h(o) {
144
+ function p(o) {
149
145
  l.value = !1, t.emitOnBlur && t.modelValue && c(o);
150
146
  }
151
147
  return le(() => {
152
148
  var o;
153
149
  Object.prototype.hasOwnProperty.call(s, "autofocus") && ((o = a.value) == null || o.focus());
154
- }), (o, n) => (f(), g("div", Ve, [
155
- v("div", {
150
+ }), (o, n) => (f(), g("div", Le, [
151
+ w("div", {
156
152
  class: T(["flow-input-wrapper", {
157
153
  "flow-input-wrapper--focus": l.value,
158
154
  "flow-input-wrapper--error": o.error,
@@ -164,8 +160,8 @@ const Me = (r) => {
164
160
  ref: a,
165
161
  class: ["flow-input hotkeys", { "flow-input__multiline": o.isMultiline }],
166
162
  value: o.modelValue,
167
- onBlur: h,
168
- onFocus: n[0] || (n[0] = (p) => l.value = !0),
163
+ onBlur: p,
164
+ onFocus: n[0] || (n[0] = (u) => l.value = !0),
169
165
  onInput: d,
170
166
  onKeyup: ue(c, ["enter"])
171
167
  }), null, 16, ["id", "class", "value", "onKeyup"])),
@@ -173,22 +169,22 @@ const Me = (r) => {
173
169
  key: 0,
174
170
  class: "flow-label",
175
171
  for: y(i)
176
- }, x(o.label), 9, Le)) : _("", !0),
177
- v("div", Ye, [
172
+ }, F(o.label), 9, Ye)) : _("", !0),
173
+ w("div", Ne, [
178
174
  E(o.$slots, "default", {}, void 0, !0)
179
175
  ])
180
176
  ], 2),
181
- v("span", Ne, x(o.helperText), 1)
177
+ w("span", Pe, F(o.helperText), 1)
182
178
  ]));
183
179
  }
184
- }), Je = /* @__PURE__ */ F(ze, [["__scopeId", "data-v-12153368"]]), je = { class: "swagger-editor-header" }, We = { class: "swagger-editor-title" }, Ke = { class: "swagger-editor-actions" }, qe = { key: 0 }, Qe = { key: 0 }, Ge = { class: "flex-col gap-1" }, Xe = { class: "flex-mobile gap-1" }, Ze = /* @__PURE__ */ R({
180
+ }), je = /* @__PURE__ */ M(Je, [["__scopeId", "data-v-12153368"]]), We = { class: "swagger-editor-header" }, Ke = { class: "swagger-editor-title" }, qe = { class: "swagger-editor-actions" }, Qe = { key: 0 }, Ge = { key: 0 }, Xe = { class: "swagger-editor-modal-layout" }, Ze = /* @__PURE__ */ R({
185
181
  __name: "SwaggerEditorHeader",
186
182
  props: {
187
183
  proxyUrl: {}
188
184
  },
189
185
  emits: ["import"],
190
186
  setup(r, { expose: e, emit: t }) {
191
- const s = r, i = Fe("(max-width: 1000px)"), { files: a, open: l, reset: u } = $e({
187
+ const s = r, i = Me("(max-width: 1000px)"), { files: a, open: l, reset: h } = $e({
192
188
  multiple: !1,
193
189
  accept: ".json,.yaml,.yml"
194
190
  }), d = me(), c = b(null);
@@ -196,8 +192,8 @@ const Me = (r) => {
196
192
  importUrlModal: d,
197
193
  openFileDialog: l
198
194
  });
199
- const h = b(""), o = () => {
200
- c.value = "", ye(h.value, s.proxyUrl).then(async (n) => {
195
+ const p = b(""), o = () => {
196
+ c.value = "", ye(p.value, s.proxyUrl).then(async (n) => {
201
197
  t("import", n), d.hide();
202
198
  }).catch((n) => {
203
199
  console.error("[importUrl]", n), c.value = n;
@@ -206,75 +202,74 @@ const Me = (r) => {
206
202
  return W(a, () => {
207
203
  var n;
208
204
  if ((n = a.value) != null && n.length) {
209
- const p = a.value[0], m = new FileReader();
210
- m.onload = (w) => {
205
+ const u = a.value[0], m = new FileReader();
206
+ m.onload = (S) => {
211
207
  var k;
212
- const $ = (k = w.target) == null ? void 0 : k.result;
213
- typeof $ == "string" && (t("import", $), u());
214
- }, m.readAsText(p);
208
+ const $ = (k = S.target) == null ? void 0 : k.result;
209
+ typeof $ == "string" && (t("import", $), h());
210
+ }, m.readAsText(u);
215
211
  }
216
- }), (n, p) => (f(), g(P, null, [
217
- v("div", je, [
218
- v("div", We, [
212
+ }), (n, u) => (f(), g(P, null, [
213
+ w("div", We, [
214
+ w("div", Ke, [
219
215
  y(i) ? _("", !0) : (f(), g(P, { key: 0 }, [
220
216
  C("Swagger ")
221
217
  ], 64)),
222
218
  C("Editor ")
223
219
  ]),
224
220
  E(n.$slots, "tab-items", {}, void 0, !0),
225
- v("div", Ke, [
226
- S(X, {
227
- onClick: p[0] || (p[0] = () => y(l)())
221
+ w("div", qe, [
222
+ v(X, {
223
+ onClick: u[0] || (u[0] = () => y(l)())
228
224
  }, {
229
- default: U(() => [
225
+ default: x(() => [
230
226
  C(" Upload"),
231
- y(i) ? _("", !0) : (f(), g("span", qe, " File"))
227
+ y(i) ? _("", !0) : (f(), g("span", Qe, " File"))
232
228
  ]),
233
229
  _: 1
234
230
  }),
235
- S(X, {
236
- onClick: p[1] || (p[1] = (m) => y(d).show())
231
+ v(X, {
232
+ onClick: u[1] || (u[1] = (m) => y(d).show())
237
233
  }, {
238
- default: U(() => [
239
- y(i) ? _("", !0) : (f(), g("span", Qe, "Import ")),
234
+ default: x(() => [
235
+ y(i) ? _("", !0) : (f(), g("span", Ge, "Import ")),
240
236
  C("URL ")
241
237
  ]),
242
238
  _: 1
243
239
  })
244
240
  ])
245
241
  ]),
246
- S(y(ge), {
242
+ v(y(ge), {
247
243
  state: y(d),
248
244
  title: "Import Swagger from URL"
249
245
  }, {
250
- default: U(() => [
251
- v("div", Ge, [
252
- S(Je, {
253
- modelValue: h.value,
254
- "onUpdate:modelValue": p[2] || (p[2] = (m) => h.value = m),
246
+ default: x(() => [
247
+ w("div", Xe, [
248
+ v(je, {
249
+ modelValue: p.value,
250
+ "onUpdate:modelValue": u[2] || (u[2] = (m) => p.value = m),
255
251
  autofocus: "",
252
+ class: "swagger-editor-modal-layout-input",
256
253
  label: "URL",
257
254
  placeholder: "https://scalar.com/swagger.json"
258
255
  }, null, 8, ["modelValue"]),
259
- C(" " + x(c.value) + " ", 1),
260
- v("div", Xe, [
261
- S(te, {
262
- label: "Cancel",
263
- variant: "outlined",
264
- onClick: p[3] || (p[3] = (m) => y(d).hide())
265
- }),
266
- S(te, {
267
- label: "Import",
268
- onClick: o
269
- })
270
- ])
256
+ C(" " + F(c.value) + " ", 1),
257
+ v(te, {
258
+ label: "Cancel",
259
+ variant: "outlined",
260
+ onClick: u[3] || (u[3] = (m) => y(d).hide())
261
+ }),
262
+ v(te, {
263
+ label: "Import",
264
+ onClick: o
265
+ })
271
266
  ])
272
267
  ]),
273
268
  _: 1
274
269
  }, 8, ["state"])
275
270
  ], 64));
276
271
  }
277
- }), He = /* @__PURE__ */ F(Ze, [["__scopeId", "data-v-000eb19c"]]);
272
+ }), He = /* @__PURE__ */ M(Ze, [["__scopeId", "data-v-eef993da"]]);
278
273
  class Q {
279
274
  /**
280
275
  * @param {Y.RelativePosition} yanchor
@@ -297,7 +292,7 @@ class Q {
297
292
  * @return {YRange}
298
293
  */
299
294
  static fromJSON(e) {
300
- return new Q(B(e.yanchor), B(e.yhead));
295
+ return new Q(I(e.yanchor), I(e.yhead));
301
296
  }
302
297
  }
303
298
  class et {
@@ -338,7 +333,7 @@ class et {
338
333
  * @param {Y.RelativePosition | Object} rpos
339
334
  */
340
335
  fromYPos(e) {
341
- const t = J(B(e), this.ytext.doc);
336
+ const t = J(I(e), this.ytext.doc);
342
337
  if (t == null || t.type !== this.ytext)
343
338
  throw new Error("[y-codemirror] The position you want to retrieve was created by a different document");
344
339
  return {
@@ -376,8 +371,8 @@ class tt {
376
371
  if (s.origin !== this.conf) {
377
372
  const i = t.delta, a = [];
378
373
  let l = 0;
379
- for (let u = 0; u < i.length; u++) {
380
- const d = i[u];
374
+ for (let h = 0; h < i.length; h++) {
375
+ const d = i[h];
381
376
  d.insert != null ? a.push({ from: l, to: l, insert: d.insert }) : d.delete != null ? (a.push({ from: l, to: l + d.delete, insert: "" }), l += d.delete) : l += d.retain;
382
377
  }
383
378
  e.dispatch({ changes: a, annotations: [j.of(this.conf)] });
@@ -393,7 +388,7 @@ class tt {
393
388
  const t = this.conf.ytext;
394
389
  t.doc.transact(() => {
395
390
  let s = 0;
396
- e.changes.iterChanges((i, a, l, u, d) => {
391
+ e.changes.iterChanges((i, a, l, h, d) => {
397
392
  const c = d.sliceString(0, d.length, `
398
393
  `);
399
394
  i !== a && t.delete(i + s, a - i), c.length > 0 && t.insert(i + s, c), s += c.length - (a - i);
@@ -472,17 +467,17 @@ class at extends _e {
472
467
  return (
473
468
  /** @type {HTMLElement} */
474
469
  N("span", [D("class", "cm-ySelectionCaret"), D("style", `background-color: ${this.color}; border-color: ${this.color}`)], [
475
- I("⁠"),
470
+ B("⁠"),
476
471
  N("div", [
477
472
  D("class", "cm-ySelectionCaretDot")
478
473
  ]),
479
- I("⁠"),
474
+ B("⁠"),
480
475
  N("div", [
481
476
  D("class", "cm-ySelectionInfo")
482
477
  ], [
483
- I(this.name)
478
+ B(this.name)
484
479
  ]),
485
- I("⁠")
480
+ B("⁠")
486
481
  ])
487
482
  );
488
483
  }
@@ -523,47 +518,47 @@ class rt {
523
518
  t.doc
524
519
  ), i = this.conf.awareness, a = [], l = this.conf.awareness.getLocalState();
525
520
  if (l != null) {
526
- const u = e.view.hasFocus && e.view.dom.ownerDocument.hasFocus(), d = u ? e.state.selection.main : null, c = l.cursor == null ? null : B(l.cursor.anchor), h = l.cursor == null ? null : B(l.cursor.head);
521
+ const h = e.view.hasFocus && e.view.dom.ownerDocument.hasFocus(), d = h ? e.state.selection.main : null, c = l.cursor == null ? null : I(l.cursor.anchor), p = l.cursor == null ? null : I(l.cursor.head);
527
522
  if (d != null) {
528
523
  const o = z(t, d.anchor), n = z(t, d.head);
529
- (l.cursor == null || !ee(c, o) || !ee(h, n)) && i.setLocalStateField("cursor", {
524
+ (l.cursor == null || !ee(c, o) || !ee(p, n)) && i.setLocalStateField("cursor", {
530
525
  anchor: o,
531
526
  head: n
532
527
  });
533
528
  } else
534
- l.cursor != null && u && i.setLocalStateField("cursor", null);
529
+ l.cursor != null && h && i.setLocalStateField("cursor", null);
535
530
  }
536
- i.getStates().forEach((u, d) => {
531
+ i.getStates().forEach((h, d) => {
537
532
  if (d === i.doc.clientID)
538
533
  return;
539
- const c = u.cursor;
534
+ const c = h.cursor;
540
535
  if (c == null || c.anchor == null || c.head == null)
541
536
  return;
542
- const h = J(c.anchor, s), o = J(c.head, s);
543
- if (h == null || o == null || h.type !== t || o.type !== t)
537
+ const p = J(c.anchor, s), o = J(c.head, s);
538
+ if (p == null || o == null || p.type !== t || o.type !== t)
544
539
  return;
545
- const { color: n = "#30bced", name: p = "Anonymous" } = u.user || {}, m = u.user && u.user.colorLight || n + "33", w = we(h.index, o.index), $ = Se(h.index, o.index), k = e.view.state.doc.lineAt(w), L = e.view.state.doc.lineAt($);
540
+ const { color: n = "#30bced", name: u = "Anonymous" } = h.user || {}, m = h.user && h.user.colorLight || n + "33", S = we(p.index, o.index), $ = Se(p.index, o.index), k = e.view.state.doc.lineAt(S), L = e.view.state.doc.lineAt($);
546
541
  if (k.number === L.number)
547
542
  a.push({
548
- from: w,
543
+ from: S,
549
544
  to: $,
550
- value: M.mark({
545
+ value: U.mark({
551
546
  attributes: { style: `background-color: ${m}` },
552
547
  class: "cm-ySelection"
553
548
  })
554
549
  });
555
550
  else {
556
551
  a.push({
557
- from: w,
552
+ from: S,
558
553
  to: k.from + k.length,
559
- value: M.mark({
554
+ value: U.mark({
560
555
  attributes: { style: `background-color: ${m}` },
561
556
  class: "cm-ySelection"
562
557
  })
563
558
  }), a.push({
564
559
  from: L.from,
565
560
  to: $,
566
- value: M.mark({
561
+ value: U.mark({
567
562
  attributes: { style: `background-color: ${m}` },
568
563
  class: "cm-ySelection"
569
564
  })
@@ -573,7 +568,7 @@ class rt {
573
568
  a.push({
574
569
  from: G,
575
570
  to: G,
576
- value: M.line({
571
+ value: U.line({
577
572
  attributes: { style: `background-color: ${m}`, class: "cm-yLineSelection" }
578
573
  })
579
574
  });
@@ -582,14 +577,14 @@ class rt {
582
577
  a.push({
583
578
  from: o.index,
584
579
  to: o.index,
585
- value: M.widget({
586
- side: o.index - h.index > 0 ? -1 : 1,
580
+ value: U.widget({
581
+ side: o.index - p.index > 0 ? -1 : 1,
587
582
  // the local cursor should be rendered outside the remote selection
588
583
  block: !1,
589
- widget: new at(n, p)
584
+ widget: new at(n, u)
590
585
  })
591
586
  });
592
- }), this.decorations = M.set(a, !0);
587
+ }), this.decorations = U.set(a, !0);
593
588
  }
594
589
  }
595
590
  const it = q.fromClass(rt, {
@@ -702,13 +697,13 @@ const ut = q.fromClass(dt), ht = ({ state: r, dispatch: e }) => r.facet(V).undo(
702
697
  const l = b(null);
703
698
  e({
704
699
  setCodeMirrorContent: (c) => {
705
- var h;
706
- (h = u.value) == null || h.setCodeMirrorContent(c);
700
+ var p;
701
+ (p = h.value) == null || p.setCodeMirrorContent(c);
707
702
  }
708
703
  }), W(
709
704
  () => s.hocuspocusConfiguration,
710
- (c, h) => {
711
- if (JSON.stringify(h) === JSON.stringify(c) || (a && (a.destroy(), l.value = null), !s.hocuspocusConfiguration))
705
+ (c, p) => {
706
+ if (JSON.stringify(p) === JSON.stringify(c) || (a && (a.destroy(), l.value = null), !s.hocuspocusConfiguration))
712
707
  return;
713
708
  const { username: o, ...n } = s.hocuspocusConfiguration;
714
709
  a = new be({
@@ -738,11 +733,11 @@ const ut = q.fromClass(dt), ht = ({ state: r, dispatch: e }) => r.facet(V).undo(
738
733
  `[SwaggerEditor] ⚪️ onDisconnect (${n == null ? void 0 : n.name})`
739
734
  );
740
735
  },
741
- onAwarenessUpdate({ states: w }) {
742
- t("awarenessUpdate", w);
736
+ onAwarenessUpdate({ states: S }) {
737
+ t("awarenessUpdate", S);
743
738
  }
744
739
  }), a == null || a.on("authenticated", () => {
745
- const w = i([
740
+ const S = i([
746
741
  "#958DF1",
747
742
  "#F98181",
748
743
  "#FBBC88",
@@ -753,35 +748,35 @@ const ut = q.fromClass(dt), ht = ({ state: r, dispatch: e }) => r.facet(V).undo(
753
748
  ]);
754
749
  a == null || a.setAwarenessField("user", {
755
750
  name: o || "guest",
756
- color: w,
757
- colorLight: w
751
+ color: S,
752
+ colorLight: S
758
753
  });
759
754
  });
760
- const p = a.document.getText("codemirror"), m = new K(p);
755
+ const u = a.document.getText("codemirror"), m = new K(u);
761
756
  l.value = ft(
762
- p,
757
+ u,
763
758
  a.awareness,
764
759
  { undoManager: m }
765
760
  );
766
761
  },
767
762
  { immediate: !0, deep: !0 }
768
763
  );
769
- const u = b(null);
764
+ const h = b(null);
770
765
  function d(c) {
771
- return Me(c) ? ["json"] : ["yaml"];
766
+ return Ue(c) ? ["json"] : ["yaml"];
772
767
  }
773
- return (c, h) => {
768
+ return (c, p) => {
774
769
  var o;
775
770
  return f(), g("div", mt, [
776
- S(y(ke), {
771
+ v(y(ke), {
777
772
  ref_key: "codeMirrorRef",
778
- ref: u,
773
+ ref: h,
779
774
  content: c.value,
780
775
  extensions: l.value ? [l.value] : [],
781
776
  languages: d(c.value),
782
777
  lineNumbers: "",
783
778
  name: (o = c.hocuspocusConfiguration) == null ? void 0 : o.name,
784
- onChange: h[0] || (h[0] = (n) => c.$emit("contentUpdate", n))
779
+ onChange: p[0] || (p[0] = (n) => c.$emit("contentUpdate", n))
785
780
  }, null, 8, ["content", "extensions", "languages", "name"])
786
781
  ]);
787
782
  };
@@ -792,13 +787,13 @@ function wt(r, e) {
792
787
  E(r.$slots, "default")
793
788
  ]);
794
789
  }
795
- const St = /* @__PURE__ */ F(yt, [["render", wt]]), _t = {}, bt = { class: "swagger-editor-status-bar" };
790
+ const St = /* @__PURE__ */ M(yt, [["render", wt]]), _t = {}, bt = { class: "swagger-editor-status-bar" };
796
791
  function kt(r, e) {
797
792
  return f(), g("div", bt, [
798
793
  E(r.$slots, "default")
799
794
  ]);
800
795
  }
801
- const Ct = /* @__PURE__ */ F(_t, [["render", kt]]), xt = { class: "swagger-editor" }, Ft = /* @__PURE__ */ R({
796
+ const Ct = /* @__PURE__ */ M(_t, [["render", kt]]), xt = /* @__PURE__ */ R({
802
797
  __name: "SwaggerEditor",
803
798
  props: {
804
799
  value: {},
@@ -811,7 +806,7 @@ const Ct = /* @__PURE__ */ F(_t, [["render", kt]]), xt = { class: "swagger-edito
811
806
  setup(r, { expose: e, emit: t }) {
812
807
  const s = r, i = b(null), a = b([]), l = (o) => {
813
808
  t("contentUpdate", o);
814
- }, u = (o) => {
809
+ }, h = (o) => {
815
810
  a.value = o;
816
811
  }, d = b(null), c = he(() => {
817
812
  if (s.error === void 0 || s.error === null || s.error === "")
@@ -828,52 +823,60 @@ const Ct = /* @__PURE__ */ F(_t, [["render", kt]]), xt = { class: "swagger-edito
828
823
  { immediate: !0 }
829
824
  ), e({
830
825
  handleOpenSwaggerEditor: (o) => {
831
- var n, p, m;
832
- o === "importUrl" ? (p = (n = i == null ? void 0 : i.value) == null ? void 0 : n.importUrlModal) == null || p.show() : o === "uploadFile" && ((m = i == null ? void 0 : i.value) == null || m.openFileDialog());
826
+ var n, u, m;
827
+ o === "importUrl" ? (u = (n = i == null ? void 0 : i.value) == null ? void 0 : n.importUrlModal) == null || u.show() : o === "uploadFile" && ((m = i == null ? void 0 : i.value) == null || m.openFileDialog());
833
828
  }
834
829
  }), (o, n) => (f(), g(P, null, [
835
- S(y(Ce), { id: o.theme }, null, 8, ["id"]),
836
- v("div", xt, [
837
- S(He, {
838
- ref_key: "swaggerEditorHeaderRef",
839
- ref: i,
840
- proxyUrl: o.proxyUrl,
841
- onImport: l
842
- }, {
843
- "tab-items": U(() => [
844
- E(o.$slots, "tab-items", {}, void 0, !0)
845
- ]),
846
- _: 3
847
- }, 8, ["proxyUrl"]),
848
- c.value ? (f(), A(St, { key: 0 }, {
849
- default: U(() => [
850
- C(x(c.value), 1)
851
- ]),
852
- _: 1
853
- })) : _("", !0),
854
- S(gt, {
855
- ref_key: "codeMirrorReference",
856
- ref: d,
857
- hocuspocusConfiguration: o.hocuspocusConfiguration,
858
- value: o.value,
859
- onAwarenessUpdate: u,
860
- onContentUpdate: l
861
- }, null, 8, ["hocuspocusConfiguration", "value"]),
862
- a.value.length ? (f(), A(Ct, { key: 1 }, {
863
- default: U(() => [
864
- C(x(a.value.length) + " user" + x(a.value.length === 1 ? "" : "s") + " online ", 1)
865
- ]),
866
- _: 1
867
- })) : _("", !0)
868
- ])
830
+ v(y(Ce), { id: o.theme }, null, 8, ["id"]),
831
+ v(xe, null, {
832
+ default: x(({ styles: u }) => [
833
+ w("div", {
834
+ class: T(["swagger-editor", u])
835
+ }, [
836
+ v(He, {
837
+ ref_key: "swaggerEditorHeaderRef",
838
+ ref: i,
839
+ proxyUrl: o.proxyUrl,
840
+ onImport: l
841
+ }, {
842
+ "tab-items": x(() => [
843
+ E(o.$slots, "tab-items", {}, void 0, !0)
844
+ ]),
845
+ _: 3
846
+ }, 8, ["proxyUrl"]),
847
+ c.value ? (f(), A(St, { key: 0 }, {
848
+ default: x(() => [
849
+ C(F(c.value), 1)
850
+ ]),
851
+ _: 1
852
+ })) : _("", !0),
853
+ v(gt, {
854
+ ref_key: "codeMirrorReference",
855
+ ref: d,
856
+ hocuspocusConfiguration: o.hocuspocusConfiguration,
857
+ value: o.value,
858
+ onAwarenessUpdate: h,
859
+ onContentUpdate: l
860
+ }, null, 8, ["hocuspocusConfiguration", "value"]),
861
+ a.value.length ? (f(), A(Ct, { key: 1 }, {
862
+ default: x(() => [
863
+ C(F(a.value.length) + " user" + F(a.value.length === 1 ? "" : "s") + " online ", 1)
864
+ ]),
865
+ _: 1
866
+ })) : _("", !0)
867
+ ], 2)
868
+ ]),
869
+ _: 3
870
+ })
869
871
  ], 64));
870
872
  }
871
- }), qt = /* @__PURE__ */ F(Ft, [["__scopeId", "data-v-16132f63"]]);
873
+ }), Kt = /* @__PURE__ */ M(xt, [["__scopeId", "data-v-a20bb635"]]);
872
874
  export {
873
- qt as CodeEditor,
875
+ Kt as CodeEditor,
874
876
  X as HeaderTabButton,
875
- qt as SwaggerEditor,
877
+ xe as ResetStyles,
878
+ Kt as SwaggerEditor,
876
879
  ye as fetchSpecFromUrl,
877
- Me as isJsonString,
878
- Xt as useDarkModeState
880
+ Ue as isJsonString,
881
+ Gt as useDarkModeState
879
882
  };