@scalar/api-reference 1.17.16 → 1.18.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.
- package/CHANGELOG.md +26 -0
- package/dist/browser/standalone.js +9 -9
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/ApiReferenceBase.vue.d.ts.map +1 -1
- package/dist/{index-DORwt0-2.js → index-C4WTVJcm.js} +62 -63
- package/dist/{index-DB9G8SWm.js → index-CEds7ERk.js} +6706 -6578
- package/dist/index.js +7 -7
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiReferenceBase.vue.d.ts","sourceRoot":"","sources":["../../src/components/ApiReferenceBase.vue.ts"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"ApiReferenceBase.vue.d.ts","sourceRoot":"","sources":["../../src/components/ApiReferenceBase.vue.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,uBAAuB,EAC7B,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAGL,KAAK,OAAO,EAEb,MAAM,gBAAgB,CAAA;AASvB,OAAO,EAIL,KAAK,cAAc,EACnB,KAAK,kBAAkB,EAExB,MAAM,UAAU,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;AA6ajB,wBAAwG;AACxG,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AACjE,KAAK,6BAA6B,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CAAE,CAAC;AAC9M,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAAE,QAAO;QAClD,MAAM,EAAE,CAAC,CAAC;KACT,CAAA;CAAE,CAAC"}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { b as H, H as I, r as O, l as A, C as N, f as J, _ as
|
|
3
|
-
import { u as _e } from "./index-
|
|
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-CEds7ERk.js";
|
|
3
|
+
import { u as _e } from "./index-CEds7ERk.js";
|
|
4
4
|
import { useMediaQuery as Y, useFileDialog as q } from "@vueuse/core";
|
|
5
|
-
const G = (
|
|
6
|
-
if (typeof
|
|
5
|
+
const G = (s) => {
|
|
6
|
+
if (typeof s != "string")
|
|
7
7
|
return !1;
|
|
8
8
|
try {
|
|
9
|
-
JSON.parse(
|
|
9
|
+
JSON.parse(s);
|
|
10
10
|
} catch {
|
|
11
11
|
return !1;
|
|
12
12
|
}
|
|
13
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__ */
|
|
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
15
|
__name: "SwaggerEditorHeader",
|
|
16
16
|
props: {
|
|
17
17
|
proxyUrl: {}
|
|
18
18
|
},
|
|
19
19
|
emits: ["import"],
|
|
20
|
-
setup(
|
|
21
|
-
const r =
|
|
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
22
|
multiple: !1,
|
|
23
23
|
accept: ".json,.yaml,.yml"
|
|
24
24
|
}), e = H(), g = k(null);
|
|
@@ -33,53 +33,53 @@ const G = (l) => {
|
|
|
33
33
|
console.error("[importUrl]", d), g.value = d;
|
|
34
34
|
});
|
|
35
35
|
};
|
|
36
|
-
return
|
|
36
|
+
return V(t, () => {
|
|
37
37
|
var d;
|
|
38
38
|
if ((d = t.value) != null && d.length) {
|
|
39
39
|
const i = t.value[0], h = new FileReader();
|
|
40
|
-
h.onload = (
|
|
40
|
+
h.onload = (R) => {
|
|
41
41
|
var F;
|
|
42
|
-
const M = (F =
|
|
43
|
-
typeof M == "string" && (_("import", M),
|
|
42
|
+
const M = (F = R.target) == null ? void 0 : F.result;
|
|
43
|
+
typeof M == "string" && (_("import", M), y());
|
|
44
44
|
}, h.readAsText(i);
|
|
45
45
|
}
|
|
46
|
-
}), (d, i) => (m(), f(
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
a
|
|
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
50
|
c("Swagger ")
|
|
51
51
|
], 64)),
|
|
52
52
|
c("Editor ")
|
|
53
53
|
]),
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
onClick: i[0] || (i[0] = () =>
|
|
54
|
+
$(d.$slots, "tab-items", {}, void 0, !0),
|
|
55
|
+
w("div", X, [
|
|
56
|
+
l(I, {
|
|
57
|
+
onClick: i[0] || (i[0] = () => o(n)())
|
|
58
58
|
}, {
|
|
59
59
|
default: p(() => [
|
|
60
60
|
c(" Upload"),
|
|
61
|
-
a
|
|
61
|
+
o(a) ? S("", !0) : (m(), f("span", Z, " File"))
|
|
62
62
|
]),
|
|
63
63
|
_: 1
|
|
64
64
|
}),
|
|
65
|
-
|
|
66
|
-
onClick: i[1] || (i[1] = (h) =>
|
|
65
|
+
l(I, {
|
|
66
|
+
onClick: i[1] || (i[1] = (h) => o(e).show())
|
|
67
67
|
}, {
|
|
68
68
|
default: p(() => [
|
|
69
|
-
a
|
|
69
|
+
o(a) ? S("", !0) : (m(), f("span", ee, "Import ")),
|
|
70
70
|
c("URL ")
|
|
71
71
|
]),
|
|
72
72
|
_: 1
|
|
73
73
|
})
|
|
74
74
|
])
|
|
75
75
|
]),
|
|
76
|
-
|
|
77
|
-
state:
|
|
76
|
+
l(o(O), {
|
|
77
|
+
state: o(e),
|
|
78
78
|
title: "Import Swagger from URL"
|
|
79
79
|
}, {
|
|
80
80
|
default: p(() => [
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
w("div", te, [
|
|
82
|
+
l(o(A), {
|
|
83
83
|
modelValue: u.value,
|
|
84
84
|
"onUpdate:modelValue": i[2] || (i[2] = (h) => u.value = h),
|
|
85
85
|
autofocus: "",
|
|
@@ -88,17 +88,17 @@ const G = (l) => {
|
|
|
88
88
|
labelShadowColor: "var(--theme-background-1, var(--default-theme-background-1))",
|
|
89
89
|
placeholder: "https://scalar.com/swagger.json"
|
|
90
90
|
}, null, 8, ["modelValue"]),
|
|
91
|
-
c(" " +
|
|
92
|
-
|
|
91
|
+
c(" " + T(g.value) + " ", 1),
|
|
92
|
+
l(o(N), {
|
|
93
93
|
variant: "outlined",
|
|
94
|
-
onClick: i[3] || (i[3] = (h) =>
|
|
94
|
+
onClick: i[3] || (i[3] = (h) => o(e).hide())
|
|
95
95
|
}, {
|
|
96
96
|
default: p(() => [
|
|
97
97
|
c(" Cancel ")
|
|
98
98
|
]),
|
|
99
99
|
_: 1
|
|
100
100
|
}),
|
|
101
|
-
|
|
101
|
+
l(o(N), { onClick: C }, {
|
|
102
102
|
default: p(() => [
|
|
103
103
|
c("Import")
|
|
104
104
|
]),
|
|
@@ -110,14 +110,14 @@ const G = (l) => {
|
|
|
110
110
|
}, 8, ["state"])
|
|
111
111
|
], 64));
|
|
112
112
|
}
|
|
113
|
-
}), oe = /* @__PURE__ */
|
|
113
|
+
}), oe = /* @__PURE__ */ E(re, [["__scopeId", "data-v-17d421af"]]), ae = { class: "swagger-editor-input" }, ne = /* @__PURE__ */ x({
|
|
114
114
|
__name: "SwaggerEditorInput",
|
|
115
115
|
props: {
|
|
116
116
|
value: {}
|
|
117
117
|
},
|
|
118
118
|
emits: ["contentUpdate"],
|
|
119
|
-
setup(
|
|
120
|
-
const
|
|
119
|
+
setup(s, { expose: v }) {
|
|
120
|
+
const U = s;
|
|
121
121
|
v({
|
|
122
122
|
setCodeMirrorContent: (t) => {
|
|
123
123
|
var n;
|
|
@@ -128,25 +128,25 @@ const G = (l) => {
|
|
|
128
128
|
function _(t) {
|
|
129
129
|
return G(t) ? "json" : "yaml";
|
|
130
130
|
}
|
|
131
|
-
const
|
|
131
|
+
const a = D(() => _(U.value));
|
|
132
132
|
return (t, n) => (m(), f("div", ae, [
|
|
133
|
-
|
|
133
|
+
l(o(z), {
|
|
134
134
|
ref_key: "codeMirrorRef",
|
|
135
135
|
ref: r,
|
|
136
136
|
content: t.value,
|
|
137
|
-
language:
|
|
137
|
+
language: a.value,
|
|
138
138
|
lineNumbers: "",
|
|
139
|
-
onChange: n[0] || (n[0] = (
|
|
139
|
+
onChange: n[0] || (n[0] = (y) => t.$emit("contentUpdate", y))
|
|
140
140
|
}, null, 8, ["content", "language"])
|
|
141
141
|
]));
|
|
142
142
|
}
|
|
143
|
-
}),
|
|
144
|
-
function ie(
|
|
145
|
-
return m(), f("div",
|
|
146
|
-
|
|
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
147
|
]);
|
|
148
148
|
}
|
|
149
|
-
const de = /* @__PURE__ */
|
|
149
|
+
const de = /* @__PURE__ */ E(le, [["render", ie]]), ue = /* @__PURE__ */ x({
|
|
150
150
|
__name: "SwaggerEditor",
|
|
151
151
|
props: {
|
|
152
152
|
value: {},
|
|
@@ -155,17 +155,17 @@ const de = /* @__PURE__ */ $(se, [["render", ie]]), ue = /* @__PURE__ */ b({
|
|
|
155
155
|
error: {}
|
|
156
156
|
},
|
|
157
157
|
emits: ["contentUpdate", "import", "changeTheme"],
|
|
158
|
-
setup(
|
|
159
|
-
const r =
|
|
158
|
+
setup(s, { expose: v, emit: U }) {
|
|
159
|
+
const r = s, _ = U, a = k(null), t = (e) => {
|
|
160
160
|
_("contentUpdate", e);
|
|
161
161
|
}, n = D(() => {
|
|
162
162
|
if (r.error === void 0 || r.error === null || r.error === "")
|
|
163
163
|
return "";
|
|
164
|
-
const e =
|
|
164
|
+
const e = B(r.error) ? r.error.value : r.error;
|
|
165
165
|
return e.startsWith("YAMLException:") ? e.split(`
|
|
166
166
|
`)[0] : e;
|
|
167
167
|
});
|
|
168
|
-
return
|
|
168
|
+
return V(
|
|
169
169
|
() => r.value,
|
|
170
170
|
async () => {
|
|
171
171
|
r.value && t(r.value);
|
|
@@ -174,37 +174,37 @@ const de = /* @__PURE__ */ $(se, [["render", ie]]), ue = /* @__PURE__ */ b({
|
|
|
174
174
|
), v({
|
|
175
175
|
handleOpenSwaggerEditor: (e) => {
|
|
176
176
|
var g, u, C;
|
|
177
|
-
e === "importUrl" ? (u = (g =
|
|
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
178
|
}
|
|
179
|
-
}), (e, g) => (m(), f(
|
|
180
|
-
|
|
181
|
-
|
|
179
|
+
}), (e, g) => (m(), f(b, null, [
|
|
180
|
+
l(o(Q), { id: e.theme }, null, 8, ["id"]),
|
|
181
|
+
l(o(W), null, {
|
|
182
182
|
default: p(({ styles: u }) => [
|
|
183
|
-
|
|
184
|
-
class:
|
|
183
|
+
w("div", {
|
|
184
|
+
class: L(["swagger-editor", u])
|
|
185
185
|
}, [
|
|
186
|
-
|
|
186
|
+
l(oe, {
|
|
187
187
|
ref_key: "swaggerEditorHeaderRef",
|
|
188
|
-
ref:
|
|
188
|
+
ref: a,
|
|
189
189
|
proxyUrl: e.proxyUrl,
|
|
190
190
|
onImport: t
|
|
191
191
|
}, {
|
|
192
192
|
"tab-items": p(() => [
|
|
193
|
-
|
|
193
|
+
$(e.$slots, "tab-items", {}, void 0, !0)
|
|
194
194
|
]),
|
|
195
195
|
_: 3
|
|
196
196
|
}, 8, ["proxyUrl"]),
|
|
197
197
|
n.value ? (m(), j(de, { key: 0 }, {
|
|
198
198
|
default: p(() => [
|
|
199
|
-
c(
|
|
199
|
+
c(T(n.value), 1)
|
|
200
200
|
]),
|
|
201
201
|
_: 1
|
|
202
202
|
})) : S("", !0),
|
|
203
|
-
|
|
203
|
+
$(e.$slots, "editor-input", {
|
|
204
204
|
value: e.value,
|
|
205
205
|
onContentUpdate: t
|
|
206
206
|
}, () => [
|
|
207
|
-
|
|
207
|
+
l(ne, {
|
|
208
208
|
value: e.value,
|
|
209
209
|
onContentUpdate: t
|
|
210
210
|
}, null, 8, ["value"])
|
|
@@ -215,11 +215,10 @@ const de = /* @__PURE__ */ $(se, [["render", ie]]), ue = /* @__PURE__ */ b({
|
|
|
215
215
|
})
|
|
216
216
|
], 64));
|
|
217
217
|
}
|
|
218
|
-
}), ge = /* @__PURE__ */
|
|
218
|
+
}), ge = /* @__PURE__ */ E(ue, [["__scopeId", "data-v-9f3238b6"]]);
|
|
219
219
|
export {
|
|
220
220
|
ge as CodeEditor,
|
|
221
221
|
I as HeaderTabButton,
|
|
222
|
-
W as ResetStyles,
|
|
223
222
|
ge as SwaggerEditor,
|
|
224
223
|
J as fetchSpecFromUrl,
|
|
225
224
|
G as isJsonString,
|