@scalar/api-client 2.0.25 → 2.0.27
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/components/AddressBar/AddressBarHistory.vue.d.ts.map +1 -1
- package/dist/components/AddressBar/AddressBarHistory.vue.js +38 -38
- package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
- package/dist/components/CodeInput/CodeInput.vue.js +2 -2
- package/dist/components/CodeInput/CodeInput.vue2.js +11 -11
- package/dist/components/CodeInput/codeVariableWidget.d.ts.map +1 -1
- package/dist/components/CodeInput/codeVariableWidget.js +48 -46
- package/dist/components/HttpMethod/HttpMethod.vue.d.ts.map +1 -1
- package/dist/components/HttpMethod/HttpMethod.vue.js +23 -30
- package/dist/components/Sidebar/SidebarToggle.vue.d.ts +20 -0
- package/dist/components/Sidebar/SidebarToggle.vue.d.ts.map +1 -0
- package/dist/components/Sidebar/SidebarToggle.vue.js +48 -0
- package/dist/components/Sidebar/SidebarToggle.vue2.js +4 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -10
- package/dist/layouts/Modal/api-client-modal.d.ts +1 -1
- package/dist/layouts/Modal/api-client-modal.d.ts.map +1 -1
- package/dist/layouts/Modal/api-client-modal.js +41 -41
- package/dist/store/workspace.d.ts +36 -12
- package/dist/store/workspace.d.ts.map +1 -1
- package/dist/store/workspace.js +163 -149
- package/dist/style.css +1 -1
- package/dist/views/Cookies/Cookies.vue2.js +22 -22
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts.map +1 -1
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.js +32 -30
- package/dist/views/Request/Request.vue.d.ts.map +1 -1
- package/dist/views/Request/Request.vue.js +1 -1
- package/dist/views/Request/Request.vue2.js +97 -98
- package/dist/views/Request/RequestSection/RequestBody.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestBody.vue.js +155 -125
- package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebarItemMenu.vue.js +44 -46
- package/dist/views/Request/ResponseSection/ResponseBody.vue.d.ts +0 -5
- package/dist/views/Request/ResponseSection/ResponseBody.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseBody.vue.js +2 -2
- package/dist/views/Request/ResponseSection/ResponseBody.vue2.js +24 -113
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# @scalar/api-client
|
|
2
2
|
|
|
3
|
+
## 2.0.27
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 19d8b6a: feat: animate sidebar icon
|
|
8
|
+
- c112f24: fix: remove ScalarCodeBlock that freezes browser in response preview
|
|
9
|
+
- 83fc241: fix: constantly adding empty header
|
|
10
|
+
- 2e1ef12: fix: set content type on body change and add proper header
|
|
11
|
+
- Updated dependencies [19d8b6a]
|
|
12
|
+
- Updated dependencies [c112f24]
|
|
13
|
+
- @scalar/components@0.12.18
|
|
14
|
+
- @scalar/use-codemirror@0.11.8
|
|
15
|
+
|
|
16
|
+
## 2.0.26
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- 54f7654: fix: add local storage to client.scalar/com
|
|
21
|
+
- b0b3290: feat: create a default workspace if no OpenAPI document is passed to the modal
|
|
22
|
+
- 7e01b12: fix: only trigger codeinput change event if the value has changed
|
|
23
|
+
- b7211fb: fix: request history
|
|
24
|
+
- Updated dependencies [67aefbf]
|
|
25
|
+
- Updated dependencies [7761630]
|
|
26
|
+
- @scalar/components@0.12.17
|
|
27
|
+
- @scalar/oas-utils@0.2.16
|
|
28
|
+
|
|
3
29
|
## 2.0.25
|
|
4
30
|
|
|
5
31
|
### Patch Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddressBarHistory.vue.d.ts","sourceRoot":"","sources":["../../../src/components/AddressBar/AddressBarHistory.vue"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"AddressBarHistory.vue.d.ts","sourceRoot":"","sources":["../../../src/components/AddressBar/AddressBarHistory.vue"],"names":[],"mappings":";UAkHQ,OAAO;;UAAP,OAAO;;AA0Of,wBAMG;AAOH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as y, openBlock as n, createElementBlock as p, Fragment as f, unref as e, createBlock as i, withCtx as m, createVNode as d, createCommentVNode as x, createElementVNode as r, normalizeClass as h, renderList as k, toDisplayString as u } from "vue";
|
|
2
2
|
import { formatMs as w } from "../../libs/formatters.js";
|
|
3
|
-
import { useWorkspace as
|
|
4
|
-
import { ListboxButton as
|
|
5
|
-
import { ScalarIcon as
|
|
6
|
-
import { httpStatusCodes as
|
|
7
|
-
import { useRouter as
|
|
3
|
+
import { useWorkspace as C } from "../../store/workspace.js";
|
|
4
|
+
import { ListboxButton as q, ListboxOptions as U, ListboxOption as L } from "@headlessui/vue";
|
|
5
|
+
import { ScalarIcon as R } from "@scalar/components";
|
|
6
|
+
import { httpStatusCodes as B } from "@scalar/oas-utils/helpers";
|
|
7
|
+
import { useRouter as S } from "vue-router";
|
|
8
8
|
import P from "../HttpMethod/HttpMethod.vue.js";
|
|
9
9
|
import { getStatusCodeColor as z } from "./httpStatusCodeColors.js";
|
|
10
|
-
const E = { class: "font-code flex flex-1 gap-1.5 text-sm font-medium" },
|
|
10
|
+
const E = { class: "font-code flex flex-1 gap-1.5 text-sm font-medium" }, H = { class: "text-c-2 gap-0" }, N = { class: "font-code text-c-3 flex flex-row items-center gap-1.5 text-sm font-medium" }, G = /* @__PURE__ */ y({
|
|
11
11
|
__name: "AddressBarHistory",
|
|
12
12
|
props: {
|
|
13
13
|
open: { type: Boolean }
|
|
14
14
|
},
|
|
15
|
-
setup(
|
|
16
|
-
const {
|
|
17
|
-
function
|
|
18
|
-
const
|
|
19
|
-
return s ? new URL(s)
|
|
15
|
+
setup(V) {
|
|
16
|
+
const { activeRequest: l, requestExampleMutators: b } = C(), g = S();
|
|
17
|
+
function _(a) {
|
|
18
|
+
const o = new URL(a), s = new URLSearchParams(o.search).get("scalar_url");
|
|
19
|
+
return s ? new URL(s).href : o.href;
|
|
20
20
|
}
|
|
21
|
-
function
|
|
22
|
-
const
|
|
23
|
-
|
|
21
|
+
function v(a) {
|
|
22
|
+
const o = l.value.history[a];
|
|
23
|
+
l.value.uid !== o.request.requestUid && g.push(`/request/${o.request.requestUid}`), b.set(o.request);
|
|
24
24
|
}
|
|
25
|
-
return (a,
|
|
26
|
-
|
|
25
|
+
return (a, o) => (n(), p(f, null, [
|
|
26
|
+
e(l).history.length ? (n(), i(e(q), {
|
|
27
27
|
key: 0,
|
|
28
28
|
class: "hover:bg-b-2 mr-1 rounded p-1.5"
|
|
29
29
|
}, {
|
|
30
30
|
default: m(() => [
|
|
31
|
-
|
|
31
|
+
d(e(R), {
|
|
32
32
|
class: "text-c-3",
|
|
33
33
|
icon: "History",
|
|
34
34
|
size: "sm",
|
|
@@ -36,38 +36,38 @@ const E = { class: "font-code flex flex-1 gap-1.5 text-sm font-medium" }, N = {
|
|
|
36
36
|
})
|
|
37
37
|
]),
|
|
38
38
|
_: 1
|
|
39
|
-
})) :
|
|
40
|
-
|
|
39
|
+
})) : x("", !0),
|
|
40
|
+
r("div", {
|
|
41
41
|
class: h([
|
|
42
42
|
"absolute left-0 top-[33px] w-full rounded before:pointer-events-none before:absolute before:left-0 before:top-[-33px] before:h-[calc(100%+33px)] before:w-full before:rounded z-50",
|
|
43
43
|
{ "before:shadow-lg": a.open }
|
|
44
44
|
])
|
|
45
45
|
}, [
|
|
46
|
-
|
|
46
|
+
d(e(U), { class: "bg-b-1 custom-scroll bg-mix-transparent bg-mix-amount-30 max-h-[300px] rounded-b p-[3px] pt-0 backdrop-blur" }, {
|
|
47
47
|
default: m(() => [
|
|
48
|
-
(n(!0), f
|
|
49
|
-
key:
|
|
48
|
+
(n(!0), p(f, null, k(e(l).history, ({ response: t }, s) => (n(), i(e(L), {
|
|
49
|
+
key: s,
|
|
50
50
|
class: "ui-active:bg-b-2 text-c-1 ui-active:text-c-1 flex cursor-pointer flex-row gap-2.5 rounded py-1.5 pr-3",
|
|
51
|
-
value:
|
|
52
|
-
onClick: (
|
|
51
|
+
value: s,
|
|
52
|
+
onClick: (c) => v(s)
|
|
53
53
|
}, {
|
|
54
54
|
default: m(() => {
|
|
55
|
-
var
|
|
55
|
+
var c;
|
|
56
56
|
return [
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
r("div", E, [
|
|
58
|
+
t.config.method ? (n(), i(P, {
|
|
59
59
|
key: 0,
|
|
60
60
|
class: "text-[11px] min-w-[44px]",
|
|
61
|
-
method:
|
|
62
|
-
}, null, 8, ["method"])) :
|
|
63
|
-
|
|
61
|
+
method: t.config.method
|
|
62
|
+
}, null, 8, ["method"])) : x("", !0),
|
|
63
|
+
r("span", H, u(_(t.config.url)), 1)
|
|
64
64
|
]),
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
class: h([
|
|
69
|
-
},
|
|
70
|
-
|
|
65
|
+
r("div", N, [
|
|
66
|
+
r("span", null, u(e(w)(t.duration)), 1),
|
|
67
|
+
r("span", {
|
|
68
|
+
class: h([e(z)(t.status).color])
|
|
69
|
+
}, u(t.status), 3),
|
|
70
|
+
r("span", null, u((c = e(B)[t.status]) == null ? void 0 : c.name), 1)
|
|
71
71
|
])
|
|
72
72
|
];
|
|
73
73
|
}),
|
|
@@ -81,5 +81,5 @@ const E = { class: "font-code flex flex-1 gap-1.5 text-sm font-medium" }, N = {
|
|
|
81
81
|
}
|
|
82
82
|
});
|
|
83
83
|
export {
|
|
84
|
-
|
|
84
|
+
G as default
|
|
85
85
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CodeInput/CodeInput.vue"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"CodeInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CodeInput/CodeInput.vue"],"names":[],"mappings":"AAAA,OA0RO,EAGL,KAAK,kBAAkB,EAExB,MAAM,wBAAwB,CAAA;;kBAeb,OAAO;gBACT,MAAM,GAAG,MAAM;YACnB,OAAO;iBACF,OAAO;kBACN,OAAO;WACd,OAAO;uBACK,OAAO;eACf,kBAAkB;wBACT,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;wBACnB,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;kBACzB,MAAM;eACT,OAAO;mBACH,OAAO;2BACC,OAAO;WACvB,MAAM,EAAE;WACR,MAAM;eACF,OAAO;oBACF,OAAO;kBACT,OAAO;;;;;;;;;;;;;;kBAlBP,OAAO;gBACT,MAAM,GAAG,MAAM;YACnB,OAAO;iBACF,OAAO;kBACN,OAAO;WACd,OAAO;uBACK,OAAO;eACf,kBAAkB;wBACT,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;wBACnB,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;kBACzB,MAAM;eACT,OAAO;mBACH,OAAO;2BACC,OAAO;WACvB,MAAM,EAAE;WACR,MAAM;eACF,OAAO;oBACF,OAAO;kBACT,OAAO;;;;;;;;;;;;;;cAFV,OAAO;iBAEJ,OAAO;iBAlBP,OAAO;gBAGR,OAAO;sBAGD,OAAO;kBAMX,OAAO;0BACC,OAAO;mBAId,OAAO;;qBA2PG,GAAG;kBACN,GAAG;;AAhR9B,wBAmTC;AAMD,KAAK,kBAAkB,CAAC,CAAC,EAAE,CAAC,IAAI;KAC1B,CAAC,IAAI,MAAM,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,SAAS,MAAM,CAAC,GAC7C,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG;QAAE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;KAAC,CAAC,GACvC,CAAC,CAAC,CAAC,CAAC;CACP,CAAC;AAEN,KAAK,cAAc,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC;AAExD,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACpC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC;AAEN,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
|
|
@@ -2,7 +2,7 @@ import o from "./CodeInput.vue2.js";
|
|
|
2
2
|
/* empty css */
|
|
3
3
|
/* empty css */
|
|
4
4
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
-
const
|
|
5
|
+
const c = /* @__PURE__ */ t(o, [["__scopeId", "data-v-5c9fc64f"]]);
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
c as default
|
|
8
8
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as S, useAttrs as P, ref as b, toRef as o, watch as O, computed as $, openBlock as t, createElementBlock as
|
|
1
|
+
import { defineComponent as S, useAttrs as P, ref as b, toRef as o, watch as O, computed as $, openBlock as t, createElementBlock as i, Fragment as R, createBlock as h, mergeProps as q, unref as E, renderSlot as y, createCommentVNode as g } from "vue";
|
|
2
2
|
import { useCodeMirror as I, colorPicker as M } from "@scalar/use-codemirror";
|
|
3
3
|
import { nanoid as N } from "nanoid";
|
|
4
4
|
import B from "../DataTable/DataTableInputSelect.vue.js";
|
|
@@ -38,11 +38,11 @@ const j = ["id"], z = {
|
|
|
38
38
|
withServers: { type: Boolean, default: !1 }
|
|
39
39
|
},
|
|
40
40
|
emits: ["submit", "update:modelValue"],
|
|
41
|
-
setup(v, { emit:
|
|
41
|
+
setup(v, { emit: V }) {
|
|
42
42
|
var m;
|
|
43
|
-
const e = v, a =
|
|
43
|
+
const e = v, a = V, d = P(), k = d.id || `id-${N()}`, p = b(!1), { activeWorkspace: w } = W();
|
|
44
44
|
function C(l) {
|
|
45
|
-
return e.handleFieldChange ? e.handleFieldChange(l) : a("update:modelValue", l);
|
|
45
|
+
return l === e.modelValue ? null : e.handleFieldChange ? e.handleFieldChange(l) : a("update:modelValue", l);
|
|
46
46
|
}
|
|
47
47
|
function _(l) {
|
|
48
48
|
return e.handleFieldSubmit ? e.handleFieldSubmit(l) : a("submit", l);
|
|
@@ -78,20 +78,20 @@ const j = ["id"], z = {
|
|
|
78
78
|
});
|
|
79
79
|
return (l, u) => {
|
|
80
80
|
var f;
|
|
81
|
-
return t(),
|
|
81
|
+
return t(), i(R, null, [
|
|
82
82
|
e.enum && e.enum.length ? (t(), h(B, {
|
|
83
83
|
key: 0,
|
|
84
84
|
modelValue: e.modelValue,
|
|
85
85
|
value: e.enum,
|
|
86
|
-
"onUpdate:modelValue": u[0] || (u[0] = (
|
|
86
|
+
"onUpdate:modelValue": u[0] || (u[0] = (s) => a("update:modelValue", s))
|
|
87
87
|
}, null, 8, ["modelValue", "value"])) : e.type === "boolean" || (f = e.type) != null && f.includes("boolean") ? (t(), h(B, {
|
|
88
88
|
key: 1,
|
|
89
89
|
modelValue: e.modelValue,
|
|
90
90
|
value: F.value,
|
|
91
|
-
"onUpdate:modelValue": u[1] || (u[1] = (
|
|
92
|
-
}, null, 8, ["modelValue", "value"])) : (t(),
|
|
91
|
+
"onUpdate:modelValue": u[1] || (u[1] = (s) => a("update:modelValue", s))
|
|
92
|
+
}, null, 8, ["modelValue", "value"])) : (t(), i("div", q({
|
|
93
93
|
key: 2,
|
|
94
|
-
id: E(
|
|
94
|
+
id: E(k)
|
|
95
95
|
}, l.$attrs, {
|
|
96
96
|
ref_key: "codeMirrorRef",
|
|
97
97
|
ref: c,
|
|
@@ -99,11 +99,11 @@ const j = ["id"], z = {
|
|
|
99
99
|
"flow-code-input--error": l.error
|
|
100
100
|
}]
|
|
101
101
|
}), null, 16, j)),
|
|
102
|
-
l.$slots.warning ? (t(),
|
|
102
|
+
l.$slots.warning ? (t(), i("div", z, [
|
|
103
103
|
y(l.$slots, "warning", {}, void 0, !0)
|
|
104
104
|
])) : g("", !0),
|
|
105
105
|
y(l.$slots, "icon", {}, void 0, !0),
|
|
106
|
-
l.required ? (t(),
|
|
106
|
+
l.required ? (t(), i("div", D, " Required ")) : g("", !0)
|
|
107
107
|
], 64);
|
|
108
108
|
};
|
|
109
109
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codeVariableWidget.d.ts","sourceRoot":"","sources":["../../../src/components/CodeInput/codeVariableWidget.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,UAAU,EACV,KAAK,aAAa,EAClB,UAAU,EAEV,UAAU,EACV,KAAK,UAAU,EAEhB,MAAM,wBAAwB,CAAA;
|
|
1
|
+
{"version":3,"file":"codeVariableWidget.d.ts","sourceRoot":"","sources":["../../../src/components/CodeInput/codeVariableWidget.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,UAAU,EACV,KAAK,aAAa,EAClB,UAAU,EAEV,UAAU,EACV,KAAK,UAAU,EAEhB,MAAM,wBAAwB,CAAA;AAqH/B,eAAO,MAAM,UAAU;iBAEN,aAAa;mBAMX,UAAU;2BAMF,UAAU;EA6BpC,CAAA;AAED,eAAO,MAAM,gBAAgB,uCAmB3B,CAAA"}
|
|
@@ -1,30 +1,32 @@
|
|
|
1
1
|
var u = Object.defineProperty;
|
|
2
|
-
var f = (
|
|
3
|
-
var c = (
|
|
2
|
+
var f = (e, n, t) => n in e ? u(e, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[n] = t;
|
|
3
|
+
var c = (e, n, t) => f(e, typeof n != "symbol" ? n + "" : n, t);
|
|
4
4
|
import { useWorkspace as v } from "../../store/workspace.js";
|
|
5
|
-
import { ScalarButton as
|
|
5
|
+
import { ScalarButton as g, ScalarIcon as b, ScalarTooltip as h } from "@scalar/components";
|
|
6
6
|
import { ViewPlugin as x, RangeSetBuilder as w, Decoration as N, EditorView as y, WidgetType as C } from "@scalar/use-codemirror";
|
|
7
|
-
import { defineComponent as
|
|
8
|
-
const { activeParsedEnvironments:
|
|
7
|
+
import { defineComponent as E, h as s, createApp as k } from "vue";
|
|
8
|
+
const { activeParsedEnvironments: D, isReadOnly: S, environments: $ } = v(), A = (e) => "_scalarEnvId" in e ? `bg-${$[e._scalarEnvId].color}` : "bg-grey";
|
|
9
9
|
class l extends C {
|
|
10
|
-
constructor(
|
|
10
|
+
constructor(t) {
|
|
11
11
|
super();
|
|
12
12
|
c(this, "app");
|
|
13
|
-
this.variableName =
|
|
13
|
+
this.variableName = t;
|
|
14
14
|
}
|
|
15
15
|
toDOM() {
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
const
|
|
16
|
+
const t = document.createElement("span");
|
|
17
|
+
t.className = "cm-pill", t.textContent = `${this.variableName}`;
|
|
18
|
+
const a = E({
|
|
19
19
|
props: ["variableName"],
|
|
20
20
|
render() {
|
|
21
|
-
const
|
|
21
|
+
const o = D.value.find(
|
|
22
22
|
(i) => i.key === this.variableName
|
|
23
|
-
)
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
);
|
|
24
|
+
o && (t.className += ` ${A(o)}`);
|
|
25
|
+
const r = o ? s("div", { class: "p-2" }, o.value) : s("div", { class: "divide-y divide-1/2 grid" }, [
|
|
26
|
+
s("span", { class: "p-2" }, "Variable not found"),
|
|
27
|
+
!S.value && s("div", { class: "p-1" }, [
|
|
28
|
+
s(
|
|
29
|
+
g,
|
|
28
30
|
{
|
|
29
31
|
class: "gap-1.5 justify-start font-normal px-1 py-1.5 h-auto transition-colors rounded no-underline text-xxs w-full hover:bg-b-2",
|
|
30
32
|
variant: "ghost",
|
|
@@ -33,14 +35,14 @@ class l extends C {
|
|
|
33
35
|
}
|
|
34
36
|
},
|
|
35
37
|
[
|
|
36
|
-
|
|
38
|
+
s(b, { class: "w-2", icon: "Add", size: "xs" }),
|
|
37
39
|
"Add variable"
|
|
38
40
|
]
|
|
39
41
|
)
|
|
40
42
|
])
|
|
41
43
|
]);
|
|
42
|
-
return
|
|
43
|
-
|
|
44
|
+
return s(
|
|
45
|
+
h,
|
|
44
46
|
{
|
|
45
47
|
align: "start",
|
|
46
48
|
class: "bg-b-1 w-full",
|
|
@@ -49,8 +51,8 @@ class l extends C {
|
|
|
49
51
|
sideOffset: 6
|
|
50
52
|
},
|
|
51
53
|
{
|
|
52
|
-
trigger: () =>
|
|
53
|
-
content: () =>
|
|
54
|
+
trigger: () => s("span", `${this.variableName}`),
|
|
55
|
+
content: () => s(
|
|
54
56
|
"div",
|
|
55
57
|
{
|
|
56
58
|
class: "w-content shadow-lg rounded bg-b-1 text-xxs leading-5 text-c-1"
|
|
@@ -61,35 +63,35 @@ class l extends C {
|
|
|
61
63
|
);
|
|
62
64
|
}
|
|
63
65
|
});
|
|
64
|
-
return this.app =
|
|
66
|
+
return this.app = k(a, { variableName: this.variableName }), this.app.mount(t), t;
|
|
65
67
|
}
|
|
66
68
|
destroy() {
|
|
67
69
|
this.app && this.app.unmount();
|
|
68
70
|
}
|
|
69
|
-
eq(
|
|
70
|
-
return
|
|
71
|
+
eq(t) {
|
|
72
|
+
return t instanceof l && t.variableName === this.variableName;
|
|
71
73
|
}
|
|
72
|
-
ignoreEvent(
|
|
74
|
+
ignoreEvent(t) {
|
|
73
75
|
return !1;
|
|
74
76
|
}
|
|
75
77
|
}
|
|
76
78
|
const V = x.fromClass(
|
|
77
79
|
class {
|
|
78
|
-
constructor(
|
|
80
|
+
constructor(e) {
|
|
79
81
|
c(this, "decorations");
|
|
80
|
-
this.decorations = this.buildDecorations(
|
|
82
|
+
this.decorations = this.buildDecorations(e);
|
|
81
83
|
}
|
|
82
|
-
update(
|
|
83
|
-
(
|
|
84
|
+
update(e) {
|
|
85
|
+
(e.docChanged || e.viewportChanged) && (this.decorations = this.buildDecorations(e.view));
|
|
84
86
|
}
|
|
85
|
-
buildDecorations(
|
|
86
|
-
const
|
|
87
|
-
for (const { from:
|
|
88
|
-
const
|
|
87
|
+
buildDecorations(e) {
|
|
88
|
+
const n = new w();
|
|
89
|
+
for (const { from: t, to: a } of e.visibleRanges) {
|
|
90
|
+
const o = e.state.doc.sliceString(t, a), r = /{{(.*?)}}/g;
|
|
89
91
|
let i;
|
|
90
|
-
for (; (i = r.exec(
|
|
91
|
-
const d =
|
|
92
|
-
|
|
92
|
+
for (; (i = r.exec(o)) !== null; ) {
|
|
93
|
+
const d = t + i.index, p = d + i[0].length, m = i[1];
|
|
94
|
+
n.add(
|
|
93
95
|
d,
|
|
94
96
|
p,
|
|
95
97
|
N.widget({
|
|
@@ -99,21 +101,21 @@ const V = x.fromClass(
|
|
|
99
101
|
);
|
|
100
102
|
}
|
|
101
103
|
}
|
|
102
|
-
return
|
|
104
|
+
return n.finish();
|
|
103
105
|
}
|
|
104
106
|
},
|
|
105
107
|
{
|
|
106
|
-
decorations: (
|
|
108
|
+
decorations: (e) => e.decorations
|
|
107
109
|
}
|
|
108
110
|
), T = y.domEventHandlers({
|
|
109
|
-
keydown(
|
|
110
|
-
if (
|
|
111
|
-
const { state:
|
|
112
|
-
if (
|
|
113
|
-
return
|
|
114
|
-
changes: { from:
|
|
115
|
-
selection: { anchor:
|
|
116
|
-
}),
|
|
111
|
+
keydown(e, n) {
|
|
112
|
+
if (e.key === "Backspace") {
|
|
113
|
+
const { state: t } = n, { from: a, to: o } = t.selection.main;
|
|
114
|
+
if (a === o && a > 0 && t.doc.sliceString(a - 2, a) === "}}")
|
|
115
|
+
return n.dispatch({
|
|
116
|
+
changes: { from: a - 2, to: o },
|
|
117
|
+
selection: { anchor: a - 2 }
|
|
118
|
+
}), e.preventDefault(), !0;
|
|
117
119
|
}
|
|
118
120
|
return !1;
|
|
119
121
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HttpMethod.vue.d.ts","sourceRoot":"","sources":["../../../src/components/HttpMethod/HttpMethod.vue"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"HttpMethod.vue.d.ts","sourceRoot":"","sources":["../../../src/components/HttpMethod/HttpMethod.vue"],"names":[],"mappings":";eAoGe,OAAO;YACV,MAAM;iBACD,OAAO;;;;;;;;eAFT,OAAO;YACV,MAAM;iBACD,OAAO;;;;;;;;cAFT,OAAO;gBAEL,OAAO;;AAkJxB,wBAOG;AAOH,KAAK,kBAAkB,CAAC,CAAC,EAAE,CAAC,IAAI;KAC1B,CAAC,IAAI,MAAM,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,SAAS,MAAM,CAAC,GAC7C,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG;QAAE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;KAAC,CAAC,GACvC,CAAC,CAAC,CAAC,CAAC;CACP,CAAC;AAEN,KAAK,cAAc,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC;AAExD,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarListbox as
|
|
1
|
+
import { defineComponent as g, computed as s, openBlock as i, createBlock as m, unref as t, withCtx as y, createElementVNode as r, normalizeClass as l, toDisplayString as p, createCommentVNode as q, createElementBlock as k } from "vue";
|
|
2
|
+
import { ScalarListbox as C, ScalarIcon as x } from "@scalar/components";
|
|
3
3
|
import { getRequest as B, REQUEST_METHODS as V } from "@scalar/oas-utils/helpers";
|
|
4
|
-
import { cva as
|
|
5
|
-
const z = /* @__PURE__ */
|
|
4
|
+
import { cva as w, cx as f } from "cva";
|
|
5
|
+
const z = /* @__PURE__ */ g({
|
|
6
6
|
__name: "HttpMethod",
|
|
7
7
|
props: {
|
|
8
8
|
isSquare: { type: Boolean, default: !1 },
|
|
@@ -10,17 +10,17 @@ const z = /* @__PURE__ */ S({
|
|
|
10
10
|
isEditable: { type: Boolean, default: !1 }
|
|
11
11
|
},
|
|
12
12
|
emits: ["change"],
|
|
13
|
-
setup(
|
|
14
|
-
const n =
|
|
15
|
-
([e, { short:
|
|
13
|
+
setup(b, { emit: v }) {
|
|
14
|
+
const n = b, h = v, o = s(() => B(n.method)), u = Object.entries(V).map(
|
|
15
|
+
([e, { short: a }]) => ({ id: e, label: a })
|
|
16
16
|
), d = s({
|
|
17
17
|
get: () => u.find(({ id: e }) => e === n.method),
|
|
18
18
|
set: (e) => (e == null ? void 0 : e.id) && h("change", e.id)
|
|
19
|
-
}),
|
|
19
|
+
}), c = w({
|
|
20
20
|
base: "text-center font-code text-3xs justify-center items-center flex",
|
|
21
21
|
variants: {
|
|
22
22
|
isSquare: {
|
|
23
|
-
true: "px-2.5 rounded-md
|
|
23
|
+
true: "px-2.5 rounded-md shadow-border",
|
|
24
24
|
false: "rounded-full"
|
|
25
25
|
},
|
|
26
26
|
isEditable: {
|
|
@@ -28,32 +28,25 @@ const z = /* @__PURE__ */ S({
|
|
|
28
28
|
false: "cusor-pointer"
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
}), E = s(() =>
|
|
32
|
-
return (e,
|
|
31
|
+
}), E = s(() => o.value.short);
|
|
32
|
+
return (e, a) => e.isEditable ? (i(), m(t(C), {
|
|
33
33
|
key: 0,
|
|
34
34
|
modelValue: d.value,
|
|
35
|
-
"onUpdate:modelValue":
|
|
36
|
-
options:
|
|
35
|
+
"onUpdate:modelValue": a[0] || (a[0] = (S) => d.value = S),
|
|
36
|
+
options: t(u)
|
|
37
37
|
}, {
|
|
38
|
-
default:
|
|
38
|
+
default: y(() => [
|
|
39
39
|
r("div", {
|
|
40
40
|
class: l(["h-full", { "pointer-events-none": !e.isEditable }])
|
|
41
41
|
}, [
|
|
42
42
|
r("button", {
|
|
43
|
-
class: l([
|
|
44
|
-
"relative h-full gap-1",
|
|
45
|
-
a(b)(
|
|
46
|
-
a(m)({ isSquare: e.isSquare, isEditable: e.isEditable }),
|
|
47
|
-
t.value.color,
|
|
48
|
-
e.isSquare && t.value.backgroundColor
|
|
49
|
-
)
|
|
50
|
-
]),
|
|
43
|
+
class: l(["relative h-full gap-1", t(f)(t(c)({ isSquare: e.isSquare, isEditable: e.isEditable }), o.value.color)]),
|
|
51
44
|
type: "button"
|
|
52
45
|
}, [
|
|
53
46
|
r("span", null, p(E.value), 1),
|
|
54
|
-
e.isEditable ? (i(),
|
|
47
|
+
e.isEditable ? (i(), m(t(x), {
|
|
55
48
|
key: 0,
|
|
56
|
-
class: l(
|
|
49
|
+
class: l(o.value.color),
|
|
57
50
|
icon: "ChevronDown",
|
|
58
51
|
size: "xs"
|
|
59
52
|
}, null, 8, ["class"])) : q("", !0)
|
|
@@ -61,18 +54,18 @@ const z = /* @__PURE__ */ S({
|
|
|
61
54
|
], 2)
|
|
62
55
|
]),
|
|
63
56
|
_: 1
|
|
64
|
-
}, 8, ["modelValue", "options"])) : (i(),
|
|
57
|
+
}, 8, ["modelValue", "options"])) : (i(), k("div", {
|
|
65
58
|
key: 1,
|
|
66
59
|
class: l([
|
|
67
60
|
"relative gap-1",
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
e.isSquare &&
|
|
61
|
+
t(f)(
|
|
62
|
+
t(c)({ isSquare: e.isSquare, isEditable: e.isEditable }),
|
|
63
|
+
o.value.color,
|
|
64
|
+
e.isSquare && o.value.backgroundColor
|
|
72
65
|
)
|
|
73
66
|
]),
|
|
74
67
|
type: "button"
|
|
75
|
-
}, p(
|
|
68
|
+
}, p(o.value.short), 3));
|
|
76
69
|
}
|
|
77
70
|
});
|
|
78
71
|
export {
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<{
|
|
2
|
+
modelValue: boolean;
|
|
3
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
4
|
+
"update:modelValue": (v: boolean) => void;
|
|
5
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<{
|
|
6
|
+
modelValue: boolean;
|
|
7
|
+
}>>> & {
|
|
8
|
+
"onUpdate:modelValue"?: ((v: boolean) => any) | undefined;
|
|
9
|
+
}, {}, {}>;
|
|
10
|
+
export default _default;
|
|
11
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
12
|
+
type __VLS_TypePropsToOption<T> = {
|
|
13
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
14
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
15
|
+
} : {
|
|
16
|
+
type: import('vue').PropType<T[K]>;
|
|
17
|
+
required: true;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=SidebarToggle.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SidebarToggle.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Sidebar/SidebarToggle.vue"],"names":[],"mappings":";gBA+Cc,OAAO;;;;gBAAP,OAAO;;;;AAiErB,wBAOG;AAOH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { defineComponent as s, openBlock as l, createElementBlock as n, createElementVNode as e, normalizeClass as r } from "vue";
|
|
2
|
+
const a = {
|
|
3
|
+
class: "size-3.5",
|
|
4
|
+
fill: "none",
|
|
5
|
+
viewBox: "0 0 24 24",
|
|
6
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
7
|
+
}, d = /* @__PURE__ */ e("defs", null, [
|
|
8
|
+
/* @__PURE__ */ e("clipPath", { id: "mask" }, [
|
|
9
|
+
/* @__PURE__ */ e("path", {
|
|
10
|
+
"clip-rule": "evenodd",
|
|
11
|
+
d: "M9 3.2H4c-1.7 0-3 1.3-3 3v11.5c0 1.7 1.3 3 3 3h5V3.2z"
|
|
12
|
+
})
|
|
13
|
+
])
|
|
14
|
+
], -1), i = { "clip-path": "url(#mask)" }, c = /* @__PURE__ */ e("path", {
|
|
15
|
+
d: "M20 20.8H4c-1.7 0-3-1.3-3-3V6.2c0-1.7 1.3-3 3-3h16c1.7 0 3 1.3 3 3v11.5c0 1.7-1.3 3-3 3zM9 3.2v17.5",
|
|
16
|
+
stroke: "currentColor",
|
|
17
|
+
"stroke-linecap": "round",
|
|
18
|
+
"stroke-linejoin": "round",
|
|
19
|
+
"stroke-width": "2"
|
|
20
|
+
}, null, -1), h = /* @__PURE__ */ s({
|
|
21
|
+
__name: "SidebarToggle",
|
|
22
|
+
props: {
|
|
23
|
+
modelValue: { type: Boolean }
|
|
24
|
+
},
|
|
25
|
+
emits: ["update:modelValue"],
|
|
26
|
+
setup(u) {
|
|
27
|
+
return (t, o) => (l(), n("button", {
|
|
28
|
+
class: "text-c-3 hover:bg-b-3 active:text-c-1 p-2 rounded",
|
|
29
|
+
type: "button",
|
|
30
|
+
onClick: o[0] || (o[0] = (p) => t.$emit("update:modelValue", !t.modelValue))
|
|
31
|
+
}, [
|
|
32
|
+
(l(), n("svg", a, [
|
|
33
|
+
d,
|
|
34
|
+
e("g", i, [
|
|
35
|
+
e("path", {
|
|
36
|
+
class: r(["transition-transform duration-300", t.modelValue ? "translate-x-0" : "-translate-x-1/2"]),
|
|
37
|
+
d: "M1 3.2h8v17.5H1z",
|
|
38
|
+
fill: "currentColor"
|
|
39
|
+
}, null, 2)
|
|
40
|
+
]),
|
|
41
|
+
c
|
|
42
|
+
]))
|
|
43
|
+
]));
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
export {
|
|
47
|
+
h as default
|
|
48
|
+
};
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,eAAe,CAAA;AAE7B,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,eAAe,CAAA;AAE7B,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
import { useWorkspace as
|
|
2
|
-
import {
|
|
1
|
+
import { useWorkspace as t } from "./store/workspace.js";
|
|
2
|
+
import { modalRouter as a, router as i } from "./router.js";
|
|
3
|
+
import { default as f } from "./layouts/App/ApiClientApp.vue.js";
|
|
3
4
|
/* empty css */
|
|
4
|
-
import { default as
|
|
5
|
-
import { createApiClientModal as
|
|
6
|
-
import { createApiClientApp as
|
|
5
|
+
import { default as x } from "./layouts/Modal/ApiClientModal.vue.js";
|
|
6
|
+
import { createApiClientModal as d } from "./layouts/Modal/api-client-modal.js";
|
|
7
|
+
import { createApiClientApp as n } from "./layouts/App/createApiClientApp.js";
|
|
7
8
|
export {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
f as ApiClientApp,
|
|
10
|
+
x as ApiClientModal,
|
|
11
|
+
n as createApiClientApp,
|
|
12
|
+
d as createApiClientModal,
|
|
13
|
+
a as modalRouter,
|
|
14
|
+
i as router,
|
|
15
|
+
t as useWorkspace
|
|
13
16
|
};
|