@scalar/api-client 2.0.24 → 2.0.26

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 (168) hide show
  1. package/CHANGELOG.md +39 -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 +79 -83
  5. package/dist/components/AddressBar/AddressBarHistory.vue.d.ts.map +1 -1
  6. package/dist/components/AddressBar/AddressBarHistory.vue.js +38 -38
  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 +2 -1
  11. package/dist/components/CodeInput/CodeInput.vue2.js +43 -38
  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/DataTable/DataTableInput.vue.d.ts +1 -1
  46. package/dist/components/DataTable/DataTableInput.vue.d.ts.map +1 -1
  47. package/dist/components/DataTable/DataTableInput.vue.js +3 -3
  48. package/dist/components/DataTable/DataTableInput.vue2.js +36 -49
  49. package/dist/components/SideNav/SideNav.vue.d.ts.map +1 -1
  50. package/dist/components/SideNav/SideNav.vue.js +26 -23
  51. package/dist/components/SideNav/SideNavLink.vue.d.ts +3 -2
  52. package/dist/components/SideNav/SideNavLink.vue.d.ts.map +1 -1
  53. package/dist/components/SideNav/SideNavLink.vue.js +5 -5
  54. package/dist/components/Sidebar/Sidebar.vue.d.ts +15 -2
  55. package/dist/components/Sidebar/Sidebar.vue.d.ts.map +1 -1
  56. package/dist/components/Sidebar/Sidebar.vue.js +14 -12
  57. package/dist/components/Sidebar/SidebarButton.vue.d.ts.map +1 -1
  58. package/dist/components/Sidebar/SidebarButton.vue.js +5 -5
  59. package/dist/components/TopNav/TopNav.vue.d.ts.map +1 -1
  60. package/dist/components/TopNav/TopNav.vue.js +2 -2
  61. package/dist/components/TopNav/TopNav.vue2.js +31 -28
  62. package/dist/components/TopNav/TopNavItem.vue.d.ts +7 -3
  63. package/dist/components/TopNav/TopNavItem.vue.d.ts.map +1 -1
  64. package/dist/components/TopNav/TopNavItem.vue.js +2 -2
  65. package/dist/components/TopNav/TopNavItem.vue2.js +16 -15
  66. package/dist/components/ViewLayout/ViewLayout.vue.d.ts.map +1 -1
  67. package/dist/components/ViewLayout/ViewLayout.vue.js +1 -1
  68. package/dist/components/ViewLayout/ViewLayoutCollapse.vue.d.ts.map +1 -1
  69. package/dist/components/ViewLayout/ViewLayoutCollapse.vue.js +2 -1
  70. package/dist/constants.d.ts +13 -7
  71. package/dist/constants.d.ts.map +1 -1
  72. package/dist/constants.js +4 -4
  73. package/dist/index.d.ts +3 -4
  74. package/dist/index.d.ts.map +1 -1
  75. package/dist/index.js +14 -16
  76. package/dist/layouts/App/ApiClientApp.vue.d.ts.map +1 -0
  77. package/dist/layouts/App/ApiClientApp.vue.js +72 -0
  78. package/dist/{App → layouts/App}/createApiClientApp.d.ts +1 -1
  79. package/dist/layouts/App/createApiClientApp.d.ts.map +1 -0
  80. package/dist/{App → layouts/App}/createApiClientApp.js +2 -2
  81. package/dist/layouts/App/index.d.ts.map +1 -0
  82. package/dist/{Modal → layouts/Modal}/ApiClientModal.vue.d.ts +1 -0
  83. package/dist/layouts/Modal/ApiClientModal.vue.d.ts.map +1 -0
  84. package/dist/{Modal → layouts/Modal}/ApiClientModal.vue.js +2 -2
  85. package/dist/{Modal → layouts/Modal}/api-client-modal.d.ts +1 -1
  86. package/dist/layouts/Modal/api-client-modal.d.ts.map +1 -0
  87. package/dist/{Modal → layouts/Modal}/api-client-modal.js +42 -42
  88. package/dist/layouts/Modal/index.d.ts.map +1 -0
  89. package/dist/libs/eventBusses/command-palette.d.ts +14 -0
  90. package/dist/libs/eventBusses/command-palette.d.ts.map +1 -0
  91. package/dist/libs/eventBusses/command-palette.js +5 -0
  92. package/dist/libs/local-storage.d.ts +1 -1
  93. package/dist/libs/local-storage.d.ts.map +1 -1
  94. package/dist/libs/local-storage.js +19 -19
  95. package/dist/router.d.ts +5 -10
  96. package/dist/router.d.ts.map +1 -1
  97. package/dist/router.js +23 -19
  98. package/dist/store/topNav.d.ts +94 -82
  99. package/dist/store/topNav.d.ts.map +1 -1
  100. package/dist/store/topNav.js +21 -20
  101. package/dist/store/workspace.d.ts +348 -94
  102. package/dist/store/workspace.d.ts.map +1 -1
  103. package/dist/store/workspace.js +314 -221
  104. package/dist/style.css +1 -1
  105. package/dist/views/Collection/Collection.vue.d.ts.map +1 -1
  106. package/dist/views/Components/Schemas/Schemas.vue.d.ts.map +1 -1
  107. package/dist/views/Cookies/Cookies.vue.d.ts.map +1 -1
  108. package/dist/views/Cookies/Cookies.vue2.js +27 -30
  109. package/dist/views/Environment/Environment.vue.d.ts.map +1 -1
  110. package/dist/views/Environment/Environment.vue2.js +22 -25
  111. package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts.map +1 -1
  112. package/dist/views/Environment/EnvironmentVariableDropdown.vue.js +38 -47
  113. package/dist/views/Request/Request.vue.d.ts.map +1 -1
  114. package/dist/views/Request/Request.vue.js +1 -1
  115. package/dist/views/Request/Request.vue2.js +130 -109
  116. package/dist/views/Request/RequestSection/RequestAuthDataTableInput.vue.d.ts +1 -1
  117. package/dist/views/Request/RequestSection/RequestAuthDataTableInput.vue.d.ts.map +1 -1
  118. package/dist/views/Request/RequestSection/RequestSection.vue.d.ts.map +1 -1
  119. package/dist/views/Request/RequestSection/RequestSection.vue.js +5 -4
  120. package/dist/views/Request/RequestSection/RequestTable.vue.d.ts.map +1 -1
  121. package/dist/views/Request/RequestSection/RequestTable.vue.js +1 -1
  122. package/dist/views/Request/RequestSection/RequestTable.vue2.js +19 -19
  123. package/dist/views/Request/RequestSection/RequestTableTooltip.vue.d.ts.map +1 -1
  124. package/dist/views/Request/RequestSection/RequestTableTooltip.vue.js +6 -5
  125. package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
  126. package/dist/views/Request/RequestSidebarItem.vue.js +2 -2
  127. package/dist/views/Request/RequestSidebarItem.vue2.js +78 -81
  128. package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts.map +1 -1
  129. package/dist/views/Request/RequestSidebarItemMenu.vue.js +60 -42
  130. package/dist/views/Request/ResponseSection/ResponseSection.vue.d.ts.map +1 -1
  131. package/dist/views/Request/ResponseSection/ResponseSection.vue.js +6 -5
  132. package/dist/views/Request/components/OAuth2.vue.d.ts.map +1 -1
  133. package/dist/views/Request/components/OAuth2.vue.js +2 -0
  134. package/dist/{App.vue.d.ts → views/Request/components/WorkspaceDropdown.vue.d.ts} +1 -2
  135. package/dist/views/Request/components/WorkspaceDropdown.vue.d.ts.map +1 -0
  136. package/dist/views/Request/components/WorkspaceDropdown.vue.js +80 -0
  137. package/dist/views/Request/components/WorkspaceDropdown.vue2.js +4 -0
  138. package/dist/views/Request/components/index.d.ts +1 -0
  139. package/dist/views/Request/components/index.d.ts.map +1 -1
  140. package/dist/views/Request/components/index.js +4 -2
  141. package/dist/views/Servers/Servers.vue.d.ts.map +1 -1
  142. package/dist/views/Servers/Servers.vue2.js +12 -15
  143. package/package.json +22 -18
  144. package/dist/App/ApiClientApp.vue.d.ts.map +0 -1
  145. package/dist/App/ApiClientApp.vue.js +0 -56
  146. package/dist/App/createApiClientApp.d.ts.map +0 -1
  147. package/dist/App/index.d.ts.map +0 -1
  148. package/dist/App.vue.d.ts.map +0 -1
  149. package/dist/App.vue.js +0 -77
  150. package/dist/App.vue3.js +0 -5
  151. package/dist/Modal/ApiClientModal.vue.d.ts.map +0 -1
  152. package/dist/Modal/api-client-modal.d.ts.map +0 -1
  153. package/dist/Modal/index.d.ts.map +0 -1
  154. package/dist/components/AddressBar/AddressBarServer.vue.js +0 -113
  155. package/dist/components/AddressBar/AddressBarServer.vue2.js +0 -4
  156. package/dist/components/CommandPalette/CommandPalette.vue.d.ts +0 -17
  157. package/dist/components/CommandPalette/CommandPalette.vue.d.ts.map +0 -1
  158. package/dist/components/CommandPalette/CommandPalette.vue.js +0 -7
  159. package/dist/components/CommandPalette/CommandPalette.vue2.js +0 -185
  160. package/dist/main.d.ts +0 -2
  161. package/dist/main.d.ts.map +0 -1
  162. /package/dist/{App → layouts/App}/ApiClientApp.vue.d.ts +0 -0
  163. /package/dist/{App → layouts/App}/ApiClientApp.vue3.js +0 -0
  164. /package/dist/{App → layouts/App}/index.d.ts +0 -0
  165. /package/dist/{App → layouts/App}/index.js +0 -0
  166. /package/dist/{Modal → layouts/Modal}/ApiClientModal.vue2.js +0 -0
  167. /package/dist/{Modal → layouts/Modal}/index.d.ts +0 -0
  168. /package/dist/{Modal → layouts/Modal}/index.js +0 -0
