@scalar/api-client 2.1.16 → 2.1.18
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 +22 -0
- package/dist/components/AddressBar/AddressBar.vue.d.ts.map +1 -1
- package/dist/components/AddressBar/AddressBar.vue.js +2 -2
- package/dist/components/AddressBar/AddressBar.vue2.js +67 -66
- package/dist/components/CommandPalette/CommandActionForm.vue.d.ts +3 -0
- package/dist/components/CommandPalette/CommandActionForm.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandActionForm.vue.js +13 -11
- package/dist/components/CommandPalette/CommandActionInput.vue.d.ts +0 -2
- package/dist/components/CommandPalette/CommandActionInput.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandActionInput.vue.js +36 -38
- package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteImport.vue.js +100 -80
- package/dist/components/CommandPalette/TheCommandPalette.vue.js +1 -1
- package/dist/components/CommandPalette/TheCommandPalette.vue2.js +24 -24
- package/dist/components/ContextBar.vue.js +2 -2
- package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +2 -2
- package/dist/components/SideNav/SideNav.vue.js +2 -2
- package/dist/components/SideNav/SideNav.vue2.js +1 -1
- package/dist/components/TopNav/TopNav.vue.js +2 -2
- package/dist/components/TopNav/TopNav.vue2.js +11 -11
- package/dist/components/ViewLayout/ViewLayoutCollapse.vue.js +1 -1
- package/dist/layouts/App/ApiClientApp.vue.d.ts.map +1 -1
- package/dist/layouts/App/ApiClientApp.vue.js +36 -40
- package/dist/layouts/App/hotkeys.d.ts +6 -0
- package/dist/layouts/App/hotkeys.d.ts.map +1 -0
- package/dist/layouts/App/hotkeys.js +21 -0
- package/dist/layouts/Web/ApiClientWeb.vue.d.ts +3 -0
- package/dist/layouts/Web/ApiClientWeb.vue.d.ts.map +1 -0
- package/dist/layouts/Web/ApiClientWeb.vue.js +54 -0
- package/dist/layouts/Web/ApiClientWeb.vue3.js +5 -0
- package/dist/layouts/Web/create-api-client-web.d.ts +3593 -0
- package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -0
- package/dist/layouts/Web/create-api-client-web.js +18 -0
- package/dist/layouts/Web/index.d.ts +3 -0
- package/dist/layouts/Web/index.d.ts.map +1 -0
- package/dist/layouts/Web/index.js +7 -0
- package/dist/libs/event-busses/hot-keys-bus.d.ts +0 -1
- package/dist/libs/event-busses/hot-keys-bus.d.ts.map +1 -1
- package/dist/libs/event-busses/hot-keys-bus.js +19 -35
- package/dist/libs/extractAttachmentFilename.d.ts +2 -0
- package/dist/libs/extractAttachmentFilename.d.ts.map +1 -0
- package/dist/libs/extractAttachmentFilename.js +20 -0
- package/dist/libs/getOpenApiDocumentDetails.d.ts +10 -0
- package/dist/libs/getOpenApiDocumentDetails.d.ts.map +1 -0
- package/dist/libs/getOpenApiDocumentDetails.js +40 -0
- package/dist/libs/index.d.ts +1 -2
- package/dist/libs/index.d.ts.map +1 -1
- package/dist/libs/index.js +21 -23
- package/dist/libs/isUrl.d.ts +1 -1
- package/dist/libs/isUrl.d.ts.map +1 -1
- package/dist/libs/isUrl.js +4 -3
- package/dist/store/import-spec.d.ts.map +1 -1
- package/dist/store/import-spec.js +21 -26
- package/dist/style.css +1 -1
- package/dist/views/Request/RequestSection/RequestSection.vue.js +1 -1
- package/dist/views/Request/RequestSubpageHeader.vue.js +3 -3
- package/dist/views/Request/RequestSubpageHeader.vue2.js +2 -2
- package/dist/views/Request/ResponseSection/ResponseBody.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseBody.vue.js +63 -55
- package/dist/views/Request/ResponseSection/ResponseBodyDownload.vue.d.ts +2 -0
- package/dist/views/Request/ResponseSection/ResponseBodyDownload.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseBodyDownload.vue.js +14 -14
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/dist/views/Request/components/WorkspaceDropdown.vue.js +2 -2
- package/package.json +10 -6
- package/dist/libs/getOpenApiDocumentVersion.d.ts +0 -8
- package/dist/libs/getOpenApiDocumentVersion.d.ts.map +0 -1
- package/dist/libs/getOpenApiDocumentVersion.js +0 -20
- package/dist/libs/isDocument.d.ts +0 -3
- package/dist/libs/isDocument.d.ts.map +0 -1
- package/dist/libs/isDocument.js +0 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @scalar/api-client
|
|
2
2
|
|
|
3
|
+
## 2.1.18
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 7c2e291: style: removes comamand palette command label + style fixtures
|
|
8
|
+
- 46a55ae: feat(api-client): improve client import ux
|
|
9
|
+
- 5d996a8: feat: download response with filename
|
|
10
|
+
- b26144c: fix(themes): remove variables from theme layer and move selection to default (base) theme
|
|
11
|
+
- Updated dependencies [46a55ae]
|
|
12
|
+
- Updated dependencies [b26144c]
|
|
13
|
+
- @scalar/oas-utils@0.2.53
|
|
14
|
+
- @scalar/themes@0.9.35
|
|
15
|
+
- @scalar/components@0.12.50
|
|
16
|
+
|
|
17
|
+
## 2.1.17
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- 8396e92: style: updates overall alignments
|
|
22
|
+
- 6279c59: feat (api-client): remove tabs on client.scalar.com
|
|
23
|
+
- 5581a28: fix: displays address bar placeholder according to active server
|
|
24
|
+
|
|
3
25
|
## 2.1.16
|
|
4
26
|
|
|
5
27
|
### Patch Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddressBar.vue.d.ts","sourceRoot":"","sources":["../../../src/components/AddressBar/AddressBar.vue"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"AddressBar.vue.d.ts","sourceRoot":"","sources":["../../../src/components/AddressBar/AddressBar.vue"],"names":[],"mappings":";AAouBA,wBAKG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./AddressBar.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const e = /* @__PURE__ */ r(o, [["__scopeId", "data-v-ef489963"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
e as default
|
|
7
7
|
};
|
|
@@ -1,112 +1,113 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { Listbox as
|
|
4
|
-
import { ScalarButton as
|
|
5
|
-
import { REQUEST_METHODS as
|
|
6
|
-
import { isMacOS as
|
|
7
|
-
import { useMagicKeys as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import { executeRequestBus as
|
|
12
|
-
import { useWorkspace as
|
|
13
|
-
import { requestStatusBus as
|
|
14
|
-
import { hotKeyBus as
|
|
15
|
-
const v = (d) => (
|
|
1
|
+
import { defineComponent as L, ref as i, watch as O, onMounted as A, onBeforeUnmount as K, unref as l, openBlock as N, createElementBlock as T, createElementVNode as o, createVNode as s, withCtx as w, normalizeClass as B, normalizeStyle as $, createCommentVNode as D, pushScopeId as P, popScopeId as Q } from "vue";
|
|
2
|
+
import W from "../CodeInput/CodeInput.vue.js";
|
|
3
|
+
import { Listbox as j } from "@headlessui/vue";
|
|
4
|
+
import { ScalarButton as F, ScalarIcon as G } from "@scalar/components";
|
|
5
|
+
import { REQUEST_METHODS as J } from "@scalar/oas-utils/helpers";
|
|
6
|
+
import { isMacOS as X } from "@scalar/use-tooltip";
|
|
7
|
+
import { useMagicKeys as Y, whenever as Z } from "@vueuse/core";
|
|
8
|
+
import ee from "../HttpMethod/HttpMethod.vue.js";
|
|
9
|
+
import te from "./AddressBarHistory.vue.js";
|
|
10
|
+
import le from "./AddressBarServer.vue.js";
|
|
11
|
+
import { executeRequestBus as S } from "../../libs/event-busses/execute-request-bus.js";
|
|
12
|
+
import { useWorkspace as oe } from "../../store/store.js";
|
|
13
|
+
import { requestStatusBus as ae } from "../../libs/event-busses/request-status-bus.js";
|
|
14
|
+
import { hotKeyBus as k } from "../../libs/event-busses/hot-keys-bus.js";
|
|
15
|
+
const v = (d) => (P("data-v-ef489963"), d = d(), Q(), d), re = {
|
|
16
16
|
key: 0,
|
|
17
17
|
class: "order-last lg:order-none lg:w-auto w-full"
|
|
18
|
-
},
|
|
18
|
+
}, se = { class: "m-auto flex flex-row items-center" }, ne = { class: "pointer-events-none absolute left-0 top-0 z-10 block h-full w-full overflow-hidden" }, ie = { class: "flex gap-1" }, ue = { class: "codemirror-bg-switcher scroll-timeline-x scroll-timeline-x-hidden relative flex w-full" }, de = /* @__PURE__ */ v(() => /* @__PURE__ */ o("div", { class: "fade-left" }, null, -1)), ce = /* @__PURE__ */ v(() => /* @__PURE__ */ o("div", { class: "fade-right" }, null, -1)), fe = /* @__PURE__ */ v(() => /* @__PURE__ */ o("span", { class: "text-xxs relative z-10 lg:flex hidden" }, "Send", -1)), Ce = /* @__PURE__ */ L({
|
|
19
19
|
__name: "AddressBar",
|
|
20
20
|
setup(d) {
|
|
21
21
|
const {
|
|
22
22
|
activeRequest: t,
|
|
23
|
-
activeExample:
|
|
23
|
+
activeExample: y,
|
|
24
|
+
activeServer: q,
|
|
24
25
|
isReadOnly: m,
|
|
25
|
-
requestMutators:
|
|
26
|
-
requestHistory:
|
|
27
|
-
} =
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
() =>
|
|
26
|
+
requestMutators: f,
|
|
27
|
+
requestHistory: C
|
|
28
|
+
} = oe(), p = i(C[0]), h = i(null), _ = Y();
|
|
29
|
+
Z(
|
|
30
|
+
X() ? _.meta_enter : _.ctrl_enter,
|
|
31
|
+
() => S.emit()
|
|
31
32
|
);
|
|
32
|
-
const
|
|
33
|
-
!t.value || t.value.path === e ||
|
|
33
|
+
const E = (e) => {
|
|
34
|
+
!t.value || t.value.path === e || f.edit(t.value.uid, "path", e);
|
|
34
35
|
};
|
|
35
|
-
|
|
36
|
+
O(
|
|
36
37
|
() => {
|
|
37
38
|
var e;
|
|
38
39
|
return (e = t.value) == null ? void 0 : e.path;
|
|
39
40
|
},
|
|
40
41
|
(e) => {
|
|
41
|
-
!t.value || !e ||
|
|
42
|
+
!t.value || !e || E(e);
|
|
42
43
|
}
|
|
43
44
|
);
|
|
44
45
|
const a = i(100), x = i(0), r = i(!1), n = i();
|
|
45
|
-
function E() {
|
|
46
|
-
r.value ? a.value -= (a.value - 15) / 60 : a.value -= x.value / 20, a.value <= 0 && (clearInterval(n.value), n.value = void 0, a.value = 100, r.value = !1);
|
|
47
|
-
}
|
|
48
46
|
function R() {
|
|
49
|
-
|
|
47
|
+
r.value ? a.value -= (a.value - 15) / 60 : a.value -= x.value / 20, a.value <= 0 && (clearInterval(n.value), n.value = void 0, a.value = 100, r.value = !1);
|
|
50
48
|
}
|
|
51
49
|
function I() {
|
|
52
|
-
|
|
50
|
+
n.value || (r.value = !0, n.value = setInterval(R, 20));
|
|
53
51
|
}
|
|
54
52
|
function V() {
|
|
53
|
+
x.value = a.value, r.value = !1;
|
|
54
|
+
}
|
|
55
|
+
function z() {
|
|
55
56
|
clearInterval(n.value), n.value = void 0, a.value = 100, r.value = !1;
|
|
56
57
|
}
|
|
57
|
-
|
|
58
|
-
e === "start" &&
|
|
58
|
+
ae.on((e) => {
|
|
59
|
+
e === "start" && I(), e === "stop" && V(), e === "abort" && z();
|
|
59
60
|
});
|
|
60
|
-
function
|
|
61
|
-
t.value &&
|
|
61
|
+
function M(e) {
|
|
62
|
+
t.value && f.edit(t.value.uid, "method", e);
|
|
62
63
|
}
|
|
63
|
-
function
|
|
64
|
+
function H() {
|
|
64
65
|
if (!t.value) return;
|
|
65
66
|
const { method: e } = t.value;
|
|
66
|
-
return
|
|
67
|
+
return J[e].backgroundColor;
|
|
67
68
|
}
|
|
68
69
|
function b() {
|
|
69
|
-
r.value || (r.value = !0,
|
|
70
|
+
r.value || (r.value = !0, S.emit());
|
|
70
71
|
}
|
|
71
|
-
function
|
|
72
|
-
t.value &&
|
|
72
|
+
function U(e) {
|
|
73
|
+
t.value && f.edit(t.value.uid, "path", e);
|
|
73
74
|
}
|
|
74
75
|
function g(e) {
|
|
75
76
|
var u;
|
|
76
77
|
e.focusAddressBar && ((u = h.value) == null || u.focus());
|
|
77
78
|
}
|
|
78
|
-
return
|
|
79
|
-
o("div",
|
|
80
|
-
s(l(
|
|
79
|
+
return A(() => k.on(g)), K(() => k.off(g)), (e, u) => l(t) && l(y) ? (N(), T("div", re, [
|
|
80
|
+
o("div", se, [
|
|
81
|
+
s(l(j), {
|
|
81
82
|
modelValue: p.value,
|
|
82
|
-
"onUpdate:modelValue": u[0] || (u[0] = (
|
|
83
|
+
"onUpdate:modelValue": u[0] || (u[0] = (c) => p.value = c)
|
|
83
84
|
}, {
|
|
84
|
-
default: w(({ open:
|
|
85
|
+
default: w(({ open: c }) => [
|
|
85
86
|
o("div", {
|
|
86
87
|
class: B([
|
|
87
88
|
"addressbar-bg-states text-xxs relative flex w-full lg:min-w-[720px] lg:max-w-[720px] order-last overflow-hidden lg:order-none flex-1 flex-row items-stretch rounded-lg border-1/2 p-[3px]",
|
|
88
|
-
{ "border-transparent overflow-visible rounded-b-none":
|
|
89
|
+
{ "border-transparent overflow-visible rounded-b-none": c }
|
|
89
90
|
])
|
|
90
91
|
}, [
|
|
91
|
-
o("div",
|
|
92
|
+
o("div", ne, [
|
|
92
93
|
o("div", {
|
|
93
|
-
class: B(["bg-mix-transparent bg-mix-amount-90 absolute left-0 top-0 h-full w-full",
|
|
94
|
-
style:
|
|
94
|
+
class: B(["bg-mix-transparent bg-mix-amount-90 absolute left-0 top-0 h-full w-full", H()]),
|
|
95
|
+
style: $({ transform: `translate3d(-${a.value}%,0,0)` })
|
|
95
96
|
}, null, 6)
|
|
96
97
|
]),
|
|
97
|
-
o("div",
|
|
98
|
-
s(
|
|
98
|
+
o("div", ie, [
|
|
99
|
+
s(ee, {
|
|
99
100
|
isEditable: !l(m),
|
|
100
101
|
isSquare: "",
|
|
101
102
|
method: l(t).method,
|
|
102
103
|
teleport: ".scalar-client",
|
|
103
|
-
onChange:
|
|
104
|
+
onChange: M
|
|
104
105
|
}, null, 8, ["isEditable", "method"])
|
|
105
106
|
]),
|
|
106
|
-
o("div",
|
|
107
|
-
|
|
108
|
-
s(
|
|
109
|
-
s(
|
|
107
|
+
o("div", ue, [
|
|
108
|
+
de,
|
|
109
|
+
s(le),
|
|
110
|
+
s(W, {
|
|
110
111
|
ref_key: "addressBarRef",
|
|
111
112
|
ref: h,
|
|
112
113
|
disableCloseBrackets: "",
|
|
@@ -115,21 +116,21 @@ const v = (d) => (D("data-v-1a9f572a"), d = d(), P(), d), ae = {
|
|
|
115
116
|
disableTabIndent: "",
|
|
116
117
|
emitOnBlur: !1,
|
|
117
118
|
modelValue: l(t).path,
|
|
118
|
-
placeholder: "Enter URL to get started",
|
|
119
|
+
placeholder: l(q) ? "" : "Enter URL to get started",
|
|
119
120
|
server: "",
|
|
120
121
|
onSubmit: b,
|
|
121
|
-
"onUpdate:modelValue":
|
|
122
|
-
}, null, 8, ["disabled", "modelValue"]),
|
|
123
|
-
|
|
122
|
+
"onUpdate:modelValue": U
|
|
123
|
+
}, null, 8, ["disabled", "modelValue", "placeholder"]),
|
|
124
|
+
ce
|
|
124
125
|
]),
|
|
125
|
-
s(
|
|
126
|
-
s(l(
|
|
126
|
+
s(te, { open: c }, null, 8, ["open"]),
|
|
127
|
+
s(l(F), {
|
|
127
128
|
class: "relative h-auto shrink-0 gap-1 overflow-hidden pl-2 pr-2.5 py-1 z-[1] font-bold",
|
|
128
129
|
disabled: r.value,
|
|
129
130
|
onClick: b
|
|
130
131
|
}, {
|
|
131
132
|
default: w(() => [
|
|
132
|
-
s(l(
|
|
133
|
+
s(l(G), {
|
|
133
134
|
class: "relative z-10 shrink-0 fill-current",
|
|
134
135
|
icon: "Play",
|
|
135
136
|
size: "xs"
|
|
@@ -143,9 +144,9 @@ const v = (d) => (D("data-v-1a9f572a"), d = d(), P(), d), ae = {
|
|
|
143
144
|
_: 1
|
|
144
145
|
}, 8, ["modelValue"])
|
|
145
146
|
])
|
|
146
|
-
])) :
|
|
147
|
+
])) : D("", !0);
|
|
147
148
|
}
|
|
148
149
|
});
|
|
149
150
|
export {
|
|
150
|
-
|
|
151
|
+
Ce as default
|
|
151
152
|
};
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
+
import { type useLoadingState } from '@scalar/components';
|
|
1
2
|
declare function __VLS_template(): {
|
|
2
3
|
default?(_: {}): any;
|
|
3
4
|
options?(_: {}): any;
|
|
4
5
|
submit?(_: {}): any;
|
|
5
6
|
};
|
|
6
7
|
declare const __VLS_component: import("vue").DefineComponent<__VLS_TypePropsToOption<{
|
|
8
|
+
loading?: ReturnType<typeof useLoadingState>;
|
|
7
9
|
disabled?: boolean;
|
|
8
10
|
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
9
11
|
submit: () => void;
|
|
10
12
|
cancel: () => void;
|
|
11
13
|
back: (e: KeyboardEvent) => void;
|
|
12
14
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<{
|
|
15
|
+
loading?: ReturnType<typeof useLoadingState>;
|
|
13
16
|
disabled?: boolean;
|
|
14
17
|
}>>> & {
|
|
15
18
|
onSubmit?: (() => any) | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommandActionForm.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandActionForm.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CommandActionForm.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandActionForm.vue"],"names":[],"mappings":"AAsCA,OAAO,EAAgB,KAAK,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAsBvE,iBAAS,cAAc;qBA+DM,GAAG;qBACH,GAAG;oBACJ,GAAG;EAgB9B;AACD,QAAA,MAAM,eAAe;cAnGT,UAAU,CAAC,OAAO,eAAe,CAAC;eACjC,OAAO;;;;;;cADR,UAAU,CAAC,OAAO,eAAe,CAAC;eACjC,OAAO;;;;;UAyGlB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAAvG,wBAAwG;AAOxG,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"}
|
|
@@ -1,28 +1,30 @@
|
|
|
1
|
-
import { defineComponent as n, openBlock as i, createElementBlock as a, withKeys as d, withModifiers as l, createElementVNode as
|
|
1
|
+
import { defineComponent as n, openBlock as i, createElementBlock as a, withKeys as d, withModifiers as l, createElementVNode as t, renderSlot as s, createVNode as r, unref as m, withCtx as p, createTextVNode as f } from "vue";
|
|
2
2
|
import { ScalarButton as u } from "@scalar/components";
|
|
3
|
-
const c = { class: "
|
|
3
|
+
const c = { class: "flex flex-col rounded min-h-20 relative" }, b = { class: "flex gap-2" }, x = { class: "flex flex-1 max-h-8" }, _ = /* @__PURE__ */ n({
|
|
4
4
|
__name: "CommandActionForm",
|
|
5
5
|
props: {
|
|
6
|
+
loading: {},
|
|
6
7
|
disabled: { type: Boolean }
|
|
7
8
|
},
|
|
8
9
|
emits: ["submit", "cancel", "back"],
|
|
9
|
-
setup(
|
|
10
|
-
return (e,
|
|
10
|
+
setup(g) {
|
|
11
|
+
return (e, o) => (i(), a("form", {
|
|
11
12
|
class: "flex w-full flex-col gap-3",
|
|
12
|
-
onKeydown:
|
|
13
|
+
onKeydown: o[0] || (o[0] = d(l(() => {
|
|
13
14
|
}, ["stop"]), ["enter"])),
|
|
14
|
-
onSubmit:
|
|
15
|
+
onSubmit: o[1] || (o[1] = l((h) => e.$emit("submit"), ["prevent", "stop"]))
|
|
15
16
|
}, [
|
|
16
|
-
|
|
17
|
+
t("div", c, [
|
|
17
18
|
s(e.$slots, "default")
|
|
18
19
|
]),
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
t("div", b, [
|
|
21
|
+
t("div", x, [
|
|
21
22
|
s(e.$slots, "options")
|
|
22
23
|
]),
|
|
23
24
|
r(m(u), {
|
|
24
25
|
class: "max-h-8 text-xs p-0 px-3",
|
|
25
26
|
disabled: e.disabled,
|
|
27
|
+
loading: e.loading,
|
|
26
28
|
type: "submit"
|
|
27
29
|
}, {
|
|
28
30
|
default: p(() => [
|
|
@@ -31,11 +33,11 @@ const c = { class: "gap-3 rounded min-h-20 relative" }, b = { class: "flex gap-2
|
|
|
31
33
|
])
|
|
32
34
|
]),
|
|
33
35
|
_: 3
|
|
34
|
-
}, 8, ["disabled"])
|
|
36
|
+
}, 8, ["disabled", "loading"])
|
|
35
37
|
])
|
|
36
38
|
], 32));
|
|
37
39
|
}
|
|
38
40
|
});
|
|
39
41
|
export {
|
|
40
|
-
|
|
42
|
+
_ as default
|
|
41
43
|
};
|
|
@@ -4,12 +4,10 @@ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<{
|
|
|
4
4
|
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
5
5
|
"update:modelValue": (v: string) => void;
|
|
6
6
|
onDelete: (event: KeyboardEvent) => void;
|
|
7
|
-
paste: (event: ClipboardEvent) => void;
|
|
8
7
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<{
|
|
9
8
|
modelValue?: string;
|
|
10
9
|
placeholder?: string;
|
|
11
10
|
}>>> & {
|
|
12
|
-
onPaste?: ((event: ClipboardEvent) => any) | undefined;
|
|
13
11
|
"onUpdate:modelValue"?: ((v: string) => any) | undefined;
|
|
14
12
|
onOnDelete?: ((event: KeyboardEvent) => any) | undefined;
|
|
15
13
|
}, {}, {}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommandActionInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandActionInput.vue"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"CommandActionInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandActionInput.vue"],"names":[],"mappings":";iBA0De,MAAM;kBACL,MAAM;;;;;iBADP,MAAM;kBACL,MAAM;;;;;AAiGtB,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"}
|
|
@@ -1,51 +1,49 @@
|
|
|
1
|
-
import { defineComponent as f, ref as
|
|
2
|
-
|
|
3
|
-
const P = ["for"], A = ["id", "placeholder"], K = /* @__PURE__ */ f({
|
|
1
|
+
import { defineComponent as f, ref as c, onMounted as h, nextTick as g, computed as v, withDirectives as w, openBlock as x, createElementBlock as k, mergeProps as y, withKeys as s, vModelText as D } from "vue";
|
|
2
|
+
const E = ["placeholder"], b = /* @__PURE__ */ f({
|
|
4
3
|
inheritAttrs: !1,
|
|
5
4
|
__name: "CommandActionInput",
|
|
6
5
|
props: {
|
|
7
6
|
modelValue: {},
|
|
8
7
|
placeholder: {}
|
|
9
8
|
},
|
|
10
|
-
emits: ["update:modelValue", "onDelete"
|
|
9
|
+
emits: ["update:modelValue", "onDelete"],
|
|
11
10
|
setup(i, { emit: p }) {
|
|
12
|
-
const
|
|
13
|
-
|
|
11
|
+
const l = i, r = p, a = c(null);
|
|
12
|
+
h(() => g(() => {
|
|
14
13
|
var e;
|
|
15
|
-
return (e =
|
|
14
|
+
return (e = a.value) == null ? void 0 : e.focus();
|
|
16
15
|
}));
|
|
17
|
-
const
|
|
18
|
-
get: () =>
|
|
19
|
-
set: (e) =>
|
|
20
|
-
})
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
u(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
], 64));
|
|
16
|
+
const o = v({
|
|
17
|
+
get: () => l.modelValue ?? "",
|
|
18
|
+
set: (e) => r("update:modelValue", e)
|
|
19
|
+
});
|
|
20
|
+
function d(e) {
|
|
21
|
+
var u;
|
|
22
|
+
if (e.shiftKey || !e.target) return;
|
|
23
|
+
e.preventDefault();
|
|
24
|
+
const t = e.target, n = new Event("submit", { cancelable: !0 });
|
|
25
|
+
(u = t.form) == null || u.dispatchEvent(n);
|
|
26
|
+
}
|
|
27
|
+
function m(e) {
|
|
28
|
+
o.value === "" && (e.preventDefault(), e.stopPropagation(), r("onDelete", e));
|
|
29
|
+
}
|
|
30
|
+
return (e, t) => w((x(), k("textarea", y({
|
|
31
|
+
ref_key: "input",
|
|
32
|
+
ref: a,
|
|
33
|
+
"onUpdate:modelValue": t[0] || (t[0] = (n) => o.value = n),
|
|
34
|
+
class: "border-none outline-none flex-1 w-full pl-8 text-sm min-h-8 py-1.5 resize-none",
|
|
35
|
+
placeholder: l.placeholder,
|
|
36
|
+
wrap: "hard"
|
|
37
|
+
}, e.$attrs, {
|
|
38
|
+
onKeydown: [
|
|
39
|
+
t[1] || (t[1] = s((n) => m(n), ["delete"])),
|
|
40
|
+
t[2] || (t[2] = s((n) => d(n), ["enter"]))
|
|
41
|
+
]
|
|
42
|
+
}), null, 16, E)), [
|
|
43
|
+
[D, o.value]
|
|
44
|
+
]);
|
|
47
45
|
}
|
|
48
46
|
});
|
|
49
47
|
export {
|
|
50
|
-
|
|
48
|
+
b as default
|
|
51
49
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommandPaletteImport.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandPaletteImport.vue"],"names":[],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"CommandPaletteImport.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandPaletteImport.vue"],"names":[],"mappings":";;;;;;;AA6eA,wBAMG"}
|