@scalar/api-client 2.0.22 → 2.0.25
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 +48 -0
- package/dist/components/AddressBar/AddressBar.vue.d.ts.map +1 -1
- package/dist/components/AddressBar/AddressBar.vue.js +2 -2
- package/dist/components/AddressBar/AddressBar.vue2.js +80 -84
- package/dist/components/AddressBar/AddressBarHistory.vue.d.ts.map +1 -1
- package/dist/components/AddressBar/AddressBarHistory.vue.js +11 -10
- package/dist/components/AddressBar/AddressBarServer.vue.d.ts.map +1 -1
- package/dist/components/CodeInput/CodeInput.vue.d.ts +10 -0
- package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
- package/dist/components/CodeInput/CodeInput.vue.js +3 -2
- package/dist/components/CodeInput/CodeInput.vue2.js +42 -37
- package/dist/components/CodeInput/codeDropdownWidget.d.ts +24 -0
- package/dist/components/CodeInput/codeDropdownWidget.d.ts.map +1 -0
- package/dist/components/CodeInput/codeDropdownWidget.js +110 -0
- package/dist/components/CodeInput/codeVariableWidget.d.ts +8 -0
- package/dist/components/CodeInput/codeVariableWidget.d.ts.map +1 -0
- package/dist/components/CodeInput/codeVariableWidget.js +124 -0
- package/dist/components/CommandPalette/CommandPaletteCollection.vue.d.ts +2 -15
- package/dist/components/CommandPalette/CommandPaletteCollection.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteCollection.vue.js +51 -54
- package/dist/components/CommandPalette/CommandPaletteExample.vue.d.ts +4 -2
- package/dist/components/CommandPalette/CommandPaletteExample.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteExample.vue.js +106 -92
- package/dist/components/CommandPalette/CommandPaletteFolder.vue.d.ts +2 -15
- package/dist/components/CommandPalette/CommandPaletteFolder.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteFolder.vue.js +68 -74
- package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts +2 -15
- package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteImport.vue.js +56 -62
- package/dist/components/CommandPalette/CommandPaletteRequest.vue.d.ts +2 -15
- package/dist/components/CommandPalette/CommandPaletteRequest.vue.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPaletteRequest.vue.js +106 -99
- package/dist/components/CommandPalette/CommandPaletteWorkspace.vue.d.ts +7 -0
- package/dist/components/CommandPalette/CommandPaletteWorkspace.vue.d.ts.map +1 -0
- package/dist/components/CommandPalette/CommandPaletteWorkspace.vue.js +57 -0
- package/dist/components/CommandPalette/CommandPaletteWorkspace.vue2.js +4 -0
- package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts +50 -0
- package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -0
- package/dist/components/CommandPalette/TheCommandPalette.vue.js +9 -0
- package/dist/components/CommandPalette/TheCommandPalette.vue2.js +198 -0
- package/dist/components/CommandPalette/index.d.ts +2 -0
- package/dist/components/CommandPalette/index.d.ts.map +1 -0
- package/dist/components/CommandPalette/index.js +4 -0
- package/dist/components/ContextBar.vue.js +4 -4
- package/dist/components/DarkModeToggle/DarkModeIconToggle.vue.js +7 -6
- package/dist/components/DataTable/DataTableCheckbox.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableCheckbox.vue.js +3 -2
- package/dist/components/DataTable/DataTableInput.vue.d.ts +1 -1
- package/dist/components/DataTable/DataTableInput.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableInput.vue.js +3 -3
- package/dist/components/DataTable/DataTableInput.vue2.js +36 -49
- package/dist/components/DataTable/DataTableInputSelect.vue.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableInputSelect.vue.js +15 -14
- package/dist/components/Search/SearchButton.vue.d.ts.map +1 -1
- package/dist/components/Search/SearchButton.vue.js +7 -6
- package/dist/components/SideNav/SideNav.vue.d.ts.map +1 -1
- package/dist/components/SideNav/SideNav.vue.js +26 -23
- package/dist/components/SideNav/SideNavLink.vue.d.ts +3 -2
- package/dist/components/SideNav/SideNavLink.vue.d.ts.map +1 -1
- package/dist/components/SideNav/SideNavLink.vue.js +18 -16
- package/dist/components/Sidebar/Sidebar.vue.d.ts +15 -2
- package/dist/components/Sidebar/Sidebar.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/Sidebar.vue.js +14 -12
- package/dist/components/Sidebar/SidebarButton.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarButton.vue.js +5 -5
- package/dist/components/Sidebar/SidebarListElementActions.vue.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarListElementActions.vue.js +2 -2
- package/dist/components/TopNav/TopNav.vue.d.ts.map +1 -1
- package/dist/components/TopNav/TopNav.vue.js +1 -1
- package/dist/components/TopNav/TopNav.vue2.js +31 -29
- package/dist/components/TopNav/TopNavItem.vue.d.ts +7 -3
- package/dist/components/TopNav/TopNavItem.vue.d.ts.map +1 -1
- package/dist/components/TopNav/TopNavItem.vue.js +2 -2
- package/dist/components/TopNav/TopNavItem.vue2.js +18 -18
- package/dist/components/ViewLayout/ViewLayout.vue.d.ts.map +1 -1
- package/dist/components/ViewLayout/ViewLayout.vue.js +1 -1
- package/dist/components/ViewLayout/ViewLayoutCollapse.vue.d.ts.map +1 -1
- package/dist/components/ViewLayout/ViewLayoutCollapse.vue.js +2 -1
- package/dist/constants.d.ts +13 -7
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +4 -4
- package/dist/index.d.ts +2 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -16
- package/dist/layouts/App/ApiClientApp.vue.d.ts.map +1 -0
- package/dist/layouts/App/ApiClientApp.vue.js +72 -0
- package/dist/{App → layouts/App}/createApiClientApp.d.ts +1 -1
- package/dist/layouts/App/createApiClientApp.d.ts.map +1 -0
- package/dist/{App → layouts/App}/createApiClientApp.js +2 -2
- package/dist/layouts/App/index.d.ts.map +1 -0
- package/dist/{Modal → layouts/Modal}/ApiClientModal.vue.d.ts +1 -0
- package/dist/layouts/Modal/ApiClientModal.vue.d.ts.map +1 -0
- package/dist/{Modal → layouts/Modal}/ApiClientModal.vue.js +2 -2
- package/dist/layouts/Modal/api-client-modal.d.ts.map +1 -0
- package/dist/{Modal → layouts/Modal}/api-client-modal.js +7 -7
- package/dist/layouts/Modal/index.d.ts.map +1 -0
- package/dist/libs/eventBusses/command-palette.d.ts +14 -0
- package/dist/libs/eventBusses/command-palette.d.ts.map +1 -0
- package/dist/libs/eventBusses/command-palette.js +5 -0
- package/dist/libs/local-storage.d.ts +1 -1
- package/dist/libs/local-storage.d.ts.map +1 -1
- package/dist/libs/local-storage.js +19 -19
- package/dist/router.d.ts +18 -6
- package/dist/router.d.ts.map +1 -1
- package/dist/router.js +107 -71
- package/dist/store/topNav.d.ts +94 -82
- package/dist/store/topNav.d.ts.map +1 -1
- package/dist/store/topNav.js +21 -20
- package/dist/store/workspace.d.ts +312 -82
- package/dist/store/workspace.d.ts.map +1 -1
- package/dist/store/workspace.js +299 -224
- package/dist/style.css +1 -1
- package/dist/views/Collection/Collection.vue.d.ts.map +1 -1
- package/dist/views/Components/Schemas/Schemas.vue.d.ts.map +1 -1
- package/dist/views/Cookies/Cookies.vue.d.ts.map +1 -1
- package/dist/views/Cookies/Cookies.vue2.js +9 -12
- package/dist/views/Environment/Environment.vue.d.ts.map +1 -1
- package/dist/views/Environment/Environment.vue2.js +22 -25
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts.map +1 -1
- package/dist/views/Environment/EnvironmentVariableDropdown.vue.js +38 -47
- package/dist/views/Request/Request.vue.d.ts.map +1 -1
- package/dist/views/Request/Request.vue.js +1 -1
- package/dist/views/Request/Request.vue2.js +125 -108
- package/dist/views/Request/RequestSection/RequestAuthDataTableInput.vue.d.ts +1 -1
- package/dist/views/Request/RequestSection/RequestAuthDataTableInput.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestBody.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestBody.vue.js +5 -4
- package/dist/views/Request/RequestSection/RequestSection.vue.js +3 -2
- package/dist/views/Request/RequestSection/RequestTable.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestTable.vue.js +4 -4
- package/dist/views/Request/RequestSection/RequestTable.vue2.js +22 -21
- package/dist/views/Request/RequestSection/RequestTableTooltip.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSection/RequestTableTooltip.vue.js +6 -5
- package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebarItem.vue.js +2 -2
- package/dist/views/Request/RequestSidebarItem.vue2.js +84 -79
- package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts.map +1 -1
- package/dist/views/Request/RequestSidebarItemMenu.vue.js +58 -38
- package/dist/views/Request/ResponseSection/ResponseSection.vue.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseSection.vue.js +3 -2
- package/dist/views/Request/components/OAuth2.vue.d.ts.map +1 -1
- package/dist/views/Request/components/OAuth2.vue.js +2 -0
- package/dist/{App.vue.d.ts → views/Request/components/WorkspaceDropdown.vue.d.ts} +1 -2
- package/dist/views/Request/components/WorkspaceDropdown.vue.d.ts.map +1 -0
- package/dist/views/Request/components/WorkspaceDropdown.vue.js +80 -0
- package/dist/views/Request/components/WorkspaceDropdown.vue2.js +4 -0
- package/dist/views/Request/components/index.d.ts +1 -0
- package/dist/views/Request/components/index.d.ts.map +1 -1
- package/dist/views/Request/components/index.js +4 -2
- package/dist/views/Servers/Servers.vue.d.ts.map +1 -1
- package/dist/views/Servers/Servers.vue2.js +12 -15
- package/package.json +19 -15
- package/dist/App/ApiClientApp.vue.d.ts.map +0 -1
- package/dist/App/ApiClientApp.vue.js +0 -56
- package/dist/App/createApiClientApp.d.ts.map +0 -1
- package/dist/App/index.d.ts.map +0 -1
- package/dist/App.vue.d.ts.map +0 -1
- package/dist/App.vue.js +0 -77
- package/dist/App.vue3.js +0 -5
- package/dist/Modal/ApiClientModal.vue.d.ts.map +0 -1
- package/dist/Modal/api-client-modal.d.ts.map +0 -1
- package/dist/Modal/index.d.ts.map +0 -1
- package/dist/components/AddressBar/AddressBarServer.vue.js +0 -106
- package/dist/components/AddressBar/AddressBarServer.vue2.js +0 -4
- package/dist/components/CommandPalette/CommandPalette.vue.d.ts +0 -17
- package/dist/components/CommandPalette/CommandPalette.vue.d.ts.map +0 -1
- package/dist/components/CommandPalette/CommandPalette.vue.js +0 -7
- package/dist/components/CommandPalette/CommandPalette.vue2.js +0 -184
- package/dist/main.d.ts +0 -2
- package/dist/main.d.ts.map +0 -1
- package/dist/views/Collection/Collection.vue.js +0 -4
- package/dist/views/Collection/Collection.vue2.js +0 -136
- package/dist/views/Components/Schemas/Schemas.vue.js +0 -4
- package/dist/views/Components/Schemas/Schemas.vue2.js +0 -20
- /package/dist/{App → layouts/App}/ApiClientApp.vue.d.ts +0 -0
- /package/dist/{App → layouts/App}/ApiClientApp.vue3.js +0 -0
- /package/dist/{App → layouts/App}/index.d.ts +0 -0
- /package/dist/{App → layouts/App}/index.js +0 -0
- /package/dist/{Modal → layouts/Modal}/ApiClientModal.vue2.js +0 -0
- /package/dist/{Modal → layouts/Modal}/api-client-modal.d.ts +0 -0
- /package/dist/{Modal → layouts/Modal}/index.d.ts +0 -0
- /package/dist/{Modal → layouts/Modal}/index.js +0 -0
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
var m = Object.defineProperty;
|
|
2
|
+
var g = (d, t, e) => t in d ? m(d, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : d[t] = e;
|
|
3
|
+
var n = (d, t, e) => g(d, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
import { router as f } from "../../router.js";
|
|
5
|
+
import { ViewPlugin as y, Decoration as h, StateEffect as T, WidgetType as S } from "@scalar/use-codemirror";
|
|
6
|
+
import { createApp as q, h as p, Teleport as x } from "vue";
|
|
7
|
+
import v from "../../views/Environment/EnvironmentVariableDropdown.vue.js";
|
|
8
|
+
class u extends S {
|
|
9
|
+
constructor(e, s, o) {
|
|
10
|
+
super();
|
|
11
|
+
n(this, "queryTerm");
|
|
12
|
+
n(this, "onSelect");
|
|
13
|
+
n(this, "dropdown", null);
|
|
14
|
+
n(this, "withServers");
|
|
15
|
+
this.queryTerm = e, this.onSelect = s, this.withServers = o;
|
|
16
|
+
}
|
|
17
|
+
updateQueryTerm(e) {
|
|
18
|
+
this.queryTerm !== e && (this.queryTerm = e);
|
|
19
|
+
}
|
|
20
|
+
getQueryTerm() {
|
|
21
|
+
return this.queryTerm;
|
|
22
|
+
}
|
|
23
|
+
toDOM(e) {
|
|
24
|
+
const s = document.createElement("span");
|
|
25
|
+
return s.style.position = "fixed", setTimeout(() => {
|
|
26
|
+
var c;
|
|
27
|
+
const o = e.state.selection.main.head, i = e.coordsAtPos(o - this.queryTerm.length - 2);
|
|
28
|
+
if (i) {
|
|
29
|
+
const r = (c = document.querySelector(".scalar-client")) == null ? void 0 : c.getBoundingClientRect();
|
|
30
|
+
r && (this.dropdown = q({
|
|
31
|
+
render: () => p(x, { to: ".scalar-client" }, [
|
|
32
|
+
p(v, {
|
|
33
|
+
query: this.queryTerm,
|
|
34
|
+
onSelect: this.onSelect,
|
|
35
|
+
withServers: this.withServers,
|
|
36
|
+
style: {
|
|
37
|
+
position: "absolute",
|
|
38
|
+
left: `${i.left - r.left}px`,
|
|
39
|
+
top: `calc(${i.bottom - r.top}px + 6px)`
|
|
40
|
+
}
|
|
41
|
+
})
|
|
42
|
+
])
|
|
43
|
+
})), this.dropdown.use(f), this.dropdown.mount(s);
|
|
44
|
+
}
|
|
45
|
+
}, 0), s;
|
|
46
|
+
}
|
|
47
|
+
destroy() {
|
|
48
|
+
this.dropdown && (this.dropdown.unmount(), this.dropdown = null);
|
|
49
|
+
}
|
|
50
|
+
eq(e) {
|
|
51
|
+
return e instanceof u && this.queryTerm === e.queryTerm;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
const P = (d) => y.fromClass(
|
|
55
|
+
class {
|
|
56
|
+
constructor(t) {
|
|
57
|
+
n(this, "decorations");
|
|
58
|
+
n(this, "widget", null);
|
|
59
|
+
n(this, "view");
|
|
60
|
+
this.view = t, this.decorations = h.none, this.handleDropdownSelect = this.handleDropdownSelect.bind(this);
|
|
61
|
+
}
|
|
62
|
+
handleDropdownSelect(t) {
|
|
63
|
+
var w;
|
|
64
|
+
if (!this.widget) return;
|
|
65
|
+
const { state: e, dispatch: s } = this.view, o = e.selection.main.head, i = Math.max(0, o - this.widget.getQueryTerm().length - 2), c = o, r = `{{${t}}}`;
|
|
66
|
+
s({
|
|
67
|
+
changes: { from: i, to: c, insert: r }
|
|
68
|
+
}), (w = this.widget) == null || w.destroy(), this.widget = null, this.decorations = h.none, this.view.dispatch({
|
|
69
|
+
effects: T.appendConfig.of([])
|
|
70
|
+
});
|
|
71
|
+
const l = i + r.length, a = "";
|
|
72
|
+
this.widget = new u(
|
|
73
|
+
a,
|
|
74
|
+
this.handleDropdownSelect,
|
|
75
|
+
d.withServers
|
|
76
|
+
), this.decorations = h.set([
|
|
77
|
+
h.widget({
|
|
78
|
+
widget: this.widget,
|
|
79
|
+
side: 1
|
|
80
|
+
}).range(l)
|
|
81
|
+
]), this.view.dispatch({
|
|
82
|
+
selection: { anchor: l }
|
|
83
|
+
}), this.view.focus();
|
|
84
|
+
}
|
|
85
|
+
update(t) {
|
|
86
|
+
var r, l;
|
|
87
|
+
const e = t.state.selection.main.head, s = t.state.doc.sliceString(0, e), o = [], i = s.lastIndexOf("{{"), c = s.lastIndexOf("}}");
|
|
88
|
+
if (i > c) {
|
|
89
|
+
const a = s.slice(i + 2);
|
|
90
|
+
!this.widget || this.widget.getQueryTerm() !== a ? ((r = this.widget) == null || r.destroy(), this.widget = new u(
|
|
91
|
+
a,
|
|
92
|
+
this.handleDropdownSelect
|
|
93
|
+
)) : this.widget.updateQueryTerm(a), o.push(
|
|
94
|
+
h.widget({
|
|
95
|
+
widget: this.widget,
|
|
96
|
+
side: 1
|
|
97
|
+
}).range(e)
|
|
98
|
+
);
|
|
99
|
+
} else
|
|
100
|
+
(l = this.widget) == null || l.destroy(), this.widget = null;
|
|
101
|
+
this.decorations = h.set(o);
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
decorations: (t) => t.decorations
|
|
106
|
+
}
|
|
107
|
+
);
|
|
108
|
+
export {
|
|
109
|
+
P as dropdownPlugin
|
|
110
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Decoration, type DecorationSet, EditorView, ViewPlugin, type ViewUpdate } from '@scalar/use-codemirror';
|
|
2
|
+
export declare const pillPlugin: ViewPlugin<{
|
|
3
|
+
decorations: DecorationSet;
|
|
4
|
+
update(update: ViewUpdate): void;
|
|
5
|
+
buildDecorations(view: EditorView): import("@codemirror/state").RangeSet<Decoration>;
|
|
6
|
+
}>;
|
|
7
|
+
export declare const backspaceCommand: import("@codemirror/state").Extension;
|
|
8
|
+
//# sourceMappingURL=codeVariableWidget.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codeVariableWidget.d.ts","sourceRoot":"","sources":["../../../src/components/CodeInput/codeVariableWidget.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,UAAU,EACV,KAAK,aAAa,EAClB,UAAU,EAEV,UAAU,EACV,KAAK,UAAU,EAEhB,MAAM,wBAAwB,CAAA;AA+F/B,eAAO,MAAM,UAAU;iBAEN,aAAa;mBAMX,UAAU;2BAMF,UAAU;EA6BpC,CAAA;AAED,eAAO,MAAM,gBAAgB,uCAmB3B,CAAA"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
var u = Object.defineProperty;
|
|
2
|
+
var f = (t, a, e) => a in t ? u(t, a, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[a] = e;
|
|
3
|
+
var c = (t, a, e) => f(t, typeof a != "symbol" ? a + "" : a, e);
|
|
4
|
+
import { useWorkspace as v } from "../../store/workspace.js";
|
|
5
|
+
import { ScalarButton as h, ScalarIcon as b, ScalarTooltip as g } from "@scalar/components";
|
|
6
|
+
import { ViewPlugin as x, RangeSetBuilder as w, Decoration as N, EditorView as y, WidgetType as C } from "@scalar/use-codemirror";
|
|
7
|
+
import { defineComponent as k, h as o, createApp as D } from "vue";
|
|
8
|
+
const { activeParsedEnvironments: S, isReadOnly: E } = v();
|
|
9
|
+
class l extends C {
|
|
10
|
+
constructor(e) {
|
|
11
|
+
super();
|
|
12
|
+
c(this, "app");
|
|
13
|
+
this.variableName = e;
|
|
14
|
+
}
|
|
15
|
+
toDOM() {
|
|
16
|
+
const e = document.createElement("span");
|
|
17
|
+
e.className = "cm-pill", e.textContent = `${this.variableName}`;
|
|
18
|
+
const n = k({
|
|
19
|
+
props: ["variableName"],
|
|
20
|
+
render() {
|
|
21
|
+
const s = S.value.find(
|
|
22
|
+
(i) => i.key === this.variableName
|
|
23
|
+
), r = s ? o("div", { class: "p-2" }, s.value) : o("div", { class: "divide-y divide-1/2 grid" }, [
|
|
24
|
+
o("span", { class: "p-2" }, "Variable not found"),
|
|
25
|
+
!E.value && o("div", { class: "p-1" }, [
|
|
26
|
+
o(
|
|
27
|
+
h,
|
|
28
|
+
{
|
|
29
|
+
class: "gap-1.5 justify-start font-normal px-1 py-1.5 h-auto transition-colors rounded no-underline text-xxs w-full hover:bg-b-2",
|
|
30
|
+
variant: "ghost",
|
|
31
|
+
onClick: () => {
|
|
32
|
+
window.location.href = "/environment";
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
[
|
|
36
|
+
o(b, { class: "w-2", icon: "Add", size: "xs" }),
|
|
37
|
+
"Add variable"
|
|
38
|
+
]
|
|
39
|
+
)
|
|
40
|
+
])
|
|
41
|
+
]);
|
|
42
|
+
return o(
|
|
43
|
+
g,
|
|
44
|
+
{
|
|
45
|
+
align: "start",
|
|
46
|
+
class: "bg-b-1 w-full",
|
|
47
|
+
delay: 0,
|
|
48
|
+
side: "bottom",
|
|
49
|
+
sideOffset: 6
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
trigger: () => o("span", `${this.variableName}`),
|
|
53
|
+
content: () => o(
|
|
54
|
+
"div",
|
|
55
|
+
{
|
|
56
|
+
class: "w-content shadow-lg rounded bg-b-1 text-xxs leading-5 text-c-1"
|
|
57
|
+
},
|
|
58
|
+
r
|
|
59
|
+
)
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
return this.app = D(n, { variableName: this.variableName }), this.app.mount(e), e;
|
|
65
|
+
}
|
|
66
|
+
destroy() {
|
|
67
|
+
this.app && this.app.unmount();
|
|
68
|
+
}
|
|
69
|
+
eq(e) {
|
|
70
|
+
return e instanceof l && e.variableName === this.variableName;
|
|
71
|
+
}
|
|
72
|
+
ignoreEvent(e) {
|
|
73
|
+
return !1;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
const V = x.fromClass(
|
|
77
|
+
class {
|
|
78
|
+
constructor(t) {
|
|
79
|
+
c(this, "decorations");
|
|
80
|
+
this.decorations = this.buildDecorations(t);
|
|
81
|
+
}
|
|
82
|
+
update(t) {
|
|
83
|
+
(t.docChanged || t.viewportChanged) && (this.decorations = this.buildDecorations(t.view));
|
|
84
|
+
}
|
|
85
|
+
buildDecorations(t) {
|
|
86
|
+
const a = new w();
|
|
87
|
+
for (const { from: e, to: n } of t.visibleRanges) {
|
|
88
|
+
const s = t.state.doc.sliceString(e, n), r = /{{(.*?)}}/g;
|
|
89
|
+
let i;
|
|
90
|
+
for (; (i = r.exec(s)) !== null; ) {
|
|
91
|
+
const d = e + i.index, p = d + i[0].length, m = i[1];
|
|
92
|
+
a.add(
|
|
93
|
+
d,
|
|
94
|
+
p,
|
|
95
|
+
N.widget({
|
|
96
|
+
widget: new l(m),
|
|
97
|
+
side: 1
|
|
98
|
+
})
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return a.finish();
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
decorations: (t) => t.decorations
|
|
107
|
+
}
|
|
108
|
+
), T = y.domEventHandlers({
|
|
109
|
+
keydown(t, a) {
|
|
110
|
+
if (t.key === "Backspace") {
|
|
111
|
+
const { state: e } = a, { from: n, to: s } = e.selection.main;
|
|
112
|
+
if (n === s && n > 0 && e.doc.sliceString(n - 2, n) === "}}")
|
|
113
|
+
return a.dispatch({
|
|
114
|
+
changes: { from: n - 2, to: s },
|
|
115
|
+
selection: { anchor: n - 2 }
|
|
116
|
+
}), t.preventDefault(), !0;
|
|
117
|
+
}
|
|
118
|
+
return !1;
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
export {
|
|
122
|
+
T as backspaceCommand,
|
|
123
|
+
V as pillPlugin
|
|
124
|
+
};
|
|
@@ -1,20 +1,7 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<
|
|
2
|
-
title: string;
|
|
3
|
-
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
4
2
|
close: () => void;
|
|
5
|
-
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<
|
|
6
|
-
title: string;
|
|
7
|
-
}>>> & {
|
|
3
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>> & {
|
|
8
4
|
onClose?: (() => any) | undefined;
|
|
9
5
|
}, {}, {}>;
|
|
10
6
|
export default _default;
|
|
11
|
-
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
12
|
-
type __VLS_TypePropsToOption<T> = {
|
|
13
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
14
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
15
|
-
} : {
|
|
16
|
-
type: import('vue').PropType<T[K]>;
|
|
17
|
-
required: true;
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
7
|
//# sourceMappingURL=CommandPaletteCollection.vue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommandPaletteCollection.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandPaletteCollection.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CommandPaletteCollection.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandPaletteCollection.vue"],"names":[],"mappings":";;;;;AAgMA,wBAMG"}
|
|
@@ -1,66 +1,63 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useWorkspace as
|
|
1
|
+
import { defineComponent as d, ref as s, onMounted as p, openBlock as f, createElementBlock as x, withModifiers as h, createElementVNode as e, withDirectives as _, vModelText as v, createVNode as b, unref as w, withCtx as C, createTextVNode as N } from "vue";
|
|
2
|
+
import { useWorkspace as g } from "../../store/workspace.js";
|
|
3
3
|
import { ScalarButton as k } from "@scalar/components";
|
|
4
|
-
const
|
|
4
|
+
const y = { class: "gap-3 rounded bg-b-2 focus-within:bg-b-1 focus-within:shadow-border min-h-20 relative" }, M = /* @__PURE__ */ e("label", {
|
|
5
5
|
class: "absolute w-full h-full opacity-0 cursor-text",
|
|
6
6
|
for: "collectionanme"
|
|
7
|
-
}, null, -1), V = { class: "flex" }, B = /* @__PURE__ */ e("div", { class: "flex flex-1 gap-2 max-h-8" }, null, -1),
|
|
7
|
+
}, null, -1), V = { class: "flex" }, B = /* @__PURE__ */ e("div", { class: "flex flex-1 gap-2 max-h-8" }, null, -1), W = /* @__PURE__ */ d({
|
|
8
8
|
__name: "CommandPaletteCollection",
|
|
9
|
-
props: {
|
|
10
|
-
title: {}
|
|
11
|
-
},
|
|
12
9
|
emits: ["close"],
|
|
13
|
-
setup(
|
|
14
|
-
const a =
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
10
|
+
setup(S, { emit: c }) {
|
|
11
|
+
const a = c, { activeWorkspace: i, collectionMutators: r } = g(), t = s(""), u = () => {
|
|
12
|
+
r.add(
|
|
13
|
+
{
|
|
14
|
+
spec: {
|
|
15
|
+
openapi: "3.1.0",
|
|
16
|
+
info: {
|
|
17
|
+
title: t.value,
|
|
18
|
+
version: "0.0.1"
|
|
19
|
+
}
|
|
21
20
|
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
},
|
|
22
|
+
i.value.uid
|
|
23
|
+
), a("close");
|
|
24
|
+
}, l = s(null);
|
|
25
25
|
return p(() => {
|
|
26
|
-
var
|
|
27
|
-
(
|
|
28
|
-
}), (
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
e("
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}, null, 512), [
|
|
45
|
-
[v, l.value]
|
|
46
|
-
])
|
|
47
|
-
]),
|
|
48
|
-
e("div", V, [
|
|
49
|
-
B,
|
|
50
|
-
w(g(k), {
|
|
51
|
-
class: "max-h-8 text-xs p-0 px-3",
|
|
52
|
-
type: "submit"
|
|
53
|
-
}, {
|
|
54
|
-
default: C(() => [
|
|
55
|
-
N(" Continue ")
|
|
56
|
-
]),
|
|
57
|
-
_: 1
|
|
58
|
-
})
|
|
26
|
+
var o;
|
|
27
|
+
(o = l.value) == null || o.focus();
|
|
28
|
+
}), (o, n) => (f(), x("form", {
|
|
29
|
+
class: "flex w-full flex-col gap-3",
|
|
30
|
+
onSubmit: h(u, ["prevent"])
|
|
31
|
+
}, [
|
|
32
|
+
e("div", y, [
|
|
33
|
+
M,
|
|
34
|
+
_(e("input", {
|
|
35
|
+
id: "collectionanme",
|
|
36
|
+
ref_key: "collectionInput",
|
|
37
|
+
ref: l,
|
|
38
|
+
"onUpdate:modelValue": n[0] || (n[0] = (m) => t.value = m),
|
|
39
|
+
class: "border-transparent outline-none w-full pl-8 text-sm min-h-8 py-1.5",
|
|
40
|
+
label: "Collection Name",
|
|
41
|
+
placeholder: "Collection Name"
|
|
42
|
+
}, null, 512), [
|
|
43
|
+
[v, t.value]
|
|
59
44
|
])
|
|
60
|
-
],
|
|
61
|
-
|
|
45
|
+
]),
|
|
46
|
+
e("div", V, [
|
|
47
|
+
B,
|
|
48
|
+
b(w(k), {
|
|
49
|
+
class: "max-h-8 text-xs p-0 px-3",
|
|
50
|
+
type: "submit"
|
|
51
|
+
}, {
|
|
52
|
+
default: C(() => [
|
|
53
|
+
N(" Continue ")
|
|
54
|
+
]),
|
|
55
|
+
_: 1
|
|
56
|
+
})
|
|
57
|
+
])
|
|
58
|
+
], 32));
|
|
62
59
|
}
|
|
63
60
|
});
|
|
64
61
|
export {
|
|
65
|
-
|
|
62
|
+
W as default
|
|
66
63
|
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<{
|
|
2
|
-
|
|
2
|
+
/** The request uid to pre-select */
|
|
3
|
+
metaData?: string;
|
|
3
4
|
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
4
5
|
close: () => void;
|
|
5
6
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<{
|
|
6
|
-
|
|
7
|
+
/** The request uid to pre-select */
|
|
8
|
+
metaData?: string;
|
|
7
9
|
}>>> & {
|
|
8
10
|
onClose?: (() => any) | undefined;
|
|
9
11
|
}, {}, {}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommandPaletteExample.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandPaletteExample.vue"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"CommandPaletteExample.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandPaletteExample.vue"],"names":[],"mappings":";IAqIE,oCAAoC;eACzB,MAAM;;;;IADjB,oCAAoC;eACzB,MAAM;;;;AA2SnB,wBAOG;AAOH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
|
|
@@ -1,107 +1,121 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { useWorkspace as
|
|
4
|
-
import { ScalarDropdown as
|
|
5
|
-
|
|
1
|
+
import { defineComponent as N, ref as u, onMounted as B, openBlock as i, createElementBlock as f, withModifiers as I, createElementVNode as l, withDirectives as M, vModelText as R, createVNode as s, unref as n, withCtx as r, Fragment as V, renderList as q, createBlock as W, createTextVNode as c, toDisplayString as x } from "vue";
|
|
2
|
+
import v from "../HttpMethod/HttpMethod.vue.js";
|
|
3
|
+
import { useWorkspace as j } from "../../store/workspace.js";
|
|
4
|
+
import { ScalarDropdown as z, ScalarDropdownItem as T, ScalarButton as h, ScalarIcon as F } from "@scalar/components";
|
|
5
|
+
import { useRouter as L } from "vue-router";
|
|
6
|
+
const P = { class: "gap-3 rounded bg-b-2 focus-within:bg-b-1 focus-within:shadow-border min-h-20 relative" }, U = /* @__PURE__ */ l("label", {
|
|
6
7
|
class: "absolute w-full h-full opacity-0 cursor-text",
|
|
7
8
|
for: "examplename"
|
|
8
|
-
}, null, -1),
|
|
9
|
+
}, null, -1), A = { class: "flex gap-2" }, G = { class: "flex flex-1 max-h-8" }, H = { class: "flex items-center gap-2" }, J = { class: "max-h-40 custom-scroll" }, ee = /* @__PURE__ */ N({
|
|
9
10
|
__name: "CommandPaletteExample",
|
|
10
11
|
props: {
|
|
11
|
-
|
|
12
|
+
metaData: {}
|
|
12
13
|
},
|
|
13
14
|
emits: ["close"],
|
|
14
|
-
setup(
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
class: "justify-between p-2 max-h-8 w-full gap-1 text-xs hover:bg-b-2",
|
|
69
|
-
variant: "outlined",
|
|
70
|
-
onClick: o[1] || (o[1] = (t) => f(r.value))
|
|
15
|
+
setup(_, { emit: b }) {
|
|
16
|
+
const w = _, k = b, { push: g } = L(), {
|
|
17
|
+
activeRequest: y,
|
|
18
|
+
activeWorkspace: C,
|
|
19
|
+
activeWorkspaceRequests: S,
|
|
20
|
+
requests: D,
|
|
21
|
+
requestExampleMutators: E
|
|
22
|
+
} = j(), m = u(""), a = u(
|
|
23
|
+
// Ensure we pre-select the correct request
|
|
24
|
+
D[w.metaData ?? ""] ?? y.value
|
|
25
|
+
), p = (e) => a.value = e, d = u(null);
|
|
26
|
+
B(() => {
|
|
27
|
+
var e;
|
|
28
|
+
return (e = d.value) == null ? void 0 : e.focus();
|
|
29
|
+
});
|
|
30
|
+
const $ = () => {
|
|
31
|
+
const e = E.add(
|
|
32
|
+
a.value,
|
|
33
|
+
m.value
|
|
34
|
+
);
|
|
35
|
+
e && g(
|
|
36
|
+
`/workspace/${C.value.uid}/request/${a.value.uid}/examples/${e.uid}`
|
|
37
|
+
);
|
|
38
|
+
};
|
|
39
|
+
return (e, o) => (i(), f("form", {
|
|
40
|
+
class: "flex w-full flex-col gap-3",
|
|
41
|
+
onSubmit: o[2] || (o[2] = I((t) => k("close"), ["prevent"]))
|
|
42
|
+
}, [
|
|
43
|
+
l("div", P, [
|
|
44
|
+
U,
|
|
45
|
+
M(l("input", {
|
|
46
|
+
id: "examplename",
|
|
47
|
+
ref_key: "exampleInput",
|
|
48
|
+
ref: d,
|
|
49
|
+
"onUpdate:modelValue": o[0] || (o[0] = (t) => m.value = t),
|
|
50
|
+
class: "border-transparent outline-none w-full pl-8 text-sm min-h-8 py-1.5",
|
|
51
|
+
label: "Example Name",
|
|
52
|
+
placeholder: "Example Name"
|
|
53
|
+
}, null, 512), [
|
|
54
|
+
[R, m.value]
|
|
55
|
+
])
|
|
56
|
+
]),
|
|
57
|
+
l("div", A, [
|
|
58
|
+
l("div", G, [
|
|
59
|
+
s(n(z), {
|
|
60
|
+
placement: "bottom",
|
|
61
|
+
resize: ""
|
|
62
|
+
}, {
|
|
63
|
+
items: r(() => [
|
|
64
|
+
l("div", J, [
|
|
65
|
+
(i(!0), f(V, null, q(n(S), (t) => (i(), W(n(T), {
|
|
66
|
+
key: t.uid,
|
|
67
|
+
class: "flex h-7 w-full items-center justify-between px-1 pr-[26px]",
|
|
68
|
+
onClick: (K) => p(t)
|
|
71
69
|
}, {
|
|
72
|
-
default:
|
|
73
|
-
c(
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}, null, 8, ["method"]),
|
|
78
|
-
a(s($), {
|
|
79
|
-
class: "text-c-3",
|
|
80
|
-
icon: "ChevronDown",
|
|
81
|
-
size: "xs"
|
|
82
|
-
})
|
|
83
|
-
])
|
|
70
|
+
default: r(() => [
|
|
71
|
+
c(x(t.summary) + " ", 1),
|
|
72
|
+
s(v, {
|
|
73
|
+
method: t.method
|
|
74
|
+
}, null, 8, ["method"])
|
|
84
75
|
]),
|
|
85
|
-
_:
|
|
86
|
-
})
|
|
87
|
-
])
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
76
|
+
_: 2
|
|
77
|
+
}, 1032, ["onClick"]))), 128))
|
|
78
|
+
])
|
|
79
|
+
]),
|
|
80
|
+
default: r(() => [
|
|
81
|
+
s(n(h), {
|
|
82
|
+
class: "justify-between p-2 max-h-8 w-full gap-1 text-xs hover:bg-b-2",
|
|
83
|
+
variant: "outlined",
|
|
84
|
+
onClick: o[1] || (o[1] = (t) => p(a.value))
|
|
85
|
+
}, {
|
|
86
|
+
default: r(() => [
|
|
87
|
+
c(x(a.value.summary) + " ", 1),
|
|
88
|
+
l("div", H, [
|
|
89
|
+
s(v, {
|
|
90
|
+
method: a.value.method
|
|
91
|
+
}, null, 8, ["method"]),
|
|
92
|
+
s(n(F), {
|
|
93
|
+
class: "text-c-3",
|
|
94
|
+
icon: "ChevronDown",
|
|
95
|
+
size: "xs"
|
|
96
|
+
})
|
|
97
|
+
])
|
|
98
|
+
]),
|
|
99
|
+
_: 1
|
|
100
|
+
})
|
|
97
101
|
]),
|
|
98
102
|
_: 1
|
|
99
103
|
})
|
|
100
|
-
])
|
|
101
|
-
|
|
102
|
-
|
|
104
|
+
]),
|
|
105
|
+
s(n(h), {
|
|
106
|
+
class: "max-h-8 text-xs p-0 px-3",
|
|
107
|
+
type: "submit",
|
|
108
|
+
onClick: $
|
|
109
|
+
}, {
|
|
110
|
+
default: r(() => [
|
|
111
|
+
c(" Create Example ")
|
|
112
|
+
]),
|
|
113
|
+
_: 1
|
|
114
|
+
})
|
|
115
|
+
])
|
|
116
|
+
], 32));
|
|
103
117
|
}
|
|
104
118
|
});
|
|
105
119
|
export {
|
|
106
|
-
|
|
120
|
+
ee as default
|
|
107
121
|
};
|
|
@@ -1,20 +1,7 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<
|
|
2
|
-
title: string;
|
|
3
|
-
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
4
2
|
close: () => void;
|
|
5
|
-
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<
|
|
6
|
-
title: string;
|
|
7
|
-
}>>> & {
|
|
3
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>> & {
|
|
8
4
|
onClose?: (() => any) | undefined;
|
|
9
5
|
}, {}, {}>;
|
|
10
6
|
export default _default;
|
|
11
|
-
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
12
|
-
type __VLS_TypePropsToOption<T> = {
|
|
13
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
14
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
15
|
-
} : {
|
|
16
|
-
type: import('vue').PropType<T[K]>;
|
|
17
|
-
required: true;
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
7
|
//# sourceMappingURL=CommandPaletteFolder.vue.d.ts.map
|