@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.
- package/CHANGELOG.md +36 -0
- package/dist/browser/standalone.js +7 -7
- package/dist/components/Anchor/Anchor.vue.d.ts.map +1 -1
- package/dist/components/ApiClientModal.vue.d.ts +2 -0
- package/dist/components/ApiClientModal.vue.d.ts.map +1 -1
- package/dist/components/ApiReference.vue.d.ts.map +1 -1
- package/dist/components/ApiReferenceBase.vue.d.ts.map +1 -1
- package/dist/components/ApiReferenceLayout.vue.d.ts +2 -2
- package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
- package/dist/components/Badge/Badge.stories.d.ts +8 -0
- package/dist/components/Badge/Badge.stories.d.ts.map +1 -0
- package/dist/components/Badge/Badge.vue.d.ts +10 -0
- package/dist/components/Badge/Badge.vue.d.ts.map +1 -0
- package/dist/components/Badge/index.d.ts +2 -0
- package/dist/components/Badge/index.d.ts.map +1 -0
- package/dist/components/Content/Content.vue.d.ts +2 -2
- package/dist/components/Content/Content.vue.d.ts.map +1 -1
- package/dist/components/Content/Introduction/DownloadSpec.vue.d.ts.map +1 -1
- package/dist/components/Content/Introduction/Introduction.vue.d.ts.map +1 -1
- package/dist/components/Content/MarkdownRenderer.vue.d.ts.map +1 -1
- package/dist/components/Content/ReferenceEndpoint/{Copy.vue.d.ts → EndpointDetails.vue.d.ts} +1 -1
- package/dist/components/Content/ReferenceEndpoint/EndpointDetails.vue.d.ts.map +1 -0
- package/dist/components/Content/ReferenceEndpoint/EndpointDetailsCard.vue.d.ts +17 -0
- package/dist/components/Content/ReferenceEndpoint/EndpointDetailsCard.vue.d.ts.map +1 -0
- package/dist/components/Content/ReferenceEndpoint/ExampleRequest.vue.d.ts.map +1 -1
- package/dist/components/Content/ReferenceEndpoint/Parameters.vue.d.ts +9 -4
- package/dist/components/Content/ReferenceEndpoint/Parameters.vue.d.ts.map +1 -1
- package/dist/components/Content/ReferenceEndpoint/ReferenceEndpoint.vue.d.ts.map +1 -1
- package/dist/components/Content/ReferenceEndpoint/ReferenceEndpointAccordion.vue.d.ts +19 -0
- package/dist/components/Content/ReferenceEndpoint/ReferenceEndpointAccordion.vue.d.ts.map +1 -0
- package/dist/components/Content/ReferenceEndpoint/RequestBody.vue.d.ts +9 -2
- package/dist/components/Content/ReferenceEndpoint/RequestBody.vue.d.ts.map +1 -1
- package/dist/components/Content/ReferenceTag.vue.d.ts +28 -0
- package/dist/components/Content/ReferenceTag.vue.d.ts.map +1 -0
- package/dist/components/Content/ReferenceTagAccordion.vue.d.ts +28 -0
- package/dist/components/Content/ReferenceTagAccordion.vue.d.ts.map +1 -0
- package/dist/components/Content/Schema.stories.d.ts.map +1 -1
- package/dist/components/Content/SchemaProperty.vue.d.ts.map +1 -1
- package/dist/components/Content/ShowMoreButton.vue.d.ts.map +1 -1
- package/dist/components/DarkModeIconToggle.vue.d.ts.map +1 -1
- package/dist/components/FlowButton.vue.d.ts.map +1 -1
- package/dist/components/GettingStarted.vue.d.ts.map +1 -1
- package/dist/components/Layouts/BaseLayout.vue.d.ts +18 -0
- package/dist/components/Layouts/BaseLayout.vue.d.ts.map +1 -0
- package/dist/components/Layouts/index.d.ts +4 -3
- package/dist/components/Layouts/index.d.ts.map +1 -1
- package/dist/components/ScreenReader.vue.d.ts +37 -0
- package/dist/components/ScreenReader.vue.d.ts.map +1 -0
- package/dist/components/Section/SectionAccordion.vue.d.ts +25 -0
- package/dist/components/{Content/ReferenceEndpoint/Copy.vue.d.ts.map → Section/SectionAccordion.vue.d.ts.map} +1 -1
- package/dist/components/Section/SectionContainer.vue.d.ts.map +1 -1
- package/dist/components/Section/SectionContainerAccordion.vue.d.ts +11 -0
- package/dist/components/Section/SectionContainerAccordion.vue.d.ts.map +1 -0
- package/dist/components/Section/index.d.ts +2 -0
- package/dist/components/Section/index.d.ts.map +1 -1
- package/dist/components/Sidebar.vue.d.ts.map +1 -1
- package/dist/components/SidebarElement.vue.d.ts +2 -0
- package/dist/components/SidebarElement.vue.d.ts.map +1 -1
- package/dist/helpers/getApiClientRequest.d.ts.map +1 -1
- package/dist/helpers/getExampleFromSchema.d.ts.map +1 -1
- package/dist/helpers/getParametersFromOperation.d.ts +13 -0
- package/dist/helpers/getParametersFromOperation.d.ts.map +1 -0
- package/dist/helpers/getRequestFromOperation.d.ts.map +1 -1
- package/dist/helpers/index.d.ts +2 -1
- package/dist/helpers/index.d.ts.map +1 -1
- package/dist/helpers/openClientFor.d.ts +3 -0
- package/dist/helpers/openClientFor.d.ts.map +1 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/useNavigation.d.ts +1 -0
- package/dist/hooks/useNavigation.d.ts.map +1 -1
- package/dist/hooks/useParser.d.ts +24 -9
- package/dist/hooks/useParser.d.ts.map +1 -1
- package/dist/hooks/useResponses.d.ts +11 -0
- package/dist/hooks/useResponses.d.ts.map +1 -0
- package/dist/{index-1820592b.js → index-0548261f.js} +10909 -10548
- package/dist/{index-06c444c3.js → index-99107dc9.js} +173 -170
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +20 -14
- package/dist/types.d.ts +15 -7
- package/dist/types.d.ts.map +1 -1
- package/package.json +5 -5
- package/dist/helpers/showItemInClient.d.ts +0 -3
- 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
|
|
2
|
-
import { _ as
|
|
3
|
-
import {
|
|
4
|
-
import { useTextareaAutosize as
|
|
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
|
|
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
|
-
},
|
|
32
|
+
}, Re = {
|
|
33
33
|
key: 0,
|
|
34
34
|
class: "loader-wrapper"
|
|
35
|
-
},
|
|
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
|
-
},
|
|
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",
|
|
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
|
-
|
|
58
|
-
e.loaderState.isLoading ? (f(), g("g",
|
|
59
|
-
|
|
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__ */
|
|
73
|
+
}), Be = /* @__PURE__ */ M(Ie, [["__scopeId", "data-v-f02d7027"]]), De = ["title"], Ae = {
|
|
74
74
|
key: 0,
|
|
75
75
|
class: "flow-button-decorator"
|
|
76
|
-
},
|
|
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",
|
|
96
|
+
e.$slots.default ? (f(), g("div", Ae, [
|
|
99
97
|
E(e.$slots, "default", {}, void 0, !0)
|
|
100
98
|
])) : _("", !0),
|
|
101
|
-
|
|
102
|
-
|
|
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,
|
|
106
|
+
], 10, De));
|
|
111
107
|
}
|
|
112
|
-
}), te = /* @__PURE__ */
|
|
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
|
-
},
|
|
115
|
-
...
|
|
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
|
|
128
|
+
let h;
|
|
133
129
|
if (t.isMultiline) {
|
|
134
|
-
const { triggerResize: o } =
|
|
130
|
+
const { triggerResize: o } = Fe({
|
|
135
131
|
element: a,
|
|
136
132
|
input: t.modelValue
|
|
137
133
|
});
|
|
138
|
-
|
|
134
|
+
h = o;
|
|
139
135
|
}
|
|
140
136
|
function d(o) {
|
|
141
137
|
const n = o.target.value;
|
|
142
|
-
t.isMultiline &&
|
|
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,
|
|
146
|
-
t.handleFieldSubmit ? t.handleFieldSubmit(
|
|
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
|
|
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",
|
|
155
|
-
|
|
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:
|
|
168
|
-
onFocus: n[0] || (n[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
|
-
},
|
|
177
|
-
|
|
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
|
-
|
|
177
|
+
w("span", Pe, F(o.helperText), 1)
|
|
182
178
|
]));
|
|
183
179
|
}
|
|
184
|
-
}),
|
|
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 =
|
|
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
|
|
200
|
-
c.value = "", ye(
|
|
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
|
|
210
|
-
m.onload = (
|
|
205
|
+
const u = a.value[0], m = new FileReader();
|
|
206
|
+
m.onload = (S) => {
|
|
211
207
|
var k;
|
|
212
|
-
const $ = (k =
|
|
213
|
-
typeof $ == "string" && (t("import", $),
|
|
214
|
-
}, m.readAsText(
|
|
208
|
+
const $ = (k = S.target) == null ? void 0 : k.result;
|
|
209
|
+
typeof $ == "string" && (t("import", $), h());
|
|
210
|
+
}, m.readAsText(u);
|
|
215
211
|
}
|
|
216
|
-
}), (n,
|
|
217
|
-
|
|
218
|
-
|
|
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
|
-
|
|
226
|
-
|
|
227
|
-
onClick:
|
|
221
|
+
w("div", qe, [
|
|
222
|
+
v(X, {
|
|
223
|
+
onClick: u[0] || (u[0] = () => y(l)())
|
|
228
224
|
}, {
|
|
229
|
-
default:
|
|
225
|
+
default: x(() => [
|
|
230
226
|
C(" Upload"),
|
|
231
|
-
y(i) ? _("", !0) : (f(), g("span",
|
|
227
|
+
y(i) ? _("", !0) : (f(), g("span", Qe, " File"))
|
|
232
228
|
]),
|
|
233
229
|
_: 1
|
|
234
230
|
}),
|
|
235
|
-
|
|
236
|
-
onClick:
|
|
231
|
+
v(X, {
|
|
232
|
+
onClick: u[1] || (u[1] = (m) => y(d).show())
|
|
237
233
|
}, {
|
|
238
|
-
default:
|
|
239
|
-
y(i) ? _("", !0) : (f(), g("span",
|
|
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
|
-
|
|
242
|
+
v(y(ge), {
|
|
247
243
|
state: y(d),
|
|
248
244
|
title: "Import Swagger from URL"
|
|
249
245
|
}, {
|
|
250
|
-
default:
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
modelValue:
|
|
254
|
-
"onUpdate:modelValue":
|
|
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(" " +
|
|
260
|
-
v(
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
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__ */
|
|
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(
|
|
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(
|
|
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
|
|
380
|
-
const d = i[
|
|
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,
|
|
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
|
-
|
|
470
|
+
B(""),
|
|
476
471
|
N("div", [
|
|
477
472
|
D("class", "cm-ySelectionCaretDot")
|
|
478
473
|
]),
|
|
479
|
-
|
|
474
|
+
B(""),
|
|
480
475
|
N("div", [
|
|
481
476
|
D("class", "cm-ySelectionInfo")
|
|
482
477
|
], [
|
|
483
|
-
|
|
478
|
+
B(this.name)
|
|
484
479
|
]),
|
|
485
|
-
|
|
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
|
|
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(
|
|
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 &&
|
|
529
|
+
l.cursor != null && h && i.setLocalStateField("cursor", null);
|
|
535
530
|
}
|
|
536
|
-
i.getStates().forEach((
|
|
531
|
+
i.getStates().forEach((h, d) => {
|
|
537
532
|
if (d === i.doc.clientID)
|
|
538
533
|
return;
|
|
539
|
-
const c =
|
|
534
|
+
const c = h.cursor;
|
|
540
535
|
if (c == null || c.anchor == null || c.head == null)
|
|
541
536
|
return;
|
|
542
|
-
const
|
|
543
|
-
if (
|
|
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:
|
|
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:
|
|
543
|
+
from: S,
|
|
549
544
|
to: $,
|
|
550
|
-
value:
|
|
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:
|
|
552
|
+
from: S,
|
|
558
553
|
to: k.from + k.length,
|
|
559
|
-
value:
|
|
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:
|
|
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:
|
|
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:
|
|
586
|
-
side: o.index -
|
|
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,
|
|
584
|
+
widget: new at(n, u)
|
|
590
585
|
})
|
|
591
586
|
});
|
|
592
|
-
}), this.decorations =
|
|
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
|
|
706
|
-
(
|
|
700
|
+
var p;
|
|
701
|
+
(p = h.value) == null || p.setCodeMirrorContent(c);
|
|
707
702
|
}
|
|
708
703
|
}), W(
|
|
709
704
|
() => s.hocuspocusConfiguration,
|
|
710
|
-
(c,
|
|
711
|
-
if (JSON.stringify(
|
|
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:
|
|
742
|
-
t("awarenessUpdate",
|
|
736
|
+
onAwarenessUpdate({ states: S }) {
|
|
737
|
+
t("awarenessUpdate", S);
|
|
743
738
|
}
|
|
744
739
|
}), a == null || a.on("authenticated", () => {
|
|
745
|
-
const
|
|
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:
|
|
757
|
-
colorLight:
|
|
751
|
+
color: S,
|
|
752
|
+
colorLight: S
|
|
758
753
|
});
|
|
759
754
|
});
|
|
760
|
-
const
|
|
755
|
+
const u = a.document.getText("codemirror"), m = new K(u);
|
|
761
756
|
l.value = ft(
|
|
762
|
-
|
|
757
|
+
u,
|
|
763
758
|
a.awareness,
|
|
764
759
|
{ undoManager: m }
|
|
765
760
|
);
|
|
766
761
|
},
|
|
767
762
|
{ immediate: !0, deep: !0 }
|
|
768
763
|
);
|
|
769
|
-
const
|
|
764
|
+
const h = b(null);
|
|
770
765
|
function d(c) {
|
|
771
|
-
return
|
|
766
|
+
return Ue(c) ? ["json"] : ["yaml"];
|
|
772
767
|
}
|
|
773
|
-
return (c,
|
|
768
|
+
return (c, p) => {
|
|
774
769
|
var o;
|
|
775
770
|
return f(), g("div", mt, [
|
|
776
|
-
|
|
771
|
+
v(y(ke), {
|
|
777
772
|
ref_key: "codeMirrorRef",
|
|
778
|
-
ref:
|
|
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:
|
|
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__ */
|
|
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__ */
|
|
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
|
-
},
|
|
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,
|
|
832
|
-
o === "importUrl" ? (
|
|
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
|
-
|
|
836
|
-
v(
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
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
|
-
}),
|
|
873
|
+
}), Kt = /* @__PURE__ */ M(xt, [["__scopeId", "data-v-a20bb635"]]);
|
|
872
874
|
export {
|
|
873
|
-
|
|
875
|
+
Kt as CodeEditor,
|
|
874
876
|
X as HeaderTabButton,
|
|
875
|
-
|
|
877
|
+
xe as ResetStyles,
|
|
878
|
+
Kt as SwaggerEditor,
|
|
876
879
|
ye as fetchSpecFromUrl,
|
|
877
|
-
|
|
878
|
-
|
|
880
|
+
Ue as isJsonString,
|
|
881
|
+
Gt as useDarkModeState
|
|
879
882
|
};
|