@@ -1,119 +1,126 @@
1
- import { defineComponent as y, ref as u, computed as v, onMounted as M, openBlock as V, createElementBlock as N, Fragment as R, createElementVNode as l, toDisplayString as h, withModifiers as I, withDirectives as k, vModelText as E, createVNode as s, unref as n, withCtx as c, normalizeClass as F, createTextVNode as U } from "vue";
2
- import B from "../HttpMethod/HttpMethod.vue.js";
3
- import { useWorkspace as D } from "../../store/workspace.js";
4
- import { ScalarListbox as T, ScalarButton as x, ScalarIcon as j } from "@scalar/components";
5
- import { useRouter as z } from "vue-router";
6
- const $ = { class: "gap-3 rounded bg-b-2 focus-within:bg-b-1 focus-within:shadow-border min-h-20 relative" }, G = /* @__PURE__ */ l("label", {
1
+ import { defineComponent as y, ref as n, computed as h, onMounted as V, openBlock as N, createElementBlock as R, withModifiers as I, createElementVNode as o, withDirectives as U, vModelText as E, createVNode as u, unref as r, withCtx as d, normalizeClass as B, toDisplayString as D, createTextVNode as F } from "vue";
2
+ import T from "../HttpMethod/HttpMethod.vue.js";
3
+ import { useWorkspace as W } from "../../store/workspace.js";
4
+ import { ScalarListbox as $, ScalarButton as x, ScalarIcon as z } from "@scalar/components";
5
+ import { useRouter as j } from "vue-router";
6
+ const G = { class: "gap-3 rounded bg-b-2 focus-within:bg-b-1 focus-within:shadow-border min-h-20 relative" }, L = /* @__PURE__ */ o("label", {
7
7
  class: "absolute w-full h-full opacity-0 cursor-text",
8
8
  for: "requestname"
9
- }, null, -1), L = { class: "flex" }, O = { class: "flex flex-1 gap-2 max-h-8" }, Q = /* @__PURE__ */ y({
9
+ }, null, -1), P = { class: "flex" }, A = { class: "flex flex-1 gap-2 max-h-8" }, Y = /* @__PURE__ */ y({
10
10
  __name: "CommandPaletteRequest",
11
- props: {
12
- title: {}
13
- },
14
11
  emits: ["close"],
15
- setup(P, { emit: b }) {
16
- const _ = b, { push: q } = z(), { requestMutators: g, activeCollection: r, folders: w } = D(), a = u(""), i = u("GET"), m = u(""), f = v(() => r.value ? Object.values(r.value.childUids).flatMap((e) => {
17
- const t = w[e];
18
- return t ? [
19
- {
20
- id: t.uid,
21
- label: t.name
22
- }
23
- ] : [];
24
- }) : []), o = v({
12
+ setup(H, { emit: b }) {
13
+ const _ = b, { push: q } = j(), {
14
+ activeCollection: c,
15
+ activeWorkspace: w,
16
+ activeWorkspaceCollections: g,
17
+ requestMutators: C,
18
+ folders: M
19
+ } = W(), s = n(""), i = n("GET"), m = n(""), f = h(
20
+ () => g.value.flatMap(
21
+ (e) => e.childUids.flatMap((l) => {
22
+ const t = M[l];
23
+ return t ? [
24
+ {
25
+ id: t.uid,
26
+ label: t.name
27
+ }
28
+ ] : [];
29
+ })
30
+ )
31
+ ), a = h({
25
32
  get: () => f.value.find(({ id: e }) => e === m.value),
26
33
  set: (e) => {
27
34
  e != null && e.id && (m.value = e.id);
28
35
  }
29
36
  });
30
- function C(e) {
37
+ function S(e) {
31
38
  i.value = e;
32
39
  }
33
- function S() {
34
- if (!r.value) return;
35
- const e = g.add({
36
- path: "",
37
- method: i.value.toUpperCase(),
38
- description: a.value,
39
- operationId: a.value,
40
- summary: a.value,
41
- tags: ["default"]
42
- });
43
- q(`/request/${e.uid}`), _("close");
44
- }
45
- const p = u(null);
46
- return M(() => {
40
+ const k = () => {
41
+ var t, v;
42
+ if (!c.value) return;
43
+ const e = ((t = a.value) == null ? void 0 : t.id) ?? ((v = c.value) == null ? void 0 : v.uid), l = C.add(
44
+ {
45
+ path: "",
46
+ method: i.value.toUpperCase(),
47
+ description: s.value,
48
+ operationId: s.value,
49
+ summary: s.value,
50
+ tags: ["default"]
51
+ },
52
+ e
53
+ );
54
+ q(`/workspace/${w.value.uid}/request/${l.uid}`), _("close");
55
+ }, p = n(null);
56
+ return V(() => {
47
57
  var e;
48
58
  (e = p.value) == null || e.focus();
49
- }), (e, t) => (V(), N(R, null, [
50
- l("h2", null, h(e.title), 1),
51
- l("form", {
52
- class: "flex w-full flex-col gap-3",
53
- onSubmit: I(S, ["prevent"])
54
- }, [
55
- l("div", $, [
56
- G,
57
- k(l("input", {
58
- id: "requestname",
59
- ref_key: "requestInput",
60
- ref: p,
61
- "onUpdate:modelValue": t[0] || (t[0] = (d) => a.value = d),
62
- class: "border-transparent outline-none w-full pl-8 text-sm min-h-8 py-1.5",
63
- label: "Request Name",
64
- placeholder: "Request Name"
65
- }, null, 512), [
66
- [E, a.value]
67
- ])
68
- ]),
69
- l("div", L, [
70
- l("div", O, [
71
- s(B, {
72
- isEditable: !0,
73
- isSquare: "",
74
- method: i.value,
75
- onChange: C
76
- }, null, 8, ["method"]),
77
- s(n(T), {
78
- modelValue: o.value,
79
- "onUpdate:modelValue": t[1] || (t[1] = (d) => o.value = d),
80
- options: f.value
81
- }, {
82
- default: c(() => [
83
- s(n(x), {
84
- class: "justify-between p-2 max-h-8 w-full gap-1 text-xs hover:bg-b-2",
85
- variant: "outlined"
86
- }, {
87
- default: c(() => [
88
- l("span", {
89
- class: F(o.value ? "text-c-1" : "text-c-3")
90
- }, h(o.value ? o.value.label : "Select Folder"), 3),
91
- s(n(j), {
92
- class: "text-c-3",
93
- icon: "ChevronDown",
94
- size: "xs"
95
- })
96
- ]),
97
- _: 1
98
- })
99
- ]),
100
- _: 1
101
- }, 8, ["modelValue", "options"])
102
- ]),
103
- s(n(x), {
104
- class: "max-h-8 text-xs p-0 px-3",
105
- type: "submit"
59
+ }), (e, l) => (N(), R("form", {
60
+ class: "flex w-full flex-col gap-3",
61
+ onSubmit: I(k, ["prevent"])
62
+ }, [
63
+ o("div", G, [
64
+ L,
65
+ U(o("input", {
66
+ id: "requestname",
67
+ ref_key: "requestInput",
68
+ ref: p,
69
+ "onUpdate:modelValue": l[0] || (l[0] = (t) => s.value = t),
70
+ class: "border-transparent outline-none w-full pl-8 text-sm min-h-8 py-1.5",
71
+ label: "Request Name",
72
+ placeholder: "Request Name"
73
+ }, null, 512), [
74
+ [E, s.value]
75
+ ])
76
+ ]),
77
+ o("div", P, [
78
+ o("div", A, [
79
+ u(T, {
80
+ isEditable: !0,
81
+ isSquare: "",
82
+ method: i.value,
83
+ onChange: S
84
+ }, null, 8, ["method"]),
85
+ u(r($), {
86
+ modelValue: a.value,
87
+ "onUpdate:modelValue": l[1] || (l[1] = (t) => a.value = t),
88
+ options: f.value
106
89
  }, {
107
- default: c(() => [
108
- U(" Create Request ")
90
+ default: d(() => [
91
+ u(r(x), {
92
+ class: "justify-between p-2 max-h-8 w-full gap-1 text-xs hover:bg-b-2",
93
+ variant: "outlined"
94
+ }, {
95
+ default: d(() => [
96
+ o("span", {
97
+ class: B(a.value ? "text-c-1" : "text-c-3")
98
+ }, D(a.value ? a.value.label : "Select Folder"), 3),
99
+ u(r(z), {
100
+ class: "text-c-3",
101
+ icon: "ChevronDown",
102
+ size: "xs"
103
+ })
104
+ ]),
105
+ _: 1
106
+ })
109
107
  ]),
110
108
  _: 1
111
- })
112
- ])
113
- ], 32)
114
- ], 64));
109
+ }, 8, ["modelValue", "options"])
110
+ ]),
111
+ u(r(x), {
112
+ class: "max-h-8 text-xs p-0 px-3",
113
+ type: "submit"
114
+ }, {
115
+ default: d(() => [
116
+ F(" Create Request ")
117
+ ]),
118
+ _: 1
119
+ })
120
+ ])
121
+ ], 32));
115
122
  }
116
123
  });
117
124
  export {
118
- Q as default
125
+ Y as default
119
126
  };
@@ -0,0 +1,7 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
2
+ close: () => void;
3
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>> & {
4
+ onClose?: (() => any) | undefined;
5
+ }, {}, {}>;
6
+ export default _default;
7
+ //# sourceMappingURL=CommandPaletteWorkspace.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CommandPaletteWorkspace.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandPaletteWorkspace.vue"],"names":[],"mappings":";;;;;AAqLA,wBAMG"}
@@ -0,0 +1,57 @@
1
+ import { defineComponent as m, ref as l, onMounted as d, openBlock as f, createElementBlock as h, withModifiers as w, createElementVNode as o, withDirectives as x, vModelText as _, createVNode as k, unref as b, withCtx as v, createTextVNode as N } from "vue";
2
+ import { useWorkspace as g } from "../../store/workspace.js";
3
+ import { ScalarButton as y } from "@scalar/components";
4
+ import { useRouter as C } from "vue-router";
5
+ const M = { class: "gap-3 rounded bg-b-2 focus-within:bg-b-1 focus-within:shadow-border min-h-20 relative" }, V = /* @__PURE__ */ o("label", {
6
+ class: "absolute w-full h-full opacity-0 cursor-text",
7
+ for: "workspacename"
8
+ }, null, -1), W = { class: "flex" }, B = /* @__PURE__ */ o("div", { class: "flex flex-1 gap-2 max-h-8" }, null, -1), P = /* @__PURE__ */ m({
9
+ __name: "CommandPaletteWorkspace",
10
+ emits: ["close"],
11
+ setup(S, { emit: n }) {
12
+ const r = n, { push: c } = C(), { workspaceMutators: u } = g(), t = l(""), i = () => {
13
+ const e = u.add({
14
+ name: t.value
15
+ });
16
+ c(`/workspace/${e.uid}`), r("close");
17
+ }, s = l(null);
18
+ return d(() => {
19
+ var e;
20
+ (e = s.value) == null || e.focus();
21
+ }), (e, a) => (f(), h("form", {
22
+ class: "flex w-full flex-col gap-3",
23
+ onSubmit: w(i, ["prevent"])
24
+ }, [
25
+ o("div", M, [
26
+ V,
27
+ x(o("input", {
28
+ id: "workspacename",
29
+ ref_key: "workspaceInput",
30
+ ref: s,
31
+ "onUpdate:modelValue": a[0] || (a[0] = (p) => t.value = p),
32
+ autofocus: "",
33
+ class: "border-transparent outline-none w-full pl-8 text-sm min-h-8 py-1.5",
34
+ label: "Workspace Name",
35
+ placeholder: "Workspace Name"
36
+ }, null, 512), [
37
+ [_, t.value]
38
+ ])
39
+ ]),
40
+ o("div", W, [
41
+ B,
42
+ k(b(y), {
43
+ class: "max-h-8 text-xs p-0 px-3",
44
+ type: "submit"
45
+ }, {
46
+ default: v(() => [
47
+ N(" Continue ")
48
+ ]),
49
+ _: 1
50
+ })
51
+ ])
52
+ ], 32));
53
+ }
54
+ });
55
+ export {
56
+ P as default
57
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./CommandPaletteWorkspace.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,50 @@
1
+ /**
2
+ * The Command Palette
3
+ *
4
+ * This component is a singleton so should only exist in our app once we will use the event bus to trigger it
5
+ */
6
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
7
+ export default _default;
8
+ export declare const PaletteComponents: {
9
+ readonly 'Import Collection': import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
10
+ close: () => void;
11
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>> & {
12
+ onClose?: (() => any) | undefined;
13
+ }, {}, {}>;
14
+ readonly 'Create Request': import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
15
+ close: () => void;
16
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>> & {
17
+ onClose?: (() => any) | undefined;
18
+ }, {}, {}>;
19
+ readonly 'Create Workspace': import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
20
+ close: () => void;
21
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>> & {
22
+ onClose?: (() => any) | undefined;
23
+ }, {}, {}>;
24
+ readonly 'Add Folder': import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
25
+ close: () => void;
26
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>> & {
27
+ onClose?: (() => any) | undefined;
28
+ }, {}, {}>;
29
+ readonly 'Create Collection': import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
30
+ close: () => void;
31
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>> & {
32
+ onClose?: (() => any) | undefined;
33
+ }, {}, {}>;
34
+ readonly 'Add Example': import("vue").DefineComponent<{
35
+ metaData: {
36
+ type: import("vue").PropType<string>;
37
+ };
38
+ }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
39
+ close: () => void;
40
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
41
+ metaData: {
42
+ type: import("vue").PropType<string>;
43
+ };
44
+ }>> & {
45
+ onClose?: (() => any) | undefined;
46
+ }, {}, {}>;
47
+ };
48
+ /** Infer the types from the commands */
49
+ export type CommandNames = keyof typeof PaletteComponents;
50
+ //# sourceMappingURL=TheCommandPalette.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TheCommandPalette.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/TheCommandPalette.vue"],"names":[],"mappings":"AAqWA;;;;GAIG;;AACH,wBA8XI;AAEJ,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOpB,CAAA;AAEV,yCAAyC;AACzC,MAAM,MAAM,YAAY,GAAG,MAAM,OAAO,iBAAiB,CACxD"}
@@ -0,0 +1,9 @@
1
+ import o from "./TheCommandPalette.vue2.js";
2
+ import { PaletteComponents as f } from "./TheCommandPalette.vue2.js";
3
+ /* empty css */
4
+ import t from "../../_virtual/_plugin-vue_export-helper.js";
5
+ const r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-caaeb4c4"]]);
6
+ export {
7
+ f as PaletteComponents,
8
+ r as default
9
+ };
@@ -0,0 +1,198 @@
1
+ import { defineComponent as z, ref as d, computed as I, onMounted as M, onBeforeUnmount as P, openBlock as r, createElementBlock as s, Fragment as u, withDirectives as h, createElementVNode as m, vShow as A, unref as v, createVNode as $, vModelText as F, renderList as R, toDisplayString as E, normalizeClass as q, createTextVNode as N, createBlock as T, resolveDynamicComponent as U } from "vue";
2
+ import { useModal as G, ScalarIcon as S } from "@scalar/components";
3
+ import { useMagicKeys as H, whenever as C } from "@vueuse/core";
4
+ import { useRouter as K } from "vue-router";
5
+ import { commandPaletteBus as B } from "../../libs/eventBusses/command-palette.js";
6
+ import { useWorkspace as Q } from "../../store/workspace.js";
7
+ import j from "./CommandPaletteCollection.vue.js";
8
+ import J from "./CommandPaletteExample.vue.js";
9
+ import O from "./CommandPaletteFolder.vue.js";
10
+ import X from "./CommandPaletteImport.vue.js";
11
+ import Y from "./CommandPaletteRequest.vue.js";
12
+ import Z from "./CommandPaletteWorkspace.vue.js";
13
+ const ee = { class: "commandmenu" }, oe = { class: "bg-b-2 flex items-center rounded mb-2 pl-2 focus-within:bg-b-1 focus-within:shadow-border" }, te = { for: "commandmenu" }, ne = ["onClick"], ae = {
14
+ name: "TheCommandPalette"
15
+ }, le = {
16
+ "Import Collection": X,
17
+ "Create Request": Y,
18
+ "Create Workspace": Z,
19
+ "Add Folder": O,
20
+ "Create Collection": j,
21
+ "Add Example": J
22
+ }, ke = /* @__PURE__ */ z({
23
+ ...ae,
24
+ setup(re) {
25
+ const b = [
26
+ {
27
+ label: "Add to Request Sidebar",
28
+ commands: [
29
+ {
30
+ name: "Create Request",
31
+ icon: "ExternalLink"
32
+ },
33
+ {
34
+ name: "Import Collection",
35
+ icon: "Import"
36
+ },
37
+ {
38
+ name: "Add Folder",
39
+ icon: "Folder"
40
+ },
41
+ {
42
+ name: "Create Collection",
43
+ icon: "Collection"
44
+ },
45
+ {
46
+ name: "Add Example",
47
+ icon: "Example"
48
+ }
49
+ ]
50
+ },
51
+ {
52
+ label: "More Actions",
53
+ commands: [
54
+ {
55
+ name: "Create Workspace",
56
+ icon: "Workspace"
57
+ },
58
+ {
59
+ name: "Add Server",
60
+ icon: "Brackets",
61
+ path: "/servers"
62
+ },
63
+ {
64
+ name: "Add Environment",
65
+ icon: "Server",
66
+ path: "/environment"
67
+ },
68
+ {
69
+ name: "Add Cookie",
70
+ icon: "Cookie",
71
+ path: "/cookies"
72
+ }
73
+ ]
74
+ }
75
+ ], p = H(), a = G(), { push: V } = K(), { activeWorkspace: W } = Q(), g = d(), c = d(""), i = d(null), o = d(0), k = d([]), _ = I(
76
+ () => b.reduce((e, t) => {
77
+ const n = t.commands.filter(
78
+ (f) => f.name.toLowerCase().includes(c.value.toLowerCase())
79
+ );
80
+ return [...e, ...n];
81
+ }, [])
82
+ ), w = () => {
83
+ a.hide(), c.value = "", i.value = null;
84
+ };
85
+ C(p.escape, () => {
86
+ a.open && a.hide();
87
+ }), C(p.enter, () => {
88
+ if (!a.open) return;
89
+ const e = _.value[o.value];
90
+ L(e);
91
+ }), C(p.ArrowDown, () => {
92
+ var e;
93
+ a.open && (o.value < _.value.length - 1 ? o.value++ : o.value = 0, (e = k.value[o.value]) == null || e.scrollIntoView({
94
+ behavior: "smooth",
95
+ block: "center"
96
+ }));
97
+ }), C(p.ArrowUp, () => {
98
+ var e;
99
+ a.open && (o.value > 0 ? o.value-- : o.value = _.value.length - 1, (e = k.value[o.value]) == null || e.scrollIntoView({
100
+ behavior: "smooth",
101
+ block: "center"
102
+ }));
103
+ });
104
+ const L = (e) => {
105
+ "path" in e ? (V(`/workspace/${W.value.uid}${e.path}`), w()) : i.value = e.name;
106
+ }, D = ({
107
+ commandName: e,
108
+ metaData: t
109
+ } = {}) => {
110
+ i.value = e ?? null, g.value = t, a.show();
111
+ };
112
+ return M(() => B.on(D)), P(() => B.off(D)), (e, t) => (r(), s(u, null, [
113
+ h(m("div", {
114
+ class: "commandmenu-clickout",
115
+ onClick: t[0] || (t[0] = (n) => w())
116
+ }, null, 512), [
117
+ [A, v(a).open]
118
+ ]),
119
+ h(m("div", ee, [
120
+ i.value ? (r(), s(u, { key: 1 }, [
121
+ m("button", {
122
+ class: "absolute p-1 hover:bg-b-3 rounded text-c-3 active:text-c-1 m-1.5 z-10",
123
+ type: "button",
124
+ onClick: t[2] || (t[2] = (n) => i.value = null)
125
+ }, [
126
+ $(v(S), {
127
+ icon: "ChevronLeft",
128
+ size: "sm"
129
+ })
130
+ ]),
131
+ (r(), T(U(le[i.value]), {
132
+ metaData: g.value,
133
+ onClose: w
134
+ }, null, 40, ["metaData"]))
135
+ ], 64)) : (r(), s(u, { key: 0 }, [
136
+ m("div", oe, [
137
+ m("label", te, [
138
+ $(v(S), {
139
+ class: "text-c-1 mr-2.5",
140
+ icon: "Search",
141
+ size: "sm",
142
+ thickness: "1.5"
143
+ })
144
+ ]),
145
+ h(m("input", {
146
+ id: "commandmenu",
147
+ "onUpdate:modelValue": t[1] || (t[1] = (n) => c.value = n),
148
+ class: "w-full rounded bg-none border-none py-1.5 text-sm focus:outline-none",
149
+ placeholder: "Search commands...",
150
+ type: "text"
151
+ }, null, 512), [
152
+ [F, c.value]
153
+ ])
154
+ ]),
155
+ (r(), s(u, null, R(b, (n, f) => (r(), s(u, {
156
+ key: n.label
157
+ }, [
158
+ h(m("div", { class: "text-c-3 font-medium text-xs mt-2" }, E(n.label), 513), [
159
+ [
160
+ A,
161
+ n.commands.filter(
162
+ (l) => l.name.toLowerCase().includes(c.value.toLowerCase())
163
+ ).length > 0
164
+ ]
165
+ ]),
166
+ (r(!0), s(u, null, R(n.commands.filter(
167
+ (l) => l.name.toLowerCase().includes(c.value.toLowerCase())
168
+ ), (l, x) => (r(), s("div", {
169
+ key: l.name,
170
+ ref_for: !0,
171
+ ref: (y) => {
172
+ y && (k.value[x] = y);
173
+ },
174
+ class: q(["commandmenu-item text-sm flex items-center py-1.5 px-2 rounded hover:bg-b-2 cursor-pointer", {
175
+ "bg-b-2": f > 0 ? o.value === x + b[f - 1].commands.length : o.value === x
176
+ }]),
177
+ onClick: (y) => L(l)
178
+ }, [
179
+ $(v(S), {
180
+ class: "text-c-1 mr-2.5",
181
+ icon: l.icon,
182
+ size: "md",
183
+ thickness: "1.5"
184
+ }, null, 8, ["icon"]),
185
+ N(" " + E(l.name), 1)
186
+ ], 10, ne))), 128))
187
+ ], 64))), 64))
188
+ ], 64))
189
+ ], 512), [
190
+ [A, v(a).open]
191
+ ])
192
+ ], 64));
193
+ }
194
+ });
195
+ export {
196
+ le as PaletteComponents,
197
+ ke as default
198
+ };
@@ -0,0 +1,2 @@
1
+ export { default as TheCommandPalette } from './TheCommandPalette.vue.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,yBAAyB,CAAA"}
@@ -0,0 +1,4 @@
1
+ import { default as t } from "./TheCommandPalette.vue.js";
2
+ export {
3
+ t as TheCommandPalette
4
+ };
@@ -1,17 +1,17 @@
1
1
  import { defineComponent as r, openBlock as n, createElementBlock as o, Fragment as i, renderList as s, normalizeClass as c, toDisplayString as a } from "vue";
2
- const b = { class: "request-section-content request-section-content-filter bg-b-2 text-c-3 bg-b-1 sticky top-0 z-10 mb-2.5 hidden xl:flex justify-center rounded p-[2.25px] text-xs gap-0.5" }, l = ["isActive", "onClick"], v = /* @__PURE__ */ r({
2
+ const p = { class: "request-section-content request-section-content-filter bg-b-2 text-c-3 bg-b-1 sticky top-0 z-10 mb-2.5 hidden xl:flex justify-center rounded p-[2.25px] text-xs gap-0.5" }, l = ["isActive", "onClick"], v = /* @__PURE__ */ r({
3
3
  __name: "ContextBar",
4
4
  props: {
5
5
  sections: {},
6
6
  activeSection: {}
7
7
  },
8
8
  emits: ["setActiveSection"],
9
- setup(p) {
10
- return (t, d) => (n(), o("div", b, [
9
+ setup(d) {
10
+ return (t, b) => (n(), o("div", p, [
11
11
  (n(!0), o(i, null, s(t.sections, (e) => (n(), o("button", {
12
12
  key: e,
13
13
  class: c(["hover:bg-b-3 w-full rounded px-1 py-1 text-center font-medium", [
14
- t.activeSection === e ? "!bg-b-1 text-c-1 dark:bg-b-3 border hover:bg-b-1" : "border border-transparent"
14
+ t.activeSection === e ? "bg-b-1 text-c-1 dark:bg-b-3 border pointer-events-none" : "border border-transparent"
15
15
  ]]),
16
16
  isActive: t.activeSection === e,
17
17
  type: "button",
@@ -42,8 +42,8 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<
42
42
  onInputFocus?: (() => any) | undefined;
43
43
  onInputBlur?: (() => any) | undefined;
44
44
  }, {
45
- readOnly: boolean;
46
45
  required: boolean;
46
+ readOnly: boolean;
47
47
  }, {}>;
48
48
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
49
49
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"file":"Data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AAC,CAAA;KAAC,CAAC,GACvC,CAAC,CAAC,CAAC,CAAC;CACP,CAAC;AAEN,KAAK,cAAc,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC;AAExD,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACpC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC;AAEN,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,7 +1,7 @@
1
1
  import t from "./DataTableInput.vue2.js";
2
2
  /* empty css */
3
- import o from "../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ o(t, [["__scopeId", "data-v-266b624d"]]);
3
+ import a from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const f = /* @__PURE__ */ a(t, [["__scopeId", "data-v-7949fbac"]]);
5
5
  export {
6
- m as default
6
+ f as default
7
7
  };