@scalar/api-client 2.24.0 → 2.26.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 +61 -0
- package/dist/components/DataTable/DataTableCheckbox.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableCheckbox.vue.js +8 -8
- package/dist/style.css +1 -1
- package/dist/v2/blocks/operation-block/helpers/build-request-body.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/build-request-body.js +28 -19
- package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.js +1 -1
- package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue2.js +1 -1
- package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.js +18 -18
- package/dist/v2/blocks/request-block/helpers/get-default-headers.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyRaw.vue.d.ts.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyRaw.vue.js +2 -2
- package/dist/v2/blocks/response-block/components/ResponseBodyRaw.vue2.js +19 -19
- 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 +26 -26
- package/dist/v2/components/callout/Callout.vue.d.ts +17 -0
- package/dist/v2/components/callout/Callout.vue.d.ts.map +1 -0
- package/dist/v2/components/callout/Callout.vue.js +7 -0
- package/dist/v2/components/callout/Callout.vue2.js +43 -0
- package/dist/v2/components/data-table/DataTableCheckbox.vue.d.ts.map +1 -1
- package/dist/v2/components/data-table/DataTableCheckbox.vue.js +8 -8
- package/dist/v2/components/sidebar/Sidebar.vue.d.ts +2 -2
- package/dist/v2/components/sidebar/Sidebar.vue.d.ts.map +1 -1
- package/dist/v2/components/sidebar/Sidebar.vue.js +40 -41
- package/dist/v2/components/sidebar/SidebarMenu.vue.d.ts +2 -2
- package/dist/v2/components/sidebar/SidebarMenu.vue.d.ts.map +1 -1
- package/dist/v2/components/sidebar/SidebarMenu.vue.js +6 -6
- package/dist/v2/features/app/App.vue.d.ts +6 -3
- package/dist/v2/features/app/App.vue.d.ts.map +1 -1
- package/dist/v2/features/app/App.vue.js +87 -86
- package/dist/v2/features/app/app-events.d.ts +1 -1
- package/dist/v2/features/app/app-events.d.ts.map +1 -1
- package/dist/v2/features/app/app-events.js +10 -10
- package/dist/v2/features/app/app-state.d.ts +77 -96
- package/dist/v2/features/app/app-state.d.ts.map +1 -1
- package/dist/v2/features/app/app-state.js +339 -322
- package/dist/v2/features/app/components/AppSidebar.vue.d.ts +2 -2
- package/dist/v2/features/app/components/AppSidebar.vue.d.ts.map +1 -1
- package/dist/v2/features/app/components/AppSidebar.vue.js +3 -3
- package/dist/v2/features/app/components/DesktopTabs.vue.d.ts.map +1 -1
- package/dist/v2/features/app/components/DesktopTabs.vue.js +1 -1
- package/dist/v2/features/app/helpers/create-api-client-app.d.ts +2 -2
- 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 +9 -9
- package/dist/v2/features/app/helpers/filter-workspaces.d.ts +49 -0
- package/dist/v2/features/app/helpers/filter-workspaces.d.ts.map +1 -0
- package/dist/v2/features/app/helpers/filter-workspaces.js +5 -0
- package/dist/v2/features/app/helpers/get-route-param.d.ts +7 -0
- package/dist/v2/features/app/helpers/get-route-param.d.ts.map +1 -0
- package/dist/v2/features/app/helpers/get-route-param.js +9 -0
- package/dist/v2/features/app/helpers/group-workspaces.d.ts +24 -0
- package/dist/v2/features/app/helpers/group-workspaces.d.ts.map +1 -0
- package/dist/v2/features/app/helpers/group-workspaces.js +23 -0
- package/dist/v2/features/app/index.d.ts +1 -1
- package/dist/v2/features/app/index.d.ts.map +1 -1
- package/dist/v2/features/app/index.js +12 -12
- package/dist/v2/features/collection/DocumentCollection.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/DocumentCollection.vue.js +72 -65
- package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.d.ts +29 -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 +110 -106
- package/dist/v2/features/command-palette/helpers/load-document-from-source.d.ts +5 -1
- package/dist/v2/features/command-palette/helpers/load-document-from-source.d.ts.map +1 -1
- package/dist/v2/features/command-palette/helpers/load-document-from-source.js +41 -23
- package/dist/v2/features/command-palette/hooks/use-command-palette-state.d.ts +41 -8
- package/dist/v2/features/command-palette/hooks/use-command-palette-state.d.ts.map +1 -1
- package/dist/v2/features/command-palette/index.d.ts +1 -2
- package/dist/v2/features/command-palette/index.d.ts.map +1 -1
- package/dist/v2/features/command-palette/index.js +4 -6
- package/dist/v2/features/operation/Operation.vue.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseBodyRaw.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseBodyRaw.vue.js +2 -2
- package/dist/views/Request/ResponseSection/ResponseBodyRaw.vue2.js +24 -23
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/package.json +10 -10
- package/dist/v2/features/app/components/WebTopNav.vue.d.ts +0 -41
- package/dist/v2/features/app/components/WebTopNav.vue.d.ts.map +0 -1
- package/dist/v2/features/app/components/WebTopNav.vue.js +0 -27
- package/dist/v2/features/app/components/WebTopNav.vue2.js +0 -4
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as D, mergeModels as v, useSlots as V, ref as B, useModel as M, computed as C, createBlock as u, openBlock as l, unref as r, withCtx as s, createVNode as y, createSlots as E, renderSlot as i, createElementBlock as w, createCommentVNode as m, Fragment as R, normalizeProps as f, guardReactiveProps as p, createElementVNode as g, isRef as z } from "vue";
|
|
2
2
|
import { ScalarIconButton as F, ScalarSidebarSearchInput as N } from "@scalar/components";
|
|
3
3
|
import { ScalarIconFileDashed as q, ScalarIconMagnifyingGlass as A } from "@scalar/icons";
|
|
4
4
|
import { ScalarSidebar as U } from "@scalar/sidebar";
|
|
5
5
|
import j from "./SidebarMenu.vue.js";
|
|
6
6
|
import { useSearchIndex as G } from "../../features/search/hooks/use-search-index.js";
|
|
7
7
|
import H from "../resize/Resize.vue.js";
|
|
8
|
-
const J = { class: "bg-sidebar-b-1 z-1 flex flex-col gap-1.5 px-3 pb-1.5" }, K = { class: "flex items-center justify-between" }, L = { key: 1 }, _ = /* @__PURE__ */
|
|
8
|
+
const J = { class: "bg-sidebar-b-1 z-1 flex flex-col gap-1.5 px-3 pb-1.5" }, K = { class: "flex items-center justify-between" }, L = { key: 1 }, _ = /* @__PURE__ */ D({
|
|
9
9
|
__name: "Sidebar",
|
|
10
|
-
props: /* @__PURE__ */
|
|
10
|
+
props: /* @__PURE__ */ v({
|
|
11
11
|
sidebarState: {},
|
|
12
12
|
layout: {},
|
|
13
13
|
activeWorkspace: {},
|
|
@@ -21,67 +21,66 @@ const J = { class: "bg-sidebar-b-1 z-1 flex flex-col gap-1.5 px-3 pb-1.5" }, K =
|
|
|
21
21
|
},
|
|
22
22
|
sidebarWidthModifiers: {}
|
|
23
23
|
}),
|
|
24
|
-
emits: /* @__PURE__ */
|
|
25
|
-
setup(
|
|
26
|
-
const
|
|
27
|
-
|
|
24
|
+
emits: /* @__PURE__ */ v(["selectItem", "select:workspace", "create:workspace", "reorder"], ["update:sidebarWidth"]),
|
|
25
|
+
setup(a, { emit: x }) {
|
|
26
|
+
const d = x, b = V(), n = B(!1), k = M(a, "sidebarWidth"), S = (o) => o.type === "example" && o.title === "draft", { query: c, results: I } = G(() => a.documents), W = C(() => I.value ?? a.sidebarState.items.value), $ = (o) => {
|
|
27
|
+
d("selectItem", o), c.value = "", n.value = !1;
|
|
28
28
|
};
|
|
29
|
-
return (o,
|
|
29
|
+
return (o, t) => (l(), u(r(H), {
|
|
30
30
|
width: k.value,
|
|
31
|
-
"onUpdate:width":
|
|
31
|
+
"onUpdate:width": t[5] || (t[5] = (e) => k.value = e),
|
|
32
32
|
class: "flex flex-col"
|
|
33
33
|
}, {
|
|
34
34
|
default: s(() => [
|
|
35
|
-
|
|
35
|
+
y(r(U), {
|
|
36
36
|
class: "flex w-auto flex-1 pt-2",
|
|
37
37
|
indent: 15,
|
|
38
|
-
isDraggable:
|
|
39
|
-
isDroppable:
|
|
40
|
-
isExpanded:
|
|
41
|
-
isSelected:
|
|
42
|
-
items:
|
|
38
|
+
isDraggable: a.layout !== "modal",
|
|
39
|
+
isDroppable: a.isDroppable,
|
|
40
|
+
isExpanded: a.sidebarState.isExpanded,
|
|
41
|
+
isSelected: a.sidebarState.isSelected,
|
|
42
|
+
items: W.value,
|
|
43
43
|
layout: "client",
|
|
44
|
-
onReorder:
|
|
45
|
-
onSelectItem:
|
|
44
|
+
onReorder: t[4] || (t[4] = (e, h) => d("reorder", e, h)),
|
|
45
|
+
onSelectItem: $
|
|
46
46
|
}, E({
|
|
47
47
|
header: s(() => [
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
g("div", J, [
|
|
49
|
+
g("div", K, [
|
|
50
|
+
a.layout !== "modal" ? (l(), u(j, {
|
|
51
51
|
key: 0,
|
|
52
|
-
activeWorkspace:
|
|
53
|
-
workspaces:
|
|
54
|
-
"onCreate:workspace":
|
|
55
|
-
"onSelect:workspace":
|
|
52
|
+
activeWorkspace: a.activeWorkspace,
|
|
53
|
+
workspaces: a.workspaces,
|
|
54
|
+
"onCreate:workspace": t[0] || (t[0] = (e) => d("create:workspace")),
|
|
55
|
+
"onSelect:workspace": t[1] || (t[1] = (e) => d("select:workspace", e))
|
|
56
56
|
}, {
|
|
57
57
|
sidebarMenuActions: s(() => [
|
|
58
58
|
i(o.$slots, "sidebarMenuActions")
|
|
59
59
|
]),
|
|
60
60
|
_: 3
|
|
61
|
-
}, 8, ["activeWorkspace", "workspaces"])) :
|
|
62
|
-
|
|
63
|
-
key: 2,
|
|
61
|
+
}, 8, ["activeWorkspace", "workspaces"])) : a.layout === "modal" ? (l(), w("div", L)) : m("", !0),
|
|
62
|
+
y(r(F), {
|
|
64
63
|
icon: r(A),
|
|
65
64
|
label: "Search",
|
|
66
|
-
onClick:
|
|
67
|
-
}, null, 8, ["icon"])
|
|
65
|
+
onClick: t[2] || (t[2] = (e) => n.value = !n.value)
|
|
66
|
+
}, null, 8, ["icon"])
|
|
68
67
|
]),
|
|
69
|
-
|
|
68
|
+
n.value ? (l(), u(r(N), {
|
|
70
69
|
key: 0,
|
|
71
|
-
modelValue: r(
|
|
72
|
-
"onUpdate:modelValue":
|
|
73
|
-
autofocus:
|
|
74
|
-
}, null, 8, ["modelValue"
|
|
70
|
+
modelValue: r(c),
|
|
71
|
+
"onUpdate:modelValue": t[3] || (t[3] = (e) => z(c) ? c.value = e : null),
|
|
72
|
+
autofocus: ""
|
|
73
|
+
}, null, 8, ["modelValue"])) : m("", !0)
|
|
75
74
|
])
|
|
76
75
|
]),
|
|
77
76
|
decorator: s((e) => [
|
|
78
|
-
i(o.$slots, "decorator", f(
|
|
77
|
+
i(o.$slots, "decorator", f(p(e)))
|
|
79
78
|
]),
|
|
80
79
|
icon: s((e) => [
|
|
81
|
-
|
|
82
|
-
S(e.item) ? (l(),
|
|
83
|
-
i(o.$slots, "icon", f(
|
|
84
|
-
], 64)) :
|
|
80
|
+
b.icon || S(e.item) ? (l(), w(R, { key: 0 }, [
|
|
81
|
+
S(e.item) ? (l(), u(r(q), { key: 0 })) : m("", !0),
|
|
82
|
+
i(o.$slots, "icon", f(p(e)))
|
|
83
|
+
], 64)) : m("", !0)
|
|
85
84
|
]),
|
|
86
85
|
before: s(() => [
|
|
87
86
|
i(o.$slots, "workspaceButton")
|
|
@@ -91,10 +90,10 @@ const J = { class: "bg-sidebar-b-1 z-1 flex flex-col gap-1.5 px-3 pb-1.5" }, K =
|
|
|
91
90
|
]),
|
|
92
91
|
_: 2
|
|
93
92
|
}, [
|
|
94
|
-
|
|
93
|
+
b.empty ? {
|
|
95
94
|
name: "empty",
|
|
96
95
|
fn: s((e) => [
|
|
97
|
-
i(o.$slots, "empty", f(
|
|
96
|
+
i(o.$slots, "empty", f(p(e)))
|
|
98
97
|
]),
|
|
99
98
|
key: "0"
|
|
100
99
|
} : void 0
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type WorkspaceGroup } from '@scalar/components';
|
|
2
2
|
type __VLS_Props = {
|
|
3
3
|
/**
|
|
4
4
|
* The currently active workspace.
|
|
@@ -11,7 +11,7 @@ type __VLS_Props = {
|
|
|
11
11
|
* The list of all available workspaces.
|
|
12
12
|
* Used to render options for workspace switching and selection.
|
|
13
13
|
*/
|
|
14
|
-
workspaces:
|
|
14
|
+
workspaces: WorkspaceGroup[];
|
|
15
15
|
};
|
|
16
16
|
type __VLS_Slots = {
|
|
17
17
|
/** Slot for customizing the actions section of the sidebar menu. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidebarMenu.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/sidebar/SidebarMenu.vue"],"names":[],"mappings":"AAoEA,OAAO,EAOL,KAAK,
|
|
1
|
+
{"version":3,"file":"SidebarMenu.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/sidebar/SidebarMenu.vue"],"names":[],"mappings":"AAoEA,OAAO,EAOL,KAAK,cAAc,EACpB,MAAM,oBAAoB,CAAA;AAI3B,KAAK,WAAW,GAAG;IACjB;;;OAGG;IACH,eAAe,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAA;IAC/B;;;OAGG;IACH,UAAU,EAAE,cAAc,EAAE,CAAA;CAC7B,CAAC;AAWF,KAAK,WAAW,GAAG;IACjB,oEAAoE;IACpE,kBAAkB,CAAC,IAAI,OAAO,CAAA;CAC/B,CAAC;AA8HF,QAAA,MAAM,eAAe;;;;;;kFAOnB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAQ1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -9,8 +9,8 @@ const L = /* @__PURE__ */ p({
|
|
|
9
9
|
workspaces: {}
|
|
10
10
|
},
|
|
11
11
|
emits: ["create:workspace", "select:workspace"],
|
|
12
|
-
setup(
|
|
13
|
-
const
|
|
12
|
+
setup(a, { emit: i }) {
|
|
13
|
+
const n = i;
|
|
14
14
|
return (c, e) => (k(), u(o(S), null, {
|
|
15
15
|
products: t(() => [...e[2] || (e[2] = [])]),
|
|
16
16
|
sections: t(({ close: l }) => [
|
|
@@ -18,10 +18,10 @@ const L = /* @__PURE__ */ p({
|
|
|
18
18
|
default: t(() => [
|
|
19
19
|
m(c.$slots, "sidebarMenuActions", {}, () => [
|
|
20
20
|
r(o(w), {
|
|
21
|
-
modelValue:
|
|
22
|
-
workspaceOptions:
|
|
23
|
-
onCreateWorkspace: e[0] || (e[0] = (s) =>
|
|
24
|
-
"onUpdate:modelValue": e[1] || (e[1] = (s) =>
|
|
21
|
+
modelValue: a.activeWorkspace.id,
|
|
22
|
+
workspaceOptions: a.workspaces,
|
|
23
|
+
onCreateWorkspace: e[0] || (e[0] = (s) => n("create:workspace")),
|
|
24
|
+
"onUpdate:modelValue": e[1] || (e[1] = (s) => n("select:workspace", s))
|
|
25
25
|
}, null, 8, ["modelValue", "workspaceOptions"]),
|
|
26
26
|
r(o(M), {
|
|
27
27
|
is: o(v),
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { type ModalState } from '@scalar/components';
|
|
2
|
+
import type { CommandPaletteState } from '../../../v2/features/command-palette/hooks/use-command-palette-state.js';
|
|
1
3
|
import type { ClientPlugin } from '../../../v2/helpers/plugins.js';
|
|
2
4
|
import type { ClientLayout } from '../../../v2/types/layout';
|
|
3
|
-
import type { CommandPaletteState } from '../command-palette/hooks/use-command-palette-state.js';
|
|
4
5
|
import { type AppState } from './app-state.js';
|
|
5
6
|
/**
|
|
6
7
|
* Main entry point for the API client for electron and web.
|
|
@@ -24,12 +25,14 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
|
24
25
|
* Slot for customizing the actions section of the sidebar menu.
|
|
25
26
|
* This slot is used to render custom actions or components within the actions section.
|
|
26
27
|
*/
|
|
27
|
-
'sidebar-menu-actions':
|
|
28
|
+
'sidebar-menu-actions': () => unknown;
|
|
28
29
|
/**
|
|
29
30
|
* Slot for customizing the create workspace modal.
|
|
30
31
|
* This slot is used to render custom actions or components within the create workspace modal.
|
|
31
32
|
*/
|
|
32
|
-
'create-workspace'?: (
|
|
33
|
+
'create-workspace'?: (payload: {
|
|
34
|
+
state: ModalState;
|
|
35
|
+
}) => unknown;
|
|
33
36
|
}>;
|
|
34
37
|
export default _default;
|
|
35
38
|
type __VLS_WithSlots<T, S> = T & {
|
|
@@ -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":"AAoPA,OAAO,EAGL,KAAK,UAAU,EAChB,MAAM,oBAAoB,CAAA;AAY3B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,+DAA+D,CAAA;AAExG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAGxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,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,MAAM,OAAO;IACrC;;;OAGG;yBACkB,CAAC,OAAO,EAAE;QAAE,KAAK,EAAE,UAAU,CAAA;KAAE,KAAK,OAAO;;AAxBlE,wBA6WC;AAOD,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useModal as
|
|
3
|
-
import { getThemeStyles as
|
|
4
|
-
import { ScalarToasts as
|
|
5
|
-
import { extensions as
|
|
1
|
+
import { defineComponent as y, computed as p, createBlock as d, openBlock as i, unref as t, withCtx as m, createElementVNode as l, createVNode as r, createElementBlock as u, renderSlot as v, createCommentVNode as k, normalizeProps as T, guardReactiveProps as W } from "vue";
|
|
2
|
+
import { useModal as x, ScalarTeleportRoot as g } from "@scalar/components";
|
|
3
|
+
import { getThemeStyles as B } from "@scalar/themes";
|
|
4
|
+
import { ScalarToasts as C } from "@scalar/use-toasts";
|
|
5
|
+
import { extensions as _ } from "@scalar/workspace-store/schemas/extensions";
|
|
6
6
|
import { RouterView as E } from "vue-router";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { useDocumentWatcher as
|
|
10
|
-
import
|
|
11
|
-
import { useColorMode as
|
|
7
|
+
import A from "./components/CreateWorkspaceModal.vue.js";
|
|
8
|
+
import O from "./components/SplashScreen.vue.js";
|
|
9
|
+
import { useDocumentWatcher as M } from "./hooks/use-document-watcher.js";
|
|
10
|
+
import U from "../command-palette/TheCommandPalette.vue.js";
|
|
11
|
+
import { useColorMode as D } from "../../hooks/use-color-mode.js";
|
|
12
12
|
import { useGlobalHotKeys as I } from "../../hooks/use-global-hot-keys.js";
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import { mergeSecurity as
|
|
17
|
-
const
|
|
13
|
+
import N from "./components/AppSidebar.vue.js";
|
|
14
|
+
import P from "./components/DesktopTabs.vue.js";
|
|
15
|
+
import $ from "./components/DownloadAppButton.vue.js";
|
|
16
|
+
import { mergeSecurity as H } from "../../blocks/scalar-auth-selector-block/helpers/merge-security.js";
|
|
17
|
+
const L = ["innerHTML"], V = { key: 0 }, F = { class: "flex h-dvh w-dvw flex-1 flex-col" }, R = { class: "flex min-h-0 flex-1 flex-row" }, G = { class: "flex flex-1 flex-col" }, j = {
|
|
18
18
|
key: 0,
|
|
19
|
-
class: "flex
|
|
20
|
-
},
|
|
21
|
-
...
|
|
19
|
+
class: "flex h-12 items-center justify-end border-b p-2"
|
|
20
|
+
}, z = { class: "bg-b-1 min-h-0 flex-1" }, K = { key: 1 }, q = {}, de = /* @__PURE__ */ y({
|
|
21
|
+
...q,
|
|
22
22
|
__name: "App",
|
|
23
23
|
props: {
|
|
24
24
|
layout: {},
|
|
@@ -26,30 +26,30 @@ const P = ["innerHTML"], H = {
|
|
|
26
26
|
getAppState: { type: Function },
|
|
27
27
|
getCommandPaletteState: { type: Function }
|
|
28
28
|
},
|
|
29
|
-
setup(s, { expose:
|
|
30
|
-
|
|
31
|
-
openCreateWorkspace: () =>
|
|
29
|
+
setup(s, { expose: f }) {
|
|
30
|
+
f({
|
|
31
|
+
openCreateWorkspace: () => c.show()
|
|
32
32
|
});
|
|
33
|
-
const e = s.getAppState(),
|
|
34
|
-
typeof window < "u" && (window.dataDumpWorkspace = () => e.store.value, window.dumpAppState = () => e),
|
|
35
|
-
documentName: () => e.store.value?.workspace[
|
|
33
|
+
const e = s.getAppState(), w = s.getCommandPaletteState();
|
|
34
|
+
typeof window < "u" && (window.dataDumpWorkspace = () => e.store.value, window.dumpAppState = () => e), I(e.eventBus, s.layout), M({
|
|
35
|
+
documentName: () => e.store.value?.workspace[_.workspace.activeDocument],
|
|
36
36
|
store: e.store,
|
|
37
37
|
initialTimeout: 5e3
|
|
38
|
-
});
|
|
39
|
-
const S =
|
|
38
|
+
}), D({ workspaceStore: e.store });
|
|
39
|
+
const S = p(() => {
|
|
40
40
|
if (e.store.value === null)
|
|
41
41
|
return "";
|
|
42
|
-
const
|
|
43
|
-
return
|
|
44
|
-
}),
|
|
45
|
-
if (!
|
|
42
|
+
const a = e.store.value.workspace["x-scalar-theme"];
|
|
43
|
+
return a ? `<style>${B(a)}</style>` : "";
|
|
44
|
+
}), h = (a) => {
|
|
45
|
+
if (!a)
|
|
46
46
|
return;
|
|
47
|
-
const
|
|
48
|
-
(
|
|
47
|
+
const o = e.workspace.workspaceList.value?.find(
|
|
48
|
+
(n) => n.id === a
|
|
49
49
|
);
|
|
50
|
-
|
|
51
|
-
},
|
|
52
|
-
const
|
|
50
|
+
o && e.workspace.navigateToWorkspace(o.namespace, o.slug);
|
|
51
|
+
}, c = x(), b = p(() => {
|
|
52
|
+
const a = e.store.value?.auth ? H(
|
|
53
53
|
e.document.value?.components?.securitySchemes ?? {},
|
|
54
54
|
{},
|
|
55
55
|
e.store.value.auth,
|
|
@@ -67,66 +67,67 @@ const P = ["innerHTML"], H = {
|
|
|
67
67
|
workspaceStore: e.store.value,
|
|
68
68
|
activeWorkspace: e.workspace.activeWorkspace.value,
|
|
69
69
|
plugins: s.plugins,
|
|
70
|
-
securitySchemes:
|
|
70
|
+
securitySchemes: a
|
|
71
71
|
};
|
|
72
72
|
});
|
|
73
|
-
return (
|
|
74
|
-
default:
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
t(e).store.value !== null && t(e).workspace.activeWorkspace.value !== null && !t(e).loading.value ? (i(),
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
tabs: t(e).tabs.state.value
|
|
83
|
-
}, null, 8, ["activeTabIndex", "eventBus", "tabs"])) : (i(), c(L, {
|
|
84
|
-
key: 1,
|
|
85
|
-
activeWorkspace: t(e).workspace.activeWorkspace.value,
|
|
86
|
-
workspaces: t(e).workspace.workspaceList.value,
|
|
87
|
-
"onCreate:workspace": a[0] || (a[0] = (r) => t(l).show()),
|
|
88
|
-
"onSelect:workspace": p
|
|
89
|
-
}, null, 8, ["activeWorkspace", "workspaces"])),
|
|
90
|
-
u("div", F, [
|
|
91
|
-
n(D, {
|
|
92
|
-
isSidebarOpen: t(e).sidebar.isOpen.value,
|
|
93
|
-
"onUpdate:isSidebarOpen": a[1] || (a[1] = (r) => t(e).sidebar.isOpen.value = r),
|
|
94
|
-
activeWorkspace: t(e).workspace.activeWorkspace.value,
|
|
73
|
+
return (a, o) => (i(), d(t(g), null, {
|
|
74
|
+
default: m(() => [
|
|
75
|
+
l("div", { innerHTML: S.value }, null, 8, L),
|
|
76
|
+
r(t(C)),
|
|
77
|
+
t(e).store.value !== null && t(e).workspace.activeWorkspace.value !== null && !t(e).loading.value ? (i(), u("main", V, [
|
|
78
|
+
l("div", F, [
|
|
79
|
+
s.layout === "desktop" ? (i(), d(P, {
|
|
80
|
+
key: 0,
|
|
81
|
+
activeTabIndex: t(e).tabs.activeTabIndex.value,
|
|
95
82
|
eventBus: t(e).eventBus,
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
83
|
+
tabs: t(e).tabs.state.value
|
|
84
|
+
}, null, 8, ["activeTabIndex", "eventBus", "tabs"])) : k("", !0),
|
|
85
|
+
l("div", R, [
|
|
86
|
+
r(N, {
|
|
87
|
+
isSidebarOpen: t(e).sidebar.isOpen.value,
|
|
88
|
+
"onUpdate:isSidebarOpen": o[0] || (o[0] = (n) => t(e).sidebar.isOpen.value = n),
|
|
89
|
+
activeWorkspace: t(e).workspace.activeWorkspace.value,
|
|
90
|
+
eventBus: t(e).eventBus,
|
|
91
|
+
isWorkspaceOpen: t(e).workspace.isOpen.value,
|
|
92
|
+
layout: s.layout,
|
|
93
|
+
sidebarState: t(e).sidebar.state,
|
|
94
|
+
sidebarWidth: t(e).sidebar.width.value,
|
|
95
|
+
store: t(e).store.value,
|
|
96
|
+
workspaces: t(e).workspace.workspaceGroups.value,
|
|
97
|
+
"onClick:workspace": t(e).workspace.navigateToWorkspace,
|
|
98
|
+
"onCreate:workspace": o[1] || (o[1] = (n) => t(c).show()),
|
|
99
|
+
"onSelect:workspace": h,
|
|
100
|
+
onSelectItem: t(e).sidebar.handleSelectItem,
|
|
101
|
+
"onUpdate:sidebarWidth": t(e).sidebar.handleSidebarWidthUpdate
|
|
102
|
+
}, {
|
|
103
|
+
sidebarMenuActions: m(() => [
|
|
104
|
+
v(a.$slots, "sidebar-menu-actions")
|
|
105
|
+
]),
|
|
106
|
+
_: 3
|
|
107
|
+
}, 8, ["isSidebarOpen", "activeWorkspace", "eventBus", "isWorkspaceOpen", "layout", "sidebarState", "sidebarWidth", "store", "workspaces", "onClick:workspace", "onSelectItem", "onUpdate:sidebarWidth"]),
|
|
108
|
+
l("div", G, [
|
|
109
|
+
s.layout === "web" ? (i(), u("nav", j, [
|
|
110
|
+
r($)
|
|
111
|
+
])) : k("", !0),
|
|
112
|
+
l("div", z, [
|
|
113
|
+
r(t(E), T(W(b.value)), null, 16)
|
|
114
|
+
])
|
|
115
|
+
])
|
|
115
116
|
])
|
|
116
117
|
]),
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
state: t(
|
|
120
|
-
"onCreate:workspace":
|
|
118
|
+
v(a.$slots, "create-workspace", { state: t(c) }, () => [
|
|
119
|
+
r(A, {
|
|
120
|
+
state: t(c),
|
|
121
|
+
"onCreate:workspace": o[2] || (o[2] = (n) => t(e).workspace.create(n))
|
|
121
122
|
}, null, 8, ["state"])
|
|
122
123
|
]),
|
|
123
|
-
|
|
124
|
+
r(U, {
|
|
124
125
|
eventBus: t(e).eventBus,
|
|
125
|
-
paletteState: t(
|
|
126
|
+
paletteState: t(w),
|
|
126
127
|
workspaceStore: t(e).store.value
|
|
127
128
|
}, null, 8, ["eventBus", "paletteState", "workspaceStore"])
|
|
128
|
-
])) : (i(),
|
|
129
|
-
|
|
129
|
+
])) : (i(), u("main", K, [
|
|
130
|
+
r(O)
|
|
130
131
|
]))
|
|
131
132
|
]),
|
|
132
133
|
_: 3
|
|
@@ -134,5 +135,5 @@ const P = ["innerHTML"], H = {
|
|
|
134
135
|
}
|
|
135
136
|
});
|
|
136
137
|
export {
|
|
137
|
-
|
|
138
|
+
de as default
|
|
138
139
|
};
|
|
@@ -5,7 +5,7 @@ import type { Router } from 'vue-router';
|
|
|
5
5
|
export declare function initializeAppEventHandlers({ eventBus, store, router, rebuildSidebar, navigateToCurrentTab, onSelectSidebarItem, onAfterExampleCreation, onCopyTabUrl, onToggleSidebar, }: {
|
|
6
6
|
eventBus: WorkspaceEventBus;
|
|
7
7
|
store: ShallowRef<WorkspaceStore | null>;
|
|
8
|
-
router:
|
|
8
|
+
router: Router;
|
|
9
9
|
rebuildSidebar: (documentName?: string) => void;
|
|
10
10
|
navigateToCurrentTab: () => Promise<void>;
|
|
11
11
|
onSelectSidebarItem: (id: string) => void;
|
|
@@ -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,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAIxC,wBAAgB,0BAA0B,CAAC,EACzC,QAAQ,EACR,KAAK,EACL,MAAM,EACN,cAAc,EACd,oBAAoB,EACpB,mBAAmB,EACnB,sBAAsB,EACtB,YAAY,EACZ,eAAe,GAChB,EAAE;IACD,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,KAAK,EAAE,UAAU,CAAC,cAAc,GAAG,IAAI,CAAC,CAAA;IACxC,MAAM,EAAE,
|
|
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,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAIxC,wBAAgB,0BAA0B,CAAC,EACzC,QAAQ,EACR,KAAK,EACL,MAAM,EACN,cAAc,EACd,oBAAoB,EACpB,mBAAmB,EACnB,sBAAsB,EACtB,YAAY,EACZ,eAAe,GAChB,EAAE;IACD,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,KAAK,EAAE,UAAU,CAAC,cAAc,GAAG,IAAI,CAAC,CAAA;IACxC,MAAM,EAAE,MAAM,CAAA;IACd,cAAc,EAAE,CAAC,YAAY,CAAC,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;CAC5B,QAmNA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { computed as
|
|
2
|
-
import { initializeWorkspaceEventHandlers as
|
|
1
|
+
import { computed as E } from "vue";
|
|
2
|
+
import { initializeWorkspaceEventHandlers as h } from "../../workspace-events.js";
|
|
3
3
|
function N({
|
|
4
4
|
eventBus: m,
|
|
5
5
|
store: r,
|
|
@@ -11,13 +11,13 @@ function N({
|
|
|
11
11
|
onCopyTabUrl: i,
|
|
12
12
|
onToggleSidebar: f
|
|
13
13
|
}) {
|
|
14
|
-
const u =
|
|
14
|
+
const u = E(() => o.currentRoute?.value), l = ({
|
|
15
15
|
documentName: e,
|
|
16
16
|
path: a,
|
|
17
17
|
method: t,
|
|
18
18
|
exampleName: n
|
|
19
19
|
}) => !(e !== void 0 && e !== u.value?.params.documentSlug || a !== void 0 && encodeURIComponent(a) !== u.value?.params.pathEncoded || t !== void 0 && t !== u.value?.params.method || n !== void 0 && n !== u.value?.params.exampleName);
|
|
20
|
-
|
|
20
|
+
h({
|
|
21
21
|
eventBus: m,
|
|
22
22
|
store: r,
|
|
23
23
|
hooks: {
|
|
@@ -26,7 +26,7 @@ function N({
|
|
|
26
26
|
//------------------------------------------------------------------------------------
|
|
27
27
|
"document:delete:document": {
|
|
28
28
|
onAfterExecute: async (e) => {
|
|
29
|
-
u?.value?.params.documentSlug === e.name && await o.
|
|
29
|
+
u?.value?.params.documentSlug === e.name && await o.push({
|
|
30
30
|
name: "workspace.environment"
|
|
31
31
|
});
|
|
32
32
|
}
|
|
@@ -38,7 +38,7 @@ function N({
|
|
|
38
38
|
onBeforeExecute: (e) => ({
|
|
39
39
|
...e,
|
|
40
40
|
callback: async (a) => {
|
|
41
|
-
a === "success" && (await o.
|
|
41
|
+
a === "success" && (await o.replace({
|
|
42
42
|
name: "example",
|
|
43
43
|
params: {
|
|
44
44
|
method: e.payload.method,
|
|
@@ -69,7 +69,7 @@ function N({
|
|
|
69
69
|
documentName: a,
|
|
70
70
|
path: t,
|
|
71
71
|
method: n
|
|
72
|
-
}) && await o.
|
|
72
|
+
}) && await o.replace({
|
|
73
73
|
name: "document.overview",
|
|
74
74
|
params: {
|
|
75
75
|
documentSlug: a
|
|
@@ -89,7 +89,7 @@ function N({
|
|
|
89
89
|
path: t,
|
|
90
90
|
method: n,
|
|
91
91
|
exampleName: x
|
|
92
|
-
}) && await o.
|
|
92
|
+
}) && await o.replace({
|
|
93
93
|
name: "example",
|
|
94
94
|
params: {
|
|
95
95
|
pathEncoded: encodeURIComponent(t),
|
|
@@ -143,8 +143,8 @@ function N({
|
|
|
143
143
|
onAfterExecute: c
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
|
-
}), m.on("scroll-to:nav-item", ({ id: e }) => d(e)), m.on("ui:toggle:sidebar", f), m.on("ui:route:page", ({ name: e }) => o.
|
|
147
|
-
const t = await o.
|
|
146
|
+
}), m.on("scroll-to:nav-item", ({ id: e }) => d(e)), m.on("ui:toggle:sidebar", f), m.on("ui:route:page", ({ name: e }) => o.push({ name: e })), m.on("ui:route:example", async ({ exampleName: e, callback: a }) => {
|
|
147
|
+
const t = await o.replace({
|
|
148
148
|
name: "example",
|
|
149
149
|
params: {
|
|
150
150
|
exampleName: e
|