@scalar/api-client 2.29.4 → 2.31.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/style.css +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts +9 -69
- package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.js +74 -76
- package/dist/v2/blocks/operation-block/components/Header.vue.d.ts +15 -8
- package/dist/v2/blocks/operation-block/components/Header.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/components/Header.vue.js +2 -2
- package/dist/v2/blocks/operation-block/components/Header.vue2.js +29 -28
- package/dist/v2/blocks/operation-code-sample/helpers/get-resolved-ref-deep.d.ts +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/get-resolved-ref-deep.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/get-resolved-ref-deep.js +18 -21
- package/dist/v2/blocks/request-block/RequestBlock.vue.js +1 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue2.js +2 -2
- package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts +12 -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 +12 -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.js +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts +13 -8
- 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 +97 -85
- package/dist/v2/components/server/ServerDropdown.vue.d.ts +16 -5
- package/dist/v2/components/server/ServerDropdown.vue.d.ts.map +1 -1
- package/dist/v2/components/server/ServerDropdown.vue.js +27 -24
- package/dist/v2/features/app/app-events.d.ts.map +1 -1
- package/dist/v2/features/app/app-events.js +29 -14
- package/dist/v2/features/app/app-state.d.ts.map +1 -1
- package/dist/v2/features/app/app-state.js +57 -57
- 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 +171 -148
- package/dist/v2/features/app/helpers/routes.d.ts +42 -12
- package/dist/v2/features/app/helpers/routes.d.ts.map +1 -1
- package/dist/v2/features/app/helpers/routes.js +57 -26
- package/dist/v2/features/collection/OperationCollection.vue.d.ts +6 -0
- package/dist/v2/features/collection/OperationCollection.vue.d.ts.map +1 -0
- package/dist/v2/features/collection/OperationCollection.vue.js +83 -0
- package/dist/v2/features/collection/OperationCollection.vue2.js +4 -0
- package/dist/v2/features/collection/components/Authentication.vue.d.ts +2 -2
- 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 +99 -49
- package/dist/v2/features/collection/components/Cookies.vue.d.ts +9 -4
- package/dist/v2/features/collection/components/Cookies.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/Cookies.vue.js +12 -10
- package/dist/v2/features/collection/components/Environment.vue.d.ts +9 -4
- package/dist/v2/features/collection/components/Environment.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/Environment.vue.js +18 -16
- package/dist/v2/features/collection/components/LabelInput.vue.d.ts +6 -2
- 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 -18
- package/dist/v2/features/collection/components/Overview.vue.d.ts +2 -2
- package/dist/v2/features/collection/components/Overview.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/Overview.vue.js +1 -1
- package/dist/v2/features/collection/components/Overview.vue2.js +177 -75
- package/dist/v2/features/collection/components/Servers.vue.d.ts +2 -2
- package/dist/v2/features/collection/components/Servers.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/Servers.vue.js +154 -98
- package/dist/v2/features/collection/components/Settings.vue.d.ts +2 -2
- package/dist/v2/features/collection/components/Tabs.vue.d.ts +2 -1
- package/dist/v2/features/collection/components/Tabs.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/Tabs.vue.js +25 -27
- package/dist/v2/features/collection/helpers/get-default-operation-security-toggle.d.ts +12 -0
- package/dist/v2/features/collection/helpers/get-default-operation-security-toggle.d.ts.map +1 -0
- package/dist/v2/features/collection/helpers/get-default-operation-security-toggle.js +13 -0
- package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
- package/dist/v2/features/operation/Operation.vue.js +61 -63
- package/dist/v2/features/operation/helpers/get-selected-security.d.ts +5 -3
- package/dist/v2/features/operation/helpers/get-selected-security.d.ts.map +1 -1
- package/dist/v2/features/operation/helpers/get-selected-security.js +7 -8
- package/dist/v2/features/operation/helpers/get-selected-server.d.ts +8 -6
- package/dist/v2/features/operation/helpers/get-selected-server.d.ts.map +1 -1
- package/dist/v2/features/operation/helpers/get-selected-server.js +2 -2
- package/dist/v2/workspace-events.d.ts.map +1 -1
- package/dist/v2/workspace-events.js +25 -15
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/package.json +12 -12
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import { defineComponent as y, computed as
|
|
1
|
+
import { defineComponent as y, computed as p, createBlock as f, openBlock as a, unref as o, 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
2
|
import { ScalarPopover as B, ScalarButton as $, ScalarFloatingBackdrop as N } from "@scalar/components";
|
|
3
3
|
import { ScalarIconPlus as V, ScalarIconPencilSimple as z } from "@scalar/icons";
|
|
4
4
|
import D from "../layout/ValueEmitter.vue.js";
|
|
5
5
|
import I from "./ServerDropdownItem.vue.js";
|
|
6
|
-
const P = ["onClick"], q = { class: "flex items-center justify-center" },
|
|
7
|
-
|
|
6
|
+
const P = ["onClick"], q = { class: "flex items-center justify-center" }, E = {
|
|
7
|
+
name: "ServerDropdown"
|
|
8
|
+
}, L = /* @__PURE__ */ y({
|
|
9
|
+
...E,
|
|
8
10
|
props: {
|
|
11
|
+
meta: {},
|
|
9
12
|
servers: {},
|
|
10
13
|
server: {},
|
|
11
14
|
target: {},
|
|
@@ -13,13 +16,13 @@ const P = ["onClick"], q = { class: "flex items-center justify-center" }, A = /*
|
|
|
13
16
|
},
|
|
14
17
|
emits: ["update:selectedServer", "update:variable", "update:servers", "update:open"],
|
|
15
18
|
setup(t, { emit: x }) {
|
|
16
|
-
const
|
|
19
|
+
const n = x, S = p(
|
|
17
20
|
() => t.servers.map((i) => ({
|
|
18
21
|
id: i.url,
|
|
19
22
|
label: i.url ?? "Unknown server"
|
|
20
23
|
}))
|
|
21
|
-
), b =
|
|
22
|
-
return (i, e) => (
|
|
24
|
+
), b = p(() => t.server?.url?.endsWith("/") ? t.server.url.slice(0, -1) : t.server?.url || "");
|
|
25
|
+
return (i, e) => (a(), f(o(B), {
|
|
23
26
|
class: "max-h-[inherit] p-0 text-base",
|
|
24
27
|
focus: "",
|
|
25
28
|
offset: 0,
|
|
@@ -28,52 +31,52 @@ const P = ["onClick"], q = { class: "flex items-center justify-center" }, A = /*
|
|
|
28
31
|
target: t.target,
|
|
29
32
|
teleport: `#${t.target}`
|
|
30
33
|
}, {
|
|
31
|
-
popover: u(({ close:
|
|
34
|
+
popover: u(({ close: m }) => [
|
|
32
35
|
s("div", {
|
|
33
36
|
class: "custom-scroll flex max-h-[inherit] flex-col gap-1 p-1",
|
|
34
|
-
onClick:
|
|
37
|
+
onClick: m
|
|
35
38
|
}, [
|
|
36
|
-
(
|
|
39
|
+
(a(!0), d(v, null, h(S.value, (r, g) => (a(), f(I, {
|
|
37
40
|
key: r.id,
|
|
38
41
|
server: t.server,
|
|
39
42
|
serverOption: r,
|
|
40
43
|
type: "request",
|
|
41
|
-
"onUpdate:selectedServer": (c) =>
|
|
42
|
-
"onUpdate:variable": (c, k) =>
|
|
44
|
+
"onUpdate:selectedServer": (c) => n("update:selectedServer", { url: r.id, meta: t.meta }),
|
|
45
|
+
"onUpdate:variable": (c, k) => n("update:variable", { index: g, key: c, value: k, meta: t.meta })
|
|
43
46
|
}, null, 8, ["server", "serverOption", "onUpdate:selectedServer", "onUpdate:variable"]))), 128)),
|
|
44
|
-
t.layout !== "modal" ? (
|
|
47
|
+
t.layout !== "modal" ? (a(), d("button", {
|
|
45
48
|
key: 0,
|
|
46
49
|
class: "text-xxs hover:bg-b-2 flex cursor-pointer items-center gap-1.5 rounded p-1.75",
|
|
47
50
|
type: "button",
|
|
48
|
-
onClick: e[0] || (e[0] = (r) =>
|
|
51
|
+
onClick: e[0] || (e[0] = (r) => n("update:servers"))
|
|
49
52
|
}, [
|
|
50
53
|
s("div", q, [
|
|
51
|
-
l(
|
|
54
|
+
l(o(z), { class: "size-4" })
|
|
52
55
|
]),
|
|
53
56
|
e[5] || (e[5] = s("span", null, "Update Servers", -1))
|
|
54
57
|
])) : w("", !0)
|
|
55
58
|
], 8, P)
|
|
56
59
|
]),
|
|
57
|
-
backdrop: u(({ open:
|
|
60
|
+
backdrop: u(({ open: m }) => [
|
|
58
61
|
l(D, {
|
|
59
|
-
value:
|
|
60
|
-
onChange: e[1] || (e[1] = (r) =>
|
|
61
|
-
onUnmount: e[2] || (e[2] = (r) =>
|
|
62
|
+
value: m,
|
|
63
|
+
onChange: e[1] || (e[1] = (r) => n("update:open", r)),
|
|
64
|
+
onUnmount: e[2] || (e[2] = (r) => n("update:open", !1))
|
|
62
65
|
}, null, 8, ["value"]),
|
|
63
|
-
l(
|
|
66
|
+
l(o(N), { class: "inset-x-px rounded-none rounded-b-lg" })
|
|
64
67
|
]),
|
|
65
68
|
default: u(() => [
|
|
66
|
-
l(
|
|
69
|
+
l(o($), {
|
|
67
70
|
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",
|
|
68
71
|
variant: "ghost"
|
|
69
72
|
}, {
|
|
70
73
|
default: u(() => [
|
|
71
|
-
t.server ? (
|
|
74
|
+
t.server ? (a(), d(v, { key: 0 }, [
|
|
72
75
|
e[3] || (e[3] = s("span", { class: "sr-only" }, "Server:", -1)),
|
|
73
76
|
U(" " + C(b.value), 1)
|
|
74
|
-
], 64)) : (
|
|
77
|
+
], 64)) : (a(), d(v, { key: 1 }, [
|
|
75
78
|
e[4] || (e[4] = s("span", { class: "sr-only" }, "Add Server", -1)),
|
|
76
|
-
l(
|
|
79
|
+
l(o(V), { class: "size-3" })
|
|
77
80
|
], 64))
|
|
78
81
|
]),
|
|
79
82
|
_: 1
|
|
@@ -84,5 +87,5 @@ const P = ["onClick"], q = { class: "flex items-center justify-center" }, A = /*
|
|
|
84
87
|
}
|
|
85
88
|
});
|
|
86
89
|
export {
|
|
87
|
-
|
|
90
|
+
L as default
|
|
88
91
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-events.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/app/app-events.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAC7F,OAAO,EAAE,KAAK,UAAU,EAAY,MAAM,KAAK,CAAA;AAC/C,OAAO,EAAiD,KAAK,MAAM,EAAE,MAAM,YAAY,CAAA;AAKvF,wBAAgB,0BAA0B,CAAC,EACzC,QAAQ,EACR,KAAK,EACL,MAAM,EACN,cAAc,EACd,oBAAoB,EACpB,mBAAmB,EACnB,sBAAsB,EACtB,YAAY,EACZ,eAAe,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C,EAAE,MAAM,KAAK,IAAI,CAAA;IAC/C,oBAAoB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;IACzC,mBAAmB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IACzC,sBAAsB,EAAE,CAAC,CAAC,EAAE,oBAAoB,KAAK,IAAI,CAAA;IACzD,YAAY,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAA;IACxC,eAAe,EAAE,MAAM,IAAI,CAAA;IAC3B,eAAe,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CACjD,QA+UA"}
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { computed as
|
|
1
|
+
import { computed as l } from "vue";
|
|
2
2
|
import { NavigationFailureType as v } from "vue-router";
|
|
3
3
|
import { initializeWorkspaceEventHandlers as k } from "../../workspace-events.js";
|
|
4
4
|
function S({
|
|
5
|
-
eventBus:
|
|
5
|
+
eventBus: s,
|
|
6
6
|
store: f,
|
|
7
7
|
router: m,
|
|
8
8
|
rebuildSidebar: u,
|
|
9
9
|
navigateToCurrentTab: o,
|
|
10
|
-
onSelectSidebarItem:
|
|
10
|
+
onSelectSidebarItem: h,
|
|
11
11
|
onAfterExampleCreation: i,
|
|
12
|
-
onCopyTabUrl:
|
|
13
|
-
onToggleSidebar:
|
|
14
|
-
renameWorkspace:
|
|
12
|
+
onCopyTabUrl: x,
|
|
13
|
+
onToggleSidebar: d,
|
|
14
|
+
renameWorkspace: w
|
|
15
15
|
}) {
|
|
16
|
-
const
|
|
16
|
+
const r = l(() => m.currentRoute?.value), p = ({
|
|
17
17
|
documentName: e,
|
|
18
18
|
path: c,
|
|
19
19
|
method: t,
|
|
20
20
|
exampleName: a
|
|
21
|
-
}) => !(e !== void 0 && e !==
|
|
21
|
+
}) => !(e !== void 0 && e !== r.value?.params.documentSlug || c !== void 0 && encodeURIComponent(c) !== r.value?.params.pathEncoded || t !== void 0 && t !== r.value?.params.method || a !== void 0 && a !== r.value?.params.exampleName);
|
|
22
22
|
k({
|
|
23
|
-
eventBus:
|
|
23
|
+
eventBus: s,
|
|
24
24
|
store: f,
|
|
25
25
|
hooks: {
|
|
26
26
|
//------------------------------------------------------------------------------------
|
|
@@ -28,7 +28,7 @@ function S({
|
|
|
28
28
|
//------------------------------------------------------------------------------------
|
|
29
29
|
"document:delete:document": {
|
|
30
30
|
onAfterExecute: async (e) => {
|
|
31
|
-
|
|
31
|
+
r?.value?.params.documentSlug === e.name && await m.push({
|
|
32
32
|
name: "workspace.environment"
|
|
33
33
|
});
|
|
34
34
|
}
|
|
@@ -45,7 +45,7 @@ function S({
|
|
|
45
45
|
params: {
|
|
46
46
|
method: e.payload.method,
|
|
47
47
|
pathEncoded: encodeURIComponent(e.payload.path),
|
|
48
|
-
exampleName:
|
|
48
|
+
exampleName: r.value?.params.exampleName
|
|
49
49
|
}
|
|
50
50
|
}), u(f.value?.workspace.activeDocument?.["x-scalar-navigation"]?.name)), e.callback(c);
|
|
51
51
|
}
|
|
@@ -138,7 +138,7 @@ function S({
|
|
|
138
138
|
path: t.path,
|
|
139
139
|
method: t.method
|
|
140
140
|
})
|
|
141
|
-
) && await m.replace({ ...
|
|
141
|
+
) && await m.replace({ ...r.value });
|
|
142
142
|
}
|
|
143
143
|
},
|
|
144
144
|
"tag:delete:tag": {
|
|
@@ -169,7 +169,7 @@ function S({
|
|
|
169
169
|
onAfterExecute: o
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
|
-
}),
|
|
172
|
+
}), s.on("workspace:update:name", (e) => w(e)), s.on("scroll-to:nav-item", ({ id: e }) => h(e)), s.on("ui:toggle:sidebar", d), s.on("ui:navigate", async (e) => {
|
|
173
173
|
const { replace: c = !1 } = e, t = c ? m.replace : m.push, a = (n) => {
|
|
174
174
|
if (!n)
|
|
175
175
|
return e.callback?.("success");
|
|
@@ -215,7 +215,22 @@ function S({
|
|
|
215
215
|
};
|
|
216
216
|
return a(await t({ name: "example", params: n }));
|
|
217
217
|
}
|
|
218
|
-
|
|
218
|
+
if (e.page === "operation") {
|
|
219
|
+
const n = {
|
|
220
|
+
namespace: e.namespace,
|
|
221
|
+
workspaceSlug: e.workspaceSlug,
|
|
222
|
+
documentSlug: e.documentSlug,
|
|
223
|
+
pathEncoded: encodeURIComponent(e.operationPath),
|
|
224
|
+
method: e.method
|
|
225
|
+
};
|
|
226
|
+
if (e.path === "overview")
|
|
227
|
+
return a(await t({ name: "operation.overview", params: n }));
|
|
228
|
+
if (e.path === "servers")
|
|
229
|
+
return a(await t({ name: "operation.servers", params: n }));
|
|
230
|
+
if (e.path === "authentication")
|
|
231
|
+
return a(await t({ name: "operation.authentication", params: n }));
|
|
232
|
+
}
|
|
233
|
+
}), s.on("tabs:copy:url", (e) => x(e.index));
|
|
219
234
|
}
|
|
220
235
|
export {
|
|
221
236
|
S as initializeAppEventHandlers
|
|
@@ -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,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAG7E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAE7D,OAAO,EAAE,kBAAkB,EAAwB,MAAM,iBAAiB,CAAA;AAC1E,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,gCAAgC,CAAA;AAC1F,OAAO,EAEL,KAAK,iBAAiB,EAEvB,MAAM,gCAAgC,CAAA;AAKvC,OAAO,KAAK,EAAa,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AAEnF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AACnH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,oEAAoE,CAAA;AAC7F,OAAO,KAAK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AAG,SAAS,CAAC,CAAA;QACnC,mFAAmF;QACnF,WAAW,EAAE,GAAG,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;QACpC,gGAAgG;QAChG,OAAO,EAAE,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAA;QAC9B,gDAAgD;QAChD,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;KACpC,CAAA;IACD,uCAAuC;IACvC,WAAW,EAAE,WAAW,CAAC,kBAAkB,CAAC,CAAA;IAC5C,oCAAoC;IACpC,QAAQ,EAAE,WAAW,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAA;IAC/C,6CAA6C;IAC7C,UAAU,EAAE,WAAW,CAAC,OAAO,CAAC,CAAA;CACjC,CAAA;AAaD,eAAO,MAAM,cAAc,GAAU,yBAGlC;IACD,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,CAAC,EAAE,YAAY,CAAA;CAC1B,KAAG,OAAO,CAAC,QAAQ,CA80BnB,CAAA"}
|
|
@@ -9,17 +9,17 @@ import { getParentEntry as h } from "@scalar/workspace-store/navigation";
|
|
|
9
9
|
import { createWorkspaceStorePersistence as ke, getWorkspaceId as w } from "@scalar/workspace-store/persistence";
|
|
10
10
|
import { persistencePlugin as xe } from "@scalar/workspace-store/plugins/client";
|
|
11
11
|
import { extensions as be } from "@scalar/workspace-store/schemas/extensions";
|
|
12
|
-
import { ref as p, computed as
|
|
12
|
+
import { ref as p, computed as i, shallowRef as j, readonly as ye } from "vue";
|
|
13
13
|
import { getRouteParam as l } from "./helpers/get-route-param.js";
|
|
14
14
|
import { groupWorkspacesByTeam as Se } from "./helpers/group-workspaces.js";
|
|
15
15
|
import { getActiveEnvironment as Ee } from "../../helpers/get-active-environment.js";
|
|
16
16
|
import { getTabDetails as We } from "../../helpers/get-tab-details.js";
|
|
17
17
|
import { slugify as Ue } from "../../helpers/slugify.js";
|
|
18
|
-
import { workspaceStorage as
|
|
19
|
-
import { initializeAppEventHandlers as
|
|
18
|
+
import { workspaceStorage as Ie } from "../../helpers/storage.js";
|
|
19
|
+
import { initializeAppEventHandlers as Te } from "./app-events.js";
|
|
20
20
|
import { filterWorkspacesByTeam as De, canLoadWorkspace as H } from "./helpers/filter-workspaces.js";
|
|
21
21
|
const Re = 1e3, Ae = 288, Xe = async ({
|
|
22
|
-
router:
|
|
22
|
+
router: u,
|
|
23
23
|
fileLoader: z
|
|
24
24
|
}) => {
|
|
25
25
|
const S = we({
|
|
@@ -27,8 +27,8 @@ const Re = 1e3, Ae = 288, Xe = async ({
|
|
|
27
27
|
}), { workspace: g } = await ke();
|
|
28
28
|
await ve();
|
|
29
29
|
const k = p("local"), f = p(void 0), x = p(void 0), E = p(void 0), B = p(void 0), L = p(void 0), N = p(void 0), W = p(!1);
|
|
30
|
-
|
|
31
|
-
const d =
|
|
30
|
+
u.afterEach((e) => ie(e));
|
|
31
|
+
const d = i(() => u.currentRoute.value ?? null), U = j(null), v = p([]), b = i(() => De(v.value, k.value)), G = i(() => Se(b.value, k.value)), s = j(null), D = i(() => s.value?.workspace.documents[E.value ?? ""] || null), J = i(() => Ee(s.value, D.value));
|
|
32
32
|
v.value = await g.getAll().then(
|
|
33
33
|
(e) => e.map(({ teamUid: a, namespace: t, slug: n, name: c }) => ({
|
|
34
34
|
id: w(t, n),
|
|
@@ -43,7 +43,7 @@ const Re = 1e3, Ae = 288, Xe = async ({
|
|
|
43
43
|
if (!a || !t)
|
|
44
44
|
return;
|
|
45
45
|
const n = w(a, t);
|
|
46
|
-
await g.updateName({ namespace: a, slug: t }, e) !== void 0 && (v.value = v.value.map((
|
|
46
|
+
await g.updateName({ namespace: a, slug: t }, e) !== void 0 && (v.value = v.value.map((r) => r.id === n ? { ...r, label: e } : r), U.value = { id: n, label: e });
|
|
47
47
|
}, X = async ({
|
|
48
48
|
namespace: e,
|
|
49
49
|
slug: a
|
|
@@ -90,7 +90,7 @@ const Re = 1e3, Ae = 288, Xe = async ({
|
|
|
90
90
|
"x-scalar-icon": "interface-edit-tool-pencil"
|
|
91
91
|
}
|
|
92
92
|
});
|
|
93
|
-
const
|
|
93
|
+
const r = await g.setItem(
|
|
94
94
|
{ namespace: t, slug: n },
|
|
95
95
|
{
|
|
96
96
|
name: e,
|
|
@@ -99,18 +99,18 @@ const Re = 1e3, Ae = 288, Xe = async ({
|
|
|
99
99
|
}
|
|
100
100
|
);
|
|
101
101
|
return v.value.push({
|
|
102
|
-
id: w(
|
|
103
|
-
teamUid:
|
|
104
|
-
namespace:
|
|
105
|
-
slug:
|
|
106
|
-
label:
|
|
107
|
-
}),
|
|
102
|
+
id: w(r.namespace, r.slug),
|
|
103
|
+
teamUid: r.teamUid,
|
|
104
|
+
namespace: r.namespace,
|
|
105
|
+
slug: r.slug,
|
|
106
|
+
label: r.name
|
|
107
|
+
}), r;
|
|
108
108
|
}, y = async (e, a) => {
|
|
109
109
|
if (!e || !a) {
|
|
110
|
-
await
|
|
110
|
+
await u.push("/");
|
|
111
111
|
return;
|
|
112
112
|
}
|
|
113
|
-
await
|
|
113
|
+
await u.push({
|
|
114
114
|
name: "example",
|
|
115
115
|
params: {
|
|
116
116
|
namespace: e,
|
|
@@ -131,7 +131,7 @@ const Re = 1e3, Ae = 288, Xe = async ({
|
|
|
131
131
|
const c = await ge({
|
|
132
132
|
defaultValue: t ?? n,
|
|
133
133
|
// Use the provided id if it exists, otherwise use the name
|
|
134
|
-
validation: async (
|
|
134
|
+
validation: async (T) => !await g.has({ namespace: a ?? "local", slug: T }),
|
|
135
135
|
maxRetries: 100,
|
|
136
136
|
transformation: Ue
|
|
137
137
|
});
|
|
@@ -148,11 +148,11 @@ const Re = 1e3, Ae = 288, Xe = async ({
|
|
|
148
148
|
s.value = null, W.value = !0;
|
|
149
149
|
const t = await Z(e, a);
|
|
150
150
|
if (t.success) {
|
|
151
|
-
const
|
|
152
|
-
|
|
153
|
-
path:
|
|
151
|
+
const r = t.workspace["x-scalar-active-tab"] ?? 0, m = t.workspace["x-scalar-tabs"], T = m?.[r];
|
|
152
|
+
T && await u.replace({
|
|
153
|
+
path: T.path,
|
|
154
154
|
query: d.value?.query ?? {}
|
|
155
|
-
}), m &&
|
|
155
|
+
}), m && r >= m.length && S.emit("tabs:update:tabs", {
|
|
156
156
|
"x-scalar-active-tab": 0
|
|
157
157
|
}), m || S.emit("tabs:update:tabs", {
|
|
158
158
|
"x-scalar-tabs": [C(d.value)],
|
|
@@ -160,7 +160,7 @@ const Re = 1e3, Ae = 288, Xe = async ({
|
|
|
160
160
|
}), W.value = !1;
|
|
161
161
|
return;
|
|
162
162
|
}
|
|
163
|
-
const n = b.value.find((
|
|
163
|
+
const n = b.value.find((r) => r.teamUid === "local" && r.slug === "default") ?? b.value[0];
|
|
164
164
|
if (n)
|
|
165
165
|
return y(n.namespace, n.slug);
|
|
166
166
|
const c = await O({
|
|
@@ -169,7 +169,7 @@ const Re = 1e3, Ae = 288, Xe = async ({
|
|
|
169
169
|
});
|
|
170
170
|
if (W.value = !1, !c)
|
|
171
171
|
return console.error("Failed to create the default workspace, something went wrong, can not load the workspace");
|
|
172
|
-
|
|
172
|
+
o.reset();
|
|
173
173
|
}, te = (e) => {
|
|
174
174
|
k.value = e;
|
|
175
175
|
const a = b.value.find(
|
|
@@ -177,18 +177,18 @@ const Re = 1e3, Ae = 288, Xe = async ({
|
|
|
177
177
|
);
|
|
178
178
|
if (!(a && H(a.teamUid, e)))
|
|
179
179
|
return y("local", "default");
|
|
180
|
-
}, _ =
|
|
180
|
+
}, _ = i(() => {
|
|
181
181
|
const e = s.value;
|
|
182
182
|
if (!e)
|
|
183
183
|
return [];
|
|
184
184
|
const a = e.workspace["x-scalar-order"] ?? Object.keys(e.workspace.documents);
|
|
185
185
|
return de(Object.keys(e.workspace.documents), a, (t) => t).map((t) => e.workspace.documents[t]?.["x-scalar-navigation"]).filter(M);
|
|
186
|
-
}),
|
|
186
|
+
}), o = fe(_), R = ({
|
|
187
187
|
document: e,
|
|
188
188
|
path: a,
|
|
189
189
|
method: t,
|
|
190
190
|
example: n
|
|
191
|
-
}) => JSON.stringify([e, a, t, n].filter(M)), P =
|
|
191
|
+
}) => JSON.stringify([e, a, t, n].filter(M)), P = i(
|
|
192
192
|
() => he({
|
|
193
193
|
items: _.value,
|
|
194
194
|
nestedKey: "children",
|
|
@@ -203,7 +203,7 @@ const Re = 1e3, Ae = 288, Xe = async ({
|
|
|
203
203
|
});
|
|
204
204
|
}
|
|
205
205
|
})
|
|
206
|
-
),
|
|
206
|
+
), I = (e) => {
|
|
207
207
|
const a = P.value.get(R(e));
|
|
208
208
|
return a || P.value.get(
|
|
209
209
|
R({
|
|
@@ -213,28 +213,28 @@ const Re = 1e3, Ae = 288, Xe = async ({
|
|
|
213
213
|
})
|
|
214
214
|
);
|
|
215
215
|
}, V = (e) => {
|
|
216
|
-
const a =
|
|
216
|
+
const a = o.getEntryById(e);
|
|
217
217
|
if (!a) {
|
|
218
218
|
console.warn(`Could not find sidebar entry with id ${e} to select`);
|
|
219
219
|
return;
|
|
220
220
|
}
|
|
221
221
|
if (a.type === "document") {
|
|
222
|
-
if (
|
|
223
|
-
|
|
222
|
+
if (o.selectedItem.value === e) {
|
|
223
|
+
o.setExpanded(e, !o.isExpanded(e));
|
|
224
224
|
return;
|
|
225
225
|
}
|
|
226
|
-
return
|
|
226
|
+
return o.setSelected(e), o.setExpanded(e, !0), u.push({
|
|
227
227
|
name: "document.overview",
|
|
228
228
|
params: { documentSlug: a.name }
|
|
229
229
|
});
|
|
230
230
|
}
|
|
231
231
|
if (a.type === "operation") {
|
|
232
|
-
if (
|
|
233
|
-
|
|
232
|
+
if (o.isSelected(e) && o.selectedItem.value !== e) {
|
|
233
|
+
o.setExpanded(e, !o.isExpanded(e));
|
|
234
234
|
return;
|
|
235
235
|
}
|
|
236
236
|
const t = a.children?.find((n) => n.type === "example");
|
|
237
|
-
return t ? (
|
|
237
|
+
return t ? (o.setSelected(t.id), o.setExpanded(t.id, !0)) : o.setSelected(e), u.push({
|
|
238
238
|
name: "example",
|
|
239
239
|
params: {
|
|
240
240
|
documentSlug: h("document", a)?.name,
|
|
@@ -245,9 +245,9 @@ const Re = 1e3, Ae = 288, Xe = async ({
|
|
|
245
245
|
});
|
|
246
246
|
}
|
|
247
247
|
if (a.type === "example") {
|
|
248
|
-
|
|
248
|
+
o.setSelected(e);
|
|
249
249
|
const t = h("operation", a);
|
|
250
|
-
return
|
|
250
|
+
return u.push({
|
|
251
251
|
name: "example",
|
|
252
252
|
params: {
|
|
253
253
|
documentSlug: h("document", a)?.name,
|
|
@@ -258,32 +258,32 @@ const Re = 1e3, Ae = 288, Xe = async ({
|
|
|
258
258
|
});
|
|
259
259
|
}
|
|
260
260
|
if (a.type === "text")
|
|
261
|
-
return
|
|
261
|
+
return u.push({
|
|
262
262
|
name: "document.overview",
|
|
263
263
|
params: {
|
|
264
264
|
documentSlug: h("document", a)?.name
|
|
265
265
|
}
|
|
266
266
|
});
|
|
267
|
-
|
|
267
|
+
o.setExpanded(e, !o.isExpanded(e));
|
|
268
268
|
}, ne = async () => {
|
|
269
269
|
if (!s.value)
|
|
270
270
|
return;
|
|
271
271
|
const e = s.value.workspace["x-scalar-active-tab"] ?? 0, a = s.value.workspace["x-scalar-tabs"]?.[e];
|
|
272
|
-
a && await
|
|
272
|
+
a && await u.replace(a.path);
|
|
273
273
|
}, F = (e) => {
|
|
274
274
|
e && s.value?.buildSidebar(e);
|
|
275
275
|
}, se = (e) => {
|
|
276
276
|
const a = D.value?.["x-scalar-navigation"]?.name;
|
|
277
277
|
if (!a)
|
|
278
278
|
return;
|
|
279
|
-
const t =
|
|
279
|
+
const t = I({
|
|
280
280
|
document: a,
|
|
281
281
|
path: e.path,
|
|
282
282
|
method: e.method,
|
|
283
283
|
example: e.exampleKey
|
|
284
284
|
});
|
|
285
285
|
(!t || t.type !== "example") && (F(a), d.value && q(d.value));
|
|
286
|
-
}, oe =
|
|
286
|
+
}, oe = i(() => s.value?.workspace?.["x-scalar-sidebar-width"] ?? Ae), re = (e) => s.value?.update("x-scalar-sidebar-width", e), A = p(!0), ce = "x-scalar-tabs", le = "x-scalar-active-tab", C = (e) => {
|
|
287
287
|
const a = l("method", e), t = l("pathEncoded", e), n = l("documentSlug", e), c = l("workspaceSlug", e);
|
|
288
288
|
return {
|
|
289
289
|
...We({
|
|
@@ -291,11 +291,11 @@ const Re = 1e3, Ae = 288, Xe = async ({
|
|
|
291
291
|
document: n,
|
|
292
292
|
path: t,
|
|
293
293
|
method: a,
|
|
294
|
-
getEntryByLocation:
|
|
294
|
+
getEntryByLocation: I
|
|
295
295
|
}),
|
|
296
296
|
path: d.value?.path ?? ""
|
|
297
297
|
};
|
|
298
|
-
}, K =
|
|
298
|
+
}, K = i(() => s.value?.workspace[ce] ?? [C(d.value)]), ue = i(() => s.value?.workspace[le] ?? 0), $ = async (e) => {
|
|
299
299
|
const a = K.value[e];
|
|
300
300
|
if (!a) {
|
|
301
301
|
console.warn(`Cannot copy URL: tab at index ${e} does not exist`);
|
|
@@ -307,16 +307,16 @@ const Re = 1e3, Ae = 288, Xe = async ({
|
|
|
307
307
|
} catch (n) {
|
|
308
308
|
console.error("Failed to copy URL to clipboard:", n);
|
|
309
309
|
}
|
|
310
|
-
},
|
|
310
|
+
}, ie = (e) => {
|
|
311
311
|
const a = l("workspaceSlug", e), t = l("documentSlug", e), n = l("namespace", e);
|
|
312
312
|
if (!n || !a)
|
|
313
313
|
return;
|
|
314
314
|
const c = v.value.find(
|
|
315
|
-
(
|
|
315
|
+
(r) => r.slug === a && r.namespace === n
|
|
316
316
|
);
|
|
317
317
|
if (c && !H(c.teamUid, k.value))
|
|
318
318
|
return y("local", "default");
|
|
319
|
-
if (f.value = n, x.value = a, E.value = t, B.value = l("method", e), L.value = l("pathEncoded", e), N.value = l("exampleName", e), e.path !== "" &&
|
|
319
|
+
if (f.value = n, x.value = a, E.value = t, B.value = l("method", e), L.value = l("pathEncoded", e), N.value = l("exampleName", e), e.path !== "" && Ie.setCurrentPath(e.path), w(f.value, a) !== U.value?.id)
|
|
320
320
|
return ae(f.value, a);
|
|
321
321
|
t && t !== s.value?.workspace[be.workspace.activeDocument] && s?.value?.update("x-scalar-active-document", t), pe(e), q(e);
|
|
322
322
|
}, pe = (e) => {
|
|
@@ -325,20 +325,20 @@ const Re = 1e3, Ae = 288, Xe = async ({
|
|
|
325
325
|
}, q = (e) => {
|
|
326
326
|
const a = l("documentSlug", e);
|
|
327
327
|
if (!a) {
|
|
328
|
-
|
|
328
|
+
o.setSelected(null);
|
|
329
329
|
return;
|
|
330
330
|
}
|
|
331
|
-
const t =
|
|
331
|
+
const t = I({
|
|
332
332
|
document: a,
|
|
333
333
|
path: l("pathEncoded", e),
|
|
334
334
|
method: l("method", e),
|
|
335
335
|
example: l("exampleName", e)
|
|
336
336
|
});
|
|
337
|
-
t && (
|
|
337
|
+
t && (o.setSelected(t.id), o.setExpanded(t.id, !0));
|
|
338
338
|
};
|
|
339
|
-
|
|
339
|
+
Te({
|
|
340
340
|
eventBus: S,
|
|
341
|
-
router:
|
|
341
|
+
router: u,
|
|
342
342
|
store: s,
|
|
343
343
|
navigateToCurrentTab: ne,
|
|
344
344
|
rebuildSidebar: F,
|
|
@@ -348,7 +348,7 @@ const Re = 1e3, Ae = 288, Xe = async ({
|
|
|
348
348
|
onToggleSidebar: () => A.value = !A.value,
|
|
349
349
|
renameWorkspace: Q
|
|
350
350
|
});
|
|
351
|
-
const me =
|
|
351
|
+
const me = i(() => {
|
|
352
352
|
const e = s.value?.workspace["x-scalar-color-mode"] ?? "system";
|
|
353
353
|
return e === "system" ? window.matchMedia?.("(prefers-color-scheme: dark)")?.matches ?? !1 : e === "dark";
|
|
354
354
|
});
|
|
@@ -356,16 +356,16 @@ const Re = 1e3, Ae = 288, Xe = async ({
|
|
|
356
356
|
/** Active workspace store */
|
|
357
357
|
store: s,
|
|
358
358
|
sidebar: {
|
|
359
|
-
state:
|
|
359
|
+
state: o,
|
|
360
360
|
width: oe,
|
|
361
361
|
isOpen: A,
|
|
362
362
|
handleSelectItem: V,
|
|
363
363
|
handleSidebarWidthUpdate: re,
|
|
364
|
-
getEntryByLocation:
|
|
364
|
+
getEntryByLocation: I
|
|
365
365
|
},
|
|
366
366
|
tabs: {
|
|
367
367
|
state: K,
|
|
368
|
-
activeTabIndex:
|
|
368
|
+
activeTabIndex: ue,
|
|
369
369
|
copyTabUrl: $
|
|
370
370
|
},
|
|
371
371
|
workspace: {
|
|
@@ -375,10 +375,10 @@ const Re = 1e3, Ae = 288, Xe = async ({
|
|
|
375
375
|
workspaceGroups: G,
|
|
376
376
|
activeWorkspace: U,
|
|
377
377
|
navigateToWorkspace: y,
|
|
378
|
-
isOpen:
|
|
378
|
+
isOpen: i(() => !!(x.value && !E.value))
|
|
379
379
|
},
|
|
380
380
|
eventBus: S,
|
|
381
|
-
router:
|
|
381
|
+
router: u,
|
|
382
382
|
currentRoute: d,
|
|
383
383
|
loading: W,
|
|
384
384
|
activeEntities: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppSidebar.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/app/components/AppSidebar.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AppSidebar.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/app/components/AppSidebar.vue"],"names":[],"mappings":"AAghBA,OAAO,EAML,KAAK,cAAc,EACpB,MAAM,oBAAoB,CAAA;AAQ3B,OAAO,KAAK,EAA6B,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAEvE,OAAO,KAAK,EACV,cAAc,EAEf,MAAM,4CAA4C,CAAA;AAWnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,KAAK,WAAW,GAAG;IACf;;OAEG;IACH,MAAM,EAAE,YAAY,CAAA;IAEpB;;OAEG;IACH,YAAY,EAAE,YAAY,CAAC,cAAc,CAAC,CAAA;IAE1C;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB;;;OAGG;IACH,eAAe,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAA;IAC9C;;;OAGG;IACH,UAAU,EAAE,cAAc,EAAE,CAAA;IAC5B;;;OAGG;IACH,QAAQ,EAAE,iBAAiB,CAAA;IAC3B;;;OAGG;IACH,KAAK,EAAE,cAAc,CAAA;CACtB,CAAC;AAiBJ,KAAK,WAAW,GAAG;IACjB,oEAAoE;IACpE,kBAAkB,CAAC,IAAI,OAAO,CAAA;CAC/B,CAAC;AAmMF,KAAK,gBAAgB,GAAG;IACxB,6CAA6C;IAC7C,eAAe,EAAE,OAAO,CAAC;IACzB,wCAAwC;IACxC,cAAc,EAAE,MAAM,CAAC;CACtB,CAAC;AAMF,KAAK,iBAAiB,GAAG,WAAW,GAAG,gBAAgB,CAAC;AA6oBxD,QAAA,MAAM,UAAU;;;;;;;;;;;;;;;kFAGd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./AppSidebar.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import p from "../../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const e = /* @__PURE__ */ p(o, [["__scopeId", "data-v-
|
|
4
|
+
const e = /* @__PURE__ */ p(o, [["__scopeId", "data-v-e53c3579"]]);
|
|
5
5
|
export {
|
|
6
6
|
e as default
|
|
7
7
|
};
|