@scalar/api-client 2.21.0 → 2.22.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 +54 -0
- package/dist/components/OpenApiClientButton.vue.d.ts.map +1 -1
- package/dist/components/OpenApiClientButton.vue.js +2 -2
- package/dist/components/OpenApiClientButton.vue2.js +1 -1
- package/dist/hooks/useClientConfig.d.ts +9 -0
- package/dist/hooks/useClientConfig.d.ts.map +1 -1
- package/dist/layouts/App/create-api-client-app.d.ts +2 -2
- package/dist/layouts/Web/create-api-client-web.d.ts +2 -2
- package/dist/libs/create-client.d.ts +2 -2
- package/dist/store/request-example.d.ts +2 -2
- package/dist/store/store.d.ts +2 -2
- package/dist/style.css +1 -1
- package/dist/v2/blocks/operation-block/helpers/get-example.d.ts +2 -2
- package/dist/v2/blocks/operation-block/helpers/get-example.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/get-example.js +29 -22
- package/dist/v2/blocks/operation-block/index.d.ts +1 -0
- package/dist/v2/blocks/operation-block/index.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/index.js +2 -0
- package/dist/v2/blocks/request-block/helpers/get-default-headers.js +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js +2 -2
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue2.js +4 -4
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.js +3 -2
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.js +96 -78
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue3.js +5 -0
- package/dist/v2/features/app/App.vue.d.ts +3 -0
- package/dist/v2/features/app/App.vue.d.ts.map +1 -1
- package/dist/v2/features/app/App.vue.js +43 -42
- package/dist/v2/features/app/app-events.d.ts +1 -3
- package/dist/v2/features/app/app-events.d.ts.map +1 -1
- package/dist/v2/features/app/app-events.js +37 -43
- package/dist/v2/features/app/app-state.d.ts +0 -2
- package/dist/v2/features/app/app-state.d.ts.map +1 -1
- package/dist/v2/features/app/app-state.js +87 -90
- package/dist/v2/features/app/helpers/create-api-client-app.d.ts.map +1 -1
- package/dist/v2/features/app/helpers/create-api-client-app.js +14 -8
- package/dist/v2/features/app/index.d.ts +1 -0
- package/dist/v2/features/app/index.d.ts.map +1 -1
- package/dist/v2/features/app/index.js +11 -7
- package/dist/v2/features/command-palette/{components/TheCommandPalette.vue.d.ts → TheCommandPalette.vue.d.ts} +3 -3
- package/dist/v2/features/command-palette/TheCommandPalette.vue.d.ts.map +1 -0
- package/dist/v2/features/command-palette/TheCommandPalette.vue.js +7 -0
- package/dist/v2/features/command-palette/TheCommandPalette.vue2.js +152 -0
- package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.d.ts +9 -2
- package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.d.ts.map +1 -1
- package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.js +61 -55
- package/dist/v2/features/command-palette/components/CommandPaletteImportCurl.vue.d.ts +2 -2
- package/dist/v2/features/command-palette/components/CommandPaletteImportCurl.vue.d.ts.map +1 -1
- package/dist/v2/features/command-palette/components/CommandPaletteImportCurl.vue.js +1 -1
- package/dist/v2/features/command-palette/components/CommandPaletteImportCurl.vue2.js +26 -26
- package/dist/v2/features/command-palette/helpers/get-operation-from-curl.d.ts.map +1 -1
- package/dist/v2/features/command-palette/helpers/get-operation-from-curl.js +30 -24
- package/dist/v2/features/command-palette/hooks/use-command-palette-state.d.ts +240 -151
- package/dist/v2/features/command-palette/hooks/use-command-palette-state.d.ts.map +1 -1
- package/dist/v2/features/command-palette/hooks/use-command-palette-state.js +114 -102
- package/dist/v2/features/modal/Modal.vue.d.ts.map +1 -1
- package/dist/v2/features/modal/Modal.vue.js +2 -2
- package/dist/v2/features/modal/Modal.vue2.js +17 -15
- package/dist/v2/features/operation/Operation.vue.js +1 -1
- package/dist/views/Request/RequestSection/RequestTable.vue.d.ts +2 -2
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/package.json +17 -22
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue2.js +0 -4
- package/dist/v2/features/command-palette/components/TheCommandPalette.vue.d.ts.map +0 -1
- package/dist/v2/features/command-palette/components/TheCommandPalette.vue.js +0 -7
- package/dist/v2/features/command-palette/components/TheCommandPalette.vue2.js +0 -172
- package/dist/v2/features/command-palette/components/index.d.ts +0 -2
- package/dist/v2/features/command-palette/components/index.d.ts.map +0 -1
- package/dist/v2/features/command-palette/components/index.js +0 -4
- package/dist/v2/features/command-palette/types.d.ts +0 -83
- package/dist/v2/features/command-palette/types.d.ts.map +0 -1
|
@@ -1,111 +1,123 @@
|
|
|
1
|
-
import { useModal as
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
1
|
+
import { useModal as I } from "@scalar/components";
|
|
2
|
+
import { ScalarIconArrowSquareIn as k, ScalarIconPackage as y, ScalarIconFolder as _, ScalarIconArrowUpRight as P, ScalarIconPuzzlePiece as A, ScalarIconBracketsCurly as R, ScalarIconCookie as q, ScalarIconSlidersHorizontal as b } from "@scalar/icons";
|
|
3
|
+
import l from "fuse.js";
|
|
4
|
+
import { ref as u, shallowRef as L, computed as t } from "vue";
|
|
5
|
+
import $ from "../components/CommandPaletteDocument.vue.js";
|
|
6
|
+
import x from "../components/CommandPaletteExample.vue.js";
|
|
7
|
+
import z from "../components/CommandPaletteImport.vue.js";
|
|
8
|
+
import F from "../components/CommandPaletteImportCurl.vue.js";
|
|
9
|
+
import U from "../components/CommandPaletteRequest.vue.js";
|
|
10
|
+
import E from "../components/CommandPaletteTag.vue.js";
|
|
11
|
+
const V = (a = Q, i = O) => {
|
|
12
|
+
const r = I(), n = u(""), m = L(null), c = u(null), d = t(() => r.open), p = new l(a, {
|
|
13
|
+
keys: ["name"],
|
|
14
|
+
threshold: 0.1
|
|
15
|
+
}), f = new l(i, {
|
|
16
|
+
keys: ["name"],
|
|
17
|
+
threshold: 0.1
|
|
18
|
+
}), v = t(() => {
|
|
19
|
+
const e = n.value.toLowerCase().trim();
|
|
20
|
+
return (e ? p.search(e).map((o) => o.item) : a).filter((o) => !o.hidden);
|
|
21
|
+
}), C = t(() => {
|
|
22
|
+
const e = n.value.toLowerCase().trim();
|
|
23
|
+
return e ? f.search(e).map((o) => o.item) : i;
|
|
24
|
+
}), S = (e, ...o) => {
|
|
25
|
+
e && (m.value = a.find((h) => h.id === e) ?? null, c.value = o[0] ?? null), r.show();
|
|
26
|
+
}, w = () => {
|
|
27
|
+
r.hide(), s();
|
|
28
|
+
}, g = (e) => {
|
|
29
|
+
n.value = e;
|
|
30
|
+
}, s = () => {
|
|
31
|
+
n.value = "", m.value = null, c.value = null;
|
|
32
|
+
};
|
|
33
|
+
return {
|
|
34
|
+
isOpen: d,
|
|
35
|
+
activeCommand: m,
|
|
36
|
+
activeCommandProps: c,
|
|
37
|
+
filterQuery: n,
|
|
38
|
+
filteredCommands: t(() => [
|
|
33
39
|
{
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
name: "Add Example",
|
|
37
|
-
icon: "Example",
|
|
38
|
-
props: n()
|
|
40
|
+
label: "",
|
|
41
|
+
commands: v.value
|
|
39
42
|
},
|
|
40
|
-
/** Hidden commands accessible programmatically but not shown in UI */
|
|
41
43
|
{
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
name: "Import cURL Command",
|
|
45
|
-
props: n()
|
|
44
|
+
label: "Pages",
|
|
45
|
+
commands: C.value
|
|
46
46
|
}
|
|
47
|
-
]
|
|
47
|
+
]),
|
|
48
|
+
open: S,
|
|
49
|
+
close: w,
|
|
50
|
+
setFilterQuery: g,
|
|
51
|
+
reset: s
|
|
52
|
+
};
|
|
53
|
+
}, O = [
|
|
54
|
+
{
|
|
55
|
+
type: "route",
|
|
56
|
+
id: "environment",
|
|
57
|
+
name: "Environment",
|
|
58
|
+
icon: R,
|
|
59
|
+
to: {
|
|
60
|
+
name: "workspace.environment"
|
|
61
|
+
}
|
|
48
62
|
},
|
|
49
63
|
{
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
to: {
|
|
67
|
-
name: "workspace.cookies"
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
type: "route",
|
|
72
|
-
id: "settings",
|
|
73
|
-
name: "Settings",
|
|
74
|
-
icon: "Settings",
|
|
75
|
-
to: {
|
|
76
|
-
name: "workspace.settings"
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
]
|
|
64
|
+
type: "route",
|
|
65
|
+
id: "cookies",
|
|
66
|
+
name: "Cookies",
|
|
67
|
+
icon: q,
|
|
68
|
+
to: {
|
|
69
|
+
name: "workspace.cookies"
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
type: "route",
|
|
74
|
+
id: "settings",
|
|
75
|
+
name: "Settings",
|
|
76
|
+
icon: b,
|
|
77
|
+
to: {
|
|
78
|
+
name: "workspace.settings"
|
|
79
|
+
}
|
|
80
80
|
}
|
|
81
|
-
],
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
81
|
+
], Q = [
|
|
82
|
+
{
|
|
83
|
+
id: "import-from-openapi-swagger-postman-curl",
|
|
84
|
+
name: "Import from OpenAPI/Swagger/Postman/cURL",
|
|
85
|
+
component: z,
|
|
86
|
+
icon: k
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
id: "create-document",
|
|
90
|
+
name: "Create Document",
|
|
91
|
+
component: $,
|
|
92
|
+
icon: y
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
id: "add-tag",
|
|
96
|
+
name: "Add Tag",
|
|
97
|
+
component: E,
|
|
98
|
+
icon: _
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
id: "create-request",
|
|
102
|
+
name: "Create Request",
|
|
103
|
+
component: U,
|
|
104
|
+
icon: P
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
id: "add-example",
|
|
108
|
+
name: "Add Example",
|
|
109
|
+
component: x,
|
|
110
|
+
icon: A
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
id: "import-curl-command",
|
|
114
|
+
name: "Import cURL Command",
|
|
115
|
+
hidden: !0,
|
|
116
|
+
component: F
|
|
117
|
+
}
|
|
118
|
+
];
|
|
109
119
|
export {
|
|
110
|
-
|
|
120
|
+
Q as baseClientActions,
|
|
121
|
+
O as baseRoutes,
|
|
122
|
+
V as useCommandPaletteState
|
|
111
123
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/modal/Modal.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Modal.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/modal/Modal.vue"],"names":[],"mappings":"AAkZA,OAAO,EAGL,KAAK,UAAU,EAEhB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,6BAA6B,CAAA;AAE/E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AAExE,OAAO,EASL,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACtB,MAAM,KAAK,CAAA;AAIZ,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,6CAA6C,CAAA;AAIxF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAKxD,MAAM,MAAM,UAAU,GAAG;IACvB,4DAA4D;IAC5D,cAAc,EAAE,cAAc,CAAA;IAC9B,qDAAqD;IACrD,QAAQ,EAAE,WAAW,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAA;IAC/C,iDAAiD;IACjD,IAAI,EAAE,WAAW,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IACrC,4CAA4C;IAC5C,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,mDAAmD;IACnD,MAAM,EAAE,WAAW,CAAC,UAAU,GAAG,SAAS,CAAC,CAAA;IAC3C,yDAAyD;IACzD,WAAW,EAAE,WAAW,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IAC5C,2CAA2C;IAC3C,UAAU,EAAE,UAAU,CAAA;IACtB,0DAA0D;IAC1D,YAAY,EAAE,qBAAqB,CAAA;IACnC,iDAAiD;IACjD,OAAO,EAAE,YAAY,EAAE,CAAA;IACvB,wDAAwD;IACxD,OAAO,EAAE,gBAAgB,CACvB,OAAO,CACL,IAAI,CACF,4BAA4B,EAC1B,gBAAgB,GAChB,eAAe,GACf,kBAAkB,GAClB,eAAe,GACf,SAAS,CACZ,CACF,CACF,CAAA;CACF,CAAA;AAED;;;;GAIG;;;;;AACH,wBA0WC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./Modal.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-b54530a3"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
p as default
|
|
7
7
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as W, ref as w, useId as
|
|
1
|
+
import { defineComponent as W, ref as w, useId as D, watch as I, nextTick as N, onBeforeMount as E, onBeforeUnmount as F, computed as d, toValue as U, withDirectives as k, createElementBlock as u, openBlock as m, createElementVNode as s, unref as o, createVNode as l, withCtx as V, vShow as b } from "vue";
|
|
2
2
|
import { addScalarClassesToHeadless as A, ScalarTeleportRoot as $ } from "@scalar/components";
|
|
3
3
|
import { ScalarToasts as z } from "@scalar/use-toasts";
|
|
4
4
|
import { useFocusTrap as H } from "@vueuse/integrations/useFocusTrap";
|
|
@@ -44,20 +44,22 @@ const P = { class: "scalar scalar-app" }, J = { class: "scalar-container" }, Q =
|
|
|
44
44
|
modalState: e.modalState,
|
|
45
45
|
store: e.workspaceStore
|
|
46
46
|
}), j(e.eventBus, "modal");
|
|
47
|
-
const v = w(null), f =
|
|
47
|
+
const v = w(null), f = D(), { activate: y, deactivate: B } = H(v, {
|
|
48
48
|
allowOutsideClick: !0,
|
|
49
49
|
fallbackFocus: `#${f}`
|
|
50
50
|
}), S = () => {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
B(), e.eventBus.emit("operation:cancel:request"), e.workspaceStore.revertDocumentChanges(
|
|
52
|
+
e.document.value?.["x-scalar-navigation"]?.name ?? ""
|
|
53
|
+
);
|
|
54
|
+
}, g = q(() => typeof window < "u" ? window.document.body : null);
|
|
55
|
+
I(
|
|
54
56
|
() => e.modalState.open,
|
|
55
57
|
(a) => {
|
|
56
|
-
|
|
58
|
+
g.value = a, a ? y({ checkCanFocusTrap: () => N() }) : S();
|
|
57
59
|
}
|
|
58
60
|
), E(() => A()), F(() => S());
|
|
59
|
-
const
|
|
60
|
-
() => e.workspaceStore?.workspace?.["x-scalar-sidebar-width"] ??
|
|
61
|
+
const p = 288, c = d(
|
|
62
|
+
() => e.workspaceStore?.workspace?.["x-scalar-sidebar-width"] ?? p
|
|
61
63
|
), T = (a) => e.workspaceStore?.update("x-scalar-sidebar-width", a), h = d(
|
|
62
64
|
() => R(e.workspaceStore, e.document.value)
|
|
63
65
|
), C = d(
|
|
@@ -70,8 +72,8 @@ const P = { class: "scalar scalar-app" }, J = { class: "scalar-container" }, Q =
|
|
|
70
72
|
sidebarWidth: c,
|
|
71
73
|
environment: h
|
|
72
74
|
}), (a, t) => k((m(), u("div", P, [
|
|
73
|
-
|
|
74
|
-
|
|
75
|
+
s("div", J, [
|
|
76
|
+
s("div", {
|
|
75
77
|
id: o(f),
|
|
76
78
|
ref_key: "client",
|
|
77
79
|
ref: v,
|
|
@@ -87,13 +89,13 @@ const P = { class: "scalar scalar-app" }, J = { class: "scalar-container" }, Q =
|
|
|
87
89
|
e.document.value && e.path?.value && e.method?.value ? (m(), u("main", X, [
|
|
88
90
|
l(o(G), {
|
|
89
91
|
modelValue: n.value,
|
|
90
|
-
"onUpdate:modelValue": t[0] || (t[0] = (
|
|
92
|
+
"onUpdate:modelValue": t[0] || (t[0] = (i) => n.value = i),
|
|
91
93
|
class: "absolute top-2 left-3 z-[10001]"
|
|
92
94
|
}, null, 8, ["modelValue"]),
|
|
93
95
|
k(l(o(K), {
|
|
94
96
|
sidebarWidth: c.value,
|
|
95
97
|
"onUpdate:sidebarWidth": [
|
|
96
|
-
t[1] || (t[1] = (
|
|
98
|
+
t[1] || (t[1] = (i) => c.value = i),
|
|
97
99
|
T
|
|
98
100
|
],
|
|
99
101
|
activeWorkspace: r,
|
|
@@ -125,15 +127,15 @@ const P = { class: "scalar scalar-app" }, J = { class: "scalar-container" }, Q =
|
|
|
125
127
|
workspaceStore: e.workspaceStore
|
|
126
128
|
}, null, 8, ["document", "documentSlug", "environment", "eventBus", "exampleName", "method", "options", "path", "plugins", "securitySchemes", "workspaceStore"])
|
|
127
129
|
])) : (m(), u("div", Y, [...t[3] || (t[3] = [
|
|
128
|
-
|
|
130
|
+
s("span", { class: "text-c-3" }, "No document selected", -1)
|
|
129
131
|
])]))
|
|
130
132
|
]),
|
|
131
133
|
_: 1
|
|
132
134
|
})
|
|
133
135
|
], 8, Q),
|
|
134
|
-
|
|
136
|
+
s("div", {
|
|
135
137
|
class: "scalar-app-exit",
|
|
136
|
-
onClick: t[2] || (t[2] = (
|
|
138
|
+
onClick: t[2] || (t[2] = (i) => e.modalState.hide())
|
|
137
139
|
})
|
|
138
140
|
])
|
|
139
141
|
], 512)), [
|
|
@@ -19,7 +19,7 @@ type __VLS_Props = {
|
|
|
19
19
|
label?: string;
|
|
20
20
|
};
|
|
21
21
|
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
22
|
-
updateRow: (idx: number, field: "
|
|
22
|
+
updateRow: (idx: number, field: "key" | "value", value: string) => any;
|
|
23
23
|
toggleRow: (idx: number, enabled: boolean) => any;
|
|
24
24
|
addRow: () => any;
|
|
25
25
|
deleteRow: (idx: number) => any;
|
|
@@ -28,7 +28,7 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
28
28
|
uploadFile: (idx: number) => any;
|
|
29
29
|
removeFile: (idx: number) => any;
|
|
30
30
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
31
|
-
onUpdateRow?: ((idx: number, field: "
|
|
31
|
+
onUpdateRow?: ((idx: number, field: "key" | "value", value: string) => any) | undefined;
|
|
32
32
|
onToggleRow?: ((idx: number, enabled: boolean) => any) | undefined;
|
|
33
33
|
onAddRow?: (() => any) | undefined;
|
|
34
34
|
onDeleteRow?: ((idx: number) => any) | undefined;
|
|
@@ -33,7 +33,7 @@ const W = { class: "flex-center relative flex flex-1 flex-col gap-6 p-2 capitali
|
|
|
33
33
|
}));
|
|
34
34
|
}, f = (u) => {
|
|
35
35
|
u?.createNew && g.name === "request" && p();
|
|
36
|
-
}, v = "2.
|
|
36
|
+
}, v = "2.22.0";
|
|
37
37
|
return q(() => a.hotKeys.on(f)), R(() => a.hotKeys.off(f)), (u, e) => (l(), n("div", W, [
|
|
38
38
|
s("div", {
|
|
39
39
|
class: y(["flex h-[calc(100%_-_50px)] flex-col items-center justify-center", {
|
package/package.json
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"rest",
|
|
19
19
|
"testing"
|
|
20
20
|
],
|
|
21
|
-
"version": "2.
|
|
21
|
+
"version": "2.22.0",
|
|
22
22
|
"engines": {
|
|
23
23
|
"node": ">=20"
|
|
24
24
|
},
|
|
@@ -221,11 +221,6 @@
|
|
|
221
221
|
"types": "./dist/v2/features/app/components/index.d.ts",
|
|
222
222
|
"default": "./dist/v2/features/app/components/index.js"
|
|
223
223
|
},
|
|
224
|
-
"./v2/features/command-palette/components": {
|
|
225
|
-
"import": "./dist/v2/features/command-palette/components/index.js",
|
|
226
|
-
"types": "./dist/v2/features/command-palette/components/index.d.ts",
|
|
227
|
-
"default": "./dist/v2/features/command-palette/components/index.js"
|
|
228
|
-
},
|
|
229
224
|
"./v2/features/environments": {
|
|
230
225
|
"import": "./dist/v2/features/environments/index.js",
|
|
231
226
|
"types": "./dist/v2/features/environments/index.d.ts",
|
|
@@ -323,34 +318,34 @@
|
|
|
323
318
|
"type-fest": "^5.3.1",
|
|
324
319
|
"vue": "^3.5.26",
|
|
325
320
|
"vue-router": "4.6.2",
|
|
326
|
-
"whatwg-mimetype": "
|
|
321
|
+
"whatwg-mimetype": "4.0.0",
|
|
327
322
|
"yaml": "^2.8.0",
|
|
328
323
|
"zod": "^4.3.5",
|
|
329
|
-
"@scalar/
|
|
324
|
+
"@scalar/draggable": "0.3.0",
|
|
330
325
|
"@scalar/analytics-client": "1.0.1",
|
|
326
|
+
"@scalar/components": "0.17.0",
|
|
331
327
|
"@scalar/helpers": "0.2.9",
|
|
332
|
-
"@scalar/draggable": "0.3.0",
|
|
333
|
-
"@scalar/import": "0.4.46",
|
|
334
328
|
"@scalar/icons": "0.5.2",
|
|
329
|
+
"@scalar/import": "0.4.46",
|
|
335
330
|
"@scalar/json-magic": "0.9.4",
|
|
336
|
-
"@scalar/oas-utils": "0.6.
|
|
337
|
-
"@scalar/object-utils": "1.2.23",
|
|
331
|
+
"@scalar/oas-utils": "0.6.30",
|
|
338
332
|
"@scalar/openapi-parser": "0.24.5",
|
|
339
333
|
"@scalar/openapi-types": "0.5.3",
|
|
340
|
-
"@scalar/sidebar": "0.7.21",
|
|
341
334
|
"@scalar/postman-to-openapi": "0.4.1",
|
|
342
|
-
"@scalar/
|
|
343
|
-
"@scalar/
|
|
344
|
-
"@scalar/
|
|
345
|
-
"@scalar/
|
|
346
|
-
"@scalar/use-hooks": "0.3.6",
|
|
335
|
+
"@scalar/object-utils": "1.2.23",
|
|
336
|
+
"@scalar/sidebar": "0.7.23",
|
|
337
|
+
"@scalar/types": "0.6.0",
|
|
338
|
+
"@scalar/snippetz": "0.6.9",
|
|
347
339
|
"@scalar/use-toasts": "0.9.1",
|
|
348
|
-
"@scalar/
|
|
340
|
+
"@scalar/themes": "0.14.0",
|
|
341
|
+
"@scalar/use-codemirror": "0.13.27",
|
|
342
|
+
"@scalar/workspace-store": "0.27.2",
|
|
343
|
+
"@scalar/use-hooks": "0.3.6"
|
|
349
344
|
},
|
|
350
345
|
"devDependencies": {
|
|
351
346
|
"@tailwindcss/vite": "^4.1.18",
|
|
352
347
|
"@types/shell-quote": "^1.7.5",
|
|
353
|
-
"@types/whatwg-mimetype": "
|
|
348
|
+
"@types/whatwg-mimetype": "3.0.2",
|
|
354
349
|
"@vitejs/plugin-vue": "^6.0.3",
|
|
355
350
|
"@vue/test-utils": "2.4.6",
|
|
356
351
|
"fake-indexeddb": "6.2.3",
|
|
@@ -360,8 +355,8 @@
|
|
|
360
355
|
"vite": "^7.3.1",
|
|
361
356
|
"vite-svg-loader": "5.1.0",
|
|
362
357
|
"vitest": "4.0.16",
|
|
363
|
-
"@scalar/
|
|
364
|
-
"@scalar/
|
|
358
|
+
"@scalar/galaxy": "0.5.12",
|
|
359
|
+
"@scalar/build-tooling": "0.4.1"
|
|
365
360
|
},
|
|
366
361
|
"scripts": {
|
|
367
362
|
"build": "scalar-build-vite",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TheCommandPalette.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/command-palette/components/TheCommandPalette.vue"],"names":[],"mappings":"AAoXA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAUvE,OAAO,KAAK,EAKV,4BAA4B,EAC7B,MAAM,+DAA+D,CAAA;AAItE;;;;;;;;;;;;;;;;;;;;GAoBG;;IAGD,gDAAgD;kBAClC,4BAA4B;IAC1C,iEAAiE;oBACjD,cAAc;IAC9B,8CAA8C;cACpC,iBAAiB;;IAL3B,gDAAgD;kBAClC,4BAA4B;IAC1C,iEAAiE;oBACjD,cAAc;IAC9B,8CAA8C;cACpC,iBAAiB;;AAP7B,wBA6dC"}
|
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
import { defineComponent as $, ref as N, computed as E, watch as _, createBlock as f, openBlock as l, unref as s, withCtx as p, createElementVNode as c, createVNode as i, createElementBlock as r, createTextVNode as I, createCommentVNode as v, withKeys as C, withModifiers as h, Fragment as S, renderList as O, withDirectives as K, toDisplayString as D, vShow as R, normalizeClass as V, resolveDynamicComponent as X, mergeProps as A, nextTick as Q } from "vue";
|
|
2
|
-
import { Dialog as F, DialogPanel as q, DialogTitle as H } from "@headlessui/vue";
|
|
3
|
-
import { ScalarIcon as x } from "@scalar/components";
|
|
4
|
-
import { useRouter as W } from "vue-router";
|
|
5
|
-
import j from "./CommandPaletteDocument.vue.js";
|
|
6
|
-
import G from "./CommandPaletteExample.vue.js";
|
|
7
|
-
import J from "./CommandPaletteImport.vue.js";
|
|
8
|
-
import U from "./CommandPaletteImportCurl.vue.js";
|
|
9
|
-
import Y from "./CommandPaletteRequest.vue.js";
|
|
10
|
-
import Z from "./CommandPaletteTag.vue.js";
|
|
11
|
-
const ee = {
|
|
12
|
-
key: 0,
|
|
13
|
-
class: "custom-scroll max-h-[50dvh] min-h-0 flex-1 rounded-lg p-1.5"
|
|
14
|
-
}, te = { class: "bg-b-2 focus-within:bg-b-1 sticky top-0 flex items-center rounded-md border border-transparent pl-2 shadow-[0_-8px_0_8px_var(--scalar-background-1),0_0_8px_8px_var(--scalar-background-1)] focus-within:border-(--scalar-background-3)" }, ae = { for: "commandmenu" }, ne = ["value", "onKeydown"], oe = ["id", "onClick"], le = {
|
|
15
|
-
key: 0,
|
|
16
|
-
class: "text-c-3 p-2 pt-3 text-center text-sm"
|
|
17
|
-
}, re = {
|
|
18
|
-
key: 1,
|
|
19
|
-
class: "flex-1 p-1.5"
|
|
20
|
-
}, se = {}, ye = /* @__PURE__ */ $({
|
|
21
|
-
...se,
|
|
22
|
-
__name: "TheCommandPalette",
|
|
23
|
-
props: {
|
|
24
|
-
paletteState: {},
|
|
25
|
-
workspaceStore: {},
|
|
26
|
-
eventBus: {}
|
|
27
|
-
},
|
|
28
|
-
setup(e) {
|
|
29
|
-
const T = {
|
|
30
|
-
"import-from-openapi-swagger-postman-curl": J,
|
|
31
|
-
"create-document": j,
|
|
32
|
-
"create-request": Y,
|
|
33
|
-
"add-tag": Z,
|
|
34
|
-
"add-example": G,
|
|
35
|
-
"import-curl-command": U
|
|
36
|
-
}, B = W(), m = N(-1), y = N(null), u = E(
|
|
37
|
-
() => e.paletteState.filteredCommands.value.flatMap((t) => t.commands)
|
|
38
|
-
), d = E(
|
|
39
|
-
() => u.value[m.value]
|
|
40
|
-
);
|
|
41
|
-
_(
|
|
42
|
-
() => e.paletteState.filterQuery.value,
|
|
43
|
-
(t) => {
|
|
44
|
-
m.value = t && u.value.length > 0 ? 0 : -1;
|
|
45
|
-
}
|
|
46
|
-
);
|
|
47
|
-
const P = (t) => {
|
|
48
|
-
e.paletteState.setFilterQuery(t), t.trim().toLowerCase().startsWith("curl") && e.paletteState.open("import-curl-command", { curl: t });
|
|
49
|
-
}, k = (t, a) => {
|
|
50
|
-
if (!e.paletteState.isOpen.value)
|
|
51
|
-
return;
|
|
52
|
-
a.preventDefault();
|
|
53
|
-
const n = t === "up" ? -1 : 1, o = u.value.length;
|
|
54
|
-
m.value = (m.value + n + o) % o;
|
|
55
|
-
}, z = (t) => {
|
|
56
|
-
!d.value || e.paletteState.activeCommand.value || (t.preventDefault(), t.stopPropagation(), b(d.value));
|
|
57
|
-
}, b = (t) => {
|
|
58
|
-
if (t.type === "route") {
|
|
59
|
-
B.push(t.to), w();
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
t.type === "folder" && e.paletteState.open(t.id, void 0);
|
|
63
|
-
}, g = () => {
|
|
64
|
-
e.paletteState.reset(), Q(() => y.value?.focus());
|
|
65
|
-
}, L = () => {
|
|
66
|
-
e.paletteState.close();
|
|
67
|
-
}, M = (...t) => {
|
|
68
|
-
e.paletteState.open(...t);
|
|
69
|
-
}, w = () => {
|
|
70
|
-
e.paletteState.close(), m.value = -1;
|
|
71
|
-
};
|
|
72
|
-
return (t, a) => (l(), f(s(F), {
|
|
73
|
-
open: e.paletteState.isOpen.value,
|
|
74
|
-
onClose: w
|
|
75
|
-
}, {
|
|
76
|
-
default: p(() => [
|
|
77
|
-
a[4] || (a[4] = c("div", { class: "commandmenu-overlay z-overlay" }, null, -1)),
|
|
78
|
-
i(s(q), { class: "commandmenu z-overlay flex flex-col" }, {
|
|
79
|
-
default: p(() => [
|
|
80
|
-
i(s(H), { class: "sr-only" }, {
|
|
81
|
-
default: p(() => [...a[3] || (a[3] = [
|
|
82
|
-
I("API Client Command Menu", -1)
|
|
83
|
-
])]),
|
|
84
|
-
_: 1
|
|
85
|
-
}),
|
|
86
|
-
e.paletteState.activeCommand.value ? (l(), r("div", re, [
|
|
87
|
-
c("button", {
|
|
88
|
-
class: "hover:bg-b-3 text-c-3 active:text-c-1 absolute z-1 mt-[0.5px] rounded p-1.5",
|
|
89
|
-
type: "button",
|
|
90
|
-
onClick: g
|
|
91
|
-
}, [
|
|
92
|
-
i(s(x), {
|
|
93
|
-
icon: "ChevronLeft",
|
|
94
|
-
size: "md",
|
|
95
|
-
thickness: "1.5"
|
|
96
|
-
})
|
|
97
|
-
]),
|
|
98
|
-
e.paletteState.activeCommand.value ? (l(), f(X(T[e.paletteState.activeCommand.value]), A({ key: 0 }, {
|
|
99
|
-
workspaceStore: e.workspaceStore,
|
|
100
|
-
eventBus: e.eventBus,
|
|
101
|
-
...e.paletteState.activeCommandProps.value
|
|
102
|
-
}, {
|
|
103
|
-
onBack: g,
|
|
104
|
-
onClose: L,
|
|
105
|
-
onOpenCommand: M
|
|
106
|
-
}), null, 16)) : v("", !0)
|
|
107
|
-
])) : (l(), r("div", ee, [
|
|
108
|
-
c("div", te, [
|
|
109
|
-
c("label", ae, [
|
|
110
|
-
i(s(x), {
|
|
111
|
-
class: "text-c-2 mr-2.5",
|
|
112
|
-
icon: "Search",
|
|
113
|
-
size: "md",
|
|
114
|
-
thickness: "1.5"
|
|
115
|
-
})
|
|
116
|
-
]),
|
|
117
|
-
c("input", {
|
|
118
|
-
id: "commandmenu",
|
|
119
|
-
ref_key: "commandInputRef",
|
|
120
|
-
ref: y,
|
|
121
|
-
autocomplete: "off",
|
|
122
|
-
autofocus: "",
|
|
123
|
-
class: "w-full rounded border-none bg-none py-1.5 text-sm focus:outline-none",
|
|
124
|
-
placeholder: "Search commands...",
|
|
125
|
-
type: "text",
|
|
126
|
-
value: e.paletteState.filterQuery.value,
|
|
127
|
-
onInput: a[0] || (a[0] = (n) => P(n.target.value)),
|
|
128
|
-
onKeydown: [
|
|
129
|
-
a[1] || (a[1] = C(h((n) => k("down", n), ["stop"]), ["down"])),
|
|
130
|
-
C(h(z, ["stop"]), ["enter"]),
|
|
131
|
-
a[2] || (a[2] = C(h((n) => k("up", n), ["stop"]), ["up"]))
|
|
132
|
-
]
|
|
133
|
-
}, null, 40, ne)
|
|
134
|
-
]),
|
|
135
|
-
(l(!0), r(S, null, O(e.paletteState.filteredCommands.value, (n) => (l(), r(S, {
|
|
136
|
-
key: n.label
|
|
137
|
-
}, [
|
|
138
|
-
K(c("div", { class: "text-c-3 mt-2 mb-1 px-2 text-xs font-medium" }, D(n.label), 513), [
|
|
139
|
-
[R, n.commands.length > 0]
|
|
140
|
-
]),
|
|
141
|
-
(l(!0), r(S, null, O(n.commands, (o) => (l(), r("button", {
|
|
142
|
-
id: o.id,
|
|
143
|
-
key: o.id,
|
|
144
|
-
class: V(["commandmenu-item hover:bg-b-2 flex w-full cursor-pointer items-center rounded px-2 py-1.5 text-left text-sm", {
|
|
145
|
-
"bg-b-2": o.id === d.value?.id
|
|
146
|
-
}]),
|
|
147
|
-
type: "button",
|
|
148
|
-
onClick: (me) => b(o)
|
|
149
|
-
}, [
|
|
150
|
-
"icon" in o ? (l(), f(s(x), {
|
|
151
|
-
key: 0,
|
|
152
|
-
class: "text-c-2 mr-2.5",
|
|
153
|
-
icon: o.icon,
|
|
154
|
-
size: "md",
|
|
155
|
-
thickness: "1.5"
|
|
156
|
-
}, null, 8, ["icon"])) : v("", !0),
|
|
157
|
-
I(" " + D(o.name), 1)
|
|
158
|
-
], 10, oe))), 128))
|
|
159
|
-
], 64))), 128)),
|
|
160
|
-
e.paletteState.filteredCommands.value.length ? v("", !0) : (l(), r("div", le, " No commands found "))
|
|
161
|
-
]))
|
|
162
|
-
]),
|
|
163
|
-
_: 1
|
|
164
|
-
})
|
|
165
|
-
]),
|
|
166
|
-
_: 1
|
|
167
|
-
}, 8, ["open"]));
|
|
168
|
-
}
|
|
169
|
-
});
|
|
170
|
-
export {
|
|
171
|
-
ye as default
|
|
172
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/command-palette/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,yBAAyB,CAAA"}
|