@scalar/api-reference 1.18.0 → 1.18.2

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 (51) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist/browser/standalone.js +9 -9
  3. package/dist/browser/webpack-stats.json +1 -1
  4. package/dist/components/ApiReference.vue.d.ts.map +1 -1
  5. package/dist/components/ApiReferenceLayout.vue.d.ts +7 -217
  6. package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
  7. package/dist/components/ClassicHeader.vue.d.ts +1 -0
  8. package/dist/components/ClassicHeader.vue.d.ts.map +1 -1
  9. package/dist/components/Content/Content.vue.d.ts +0 -2
  10. package/dist/components/Content/Content.vue.d.ts.map +1 -1
  11. package/dist/components/Content/Introduction/DownloadSpec.vue.d.ts +1 -14
  12. package/dist/components/Content/Introduction/DownloadSpec.vue.d.ts.map +1 -1
  13. package/dist/components/Content/Introduction/Introduction.vue.d.ts +0 -2
  14. package/dist/components/Content/Introduction/Introduction.vue.d.ts.map +1 -1
  15. package/dist/components/DarkModeToggle/DarkModeIconToggle.vue.d.ts +18 -1
  16. package/dist/components/DarkModeToggle/DarkModeIconToggle.vue.d.ts.map +1 -1
  17. package/dist/components/DarkModeToggle/DarkModeToggle.vue.d.ts +18 -1
  18. package/dist/components/DarkModeToggle/DarkModeToggle.vue.d.ts.map +1 -1
  19. package/dist/components/GettingStarted.vue.d.ts +4 -4
  20. package/dist/components/GettingStarted.vue.d.ts.map +1 -1
  21. package/dist/components/Layouts/BaseLayout.vue.d.ts +6 -2
  22. package/dist/components/Layouts/BaseLayout.vue.d.ts.map +1 -1
  23. package/dist/components/Layouts/ClassicLayout.vue.d.ts +6 -2
  24. package/dist/components/Layouts/ClassicLayout.vue.d.ts.map +1 -1
  25. package/dist/components/Layouts/ModernLayout.vue.d.ts +6 -2
  26. package/dist/components/Layouts/ModernLayout.vue.d.ts.map +1 -1
  27. package/dist/helpers/index.d.ts +1 -0
  28. package/dist/helpers/index.d.ts.map +1 -1
  29. package/dist/helpers/specDownloads.d.ts +6 -0
  30. package/dist/helpers/specDownloads.d.ts.map +1 -0
  31. package/dist/hooks/index.d.ts +1 -2
  32. package/dist/hooks/index.d.ts.map +1 -1
  33. package/dist/hooks/useClipboard.d.ts.map +1 -1
  34. package/dist/hooks/{useParser.d.ts → useReactiveSpec.d.ts} +11 -9
  35. package/dist/hooks/useReactiveSpec.d.ts.map +1 -0
  36. package/dist/hooks/useToasts.d.ts +12 -0
  37. package/dist/hooks/useToasts.d.ts.map +1 -0
  38. package/dist/index.d.ts +1 -1
  39. package/dist/index.d.ts.map +1 -1
  40. package/dist/index.js +46013 -53
  41. package/dist/stores/utility.d.ts.map +1 -1
  42. package/dist/types.d.ts +6 -3
  43. package/dist/types.d.ts.map +1 -1
  44. package/package.json +7 -10
  45. package/dist/components/ApiReferenceBase.vue.d.ts +0 -44
  46. package/dist/components/ApiReferenceBase.vue.d.ts.map +0 -1
  47. package/dist/hooks/useParser.d.ts.map +0 -1
  48. package/dist/hooks/useSpec.d.ts +0 -14
  49. package/dist/hooks/useSpec.d.ts.map +0 -1
  50. package/dist/index-BNQlaahg.js +0 -46881
  51. package/dist/index-CDYgXzd-.js +0 -226
