@scalar/api-client 2.1.39 → 2.1.41
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 +27 -0
- package/dist/components/CodeInput/CodeInput.vue.d.ts +3 -0
- package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
- package/dist/components/CodeInput/CodeInput.vue.js +1 -1
- package/dist/components/CodeInput/CodeInput.vue2.js +105 -84
- package/dist/components/CodeInput/codeVariableWidget.d.ts +3 -0
- package/dist/components/CodeInput/codeVariableWidget.d.ts.map +1 -1
- package/dist/components/CodeInput/codeVariableWidget.js +51 -47
- package/dist/components/ImportCollection/ImportCollectionModal.vue.d.ts.map +1 -1
- package/dist/components/ImportCollection/ImportCollectionModal.vue.js +102 -129
- package/dist/components/ImportCollection/PrefetchError.vue.d.ts +2 -3
- package/dist/components/ImportCollection/PrefetchError.vue.d.ts.map +1 -1
- package/dist/components/ImportCollection/PrefetchError.vue.js +27 -0
- package/dist/components/ImportCollection/PrefetchError.vue2.js +4 -0
- package/dist/components/ImportCollection/hooks/useUrlPrefetcher.d.ts +11 -17
- package/dist/components/ImportCollection/hooks/useUrlPrefetcher.d.ts.map +1 -1
- package/dist/components/ImportCollection/hooks/useUrlPrefetcher.js +72 -29
- package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.js +1 -1
- package/dist/components/Sidebar/Actions/SidebarListElementForm.vue2.js +20 -28
- package/dist/components/Sidebar/SidebarButton.vue.d.ts +5 -3
- package/dist/components/Sidebar/SidebarButton.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarButton.vue.js +16 -16
- package/dist/components/Sidebar/SidebarList.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarList.vue.js +5 -5
- package/dist/components/Sidebar/SidebarListElement.vue.d.ts +1 -1
- package/dist/components/Sidebar/SidebarListElement.vue.d.ts.map +1 -1
- package/dist/layouts/App/ApiClientApp.vue.d.ts.map +1 -1
- package/dist/layouts/App/ApiClientApp.vue.js +37 -37
- package/dist/layouts/Modal/ApiClientModal.vue.d.ts.map +1 -1
- package/dist/layouts/Modal/ApiClientModal.vue.js +1 -1
- package/dist/layouts/Modal/ApiClientModal.vue2.js +23 -21
- package/dist/layouts/Web/ApiClientWeb.vue.d.ts.map +1 -1
- package/dist/layouts/Web/ApiClientWeb.vue.js +30 -30
- package/dist/store/environment.js +1 -1
- package/dist/style.css +1 -1
- package/dist/views/Cookies/Cookies.vue.d.ts +1 -5
- package/dist/views/Cookies/Cookies.vue.d.ts.map +1 -1
- package/dist/views/Cookies/Cookies.vue2.js +58 -61
- package/dist/views/Environment/Environment.vue.d.ts +1 -5
- package/dist/views/Environment/Environment.vue.d.ts.map +1 -1
- package/dist/views/Environment/Environment.vue2.js +142 -96
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts.map +1 -1
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.js +17 -18
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.js +36 -34
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue.js +3 -3
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +25 -25
- package/dist/views/Request/libs/oauth2.d.ts +2 -2
- package/dist/views/Request/libs/oauth2.d.ts.map +1 -1
- package/dist/views/Request/libs/oauth2.js +45 -36
- package/package.json +7 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# @scalar/api-client
|
|
2
2
|
|
|
3
|
+
## 2.1.41
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 823c14d: fix: add tests for oauth2 flows, ensure we reject on state mismatch
|
|
8
|
+
- Updated dependencies [823c14d]
|
|
9
|
+
- Updated dependencies [997cd35]
|
|
10
|
+
- @scalar/oas-utils@0.2.67
|
|
11
|
+
|
|
12
|
+
## 2.1.40
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- db4a4b7: fix: favors provide for web layout hotkey display
|
|
17
|
+
- c63ab07: fix: sidebar list action button danger
|
|
18
|
+
- c929284: fix: add default redirectURI and prefix relative redirectURIs with activeServer
|
|
19
|
+
- 2275977: feat: import from way more sources, leverage the proxy more
|
|
20
|
+
- e044d78: feat: adds copy capability to environment code input
|
|
21
|
+
- e461e5b: feat: adds environment variables synchronization
|
|
22
|
+
- Updated dependencies [c929284]
|
|
23
|
+
- Updated dependencies [2275977]
|
|
24
|
+
- Updated dependencies [3a0c367]
|
|
25
|
+
- Updated dependencies [89a2cc7]
|
|
26
|
+
- Updated dependencies [f2361b3]
|
|
27
|
+
- @scalar/oas-utils@0.2.66
|
|
28
|
+
- @scalar/import@0.0.4
|
|
29
|
+
|
|
3
30
|
## 2.1.39
|
|
4
31
|
|
|
5
32
|
### Patch Changes
|
|
@@ -19,6 +19,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
19
19
|
nullable?: boolean;
|
|
20
20
|
withVariables?: boolean;
|
|
21
21
|
importCurl?: boolean;
|
|
22
|
+
isCopyable?: boolean;
|
|
22
23
|
}, {
|
|
23
24
|
focus: () => void;
|
|
24
25
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
@@ -45,6 +46,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
45
46
|
nullable?: boolean;
|
|
46
47
|
withVariables?: boolean;
|
|
47
48
|
importCurl?: boolean;
|
|
49
|
+
isCopyable?: boolean;
|
|
48
50
|
}> & Readonly<{
|
|
49
51
|
onSubmit?: ((v: string) => any) | undefined;
|
|
50
52
|
"onUpdate:modelValue"?: ((v: string) => any) | undefined;
|
|
@@ -57,6 +59,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
57
59
|
disableCloseBrackets: boolean;
|
|
58
60
|
nullable: boolean;
|
|
59
61
|
withVariables: boolean;
|
|
62
|
+
isCopyable: boolean;
|
|
60
63
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
61
64
|
warning?(_: {}): any;
|
|
62
65
|
icon?(_: {}): any;
|
|
@@ -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,OAkcO,EAGL,KAAK,kBAAkB,EAGxB,MAAM,wBAAwB,CAAA;;kBAiBb,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;iBACV,OAAO;iBACP,OAAO;;;;;;;;kBAnBN,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;iBACV,OAAO;iBACP,OAAO;;;;;;gBAhBP,OAAO;iBAHN,OAAO;sBAMF,OAAO;kBAMX,OAAO;0BACC,OAAO;cAGnB,OAAO;mBACF,OAAO;gBAEV,OAAO;;qBAoZM,GAAG;kBACN,GAAG;;AA3a9B,wBAweC;AAcD,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACpC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,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 a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
5
|
+
const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-77713050"]]);
|
|
6
6
|
export {
|
|
7
7
|
a as default
|
|
8
8
|
};
|
|
@@ -1,20 +1,26 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useCodeMirror as
|
|
3
|
-
import { nanoid as
|
|
4
|
-
import
|
|
5
|
-
import { pillPlugin as
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
|
|
1
|
+
import { defineComponent as J, useAttrs as L, ref as s, toRef as a, watch as Q, computed as v, openBlock as i, createElementBlock as p, Fragment as G, createBlock as h, mergeProps as H, unref as n, withKeys as w, withModifiers as D, createElementVNode as $, createVNode as X, createCommentVNode as m, renderSlot as q } from "vue";
|
|
2
|
+
import { useCodeMirror as Y, useDropdown as Z, colorPicker as ee } from "@scalar/use-codemirror";
|
|
3
|
+
import { nanoid as oe } from "nanoid";
|
|
4
|
+
import R from "../DataTable/DataTableInputSelect.vue.js";
|
|
5
|
+
import { pillPlugin as te, backspaceCommand as le } from "./codeVariableWidget.js";
|
|
6
|
+
import ne from "../../views/Environment/EnvironmentVariableDropdown.vue.js";
|
|
7
|
+
import { useClipboard as re } from "../../hooks/useClipboard.js";
|
|
8
|
+
import { ScalarIcon as ae } from "@scalar/components";
|
|
9
|
+
import { prettyPrintJson as ie } from "@scalar/oas-utils/helpers";
|
|
10
|
+
import { useWorkspace as se } from "../../store/store.js";
|
|
11
|
+
const ue = ["id"], de = {
|
|
12
|
+
key: 0,
|
|
13
|
+
class: "scalar-code-copy z-context"
|
|
14
|
+
}, pe = {
|
|
9
15
|
key: 3,
|
|
10
16
|
class: "absolute centered-y right-7 text-orange text-xs"
|
|
11
|
-
},
|
|
17
|
+
}, ce = {
|
|
12
18
|
key: 4,
|
|
13
19
|
class: "required absolute centered-y right-0 pt-px pr-2 text-xxs text-c-3 bg-b-1 shadow-[-8px_0_4px_var(--scalar-background-1)] opacity-100 duration-150 transition-opacity peer-has-[.cm-focused]:opacity-0 pointer-events-none"
|
|
14
|
-
},
|
|
20
|
+
}, me = {
|
|
15
21
|
inheritAttrs: !1
|
|
16
|
-
},
|
|
17
|
-
...
|
|
22
|
+
}, ke = /* @__PURE__ */ J({
|
|
23
|
+
...me,
|
|
18
24
|
__name: "CodeInput",
|
|
19
25
|
props: {
|
|
20
26
|
colorPicker: { type: Boolean, default: !1 },
|
|
@@ -35,126 +41,141 @@ const te = ["id"], ne = {
|
|
|
35
41
|
type: {},
|
|
36
42
|
nullable: { type: Boolean, default: !1 },
|
|
37
43
|
withVariables: { type: Boolean, default: !0 },
|
|
38
|
-
importCurl: { type: Boolean }
|
|
44
|
+
importCurl: { type: Boolean },
|
|
45
|
+
isCopyable: { type: Boolean, default: !1 }
|
|
39
46
|
},
|
|
40
47
|
emits: ["submit", "update:modelValue", "curl"],
|
|
41
|
-
setup(
|
|
42
|
-
var
|
|
43
|
-
const o =
|
|
48
|
+
setup(N, { expose: O, emit: _ }) {
|
|
49
|
+
var P;
|
|
50
|
+
const o = N, u = _, V = L(), I = V.id || `id-${oe()}`, g = s(!1), f = s(!1), B = s(""), C = s({ left: 0, top: 0 }), c = s(null), { activeEnvVariables: k, isReadOnly: S, activeEnvironment: E, router: K } = se(), { copyToClipboard: M } = re();
|
|
44
51
|
function A(e) {
|
|
45
|
-
var
|
|
46
|
-
return e === o.modelValue ? null : o.importCurl && e.trim().toLowerCase().startsWith("curl") ? (
|
|
52
|
+
var t;
|
|
53
|
+
return e === o.modelValue ? null : o.importCurl && e.trim().toLowerCase().startsWith("curl") ? (u("curl", e), (t = r.value) == null || t.dispatch({
|
|
47
54
|
changes: {
|
|
48
55
|
from: 0,
|
|
49
|
-
to:
|
|
56
|
+
to: r.value.state.doc.length,
|
|
50
57
|
insert: String(o.modelValue)
|
|
51
58
|
}
|
|
52
|
-
}), null) : o.handleFieldChange ? o.handleFieldChange(e) :
|
|
59
|
+
}), null) : o.handleFieldChange ? o.handleFieldChange(e) : u("update:modelValue", e);
|
|
53
60
|
}
|
|
54
|
-
function
|
|
55
|
-
return o.handleFieldSubmit ? o.handleFieldSubmit(e) :
|
|
61
|
+
function T(e) {
|
|
62
|
+
return o.handleFieldSubmit ? o.handleFieldSubmit(e) : u("submit", e);
|
|
56
63
|
}
|
|
57
|
-
function
|
|
58
|
-
|
|
64
|
+
function z(e) {
|
|
65
|
+
g.value = !1, o.emitOnBlur && o.modelValue && T(e);
|
|
59
66
|
}
|
|
60
|
-
const
|
|
61
|
-
o.colorPicker &&
|
|
62
|
-
|
|
63
|
-
activeEnvironment:
|
|
64
|
-
activeEnvVariables:
|
|
67
|
+
const y = [];
|
|
68
|
+
o.colorPicker && y.push(ee), y.push(
|
|
69
|
+
te({
|
|
70
|
+
activeEnvironment: E,
|
|
71
|
+
activeEnvVariables: k,
|
|
65
72
|
isReadOnly: S
|
|
66
73
|
}),
|
|
67
|
-
|
|
74
|
+
le
|
|
68
75
|
);
|
|
69
|
-
const
|
|
70
|
-
content:
|
|
76
|
+
const x = s(null), { codeMirror: r } = Y({
|
|
77
|
+
content: a(
|
|
71
78
|
() => o.modelValue !== void 0 ? String(o.modelValue) : ""
|
|
72
79
|
),
|
|
73
80
|
onChange: (e) => {
|
|
74
|
-
A(e),
|
|
81
|
+
A(e), W();
|
|
75
82
|
},
|
|
76
|
-
onFocus: () =>
|
|
77
|
-
onBlur: (e) =>
|
|
78
|
-
codeMirrorRef:
|
|
79
|
-
disableTabIndent:
|
|
80
|
-
disableEnter:
|
|
81
|
-
disableCloseBrackets:
|
|
82
|
-
lineNumbers:
|
|
83
|
-
language:
|
|
84
|
-
lint:
|
|
85
|
-
extensions:
|
|
86
|
-
placeholder:
|
|
83
|
+
onFocus: () => g.value = !0,
|
|
84
|
+
onBlur: (e) => z(e),
|
|
85
|
+
codeMirrorRef: x,
|
|
86
|
+
disableTabIndent: a(() => o.disableTabIndent),
|
|
87
|
+
disableEnter: a(() => o.disableEnter),
|
|
88
|
+
disableCloseBrackets: a(() => o.disableCloseBrackets),
|
|
89
|
+
lineNumbers: a(() => o.lineNumbers),
|
|
90
|
+
language: a(() => o.language),
|
|
91
|
+
lint: a(() => o.lint),
|
|
92
|
+
extensions: y,
|
|
93
|
+
placeholder: a(() => o.placeholder)
|
|
87
94
|
});
|
|
88
|
-
(
|
|
89
|
-
|
|
95
|
+
(P = r.value) == null || P.focus(), Q(r, () => {
|
|
96
|
+
r.value && Object.prototype.hasOwnProperty.call(V, "autofocus") && r.value.focus();
|
|
90
97
|
});
|
|
91
|
-
const { handleDropdownSelect:
|
|
92
|
-
codeMirror:
|
|
98
|
+
const { handleDropdownSelect: U, updateDropdownVisibility: W } = Z({
|
|
99
|
+
codeMirror: r,
|
|
93
100
|
query: B,
|
|
94
|
-
showDropdown:
|
|
95
|
-
dropdownPosition:
|
|
96
|
-
}),
|
|
101
|
+
showDropdown: f,
|
|
102
|
+
dropdownPosition: C
|
|
103
|
+
}), j = v(() => {
|
|
97
104
|
var e;
|
|
98
105
|
return o.type === "boolean" || (e = o.type) != null && e.includes("boolean") || o.nullable ? ["true", "false", "null"] : ["true", "false"];
|
|
99
106
|
});
|
|
100
|
-
|
|
107
|
+
O({
|
|
101
108
|
focus: () => {
|
|
102
109
|
var e;
|
|
103
|
-
(e =
|
|
110
|
+
(e = r.value) == null || e.focus();
|
|
104
111
|
}
|
|
105
112
|
});
|
|
106
|
-
const b = (e,
|
|
107
|
-
var d,
|
|
108
|
-
|
|
113
|
+
const b = (e, t) => {
|
|
114
|
+
var d, l, F;
|
|
115
|
+
f.value && (e === "down" ? (t.preventDefault(), (d = c.value) == null || d.handleArrowKey("down")) : e === "up" ? (t.preventDefault(), (l = c.value) == null || l.handleArrowKey("up")) : e === "enter" && (t.preventDefault(), (F = c.value) == null || F.handleSelect()));
|
|
109
116
|
};
|
|
110
|
-
return (e,
|
|
117
|
+
return (e, t) => {
|
|
111
118
|
var d;
|
|
112
|
-
return
|
|
113
|
-
o.enum && o.enum.length ? (
|
|
119
|
+
return i(), p(G, null, [
|
|
120
|
+
o.enum && o.enum.length ? (i(), h(R, {
|
|
114
121
|
key: 0,
|
|
115
122
|
modelValue: o.modelValue,
|
|
116
123
|
value: o.enum,
|
|
117
|
-
"onUpdate:modelValue":
|
|
118
|
-
}, null, 8, ["modelValue", "value"])) : o.type === "boolean" || (d = o.type) != null && d.includes("boolean") ? (
|
|
124
|
+
"onUpdate:modelValue": t[0] || (t[0] = (l) => u("update:modelValue", l))
|
|
125
|
+
}, null, 8, ["modelValue", "value"])) : o.type === "boolean" || (d = o.type) != null && d.includes("boolean") ? (i(), h(R, {
|
|
119
126
|
key: 1,
|
|
120
127
|
modelValue: o.modelValue,
|
|
121
|
-
value:
|
|
122
|
-
"onUpdate:modelValue":
|
|
123
|
-
}, null, 8, ["modelValue", "value"])) : (
|
|
128
|
+
value: j.value,
|
|
129
|
+
"onUpdate:modelValue": t[1] || (t[1] = (l) => u("update:modelValue", l))
|
|
130
|
+
}, null, 8, ["modelValue", "value"])) : (i(), p("div", H({
|
|
124
131
|
key: 2,
|
|
125
|
-
id:
|
|
132
|
+
id: n(I)
|
|
126
133
|
}, e.$attrs, {
|
|
127
134
|
ref_key: "codeMirrorRef",
|
|
128
|
-
ref:
|
|
135
|
+
ref: x,
|
|
129
136
|
class: ["peer font-code w-full whitespace-nowrap overflow-hidden text-xs leading-[1.44] relative", {
|
|
130
137
|
"flow-code-input--error": e.error
|
|
131
138
|
}],
|
|
132
139
|
onKeydown: [
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
140
|
+
t[3] || (t[3] = w(D((l) => b("down", l), ["stop"]), ["down"])),
|
|
141
|
+
t[4] || (t[4] = w((l) => b("enter", l), ["enter"])),
|
|
142
|
+
t[5] || (t[5] = w(D((l) => b("up", l), ["stop"]), ["up"]))
|
|
136
143
|
]
|
|
137
|
-
}),
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
+
}), [
|
|
145
|
+
e.isCopyable ? (i(), p("div", de, [
|
|
146
|
+
$("button", {
|
|
147
|
+
class: "copy-button",
|
|
148
|
+
type: "button",
|
|
149
|
+
onClick: t[2] || (t[2] = (l) => n(M)(n(ie)(o.modelValue)))
|
|
150
|
+
}, [
|
|
151
|
+
t[6] || (t[6] = $("span", { class: "sr-only" }, "Copy content", -1)),
|
|
152
|
+
X(n(ae), {
|
|
153
|
+
icon: "Clipboard",
|
|
154
|
+
size: "md"
|
|
155
|
+
})
|
|
156
|
+
])
|
|
157
|
+
])) : m("", !0)
|
|
158
|
+
], 16, ue)),
|
|
159
|
+
e.$slots.warning ? (i(), p("div", pe, [
|
|
160
|
+
q(e.$slots, "warning", {}, void 0, !0)
|
|
161
|
+
])) : m("", !0),
|
|
162
|
+
q(e.$slots, "icon", {}, void 0, !0),
|
|
163
|
+
e.required ? (i(), p("div", ce, " Required ")) : m("", !0),
|
|
164
|
+
f.value && o.withVariables && !n(S) ? (i(), h(ne, {
|
|
144
165
|
key: 5,
|
|
145
166
|
ref_key: "dropdownRef",
|
|
146
|
-
ref:
|
|
147
|
-
activeEnvVariables:
|
|
148
|
-
activeEnvironment:
|
|
149
|
-
dropdownPosition:
|
|
167
|
+
ref: c,
|
|
168
|
+
activeEnvVariables: v(() => n(k)),
|
|
169
|
+
activeEnvironment: v(() => n(E)),
|
|
170
|
+
dropdownPosition: C.value,
|
|
150
171
|
query: B.value,
|
|
151
|
-
router:
|
|
152
|
-
onSelect:
|
|
153
|
-
}, null, 8, ["activeEnvVariables", "activeEnvironment", "dropdownPosition", "query", "router", "onSelect"])) :
|
|
172
|
+
router: n(K),
|
|
173
|
+
onSelect: n(U)
|
|
174
|
+
}, null, 8, ["activeEnvVariables", "activeEnvironment", "dropdownPosition", "query", "router", "onSelect"])) : m("", !0)
|
|
154
175
|
], 64);
|
|
155
176
|
};
|
|
156
177
|
}
|
|
157
178
|
});
|
|
158
179
|
export {
|
|
159
|
-
|
|
180
|
+
ke as default
|
|
160
181
|
};
|
|
@@ -2,6 +2,9 @@ import type { WorkspaceStore } from '../../store/index.js';
|
|
|
2
2
|
import { Decoration, type DecorationSet, EditorView, ViewPlugin, type ViewUpdate } from '@scalar/use-codemirror';
|
|
3
3
|
type ActiveParsedEnvironments = WorkspaceStore['activeEnvVariables'];
|
|
4
4
|
type IsReadOnly = WorkspaceStore['isReadOnly'];
|
|
5
|
+
/**
|
|
6
|
+
* Styles the active environment variable pill
|
|
7
|
+
*/
|
|
5
8
|
export declare const pillPlugin: (props: {
|
|
6
9
|
activeEnvironment: WorkspaceStore["activeEnvironment"];
|
|
7
10
|
activeEnvVariables: ActiveParsedEnvironments;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codeVariableWidget.d.ts","sourceRoot":"","sources":["../../../src/components/CodeInput/codeVariableWidget.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"codeVariableWidget.d.ts","sourceRoot":"","sources":["../../../src/components/CodeInput/codeVariableWidget.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAG7C,OAAO,EACL,UAAU,EACV,KAAK,aAAa,EAClB,UAAU,EAEV,UAAU,EACV,KAAK,UAAU,EAEhB,MAAM,wBAAwB,CAAA;AAI/B,KAAK,wBAAwB,GAAG,cAAc,CAAC,oBAAoB,CAAC,CAAA;AACpE,KAAK,UAAU,GAAG,cAAc,CAAC,YAAY,CAAC,CAAA;AAqI9C;;GAEG;AACH,eAAO,MAAM,UAAU,UAAW;IAChC,iBAAiB,EAAE,cAAc,CAAC,mBAAmB,CAAC,CAAA;IACtD,kBAAkB,EAAE,wBAAwB,CAAA;IAC5C,UAAU,EAAE,UAAU,CAAA;CACvB;iBAGkB,aAAa;mBAMX,UAAU;2BAMF,UAAU;EAiCpC,CAAA;AAEH,eAAO,MAAM,gBAAgB,uCA8B3B,CAAA"}
|
|
@@ -1,36 +1,33 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var l = (
|
|
1
|
+
var m = Object.defineProperty;
|
|
2
|
+
var v = (n, t, e) => t in n ? m(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
|
|
3
|
+
var l = (n, t, e) => v(n, typeof t != "symbol" ? t + "" : t, e);
|
|
4
4
|
import { ScalarButton as h, ScalarIcon as f, ScalarTooltip as b } from "@scalar/components";
|
|
5
5
|
import { variableRegex as g } from "@scalar/oas-utils/helpers";
|
|
6
|
-
import { ViewPlugin as
|
|
7
|
-
import { defineComponent as C, h as o, createApp as
|
|
8
|
-
import { parseEnvVariables as
|
|
9
|
-
const
|
|
10
|
-
class
|
|
11
|
-
constructor(e,
|
|
6
|
+
import { ViewPlugin as E, RangeSetBuilder as y, Decoration as x, EditorView as w, WidgetType as N } from "@scalar/use-codemirror";
|
|
7
|
+
import { defineComponent as C, h as o, createApp as D } from "vue";
|
|
8
|
+
import { parseEnvVariables as R } from "../../libs/environment-parser.js";
|
|
9
|
+
const S = (n) => n.value ? n.value.color : "#8E8E8E";
|
|
10
|
+
class d extends N {
|
|
11
|
+
constructor(e, a, i, s) {
|
|
12
12
|
super();
|
|
13
13
|
l(this, "app");
|
|
14
14
|
l(this, "activeEnvironment");
|
|
15
15
|
l(this, "activeEnvVariables");
|
|
16
16
|
l(this, "isReadOnly");
|
|
17
|
-
this.variableName = e, this.variableName = e, this.activeEnvironment =
|
|
17
|
+
this.variableName = e, this.variableName = e, this.activeEnvironment = a, this.activeEnvVariables = i, this.isReadOnly = s;
|
|
18
18
|
}
|
|
19
19
|
toDOM() {
|
|
20
20
|
const e = document.createElement("span");
|
|
21
21
|
e.className = "cm-pill", e.textContent = `${this.variableName}`;
|
|
22
|
-
const
|
|
22
|
+
const a = C({
|
|
23
23
|
props: { variableName: { type: String, default: null } },
|
|
24
24
|
render: () => {
|
|
25
|
-
const
|
|
26
|
-
(
|
|
27
|
-
);
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
);
|
|
32
|
-
const s = n ? o("div", { class: "p-2" }, n.value) : o("div", { class: "divide-y divide-1/2 grid" }, [
|
|
33
|
-
o("span", { class: "p-2" }, "Variable not found"),
|
|
25
|
+
const i = R(this.activeEnvVariables.value).find(
|
|
26
|
+
(c) => c.key === this.variableName
|
|
27
|
+
), s = i && this.activeEnvironment.value ? S(this.activeEnvironment) : "#8E8E8E";
|
|
28
|
+
e.style.setProperty("--tw-bg-base", s), e.style.opacity = i != null && i.value ? "1" : "0.5";
|
|
29
|
+
const r = i != null && i.value ? o("div", { class: "p-2" }, i.value) : o("div", { class: "divide-y divide-1/2 grid" }, [
|
|
30
|
+
o("span", { class: "p-2 opacity-25" }, "No value"),
|
|
34
31
|
!this.isReadOnly && o("div", { class: "p-1" }, [
|
|
35
32
|
o(
|
|
36
33
|
h,
|
|
@@ -42,7 +39,11 @@ class c extends N {
|
|
|
42
39
|
}
|
|
43
40
|
},
|
|
44
41
|
[
|
|
45
|
-
o(f, {
|
|
42
|
+
o(f, {
|
|
43
|
+
class: "w-2",
|
|
44
|
+
icon: "Add",
|
|
45
|
+
size: "xs"
|
|
46
|
+
}),
|
|
46
47
|
"Add variable"
|
|
47
48
|
]
|
|
48
49
|
)
|
|
@@ -52,7 +53,7 @@ class c extends N {
|
|
|
52
53
|
b,
|
|
53
54
|
{
|
|
54
55
|
align: "center",
|
|
55
|
-
class: "
|
|
56
|
+
class: "w-full",
|
|
56
57
|
delay: 0,
|
|
57
58
|
side: "bottom",
|
|
58
59
|
sideOffset: 6
|
|
@@ -62,27 +63,30 @@ class c extends N {
|
|
|
62
63
|
content: () => o(
|
|
63
64
|
"div",
|
|
64
65
|
{
|
|
65
|
-
class:
|
|
66
|
+
class: [
|
|
67
|
+
"border w-content rounded bg-b-1 brightness-lifted text-xxs leading-5 text-c-1",
|
|
68
|
+
i != null && i.value ? "border-solid" : "border-dashed"
|
|
69
|
+
]
|
|
66
70
|
},
|
|
67
|
-
|
|
71
|
+
r
|
|
68
72
|
)
|
|
69
73
|
}
|
|
70
74
|
);
|
|
71
75
|
}
|
|
72
76
|
});
|
|
73
|
-
return this.app =
|
|
77
|
+
return this.app = D(a, { variableName: this.variableName }), this.app.mount(e), e;
|
|
74
78
|
}
|
|
75
79
|
destroy() {
|
|
76
80
|
this.app && this.app.unmount();
|
|
77
81
|
}
|
|
78
82
|
eq(e) {
|
|
79
|
-
return e instanceof
|
|
83
|
+
return e instanceof d && e.variableName === this.variableName;
|
|
80
84
|
}
|
|
81
85
|
ignoreEvent() {
|
|
82
86
|
return !1;
|
|
83
87
|
}
|
|
84
88
|
}
|
|
85
|
-
const T = (
|
|
89
|
+
const T = (n) => E.fromClass(
|
|
86
90
|
class {
|
|
87
91
|
constructor(t) {
|
|
88
92
|
l(this, "decorations");
|
|
@@ -93,20 +97,20 @@ const T = (a) => x.fromClass(
|
|
|
93
97
|
}
|
|
94
98
|
buildDecorations(t) {
|
|
95
99
|
const e = new y();
|
|
96
|
-
for (const { from:
|
|
97
|
-
const s = t.state.doc.sliceString(
|
|
100
|
+
for (const { from: a, to: i } of t.visibleRanges) {
|
|
101
|
+
const s = t.state.doc.sliceString(a, i);
|
|
98
102
|
let r;
|
|
99
103
|
for (; (r = g.exec(s)) !== null; ) {
|
|
100
|
-
const
|
|
104
|
+
const c = a + r.index, p = c + r[0].length, u = r[1];
|
|
101
105
|
e.add(
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
widget: new
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
106
|
+
c,
|
|
107
|
+
p,
|
|
108
|
+
x.widget({
|
|
109
|
+
widget: new d(
|
|
110
|
+
u,
|
|
111
|
+
n.activeEnvironment,
|
|
112
|
+
n.activeEnvVariables,
|
|
113
|
+
n.isReadOnly
|
|
110
114
|
),
|
|
111
115
|
side: 1
|
|
112
116
|
})
|
|
@@ -120,19 +124,19 @@ const T = (a) => x.fromClass(
|
|
|
120
124
|
decorations: (t) => t.decorations
|
|
121
125
|
}
|
|
122
126
|
), $ = w.domEventHandlers({
|
|
123
|
-
keydown(
|
|
124
|
-
if (
|
|
125
|
-
const { state: e } = t, { from:
|
|
126
|
-
if (
|
|
127
|
+
keydown(n, t) {
|
|
128
|
+
if (n.key === "Backspace") {
|
|
129
|
+
const { state: e } = t, { from: a, to: i } = e.selection.main;
|
|
130
|
+
if (a === 0 && i === e.doc.length)
|
|
127
131
|
return t.dispatch({
|
|
128
132
|
changes: { from: 0, to: e.doc.length },
|
|
129
133
|
selection: { anchor: 0 }
|
|
130
|
-
}),
|
|
131
|
-
if (
|
|
134
|
+
}), n.preventDefault(), !0;
|
|
135
|
+
if (a === i && a > 0 && e.doc.sliceString(a - 2, a) === "}}")
|
|
132
136
|
return t.dispatch({
|
|
133
|
-
changes: { from:
|
|
134
|
-
selection: { anchor:
|
|
135
|
-
}),
|
|
137
|
+
changes: { from: a - 2, to: i },
|
|
138
|
+
selection: { anchor: a - 2 }
|
|
139
|
+
}), n.preventDefault(), !0;
|
|
136
140
|
}
|
|
137
141
|
return !1;
|
|
138
142
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImportCollectionModal.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCollection/ImportCollectionModal.vue"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"ImportCollectionModal.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCollection/ImportCollectionModal.vue"],"names":[],"mappings":";YAgTU,MAAM,GAAG,IAAI;iBACR,MAAM,GAAG,IAAI;;;;YADlB,MAAM,GAAG,IAAI;iBACR,MAAM,GAAG,IAAI;;;;AAuX5B,wBASG"}
|