@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.
Files changed (182) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/dist/components/AddressBar/AddressBar.vue.d.ts.map +1 -1
  3. package/dist/components/AddressBar/AddressBar.vue.js +2 -2
  4. package/dist/components/AddressBar/AddressBar.vue2.js +80 -84
  5. package/dist/components/AddressBar/AddressBarHistory.vue.d.ts.map +1 -1
  6. package/dist/components/AddressBar/AddressBarHistory.vue.js +11 -10
  7. package/dist/components/AddressBar/AddressBarServer.vue.d.ts.map +1 -1
  8. package/dist/components/CodeInput/CodeInput.vue.d.ts +10 -0
  9. package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
  10. package/dist/components/CodeInput/CodeInput.vue.js +3 -2
  11. package/dist/components/CodeInput/CodeInput.vue2.js +42 -37
  12. package/dist/components/CodeInput/codeDropdownWidget.d.ts +24 -0
  13. package/dist/components/CodeInput/codeDropdownWidget.d.ts.map +1 -0
  14. package/dist/components/CodeInput/codeDropdownWidget.js +110 -0
  15. package/dist/components/CodeInput/codeVariableWidget.d.ts +8 -0
  16. package/dist/components/CodeInput/codeVariableWidget.d.ts.map +1 -0
  17. package/dist/components/CodeInput/codeVariableWidget.js +124 -0
  18. package/dist/components/CommandPalette/CommandPaletteCollection.vue.d.ts +2 -15
  19. package/dist/components/CommandPalette/CommandPaletteCollection.vue.d.ts.map +1 -1
  20. package/dist/components/CommandPalette/CommandPaletteCollection.vue.js +51 -54
  21. package/dist/components/CommandPalette/CommandPaletteExample.vue.d.ts +4 -2
  22. package/dist/components/CommandPalette/CommandPaletteExample.vue.d.ts.map +1 -1
  23. package/dist/components/CommandPalette/CommandPaletteExample.vue.js +106 -92
  24. package/dist/components/CommandPalette/CommandPaletteFolder.vue.d.ts +2 -15
  25. package/dist/components/CommandPalette/CommandPaletteFolder.vue.d.ts.map +1 -1
  26. package/dist/components/CommandPalette/CommandPaletteFolder.vue.js +68 -74
  27. package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts +2 -15
  28. package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts.map +1 -1
  29. package/dist/components/CommandPalette/CommandPaletteImport.vue.js +56 -62
  30. package/dist/components/CommandPalette/CommandPaletteRequest.vue.d.ts +2 -15
  31. package/dist/components/CommandPalette/CommandPaletteRequest.vue.d.ts.map +1 -1
  32. package/dist/components/CommandPalette/CommandPaletteRequest.vue.js +106 -99
  33. package/dist/components/CommandPalette/CommandPaletteWorkspace.vue.d.ts +7 -0
  34. package/dist/components/CommandPalette/CommandPaletteWorkspace.vue.d.ts.map +1 -0
  35. package/dist/components/CommandPalette/CommandPaletteWorkspace.vue.js +57 -0
  36. package/dist/components/CommandPalette/CommandPaletteWorkspace.vue2.js +4 -0
  37. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts +50 -0
  38. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -0
  39. package/dist/components/CommandPalette/TheCommandPalette.vue.js +9 -0
  40. package/dist/components/CommandPalette/TheCommandPalette.vue2.js +198 -0
  41. package/dist/components/CommandPalette/index.d.ts +2 -0
  42. package/dist/components/CommandPalette/index.d.ts.map +1 -0
  43. package/dist/components/CommandPalette/index.js +4 -0
  44. package/dist/components/ContextBar.vue.js +4 -4
  45. package/dist/components/DarkModeToggle/DarkModeIconToggle.vue.js +7 -6
  46. package/dist/components/DataTable/DataTableCheckbox.vue.d.ts.map +1 -1
  47. package/dist/components/DataTable/DataTableCheckbox.vue.js +3 -2
  48. package/dist/components/DataTable/DataTableInput.vue.d.ts +1 -1
  49. package/dist/components/DataTable/DataTableInput.vue.d.ts.map +1 -1
  50. package/dist/components/DataTable/DataTableInput.vue.js +3 -3
  51. package/dist/components/DataTable/DataTableInput.vue2.js +36 -49
  52. package/dist/components/DataTable/DataTableInputSelect.vue.d.ts.map +1 -1
  53. package/dist/components/DataTable/DataTableInputSelect.vue.js +15 -14
  54. package/dist/components/Search/SearchButton.vue.d.ts.map +1 -1
  55. package/dist/components/Search/SearchButton.vue.js +7 -6
  56. package/dist/components/SideNav/SideNav.vue.d.ts.map +1 -1
  57. package/dist/components/SideNav/SideNav.vue.js +26 -23
  58. package/dist/components/SideNav/SideNavLink.vue.d.ts +3 -2
  59. package/dist/components/SideNav/SideNavLink.vue.d.ts.map +1 -1
  60. package/dist/components/SideNav/SideNavLink.vue.js +18 -16
  61. package/dist/components/Sidebar/Sidebar.vue.d.ts +15 -2
  62. package/dist/components/Sidebar/Sidebar.vue.d.ts.map +1 -1
  63. package/dist/components/Sidebar/Sidebar.vue.js +14 -12
  64. package/dist/components/Sidebar/SidebarButton.vue.d.ts.map +1 -1
  65. package/dist/components/Sidebar/SidebarButton.vue.js +5 -5
  66. package/dist/components/Sidebar/SidebarListElementActions.vue.d.ts.map +1 -1
  67. package/dist/components/Sidebar/SidebarListElementActions.vue.js +2 -2
  68. package/dist/components/TopNav/TopNav.vue.d.ts.map +1 -1
  69. package/dist/components/TopNav/TopNav.vue.js +1 -1
  70. package/dist/components/TopNav/TopNav.vue2.js +31 -29
  71. package/dist/components/TopNav/TopNavItem.vue.d.ts +7 -3
  72. package/dist/components/TopNav/TopNavItem.vue.d.ts.map +1 -1
  73. package/dist/components/TopNav/TopNavItem.vue.js +2 -2
  74. package/dist/components/TopNav/TopNavItem.vue2.js +18 -18
  75. package/dist/components/ViewLayout/ViewLayout.vue.d.ts.map +1 -1
  76. package/dist/components/ViewLayout/ViewLayout.vue.js +1 -1
  77. package/dist/components/ViewLayout/ViewLayoutCollapse.vue.d.ts.map +1 -1
  78. package/dist/components/ViewLayout/ViewLayoutCollapse.vue.js +2 -1
  79. package/dist/constants.d.ts +13 -7
  80. package/dist/constants.d.ts.map +1 -1
  81. package/dist/constants.js +4 -4
  82. package/dist/index.d.ts +2 -4
  83. package/dist/index.d.ts.map +1 -1
  84. package/dist/index.js +11 -16
  85. package/dist/layouts/App/ApiClientApp.vue.d.ts.map +1 -0
  86. package/dist/layouts/App/ApiClientApp.vue.js +72 -0
  87. package/dist/{App → layouts/App}/createApiClientApp.d.ts +1 -1
  88. package/dist/layouts/App/createApiClientApp.d.ts.map +1 -0
  89. package/dist/{App → layouts/App}/createApiClientApp.js +2 -2
  90. package/dist/layouts/App/index.d.ts.map +1 -0
  91. package/dist/{Modal → layouts/Modal}/ApiClientModal.vue.d.ts +1 -0
  92. package/dist/layouts/Modal/ApiClientModal.vue.d.ts.map +1 -0
  93. package/dist/{Modal → layouts/Modal}/ApiClientModal.vue.js +2 -2
  94. package/dist/layouts/Modal/api-client-modal.d.ts.map +1 -0
  95. package/dist/{Modal → layouts/Modal}/api-client-modal.js +7 -7
  96. package/dist/layouts/Modal/index.d.ts.map +1 -0
  97. package/dist/libs/eventBusses/command-palette.d.ts +14 -0
  98. package/dist/libs/eventBusses/command-palette.d.ts.map +1 -0
  99. package/dist/libs/eventBusses/command-palette.js +5 -0
  100. package/dist/libs/local-storage.d.ts +1 -1
  101. package/dist/libs/local-storage.d.ts.map +1 -1
  102. package/dist/libs/local-storage.js +19 -19
  103. package/dist/router.d.ts +18 -6
  104. package/dist/router.d.ts.map +1 -1
  105. package/dist/router.js +107 -71
  106. package/dist/store/topNav.d.ts +94 -82
  107. package/dist/store/topNav.d.ts.map +1 -1
  108. package/dist/store/topNav.js +21 -20
  109. package/dist/store/workspace.d.ts +312 -82
  110. package/dist/store/workspace.d.ts.map +1 -1
  111. package/dist/store/workspace.js +299 -224
  112. package/dist/style.css +1 -1
  113. package/dist/views/Collection/Collection.vue.d.ts.map +1 -1
  114. package/dist/views/Components/Schemas/Schemas.vue.d.ts.map +1 -1
  115. package/dist/views/Cookies/Cookies.vue.d.ts.map +1 -1
  116. package/dist/views/Cookies/Cookies.vue2.js +9 -12
  117. package/dist/views/Environment/Environment.vue.d.ts.map +1 -1
  118. package/dist/views/Environment/Environment.vue2.js +22 -25
  119. package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts.map +1 -1
  120. package/dist/views/Environment/EnvironmentVariableDropdown.vue.js +38 -47
  121. package/dist/views/Request/Request.vue.d.ts.map +1 -1
  122. package/dist/views/Request/Request.vue.js +1 -1
  123. package/dist/views/Request/Request.vue2.js +125 -108
  124. package/dist/views/Request/RequestSection/RequestAuthDataTableInput.vue.d.ts +1 -1
  125. package/dist/views/Request/RequestSection/RequestAuthDataTableInput.vue.d.ts.map +1 -1
  126. package/dist/views/Request/RequestSection/RequestBody.vue.d.ts.map +1 -1
  127. package/dist/views/Request/RequestSection/RequestBody.vue.js +5 -4
  128. package/dist/views/Request/RequestSection/RequestSection.vue.js +3 -2
  129. package/dist/views/Request/RequestSection/RequestTable.vue.d.ts.map +1 -1
  130. package/dist/views/Request/RequestSection/RequestTable.vue.js +4 -4
  131. package/dist/views/Request/RequestSection/RequestTable.vue2.js +22 -21
  132. package/dist/views/Request/RequestSection/RequestTableTooltip.vue.d.ts.map +1 -1
  133. package/dist/views/Request/RequestSection/RequestTableTooltip.vue.js +6 -5
  134. package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
  135. package/dist/views/Request/RequestSidebarItem.vue.js +2 -2
  136. package/dist/views/Request/RequestSidebarItem.vue2.js +84 -79
  137. package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts.map +1 -1
  138. package/dist/views/Request/RequestSidebarItemMenu.vue.js +58 -38
  139. package/dist/views/Request/ResponseSection/ResponseSection.vue.d.ts.map +1 -1
  140. package/dist/views/Request/ResponseSection/ResponseSection.vue.js +3 -2
  141. package/dist/views/Request/components/OAuth2.vue.d.ts.map +1 -1
  142. package/dist/views/Request/components/OAuth2.vue.js +2 -0
  143. package/dist/{App.vue.d.ts → views/Request/components/WorkspaceDropdown.vue.d.ts} +1 -2
  144. package/dist/views/Request/components/WorkspaceDropdown.vue.d.ts.map +1 -0
  145. package/dist/views/Request/components/WorkspaceDropdown.vue.js +80 -0
  146. package/dist/views/Request/components/WorkspaceDropdown.vue2.js +4 -0
  147. package/dist/views/Request/components/index.d.ts +1 -0
  148. package/dist/views/Request/components/index.d.ts.map +1 -1
  149. package/dist/views/Request/components/index.js +4 -2
  150. package/dist/views/Servers/Servers.vue.d.ts.map +1 -1
  151. package/dist/views/Servers/Servers.vue2.js +12 -15
  152. package/package.json +19 -15
  153. package/dist/App/ApiClientApp.vue.d.ts.map +0 -1
  154. package/dist/App/ApiClientApp.vue.js +0 -56
  155. package/dist/App/createApiClientApp.d.ts.map +0 -1
  156. package/dist/App/index.d.ts.map +0 -1
  157. package/dist/App.vue.d.ts.map +0 -1
  158. package/dist/App.vue.js +0 -77
  159. package/dist/App.vue3.js +0 -5
  160. package/dist/Modal/ApiClientModal.vue.d.ts.map +0 -1
  161. package/dist/Modal/api-client-modal.d.ts.map +0 -1
  162. package/dist/Modal/index.d.ts.map +0 -1
  163. package/dist/components/AddressBar/AddressBarServer.vue.js +0 -106
  164. package/dist/components/AddressBar/AddressBarServer.vue2.js +0 -4
  165. package/dist/components/CommandPalette/CommandPalette.vue.d.ts +0 -17
  166. package/dist/components/CommandPalette/CommandPalette.vue.d.ts.map +0 -1
  167. package/dist/components/CommandPalette/CommandPalette.vue.js +0 -7
  168. package/dist/components/CommandPalette/CommandPalette.vue2.js +0 -184
  169. package/dist/main.d.ts +0 -2
  170. package/dist/main.d.ts.map +0 -1
  171. package/dist/views/Collection/Collection.vue.js +0 -4
  172. package/dist/views/Collection/Collection.vue2.js +0 -136
  173. package/dist/views/Components/Schemas/Schemas.vue.js +0 -4
  174. package/dist/views/Components/Schemas/Schemas.vue2.js +0 -20
  175. /package/dist/{App → layouts/App}/ApiClientApp.vue.d.ts +0 -0
  176. /package/dist/{App → layouts/App}/ApiClientApp.vue3.js +0 -0
  177. /package/dist/{App → layouts/App}/index.d.ts +0 -0
  178. /package/dist/{App → layouts/App}/index.js +0 -0
  179. /package/dist/{Modal → layouts/Modal}/ApiClientModal.vue2.js +0 -0
  180. /package/dist/{Modal → layouts/Modal}/api-client-modal.d.ts +0 -0
  181. /package/dist/{Modal → layouts/Modal}/index.d.ts +0 -0
  182. /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<__VLS_TypePropsToOption<{
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<__VLS_TypePropsToOption<{
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":";WAuES,MAAM;;;;WAAN,MAAM;;;;AAkIf,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
+ {"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 m, ref as s, onMounted as p, openBlock as d, createElementBlock as f, Fragment as h, createElementVNode as e, toDisplayString as x, withModifiers as _, withDirectives as b, vModelText as v, createVNode as w, unref as g, withCtx as C, createTextVNode as N } from "vue";
2
- import { useWorkspace as y } from "../../store/workspace.js";
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 M = { class: "gap-3 rounded bg-b-2 focus-within:bg-b-1 focus-within:shadow-border min-h-20 relative" }, S = /* @__PURE__ */ e("label", {
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), F = /* @__PURE__ */ m({
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(D, { emit: i }) {
14
- const a = i, { collectionMutators: c } = y(), l = s(""), r = () => {
15
- c.add({
16
- spec: {
17
- openapi: "3.1.0",
18
- info: {
19
- title: l.value,
20
- version: "0.0.1"
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
- }), a("close");
24
- }, o = s(null);
21
+ },
22
+ i.value.uid
23
+ ), a("close");
24
+ }, l = s(null);
25
25
  return p(() => {
26
- var t;
27
- (t = o.value) == null || t.focus();
28
- }), (t, n) => (d(), f(h, null, [
29
- e("h2", null, x(t.title), 1),
30
- e("form", {
31
- class: "flex w-full flex-col gap-3",
32
- onSubmit: _(r, ["prevent"])
33
- }, [
34
- e("div", M, [
35
- S,
36
- b(e("input", {
37
- id: "collectionanme",
38
- ref_key: "collectionInput",
39
- ref: o,
40
- "onUpdate:modelValue": n[0] || (n[0] = (u) => l.value = u),
41
- class: "border-transparent outline-none w-full pl-8 text-sm min-h-8 py-1.5",
42
- label: "Collection Name",
43
- placeholder: "Collection Name"
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
- ], 32)
61
- ], 64));
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
- F as default
62
+ W as default
66
63
  };
@@ -1,9 +1,11 @@
1
1
  declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<{
2
- title: string;
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
- title: string;
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":";WAyGS,MAAM;;;;WAAN,MAAM;;;;AAwQf,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
+ {"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 k, ref as i, onMounted as y, openBlock as m, createElementBlock as h, Fragment as v, createElementVNode as e, toDisplayString as u, withModifiers as C, withDirectives as S, vModelText as N, createVNode as a, unref as s, withCtx as n, renderList as V, createBlock as D, createTextVNode as c } from "vue";
2
- import _ from "../HttpMethod/HttpMethod.vue.js";
3
- import { useWorkspace as B } from "../../store/workspace.js";
4
- import { ScalarDropdown as E, ScalarDropdownItem as I, ScalarButton as w, ScalarIcon as $ } from "@scalar/components";
5
- const M = { class: "gap-3 rounded bg-b-2 focus-within:bg-b-1 focus-within:shadow-border min-h-20 relative" }, j = /* @__PURE__ */ e("label", {
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), z = { class: "flex gap-2" }, R = { class: "flex flex-1 max-h-8" }, T = { class: "flex items-center gap-2" }, F = { class: "max-h-40 custom-scroll" }, H = /* @__PURE__ */ k({
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
- title: {}
12
+ metaData: {}
12
13
  },
13
14
  emits: ["close"],
14
- setup(L, { emit: b }) {
15
- const g = b, { workspaceRequests: p } = B(), d = i(""), r = i(p.value[0]);
16
- function f(l) {
17
- r.value = l;
18
- }
19
- const x = i(null);
20
- return y(() => {
21
- var l;
22
- (l = x.value) == null || l.focus();
23
- }), (l, o) => (m(), h(v, null, [
24
- e("h2", null, u(l.title), 1),
25
- e("form", {
26
- class: "flex w-full flex-col gap-3",
27
- onSubmit: o[2] || (o[2] = C((t) => g("close"), ["prevent"]))
28
- }, [
29
- e("div", M, [
30
- j,
31
- S(e("input", {
32
- id: "examplename",
33
- ref_key: "exampleInput",
34
- ref: x,
35
- "onUpdate:modelValue": o[0] || (o[0] = (t) => d.value = t),
36
- class: "border-transparent outline-none w-full pl-8 text-sm min-h-8 py-1.5",
37
- label: "Variant Name",
38
- placeholder: "Variant Name"
39
- }, null, 512), [
40
- [N, d.value]
41
- ])
42
- ]),
43
- e("div", z, [
44
- e("div", R, [
45
- a(s(E), {
46
- placement: "bottom",
47
- resize: ""
48
- }, {
49
- items: n(() => [
50
- e("div", F, [
51
- (m(!0), h(v, null, V(s(p), (t) => (m(), D(s(I), {
52
- key: t.uid,
53
- class: "flex h-7 w-full items-center justify-between px-1 pr-[26px]",
54
- onClick: (P) => f(t)
55
- }, {
56
- default: n(() => [
57
- c(u(t.summary) + " ", 1),
58
- a(_, {
59
- method: t.method
60
- }, null, 8, ["method"])
61
- ]),
62
- _: 2
63
- }, 1032, ["onClick"]))), 128))
64
- ])
65
- ]),
66
- default: n(() => [
67
- a(s(w), {
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: n(() => [
73
- c(u(r.value.summary) + " ", 1),
74
- e("div", T, [
75
- a(_, {
76
- method: r.value.method
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
- _: 1
86
- })
87
- ]),
88
- _: 1
89
- })
90
- ]),
91
- a(s(w), {
92
- class: "max-h-8 text-xs p-0 px-3",
93
- type: "submit"
94
- }, {
95
- default: n(() => [
96
- c(" Create Example ")
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
- ], 32)
102
- ], 64));
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
- H as default
120
+ ee as default
107
121
  };
@@ -1,20 +1,7 @@
1
- declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<{
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<__VLS_TypePropsToOption<{
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