@@ -1,226 +0,0 @@
1
- import { defineComponent as x, ref as k, watch as V, openBlock as m, createElementBlock as f, Fragment as b, createElementVNode as w, unref as o, createTextVNode as c, createCommentVNode as S, renderSlot as $, createVNode as l, withCtx as p, toDisplayString as T, computed as D, isRef as B, normalizeClass as L, createBlock as j } from "vue";
2
- import { b as H, H as I, r as O, l as A, C as N, f as J, _ as E, a as z, $ as Q, T as W } from "./index-BNQlaahg.js";
3
- import { u as _e } from "./index-BNQlaahg.js";
4
- import { useMediaQuery as Y, useFileDialog as q } from "@vueuse/core";
5
- const G = (s) => {
6
- if (typeof s != "string")
7
- return !1;
8
- try {
9
- JSON.parse(s);
10
- } catch {
11
- return !1;
12
- }
13
- return !0;
14
- }, K = { class: "swagger-editor-header" }, P = { class: "swagger-editor-title" }, X = { class: "swagger-editor-actions" }, Z = { key: 0 }, ee = { key: 0 }, te = { class: "swagger-editor-modal-layout" }, re = /* @__PURE__ */ x({
15
- __name: "SwaggerEditorHeader",
16
- props: {
17
- proxyUrl: {}
18
- },
19
- emits: ["import"],
20
- setup(s, { expose: v, emit: U }) {
21
- const r = s, _ = U, a = Y("(max-width: 1000px)"), { files: t, open: n, reset: y } = q({
22
- multiple: !1,
23
- accept: ".json,.yaml,.yml"
24
- }), e = H(), g = k(null);
25
- v({
26
- importUrlModal: e,
27
- openFileDialog: n
28
- });
29
- const u = k(""), C = () => {
30
- g.value = "", J(u.value, r.proxyUrl).then(async (d) => {
31
- _("import", d), e.hide();
32
- }).catch((d) => {
33
- console.error("[importUrl]", d), g.value = d;
34
- });
35
- };
36
- return V(t, () => {
37
- var d;
38
- if ((d = t.value) != null && d.length) {
39
- const i = t.value[0], h = new FileReader();
40
- h.onload = (R) => {
41
- var F;
42
- const M = (F = R.target) == null ? void 0 : F.result;
43
- typeof M == "string" && (_("import", M), y());
44
- }, h.readAsText(i);
45
- }
46
- }), (d, i) => (m(), f(b, null, [
47
- w("div", K, [
48
- w("div", P, [
49
- o(a) ? S("", !0) : (m(), f(b, { key: 0 }, [
50
- c("Swagger ")
51
- ], 64)),
52
- c("Editor ")
53
- ]),
54
- $(d.$slots, "tab-items", {}, void 0, !0),
55
- w("div", X, [
56
- l(I, {
57
- onClick: i[0] || (i[0] = () => o(n)())
58
- }, {
59
- default: p(() => [
60
- c(" Upload"),
61
- o(a) ? S("", !0) : (m(), f("span", Z, " File"))
62
- ]),
63
- _: 1
64
- }),
65
- l(I, {
66
- onClick: i[1] || (i[1] = (h) => o(e).show())
67
- }, {
68
- default: p(() => [
69
- o(a) ? S("", !0) : (m(), f("span", ee, "Import ")),
70
- c("URL ")
71
- ]),
72
- _: 1
73
- })
74
- ])
75
- ]),
76
- l(o(O), {
77
- state: o(e),
78
- title: "Import Swagger from URL"
79
- }, {
80
- default: p(() => [
81
- w("div", te, [
82
- l(o(A), {
83
- modelValue: u.value,
84
- "onUpdate:modelValue": i[2] || (i[2] = (h) => u.value = h),
85
- autofocus: "",
86
- class: "swagger-editor-modal-layout-input",
87
- label: "URL",
88
- labelShadowColor: "var(--theme-background-1, var(--default-theme-background-1))",
89
- placeholder: "https://scalar.com/swagger.json"
90
- }, null, 8, ["modelValue"]),
91
- c(" " + T(g.value) + " ", 1),
92
- l(o(N), {
93
- variant: "outlined",
94
- onClick: i[3] || (i[3] = (h) => o(e).hide())
95
- }, {
96
- default: p(() => [
97
- c(" Cancel ")
98
- ]),
99
- _: 1
100
- }),
101
- l(o(N), { onClick: C }, {
102
- default: p(() => [
103
- c("Import")
104
- ]),
105
- _: 1
106
- })
107
- ])
108
- ]),
109
- _: 1
110
- }, 8, ["state"])
111
- ], 64));
112
- }
113
- }), oe = /* @__PURE__ */ E(re, [["__scopeId", "data-v-17d421af"]]), ae = { class: "swagger-editor-input" }, ne = /* @__PURE__ */ x({
114
- __name: "SwaggerEditorInput",
115
- props: {
116
- value: {}
117
- },
118
- emits: ["contentUpdate"],
119
- setup(s, { expose: v }) {
120
- const U = s;
121
- v({
122
- setCodeMirrorContent: (t) => {
123
- var n;
124
- (n = r.value) == null || n.setCodeMirrorContent(t);
125
- }
126
- });
127
- const r = k(null);
128
- function _(t) {
129
- return G(t) ? "json" : "yaml";
130
- }
131
- const a = D(() => _(U.value));
132
- return (t, n) => (m(), f("div", ae, [
133
- l(o(z), {
134
- ref_key: "codeMirrorRef",
135
- ref: r,
136
- content: t.value,
137
- language: a.value,
138
- lineNumbers: "",
139
- onChange: n[0] || (n[0] = (y) => t.$emit("contentUpdate", y))
140
- }, null, 8, ["content", "language"])
141
- ]));
142
- }
143
- }), le = {}, se = { class: "swagger-editor-notification swagger-editor-notification--error" };
144
- function ie(s, v) {
145
- return m(), f("div", se, [
146
- $(s.$slots, "default")
147
- ]);
148
- }
149
- const de = /* @__PURE__ */ E(le, [["render", ie]]), ue = /* @__PURE__ */ x({
150
- __name: "SwaggerEditor",
151
- props: {
152
- value: {},
153
- theme: {},
154
- proxyUrl: {},
155
- error: {}
156
- },
157
- emits: ["contentUpdate", "import", "changeTheme"],
158
- setup(s, { expose: v, emit: U }) {
159
- const r = s, _ = U, a = k(null), t = (e) => {
160
- _("contentUpdate", e);
161
- }, n = D(() => {
162
- if (r.error === void 0 || r.error === null || r.error === "")
163
- return "";
164
- const e = B(r.error) ? r.error.value : r.error;
165
- return e.startsWith("YAMLException:") ? e.split(`
166
- `)[0] : e;
167
- });
168
- return V(
169
- () => r.value,
170
- async () => {
171
- r.value && t(r.value);
172
- },
173
- { immediate: !0 }
174
- ), v({
175
- handleOpenSwaggerEditor: (e) => {
176
- var g, u, C;
177
- e === "importUrl" ? (u = (g = a == null ? void 0 : a.value) == null ? void 0 : g.importUrlModal) == null || u.show() : e === "uploadFile" && ((C = a == null ? void 0 : a.value) == null || C.openFileDialog());
178
- }
179
- }), (e, g) => (m(), f(b, null, [
180
- l(o(Q), { id: e.theme }, null, 8, ["id"]),
181
- l(o(W), null, {
182
- default: p(({ styles: u }) => [
183
- w("div", {
184
- class: L(["swagger-editor", u])
185
- }, [
186
- l(oe, {
187
- ref_key: "swaggerEditorHeaderRef",
188
- ref: a,
189
- proxyUrl: e.proxyUrl,
190
- onImport: t
191
- }, {
192
- "tab-items": p(() => [
193
- $(e.$slots, "tab-items", {}, void 0, !0)
194
- ]),
195
- _: 3
196
- }, 8, ["proxyUrl"]),
197
- n.value ? (m(), j(de, { key: 0 }, {
198
- default: p(() => [
199
- c(T(n.value), 1)
200
- ]),
201
- _: 1
202
- })) : S("", !0),
203
- $(e.$slots, "editor-input", {
204
- value: e.value,
205
- onContentUpdate: t
206
- }, () => [
207
- l(ne, {
208
- value: e.value,
209
- onContentUpdate: t
210
- }, null, 8, ["value"])
211
- ], !0)
212
- ], 2)
213
- ]),
214
- _: 3
215
- })
216
- ], 64));
217
- }
218
- }), ge = /* @__PURE__ */ E(ue, [["__scopeId", "data-v-9f3238b6"]]);
219
- export {
220
- ge as CodeEditor,
221
- I as HeaderTabButton,
222
- ge as SwaggerEditor,
223
- J as fetchSpecFromUrl,
224
- G as isJsonString,
225
- _e as useDarkModeState
226
- };