@scalar/api-client 2.27.1 → 2.29.2
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 +166 -0
- package/dist/components/ViewLayout/ViewLayoutSection.vue.d.ts.map +1 -1
- package/dist/components/ViewLayout/ViewLayoutSection.vue.js +1 -1
- package/dist/libs/local-storage.js +3 -3
- package/dist/style.css +1 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue.js +1 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue2.js +21 -21
- package/dist/v2/blocks/request-block/components/RequestBody.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestBody.vue.js +2 -2
- package/dist/v2/blocks/request-block/components/RequestBody.vue2.js +67 -75
- package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts +2 -0
- package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts +2 -0
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/helpers/get-default-headers.d.ts +1 -1
- package/dist/v2/blocks/request-block/helpers/get-default-headers.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/helpers/get-default-headers.js +20 -19
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts +2 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.js +42 -40
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.js +5 -5
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.d.ts +3 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.js +35 -35
- package/dist/v2/components/code-input/CodeInput.vue.d.ts.map +1 -1
- package/dist/v2/components/code-input/CodeInput.vue.js +2 -2
- package/dist/v2/components/sidebar/Sidebar.vue.d.ts.map +1 -1
- package/dist/v2/components/sidebar/Sidebar.vue.js +1 -1
- package/dist/v2/features/app/App.vue.d.ts.map +1 -1
- package/dist/v2/features/app/App.vue.js +70 -70
- package/dist/v2/features/app/app-events.d.ts +2 -1
- package/dist/v2/features/app/app-events.d.ts.map +1 -1
- package/dist/v2/features/app/app-events.js +89 -64
- package/dist/v2/features/app/app-state.d.ts +4 -2
- package/dist/v2/features/app/app-state.d.ts.map +1 -1
- package/dist/v2/features/app/app-state.js +185 -156
- package/dist/v2/features/app/components/AppSidebar.vue.d.ts.map +1 -1
- package/dist/v2/features/app/components/AppSidebar.vue.js +1 -1
- package/dist/v2/features/app/components/AppSidebar.vue2.js +48 -47
- package/dist/v2/features/app/components/DesktopTabs.vue.d.ts.map +1 -1
- package/dist/v2/features/app/components/DesktopTabs.vue.js +4 -4
- package/dist/v2/features/app/components/DownloadAppButton.vue.d.ts.map +1 -1
- package/dist/v2/features/app/components/DownloadAppButton.vue.js +1 -1
- package/dist/v2/features/app/components/DownloadAppButton.vue2.js +9 -9
- package/dist/v2/features/app/components/SidebarItemMenu.vue.d.ts.map +1 -1
- package/dist/v2/features/app/components/SidebarItemMenu.vue.js +71 -43
- package/dist/v2/features/app/helpers/routes.js +11 -11
- package/dist/v2/features/collection/WorkspaceCollection.vue.d.ts +1 -6
- package/dist/v2/features/collection/WorkspaceCollection.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/WorkspaceCollection.vue.js +38 -20
- package/dist/v2/features/collection/components/Authentication.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/Authentication.vue.js +2 -2
- package/dist/v2/features/collection/components/Authentication.vue2.js +20 -16
- package/dist/v2/features/collection/components/LabelInput.vue.d.ts +3 -0
- package/dist/v2/features/collection/components/LabelInput.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/LabelInput.vue.js +2 -2
- package/dist/v2/features/collection/components/LabelInput.vue2.js +20 -16
- package/dist/v2/features/collection/components/Settings.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/Settings.vue.js +18 -14
- package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.d.ts +7 -2
- package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.d.ts.map +1 -1
- package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.js +70 -71
- package/dist/v2/features/command-palette/components/{CommandPaletteDocument.vue.d.ts → CommandPaletteOpenApiDocument.vue.d.ts} +3 -3
- package/dist/v2/features/command-palette/components/CommandPaletteOpenApiDocument.vue.d.ts.map +1 -0
- package/dist/v2/features/command-palette/components/{CommandPaletteDocument.vue.js → CommandPaletteOpenApiDocument.vue.js} +15 -15
- package/dist/v2/features/command-palette/components/CommandPaletteOpenApiDocument.vue2.js +4 -0
- package/dist/v2/features/command-palette/components/CommandPaletteRequest.vue.d.ts +2 -2
- package/dist/v2/features/command-palette/components/CommandPaletteRequest.vue.d.ts.map +1 -1
- package/dist/v2/features/command-palette/components/CommandPaletteRequest.vue.js +10 -10
- package/dist/v2/features/command-palette/components/CommandPaletteTag.vue.d.ts +27 -5
- package/dist/v2/features/command-palette/components/CommandPaletteTag.vue.d.ts.map +1 -1
- package/dist/v2/features/command-palette/components/CommandPaletteTag.vue.js +80 -53
- package/dist/v2/features/command-palette/hooks/use-command-palette-state.d.ts +34 -9
- 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 +50 -44
- package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
- package/dist/v2/features/operation/Operation.vue.js +19 -15
- package/dist/v2/helpers/get-active-proxy-url.d.ts +18 -0
- package/dist/v2/helpers/get-active-proxy-url.d.ts.map +1 -0
- package/dist/v2/helpers/get-active-proxy-url.js +5 -0
- package/dist/v2/workspace-events.d.ts.map +1 -1
- package/dist/v2/workspace-events.js +123 -113
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/package.json +18 -18
- package/dist/v2/features/command-palette/components/CommandPaletteDocument.vue.d.ts.map +0 -1
- package/dist/v2/features/command-palette/components/CommandPaletteDocument.vue2.js +0 -4
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
const
|
|
6
|
-
...
|
|
1
|
+
import { defineComponent as m, ref as p, watch as i, createElementBlock as u, openBlock as d, createElementVNode as a, createVNode as l, unref as f, mergeProps as v } from "vue";
|
|
2
|
+
import { RouterView as _ } from "vue-router";
|
|
3
|
+
import k from "./components/LabelInput.vue.js";
|
|
4
|
+
import w from "./components/Tabs.vue.js";
|
|
5
|
+
const h = { class: "custom-scroll h-full" }, x = { class: "w-full md:mx-auto md:max-w-180" }, b = ["aria-label"], W = { class: "group relative ml-1.25" }, V = { class: "px-1.5 py-8" }, g = {}, S = /* @__PURE__ */ m({
|
|
6
|
+
...g,
|
|
7
7
|
__name: "WorkspaceCollection",
|
|
8
8
|
props: {
|
|
9
9
|
documentSlug: {},
|
|
@@ -20,27 +20,45 @@ const d = { class: "custom-scroll h-full" }, _ = { class: "w-full md:mx-auto md:
|
|
|
20
20
|
plugins: {},
|
|
21
21
|
customThemes: {}
|
|
22
22
|
},
|
|
23
|
-
setup(
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
setup(s) {
|
|
24
|
+
const e = s, o = p(e.activeWorkspace.label);
|
|
25
|
+
i(
|
|
26
|
+
() => e.activeWorkspace.label,
|
|
27
|
+
(t) => {
|
|
28
|
+
o.value = t;
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
const r = (t) => {
|
|
32
|
+
if (t.trim() === "") {
|
|
33
|
+
o.value = e.activeWorkspace.label;
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
e.eventBus.emit("workspace:update:name", t);
|
|
37
|
+
};
|
|
38
|
+
return (t, c) => (d(), u("div", h, [
|
|
39
|
+
a("div", x, [
|
|
40
|
+
a("div", {
|
|
41
|
+
"aria-label": `title: ${s.activeWorkspace.label}`,
|
|
29
42
|
class: "mx-auto flex h-fit w-full flex-row items-center gap-2 pt-8 pb-3 md:max-w-180"
|
|
30
43
|
}, [
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
44
|
+
a("div", W, [
|
|
45
|
+
l(k, {
|
|
46
|
+
modelValue: o.value,
|
|
47
|
+
"onUpdate:modelValue": c[0] || (c[0] = (n) => o.value = n),
|
|
48
|
+
class: "text-xl font-bold",
|
|
49
|
+
inputId: "workspaceName",
|
|
50
|
+
onBlur: r
|
|
51
|
+
}, null, 8, ["modelValue"])
|
|
34
52
|
])
|
|
35
|
-
], 8,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
53
|
+
], 8, b),
|
|
54
|
+
l(w, { type: "workspace" }),
|
|
55
|
+
a("div", V, [
|
|
56
|
+
l(f(_), v(e, { collectionType: "workspace" }), null, 16)
|
|
39
57
|
])
|
|
40
58
|
])
|
|
41
59
|
]));
|
|
42
60
|
}
|
|
43
61
|
});
|
|
44
62
|
export {
|
|
45
|
-
|
|
63
|
+
S as default
|
|
46
64
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Authentication.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/collection/components/Authentication.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Authentication.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/collection/components/Authentication.vue"],"names":[],"mappings":"AA6PA,QAAA,MAAM,YAAY;;;;;;;;;;;;kGAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import t from "./Authentication.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import o from "../../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const i = /* @__PURE__ */ o(t, [["__scopeId", "data-v-ac90d255"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
i as default
|
|
7
7
|
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { defineComponent as d, computed as
|
|
1
|
+
import { defineComponent as d, computed as i, createBlock as v, openBlock as y, withCtx as n, createElementVNode as a, normalizeClass as r, createVNode as s, unref as l, createTextVNode as u } from "vue";
|
|
2
2
|
import { ScalarToggle as h } from "@scalar/components";
|
|
3
|
-
import
|
|
4
|
-
import S from "../../../
|
|
5
|
-
|
|
3
|
+
import f from "../../settings/components/Section.vue.js";
|
|
4
|
+
import { getActiveProxyUrl as S } from "../../../helpers/get-active-proxy-url.js";
|
|
5
|
+
import p from "../../../blocks/scalar-auth-selector-block/components/AuthSelector.vue.js";
|
|
6
|
+
const x = { class: "flex h-8 items-center" }, V = /* @__PURE__ */ d({
|
|
6
7
|
__name: "Authentication",
|
|
7
8
|
props: {
|
|
8
9
|
documentSlug: {},
|
|
@@ -21,14 +22,14 @@ const f = { class: "flex h-8 items-center" }, B = /* @__PURE__ */ d({
|
|
|
21
22
|
collectionType: {}
|
|
22
23
|
},
|
|
23
24
|
setup(e) {
|
|
24
|
-
const o =
|
|
25
|
+
const o = i(
|
|
25
26
|
() => e.document?.["x-scalar-set-operation-security"] ?? !1
|
|
26
|
-
), m =
|
|
27
|
+
), m = i(
|
|
27
28
|
() => e.document?.servers?.find(
|
|
28
|
-
({ url:
|
|
29
|
+
({ url: c }) => c === e.document?.["x-scalar-selected-server"]
|
|
29
30
|
) ?? null
|
|
30
31
|
);
|
|
31
|
-
return (
|
|
32
|
+
return (c, t) => (y(), v(f, null, {
|
|
32
33
|
title: n(() => [...t[1] || (t[1] = [
|
|
33
34
|
u("Authentication", -1)
|
|
34
35
|
])]),
|
|
@@ -36,8 +37,8 @@ const f = { class: "flex h-8 items-center" }, B = /* @__PURE__ */ d({
|
|
|
36
37
|
u(" If enabled, all selected authentication will apply to all operations in this document. You can override this by disabling the toggle and authentication will then be applied at the operation level. ", -1)
|
|
37
38
|
])]),
|
|
38
39
|
actions: n(() => [
|
|
39
|
-
|
|
40
|
-
s(
|
|
40
|
+
a("div", x, [
|
|
41
|
+
s(l(h), {
|
|
41
42
|
class: "w-4",
|
|
42
43
|
modelValue: o.value,
|
|
43
44
|
"onUpdate:modelValue": t[0] || (t[0] = () => e.eventBus.emit("document:toggle:security"))
|
|
@@ -45,11 +46,11 @@ const f = { class: "flex h-8 items-center" }, B = /* @__PURE__ */ d({
|
|
|
45
46
|
])
|
|
46
47
|
]),
|
|
47
48
|
default: n(() => [
|
|
48
|
-
|
|
49
|
-
class:
|
|
49
|
+
a("div", {
|
|
50
|
+
class: r(!o.value && "cursor-not-allowed")
|
|
50
51
|
}, [
|
|
51
|
-
s(
|
|
52
|
-
class:
|
|
52
|
+
s(l(p), {
|
|
53
|
+
class: r([
|
|
53
54
|
"scalar-collection-auth border-none!",
|
|
54
55
|
!o.value && "pointer-events-none opacity-50 mix-blend-luminosity"
|
|
55
56
|
]),
|
|
@@ -57,7 +58,10 @@ const f = { class: "flex h-8 items-center" }, B = /* @__PURE__ */ d({
|
|
|
57
58
|
eventBus: e.eventBus,
|
|
58
59
|
isStatic: "",
|
|
59
60
|
meta: { type: "document" },
|
|
60
|
-
proxyUrl:
|
|
61
|
+
proxyUrl: l(S)(
|
|
62
|
+
e.workspaceStore.workspace["x-scalar-active-proxy"],
|
|
63
|
+
e.layout
|
|
64
|
+
) ?? "",
|
|
61
65
|
securityRequirements: e.document?.security ?? [],
|
|
62
66
|
securitySchemes: e.securitySchemes,
|
|
63
67
|
selectedSecurity: e.workspaceStore.auth.getAuthSelectedSchemas({
|
|
@@ -74,5 +78,5 @@ const f = { class: "flex h-8 items-center" }, B = /* @__PURE__ */ d({
|
|
|
74
78
|
}
|
|
75
79
|
});
|
|
76
80
|
export {
|
|
77
|
-
|
|
81
|
+
V as default
|
|
78
82
|
};
|
|
@@ -3,8 +3,11 @@ type __VLS_ModelProps = {
|
|
|
3
3
|
};
|
|
4
4
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
5
5
|
"update:modelValue": (value: string) => any;
|
|
6
|
+
} & {
|
|
7
|
+
blur: (value: string) => any;
|
|
6
8
|
}, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
|
|
7
9
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
10
|
+
onBlur?: ((value: string) => any) | undefined;
|
|
8
11
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
9
12
|
declare const _default: typeof __VLS_export;
|
|
10
13
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LabelInput.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/collection/components/LabelInput.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LabelInput.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/collection/components/LabelInput.vue"],"names":[],"mappings":"AAgEA,KAAK,gBAAgB,GAAG;IACxB,UAAU,EAAE,MAAM,CAAC;CAClB,CAAC;AAgFF,QAAA,MAAM,YAAY;;;;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./LabelInput.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-9a6458fc"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
f as default
|
|
7
7
|
};
|
|
@@ -1,29 +1,33 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
const
|
|
1
|
+
import { defineComponent as a, mergeModels as m, useModel as p, useId as c, createElementBlock as f, openBlock as v, createElementVNode as n, withDirectives as h, unref as u, withKeys as x, vModelText as _ } from "vue";
|
|
2
|
+
const b = { class: "group pointer-events-none flex flex-1 items-center gap-1" }, g = ["for"], w = ["id"], M = /* @__PURE__ */ a({
|
|
3
3
|
__name: "LabelInput",
|
|
4
4
|
props: {
|
|
5
5
|
modelValue: { required: !0 },
|
|
6
6
|
modelModifiers: {}
|
|
7
7
|
},
|
|
8
|
-
emits: ["update:modelValue"],
|
|
9
|
-
setup(
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
emits: /* @__PURE__ */ m(["blur"], ["update:modelValue"]),
|
|
9
|
+
setup(r, { emit: s }) {
|
|
10
|
+
const i = s, t = p(r, "modelValue"), o = c(), d = () => {
|
|
11
|
+
i("blur", t.value);
|
|
12
|
+
};
|
|
13
|
+
return (V, e) => (v(), f("div", b, [
|
|
14
|
+
n("label", {
|
|
13
15
|
class: "pointer-events-auto absolute top-0 left-0 h-full w-full cursor-text opacity-0",
|
|
14
|
-
for:
|
|
15
|
-
}, null, 8,
|
|
16
|
-
|
|
17
|
-
id:
|
|
18
|
-
"onUpdate:modelValue":
|
|
16
|
+
for: u(o)
|
|
17
|
+
}, null, 8, g),
|
|
18
|
+
h(n("input", {
|
|
19
|
+
id: u(o),
|
|
20
|
+
"onUpdate:modelValue": e[0] || (e[0] = (l) => t.value = l),
|
|
19
21
|
class: "text-c-1 group-hover-input pointer-events-auto relative z-10 -ml-0.5 h-8 w-full flex-1 rounded pl-1.25 has-[:focus-visible]:outline md:-ml-1.25",
|
|
20
|
-
placeholder: "Untitled Document"
|
|
21
|
-
|
|
22
|
-
[
|
|
22
|
+
placeholder: "Untitled Document",
|
|
23
|
+
onBlur: d,
|
|
24
|
+
onKeydown: e[1] || (e[1] = x((l) => l.target?.blur(), ["enter"]))
|
|
25
|
+
}, null, 40, w), [
|
|
26
|
+
[_, t.value]
|
|
23
27
|
])
|
|
24
28
|
]));
|
|
25
29
|
}
|
|
26
30
|
});
|
|
27
31
|
export {
|
|
28
|
-
|
|
32
|
+
M as default
|
|
29
33
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Settings.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/collection/components/Settings.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Settings.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/collection/components/Settings.vue"],"names":[],"mappings":"AA8MA,QAAA,MAAM,YAAY;;;;;;;;;;;;kGAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as d, createBlock as a, openBlock as n, unref as o } from "vue";
|
|
2
|
+
import { getActiveProxyUrl as i } from "../../../helpers/get-active-proxy-url.js";
|
|
2
3
|
import s from "../../settings/DocumentSettings.vue.js";
|
|
3
|
-
import
|
|
4
|
-
const
|
|
4
|
+
import h from "../../settings/CollectionSettings.vue.js";
|
|
5
|
+
const f = /* @__PURE__ */ d({
|
|
5
6
|
__name: "Settings",
|
|
6
7
|
props: {
|
|
7
8
|
documentSlug: {},
|
|
@@ -22,33 +23,36 @@ const x = /* @__PURE__ */ r({
|
|
|
22
23
|
setup(e) {
|
|
23
24
|
const m = (t) => {
|
|
24
25
|
e.eventBus.emit("document:update:watch-mode", t);
|
|
25
|
-
}, u = (t) => {
|
|
26
|
-
e.eventBus.emit("workspace:update:theme", t);
|
|
27
26
|
}, l = (t) => {
|
|
27
|
+
e.eventBus.emit("workspace:update:theme", t);
|
|
28
|
+
}, u = (t) => {
|
|
28
29
|
e.eventBus.emit("workspace:update:active-proxy", t);
|
|
29
|
-
},
|
|
30
|
+
}, r = (t) => {
|
|
30
31
|
e.eventBus.emit("workspace:update:color-mode", t);
|
|
31
32
|
};
|
|
32
|
-
return (t,
|
|
33
|
+
return (t, c) => e.collectionType === "document" ? (n(), a(o(s), {
|
|
33
34
|
key: 0,
|
|
34
35
|
documentUrl: e.document?.["x-scalar-original-source-url"],
|
|
35
36
|
isDraftDocument: e.documentSlug === "drafts",
|
|
36
37
|
title: e.document?.info.title ?? "",
|
|
37
38
|
watchMode: e.document?.["x-scalar-watch-mode"],
|
|
38
|
-
"onDelete:document":
|
|
39
|
+
"onDelete:document": c[0] || (c[0] = (v) => e.eventBus.emit("document:delete:document", { name: e.documentSlug })),
|
|
39
40
|
"onUpdate:watchMode": m
|
|
40
|
-
}, null, 8, ["documentUrl", "isDraftDocument", "title", "watchMode"])) : (
|
|
41
|
+
}, null, 8, ["documentUrl", "isDraftDocument", "title", "watchMode"])) : (n(), a(o(h), {
|
|
41
42
|
key: 1,
|
|
42
|
-
activeProxyUrl:
|
|
43
|
+
activeProxyUrl: o(i)(
|
|
44
|
+
e.workspaceStore.workspace["x-scalar-active-proxy"],
|
|
45
|
+
e.layout
|
|
46
|
+
),
|
|
43
47
|
activeThemeSlug: e.workspaceStore.workspace["x-scalar-theme"] ?? "none",
|
|
44
48
|
colorMode: e.workspaceStore.workspace["x-scalar-color-mode"] ?? "system",
|
|
45
49
|
customThemes: e.customThemes,
|
|
46
|
-
"onUpdate:colorMode":
|
|
47
|
-
"onUpdate:proxyUrl":
|
|
48
|
-
"onUpdate:themeSlug":
|
|
50
|
+
"onUpdate:colorMode": r,
|
|
51
|
+
"onUpdate:proxyUrl": u,
|
|
52
|
+
"onUpdate:themeSlug": l
|
|
49
53
|
}, null, 8, ["activeProxyUrl", "activeThemeSlug", "colorMode", "customThemes"]));
|
|
50
54
|
}
|
|
51
55
|
});
|
|
52
56
|
export {
|
|
53
|
-
|
|
57
|
+
f as default
|
|
54
58
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { WorkspaceStore } from '@scalar/workspace-store/client';
|
|
2
|
+
import type { WorkspaceEventBus } from '@scalar/workspace-store/events';
|
|
2
3
|
/**
|
|
3
4
|
* Command Palette Example Component
|
|
4
5
|
*
|
|
@@ -18,8 +19,10 @@ export default _default;
|
|
|
18
19
|
declare const __VLS_export: import("vue").DefineComponent<{
|
|
19
20
|
/** The workspace store for accessing documents and operations */
|
|
20
21
|
workspaceStore: WorkspaceStore;
|
|
22
|
+
/** Event bus for emitting operation creation events */
|
|
23
|
+
eventBus: WorkspaceEventBus;
|
|
21
24
|
/** Document id to create the example for */
|
|
22
|
-
|
|
25
|
+
documentName?: string;
|
|
23
26
|
/** Preselected path and method to create the example for */
|
|
24
27
|
operationId?: string;
|
|
25
28
|
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
@@ -28,8 +31,10 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
28
31
|
}, string, import("vue").PublicProps, Readonly<{
|
|
29
32
|
/** The workspace store for accessing documents and operations */
|
|
30
33
|
workspaceStore: WorkspaceStore;
|
|
34
|
+
/** Event bus for emitting operation creation events */
|
|
35
|
+
eventBus: WorkspaceEventBus;
|
|
31
36
|
/** Document id to create the example for */
|
|
32
|
-
|
|
37
|
+
documentName?: string;
|
|
33
38
|
/** Preselected path and method to create the example for */
|
|
34
39
|
operationId?: string;
|
|
35
40
|
}> & Readonly<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommandPaletteExample.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/command-palette/components/CommandPaletteExample.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CommandPaletteExample.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/command-palette/components/CommandPaletteExample.vue"],"names":[],"mappings":"AAoSA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAavE;;;;;;;;;;;;;GAaG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAKzC,QAAA,MAAM,YAAY;IAEhB,iEAAiE;oBACjD,cAAc;IAC9B,uDAAuD;cAC7C,iBAAiB;IAC3B,4CAA4C;mBAC7B,MAAM;IACrB,4DAA4D;kBAC9C,MAAM;;;;;IAPpB,iEAAiE;oBACjD,cAAc;IAC9B,uDAAuD;cAC7C,iBAAiB;IAC3B,4CAA4C;mBAC7B,MAAM;IACrB,4DAA4D;kBAC9C,MAAM;;;;kFAyclB,CAAC"}
|
|
@@ -1,103 +1,102 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarListbox as T, ScalarButton as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import q from "./
|
|
6
|
-
|
|
7
|
-
const H = { class: "flex flex-1 gap-1" }, J = {
|
|
1
|
+
import { defineComponent as I, ref as h, computed as p, watch as $, createBlock as x, openBlock as u, withCtx as s, createVNode as i, createTextVNode as O, createElementVNode as r, unref as c, normalizeClass as j, toDisplayString as b, createElementBlock as w, createCommentVNode as z, Fragment as U, renderList as L } from "vue";
|
|
2
|
+
import { ScalarListbox as T, ScalarButton as C, ScalarIcon as y, ScalarDropdown as A, ScalarDropdownItem as F } from "@scalar/components";
|
|
3
|
+
import D from "../../../blocks/operation-code-sample/components/HttpMethod.vue.js";
|
|
4
|
+
import P from "./CommandActionForm.vue.js";
|
|
5
|
+
import q from "./CommandActionInput.vue.js";
|
|
6
|
+
const G = { class: "flex flex-1 gap-1" }, H = {
|
|
8
7
|
key: 0,
|
|
9
8
|
class: "text-c-1 truncate"
|
|
10
|
-
},
|
|
9
|
+
}, J = {
|
|
11
10
|
key: 1,
|
|
12
11
|
class: "text-c-3"
|
|
13
|
-
},
|
|
12
|
+
}, K = { class: "flex items-center gap-2" }, M = { class: "custom-scroll max-h-40" }, Q = { class: "truncate" }, R = {
|
|
14
13
|
name: "CommandPaletteExample"
|
|
15
|
-
},
|
|
16
|
-
...
|
|
14
|
+
}, te = /* @__PURE__ */ I({
|
|
15
|
+
...R,
|
|
17
16
|
props: {
|
|
18
17
|
workspaceStore: {},
|
|
19
|
-
|
|
18
|
+
eventBus: {},
|
|
19
|
+
documentName: {},
|
|
20
20
|
operationId: {}
|
|
21
21
|
},
|
|
22
22
|
emits: ["close", "back"],
|
|
23
|
-
setup(
|
|
24
|
-
const k =
|
|
25
|
-
() => Object.entries(
|
|
23
|
+
setup(n, { emit: V }) {
|
|
24
|
+
const k = V, v = h(""), g = p(() => v.value.trim()), f = p(
|
|
25
|
+
() => Object.entries(n.workspaceStore.workspace.documents).map(
|
|
26
26
|
([e, a]) => ({
|
|
27
27
|
id: e,
|
|
28
28
|
label: a.info.title || e
|
|
29
29
|
})
|
|
30
30
|
)
|
|
31
31
|
), l = h(
|
|
32
|
-
|
|
33
|
-
),
|
|
32
|
+
n.documentName ? f.value.find((e) => e.id === n.documentName) : f.value[0] ?? void 0
|
|
33
|
+
), N = (e) => {
|
|
34
34
|
const a = [];
|
|
35
35
|
for (const t of e)
|
|
36
|
-
t.type === "operation" && a.push(t), "children" in t && t.children && a.push(...
|
|
36
|
+
t.type === "operation" && a.push(t), "children" in t && t.children && a.push(...N(t.children));
|
|
37
37
|
return a;
|
|
38
|
-
},
|
|
38
|
+
}, m = p(() => {
|
|
39
39
|
if (!l.value)
|
|
40
40
|
return [];
|
|
41
|
-
const e =
|
|
41
|
+
const e = n.workspaceStore.workspace.documents[l.value.id];
|
|
42
42
|
if (!e || !e["x-scalar-navigation"])
|
|
43
43
|
return [];
|
|
44
44
|
const a = e["x-scalar-navigation"];
|
|
45
|
-
return
|
|
45
|
+
return N(a.children ?? []).map((d) => ({
|
|
46
46
|
id: d.id,
|
|
47
47
|
label: `${d.method.toUpperCase()} ${d.path}`,
|
|
48
48
|
path: d.path,
|
|
49
49
|
method: d.method
|
|
50
50
|
}));
|
|
51
51
|
}), o = h(
|
|
52
|
-
|
|
53
|
-
(e) => e.id ===
|
|
52
|
+
n.operationId ? m.value.find(
|
|
53
|
+
(e) => e.id === n.operationId
|
|
54
54
|
) : void 0
|
|
55
55
|
);
|
|
56
|
-
|
|
56
|
+
$(
|
|
57
57
|
l,
|
|
58
58
|
() => {
|
|
59
|
-
o.value =
|
|
60
|
-
(e) => e.id ===
|
|
61
|
-
) :
|
|
59
|
+
o.value = n.operationId ? m.value.find(
|
|
60
|
+
(e) => e.id === n.operationId
|
|
61
|
+
) : m.value[0] ?? void 0;
|
|
62
62
|
},
|
|
63
63
|
{ immediate: !0 }
|
|
64
64
|
);
|
|
65
|
-
const
|
|
65
|
+
const _ = (e) => {
|
|
66
66
|
e && (o.value = e);
|
|
67
|
-
},
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
}
|
|
67
|
+
}, S = p(() => !g.value || !l.value || !o.value), B = () => {
|
|
68
|
+
S.value || !l.value || !o.value || (n.eventBus.emit("operation:create:draft-example", {
|
|
69
|
+
documentName: l.value.id,
|
|
70
|
+
meta: {
|
|
71
|
+
path: o.value.path,
|
|
72
|
+
method: o.value.method
|
|
73
|
+
},
|
|
74
|
+
exampleName: g.value
|
|
76
75
|
}), k("close"));
|
|
77
|
-
},
|
|
76
|
+
}, E = (e) => {
|
|
78
77
|
k("back", e);
|
|
79
78
|
};
|
|
80
|
-
return (e, a) => (u(), x(
|
|
81
|
-
disabled:
|
|
82
|
-
onSubmit:
|
|
79
|
+
return (e, a) => (u(), x(P, {
|
|
80
|
+
disabled: S.value,
|
|
81
|
+
onSubmit: B
|
|
83
82
|
}, {
|
|
84
|
-
options:
|
|
85
|
-
|
|
83
|
+
options: s(() => [
|
|
84
|
+
r("div", G, [
|
|
86
85
|
i(c(T), {
|
|
87
86
|
modelValue: l.value,
|
|
88
87
|
"onUpdate:modelValue": a[1] || (a[1] = (t) => l.value = t),
|
|
89
88
|
options: f.value
|
|
90
89
|
}, {
|
|
91
|
-
default:
|
|
92
|
-
i(c(
|
|
90
|
+
default: s(() => [
|
|
91
|
+
i(c(C), {
|
|
93
92
|
class: "hover:bg-b-2 max-h-8 w-[150px] min-w-[150px] justify-between gap-1 p-2 text-xs",
|
|
94
93
|
variant: "outlined"
|
|
95
94
|
}, {
|
|
96
|
-
default:
|
|
97
|
-
|
|
98
|
-
class:
|
|
95
|
+
default: s(() => [
|
|
96
|
+
r("span", {
|
|
97
|
+
class: j(l.value ? "text-c-1 truncate" : "text-c-3")
|
|
99
98
|
}, b(l.value ? l.value.label : "Select Document"), 3),
|
|
100
|
-
i(c(
|
|
99
|
+
i(c(y), {
|
|
101
100
|
class: "text-c-3",
|
|
102
101
|
icon: "ChevronDown",
|
|
103
102
|
size: "md"
|
|
@@ -112,16 +111,16 @@ const H = { class: "flex flex-1 gap-1" }, J = {
|
|
|
112
111
|
placement: "bottom",
|
|
113
112
|
resize: ""
|
|
114
113
|
}, {
|
|
115
|
-
items:
|
|
116
|
-
|
|
117
|
-
(u(!0), w(
|
|
114
|
+
items: s(() => [
|
|
115
|
+
r("div", M, [
|
|
116
|
+
(u(!0), w(U, null, L(m.value, (t) => (u(), x(c(F), {
|
|
118
117
|
key: t.id,
|
|
119
118
|
class: "flex h-7 w-full items-center justify-between px-1 pr-[26px]",
|
|
120
|
-
onClick: (d) =>
|
|
119
|
+
onClick: (d) => _(t)
|
|
121
120
|
}, {
|
|
122
|
-
default:
|
|
123
|
-
|
|
124
|
-
i(
|
|
121
|
+
default: s(() => [
|
|
122
|
+
r("span", Q, b(t.path), 1),
|
|
123
|
+
i(D, {
|
|
125
124
|
method: t.method
|
|
126
125
|
}, null, 8, ["method"])
|
|
127
126
|
]),
|
|
@@ -129,20 +128,20 @@ const H = { class: "flex flex-1 gap-1" }, J = {
|
|
|
129
128
|
}, 1032, ["onClick"]))), 128))
|
|
130
129
|
])
|
|
131
130
|
]),
|
|
132
|
-
default:
|
|
133
|
-
i(c(
|
|
131
|
+
default: s(() => [
|
|
132
|
+
i(c(C), {
|
|
134
133
|
class: "hover:bg-b-2 max-h-8 w-full justify-between gap-1 p-2 text-xs",
|
|
135
|
-
disabled: !
|
|
134
|
+
disabled: !m.value.length,
|
|
136
135
|
variant: "outlined"
|
|
137
136
|
}, {
|
|
138
|
-
default:
|
|
139
|
-
o.value ? (u(), w("span",
|
|
140
|
-
|
|
141
|
-
o.value ? (u(), x(
|
|
137
|
+
default: s(() => [
|
|
138
|
+
o.value ? (u(), w("span", H, b(o.value.path), 1)) : (u(), w("span", J, " Select Operation ")),
|
|
139
|
+
r("div", K, [
|
|
140
|
+
o.value ? (u(), x(D, {
|
|
142
141
|
key: 0,
|
|
143
142
|
method: o.value.method
|
|
144
|
-
}, null, 8, ["method"])) :
|
|
145
|
-
i(c(
|
|
143
|
+
}, null, 8, ["method"])) : z("", !0),
|
|
144
|
+
i(c(y), {
|
|
146
145
|
class: "text-c-3",
|
|
147
146
|
icon: "ChevronDown",
|
|
148
147
|
size: "md"
|
|
@@ -156,16 +155,16 @@ const H = { class: "flex flex-1 gap-1" }, J = {
|
|
|
156
155
|
})
|
|
157
156
|
])
|
|
158
157
|
]),
|
|
159
|
-
submit:
|
|
160
|
-
|
|
158
|
+
submit: s(() => [...a[2] || (a[2] = [
|
|
159
|
+
O("Create Example", -1)
|
|
161
160
|
])]),
|
|
162
|
-
default:
|
|
163
|
-
i(
|
|
161
|
+
default: s(() => [
|
|
162
|
+
i(q, {
|
|
164
163
|
modelValue: v.value,
|
|
165
164
|
"onUpdate:modelValue": a[0] || (a[0] = (t) => v.value = t),
|
|
166
165
|
label: "Example Name",
|
|
167
166
|
placeholder: "Example Name",
|
|
168
|
-
onDelete:
|
|
167
|
+
onDelete: E
|
|
169
168
|
}, null, 8, ["modelValue"])
|
|
170
169
|
]),
|
|
171
170
|
_: 1
|
|
@@ -173,5 +172,5 @@ const H = { class: "flex flex-1 gap-1" }, J = {
|
|
|
173
172
|
}
|
|
174
173
|
});
|
|
175
174
|
export {
|
|
176
|
-
|
|
175
|
+
te as default
|
|
177
176
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import type { WorkspaceStore } from '@scalar/workspace-store/client';
|
|
2
2
|
import type { WorkspaceEventBus } from '@scalar/workspace-store/events';
|
|
3
3
|
/**
|
|
4
|
-
* Command Palette Document Component
|
|
4
|
+
* Command Palette OpenAPI Document Component
|
|
5
5
|
*
|
|
6
6
|
* Provides a form for creating a new empty document in the workspace.
|
|
7
7
|
* Users can name the document and select an icon before creation.
|
|
8
8
|
* Validates that the name is not empty and not already in use.
|
|
9
9
|
*
|
|
10
10
|
* @example
|
|
11
|
-
* <
|
|
11
|
+
* <CommandPaletteOpenApiDocument
|
|
12
12
|
* :workspaceStore="workspaceStore"
|
|
13
13
|
* :eventBus="eventBus"
|
|
14
14
|
* @close="handleClose"
|
|
@@ -34,4 +34,4 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
34
34
|
onClose?: (() => any) | undefined;
|
|
35
35
|
onBack?: ((keyboardEvent: KeyboardEvent) => any) | undefined;
|
|
36
36
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
37
|
-
//# sourceMappingURL=
|
|
37
|
+
//# sourceMappingURL=CommandPaletteOpenApiDocument.vue.d.ts.map
|
package/dist/v2/features/command-palette/components/CommandPaletteOpenApiDocument.vue.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CommandPaletteOpenApiDocument.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/command-palette/components/CommandPaletteOpenApiDocument.vue"],"names":[],"mappings":"AAwIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAUvE;;;;;;;;;;;;;;GAcG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAGzC,QAAA,MAAM,YAAY;IAEhB,2DAA2D;oBAC3C,cAAc;IAC9B,sDAAsD;cAC5C,iBAAiB;;;;;IAH3B,2DAA2D;oBAC3C,cAAc;IAC9B,sDAAsD;cAC5C,iBAAiB;;;;kFAwMzB,CAAC"}
|