@scalar/api-client 2.22.0 → 2.22.2
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 +56 -0
- package/dist/hooks/useClientConfig.d.ts +6 -3
- package/dist/hooks/useClientConfig.d.ts.map +1 -1
- package/dist/style.css +1 -1
- 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 +2 -2
- package/dist/v2/blocks/request-block/helpers/get-default-headers.js +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js +2 -2
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue2.js +23 -29
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.js +45 -43
- package/dist/v2/components/code-input/CodeInput.vue.d.ts +0 -6
- package/dist/v2/components/code-input/CodeInput.vue.d.ts.map +1 -1
- package/dist/v2/components/code-input/CodeInput.vue.js +1 -1
- package/dist/v2/components/code-input/CodeInput.vue2.js +50 -63
- package/dist/v2/components/sidebar/Sidebar.vue.d.ts +0 -3
- package/dist/v2/components/sidebar/Sidebar.vue.d.ts.map +1 -1
- package/dist/v2/components/sidebar/Sidebar.vue.js +55 -53
- package/dist/v2/features/app/App.vue.d.ts +3 -1
- package/dist/v2/features/app/App.vue.d.ts.map +1 -1
- package/dist/v2/features/app/App.vue.js +46 -43
- package/dist/v2/features/app/app-state.d.ts.map +1 -1
- package/dist/v2/features/app/app-state.js +33 -28
- package/dist/v2/features/app/components/AppSidebar.vue.d.ts.map +1 -1
- package/dist/v2/features/app/components/AppSidebar.vue.js +1 -1
- package/dist/v2/features/app/components/AppSidebar.vue2.js +137 -127
- package/dist/v2/features/app/index.d.ts +3 -0
- package/dist/v2/features/app/index.d.ts.map +1 -1
- package/dist/v2/features/app/index.js +17 -11
- package/dist/v2/features/command-palette/TheCommandPalette.vue.d.ts.map +1 -1
- package/dist/v2/features/command-palette/TheCommandPalette.vue.js +1 -1
- package/dist/v2/features/command-palette/TheCommandPalette.vue2.js +6 -6
- package/dist/v2/features/command-palette/hooks/use-command-palette-state.d.ts +2 -2
- 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 +60 -56
- package/dist/v2/features/operation/Operation.vue.js +1 -1
- package/dist/v2/features/search/hooks/use-search-index.d.ts +3 -7
- package/dist/v2/features/search/hooks/use-search-index.d.ts.map +1 -1
- package/dist/v2/features/search/hooks/use-search-index.js +12 -18
- package/dist/v2/features/search/index.d.ts +1 -2
- package/dist/v2/features/search/index.d.ts.map +1 -1
- package/dist/v2/features/search/index.js +2 -4
- package/dist/v2/features/search/types.d.ts +1 -1
- package/dist/v2/features/search/types.d.ts.map +1 -1
- package/dist/v2/helpers/handle-hotkeys.js +1 -1
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/dist/views/Request/libs/oauth2.d.ts.map +1 -1
- package/dist/views/Request/libs/oauth2.js +54 -52
- package/package.json +19 -19
- package/dist/v2/features/search/components/SearchButton.vue.d.ts +0 -12
- package/dist/v2/features/search/components/SearchButton.vue.d.ts.map +0 -1
- package/dist/v2/features/search/components/SearchButton.vue.js +0 -71
- package/dist/v2/features/search/components/SearchButton.vue2.js +0 -4
- package/dist/v2/features/search/components/SearchModal.vue.d.ts +0 -11
- package/dist/v2/features/search/components/SearchModal.vue.d.ts.map +0 -1
- package/dist/v2/features/search/components/SearchModal.vue.js +0 -7
- package/dist/v2/features/search/components/SearchModal.vue2.js +0 -102
- package/dist/v2/features/search/components/SearchResult.vue.d.ts +0 -10
- package/dist/v2/features/search/components/SearchResult.vue.d.ts.map +0 -1
- package/dist/v2/features/search/components/SearchResult.vue.js +0 -80
- package/dist/v2/features/search/components/SearchResult.vue2.js +0 -4
|
@@ -9,7 +9,7 @@ import { getParentEntry as p } from "@scalar/workspace-store/navigation";
|
|
|
9
9
|
import { createWorkspaceStorePersistence as z } from "@scalar/workspace-store/persistence";
|
|
10
10
|
import { persistencePlugin as J } from "@scalar/workspace-store/plugins/client";
|
|
11
11
|
import { extensions as M } from "@scalar/workspace-store/schemas/extensions";
|
|
12
|
-
import { shallowRef as g, computed as
|
|
12
|
+
import { shallowRef as g, computed as u, ref as l, watch as G } from "vue";
|
|
13
13
|
import { getActiveEnvironment as Q } from "../../helpers/get-active-environment.js";
|
|
14
14
|
import { getTabDetails as X } from "../../helpers/get-tab-details.js";
|
|
15
15
|
import { slugify as Z } from "../../helpers/slugify.js";
|
|
@@ -21,15 +21,15 @@ const ae = 1e3, v = j({
|
|
|
21
21
|
G(c, (e) => {
|
|
22
22
|
e && e.afterEach((t) => he(t));
|
|
23
23
|
});
|
|
24
|
-
const d =
|
|
24
|
+
const d = u(() => c.value?.currentRoute.value ?? null);
|
|
25
25
|
function s(e, t) {
|
|
26
26
|
const a = t?.params[e];
|
|
27
27
|
if (typeof a == "string")
|
|
28
28
|
return e === "method" ? a && H(a) ? a : void 0 : decodeURIComponent(a);
|
|
29
29
|
}
|
|
30
|
-
const y = g(null), S = l([]), n = g(null), E =
|
|
30
|
+
const y = g(null), S = l([]), n = g(null), E = u(() => n.value?.workspace.documents[f.value ?? ""] || null), re = u(() => Q(n.value, E.value)), { workspace: h } = await z();
|
|
31
31
|
S.value = await h.getAll().then((e) => e.map(({ id: t, name: a }) => ({ id: t, label: a })));
|
|
32
|
-
const
|
|
32
|
+
const ne = async ({ workspaceId: e }) => R({
|
|
33
33
|
plugins: [await J({ workspaceId: e, debounceDelay: ae })]
|
|
34
34
|
}), oe = async (e) => {
|
|
35
35
|
const t = await h.getItem(e);
|
|
@@ -37,7 +37,7 @@ const re = async ({ workspaceId: e }) => R({
|
|
|
37
37
|
return {
|
|
38
38
|
success: !1
|
|
39
39
|
};
|
|
40
|
-
const a = await
|
|
40
|
+
const a = await ne({ workspaceId: e });
|
|
41
41
|
return a.loadWorkspace(t.workspace), y.value = { id: e, label: t.name }, n.value = a, {
|
|
42
42
|
success: !0,
|
|
43
43
|
workspace: a.workspace
|
|
@@ -77,7 +77,7 @@ const re = async ({ workspaceId: e }) => R({
|
|
|
77
77
|
const a = await q({
|
|
78
78
|
defaultValue: e ?? t,
|
|
79
79
|
// Use the provided id if it exists, otherwise use the name
|
|
80
|
-
validation: async (
|
|
80
|
+
validation: async (i) => !await h.has(i),
|
|
81
81
|
maxRetries: 100,
|
|
82
82
|
transformation: Z
|
|
83
83
|
});
|
|
@@ -89,10 +89,10 @@ const re = async ({ workspaceId: e }) => R({
|
|
|
89
89
|
n.value = null, m.value = !0;
|
|
90
90
|
const t = await oe(e);
|
|
91
91
|
if (t.success) {
|
|
92
|
-
const o = t.workspace["x-scalar-active-tab"] ?? 0,
|
|
93
|
-
W && await c.value?.replace(W.path),
|
|
92
|
+
const o = t.workspace["x-scalar-active-tab"] ?? 0, i = t.workspace["x-scalar-tabs"], W = i?.[o];
|
|
93
|
+
W && await c.value?.replace(W.path), i && o >= i.length && v.emit("tabs:update:tabs", {
|
|
94
94
|
"x-scalar-active-tab": 0
|
|
95
|
-
}),
|
|
95
|
+
}), i || v.emit("tabs:update:tabs", {
|
|
96
96
|
"x-scalar-tabs": [I(d.value)],
|
|
97
97
|
"x-scalar-active-tab": 0
|
|
98
98
|
}), m.value = !1;
|
|
@@ -105,7 +105,7 @@ const re = async ({ workspaceId: e }) => R({
|
|
|
105
105
|
if (m.value = !1, !a)
|
|
106
106
|
return console.error("Failed to create the default workspace, something went wrong, can not load the workspace");
|
|
107
107
|
r.reset();
|
|
108
|
-
}, L =
|
|
108
|
+
}, L = u(() => {
|
|
109
109
|
const e = n.value;
|
|
110
110
|
if (!e)
|
|
111
111
|
return [];
|
|
@@ -116,7 +116,7 @@ const re = async ({ workspaceId: e }) => R({
|
|
|
116
116
|
path: t,
|
|
117
117
|
method: a,
|
|
118
118
|
example: o
|
|
119
|
-
}) => JSON.stringify([e, t, a, o].filter(D)), T =
|
|
119
|
+
}) => JSON.stringify([e, t, a, o].filter(D)), T = u(
|
|
120
120
|
() => Y({
|
|
121
121
|
items: L.value,
|
|
122
122
|
nestedKey: "children",
|
|
@@ -146,16 +146,21 @@ const re = async ({ workspaceId: e }) => R({
|
|
|
146
146
|
console.warn(`Could not find sidebar entry with id ${e} to select`);
|
|
147
147
|
return;
|
|
148
148
|
}
|
|
149
|
-
if (
|
|
150
|
-
r.
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
return r.setSelected(e), r.setExpanded(e, !
|
|
149
|
+
if (t.type === "document") {
|
|
150
|
+
if (r.selectedItem.value === e) {
|
|
151
|
+
r.setExpanded(e, !r.isExpanded(e));
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
return r.setSelected(e), r.setExpanded(e, !0), c.value?.push({
|
|
155
155
|
name: "document.overview",
|
|
156
156
|
params: { documentSlug: t.name }
|
|
157
157
|
});
|
|
158
|
+
}
|
|
158
159
|
if (t.type === "operation") {
|
|
160
|
+
if (r.isSelected(e)) {
|
|
161
|
+
r.setExpanded(e, !r.isExpanded(e));
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
159
164
|
const a = t.children?.find((o) => o.type === "example");
|
|
160
165
|
return a ? (r.setSelected(a.id), r.setExpanded(a.id, !0)) : r.setSelected(e), c.value?.push({
|
|
161
166
|
name: "example",
|
|
@@ -168,7 +173,7 @@ const re = async ({ workspaceId: e }) => R({
|
|
|
168
173
|
});
|
|
169
174
|
}
|
|
170
175
|
if (t.type === "example") {
|
|
171
|
-
r.setSelected(e)
|
|
176
|
+
r.setSelected(e);
|
|
172
177
|
const a = p("operation", t);
|
|
173
178
|
return c.value?.push({
|
|
174
179
|
name: "example",
|
|
@@ -188,14 +193,14 @@ const re = async ({ workspaceId: e }) => R({
|
|
|
188
193
|
}
|
|
189
194
|
});
|
|
190
195
|
r.setExpanded(e, !r.isExpanded(e));
|
|
191
|
-
},
|
|
196
|
+
}, ue = async () => {
|
|
192
197
|
if (!n.value)
|
|
193
198
|
return;
|
|
194
199
|
const e = n.value.workspace["x-scalar-active-tab"] ?? 0, t = n.value.workspace["x-scalar-tabs"]?.[e];
|
|
195
200
|
t && await c.value?.replace(t.path);
|
|
196
201
|
}, P = (e) => {
|
|
197
202
|
e && n.value?.buildSidebar(e);
|
|
198
|
-
},
|
|
203
|
+
}, ie = (e) => {
|
|
199
204
|
const t = E.value?.["x-scalar-navigation"]?.name;
|
|
200
205
|
if (!t)
|
|
201
206
|
return;
|
|
@@ -206,11 +211,11 @@ const re = async ({ workspaceId: e }) => R({
|
|
|
206
211
|
example: e.exampleKey
|
|
207
212
|
});
|
|
208
213
|
(!a || a.type !== "example") && (P(t), d.value && K(d.value));
|
|
209
|
-
}, le = 288, pe =
|
|
210
|
-
const t = s("method", e), a = s("pathEncoded", e), o = s("documentSlug", e),
|
|
214
|
+
}, le = 288, pe = u(() => n.value?.workspace?.["x-scalar-sidebar-width"] ?? le), de = (e) => n.value?.update("x-scalar-sidebar-width", e), k = l(!0), me = "x-scalar-tabs", ve = "x-scalar-active-tab", I = (e) => {
|
|
215
|
+
const t = s("method", e), a = s("pathEncoded", e), o = s("documentSlug", e), i = s("workspaceSlug", e);
|
|
211
216
|
return {
|
|
212
217
|
...X({
|
|
213
|
-
workspace:
|
|
218
|
+
workspace: i,
|
|
214
219
|
document: o,
|
|
215
220
|
path: a,
|
|
216
221
|
method: t,
|
|
@@ -218,7 +223,7 @@ const re = async ({ workspaceId: e }) => R({
|
|
|
218
223
|
}),
|
|
219
224
|
path: d.value?.path ?? ""
|
|
220
225
|
};
|
|
221
|
-
}, _ =
|
|
226
|
+
}, _ = u(() => n.value?.workspace[me] ?? [I(d.value)]), fe = u(() => n.value?.workspace[ve] ?? 0), F = async (e) => {
|
|
222
227
|
const t = _.value[e];
|
|
223
228
|
if (!t) {
|
|
224
229
|
console.warn(`Cannot copy URL: tab at index ${e} does not exist`);
|
|
@@ -260,9 +265,9 @@ te({
|
|
|
260
265
|
eventBus: v,
|
|
261
266
|
router: c,
|
|
262
267
|
store: n,
|
|
263
|
-
navigateToCurrentTab:
|
|
268
|
+
navigateToCurrentTab: ue,
|
|
264
269
|
rebuildSidebar: P,
|
|
265
|
-
onAfterExampleCreation:
|
|
270
|
+
onAfterExampleCreation: ie,
|
|
266
271
|
onSelectSidebarItem: N,
|
|
267
272
|
onCopyTabUrl: (e) => F(e),
|
|
268
273
|
onToggleSidebar: () => k.value = !k.value
|
|
@@ -289,7 +294,7 @@ function Le(e) {
|
|
|
289
294
|
workspaceList: S,
|
|
290
295
|
activeWorkspace: y,
|
|
291
296
|
setId: B,
|
|
292
|
-
isOpen:
|
|
297
|
+
isOpen: u(() => !!(x.value && !f.value))
|
|
293
298
|
},
|
|
294
299
|
eventBus: v,
|
|
295
300
|
router: c,
|
|
@@ -302,7 +307,7 @@ function Le(e) {
|
|
|
302
307
|
method: A,
|
|
303
308
|
exampleName: U
|
|
304
309
|
},
|
|
305
|
-
environment:
|
|
310
|
+
environment: re,
|
|
306
311
|
document: E
|
|
307
312
|
};
|
|
308
313
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppSidebar.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/app/components/AppSidebar.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AppSidebar.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/app/components/AppSidebar.vue"],"names":[],"mappings":"AAkeA,OAAO,EAML,KAAK,mBAAmB,EACzB,MAAM,oBAAoB,CAAA;AAO3B,OAAO,KAAK,EAA6B,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAEvE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAA;AAUhF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,KAAK,WAAW,GAAG;IACf;;OAEG;IACH,MAAM,EAAE,YAAY,CAAA;IAEpB;;OAEG;IACH,YAAY,EAAE,YAAY,CAAC,cAAc,CAAC,CAAA;IAE1C;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB;;;OAGG;IACH,eAAe,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAA;IAC9C;;;OAGG;IACH,UAAU,EAAE,mBAAmB,EAAE,CAAA;IACjC;;;OAGG;IACH,QAAQ,EAAE,iBAAiB,CAAA;IAC3B;;;OAGG;IACH,KAAK,EAAE,cAAc,CAAA;CACtB,CAAC;AAgBJ,KAAK,WAAW,GAAG;IACjB,oEAAoE;IACpE,kBAAkB,CAAC,IAAI,OAAO,CAAA;CAC/B,CAAC;AAmLF,KAAK,iBAAiB,GAAG,WAAW,GAAG;IACvC,6CAA6C;IAC7C,eAAe,EAAE,OAAO,CAAC;IACzB,wCAAwC;IACxC,cAAc,EAAE,MAAM,CAAC;CACtB,CAAC;AAqfF,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,7 +1,7 @@
|
|
|
1
1
|
import o from "./AppSidebar.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import p from "../../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const e = /* @__PURE__ */ p(o, [["__scopeId", "data-v-
|
|
4
|
+
const e = /* @__PURE__ */ p(o, [["__scopeId", "data-v-b574e7b1"]]);
|
|
5
5
|
export {
|
|
6
6
|
e as default
|
|
7
7
|
};
|
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useModal as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
1
|
+
import { defineComponent as R, mergeModels as W, computed as k, capitalize as V, useModel as I, ref as F, createElementBlock as c, openBlock as u, createVNode as d, createBlock as M, createCommentVNode as p, unref as s, createSlots as G, withCtx as r, createTextVNode as b, createElementVNode as l, withKeys as w, withModifiers as v, toDisplayString as L, renderSlot as j, normalizeClass as H, Fragment as h, nextTick as U } from "vue";
|
|
2
|
+
import { useModal as J, ScalarSidebarItem as O, ScalarIconButton as Y, ScalarButton as $, ScalarModal as Q } from "@scalar/components";
|
|
3
|
+
import { isMacOS as X } from "@scalar/helpers/general/is-mac-os";
|
|
4
|
+
import { ScalarIconPlus as Z, ScalarIconDotsThree as _, ScalarIconGlobe as ee } from "@scalar/icons";
|
|
5
|
+
import { getParentEntry as S } from "@scalar/workspace-store/navigation";
|
|
6
|
+
import te from "../../../../assets/rabbit.ascii.js";
|
|
7
|
+
import ae from "../../../../assets/rabbitjump.ascii.js";
|
|
7
8
|
import E from "../../../../components/ScalarAsciiArt.vue.js";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { dragHandleFactory as
|
|
11
|
-
import
|
|
12
|
-
const
|
|
9
|
+
import oe from "../../../../components/Sidebar/Actions/DeleteSidebarListElement.vue.js";
|
|
10
|
+
import ne from "./SidebarItemMenu.vue.js";
|
|
11
|
+
import { dragHandleFactory as se } from "../../../helpers/drag-handle-factory.js";
|
|
12
|
+
import ie from "../../../components/sidebar/Sidebar.vue.js";
|
|
13
|
+
const re = { class: "flex" }, le = {
|
|
13
14
|
key: 0,
|
|
14
15
|
class: "flex items-center"
|
|
15
|
-
},
|
|
16
|
+
}, de = {
|
|
16
17
|
key: 0,
|
|
17
18
|
class: "empty-sidebar-item-content overflow-hidden px-2.5 py-2.5"
|
|
18
|
-
},
|
|
19
|
+
}, ue = { class: "rabbit-ascii relative m-auto mt-2 h-[68px] w-[60px]" }, me = { class: "gap-1.5 p-2" }, ce = { class: "text-sidebar-c-2 rounded border px-1.25 py-1 text-xs leading-none font-medium uppercase" }, Ce = /* @__PURE__ */ R({
|
|
19
20
|
__name: "AppSidebar",
|
|
20
|
-
props: /* @__PURE__ */
|
|
21
|
+
props: /* @__PURE__ */ W({
|
|
21
22
|
layout: {},
|
|
22
23
|
sidebarState: {},
|
|
23
24
|
isWorkspaceOpen: { type: Boolean },
|
|
@@ -34,65 +35,65 @@ const ie = { class: "flex" }, se = {
|
|
|
34
35
|
},
|
|
35
36
|
sidebarWidthModifiers: {}
|
|
36
37
|
}),
|
|
37
|
-
emits: /* @__PURE__ */
|
|
38
|
-
setup(
|
|
39
|
-
const
|
|
40
|
-
() =>
|
|
41
|
-
store:
|
|
42
|
-
sidebarState:
|
|
38
|
+
emits: /* @__PURE__ */ W(["click:workspace", "selectItem", "select:workspace", "create:workspace"], ["update:isSidebarOpen", "update:sidebarWidth"]),
|
|
39
|
+
setup(o, { emit: A }) {
|
|
40
|
+
const f = A, D = k(() => V(o.activeWorkspace.label)), x = I(o, "isSidebarOpen"), B = I(o, "sidebarWidth"), g = k(() => o.sidebarState.items.value.length <= 1), C = k(
|
|
41
|
+
() => se({
|
|
42
|
+
store: o.store,
|
|
43
|
+
sidebarState: o.sidebarState
|
|
43
44
|
})
|
|
44
|
-
),
|
|
45
|
-
const
|
|
46
|
-
return
|
|
45
|
+
), N = (a, e) => C.value.handleDragEnd(a, e), T = (a, e) => C.value.isDroppable(a, e), i = F(null), y = J(), K = k(() => {
|
|
46
|
+
const a = i.value?.item;
|
|
47
|
+
return a?.type === "document" ? "This cannot be undone. You're about to delete the document and all tags and operations inside it." : `Are you sure you want to delete this ${a?.type ?? "item"}? This action cannot be undone.`;
|
|
47
48
|
}), z = () => {
|
|
48
|
-
const
|
|
49
|
-
if (!
|
|
49
|
+
const a = i.value?.item;
|
|
50
|
+
if (!a)
|
|
50
51
|
return;
|
|
51
|
-
const e =
|
|
52
|
+
const e = o.sidebarState.getEntryById(a.id), t = S("document", e), n = S("operation", e);
|
|
52
53
|
if (t) {
|
|
53
|
-
if (
|
|
54
|
-
|
|
55
|
-
else if (
|
|
56
|
-
|
|
54
|
+
if (a.type === "document")
|
|
55
|
+
o.eventBus.emit("document:delete:document", { name: t.name });
|
|
56
|
+
else if (a.type === "tag")
|
|
57
|
+
o.eventBus.emit("tag:delete:tag", {
|
|
57
58
|
documentName: t.name,
|
|
58
|
-
name:
|
|
59
|
+
name: a.name
|
|
59
60
|
});
|
|
60
|
-
else if (
|
|
61
|
+
else if (a.type === "operation") {
|
|
61
62
|
if (!n)
|
|
62
63
|
return;
|
|
63
|
-
|
|
64
|
+
o.eventBus.emit("operation:delete:operation", {
|
|
64
65
|
meta: {
|
|
65
66
|
method: n.method,
|
|
66
67
|
path: n.path
|
|
67
68
|
},
|
|
68
69
|
documentName: t.name
|
|
69
70
|
});
|
|
70
|
-
} else if (
|
|
71
|
+
} else if (a.type === "example") {
|
|
71
72
|
if (!n)
|
|
72
73
|
return;
|
|
73
|
-
|
|
74
|
+
o.eventBus.emit("operation:delete:example", {
|
|
74
75
|
meta: {
|
|
75
76
|
method: n.method,
|
|
76
77
|
path: n.path,
|
|
77
|
-
exampleKey:
|
|
78
|
+
exampleKey: a.name
|
|
78
79
|
},
|
|
79
80
|
documentName: t.name
|
|
80
81
|
});
|
|
81
82
|
}
|
|
82
|
-
|
|
83
|
+
y.hide(), i.value = null;
|
|
83
84
|
}
|
|
84
|
-
}, m = async (
|
|
85
|
-
if (
|
|
85
|
+
}, m = async (a, e) => {
|
|
86
|
+
if (i.value?.showMenu)
|
|
86
87
|
return;
|
|
87
|
-
const t =
|
|
88
|
-
|
|
89
|
-
const n =
|
|
90
|
-
|
|
91
|
-
},
|
|
92
|
-
|
|
93
|
-
},
|
|
94
|
-
const e =
|
|
95
|
-
|
|
88
|
+
const t = a.currentTarget;
|
|
89
|
+
i.value = { item: e, el: t, showMenu: !0 }, await U();
|
|
90
|
+
const n = a instanceof MouseEvent ? new MouseEvent(a.type, a) : new KeyboardEvent(a.type, a);
|
|
91
|
+
i.value?.el.dispatchEvent(n);
|
|
92
|
+
}, P = () => {
|
|
93
|
+
i.value && (i.value.showMenu = !1);
|
|
94
|
+
}, q = (a) => {
|
|
95
|
+
const e = o.sidebarState.getEntryById(a.id), t = S("document", e), n = S("tag", e);
|
|
96
|
+
o.eventBus.emit("ui:open:command-palette", {
|
|
96
97
|
action: "create-request",
|
|
97
98
|
payload: {
|
|
98
99
|
documentId: t?.id,
|
|
@@ -100,127 +101,136 @@ const ie = { class: "flex" }, se = {
|
|
|
100
101
|
}
|
|
101
102
|
});
|
|
102
103
|
};
|
|
103
|
-
return (
|
|
104
|
-
|
|
105
|
-
isSidebarOpen:
|
|
106
|
-
"onUpdate:isSidebarOpen": e[3] || (e[3] = (t) =>
|
|
107
|
-
sidebarWidth:
|
|
108
|
-
"onUpdate:sidebarWidth": e[4] || (e[4] = (t) =>
|
|
109
|
-
activeWorkspace:
|
|
110
|
-
documents: Object.values(
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
}, R({
|
|
104
|
+
return (a, e) => (u(), c("div", re, [
|
|
105
|
+
d(s(ie), {
|
|
106
|
+
isSidebarOpen: x.value,
|
|
107
|
+
"onUpdate:isSidebarOpen": e[3] || (e[3] = (t) => x.value = t),
|
|
108
|
+
sidebarWidth: B.value,
|
|
109
|
+
"onUpdate:sidebarWidth": e[4] || (e[4] = (t) => B.value = t),
|
|
110
|
+
activeWorkspace: o.activeWorkspace,
|
|
111
|
+
documents: Object.values(o.store.workspace.documents),
|
|
112
|
+
isDroppable: T,
|
|
113
|
+
layout: o.layout,
|
|
114
|
+
sidebarState: o.sidebarState,
|
|
115
|
+
workspaces: o.workspaces,
|
|
116
|
+
"onCreate:workspace": e[5] || (e[5] = (t) => f("create:workspace")),
|
|
117
|
+
onReorder: e[6] || (e[6] = (t, n) => N(t, n)),
|
|
118
|
+
"onSelect:workspace": e[7] || (e[7] = (t) => f("select:workspace", t)),
|
|
119
|
+
onSelectItem: e[8] || (e[8] = (t) => f("selectItem", t))
|
|
120
|
+
}, G({
|
|
121
121
|
sidebarMenuActions: r(() => [
|
|
122
|
-
|
|
122
|
+
j(a.$slots, "sidebarMenuActions", {}, void 0, !0)
|
|
123
123
|
]),
|
|
124
124
|
workspaceButton: r(() => [
|
|
125
|
-
|
|
125
|
+
d(s(O), {
|
|
126
126
|
is: "button",
|
|
127
|
-
active:
|
|
128
|
-
icon:
|
|
129
|
-
onClick: e[0] || (e[0] = (t) =>
|
|
127
|
+
active: o.isWorkspaceOpen,
|
|
128
|
+
icon: s(ee),
|
|
129
|
+
onClick: e[0] || (e[0] = (t) => f("click:workspace"))
|
|
130
130
|
}, {
|
|
131
131
|
default: r(() => [
|
|
132
|
-
|
|
132
|
+
b(L(D.value), 1)
|
|
133
133
|
]),
|
|
134
134
|
_: 1
|
|
135
135
|
}, 8, ["active", "icon"])
|
|
136
136
|
]),
|
|
137
137
|
decorator: r(({ item: t }) => [
|
|
138
|
-
|
|
138
|
+
d(s(Y), {
|
|
139
139
|
"aria-expanded": "false",
|
|
140
140
|
"aria-haspopup": "menu",
|
|
141
|
-
icon:
|
|
141
|
+
icon: s(_),
|
|
142
142
|
label: "More options",
|
|
143
143
|
size: "sm",
|
|
144
144
|
weight: "bold",
|
|
145
|
-
onClick:
|
|
145
|
+
onClick: v((n) => m(n, t), ["stop"]),
|
|
146
146
|
onKeydown: [
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
147
|
+
w(v((n) => m(n, t), ["stop"]), ["down"]),
|
|
148
|
+
w(v((n) => m(n, t), ["stop"]), ["enter"]),
|
|
149
|
+
w(v((n) => m(n, t), ["stop"]), ["space"]),
|
|
150
|
+
w(v((n) => m(n, t), ["stop"]), ["up"])
|
|
151
151
|
]
|
|
152
152
|
}, null, 8, ["icon", "onClick", "onKeydown"])
|
|
153
153
|
]),
|
|
154
154
|
icon: r(({ item: t }) => [
|
|
155
|
-
t.type === "document" &&
|
|
156
|
-
|
|
157
|
-
])])) :
|
|
155
|
+
t.type === "document" && o.store.workspace.documents[t.name]?.["x-scalar-is-dirty"] === !0 ? (u(), c("div", le, [...e[11] || (e[11] = [
|
|
156
|
+
l("div", { class: "h-2 w-2 rounded-full bg-white" }, null, -1)
|
|
157
|
+
])])) : p("", !0)
|
|
158
158
|
]),
|
|
159
159
|
empty: r(({ item: t }) => [
|
|
160
|
-
|
|
160
|
+
d(s(O), {
|
|
161
161
|
is: "button",
|
|
162
|
-
onClick: (n) =>
|
|
162
|
+
onClick: (n) => q(t)
|
|
163
163
|
}, {
|
|
164
164
|
icon: r(() => [
|
|
165
|
-
|
|
165
|
+
d(s(Z))
|
|
166
166
|
]),
|
|
167
167
|
default: r(() => [...e[12] || (e[12] = [
|
|
168
|
-
|
|
168
|
+
b("Add operation", -1)
|
|
169
169
|
])]),
|
|
170
170
|
_: 1
|
|
171
171
|
}, 8, ["onClick"])
|
|
172
172
|
]),
|
|
173
173
|
_: 2
|
|
174
174
|
}, [
|
|
175
|
-
|
|
175
|
+
o.layout !== "modal" ? {
|
|
176
176
|
name: "footer",
|
|
177
177
|
fn: r(() => [
|
|
178
|
-
|
|
178
|
+
l("div", {
|
|
179
179
|
class: H({
|
|
180
|
-
"empty-sidebar-item border-t":
|
|
180
|
+
"empty-sidebar-item border-t": g.value
|
|
181
181
|
})
|
|
182
182
|
}, [
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
art:
|
|
183
|
+
g.value ? (u(), c("div", de, [
|
|
184
|
+
l("div", ue, [
|
|
185
|
+
d(E, {
|
|
186
|
+
art: s(te),
|
|
187
187
|
class: "rabbitsit font-bold"
|
|
188
188
|
}, null, 8, ["art"]),
|
|
189
|
-
|
|
190
|
-
art:
|
|
189
|
+
d(E, {
|
|
190
|
+
art: s(ae),
|
|
191
191
|
class: "rabbitjump absolute top-0 left-0 font-bold"
|
|
192
192
|
}, null, 8, ["art"])
|
|
193
193
|
]),
|
|
194
|
-
e[13] || (e[13] =
|
|
195
|
-
|
|
196
|
-
|
|
194
|
+
e[13] || (e[13] = l("div", { class: "mt-2 mb-2 text-center text-sm text-balance" }, [
|
|
195
|
+
l("b", { class: "font-medium" }, "Let's Get Started"),
|
|
196
|
+
l("p", { class: "mt-2 leading-3" }, " Create request, folder, collection or import from OpenAPI/Postman ")
|
|
197
197
|
], -1))
|
|
198
|
-
])) :
|
|
199
|
-
|
|
200
|
-
|
|
198
|
+
])) : p("", !0),
|
|
199
|
+
l("div", me, [
|
|
200
|
+
g.value ? (u(), M(s($), {
|
|
201
201
|
key: 0,
|
|
202
202
|
class: "w-full",
|
|
203
203
|
size: "sm",
|
|
204
|
-
onClick: e[1] || (e[1] = (t) =>
|
|
204
|
+
onClick: e[1] || (e[1] = (t) => o.eventBus.emit("ui:open:command-palette", {
|
|
205
205
|
action: "import-from-openapi-swagger-postman-curl",
|
|
206
206
|
payload: void 0
|
|
207
207
|
}))
|
|
208
208
|
}, {
|
|
209
209
|
default: r(() => [...e[14] || (e[14] = [
|
|
210
|
-
|
|
210
|
+
b(" Import Collection ", -1)
|
|
211
211
|
])]),
|
|
212
212
|
_: 1
|
|
213
|
-
})) :
|
|
214
|
-
|
|
213
|
+
})) : p("", !0),
|
|
214
|
+
d(s($), {
|
|
215
215
|
class: "w-full",
|
|
216
216
|
hotkey: "K",
|
|
217
217
|
size: "sm",
|
|
218
218
|
variant: "outlined",
|
|
219
|
-
onClick: e[2] || (e[2] = (t) =>
|
|
219
|
+
onClick: e[2] || (e[2] = (t) => o.eventBus.emit("ui:open:command-palette"))
|
|
220
220
|
}, {
|
|
221
|
-
default: r(() => [
|
|
222
|
-
|
|
223
|
-
|
|
221
|
+
default: r(() => [
|
|
222
|
+
e[20] || (e[20] = b(" Add Item ", -1)),
|
|
223
|
+
l("span", ce, [
|
|
224
|
+
s(X)() ? (u(), c(h, { key: 0 }, [
|
|
225
|
+
e[15] || (e[15] = l("span", { class: "sr-only" }, "Command", -1)),
|
|
226
|
+
e[16] || (e[16] = l("span", { "aria-hidden": "true" }, "⌘", -1))
|
|
227
|
+
], 64)) : (u(), c(h, { key: 1 }, [
|
|
228
|
+
e[17] || (e[17] = l("span", { class: "sr-only" }, "CTRL", -1)),
|
|
229
|
+
e[18] || (e[18] = l("span", { "aria-hidden": "true" }, "⌃", -1))
|
|
230
|
+
], 64)),
|
|
231
|
+
e[19] || (e[19] = b(" K ", -1))
|
|
232
|
+
])
|
|
233
|
+
]),
|
|
224
234
|
_: 1
|
|
225
235
|
})
|
|
226
236
|
])
|
|
@@ -228,35 +238,35 @@ const ie = { class: "flex" }, se = {
|
|
|
228
238
|
]),
|
|
229
239
|
key: "0"
|
|
230
240
|
} : void 0
|
|
231
|
-
]), 1032, ["isSidebarOpen", "sidebarWidth", "activeWorkspace", "documents", "
|
|
232
|
-
|
|
241
|
+
]), 1032, ["isSidebarOpen", "sidebarWidth", "activeWorkspace", "documents", "layout", "sidebarState", "workspaces"]),
|
|
242
|
+
i.value?.showMenu ? (u(), M(ne, {
|
|
233
243
|
key: 0,
|
|
234
|
-
eventBus:
|
|
235
|
-
item:
|
|
236
|
-
sidebarState:
|
|
237
|
-
target:
|
|
238
|
-
onCloseMenu:
|
|
239
|
-
onShowDeleteModal: e[9] || (e[9] = (t) =>
|
|
240
|
-
}, null, 8, ["eventBus", "item", "sidebarState", "target"])) :
|
|
241
|
-
|
|
244
|
+
eventBus: o.eventBus,
|
|
245
|
+
item: i.value.item,
|
|
246
|
+
sidebarState: o.sidebarState,
|
|
247
|
+
target: i.value.el,
|
|
248
|
+
onCloseMenu: P,
|
|
249
|
+
onShowDeleteModal: e[9] || (e[9] = (t) => s(y).show())
|
|
250
|
+
}, null, 8, ["eventBus", "item", "sidebarState", "target"])) : p("", !0),
|
|
251
|
+
i.value ? (u(), M(s(Q), {
|
|
242
252
|
key: 1,
|
|
243
253
|
size: "xxs",
|
|
244
|
-
state:
|
|
245
|
-
title: `Delete ${
|
|
254
|
+
state: s(y),
|
|
255
|
+
title: `Delete ${i.value.item.title}`
|
|
246
256
|
}, {
|
|
247
257
|
default: r(() => [
|
|
248
|
-
|
|
249
|
-
variableName:
|
|
250
|
-
warningMessage:
|
|
251
|
-
onClose: e[10] || (e[10] = (t) =>
|
|
258
|
+
d(oe, {
|
|
259
|
+
variableName: i.value.item.title,
|
|
260
|
+
warningMessage: K.value,
|
|
261
|
+
onClose: e[10] || (e[10] = (t) => s(y).hide()),
|
|
252
262
|
onDelete: z
|
|
253
263
|
}, null, 8, ["variableName", "warningMessage"])
|
|
254
264
|
]),
|
|
255
265
|
_: 1
|
|
256
|
-
}, 8, ["state", "title"])) :
|
|
266
|
+
}, 8, ["state", "title"])) : p("", !0)
|
|
257
267
|
]));
|
|
258
268
|
}
|
|
259
269
|
});
|
|
260
270
|
export {
|
|
261
|
-
|
|
271
|
+
Ce as default
|
|
262
272
|
};
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
export { type AppState, useAppState } from '../../../v2/features/app/app-state.js';
|
|
2
|
+
export { default as CreateWorkspaceModal } from '../../../v2/features/app/components/CreateWorkspaceModal.vue.js';
|
|
3
|
+
export { default as CommandActionForm } from '../../../v2/features/command-palette/components/CommandActionForm.vue.js';
|
|
4
|
+
export { default as CommandActionInput } from '../../../v2/features/command-palette/components/CommandActionInput.vue.js';
|
|
2
5
|
export type { ClientPlugin } from '../../../v2/helpers/plugins.js';
|
|
3
6
|
export type { ClientLayout } from '../../../v2/types/layout';
|
|
4
7
|
export { type CommandPaletteAction, type CommandPaletteRoute, baseClientActions, baseRoutes, useCommandPaletteState, } from '../command-palette/hooks/use-command-palette-state.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/app/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AACxE,YAAY,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACxD,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,iBAAiB,EACjB,UAAU,EACV,sBAAsB,GACvB,MAAM,oDAAoD,CAAA;AAC3D,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,WAAW,CAAA;AAChD,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/app/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AACxE,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,uDAAuD,CAAA;AACvG,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,gEAAgE,CAAA;AAC7G,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,iEAAiE,CAAA;AAC/G,YAAY,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACxD,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,iBAAiB,EACjB,UAAU,EACV,sBAAsB,GACvB,MAAM,oDAAoD,CAAA;AAC3D,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,WAAW,CAAA;AAChD,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAA"}
|