@scalar/api-client 2.26.2 → 2.29.1
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 +218 -0
- package/dist/components/Server/ServerSelector.vue.js +6 -6
- package/dist/components/ViewLayout/ViewLayoutCollapse.vue.js +6 -6
- 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/operation-block/helpers/build-request-body.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/build-request-body.js +29 -25
- package/dist/v2/blocks/operation-block/helpers/get-example.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/get-example.js +15 -15
- package/dist/v2/blocks/operation-block/helpers/get-selected-body-content-type.d.ts +10 -0
- package/dist/v2/blocks/operation-block/helpers/get-selected-body-content-type.d.ts.map +1 -0
- package/dist/v2/blocks/operation-block/helpers/get-selected-body-content-type.js +4 -0
- package/dist/v2/blocks/request-block/RequestBlock.vue.js +1 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue2.js +26 -26
- 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 +88 -103
- 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/response-block/ResponseBlock.vue.js +1 -1
- package/dist/v2/blocks/response-block/ResponseBlock.vue2.js +7 -7
- package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.d.ts.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseEmpty.vue2.js +31 -40
- 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 +52 -54
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts +3 -2
- 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 +106 -86
- package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.d.ts +21 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue.js +91 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/OpenIDConnect.vue2.js +4 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.js +107 -93
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.js +87 -65
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.d.ts +36 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.js +35 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-security.d.ts +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-security.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-security.js +18 -10
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/openid-discovery-to-flows.d.ts +5 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/openid-discovery-to-flows.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/openid-discovery-to-flows.js +27 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/secret-types.d.ts +3 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/secret-types.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.d.ts +4 -3
- 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 +32 -40
- 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/layout/CollapsibleSection.vue.js +1 -1
- package/dist/v2/components/sidebar/Sidebar.vue.d.ts +2 -0
- package/dist/v2/components/sidebar/Sidebar.vue.d.ts.map +1 -1
- package/dist/v2/components/sidebar/Sidebar.vue.js +25 -24
- package/dist/v2/components/sidebar/SidebarMenu.vue.d.ts +2 -0
- package/dist/v2/components/sidebar/SidebarMenu.vue.d.ts.map +1 -1
- package/dist/v2/components/sidebar/SidebarMenu.vue.js +30 -30
- package/dist/v2/features/app/App.vue.d.ts +5 -0
- package/dist/v2/features/app/App.vue.d.ts.map +1 -1
- package/dist/v2/features/app/App.vue.js +80 -78
- 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.map +1 -1
- package/dist/v2/features/app/app-state.js +172 -151
- 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/AppSidebar.vue2.js +99 -97
- 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/create-api-client-app.d.ts +11 -1
- 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 +12 -10
- package/dist/v2/features/app/helpers/routes.d.ts +2 -0
- package/dist/v2/features/app/helpers/routes.d.ts.map +1 -1
- package/dist/v2/features/app/helpers/routes.js +11 -11
- package/dist/v2/features/app/hooks/use-theme.d.ts +42 -0
- package/dist/v2/features/app/hooks/use-theme.d.ts.map +1 -0
- package/dist/v2/features/app/hooks/use-theme.js +34 -0
- package/dist/v2/features/collection/DocumentCollection.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/DocumentCollection.vue.js +27 -26
- 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 +41 -22
- 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 +49 -40
- package/dist/v2/features/collection/components/Cookies.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/Cookies.vue.js +26 -13
- package/dist/v2/features/collection/components/Environment.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/Environment.vue.js +27 -15
- 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/Overview.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/Overview.vue.js +2 -2
- package/dist/v2/features/collection/components/Overview.vue2.js +68 -61
- package/dist/v2/features/collection/components/Servers.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/Servers.vue.js +93 -88
- package/dist/v2/features/collection/components/Settings.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/Settings.vue.js +19 -17
- 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/environments/EnvironmentsList.vue.js +1 -1
- package/dist/v2/features/global-cookies/components/CookiesTable.vue.d.ts.map +1 -1
- package/dist/v2/features/global-cookies/components/CookiesTable.vue.js +2 -2
- package/dist/v2/features/global-cookies/components/CookiesTable.vue2.js +8 -8
- package/dist/v2/features/modal/Modal.vue.d.ts.map +1 -1
- package/dist/v2/features/modal/Modal.vue.js +15 -15
- package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
- package/dist/v2/features/operation/Operation.vue.js +30 -33
- package/dist/v2/features/settings/CollectionSettings.vue.d.ts +10 -7
- package/dist/v2/features/settings/CollectionSettings.vue.d.ts.map +1 -1
- package/dist/v2/features/settings/CollectionSettings.vue.js +183 -149
- package/dist/v2/features/settings/DocumentSettings.vue.d.ts.map +1 -1
- package/dist/v2/features/settings/DocumentSettings.vue.js +88 -79
- package/dist/v2/features/settings/components/Section.vue.d.ts +2 -1
- package/dist/v2/features/settings/components/Section.vue.d.ts.map +1 -1
- package/dist/v2/features/settings/components/Section.vue.js +26 -15
- package/dist/v2/features/settings/helpers/get-theme-colors.d.ts +4 -3
- package/dist/v2/features/settings/helpers/get-theme-colors.d.ts.map +1 -1
- package/dist/v2/features/settings/helpers/get-theme-colors.js +6 -7
- package/dist/v2/helpers/handle-hotkeys.d.ts.map +1 -1
- package/dist/v2/helpers/handle-hotkeys.js +2 -2
- package/dist/v2/hooks/use-global-hot-keys.d.ts +3 -1
- package/dist/v2/hooks/use-global-hot-keys.d.ts.map +1 -1
- package/dist/v2/hooks/use-global-hot-keys.js +8 -6
- package/dist/v2/workspace-events.d.ts.map +1 -1
- package/dist/v2/workspace-events.js +132 -115
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/package.json +17 -16
- 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,7 +1,8 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarDropdown as
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { defineComponent as C, ref as T, watch as b, nextTick as p, createBlock as i, openBlock as d, unref as n, withCtx as o, createCommentVNode as l, createElementVNode as c, createVNode as u, createTextVNode as s } from "vue";
|
|
2
|
+
import { ScalarDropdown as P, ScalarDropdownItem as r, ScalarIcon as y, ScalarDropdownDivider as z } from "@scalar/components";
|
|
3
|
+
import { ScalarIconPencil as M } from "@scalar/icons";
|
|
4
|
+
import { getParentEntry as f } from "@scalar/workspace-store/navigation";
|
|
5
|
+
const $ = { class: "flex items-center gap-2" }, V = { class: "flex items-center gap-2" }, O = { class: "flex items-center gap-2" }, W = { class: "flex items-center gap-2" }, q = { class: "text-red flex items-center gap-2" }, G = /* @__PURE__ */ C({
|
|
5
6
|
__name: "SidebarItemMenu",
|
|
6
7
|
props: {
|
|
7
8
|
item: {},
|
|
@@ -10,111 +11,138 @@ const z = { class: "flex items-center gap-2" }, N = { class: "flex items-center
|
|
|
10
11
|
target: {}
|
|
11
12
|
},
|
|
12
13
|
emits: ["closeMenu", "showDeleteModal"],
|
|
13
|
-
setup(e, { emit:
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
!
|
|
14
|
+
setup(e, { emit: E }) {
|
|
15
|
+
const v = E, g = T(!1);
|
|
16
|
+
b(g, async (a, t) => {
|
|
17
|
+
!a && t && (await p(), v("closeMenu"));
|
|
17
18
|
});
|
|
18
|
-
const
|
|
19
|
+
const x = () => e.item.type === "document" || e.item.type === "tag", k = () => e.item.type === "document", S = () => e.item.type === "tag", A = () => e.item.type === "operation", B = () => e.item.type === "document" && e.item.id !== "drafts" || e.item.type === "tag" || e.item.type === "operation" || e.item.type === "example", D = () => {
|
|
19
20
|
if (e.item.type === "document" && e.eventBus.emit("ui:open:command-palette", {
|
|
20
21
|
action: "create-request",
|
|
21
22
|
payload: {
|
|
22
|
-
|
|
23
|
+
documentName: e.item.name
|
|
23
24
|
}
|
|
24
25
|
}), e.item.type === "tag") {
|
|
25
|
-
const
|
|
26
|
+
const a = e.sidebarState.getEntryById(e.item.id);
|
|
26
27
|
e.eventBus.emit("ui:open:command-palette", {
|
|
27
28
|
action: "create-request",
|
|
28
29
|
payload: {
|
|
29
|
-
|
|
30
|
+
documentName: f("document", a)?.name,
|
|
30
31
|
tagId: e.item.name
|
|
31
32
|
}
|
|
32
33
|
});
|
|
33
34
|
}
|
|
34
|
-
},
|
|
35
|
+
}, I = () => {
|
|
35
36
|
e.item.type === "document" && e.eventBus.emit("ui:open:command-palette", {
|
|
36
37
|
action: "add-tag",
|
|
37
38
|
payload: {
|
|
38
|
-
|
|
39
|
+
documentName: e.item.name
|
|
39
40
|
}
|
|
40
41
|
});
|
|
42
|
+
}, N = () => {
|
|
43
|
+
if (e.item.type === "tag") {
|
|
44
|
+
const a = e.sidebarState.getEntryById(e.item.id);
|
|
45
|
+
e.eventBus.emit(
|
|
46
|
+
"ui:open:command-palette",
|
|
47
|
+
{
|
|
48
|
+
action: "edit-tag",
|
|
49
|
+
payload: {
|
|
50
|
+
tag: e.item,
|
|
51
|
+
documentName: f("document", a)?.name ?? ""
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
{ skipUnpackProxy: !0 }
|
|
55
|
+
);
|
|
56
|
+
}
|
|
41
57
|
}, w = () => {
|
|
42
58
|
if (e.item.type === "operation") {
|
|
43
|
-
const
|
|
59
|
+
const a = e.sidebarState.getEntryById(e.item.id);
|
|
44
60
|
e.eventBus.emit("ui:open:command-palette", {
|
|
45
61
|
action: "add-example",
|
|
46
62
|
payload: {
|
|
47
|
-
|
|
63
|
+
documentName: f("document", a)?.name,
|
|
48
64
|
operationId: e.item.id
|
|
49
65
|
}
|
|
50
66
|
});
|
|
51
67
|
}
|
|
52
68
|
};
|
|
53
|
-
return (
|
|
54
|
-
open:
|
|
55
|
-
"onUpdate:open": t[
|
|
69
|
+
return (a, t) => (d(), i(n(P), {
|
|
70
|
+
open: g.value,
|
|
71
|
+
"onUpdate:open": t[5] || (t[5] = (m) => g.value = m),
|
|
56
72
|
placement: "bottom-end",
|
|
57
73
|
target: e.target,
|
|
58
74
|
teleport: ""
|
|
59
75
|
}, {
|
|
60
|
-
items:
|
|
61
|
-
|
|
76
|
+
items: o(() => [
|
|
77
|
+
x() ? (d(), i(n(r), {
|
|
62
78
|
key: 0,
|
|
63
|
-
onClick: t[0] || (t[0] = (
|
|
79
|
+
onClick: t[0] || (t[0] = (m) => D())
|
|
64
80
|
}, {
|
|
65
|
-
default:
|
|
66
|
-
|
|
81
|
+
default: o(() => [
|
|
82
|
+
c("div", $, [
|
|
67
83
|
u(n(y), {
|
|
68
84
|
icon: "Add",
|
|
69
85
|
size: "sm"
|
|
70
86
|
}),
|
|
71
|
-
t[
|
|
87
|
+
t[6] || (t[6] = s(" Add Operation ", -1))
|
|
72
88
|
])
|
|
73
89
|
]),
|
|
74
90
|
_: 1
|
|
75
91
|
})) : l("", !0),
|
|
76
|
-
|
|
92
|
+
k() ? (d(), i(n(r), {
|
|
77
93
|
key: 1,
|
|
78
|
-
onClick: t[1] || (t[1] = (
|
|
94
|
+
onClick: t[1] || (t[1] = (m) => I())
|
|
79
95
|
}, {
|
|
80
|
-
default:
|
|
81
|
-
|
|
96
|
+
default: o(() => [
|
|
97
|
+
c("div", V, [
|
|
82
98
|
u(n(y), {
|
|
83
99
|
icon: "Add",
|
|
84
100
|
size: "sm"
|
|
85
101
|
}),
|
|
86
|
-
t[
|
|
102
|
+
t[7] || (t[7] = s(" Add Tag ", -1))
|
|
87
103
|
])
|
|
88
104
|
]),
|
|
89
105
|
_: 1
|
|
90
106
|
})) : l("", !0),
|
|
91
|
-
|
|
107
|
+
S() ? (d(), i(n(r), {
|
|
92
108
|
key: 2,
|
|
93
|
-
onClick: t[2] || (t[2] = (
|
|
109
|
+
onClick: t[2] || (t[2] = (m) => N())
|
|
110
|
+
}, {
|
|
111
|
+
default: o(() => [
|
|
112
|
+
c("div", O, [
|
|
113
|
+
u(n(M), { size: "sm" }),
|
|
114
|
+
t[8] || (t[8] = s(" Rename Tag ", -1))
|
|
115
|
+
])
|
|
116
|
+
]),
|
|
117
|
+
_: 1
|
|
118
|
+
})) : l("", !0),
|
|
119
|
+
A() ? (d(), i(n(r), {
|
|
120
|
+
key: 3,
|
|
121
|
+
onClick: t[3] || (t[3] = (m) => w())
|
|
94
122
|
}, {
|
|
95
|
-
default:
|
|
96
|
-
|
|
123
|
+
default: o(() => [
|
|
124
|
+
c("div", W, [
|
|
97
125
|
u(n(y), {
|
|
98
126
|
icon: "Add",
|
|
99
127
|
size: "sm"
|
|
100
128
|
}),
|
|
101
|
-
t[
|
|
129
|
+
t[9] || (t[9] = s(" Add Example ", -1))
|
|
102
130
|
])
|
|
103
131
|
]),
|
|
104
132
|
_: 1
|
|
105
133
|
})) : l("", !0),
|
|
106
|
-
(
|
|
107
|
-
|
|
108
|
-
key:
|
|
109
|
-
onClick: t[
|
|
134
|
+
(A() || x() || k()) && B() ? (d(), i(n(z), { key: 4 })) : l("", !0),
|
|
135
|
+
B() ? (d(), i(n(r), {
|
|
136
|
+
key: 5,
|
|
137
|
+
onClick: t[4] || (t[4] = (m) => v("showDeleteModal"))
|
|
110
138
|
}, {
|
|
111
|
-
default:
|
|
112
|
-
|
|
139
|
+
default: o(() => [
|
|
140
|
+
c("div", q, [
|
|
113
141
|
u(n(y), {
|
|
114
142
|
icon: "Delete",
|
|
115
143
|
size: "sm"
|
|
116
144
|
}),
|
|
117
|
-
t[
|
|
145
|
+
t[10] || (t[10] = s(" Delete ", -1))
|
|
118
146
|
])
|
|
119
147
|
]),
|
|
120
148
|
_: 1
|
|
@@ -125,5 +153,5 @@ const z = { class: "flex items-center gap-2" }, N = { class: "flex items-center
|
|
|
125
153
|
}
|
|
126
154
|
});
|
|
127
155
|
export {
|
|
128
|
-
|
|
156
|
+
G as default
|
|
129
157
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ClientPlugin } from '@scalar/oas-utils/helpers';
|
|
2
|
+
import type { Theme } from '@scalar/themes';
|
|
2
3
|
import type { ClientLayout } from '../../../../v2/types/layout';
|
|
3
4
|
type CreateApiClientOptions = {
|
|
4
5
|
/**
|
|
@@ -12,6 +13,15 @@ type CreateApiClientOptions = {
|
|
|
12
13
|
* Api client plugins to include in the app
|
|
13
14
|
*/
|
|
14
15
|
plugins?: ClientPlugin[];
|
|
16
|
+
/**
|
|
17
|
+
* Custom themes to include in the app
|
|
18
|
+
*/
|
|
19
|
+
customThemes?: Theme[];
|
|
20
|
+
/**
|
|
21
|
+
* Fallback theme slug to use if no theme is selected for the workspace
|
|
22
|
+
* @default 'default'
|
|
23
|
+
*/
|
|
24
|
+
fallbackThemeSlug?: string;
|
|
15
25
|
};
|
|
16
26
|
/**
|
|
17
27
|
* Creates the appropriate router with the appropriate routes based on the layout
|
|
@@ -20,7 +30,7 @@ export declare const createAppRouter: (layout: CreateApiClientOptions["layout"])
|
|
|
20
30
|
/**
|
|
21
31
|
* Create the API Client with router and passes in the workspace store as a prop
|
|
22
32
|
*/
|
|
23
|
-
export declare const createApiClientApp: (el: HTMLElement | null, { layout, plugins }: CreateApiClientOptions) => Promise<{
|
|
33
|
+
export declare const createApiClientApp: (el: HTMLElement | null, { layout, plugins, customThemes, fallbackThemeSlug }: CreateApiClientOptions) => Promise<{
|
|
24
34
|
app: import("vue").App<Element>;
|
|
25
35
|
state: import("../../../../v2/features/app/app-state.js").AppState;
|
|
26
36
|
} | undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-api-client-app.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/app/helpers/create-api-client-app.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;
|
|
1
|
+
{"version":3,"file":"create-api-client-app.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/app/helpers/create-api-client-app.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAO3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAIrD,KAAK,sBAAsB,GAAG;IAC5B;;;;;OAKG;IACH,MAAM,EAAE,OAAO,CAAC,YAAY,EAAE,OAAO,CAAC,CAAA;IACtC;;OAEG;IACH,OAAO,CAAC,EAAE,YAAY,EAAE,CAAA;IACxB;;OAEG;IACH,YAAY,CAAC,EAAE,KAAK,EAAE,CAAA;IACtB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC3B,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,eAAe,GAAI,QAAQ,sBAAsB,CAAC,QAAQ,CAAC,gCAQvE,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAC7B,IAAI,WAAW,GAAG,IAAI,EACtB,sDAA8E,sBAAsB;;;cAkCrG,CAAA"}
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
import { createApp as
|
|
2
|
-
import { createRouter as p, createWebHistory as
|
|
3
|
-
import
|
|
1
|
+
import { createApp as l } from "vue";
|
|
2
|
+
import { createRouter as p, createWebHistory as u, createWebHashHistory as d } from "vue-router";
|
|
3
|
+
import f from "../App.vue.js";
|
|
4
4
|
/* empty css */
|
|
5
|
-
import { createAppState as
|
|
5
|
+
import { createAppState as A } from "../app-state.js";
|
|
6
6
|
import { ROUTES as c } from "./routes.js";
|
|
7
|
-
import { useCommandPaletteState as
|
|
8
|
-
const
|
|
9
|
-
const o =
|
|
7
|
+
import { useCommandPaletteState as h } from "../../command-palette/hooks/use-command-palette-state.js";
|
|
8
|
+
const S = (t) => t === "web" ? p({ history: u(), routes: c }) : p({ history: d(), routes: c }), k = async (t, { layout: r = "desktop", plugins: i, customThemes: m, fallbackThemeSlug: n = "default" }) => {
|
|
9
|
+
const o = S(r), a = await A({ router: o }), s = h(), e = l(f, {
|
|
10
10
|
layout: r,
|
|
11
11
|
plugins: i,
|
|
12
|
+
customThemes: m,
|
|
13
|
+
fallbackThemeSlug: n,
|
|
12
14
|
getAppState: () => a,
|
|
13
|
-
getCommandPaletteState: () =>
|
|
15
|
+
getCommandPaletteState: () => s
|
|
14
16
|
});
|
|
15
17
|
if (e.use(o), !t) {
|
|
16
18
|
console.error(
|
|
@@ -26,6 +28,6 @@ const A = (t) => t === "web" ? p({ history: s(), routes: c }) : p({ history: l()
|
|
|
26
28
|
};
|
|
27
29
|
};
|
|
28
30
|
export {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
+
k as createApiClientApp,
|
|
32
|
+
S as createAppRouter
|
|
31
33
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { HttpMethod } from '@scalar/helpers/http/http-methods';
|
|
2
2
|
import type { ClientPlugin } from '@scalar/oas-utils/helpers';
|
|
3
|
+
import type { Theme } from '@scalar/themes';
|
|
3
4
|
import type { WorkspaceStore } from '@scalar/workspace-store/client';
|
|
4
5
|
import type { WorkspaceEventBus } from '@scalar/workspace-store/events';
|
|
5
6
|
import type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments';
|
|
@@ -23,6 +24,7 @@ export type RouteProps = {
|
|
|
23
24
|
label: string;
|
|
24
25
|
};
|
|
25
26
|
plugins: ClientPlugin[];
|
|
27
|
+
customThemes?: Theme[];
|
|
26
28
|
};
|
|
27
29
|
/** When in the collections pages */
|
|
28
30
|
export type CollectionProps = RouteProps & ({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/app/helpers/routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AAEnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AACnH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAA;AAGlF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+DAA+D,CAAA;AAW1G,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,kDAAkD;AAClD,MAAM,MAAM,UAAU,GAAG;IACvB,YAAY,EAAE,MAAM,CAAA;IACpB,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAA;IAClC,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,MAAM,EAAE,YAAY,CAAA;IACpB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,UAAU,CAAA;IACnB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,WAAW,EAAE,kBAAkB,CAAA;IAC/B,eAAe,EAAE,qBAAqB,CAAA;IACtC,cAAc,EAAE,cAAc,CAAA;IAC9B,eAAe,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAA;IAC9C,OAAO,EAAE,YAAY,EAAE,CAAA;
|
|
1
|
+
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/app/helpers/routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AAEnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AACnH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAA;AAGlF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+DAA+D,CAAA;AAW1G,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,kDAAkD;AAClD,MAAM,MAAM,UAAU,GAAG;IACvB,YAAY,EAAE,MAAM,CAAA;IACpB,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAA;IAClC,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,MAAM,EAAE,YAAY,CAAA;IACpB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,UAAU,CAAA;IACnB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,WAAW,EAAE,kBAAkB,CAAA;IAC/B,eAAe,EAAE,qBAAqB,CAAA;IACtC,cAAc,EAAE,cAAc,CAAA;IAC9B,eAAe,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAA;IAC9C,OAAO,EAAE,YAAY,EAAE,CAAA;IACvB,YAAY,CAAC,EAAE,KAAK,EAAE,CAAA;CAGvB,CAAA;AAED,oCAAoC;AACpC,MAAM,MAAM,eAAe,GAAG,UAAU,GACtC,CACI;IACE,cAAc,EAAE,UAAU,CAAA;IAC1B,QAAQ,EAAE,iBAAiB,CAAA;CAC5B,GACD;IACE,cAAc,EAAE,WAAW,CAAA;IAC3B,QAAQ,EAAE,IAAI,CAAA;CACf,CACJ,CAAA;AAEH,MAAM,MAAM,0BAA0B,GAClC,WAAW,GACX,eAAe,GACf,cAAc,GACd,aAAa,GACb,QAAQ,GACR,aAAa,CAAA;AAEjB,kFAAkF;AAClF,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;oCAlBK,UAAU;8BAChB,iBAAiB;;oCAGX,WAAW;8BACjB,IAAI;;oCALE,UAAU;8BAChB,iBAAiB;;oCAGX,WAAW;8BACjB,IAAI;;;;;;;;;;;;;;;gCALE,UAAU;0BAChB,iBAAiB;;gCAGX,WAAW;0BACjB,IAAI;;gCALE,UAAU;0BAChB,iBAAiB;;gCAGX,WAAW;0BACjB,IAAI;;;;;;;;;IAgIM,CAAA"}
|
|
@@ -4,17 +4,17 @@ import o from "../../collection/components/Cookies.vue.js";
|
|
|
4
4
|
import n from "../../collection/components/Environment.vue.js";
|
|
5
5
|
import h from "../../collection/components/Overview.vue.js";
|
|
6
6
|
import d from "../../collection/components/Servers.vue.js";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
7
|
+
import m from "../../collection/components/Settings.vue.js";
|
|
8
|
+
import u from "../../collection/DocumentCollection.vue.js";
|
|
9
|
+
import f from "../../collection/WorkspaceCollection.vue.js";
|
|
10
10
|
import l from "../../operation/Operation.vue.js";
|
|
11
|
-
import { workspaceStorage as
|
|
11
|
+
import { workspaceStorage as a } from "../../../helpers/storage.js";
|
|
12
12
|
const A = [
|
|
13
13
|
{
|
|
14
14
|
path: "/@:namespace/:workspaceSlug",
|
|
15
15
|
children: [
|
|
16
16
|
{
|
|
17
|
-
path: "
|
|
17
|
+
path: "document/:documentSlug",
|
|
18
18
|
children: [
|
|
19
19
|
// Example page
|
|
20
20
|
{
|
|
@@ -26,7 +26,7 @@ const A = [
|
|
|
26
26
|
{
|
|
27
27
|
name: "document",
|
|
28
28
|
path: "",
|
|
29
|
-
component:
|
|
29
|
+
component: u,
|
|
30
30
|
children: [
|
|
31
31
|
// Redirect to overview
|
|
32
32
|
{
|
|
@@ -70,7 +70,7 @@ const A = [
|
|
|
70
70
|
{
|
|
71
71
|
name: "document.settings",
|
|
72
72
|
path: "settings",
|
|
73
|
-
component:
|
|
73
|
+
component: m
|
|
74
74
|
}
|
|
75
75
|
]
|
|
76
76
|
}
|
|
@@ -80,7 +80,7 @@ const A = [
|
|
|
80
80
|
{
|
|
81
81
|
name: "workspace",
|
|
82
82
|
path: "",
|
|
83
|
-
component:
|
|
83
|
+
component: f,
|
|
84
84
|
children: [
|
|
85
85
|
// Workspace environment
|
|
86
86
|
{
|
|
@@ -98,7 +98,7 @@ const A = [
|
|
|
98
98
|
{
|
|
99
99
|
name: "workspace.settings",
|
|
100
100
|
path: "settings",
|
|
101
|
-
component:
|
|
101
|
+
component: m
|
|
102
102
|
}
|
|
103
103
|
]
|
|
104
104
|
}
|
|
@@ -107,8 +107,8 @@ const A = [
|
|
|
107
107
|
{
|
|
108
108
|
path: "/:pathMatch(.*)*",
|
|
109
109
|
redirect: () => {
|
|
110
|
-
const e = "/@local/
|
|
111
|
-
|
|
110
|
+
const e = "/@local/default/document/drafts/overview", r = a.getLastPath() ?? e;
|
|
111
|
+
a.setCurrentPath(e);
|
|
112
112
|
const t = new URL(r, "http://example.com"), c = new URLSearchParams(window.location.search), p = i(t.searchParams, c);
|
|
113
113
|
return `${t.pathname}?${p.toString()}`;
|
|
114
114
|
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { type Theme } from '@scalar/themes';
|
|
2
|
+
import type { WorkspaceStore } from '@scalar/workspace-store/client';
|
|
3
|
+
import { type MaybeRefOrGetter } from 'vue';
|
|
4
|
+
/**
|
|
5
|
+
* useTheme
|
|
6
|
+
*
|
|
7
|
+
* Reactive Vue.js hook to resolve and generate a <style> tag string based on the current theme.
|
|
8
|
+
* Automatically selects the appropriate theme styles in the following priority order:
|
|
9
|
+
* 1. Workspace theme (from the provided store, e.g. store.workspace['x-scalar-theme'])
|
|
10
|
+
* 2. Fallback theme (from the fallbackThemeSlug prop)
|
|
11
|
+
* 3. Default built-in theme (with slug "default")
|
|
12
|
+
*
|
|
13
|
+
* The returned `themeStyleTag` can be injected into your page to dynamically apply theming.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* // In a Vue component setup() function
|
|
18
|
+
* import { ref } from 'vue'
|
|
19
|
+
* import { useTheme } from './use-theme.js'
|
|
20
|
+
*
|
|
21
|
+
* const myThemes = ref([...])
|
|
22
|
+
* const workspaceStore = ref(...)
|
|
23
|
+
* const fallbackThemeSlug = ref('dark')
|
|
24
|
+
*
|
|
25
|
+
* const { themeStyleTag } = useTheme({
|
|
26
|
+
* customThemes: myThemes,
|
|
27
|
+
* fallbackThemeSlug,
|
|
28
|
+
* store: workspaceStore
|
|
29
|
+
* })
|
|
30
|
+
*
|
|
31
|
+
* // To inject in template:
|
|
32
|
+
* // <div v-html="themeStyleTag"></div>
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
export declare const useTheme: ({ fallbackThemeSlug, store, customThemes, }: {
|
|
36
|
+
customThemes: MaybeRefOrGetter<Theme[]>;
|
|
37
|
+
fallbackThemeSlug: MaybeRefOrGetter<string>;
|
|
38
|
+
store: MaybeRefOrGetter<WorkspaceStore | null>;
|
|
39
|
+
}) => {
|
|
40
|
+
themeStyleTag: import("vue").ComputedRef<string>;
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=use-theme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-theme.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/app/hooks/use-theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,KAAK,EAA8B,MAAM,gBAAgB,CAAA;AACvE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,EAAE,KAAK,gBAAgB,EAAqB,MAAM,KAAK,CAAA;AAkC9D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,eAAO,MAAM,QAAQ,GAAI,6CAItB;IACD,YAAY,EAAE,gBAAgB,CAAC,KAAK,EAAE,CAAC,CAAA;IACvC,iBAAiB,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAA;IAC3C,KAAK,EAAE,gBAAgB,CAAC,cAAc,GAAG,IAAI,CAAC,CAAA;CAC/C;;CA2CA,CAAA"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { themePresets as y, defaultFonts as S } from "@scalar/themes";
|
|
2
|
+
import { computed as T, toValue as a } from "vue";
|
|
3
|
+
const p = new Map(y.map((e) => [e.slug, e])), l = (e, s = "scalar-theme") => `<style id="scalar-theme" data-testid="${s}">${e}</style>`, o = (e, s) => {
|
|
4
|
+
const r = (t) => `${t}
|
|
5
|
+
${S}`;
|
|
6
|
+
if (p.has(e))
|
|
7
|
+
return r(p.get(e)?.theme ?? "");
|
|
8
|
+
const c = s.find((t) => t.slug === e);
|
|
9
|
+
if (c)
|
|
10
|
+
return r(c.theme);
|
|
11
|
+
}, w = ({
|
|
12
|
+
fallbackThemeSlug: e,
|
|
13
|
+
store: s,
|
|
14
|
+
customThemes: r
|
|
15
|
+
}) => ({
|
|
16
|
+
themeStyleTag: T(() => {
|
|
17
|
+
const t = l(o("default", []), "default"), m = a(s), n = a(e);
|
|
18
|
+
if (m === null)
|
|
19
|
+
return t;
|
|
20
|
+
const f = m.workspace["x-scalar-theme"], u = f === "none" ? n : f;
|
|
21
|
+
if (!u) {
|
|
22
|
+
const i = o(n, a(r));
|
|
23
|
+
return i ? l(i, n) : t;
|
|
24
|
+
}
|
|
25
|
+
const h = o(u, a(r));
|
|
26
|
+
if (h)
|
|
27
|
+
return l(h, u);
|
|
28
|
+
const d = o(n, a(r));
|
|
29
|
+
return d ? l(d, n) : t;
|
|
30
|
+
})
|
|
31
|
+
});
|
|
32
|
+
export {
|
|
33
|
+
w as useTheme
|
|
34
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentCollection.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/collection/DocumentCollection.vue"],"names":[],"mappings":"AAyJA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAA;AAMlE;;;;;;;GAOG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAKzC,QAAA,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"DocumentCollection.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/collection/DocumentCollection.vue"],"names":[],"mappings":"AAyJA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAA;AAMlE;;;;;;;GAOG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAKzC,QAAA,MAAM,YAAY,gSA4Vd,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as h, computed as p, createElementBlock as c, openBlock as u, createElementVNode as t, createVNode as o, createBlock as f, createCommentVNode as y, withCtx as l, unref as s, resolveDynamicComponent as g, mergeProps as k } from "vue";
|
|
2
2
|
import { ScalarButton as i } from "@scalar/components";
|
|
3
3
|
import { ScalarIconFloppyDisk as b } from "@scalar/icons";
|
|
4
4
|
import { LibraryIcon as w } from "@scalar/icons/library";
|
|
@@ -9,14 +9,14 @@ import V from "./components/LabelInput.vue.js";
|
|
|
9
9
|
import B from "./components/Tabs.vue.js";
|
|
10
10
|
const D = { class: "custom-scroll h-full" }, N = {
|
|
11
11
|
key: 0,
|
|
12
|
-
class: "w-full md:mx-auto md:max-w-
|
|
13
|
-
}, z = ["aria-label"], I = { class: "flex flex-row items-center gap-2" }, U = { class: "group relative ml-1.25" },
|
|
12
|
+
class: "w-full md:mx-auto md:max-w-180"
|
|
13
|
+
}, z = ["aria-label"], I = { class: "flex flex-row items-center gap-2" }, U = { class: "group relative ml-1.25" }, T = { class: "px-1.5 py-8" }, $ = {
|
|
14
14
|
key: 1,
|
|
15
15
|
class: "flex w-full flex-1 items-center justify-center"
|
|
16
|
-
},
|
|
16
|
+
}, j = {
|
|
17
17
|
name: "DocumentCollection"
|
|
18
|
-
}, H = /* @__PURE__ */
|
|
19
|
-
...
|
|
18
|
+
}, H = /* @__PURE__ */ h({
|
|
19
|
+
...j,
|
|
20
20
|
props: {
|
|
21
21
|
documentSlug: {},
|
|
22
22
|
document: {},
|
|
@@ -29,21 +29,22 @@ const D = { class: "custom-scroll h-full" }, N = {
|
|
|
29
29
|
securitySchemes: {},
|
|
30
30
|
workspaceStore: {},
|
|
31
31
|
activeWorkspace: {},
|
|
32
|
-
plugins: {}
|
|
32
|
+
plugins: {},
|
|
33
|
+
customThemes: {}
|
|
33
34
|
},
|
|
34
35
|
setup(a) {
|
|
35
36
|
const n = a, m = p(() => n.document?.info?.title || "Untitled Document"), d = p(
|
|
36
37
|
() => n.document?.["x-scalar-icon"] || "interface-content-folder"
|
|
37
|
-
),
|
|
38
|
+
), v = () => {
|
|
38
39
|
n.workspaceStore.revertDocumentChanges(n.documentSlug);
|
|
39
|
-
},
|
|
40
|
+
}, x = () => {
|
|
40
41
|
n.workspaceStore.saveDocument(n.documentSlug);
|
|
41
42
|
};
|
|
42
|
-
return (
|
|
43
|
+
return (E, e) => (u(), c("div", D, [
|
|
43
44
|
a.document ? (u(), c("div", N, [
|
|
44
45
|
t("div", {
|
|
45
46
|
"aria-label": `title: ${m.value}`,
|
|
46
|
-
class: "mx-auto flex h-fit w-full flex-col gap-2 pt-6 pb-3 md:
|
|
47
|
+
class: "mx-auto flex h-fit w-full flex-col gap-2 pt-6 pb-3 md:max-w-180"
|
|
47
48
|
}, [
|
|
48
49
|
a.document?.["x-scalar-is-dirty"] ? (u(), f(S, {
|
|
49
50
|
key: 0,
|
|
@@ -56,7 +57,7 @@ const D = { class: "custom-scroll h-full" }, N = {
|
|
|
56
57
|
size: "xs",
|
|
57
58
|
type: "button",
|
|
58
59
|
variant: "outlined",
|
|
59
|
-
onClick:
|
|
60
|
+
onClick: v
|
|
60
61
|
}, {
|
|
61
62
|
default: l(() => [...e[2] || (e[2] = [
|
|
62
63
|
t("span", null, "Undo", -1)
|
|
@@ -68,7 +69,7 @@ const D = { class: "custom-scroll h-full" }, N = {
|
|
|
68
69
|
size: "xs",
|
|
69
70
|
type: "button",
|
|
70
71
|
variant: "solid",
|
|
71
|
-
onClick:
|
|
72
|
+
onClick: x
|
|
72
73
|
}, {
|
|
73
74
|
default: l(() => [
|
|
74
75
|
o(s(b), {
|
|
@@ -84,7 +85,7 @@ const D = { class: "custom-scroll h-full" }, N = {
|
|
|
84
85
|
e[4] || (e[4] = t("p", null, " You have unsaved changes. Save your work to keep your changes, or undo to revert them. ", -1))
|
|
85
86
|
]),
|
|
86
87
|
_: 1
|
|
87
|
-
})) :
|
|
88
|
+
})) : y("", !0),
|
|
88
89
|
t("div", I, [
|
|
89
90
|
o(C, {
|
|
90
91
|
modelValue: d.value,
|
|
@@ -107,27 +108,27 @@ const D = { class: "custom-scroll h-full" }, N = {
|
|
|
107
108
|
})
|
|
108
109
|
]),
|
|
109
110
|
_: 1
|
|
110
|
-
}, 8, ["modelValue"])
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
111
|
+
}, 8, ["modelValue"]),
|
|
112
|
+
t("div", U, [
|
|
113
|
+
o(V, {
|
|
114
|
+
class: "text-xl font-bold",
|
|
115
|
+
inputId: "documentName",
|
|
116
|
+
modelValue: m.value,
|
|
117
|
+
"onUpdate:modelValue": e[1] || (e[1] = (r) => a.eventBus.emit("document:update:info", { title: r }))
|
|
118
|
+
}, null, 8, ["modelValue"])
|
|
119
|
+
])
|
|
119
120
|
])
|
|
120
121
|
], 8, z),
|
|
121
122
|
o(B, { type: "document" }),
|
|
122
|
-
t("div",
|
|
123
|
+
t("div", T, [
|
|
123
124
|
o(s(_), null, {
|
|
124
125
|
default: l(({ Component: r }) => [
|
|
125
|
-
(u(), f(
|
|
126
|
+
(u(), f(g(r), k(n, { collectionType: "document" }), null, 16))
|
|
126
127
|
]),
|
|
127
128
|
_: 1
|
|
128
129
|
})
|
|
129
130
|
])
|
|
130
|
-
])) : (u(), c("div",
|
|
131
|
+
])) : (u(), c("div", $, [...e[5] || (e[5] = [
|
|
131
132
|
t("div", { class: "flex h-full flex-col items-center justify-center" }, [
|
|
132
133
|
t("h1", { class: "text-2xl font-bold" }, "Document not found"),
|
|
133
134
|
t("p", { class: "text-gray-500" }, " The document you are looking for does not exist. ")
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import type { RouteProps } from '../../../v2/features/app/helpers/routes.js';
|
|
2
|
-
/**
|
|
3
|
-
* Document Collection Page
|
|
4
|
-
*
|
|
5
|
-
* Displays primary document editing and viewing interface, enabling users navigate among
|
|
6
|
-
* Overview, Servers, Authentication, Environment, Cookies, and Settings tabs
|
|
7
|
-
*/
|
|
2
|
+
/** Document collection page — tabs for Overview, Servers, Auth, Environment, Cookies, and Settings. */
|
|
8
3
|
declare const _default: typeof __VLS_export;
|
|
9
4
|
export default _default;
|
|
10
5
|
declare const __VLS_export: import("vue").DefineComponent<RouteProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<RouteProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkspaceCollection.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/collection/WorkspaceCollection.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"WorkspaceCollection.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/collection/WorkspaceCollection.vue"],"names":[],"mappings":"AA0EA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAA;AAMlE,uGAAuG;wBAClF,OAAO,YAAY;AAAxC,wBAAyC;AAGzC,QAAA,MAAM,YAAY,gSAmId,CAAC"}
|