@scalar/api-client 2.22.1 → 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 +50 -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-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/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 +17 -17
- 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
|
@@ -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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TheCommandPalette.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/command-palette/TheCommandPalette.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TheCommandPalette.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/command-palette/TheCommandPalette.vue"],"names":[],"mappings":"AA0WA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAIV,iBAAiB,EAClB,MAAM,gCAAgC,CAAA;AAWvC,OAAO,KAAK,EAEV,mBAAmB,EACpB,MAAM,mCAAmC,CAAA;AAG1C;;;;;;;;;;;;;;;;;;;;GAoBG;;IAGD,gDAAgD;kBAClC,mBAAmB;IACjC,iEAAiE;oBACjD,cAAc;IAC9B,8CAA8C;cACpC,iBAAiB;;IAL3B,gDAAgD;kBAClC,mBAAmB;IACjC,iEAAiE;oBACjD,cAAc;IAC9B,8CAA8C;cACpC,iBAAiB;;AAP7B,wBAscC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./TheCommandPalette.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
4
|
+
const r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-2fe57517"]]);
|
|
5
5
|
export {
|
|
6
6
|
r as default
|
|
7
7
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as V, ref as E, computed as f, watch as K, onBeforeMount as R, onBeforeUnmount as X, createBlock as v, openBlock as l, unref as r, withCtx as p, createElementVNode as u, createVNode as i, createElementBlock as s, createTextVNode as I, createCommentVNode as S, withKeys as x, withModifiers as C, Fragment as h, renderList as
|
|
1
|
+
import { defineComponent as V, ref as E, computed as f, watch as K, onBeforeMount as R, onBeforeUnmount as X, createBlock as v, openBlock as l, unref as r, withCtx as p, createElementVNode as u, createVNode as i, createElementBlock as s, createTextVNode as I, createCommentVNode as S, withKeys as x, withModifiers as C, Fragment as h, renderList as D, withDirectives as Q, toDisplayString as B, vShow as A, normalizeClass as F, resolveDynamicComponent as O, mergeProps as G, nextTick as H } from "vue";
|
|
2
2
|
import { Dialog as U, DialogPanel as W, DialogTitle as $ } from "@headlessui/vue";
|
|
3
3
|
import { ScalarIconMagnifyingGlass as j, ScalarIconCaretLeft as q } from "@scalar/icons";
|
|
4
4
|
import { useRouter as J } from "vue-router";
|
|
@@ -58,7 +58,7 @@ const Y = {
|
|
|
58
58
|
eventBus: e.eventBus,
|
|
59
59
|
...e.paletteState.activeCommandProps.value
|
|
60
60
|
})), N = (t) => {
|
|
61
|
-
t ? e.paletteState.open(t.action, t.payload) : e.paletteState.open();
|
|
61
|
+
t?.event && t.event.preventDefault(), t && "action" in t ? e.paletteState.open(t.action, t.payload) : e.paletteState.open();
|
|
62
62
|
};
|
|
63
63
|
return R(() => e.eventBus.on("ui:open:command-palette", N)), X(() => e.eventBus.off("ui:open:command-palette", N)), (t, a) => (l(), v(r(U), {
|
|
64
64
|
open: e.paletteState.isOpen.value,
|
|
@@ -113,13 +113,13 @@ const Y = {
|
|
|
113
113
|
]
|
|
114
114
|
}, null, 40, ee)
|
|
115
115
|
]),
|
|
116
|
-
(l(!0), s(h, null,
|
|
116
|
+
(l(!0), s(h, null, D(e.paletteState.filteredCommands.value, (n) => (l(), s(h, {
|
|
117
117
|
key: n.label || "100"
|
|
118
118
|
}, [
|
|
119
|
-
Q(u("div", { class: "text-c-3 mt-2 mb-1 px-2 text-xs font-medium" },
|
|
119
|
+
Q(u("div", { class: "text-c-3 mt-2 mb-1 px-2 text-xs font-medium" }, B(n.label), 513), [
|
|
120
120
|
[A, n.commands.length > 0]
|
|
121
121
|
]),
|
|
122
|
-
(l(!0), s(h, null,
|
|
122
|
+
(l(!0), s(h, null, D(n.commands, (o) => (l(), s("button", {
|
|
123
123
|
id: o.id,
|
|
124
124
|
key: o.id,
|
|
125
125
|
class: F(["commandmenu-item hover:bg-b-2 flex w-full cursor-pointer items-center rounded px-2 py-1.5 text-left text-sm", {
|
|
@@ -134,7 +134,7 @@ const Y = {
|
|
|
134
134
|
size: "md",
|
|
135
135
|
thickness: "1.5"
|
|
136
136
|
})) : S("", !0),
|
|
137
|
-
I(" " +
|
|
137
|
+
I(" " + B(o.name), 1)
|
|
138
138
|
], 10, te))), 128))
|
|
139
139
|
], 64))), 128)),
|
|
140
140
|
e.paletteState.filteredCommands.value.flatMap((n) => n.commands).length ? S("", !0) : (l(), s("div", ne, " No commands found "))
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ScalarIconComponent } from '@scalar/icons/types';
|
|
2
2
|
import type { CommandPalettePayload } from '@scalar/workspace-store/events';
|
|
3
|
-
import { type Component, type ComputedRef, type Ref, type ShallowRef } from 'vue';
|
|
3
|
+
import { type Component, type ComputedRef, type MaybeRefOrGetter, type Ref, type ShallowRef } from 'vue';
|
|
4
4
|
import type { RouteLocationRaw } from 'vue-router';
|
|
5
5
|
/**
|
|
6
6
|
* Command IDs that map to UI components (folder and hidden-folder types)
|
|
@@ -100,7 +100,7 @@ export type CommandPaletteState = {
|
|
|
100
100
|
* // Close and reset
|
|
101
101
|
* palette.close()
|
|
102
102
|
*/
|
|
103
|
-
export declare const useCommandPaletteState: (actions?: CommandPaletteAction[]
|
|
103
|
+
export declare const useCommandPaletteState: (actions?: MaybeRefOrGetter<CommandPaletteAction[]>, routes?: MaybeRefOrGetter<CommandPaletteRoute[]>) => CommandPaletteState;
|
|
104
104
|
/**
|
|
105
105
|
* The base naviation routes used in the command palette.
|
|
106
106
|
* This object can be extended and passed to the useCommandPaletteState hook to add custom routes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-command-palette-state.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/command-palette/hooks/use-command-palette-state.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAC9D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAA;AAE3E,OAAO,
|
|
1
|
+
{"version":3,"file":"use-command-palette-state.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/command-palette/hooks/use-command-palette-state.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAC9D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAA;AAE3E,OAAO,EACL,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,GAAG,EACR,KAAK,UAAU,EAKhB,MAAM,KAAK,CAAA;AACZ,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AASlD;;;;GAIG;AACH,KAAK,YAAY,GAAG,MAAM,qBAAqB,CAAA;AAE/C,oDAAoD;AACpD,KAAK,yBAAyB,CAAC,CAAC,SAAS,YAAY,IAAI,qBAAqB,CAAC,CAAC,CAAC,CAA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