@scalar/api-client 2.0.24 → 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 (166) hide show
  1. package/CHANGELOG.md +26 -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/AddressBarServer.vue.d.ts.map +1 -1
  6. package/dist/components/CodeInput/CodeInput.vue.d.ts +10 -0
  7. package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
  8. package/dist/components/CodeInput/CodeInput.vue.js +3 -2
  9. package/dist/components/CodeInput/CodeInput.vue2.js +42 -37
  10. package/dist/components/CodeInput/codeDropdownWidget.d.ts +24 -0
  11. package/dist/components/CodeInput/codeDropdownWidget.d.ts.map +1 -0
  12. package/dist/components/CodeInput/codeDropdownWidget.js +110 -0
  13. package/dist/components/CodeInput/codeVariableWidget.d.ts +8 -0
  14. package/dist/components/CodeInput/codeVariableWidget.d.ts.map +1 -0
  15. package/dist/components/CodeInput/codeVariableWidget.js +124 -0
  16. package/dist/components/CommandPalette/CommandPaletteCollection.vue.d.ts +2 -15
  17. package/dist/components/CommandPalette/CommandPaletteCollection.vue.d.ts.map +1 -1
  18. package/dist/components/CommandPalette/CommandPaletteCollection.vue.js +51 -54
  19. package/dist/components/CommandPalette/CommandPaletteExample.vue.d.ts +4 -2
  20. package/dist/components/CommandPalette/CommandPaletteExample.vue.d.ts.map +1 -1
  21. package/dist/components/CommandPalette/CommandPaletteExample.vue.js +106 -92
  22. package/dist/components/CommandPalette/CommandPaletteFolder.vue.d.ts +2 -15
  23. package/dist/components/CommandPalette/CommandPaletteFolder.vue.d.ts.map +1 -1
  24. package/dist/components/CommandPalette/CommandPaletteFolder.vue.js +68 -74
  25. package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts +2 -15
  26. package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts.map +1 -1
  27. package/dist/components/CommandPalette/CommandPaletteImport.vue.js +56 -62
  28. package/dist/components/CommandPalette/CommandPaletteRequest.vue.d.ts +2 -15
  29. package/dist/components/CommandPalette/CommandPaletteRequest.vue.d.ts.map +1 -1
  30. package/dist/components/CommandPalette/CommandPaletteRequest.vue.js +106 -99
  31. package/dist/components/CommandPalette/CommandPaletteWorkspace.vue.d.ts +7 -0
  32. package/dist/components/CommandPalette/CommandPaletteWorkspace.vue.d.ts.map +1 -0
  33. package/dist/components/CommandPalette/CommandPaletteWorkspace.vue.js +57 -0
  34. package/dist/components/CommandPalette/CommandPaletteWorkspace.vue2.js +4 -0
  35. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts +50 -0
  36. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -0
  37. package/dist/components/CommandPalette/TheCommandPalette.vue.js +9 -0
  38. package/dist/components/CommandPalette/TheCommandPalette.vue2.js +198 -0
  39. package/dist/components/CommandPalette/index.d.ts +2 -0
  40. package/dist/components/CommandPalette/index.d.ts.map +1 -0
  41. package/dist/components/CommandPalette/index.js +4 -0
  42. package/dist/components/ContextBar.vue.js +4 -4
  43. package/dist/components/DataTable/DataTableInput.vue.d.ts +1 -1
  44. package/dist/components/DataTable/DataTableInput.vue.d.ts.map +1 -1
  45. package/dist/components/DataTable/DataTableInput.vue.js +3 -3
  46. package/dist/components/DataTable/DataTableInput.vue2.js +36 -49
  47. package/dist/components/SideNav/SideNav.vue.d.ts.map +1 -1
  48. package/dist/components/SideNav/SideNav.vue.js +26 -23
  49. package/dist/components/SideNav/SideNavLink.vue.d.ts +3 -2
  50. package/dist/components/SideNav/SideNavLink.vue.d.ts.map +1 -1
  51. package/dist/components/SideNav/SideNavLink.vue.js +5 -5
  52. package/dist/components/Sidebar/Sidebar.vue.d.ts +15 -2
  53. package/dist/components/Sidebar/Sidebar.vue.d.ts.map +1 -1
  54. package/dist/components/Sidebar/Sidebar.vue.js +14 -12
  55. package/dist/components/Sidebar/SidebarButton.vue.d.ts.map +1 -1
  56. package/dist/components/Sidebar/SidebarButton.vue.js +5 -5
  57. package/dist/components/TopNav/TopNav.vue.d.ts.map +1 -1
  58. package/dist/components/TopNav/TopNav.vue.js +2 -2
  59. package/dist/components/TopNav/TopNav.vue2.js +31 -28
  60. package/dist/components/TopNav/TopNavItem.vue.d.ts +7 -3
  61. package/dist/components/TopNav/TopNavItem.vue.d.ts.map +1 -1
  62. package/dist/components/TopNav/TopNavItem.vue.js +2 -2
  63. package/dist/components/TopNav/TopNavItem.vue2.js +16 -15
  64. package/dist/components/ViewLayout/ViewLayout.vue.d.ts.map +1 -1
  65. package/dist/components/ViewLayout/ViewLayout.vue.js +1 -1
  66. package/dist/components/ViewLayout/ViewLayoutCollapse.vue.d.ts.map +1 -1
  67. package/dist/components/ViewLayout/ViewLayoutCollapse.vue.js +2 -1
  68. package/dist/constants.d.ts +13 -7
  69. package/dist/constants.d.ts.map +1 -1
  70. package/dist/constants.js +4 -4
  71. package/dist/index.d.ts +2 -4
  72. package/dist/index.d.ts.map +1 -1
  73. package/dist/index.js +11 -16
  74. package/dist/layouts/App/ApiClientApp.vue.d.ts.map +1 -0
  75. package/dist/layouts/App/ApiClientApp.vue.js +72 -0
  76. package/dist/{App → layouts/App}/createApiClientApp.d.ts +1 -1
  77. package/dist/layouts/App/createApiClientApp.d.ts.map +1 -0
  78. package/dist/{App → layouts/App}/createApiClientApp.js +2 -2
  79. package/dist/layouts/App/index.d.ts.map +1 -0
  80. package/dist/{Modal → layouts/Modal}/ApiClientModal.vue.d.ts +1 -0
  81. package/dist/layouts/Modal/ApiClientModal.vue.d.ts.map +1 -0
  82. package/dist/{Modal → layouts/Modal}/ApiClientModal.vue.js +2 -2
  83. package/dist/layouts/Modal/api-client-modal.d.ts.map +1 -0
  84. package/dist/{Modal → layouts/Modal}/api-client-modal.js +2 -2
  85. package/dist/layouts/Modal/index.d.ts.map +1 -0
  86. package/dist/libs/eventBusses/command-palette.d.ts +14 -0
  87. package/dist/libs/eventBusses/command-palette.d.ts.map +1 -0
  88. package/dist/libs/eventBusses/command-palette.js +5 -0
  89. package/dist/libs/local-storage.d.ts +1 -1
  90. package/dist/libs/local-storage.d.ts.map +1 -1
  91. package/dist/libs/local-storage.js +19 -19
  92. package/dist/router.d.ts +5 -10
  93. package/dist/router.d.ts.map +1 -1
  94. package/dist/router.js +23 -19
  95. package/dist/store/topNav.d.ts +94 -82
  96. package/dist/store/topNav.d.ts.map +1 -1
  97. package/dist/store/topNav.js +21 -20
  98. package/dist/store/workspace.d.ts +314 -84
  99. package/dist/store/workspace.d.ts.map +1 -1
  100. package/dist/store/workspace.js +299 -220
  101. package/dist/style.css +1 -1
  102. package/dist/views/Collection/Collection.vue.d.ts.map +1 -1
  103. package/dist/views/Components/Schemas/Schemas.vue.d.ts.map +1 -1
  104. package/dist/views/Cookies/Cookies.vue.d.ts.map +1 -1
  105. package/dist/views/Cookies/Cookies.vue2.js +9 -12
  106. package/dist/views/Environment/Environment.vue.d.ts.map +1 -1
  107. package/dist/views/Environment/Environment.vue2.js +22 -25
  108. package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts.map +1 -1
  109. package/dist/views/Environment/EnvironmentVariableDropdown.vue.js +38 -47
  110. package/dist/views/Request/Request.vue.d.ts.map +1 -1
  111. package/dist/views/Request/Request.vue.js +1 -1
  112. package/dist/views/Request/Request.vue2.js +122 -105
  113. package/dist/views/Request/RequestSection/RequestAuthDataTableInput.vue.d.ts +1 -1
  114. package/dist/views/Request/RequestSection/RequestAuthDataTableInput.vue.d.ts.map +1 -1
  115. package/dist/views/Request/RequestSection/RequestSection.vue.d.ts.map +1 -1
  116. package/dist/views/Request/RequestSection/RequestSection.vue.js +5 -4
  117. package/dist/views/Request/RequestSection/RequestTable.vue.d.ts.map +1 -1
  118. package/dist/views/Request/RequestSection/RequestTable.vue.js +1 -1
  119. package/dist/views/Request/RequestSection/RequestTable.vue2.js +19 -19
  120. package/dist/views/Request/RequestSection/RequestTableTooltip.vue.d.ts.map +1 -1
  121. package/dist/views/Request/RequestSection/RequestTableTooltip.vue.js +6 -5
  122. package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
  123. package/dist/views/Request/RequestSidebarItem.vue.js +2 -2
  124. package/dist/views/Request/RequestSidebarItem.vue2.js +78 -81
  125. package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts.map +1 -1
  126. package/dist/views/Request/RequestSidebarItemMenu.vue.js +53 -33
  127. package/dist/views/Request/ResponseSection/ResponseSection.vue.d.ts.map +1 -1
  128. package/dist/views/Request/ResponseSection/ResponseSection.vue.js +6 -5
  129. package/dist/views/Request/components/OAuth2.vue.d.ts.map +1 -1
  130. package/dist/views/Request/components/OAuth2.vue.js +2 -0
  131. package/dist/{App.vue.d.ts → views/Request/components/WorkspaceDropdown.vue.d.ts} +1 -2
  132. package/dist/views/Request/components/WorkspaceDropdown.vue.d.ts.map +1 -0
  133. package/dist/views/Request/components/WorkspaceDropdown.vue.js +80 -0
  134. package/dist/views/Request/components/WorkspaceDropdown.vue2.js +4 -0
  135. package/dist/views/Request/components/index.d.ts +1 -0
  136. package/dist/views/Request/components/index.d.ts.map +1 -1
  137. package/dist/views/Request/components/index.js +4 -2
  138. package/dist/views/Servers/Servers.vue.d.ts.map +1 -1
  139. package/dist/views/Servers/Servers.vue2.js +12 -15
  140. package/package.json +20 -16
  141. package/dist/App/ApiClientApp.vue.d.ts.map +0 -1
  142. package/dist/App/ApiClientApp.vue.js +0 -56
  143. package/dist/App/createApiClientApp.d.ts.map +0 -1
  144. package/dist/App/index.d.ts.map +0 -1
  145. package/dist/App.vue.d.ts.map +0 -1
  146. package/dist/App.vue.js +0 -77
  147. package/dist/App.vue3.js +0 -5
  148. package/dist/Modal/ApiClientModal.vue.d.ts.map +0 -1
  149. package/dist/Modal/api-client-modal.d.ts.map +0 -1
  150. package/dist/Modal/index.d.ts.map +0 -1
  151. package/dist/components/AddressBar/AddressBarServer.vue.js +0 -113
  152. package/dist/components/AddressBar/AddressBarServer.vue2.js +0 -4
  153. package/dist/components/CommandPalette/CommandPalette.vue.d.ts +0 -17
  154. package/dist/components/CommandPalette/CommandPalette.vue.d.ts.map +0 -1
  155. package/dist/components/CommandPalette/CommandPalette.vue.js +0 -7
  156. package/dist/components/CommandPalette/CommandPalette.vue2.js +0 -185
  157. package/dist/main.d.ts +0 -2
  158. package/dist/main.d.ts.map +0 -1
  159. /package/dist/{App → layouts/App}/ApiClientApp.vue.d.ts +0 -0
  160. /package/dist/{App → layouts/App}/ApiClientApp.vue3.js +0 -0
  161. /package/dist/{App → layouts/App}/index.d.ts +0 -0
  162. /package/dist/{App → layouts/App}/index.js +0 -0
  163. /package/dist/{Modal → layouts/Modal}/ApiClientModal.vue2.js +0 -0
  164. /package/dist/{Modal → layouts/Modal}/api-client-modal.d.ts +0 -0
  165. /package/dist/{Modal → layouts/Modal}/index.d.ts +0 -0
  166. /package/dist/{Modal → layouts/Modal}/index.js +0 -0
@@ -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
@@ -1 +1 @@
1
- {"version":3,"file":"CommandPaletteFolder.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandPaletteFolder.vue"],"names":[],"mappings":";WA0GS,MAAM;;;;WAAN,MAAM;;;;AAgNf,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":"CommandPaletteFolder.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandPaletteFolder.vue"],"names":[],"mappings":";;;;;AA2SA,wBAMG"}