@scalar/api-client 2.22.2 → 2.23.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 +27 -0
- package/dist/style.css +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 +9 -9
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts.map +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 +100 -91
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.d.ts +2 -0
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.js +2 -2
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue2.js +43 -37
- package/dist/v2/components/layout/ValueEmitter.vue.d.ts +6 -2
- package/dist/v2/components/layout/ValueEmitter.vue.d.ts.map +1 -1
- package/dist/v2/components/layout/ValueEmitter.vue.js +10 -10
- package/dist/v2/components/server/ServerDropdown.vue.d.ts +2 -0
- package/dist/v2/components/server/ServerDropdown.vue.d.ts.map +1 -1
- package/dist/v2/components/server/ServerDropdown.vue.js +48 -42
- package/dist/v2/features/app/App.vue.d.ts.map +1 -1
- package/dist/v2/features/app/App.vue.js +117 -89
- package/dist/v2/features/app/app-state.d.ts +23 -12
- package/dist/v2/features/app/app-state.d.ts.map +1 -1
- package/dist/v2/features/app/app-state.js +228 -196
- package/dist/v2/features/app/helpers/routes.d.ts +1 -1
- package/dist/v2/features/app/helpers/routes.d.ts.map +1 -1
- package/dist/v2/features/app/helpers/routes.js +33 -27
- package/dist/v2/features/import-listener/ImportListener.vue.d.ts +52 -0
- package/dist/v2/features/import-listener/ImportListener.vue.d.ts.map +1 -0
- package/dist/v2/features/import-listener/ImportListener.vue.js +91 -0
- package/dist/v2/features/import-listener/ImportListener.vue2.js +4 -0
- package/dist/v2/features/import-listener/components/DropEventListener.vue.d.ts +7 -0
- package/dist/v2/features/import-listener/components/DropEventListener.vue.d.ts.map +1 -0
- package/dist/v2/features/import-listener/components/DropEventListener.vue.js +81 -0
- package/dist/v2/features/import-listener/components/DropEventListener.vue2.js +4 -0
- package/dist/v2/features/import-listener/components/ImportModal.vue.d.ts +40 -0
- package/dist/v2/features/import-listener/components/ImportModal.vue.d.ts.map +1 -0
- package/dist/v2/features/import-listener/components/ImportModal.vue.js +170 -0
- package/dist/v2/features/import-listener/components/ImportModal.vue3.js +5 -0
- package/dist/v2/features/import-listener/components/WorkspaceSelector.vue.d.ts +29 -0
- package/dist/v2/features/import-listener/components/WorkspaceSelector.vue.d.ts.map +1 -0
- package/dist/v2/features/import-listener/components/WorkspaceSelector.vue.js +83 -0
- package/dist/v2/features/import-listener/components/WorkspaceSelector.vue2.js +4 -0
- package/dist/v2/features/import-listener/helpers/generate-unique-slug.d.ts +16 -0
- package/dist/v2/features/import-listener/helpers/generate-unique-slug.d.ts.map +1 -0
- package/dist/v2/features/import-listener/helpers/generate-unique-slug.js +11 -0
- package/dist/v2/features/import-listener/helpers/get-url-query-parameter.d.ts +8 -0
- package/dist/v2/features/import-listener/helpers/get-url-query-parameter.d.ts.map +1 -0
- package/dist/v2/features/import-listener/helpers/get-url-query-parameter.js +4 -0
- package/dist/v2/features/import-listener/helpers/import-document-to-workspace.d.ts +30 -0
- package/dist/v2/features/import-listener/helpers/import-document-to-workspace.d.ts.map +1 -0
- package/dist/v2/features/import-listener/helpers/import-document-to-workspace.js +31 -0
- package/dist/v2/features/import-listener/helpers/load-document-from-source.d.ts +15 -0
- package/dist/v2/features/import-listener/helpers/load-document-from-source.d.ts.map +1 -0
- package/dist/v2/features/import-listener/helpers/load-document-from-source.js +28 -0
- package/dist/v2/features/import-listener/helpers/wait-for-condition.d.ts +15 -0
- package/dist/v2/features/import-listener/helpers/wait-for-condition.d.ts.map +1 -0
- package/dist/v2/features/import-listener/helpers/wait-for-condition.js +16 -0
- package/dist/v2/features/import-listener/index.d.ts +2 -0
- package/dist/v2/features/import-listener/index.d.ts.map +1 -0
- package/dist/v2/features/import-listener/index.js +4 -0
- package/dist/v2/features/operation/Operation.vue.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/package.json +16 -11
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { defineComponent as y, computed as
|
|
2
|
-
import { ScalarPopover as B, ScalarButton as
|
|
3
|
-
import { ScalarIconPlus as V, ScalarIconPencilSimple as
|
|
1
|
+
import { defineComponent as y, computed as m, createBlock as f, openBlock as o, unref as n, withCtx as u, createVNode as l, createElementBlock as d, Fragment as v, createElementVNode as s, createTextVNode as U, toDisplayString as C, createCommentVNode as w, renderList as h } from "vue";
|
|
2
|
+
import { ScalarPopover as B, ScalarButton as $, ScalarFloatingBackdrop as N } from "@scalar/components";
|
|
3
|
+
import { ScalarIconPlus as V, ScalarIconPencilSimple as z } from "@scalar/icons";
|
|
4
|
+
import D from "../layout/ValueEmitter.vue.js";
|
|
4
5
|
import I from "./ServerDropdownItem.vue.js";
|
|
5
|
-
const P = ["onClick"],
|
|
6
|
+
const P = ["onClick"], q = { class: "flex items-center justify-center" }, A = /* @__PURE__ */ y({
|
|
6
7
|
__name: "ServerDropdown",
|
|
7
8
|
props: {
|
|
8
9
|
servers: {},
|
|
@@ -10,64 +11,69 @@ const P = ["onClick"], $ = { class: "flex items-center justify-center" }, W = /*
|
|
|
10
11
|
target: {},
|
|
11
12
|
layout: {}
|
|
12
13
|
},
|
|
13
|
-
emits: ["update:selectedServer", "update:variable", "update:servers"],
|
|
14
|
-
setup(
|
|
15
|
-
const
|
|
16
|
-
() =>
|
|
17
|
-
id:
|
|
18
|
-
label:
|
|
14
|
+
emits: ["update:selectedServer", "update:variable", "update:servers", "update:open"],
|
|
15
|
+
setup(t, { emit: x }) {
|
|
16
|
+
const a = x, S = m(
|
|
17
|
+
() => t.servers.map((i) => ({
|
|
18
|
+
id: i.url,
|
|
19
|
+
label: i.url ?? "Unknown server"
|
|
19
20
|
}))
|
|
20
|
-
),
|
|
21
|
-
return (
|
|
21
|
+
), b = m(() => t.server?.url?.endsWith("/") ? t.server.url.slice(0, -1) : t.server?.url || "");
|
|
22
|
+
return (i, e) => (o(), f(n(B), {
|
|
22
23
|
class: "max-h-[inherit] p-0 text-base",
|
|
23
24
|
focus: "",
|
|
24
25
|
offset: 0,
|
|
25
|
-
placement: "bottom
|
|
26
|
+
placement: "bottom",
|
|
26
27
|
resize: "",
|
|
27
|
-
target:
|
|
28
|
-
teleport: `#${
|
|
28
|
+
target: t.target,
|
|
29
|
+
teleport: `#${t.target}`
|
|
29
30
|
}, {
|
|
30
|
-
popover:
|
|
31
|
+
popover: u(({ close: p }) => [
|
|
31
32
|
s("div", {
|
|
32
|
-
class: "custom-scroll flex max-h-[inherit] flex-col gap-1
|
|
33
|
-
onClick:
|
|
33
|
+
class: "custom-scroll flex max-h-[inherit] flex-col gap-1 p-1",
|
|
34
|
+
onClick: p
|
|
34
35
|
}, [
|
|
35
|
-
(
|
|
36
|
-
key:
|
|
37
|
-
server:
|
|
38
|
-
serverOption:
|
|
36
|
+
(o(!0), d(v, null, h(S.value, (r, g) => (o(), f(I, {
|
|
37
|
+
key: r.id,
|
|
38
|
+
server: t.server,
|
|
39
|
+
serverOption: r,
|
|
39
40
|
type: "request",
|
|
40
|
-
"onUpdate:selectedServer": (
|
|
41
|
-
"onUpdate:variable": (
|
|
41
|
+
"onUpdate:selectedServer": (c) => a("update:selectedServer", { url: r.id }),
|
|
42
|
+
"onUpdate:variable": (c, k) => a("update:variable", { index: g, key: c, value: k })
|
|
42
43
|
}, null, 8, ["server", "serverOption", "onUpdate:selectedServer", "onUpdate:variable"]))), 128)),
|
|
43
|
-
|
|
44
|
+
t.layout !== "modal" ? (o(), d("button", {
|
|
44
45
|
key: 0,
|
|
45
46
|
class: "text-xxs hover:bg-b-2 flex cursor-pointer items-center gap-1.5 rounded p-1.75",
|
|
46
47
|
type: "button",
|
|
47
|
-
onClick:
|
|
48
|
+
onClick: e[0] || (e[0] = (r) => a("update:servers"))
|
|
48
49
|
}, [
|
|
49
|
-
s("div",
|
|
50
|
-
n(
|
|
50
|
+
s("div", q, [
|
|
51
|
+
l(n(z), { class: "size-4" })
|
|
51
52
|
]),
|
|
52
|
-
|
|
53
|
+
e[5] || (e[5] = s("span", null, "Update Servers", -1))
|
|
53
54
|
])) : w("", !0)
|
|
54
55
|
], 8, P)
|
|
55
56
|
]),
|
|
56
|
-
backdrop:
|
|
57
|
-
|
|
57
|
+
backdrop: u(({ open: p }) => [
|
|
58
|
+
l(D, {
|
|
59
|
+
value: p,
|
|
60
|
+
onChange: e[1] || (e[1] = (r) => a("update:open", r)),
|
|
61
|
+
onUnmount: e[2] || (e[2] = (r) => a("update:open", !1))
|
|
62
|
+
}, null, 8, ["value"]),
|
|
63
|
+
l(n(N), { class: "inset-x-px rounded-none rounded-b-lg" })
|
|
58
64
|
]),
|
|
59
|
-
default:
|
|
60
|
-
n(
|
|
61
|
-
class: "
|
|
65
|
+
default: u(() => [
|
|
66
|
+
l(n($), {
|
|
67
|
+
class: "hover:bg-b-2 font-code text-c-2 ml-0.75 h-auto gap-0.75 rounded border px-1.5 text-base whitespace-nowrap",
|
|
62
68
|
variant: "ghost"
|
|
63
69
|
}, {
|
|
64
|
-
default:
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
], 64)) : (
|
|
69
|
-
|
|
70
|
-
n(
|
|
70
|
+
default: u(() => [
|
|
71
|
+
t.server ? (o(), d(v, { key: 0 }, [
|
|
72
|
+
e[3] || (e[3] = s("span", { class: "sr-only" }, "Server:", -1)),
|
|
73
|
+
U(" " + C(b.value), 1)
|
|
74
|
+
], 64)) : (o(), d(v, { key: 1 }, [
|
|
75
|
+
e[4] || (e[4] = s("span", { class: "sr-only" }, "Add Server", -1)),
|
|
76
|
+
l(n(V), { class: "size-3" })
|
|
71
77
|
], 64))
|
|
72
78
|
]),
|
|
73
79
|
_: 1
|
|
@@ -78,5 +84,5 @@ const P = ["onClick"], $ = { class: "flex items-center justify-center" }, W = /*
|
|
|
78
84
|
}
|
|
79
85
|
});
|
|
80
86
|
export {
|
|
81
|
-
|
|
87
|
+
A as default
|
|
82
88
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"App.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/app/App.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"App.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/app/App.vue"],"names":[],"mappings":"AA6PA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAGxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oDAAoD,CAAA;AAC7F,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAA;AAM3C;;;;GAIG;;YAGO,OAAO,CAAC,YAAY,EAAE,OAAO,CAAC;cAC5B,YAAY,EAAE;iBACX,MAAM,QAAQ;4BACH,MAAM,mBAAmB;;;;YAHzC,OAAO,CAAC,YAAY,EAAE,OAAO,CAAC;cAC5B,YAAY,EAAE;iBACX,MAAM,QAAQ;4BACH,MAAM,mBAAmB;;IAUjD;;;OAGG;4BACqB,EAAE;;AAnB5B,wBAsYC;AAOD,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1,20 +1,24 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as W, computed as d, createBlock as p, openBlock as i, unref as t, withCtx as u, createElementVNode as m, createVNode as n, createElementBlock as v, renderSlot as T, normalizeProps as y, guardReactiveProps as h } from "vue";
|
|
2
2
|
import { useModal as g, ScalarTeleportRoot as C } from "@scalar/components";
|
|
3
|
-
import { getThemeStyles as
|
|
4
|
-
import { ScalarToasts as
|
|
5
|
-
import { extensions as
|
|
6
|
-
import { RouterView as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { useDocumentWatcher as
|
|
3
|
+
import { getThemeStyles as x } from "@scalar/themes";
|
|
4
|
+
import { ScalarToasts as B } from "@scalar/use-toasts";
|
|
5
|
+
import { extensions as M } from "@scalar/workspace-store/schemas/extensions";
|
|
6
|
+
import { RouterView as E } from "vue-router";
|
|
7
|
+
import O from "./components/CreateWorkspaceModal.vue.js";
|
|
8
|
+
import _ from "./components/SplashScreen.vue.js";
|
|
9
|
+
import { useDocumentWatcher as A } from "./hooks/use-document-watcher.js";
|
|
10
10
|
import U from "../command-palette/TheCommandPalette.vue.js";
|
|
11
|
-
import { useColorMode as
|
|
12
|
-
import { useGlobalHotKeys as
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
import { useColorMode as D } from "../../hooks/use-color-mode.js";
|
|
12
|
+
import { useGlobalHotKeys as I } from "../../hooks/use-global-hot-keys.js";
|
|
13
|
+
import L from "./components/AppSidebar.vue.js";
|
|
14
|
+
import N from "./components/DesktopTabs.vue.js";
|
|
15
|
+
import $ from "./components/WebTopNav.vue.js";
|
|
16
|
+
import P from "../import-listener/ImportListener.vue.js";
|
|
17
|
+
const H = ["innerHTML"], F = {
|
|
18
|
+
key: 0,
|
|
19
|
+
class: "flex flex-1 flex-col"
|
|
20
|
+
}, V = { class: "flex min-h-0 flex-1" }, R = { class: "bg-b-1 flex-1" }, z = { key: 1 }, G = {}, le = /* @__PURE__ */ W({
|
|
21
|
+
...G,
|
|
18
22
|
__name: "App",
|
|
19
23
|
props: {
|
|
20
24
|
layout: {},
|
|
@@ -22,99 +26,123 @@ const P = ["innerHTML"], F = { class: "flex min-h-0 flex-1" }, H = { class: "bg-
|
|
|
22
26
|
getAppState: { type: Function },
|
|
23
27
|
getCommandPaletteState: { type: Function }
|
|
24
28
|
},
|
|
25
|
-
setup(
|
|
26
|
-
|
|
27
|
-
openCreateWorkspace: () =>
|
|
29
|
+
setup(s, { expose: k }) {
|
|
30
|
+
k({
|
|
31
|
+
openCreateWorkspace: () => c.show()
|
|
28
32
|
});
|
|
29
|
-
const e =
|
|
30
|
-
typeof window < "u" && (window.dataDumpWorkspace = () => e.store.value, window.dumpAppState = () => e)
|
|
31
|
-
|
|
33
|
+
const e = s.getAppState(), w = s.getCommandPaletteState();
|
|
34
|
+
typeof window < "u" && (window.dataDumpWorkspace = () => e.store.value, window.dumpAppState = () => e);
|
|
35
|
+
const { isDarkMode: f } = D({ workspaceStore: e.store });
|
|
36
|
+
I(e.eventBus, s.layout), A({
|
|
37
|
+
documentName: () => e.store.value?.workspace[M.workspace.activeDocument],
|
|
32
38
|
store: e.store,
|
|
33
39
|
initialTimeout: 5e3
|
|
34
40
|
});
|
|
35
|
-
const
|
|
41
|
+
const S = d(() => {
|
|
36
42
|
if (e.store.value === null)
|
|
37
43
|
return "";
|
|
38
|
-
const
|
|
39
|
-
return
|
|
40
|
-
}),
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
const r = e.store.value.workspace["x-scalar-theme"];
|
|
45
|
+
return r ? `<style>${x(r)}</style>` : "";
|
|
46
|
+
}), l = (r) => {
|
|
47
|
+
if (!r)
|
|
48
|
+
return;
|
|
49
|
+
const a = e.workspace.workspaceList.value?.find(
|
|
50
|
+
(o) => o.id === r
|
|
51
|
+
);
|
|
52
|
+
a && e.workspace.navigateToWorkspace(a.namespace, a.slug);
|
|
53
|
+
}, c = g(), b = d(() => ({
|
|
46
54
|
documentSlug: e.activeEntities.documentSlug.value ?? "",
|
|
47
55
|
document: e.store.value?.workspace.activeDocument ?? null,
|
|
48
56
|
environment: e.environment.value,
|
|
49
57
|
eventBus: e.eventBus,
|
|
50
58
|
exampleName: e.activeEntities.exampleName.value,
|
|
51
|
-
layout:
|
|
59
|
+
layout: s.layout,
|
|
52
60
|
method: e.activeEntities.method.value,
|
|
53
61
|
path: e.activeEntities.path.value,
|
|
54
62
|
workspaceStore: e.store.value,
|
|
55
63
|
activeWorkspace: e.workspace.activeWorkspace.value,
|
|
56
|
-
plugins:
|
|
64
|
+
plugins: s.plugins,
|
|
57
65
|
securitySchemes: e.document.value?.components?.securitySchemes ?? {}
|
|
58
66
|
}));
|
|
59
|
-
return (
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
"
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
"
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
67
|
+
return (r, a) => (i(), p(t(C), null, {
|
|
68
|
+
default: u(() => [
|
|
69
|
+
m("div", { innerHTML: S.value }, null, 8, H),
|
|
70
|
+
n(t(B)),
|
|
71
|
+
n(t(P), {
|
|
72
|
+
activeWorkspace: t(e).workspace.activeWorkspace.value,
|
|
73
|
+
darkMode: t(f),
|
|
74
|
+
workspaceStore: t(e).store.value,
|
|
75
|
+
workspaces: t(e).workspace.workspaceList.value,
|
|
76
|
+
"onCreate:workspace": a[4] || (a[4] = (o) => t(e).workspace.create(o)),
|
|
77
|
+
"onNavigateTo:document": a[5] || (a[5] = (o) => t(e).router.value?.push({
|
|
78
|
+
name: "document.overview",
|
|
79
|
+
params: {
|
|
80
|
+
documentSlug: o
|
|
81
|
+
}
|
|
82
|
+
})),
|
|
83
|
+
"onSelect:workspace": l
|
|
84
|
+
}, {
|
|
85
|
+
default: u(() => [
|
|
86
|
+
t(e).store.value !== null && t(e).workspace.activeWorkspace.value !== null && !t(e).loading.value ? (i(), v("main", F, [
|
|
87
|
+
s.layout === "desktop" ? (i(), p(N, {
|
|
88
|
+
key: 0,
|
|
89
|
+
activeTabIndex: t(e).tabs.activeTabIndex.value,
|
|
90
|
+
eventBus: t(e).eventBus,
|
|
91
|
+
tabs: t(e).tabs.state.value
|
|
92
|
+
}, null, 8, ["activeTabIndex", "eventBus", "tabs"])) : (i(), p($, {
|
|
93
|
+
key: 1,
|
|
94
|
+
activeWorkspace: t(e).workspace.activeWorkspace.value,
|
|
95
|
+
workspaces: t(e).workspace.workspaceList.value,
|
|
96
|
+
"onCreate:workspace": a[0] || (a[0] = (o) => t(c).show()),
|
|
97
|
+
"onSelect:workspace": l
|
|
98
|
+
}, null, 8, ["activeWorkspace", "workspaces"])),
|
|
99
|
+
m("div", V, [
|
|
100
|
+
n(L, {
|
|
101
|
+
isSidebarOpen: t(e).sidebar.isOpen.value,
|
|
102
|
+
"onUpdate:isSidebarOpen": a[1] || (a[1] = (o) => t(e).sidebar.isOpen.value = o),
|
|
103
|
+
activeWorkspace: t(e).workspace.activeWorkspace.value,
|
|
104
|
+
eventBus: t(e).eventBus,
|
|
105
|
+
isWorkspaceOpen: t(e).workspace.isOpen.value,
|
|
106
|
+
layout: s.layout,
|
|
107
|
+
sidebarState: t(e).sidebar.state,
|
|
108
|
+
sidebarWidth: t(e).sidebar.width.value,
|
|
109
|
+
store: t(e).store.value,
|
|
110
|
+
workspaces: t(e).workspace.workspaceList.value,
|
|
111
|
+
"onClick:workspace": t(e).workspace.navigateToWorkspace,
|
|
112
|
+
"onCreate:workspace": a[2] || (a[2] = (o) => t(c).show()),
|
|
113
|
+
"onSelect:workspace": l,
|
|
114
|
+
onSelectItem: t(e).sidebar.handleSelectItem,
|
|
115
|
+
"onUpdate:sidebarWidth": t(e).sidebar.handleSidebarWidthUpdate
|
|
116
|
+
}, {
|
|
117
|
+
sidebarMenuActions: u(() => [
|
|
118
|
+
T(r.$slots, "sidebar-menu-actions")
|
|
119
|
+
]),
|
|
120
|
+
_: 3
|
|
121
|
+
}, 8, ["isSidebarOpen", "activeWorkspace", "eventBus", "isWorkspaceOpen", "layout", "sidebarState", "sidebarWidth", "store", "workspaces", "onClick:workspace", "onSelectItem", "onUpdate:sidebarWidth"]),
|
|
122
|
+
m("div", R, [
|
|
123
|
+
n(t(E), y(h(b.value)), null, 16)
|
|
124
|
+
])
|
|
96
125
|
]),
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
state
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
paletteState
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
], 64)) : (l(), c(A, { key: 1 }));
|
|
126
|
+
n(O, {
|
|
127
|
+
state: t(c),
|
|
128
|
+
"onCreate:workspace": a[3] || (a[3] = (o) => t(e).workspace.create(o))
|
|
129
|
+
}, null, 8, ["state"]),
|
|
130
|
+
n(U, {
|
|
131
|
+
eventBus: t(e).eventBus,
|
|
132
|
+
paletteState: t(w),
|
|
133
|
+
workspaceStore: t(e).store.value
|
|
134
|
+
}, null, 8, ["eventBus", "paletteState", "workspaceStore"])
|
|
135
|
+
])) : (i(), v("main", z, [
|
|
136
|
+
n(_)
|
|
137
|
+
]))
|
|
138
|
+
]),
|
|
139
|
+
_: 3
|
|
140
|
+
}, 8, ["activeWorkspace", "darkMode", "workspaceStore", "workspaces"])
|
|
141
|
+
]),
|
|
142
|
+
_: 3
|
|
143
|
+
}));
|
|
116
144
|
}
|
|
117
145
|
});
|
|
118
146
|
export {
|
|
119
|
-
|
|
147
|
+
le as default
|
|
120
148
|
};
|
|
@@ -8,18 +8,22 @@ import type { Tab } from '@scalar/workspace-store/schemas/extensions/workspace/x
|
|
|
8
8
|
import type { TraversedEntry } from '@scalar/workspace-store/schemas/navigation';
|
|
9
9
|
import { type ComputedRef, type Ref, type ShallowRef } from 'vue';
|
|
10
10
|
import type { RouteLocationNormalizedGeneric, Router } from 'vue-router';
|
|
11
|
+
type WorkspaceOption = ScalarListboxOption & {
|
|
12
|
+
teamUid: string;
|
|
13
|
+
namespace: string;
|
|
14
|
+
slug: string;
|
|
15
|
+
};
|
|
11
16
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* whether the previous route path should be loaded via a query parameter.
|
|
17
|
+
* Navigates to the overview page of the specified workspace.
|
|
18
|
+
* Updates the route based on the given namespace and slug.
|
|
15
19
|
*
|
|
16
|
-
* @param
|
|
17
|
-
* @param
|
|
20
|
+
* @param namespace - The workspace namespace.
|
|
21
|
+
* @param slug - The unique workspace slug (identifier).
|
|
18
22
|
*/
|
|
19
|
-
declare const
|
|
23
|
+
declare const navigateToWorkspace: (namespace?: string, slug?: string) => Promise<void>;
|
|
20
24
|
/**
|
|
21
25
|
* Creates a new workspace with the provided name.
|
|
22
|
-
* - Generates a unique
|
|
26
|
+
* - Generates a unique slug for the workspace (sluggified from the name and guaranteed unique).
|
|
23
27
|
* - Adds a default blank document ("drafts") to the workspace.
|
|
24
28
|
* - Persists the workspace and navigates to it.
|
|
25
29
|
*
|
|
@@ -27,12 +31,18 @@ declare const setWorkspaceId: (id?: string) => Promise<void>;
|
|
|
27
31
|
* await createWorkspace({ name: 'My Awesome API' })
|
|
28
32
|
* // -> Navigates to /workspace/my-awesome-api (if available)
|
|
29
33
|
*/
|
|
30
|
-
declare const createWorkspace: ({
|
|
31
|
-
|
|
34
|
+
declare const createWorkspace: ({ key, name, }: {
|
|
35
|
+
key?: {
|
|
36
|
+
teamUid?: string;
|
|
37
|
+
namespace?: string;
|
|
38
|
+
slug: string;
|
|
39
|
+
};
|
|
32
40
|
name: string;
|
|
33
41
|
}) => Promise<{
|
|
34
|
-
|
|
42
|
+
slug: string;
|
|
35
43
|
name: string;
|
|
44
|
+
namespace: string;
|
|
45
|
+
teamUid: string;
|
|
36
46
|
} | undefined>;
|
|
37
47
|
declare const sidebarState: {
|
|
38
48
|
items: ComputedRef<TraversedEntry[]>;
|
|
@@ -110,9 +120,9 @@ export type AppState = {
|
|
|
110
120
|
};
|
|
111
121
|
workspace: {
|
|
112
122
|
create: typeof createWorkspace;
|
|
113
|
-
workspaceList: Ref<
|
|
123
|
+
workspaceList: Ref<WorkspaceOption[]>;
|
|
114
124
|
activeWorkspace: ShallowRef<ScalarListboxOption | null>;
|
|
115
|
-
|
|
125
|
+
navigateToWorkspace: typeof navigateToWorkspace;
|
|
116
126
|
isOpen: ComputedRef<boolean>;
|
|
117
127
|
};
|
|
118
128
|
eventBus: WorkspaceEventBus;
|
|
@@ -120,6 +130,7 @@ export type AppState = {
|
|
|
120
130
|
currentRoute: Ref<RouteLocationNormalizedGeneric | null>;
|
|
121
131
|
loading: Ref<boolean>;
|
|
122
132
|
activeEntities: {
|
|
133
|
+
namespace: Ref<string | undefined>;
|
|
123
134
|
workspaceSlug: Ref<string | undefined>;
|
|
124
135
|
documentSlug: Ref<string | undefined>;
|
|
125
136
|
path: Ref<string | undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-state.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/app/app-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAG7D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AAGnE,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,gCAAgC,CAAA;AAC1F,OAAO,EAEL,KAAK,iBAAiB,EAEvB,MAAM,gCAAgC,CAAA;AAKvC,OAAO,KAAK,EAAa,iBAA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