@scalar/api-client 2.17.8 → 2.18.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 +49 -0
- package/dist/style.css +1 -1
- package/dist/v2/blocks/operation-block/helpers/build-request.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/build-request.js +46 -51
- package/dist/v2/blocks/operation-block/helpers/get-environment-variables.d.ts +9 -0
- package/dist/v2/blocks/operation-block/helpers/get-environment-variables.d.ts.map +1 -0
- package/dist/v2/blocks/operation-block/helpers/get-environment-variables.js +7 -0
- package/dist/v2/blocks/operation-block/helpers/get-example.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/get-example.js +12 -10
- package/dist/v2/blocks/operation-block/helpers/get-server-url.d.ts +3 -0
- package/dist/v2/blocks/operation-block/helpers/get-server-url.d.ts.map +1 -0
- package/dist/v2/blocks/operation-block/helpers/get-server-url.js +12 -0
- 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 +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue2.js +87 -65
- package/dist/v2/components/code-input/CodeInput.vue.d.ts +115 -144
- 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/code-input/CodeInput.vue2.js +120 -107
- package/dist/v2/components/data-table/DataTableInput.vue.d.ts +3 -3
- package/dist/v2/components/data-table/DataTableInput.vue.d.ts.map +1 -1
- package/dist/v2/components/data-table/DataTableInput.vue.js +2 -2
- package/dist/v2/components/data-table/DataTableInput.vue2.js +27 -27
- package/dist/v2/components/data-table/DataTableInputSelect.vue.d.ts +3 -2
- package/dist/v2/components/data-table/DataTableInputSelect.vue.d.ts.map +1 -1
- package/dist/v2/components/data-table/DataTableInputSelect.vue.js +42 -39
- package/dist/v2/components/sidebar/Sidebar.vue.d.ts +5 -3
- package/dist/v2/components/sidebar/Sidebar.vue.d.ts.map +1 -1
- package/dist/v2/components/sidebar/SidebarMenu.vue.d.ts +5 -3
- package/dist/v2/components/sidebar/SidebarMenu.vue.d.ts.map +1 -1
- package/dist/v2/components/sidebar/SidebarMenu.vue.js +25 -30
- package/dist/v2/features/app/App.vue.d.ts.map +1 -1
- package/dist/v2/features/app/App.vue.js +89 -141
- package/dist/v2/features/app/app-events.d.ts +22 -0
- package/dist/v2/features/app/app-events.d.ts.map +1 -0
- package/dist/v2/features/app/app-events.js +136 -0
- package/dist/v2/features/app/app-state.d.ts +135 -0
- package/dist/v2/features/app/app-state.d.ts.map +1 -0
- package/dist/v2/features/app/app-state.js +316 -0
- package/dist/v2/features/app/components/AppSidebar.vue.d.ts +6 -3
- 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 +4 -4
- package/dist/v2/features/app/components/DesktopTabs.vue.d.ts +4 -2
- package/dist/v2/features/app/components/DesktopTabs.vue.d.ts.map +1 -1
- package/dist/v2/features/app/components/DesktopTabs.vue.js +25 -22
- package/dist/v2/features/app/components/WebTopNav.vue.d.ts +9 -5
- package/dist/v2/features/app/components/WebTopNav.vue.d.ts.map +1 -1
- package/dist/v2/features/app/helpers/create-api-client-app.d.ts +62 -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 +14 -10
- package/dist/v2/features/app/helpers/routes.d.ts +5 -2
- package/dist/v2/features/app/helpers/routes.d.ts.map +1 -1
- package/dist/v2/features/collection/WorkspaceCollection.vue.js +7 -7
- package/dist/v2/features/collection/components/Form.vue.d.ts +1 -1
- package/dist/v2/features/collection/components/Form.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/Servers.vue.d.ts.map +1 -1
- package/dist/v2/features/modal/Modal.vue.d.ts.map +1 -1
- package/dist/v2/features/modal/Modal.vue.js +2 -2
- package/dist/v2/features/modal/Modal.vue2.js +40 -41
- package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
- package/dist/v2/features/operation/Operation.vue.js +38 -28
- package/dist/v2/features/operation/helpers/combine-params.d.ts +4 -0
- package/dist/v2/features/operation/helpers/combine-params.d.ts.map +1 -0
- package/dist/v2/features/operation/helpers/combine-params.js +13 -0
- package/dist/v2/features/operation/index.d.ts +1 -0
- package/dist/v2/features/operation/index.d.ts.map +1 -1
- package/dist/v2/features/operation/index.js +10 -8
- package/dist/v2/helpers/get-tab-details.d.ts +2 -2
- package/dist/v2/helpers/get-tab-details.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/package.json +16 -16
- package/dist/v2/features/app/hooks/use-app-sidebar.d.ts +0 -40
- package/dist/v2/features/app/hooks/use-app-sidebar.d.ts.map +0 -1
- package/dist/v2/features/app/hooks/use-app-sidebar.js +0 -134
- package/dist/v2/features/app/hooks/use-sync-path.d.ts +0 -11
- package/dist/v2/features/app/hooks/use-sync-path.d.ts.map +0 -1
- package/dist/v2/features/app/hooks/use-sync-path.js +0 -52
- package/dist/v2/features/app/hooks/use-tabs.d.ts +0 -31
- package/dist/v2/features/app/hooks/use-tabs.d.ts.map +0 -1
- package/dist/v2/features/app/hooks/use-tabs.js +0 -44
- package/dist/v2/features/app/hooks/use-workspace-client-app-events.d.ts +0 -18
- package/dist/v2/features/app/hooks/use-workspace-client-app-events.d.ts.map +0 -1
- package/dist/v2/features/app/hooks/use-workspace-client-app-events.js +0 -156
- package/dist/v2/features/app/hooks/use-workspace-selector.d.ts +0 -28
- package/dist/v2/features/app/hooks/use-workspace-selector.d.ts.map +0 -1
- package/dist/v2/features/app/hooks/use-workspace-selector.js +0 -81
|
@@ -1,57 +1,60 @@
|
|
|
1
|
-
import { defineComponent as T, computed as
|
|
2
|
-
import { ScalarComboboxMultiselect as F, ScalarButton as
|
|
1
|
+
import { defineComponent as T, computed as p, ref as w, watch as b, nextTick as E, createElementBlock as m, openBlock as o, createBlock as f, withDirectives as K, unref as a, withCtx as n, createVNode as s, createElementVNode as i, toDisplayString as V, withKeys as M, vModelText as R, createCommentVNode as C, Fragment as _, renderList as U, normalizeClass as $ } from "vue";
|
|
2
|
+
import { ScalarComboboxMultiselect as F, ScalarButton as B, ScalarIcon as v, ScalarDropdown as L, ScalarDropdownItem as D, ScalarDropdownDivider as W } from "@scalar/components";
|
|
3
3
|
const q = { class: "group-[.alert]:outline-orange group-[.error]:outline-red w-full pr-10 -outline-offset-1 has-[:focus-visible]:rounded-[4px] has-[:focus-visible]:outline" }, G = { class: "text-c-1 whitespace-nowrap" }, H = { class: "text-c-1 overflow-hidden text-ellipsis" }, J = { class: "overflow-hidden text-ellipsis" }, P = { class: "flex h-4 w-4 items-center justify-center" }, Z = /* @__PURE__ */ T({
|
|
4
4
|
__name: "DataTableInputSelect",
|
|
5
5
|
props: {
|
|
6
|
-
modelValue: { type: [String, Number, Boolean] },
|
|
6
|
+
modelValue: { type: [String, Number, Boolean, Array, Object] },
|
|
7
7
|
value: {},
|
|
8
|
-
default: { type: [String, Number, Boolean] },
|
|
8
|
+
default: { type: [String, Number, Boolean, Array, Object] },
|
|
9
9
|
canAddCustomValue: { type: Boolean, default: !0 },
|
|
10
10
|
type: {}
|
|
11
11
|
},
|
|
12
12
|
emits: ["update:modelValue"],
|
|
13
|
-
setup(
|
|
14
|
-
const u =
|
|
15
|
-
|
|
13
|
+
setup(j, { emit: z }) {
|
|
14
|
+
const u = j, c = z, h = p(() => u.value ?? []), d = w(!1), r = w(""), x = w(null);
|
|
15
|
+
b(r, (e) => {
|
|
16
16
|
c("update:modelValue", e);
|
|
17
17
|
});
|
|
18
18
|
const g = (e) => {
|
|
19
19
|
c("update:modelValue", e), d.value = !1;
|
|
20
|
-
}, j = () => {
|
|
21
|
-
r.value.trim() && g(r.value);
|
|
22
20
|
}, A = () => {
|
|
21
|
+
r.value.trim() && g(r.value);
|
|
22
|
+
}, N = () => {
|
|
23
23
|
r.value.trim() || c("update:modelValue", ""), d.value = !1;
|
|
24
|
-
},
|
|
25
|
-
|
|
24
|
+
}, O = (e) => u.modelValue.toString() === e;
|
|
25
|
+
b(d, (e) => {
|
|
26
26
|
e && E(() => {
|
|
27
27
|
x.value?.focus();
|
|
28
28
|
});
|
|
29
29
|
});
|
|
30
|
-
const S =
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
),
|
|
30
|
+
const S = p(() => u.modelValue !== void 0 ? u.modelValue : u.default), k = p(
|
|
31
|
+
() => h.value.map((e) => {
|
|
32
|
+
const t = e.toString();
|
|
33
|
+
return { id: t, label: t, value: t };
|
|
34
|
+
})
|
|
35
|
+
), y = p(() => {
|
|
36
|
+
const e = new Set(u.modelValue.toString().split(","));
|
|
37
|
+
return k.value.filter((t) => e.has(t.id));
|
|
38
|
+
}), I = (e) => {
|
|
36
39
|
const t = e.map((l) => l.value);
|
|
37
|
-
c("update:modelValue", t.join(",
|
|
40
|
+
c("update:modelValue", t.join(","));
|
|
38
41
|
};
|
|
39
|
-
return (e, t) => (o(),
|
|
40
|
-
e.type === "array" ? (o(),
|
|
42
|
+
return (e, t) => (o(), m("div", q, [
|
|
43
|
+
e.type === "array" ? (o(), f(a(F), {
|
|
41
44
|
key: 0,
|
|
42
|
-
modelValue:
|
|
43
|
-
options:
|
|
44
|
-
"onUpdate:modelValue":
|
|
45
|
+
modelValue: y.value,
|
|
46
|
+
options: k.value,
|
|
47
|
+
"onUpdate:modelValue": I
|
|
45
48
|
}, {
|
|
46
49
|
default: n(() => [
|
|
47
|
-
s(a(
|
|
50
|
+
s(a(B), {
|
|
48
51
|
class: "custom-scroll h-full justify-start gap-1.5 px-2 py-1.5 pr-6 font-normal outline-none",
|
|
49
52
|
fullWidth: "",
|
|
50
53
|
variant: "ghost"
|
|
51
54
|
}, {
|
|
52
55
|
default: n(() => [
|
|
53
|
-
i("span", G, V(
|
|
54
|
-
s(a(
|
|
56
|
+
i("span", G, V(y.value.length > 0 ? y.value.map((l) => l.label).join(", ") : "Select a value"), 1),
|
|
57
|
+
s(a(v), {
|
|
55
58
|
class: "min-w-4",
|
|
56
59
|
icon: "ChevronDown",
|
|
57
60
|
size: "md"
|
|
@@ -61,7 +64,7 @@ const q = { class: "group-[.alert]:outline-orange group-[.error]:outline-red w-f
|
|
|
61
64
|
})
|
|
62
65
|
]),
|
|
63
66
|
_: 1
|
|
64
|
-
}, 8, ["modelValue", "options"])) : d.value ? K((o(),
|
|
67
|
+
}, 8, ["modelValue", "options"])) : d.value ? K((o(), m("input", {
|
|
65
68
|
key: 1,
|
|
66
69
|
ref_key: "inputRef",
|
|
67
70
|
ref: x,
|
|
@@ -69,17 +72,17 @@ const q = { class: "group-[.alert]:outline-orange group-[.error]:outline-red w-f
|
|
|
69
72
|
class: "text-c-1 w-full min-w-0 border-none px-2 py-1.5 outline-none",
|
|
70
73
|
placeholder: "Value",
|
|
71
74
|
type: "text",
|
|
72
|
-
onBlur:
|
|
73
|
-
onKeyup: M(
|
|
75
|
+
onBlur: N,
|
|
76
|
+
onKeyup: M(A, ["enter"])
|
|
74
77
|
}, null, 544)), [
|
|
75
78
|
[R, r.value]
|
|
76
|
-
]) : (o(),
|
|
79
|
+
]) : (o(), f(a(L), {
|
|
77
80
|
key: 2,
|
|
78
81
|
resize: "",
|
|
79
82
|
value: S.value
|
|
80
83
|
}, {
|
|
81
84
|
items: n(() => [
|
|
82
|
-
(o(!0),
|
|
85
|
+
(o(!0), m(_, null, U(h.value, (l) => (o(), f(a(D), {
|
|
83
86
|
key: l,
|
|
84
87
|
class: "group/item flex items-center gap-1.5 overflow-hidden text-ellipsis whitespace-nowrap",
|
|
85
88
|
value: l,
|
|
@@ -89,10 +92,10 @@ const q = { class: "group-[.alert]:outline-orange group-[.error]:outline-red w-f
|
|
|
89
92
|
i("div", {
|
|
90
93
|
class: $([
|
|
91
94
|
"flex h-4 w-4 items-center justify-center rounded-full p-[3px]",
|
|
92
|
-
|
|
95
|
+
O(l) ? "bg-c-accent text-b-1" : "shadow-border text-transparent"
|
|
93
96
|
])
|
|
94
97
|
}, [
|
|
95
|
-
s(a(
|
|
98
|
+
s(a(v), {
|
|
96
99
|
class: "size-2.5",
|
|
97
100
|
icon: "Checkmark",
|
|
98
101
|
thickness: "3"
|
|
@@ -102,15 +105,15 @@ const q = { class: "group-[.alert]:outline-orange group-[.error]:outline-red w-f
|
|
|
102
105
|
]),
|
|
103
106
|
_: 2
|
|
104
107
|
}, 1032, ["value", "onClick"]))), 128)),
|
|
105
|
-
e.canAddCustomValue ? (o(),
|
|
106
|
-
|
|
107
|
-
s(a(
|
|
108
|
+
e.canAddCustomValue ? (o(), m(_, { key: 0 }, [
|
|
109
|
+
h.value.length ? (o(), f(a(W), { key: 0 })) : C("", !0),
|
|
110
|
+
s(a(D), {
|
|
108
111
|
class: "flex items-center gap-1.5",
|
|
109
112
|
onClick: t[1] || (t[1] = (l) => d.value = !0)
|
|
110
113
|
}, {
|
|
111
114
|
default: n(() => [
|
|
112
115
|
i("div", P, [
|
|
113
|
-
s(a(
|
|
116
|
+
s(a(v), {
|
|
114
117
|
icon: "Add",
|
|
115
118
|
size: "sm"
|
|
116
119
|
})
|
|
@@ -122,13 +125,13 @@ const q = { class: "group-[.alert]:outline-orange group-[.error]:outline-red w-f
|
|
|
122
125
|
], 64)) : C("", !0)
|
|
123
126
|
]),
|
|
124
127
|
default: n(() => [
|
|
125
|
-
s(a(
|
|
128
|
+
s(a(B), {
|
|
126
129
|
class: "size-full justify-start gap-1.5 overflow-auto px-2 py-1.5 font-normal whitespace-nowrap outline-none",
|
|
127
130
|
variant: "ghost"
|
|
128
131
|
}, {
|
|
129
132
|
default: n(() => [
|
|
130
133
|
i("span", H, V(S.value ?? "Select a value"), 1),
|
|
131
|
-
s(a(
|
|
134
|
+
s(a(v), {
|
|
132
135
|
icon: "ChevronDown",
|
|
133
136
|
size: "md"
|
|
134
137
|
})
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { type ScalarListboxOption } from '@scalar/components';
|
|
1
2
|
import { type DraggingItem, type HoveredItem, type SidebarState } from '@scalar/sidebar';
|
|
2
3
|
import type { WorkspaceEventBus } from '@scalar/workspace-store/events';
|
|
3
4
|
import type { WorkspaceDocument } from '@scalar/workspace-store/schemas';
|
|
4
5
|
import type { TraversedEntry } from '@scalar/workspace-store/schemas/navigation';
|
|
5
|
-
import type { Workspace } from '../../../v2/features/app/hooks/use-workspace-selector.js';
|
|
6
6
|
import type { ClientLayout } from '../../../v2/types/layout';
|
|
7
7
|
type __VLS_Props = {
|
|
8
8
|
/** All documents to display sidebar items for */
|
|
@@ -10,9 +10,11 @@ type __VLS_Props = {
|
|
|
10
10
|
/** Layout for the client */
|
|
11
11
|
layout: ClientLayout;
|
|
12
12
|
/** The currently active workspace */
|
|
13
|
-
activeWorkspace:
|
|
13
|
+
activeWorkspace: {
|
|
14
|
+
id: string;
|
|
15
|
+
};
|
|
14
16
|
/** The list of all available workspaces */
|
|
15
|
-
workspaces:
|
|
17
|
+
workspaces: ScalarListboxOption[];
|
|
16
18
|
/** The workspace event bus for handling workspace-level events */
|
|
17
19
|
eventBus: WorkspaceEventBus;
|
|
18
20
|
/** The documents belonging to the workspace */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sidebar.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/sidebar/Sidebar.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Sidebar.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/sidebar/Sidebar.vue"],"names":[],"mappings":"AAsJA,OAAO,EAAoB,KAAK,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAE/E,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,YAAY,EAClB,MAAM,iBAAiB,CAAA;AACxB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AACxE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAA;AAKhF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAIrD,KAAK,WAAW,GAAG;IACjB,iDAAiD;IACjD,YAAY,EAAE,YAAY,CAAC,cAAc,CAAC,CAAA;IAC1C,4BAA4B;IAC5B,MAAM,EAAE,YAAY,CAAA;IACpB,qCAAqC;IACrC,eAAe,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAA;IAC/B,2CAA2C;IAC3C,UAAU,EAAE,mBAAmB,EAAE,CAAA;IACjC,kEAAkE;IAClE,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,+CAA+C;IAC/C,SAAS,EAAE,iBAAiB,EAAE,CAAA;IAC9B;;;;OAIG;IACH,WAAW,CAAC,EACR,OAAO,GACP,CAAC,CAAC,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,KAAK,OAAO,CAAC,CAAA;CACxE,CAAC;AAeF,KAAK,WAAW,GAAG;IACjB,uCAAuC;IACvC,eAAe,CAAC,IAAI,OAAO,CAAA;IAC3B,sDAAsD;IACtD,SAAS,CAAC,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE,cAAc,CAAA;KAAE,GAAG,OAAO,CAAA;IACpD,mDAAmD;IACnD,MAAM,CAAC,IAAI,OAAO,CAAA;IAClB,yDAAyD;IACzD,KAAK,CAAC,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE,cAAc,CAAA;KAAE,GAAG,OAAO,CAAA;CACjD,CAAC;AAiBF,KAAK,iBAAiB,GAAG,WAAW,GAAG;IACvC,wCAAwC;IACxC,cAAc,EAAE,MAAM,CAAC;CACtB,CAAC;AAqNF,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"}
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ScalarListboxOption } from '@scalar/components';
|
|
2
2
|
type __VLS_Props = {
|
|
3
3
|
/**
|
|
4
4
|
* The currently active workspace.
|
|
5
5
|
* This represents the workspace that the user is currently working in.
|
|
6
6
|
*/
|
|
7
|
-
activeWorkspace:
|
|
7
|
+
activeWorkspace: {
|
|
8
|
+
id: string;
|
|
9
|
+
};
|
|
8
10
|
/**
|
|
9
11
|
* The list of all available workspaces.
|
|
10
12
|
* Used to render options for workspace switching and selection.
|
|
11
13
|
*/
|
|
12
|
-
workspaces:
|
|
14
|
+
workspaces: ScalarListboxOption[];
|
|
13
15
|
};
|
|
14
16
|
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
15
17
|
"create:workspace": () => any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidebarMenu.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/sidebar/SidebarMenu.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SidebarMenu.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/sidebar/SidebarMenu.vue"],"names":[],"mappings":"AA2EA,OAAO,EAOL,KAAK,mBAAmB,EACzB,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,mBAAmB,EAAE,CAAA;CAClC,CAAC;;;;;;;;AAwIF,wBAOG"}
|
|
@@ -1,42 +1,37 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarMenu as
|
|
3
|
-
import { ScalarIconGear as
|
|
4
|
-
import { RouterLink as
|
|
5
|
-
const L = /* @__PURE__ */
|
|
1
|
+
import { defineComponent as c, createBlock as u, openBlock as k, unref as o, withCtx as r, createVNode as t, createTextVNode as i } from "vue";
|
|
2
|
+
import { ScalarMenu as m, ScalarMenuSection as d, ScalarMenuWorkspacePicker as S, ScalarMenuLink as f, ScalarMenuResources as w, ScalarMenuSupport as M } from "@scalar/components";
|
|
3
|
+
import { ScalarIconGear as C } from "@scalar/icons";
|
|
4
|
+
import { RouterLink as V } from "vue-router";
|
|
5
|
+
const L = /* @__PURE__ */ c({
|
|
6
6
|
__name: "SidebarMenu",
|
|
7
7
|
props: {
|
|
8
8
|
activeWorkspace: {},
|
|
9
9
|
workspaces: {}
|
|
10
10
|
},
|
|
11
11
|
emits: ["create:workspace", "select:workspace"],
|
|
12
|
-
setup(
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
return (a, e) => (S(), d(o(f), null, {
|
|
20
|
-
products: t(() => [...e[2] || (e[2] = [])]),
|
|
21
|
-
sections: t(({ close: u }) => [
|
|
22
|
-
r(o(w), null, {
|
|
23
|
-
title: t(() => [...e[3] || (e[3] = [
|
|
12
|
+
setup(W, { emit: p }) {
|
|
13
|
+
const a = p;
|
|
14
|
+
return (n, e) => (k(), u(o(m), null, {
|
|
15
|
+
products: r(() => [...e[2] || (e[2] = [])]),
|
|
16
|
+
sections: r(({ close: l }) => [
|
|
17
|
+
t(o(d), null, {
|
|
18
|
+
title: r(() => [...e[3] || (e[3] = [
|
|
24
19
|
i("Team", -1)
|
|
25
20
|
])]),
|
|
26
|
-
default:
|
|
27
|
-
|
|
28
|
-
modelValue:
|
|
29
|
-
workspaceOptions:
|
|
30
|
-
onCreateWorkspace: e[0] || (e[0] = (s) =>
|
|
31
|
-
"onUpdate:modelValue": e[1] || (e[1] = (s) =>
|
|
21
|
+
default: r(() => [
|
|
22
|
+
t(o(S), {
|
|
23
|
+
modelValue: n.activeWorkspace.id,
|
|
24
|
+
workspaceOptions: n.workspaces,
|
|
25
|
+
onCreateWorkspace: e[0] || (e[0] = (s) => a("create:workspace")),
|
|
26
|
+
"onUpdate:modelValue": e[1] || (e[1] = (s) => a("select:workspace", s))
|
|
32
27
|
}, null, 8, ["modelValue", "workspaceOptions"]),
|
|
33
|
-
|
|
34
|
-
is: o(
|
|
35
|
-
icon: o(
|
|
28
|
+
t(o(f), {
|
|
29
|
+
is: o(V),
|
|
30
|
+
icon: o(C),
|
|
36
31
|
to: "/settings",
|
|
37
|
-
onClick:
|
|
32
|
+
onClick: l
|
|
38
33
|
}, {
|
|
39
|
-
default:
|
|
34
|
+
default: r(() => [...e[4] || (e[4] = [
|
|
40
35
|
i(" Settings ", -1)
|
|
41
36
|
])]),
|
|
42
37
|
_: 1
|
|
@@ -44,8 +39,8 @@ const L = /* @__PURE__ */ m({
|
|
|
44
39
|
]),
|
|
45
40
|
_: 2
|
|
46
41
|
}, 1024),
|
|
47
|
-
|
|
48
|
-
|
|
42
|
+
t(o(w)),
|
|
43
|
+
t(o(M))
|
|
49
44
|
]),
|
|
50
45
|
_: 1
|
|
51
46
|
}));
|
|
@@ -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":"AA0MA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAGxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAQrD;;;;GAIG;;YAGO,OAAO,CAAC,YAAY,EAAE,OAAO,CAAC;cAC5B,YAAY,EAAE;;YADhB,OAAO,CAAC,YAAY,EAAE,OAAO,CAAC;cAC5B,YAAY,EAAE;;AAH1B,wBAmTC"}
|
|
@@ -1,163 +1,111 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useModal as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
import ve from "./components/AppSidebar.vue.js";
|
|
20
|
-
import ke from "./components/DesktopTabs.vue.js";
|
|
21
|
-
import Se from "./components/WebTopNav.vue.js";
|
|
22
|
-
import { useTabs as fe } from "./hooks/use-tabs.js";
|
|
23
|
-
import { useWorkspaceClientAppEvents as we } from "./hooks/use-workspace-client-app-events.js";
|
|
24
|
-
const he = ["innerHTML"], ye = { class: "flex min-h-0 flex-1" }, We = { class: "bg-b-1 flex-1" }, be = {}, je = /* @__PURE__ */ $({
|
|
25
|
-
...be,
|
|
1
|
+
import { defineComponent as k, computed as u, createElementBlock as w, createBlock as p, unref as t, openBlock as n, Fragment as S, createElementVNode as c, createVNode as o, withCtx as f, normalizeProps as b, guardReactiveProps as h } from "vue";
|
|
2
|
+
import { useModal as W, ScalarTeleportRoot as T } from "@scalar/components";
|
|
3
|
+
import { getThemeStyles as y } from "@scalar/themes";
|
|
4
|
+
import { ScalarToasts as B } from "@scalar/use-toasts";
|
|
5
|
+
import { extensions as _ } from "@scalar/workspace-store/schemas/extensions";
|
|
6
|
+
import { RouterView as g } from "vue-router";
|
|
7
|
+
import C from "./components/CreateWorkspaceModal.vue.js";
|
|
8
|
+
import E from "./components/SplashScreen.vue.js";
|
|
9
|
+
import { useDocumentWatcher as O } from "./hooks/use-document-watcher.js";
|
|
10
|
+
import x from "../command-palette/components/TheCommandPalette.vue.js";
|
|
11
|
+
import { useColorMode as I } from "../../hooks/use-color-mode.js";
|
|
12
|
+
import { useGlobalHotKeys as U } from "../../hooks/use-global-hot-keys.js";
|
|
13
|
+
import { useAppState as M } from "./app-state.js";
|
|
14
|
+
import A from "./components/AppSidebar.vue.js";
|
|
15
|
+
import D from "./components/DesktopTabs.vue.js";
|
|
16
|
+
import N from "./components/WebTopNav.vue.js";
|
|
17
|
+
const L = ["innerHTML"], $ = { class: "flex min-h-0 flex-1" }, H = { class: "bg-b-1 flex-1" }, P = {}, se = /* @__PURE__ */ k({
|
|
18
|
+
...P,
|
|
26
19
|
__name: "App",
|
|
27
20
|
props: {
|
|
28
21
|
layout: {},
|
|
29
22
|
plugins: { default: () => [] }
|
|
30
23
|
},
|
|
31
|
-
setup(
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
const a = B.params[t];
|
|
37
|
-
return typeof a == "string" ? a : void 0;
|
|
38
|
-
}, S = r(() => c("workspaceSlug")), n = r(() => c("documentSlug")), p = r(() => !n.value || o.value === null ? null : o.value.workspace.documents[n.value] ?? null), f = r(() => {
|
|
39
|
-
const t = c("pathEncoded");
|
|
40
|
-
return t ? decodeURIComponent(t) : void 0;
|
|
41
|
-
}), w = r(() => {
|
|
42
|
-
const t = c("method");
|
|
43
|
-
return t && Q(t) ? t : void 0;
|
|
44
|
-
}), b = r(() => c("exampleName")), g = ce(), { store: o, workspaces: T, activeWorkspace: i, setWorkspaceId: O, createWorkspace: U } = g;
|
|
45
|
-
me({ workspaceStore: o });
|
|
46
|
-
const m = se({
|
|
47
|
-
workspaceStore: o,
|
|
48
|
-
documentSlug: n,
|
|
49
|
-
path: f,
|
|
50
|
-
method: w,
|
|
51
|
-
exampleName: b
|
|
52
|
-
}), E = fe({
|
|
53
|
-
workspaceStore: o,
|
|
54
|
-
getEntryByLocation: m.getEntryByLocation,
|
|
55
|
-
workspaceSlug: S,
|
|
56
|
-
documentSlug: n,
|
|
57
|
-
path: f,
|
|
58
|
-
method: w
|
|
59
|
-
}), { isLoading: x } = le({
|
|
60
|
-
workspaceSelectorState: g,
|
|
61
|
-
tabsState: E,
|
|
62
|
-
eventBus: s
|
|
63
|
-
}), _ = pe();
|
|
64
|
-
we({
|
|
65
|
-
eventBus: s,
|
|
66
|
-
document: p,
|
|
67
|
-
workspaceStore: o,
|
|
68
|
-
isSidebarOpen: k,
|
|
69
|
-
commandPaletteState: _,
|
|
70
|
-
sidebarState: m
|
|
71
|
-
}), de(s, v.layout), ne({
|
|
72
|
-
documentName: n,
|
|
73
|
-
store: o,
|
|
24
|
+
setup(i) {
|
|
25
|
+
const e = M();
|
|
26
|
+
typeof window < "u" && (window.dataDumpWorkspace = () => e.store.value, window.dumpAppState = () => e), I({ workspaceStore: e.store }), U(e.eventBus, i.layout), O({
|
|
27
|
+
documentName: () => e.store.value?.workspace[_.workspace.activeDocument],
|
|
28
|
+
store: e.store,
|
|
74
29
|
initialTimeout: 5e3
|
|
75
30
|
});
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
), M = r(() => {
|
|
79
|
-
if (o.value === null)
|
|
31
|
+
const m = u(() => {
|
|
32
|
+
if (e.store.value === null)
|
|
80
33
|
return "";
|
|
81
|
-
const
|
|
82
|
-
return
|
|
83
|
-
}),
|
|
84
|
-
() => o.value?.workspace?.["x-scalar-sidebar-width"] ?? P
|
|
85
|
-
), L = r(
|
|
86
|
-
() => !!(S.value && !n.value)
|
|
87
|
-
), N = (t) => o.value?.update("x-scalar-sidebar-width", t), R = () => A.push({
|
|
34
|
+
const s = e.store.value.workspace["x-scalar-theme"];
|
|
35
|
+
return s ? `<style>${y(s)}</style>` : "";
|
|
36
|
+
}), d = () => e.router.value?.push({
|
|
88
37
|
name: "workspace.environment",
|
|
89
|
-
params: {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
},
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
l(e(Y)),
|
|
113
|
-
t.layout === "desktop" ? (d(), y(ke, {
|
|
38
|
+
params: {
|
|
39
|
+
workspaceSlug: e.activeEntities.workspaceSlug.value
|
|
40
|
+
}
|
|
41
|
+
}), l = W(), v = u(() => ({
|
|
42
|
+
documentSlug: e.activeEntities.documentSlug.value ?? "",
|
|
43
|
+
document: e.store.value?.workspace.activeDocument ?? null,
|
|
44
|
+
environment: e.environment.value,
|
|
45
|
+
eventBus: e.eventBus,
|
|
46
|
+
exampleName: e.activeEntities.exampleName.value,
|
|
47
|
+
layout: i.layout,
|
|
48
|
+
method: e.activeEntities.method.value,
|
|
49
|
+
path: e.activeEntities.path.value,
|
|
50
|
+
workspaceStore: e.store.value,
|
|
51
|
+
activeWorkspace: e.workspace.activeWorkspace.value,
|
|
52
|
+
plugins: i.plugins,
|
|
53
|
+
securitySchemes: e.document.value?.components?.securitySchemes ?? {}
|
|
54
|
+
}));
|
|
55
|
+
return (s, a) => t(e).store.value !== null && t(e).workspace.activeWorkspace.value !== null && !t(e).loading.value ? (n(), w(S, { key: 0 }, [
|
|
56
|
+
c("div", { innerHTML: m.value }, null, 8, L),
|
|
57
|
+
o(t(T), null, {
|
|
58
|
+
default: f(() => [
|
|
59
|
+
o(t(B)),
|
|
60
|
+
s.layout === "desktop" ? (n(), p(D, {
|
|
114
61
|
key: 0,
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
62
|
+
activeTabIndex: t(e).tabs.activeTabIndex.value,
|
|
63
|
+
eventBus: t(e).eventBus,
|
|
64
|
+
tabs: t(e).tabs.state.value
|
|
65
|
+
}, null, 8, ["activeTabIndex", "eventBus", "tabs"])) : (n(), p(N, {
|
|
118
66
|
key: 1,
|
|
119
|
-
activeWorkspace: e
|
|
120
|
-
workspaces: e
|
|
121
|
-
"onCreate:workspace": a[0] || (a[0] = (
|
|
122
|
-
"onSelect:workspace":
|
|
123
|
-
}, null, 8, ["activeWorkspace", "workspaces"])),
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
isSidebarOpen:
|
|
127
|
-
"onUpdate:isSidebarOpen": a[1] || (a[1] = (
|
|
128
|
-
activeWorkspace: e
|
|
129
|
-
eventBus: e
|
|
130
|
-
isWorkspaceOpen:
|
|
131
|
-
layout:
|
|
132
|
-
sidebarState: e
|
|
133
|
-
sidebarWidth:
|
|
134
|
-
store: e
|
|
135
|
-
workspaces: e
|
|
136
|
-
"onClick:workspace":
|
|
137
|
-
"onCreate:workspace": a[2] || (a[2] = (
|
|
138
|
-
"onSelect:workspace":
|
|
139
|
-
onSelectItem: e
|
|
140
|
-
"onUpdate:sidebarWidth":
|
|
141
|
-
}, null, 8, ["isSidebarOpen", "activeWorkspace", "eventBus", "isWorkspaceOpen", "layout", "sidebarState", "sidebarWidth", "store", "workspaces", "onSelectItem"]),
|
|
142
|
-
|
|
143
|
-
state:
|
|
144
|
-
"onCreate:workspace": a[3] || (a[3] = (
|
|
67
|
+
activeWorkspace: t(e).workspace.activeWorkspace.value,
|
|
68
|
+
workspaces: t(e).workspace.workspaceList.value,
|
|
69
|
+
"onCreate:workspace": a[0] || (a[0] = (r) => t(l).show()),
|
|
70
|
+
"onSelect:workspace": t(e).workspace.setId
|
|
71
|
+
}, null, 8, ["activeWorkspace", "workspaces", "onSelect:workspace"])),
|
|
72
|
+
c("main", $, [
|
|
73
|
+
o(A, {
|
|
74
|
+
isSidebarOpen: t(e).sidebar.isOpen.value,
|
|
75
|
+
"onUpdate:isSidebarOpen": a[1] || (a[1] = (r) => t(e).sidebar.isOpen.value = r),
|
|
76
|
+
activeWorkspace: t(e).workspace.activeWorkspace.value,
|
|
77
|
+
eventBus: t(e).eventBus,
|
|
78
|
+
isWorkspaceOpen: t(e).workspace.isOpen.value,
|
|
79
|
+
layout: s.layout,
|
|
80
|
+
sidebarState: t(e).sidebar.state,
|
|
81
|
+
sidebarWidth: t(e).sidebar.width.value,
|
|
82
|
+
store: t(e).store.value,
|
|
83
|
+
workspaces: t(e).workspace.workspaceList.value,
|
|
84
|
+
"onClick:workspace": d,
|
|
85
|
+
"onCreate:workspace": a[2] || (a[2] = (r) => t(l).show()),
|
|
86
|
+
"onSelect:workspace": t(e).workspace.setId,
|
|
87
|
+
onSelectItem: t(e).sidebar.handleSelectItem,
|
|
88
|
+
"onUpdate:sidebarWidth": t(e).sidebar.handleSidebarWidthUpdate
|
|
89
|
+
}, null, 8, ["isSidebarOpen", "activeWorkspace", "eventBus", "isWorkspaceOpen", "layout", "sidebarState", "sidebarWidth", "store", "workspaces", "onSelect:workspace", "onSelectItem", "onUpdate:sidebarWidth"]),
|
|
90
|
+
o(C, {
|
|
91
|
+
state: t(l),
|
|
92
|
+
"onCreate:workspace": a[3] || (a[3] = (r) => t(e).workspace.create(r))
|
|
145
93
|
}, null, 8, ["state"]),
|
|
146
|
-
|
|
147
|
-
eventBus: e
|
|
148
|
-
paletteState: e
|
|
149
|
-
workspaceStore: e
|
|
94
|
+
o(x, {
|
|
95
|
+
eventBus: t(e).eventBus,
|
|
96
|
+
paletteState: t(e).commandPalette,
|
|
97
|
+
workspaceStore: t(e).store.value
|
|
150
98
|
}, null, 8, ["eventBus", "paletteState", "workspaceStore"]),
|
|
151
|
-
|
|
152
|
-
|
|
99
|
+
c("div", H, [
|
|
100
|
+
o(t(g), b(h(v.value)), null, 16)
|
|
153
101
|
])
|
|
154
102
|
])
|
|
155
103
|
]),
|
|
156
104
|
_: 1
|
|
157
105
|
})
|
|
158
|
-
], 64)) : (
|
|
106
|
+
], 64)) : (n(), p(E, { key: 1 }));
|
|
159
107
|
}
|
|
160
108
|
});
|
|
161
109
|
export {
|
|
162
|
-
|
|
110
|
+
se as default
|
|
163
111
|
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { WorkspaceStore } from '@scalar/workspace-store/client';
|
|
2
|
+
import type { WorkspaceEventBus } from '@scalar/workspace-store/events';
|
|
3
|
+
import { type OperationExampleMeta } from '@scalar/workspace-store/mutators';
|
|
4
|
+
import type { WorkspaceDocument } from '@scalar/workspace-store/schemas/workspace';
|
|
5
|
+
import { type ComputedRef, type ShallowRef } from 'vue';
|
|
6
|
+
import type { Router } from 'vue-router';
|
|
7
|
+
import type { OpenCommand } from '../command-palette/hooks/use-command-palette-state.js';
|
|
8
|
+
export declare function initializeAppEventHandlers({ eventBus, getStore, document, router, rebuildSidebar, navigateToCurrentTab, onSelectSidebarItem, onAfterExampleCreation, onOpenCommandPalette, onCopyTabUrl, onToggleSidebar, }: {
|
|
9
|
+
eventBus: WorkspaceEventBus;
|
|
10
|
+
getStore: () => WorkspaceStore | null;
|
|
11
|
+
/** Current active document */
|
|
12
|
+
document: ComputedRef<WorkspaceDocument | null>;
|
|
13
|
+
router: ShallowRef<Router | null>;
|
|
14
|
+
navigateToCurrentTab: () => Promise<void>;
|
|
15
|
+
rebuildSidebar: (documentName?: string) => void;
|
|
16
|
+
onSelectSidebarItem: (id: string) => void;
|
|
17
|
+
onAfterExampleCreation: (o: OperationExampleMeta) => void;
|
|
18
|
+
onOpenCommandPalette: OpenCommand;
|
|
19
|
+
onCopyTabUrl: (tabIndex: number) => void;
|
|
20
|
+
onToggleSidebar: () => void;
|
|
21
|
+
}): void;
|
|
22
|
+
//# sourceMappingURL=app-events.d.ts.map
|
|
@@ -0,0 +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,EAAwC,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAE7G,OAAO,EACL,KAAK,oBAAoB,EAgD1B,MAAM,kCAAkC,CAAA;AACzC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAA;AAClF,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,UAAU,EAAY,MAAM,KAAK,CAAA;AACjE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAExC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oDAAoD,CAAA;AAErF,wBAAgB,0BAA0B,CAAC,EACzC,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,cAAc,EACd,oBAAoB,EACpB,mBAAmB,EACnB,sBAAsB,EACtB,oBAAoB,EACpB,YAAY,EACZ,eAAe,GAChB,EAAE;IACD,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,QAAQ,EAAE,MAAM,cAAc,GAAG,IAAI,CAAA;IACrC,8BAA8B;IAC9B,QAAQ,EAAE,WAAW,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAA;IAC/C,MAAM,EAAE,UAAU,CAAC,MAAM,GAAG,IAAI,CAAC,CAAA;IACjC,oBAAoB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;IACzC,cAAc,EAAE,CAAC,YAAY,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;IAC/C,mBAAmB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IACzC,sBAAsB,EAAE,CAAC,CAAC,EAAE,oBAAoB,KAAK,IAAI,CAAA;IACzD,oBAAoB,EAAE,WAAW,CAAA;IACjC,YAAY,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAA;IACxC,eAAe,EAAE,MAAM,IAAI,CAAA;CAC5B,QAySA"}
|