@scalar/api-client 2.0.29 → 2.0.31

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 (92) hide show
  1. package/CHANGELOG.md +19 -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 +23 -23
  5. package/dist/components/AddressBar/AddressBarHistory.vue.d.ts.map +1 -1
  6. package/dist/components/CodeInput/CodeInput.vue.d.ts +2 -2
  7. package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
  8. package/dist/components/CodeInput/CodeInput.vue.js +2 -2
  9. package/dist/components/CodeInput/CodeInput.vue2.js +63 -48
  10. package/dist/components/CodeInput/codeDropdownWidget.d.ts +9 -1
  11. package/dist/components/CodeInput/codeDropdownWidget.d.ts.map +1 -1
  12. package/dist/components/CodeInput/codeDropdownWidget.js +62 -51
  13. package/dist/components/CodeInput/codeVariableWidget.d.ts +10 -1
  14. package/dist/components/CodeInput/codeVariableWidget.d.ts.map +1 -1
  15. package/dist/components/CodeInput/codeVariableWidget.js +63 -56
  16. package/dist/components/CommandPalette/CommandPaletteImport.vue.js +1 -1
  17. package/dist/components/DarkModeToggle/DarkModeIconToggle.vue.d.ts.map +1 -1
  18. package/dist/components/DarkModeToggle/DarkModeIconToggle.vue.js +5 -5
  19. package/dist/components/HttpMethod/HttpMethod.vue.d.ts +2 -2
  20. package/dist/components/SideNav/SideNav.vue.d.ts.map +1 -1
  21. package/dist/components/SideNav/SideNav.vue.js +5 -43
  22. package/dist/components/SideNav/SideNav.vue2.js +44 -2
  23. package/dist/components/SideNav/SideNavLink.vue.d.ts +2 -0
  24. package/dist/components/SideNav/SideNavLink.vue.d.ts.map +1 -1
  25. package/dist/components/SideNav/SideNavLink.vue.js +29 -20
  26. package/dist/components/SideNav/WorkspaceProfileIcon.vue.d.ts.map +1 -1
  27. package/dist/components/SubpageHeader.vue.d.ts.map +1 -1
  28. package/dist/components/SubpageHeader.vue.js +1 -1
  29. package/dist/components/TopNav/TopNav.vue.d.ts.map +1 -1
  30. package/dist/components/TopNav/TopNav.vue.js +1 -1
  31. package/dist/components/TopNav/TopNav.vue2.js +65 -34
  32. package/dist/constants.d.ts +4 -0
  33. package/dist/constants.d.ts.map +1 -1
  34. package/dist/constants.js +4 -4
  35. package/dist/index.d.ts +1 -1
  36. package/dist/index.d.ts.map +1 -1
  37. package/dist/index.js +12 -11
  38. package/dist/layouts/App/ApiClientApp.vue.d.ts.map +1 -1
  39. package/dist/layouts/App/ApiClientApp.vue.js +9 -9
  40. package/dist/layouts/App/create-api-client-app.d.ts +2966 -0
  41. package/dist/layouts/App/create-api-client-app.d.ts.map +1 -0
  42. package/dist/layouts/App/create-api-client-app.js +18 -0
  43. package/dist/layouts/App/index.d.ts +1 -1
  44. package/dist/layouts/App/index.d.ts.map +1 -1
  45. package/dist/layouts/App/index.js +1 -1
  46. package/dist/layouts/Modal/ApiClientModal.vue.d.ts +1 -17
  47. package/dist/layouts/Modal/ApiClientModal.vue.d.ts.map +1 -1
  48. package/dist/layouts/Modal/ApiClientModal.vue.js +1 -1
  49. package/dist/layouts/Modal/ApiClientModal.vue2.js +20 -24
  50. package/dist/layouts/Modal/api-client-modal.d.ts +5905 -57
  51. package/dist/layouts/Modal/api-client-modal.d.ts.map +1 -1
  52. package/dist/layouts/Modal/api-client-modal.js +27 -129
  53. package/dist/libs/create-client.d.ts +3025 -0
  54. package/dist/libs/create-client.d.ts.map +1 -0
  55. package/dist/libs/create-client.js +147 -0
  56. package/dist/libs/index.d.ts +1 -0
  57. package/dist/libs/index.d.ts.map +1 -1
  58. package/dist/libs/index.js +11 -9
  59. package/dist/router.d.ts +7 -17
  60. package/dist/router.d.ts.map +1 -1
  61. package/dist/router.js +28 -40
  62. package/dist/store/index.d.ts +2 -0
  63. package/dist/store/index.d.ts.map +1 -0
  64. package/dist/store/index.js +5 -0
  65. package/dist/store/workspace.d.ts +3028 -603
  66. package/dist/store/workspace.d.ts.map +1 -1
  67. package/dist/store/workspace.js +454 -432
  68. package/dist/style.css +1 -1
  69. package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts +8 -0
  70. package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts.map +1 -1
  71. package/dist/views/Environment/EnvironmentVariableDropdown.vue.js +32 -31
  72. package/dist/views/Request/Request.vue.d.ts.map +1 -1
  73. package/dist/views/Request/Request.vue.js +2 -2
  74. package/dist/views/Request/Request.vue2.js +11 -11
  75. package/dist/views/Request/RequestSection/RequestBody.vue.d.ts.map +1 -1
  76. package/dist/views/Request/RequestSection/RequestBody.vue.js +13 -13
  77. package/dist/views/Request/RequestSection/RequestTable.vue.d.ts +2 -2
  78. package/dist/views/Request/RequestSection/RequestTable.vue.d.ts.map +1 -1
  79. package/dist/views/Request/RequestSection/RequestTable.vue.js +1 -1
  80. package/dist/views/Request/RequestSection/RequestTable.vue2.js +2 -2
  81. package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
  82. package/dist/views/Request/RequestSidebarItem.vue.js +1 -1
  83. package/dist/views/Request/RequestSidebarItem.vue2.js +24 -23
  84. package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts.map +1 -1
  85. package/dist/views/Request/RequestSidebarItemMenu.vue.js +26 -20
  86. package/package.json +11 -7
  87. package/dist/layouts/App/createApiClientApp.d.ts +0 -16
  88. package/dist/layouts/App/createApiClientApp.d.ts.map +0 -1
  89. package/dist/layouts/App/createApiClientApp.js +0 -62
  90. package/dist/store/topNav.d.ts +0 -445
  91. package/dist/store/topNav.d.ts.map +0 -1
  92. package/dist/store/topNav.js +0 -53
@@ -1,32 +1,34 @@
1
1
  var u = Object.defineProperty;
2
- var f = (e, n, t) => n in e ? u(e, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[n] = t;
3
- var c = (e, n, t) => f(e, typeof n != "symbol" ? n + "" : n, t);
4
- import { useWorkspace as v } from "../../store/workspace.js";
5
- import { ScalarButton as g, ScalarIcon as b, ScalarTooltip as h } 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 E, h as s, createApp as k } from "vue";
8
- const { activeParsedEnvironments: D, isReadOnly: S, environments: $ } = v(), A = (e) => "_scalarEnvId" in e ? `bg-${$[e._scalarEnvId].color}` : "bg-grey";
9
- class l extends C {
10
- constructor(t) {
2
+ var h = (n, e, t) => e in n ? u(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
+ var r = (n, e, t) => h(n, typeof e != "symbol" ? e + "" : e, t);
4
+ import { ScalarButton as f, ScalarIcon as g, ScalarTooltip as b } from "@scalar/components";
5
+ import { ViewPlugin as x, RangeSetBuilder as w, Decoration as y, EditorView as N, WidgetType as E } from "@scalar/use-codemirror";
6
+ import { defineComponent as C, h as a, createApp as S } from "vue";
7
+ const k = (n, e) => "_scalarEnvId" in n ? `bg-${e[n._scalarEnvId].color}` : "bg-grey";
8
+ class d extends E {
9
+ constructor(t, i, s, o) {
11
10
  super();
12
- c(this, "app");
13
- this.variableName = t;
11
+ r(this, "app");
12
+ r(this, "environments");
13
+ r(this, "activeParsedEnvironments");
14
+ r(this, "isReadOnly");
15
+ this.variableName = t, this.variableName = t, this.environments = i, this.activeParsedEnvironments = s, this.isReadOnly = o;
14
16
  }
15
17
  toDOM() {
16
18
  const t = document.createElement("span");
17
19
  t.className = "cm-pill", t.textContent = `${this.variableName}`;
18
- const a = E({
19
- props: ["variableName"],
20
- render() {
21
- const o = D.value.find(
22
- (i) => i.key === this.variableName
20
+ const i = C({
21
+ props: { variableName: { type: String, default: null } },
22
+ render: () => {
23
+ const s = this.activeParsedEnvironments.value.find(
24
+ (c) => c.key === this.variableName
23
25
  );
24
- o && (t.className += ` ${A(o)}`);
25
- const r = o ? s("div", { class: "p-2" }, o.value) : s("div", { class: "divide-y divide-1/2 grid" }, [
26
- s("span", { class: "p-2" }, "Variable not found"),
27
- !S.value && s("div", { class: "p-1" }, [
28
- s(
29
- g,
26
+ s && (t.className += ` ${k(s, this.environments)}`);
27
+ const o = s ? a("div", { class: "p-2" }, s.value) : a("div", { class: "divide-y divide-1/2 grid" }, [
28
+ a("span", { class: "p-2" }, "Variable not found"),
29
+ !this.isReadOnly && a("div", { class: "p-1" }, [
30
+ a(
31
+ f,
30
32
  {
31
33
  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",
32
34
  variant: "ghost",
@@ -35,14 +37,14 @@ class l extends C {
35
37
  }
36
38
  },
37
39
  [
38
- s(b, { class: "w-2", icon: "Add", size: "xs" }),
40
+ a(g, { class: "w-2", icon: "Add", size: "xs" }),
39
41
  "Add variable"
40
42
  ]
41
43
  )
42
44
  ])
43
45
  ]);
44
- return s(
45
- h,
46
+ return a(
47
+ b,
46
48
  {
47
49
  align: "start",
48
50
  class: "bg-b-1 w-full",
@@ -51,76 +53,81 @@ class l extends C {
51
53
  sideOffset: 6
52
54
  },
53
55
  {
54
- trigger: () => s("span", `${this.variableName}`),
55
- content: () => s(
56
+ trigger: () => a("span", `${this.variableName}`),
57
+ content: () => a(
56
58
  "div",
57
59
  {
58
60
  class: "w-content shadow-lg rounded bg-b-1 text-xxs leading-5 text-c-1"
59
61
  },
60
- r
62
+ o
61
63
  )
62
64
  }
63
65
  );
64
66
  }
65
67
  });
66
- return this.app = k(a, { variableName: this.variableName }), this.app.mount(t), t;
68
+ return this.app = S(i, { variableName: this.variableName }), this.app.mount(t), t;
67
69
  }
68
70
  destroy() {
69
71
  this.app && this.app.unmount();
70
72
  }
71
73
  eq(t) {
72
- return t instanceof l && t.variableName === this.variableName;
74
+ return t instanceof d && t.variableName === this.variableName;
73
75
  }
74
- ignoreEvent(t) {
76
+ ignoreEvent() {
75
77
  return !1;
76
78
  }
77
79
  }
78
- const V = x.fromClass(
80
+ const $ = (n) => x.fromClass(
79
81
  class {
80
82
  constructor(e) {
81
- c(this, "decorations");
83
+ r(this, "decorations");
82
84
  this.decorations = this.buildDecorations(e);
83
85
  }
84
86
  update(e) {
85
87
  (e.docChanged || e.viewportChanged) && (this.decorations = this.buildDecorations(e.view));
86
88
  }
87
89
  buildDecorations(e) {
88
- const n = new w();
89
- for (const { from: t, to: a } of e.visibleRanges) {
90
- const o = e.state.doc.sliceString(t, a), r = /{{(.*?)}}/g;
91
- let i;
92
- for (; (i = r.exec(o)) !== null; ) {
93
- const d = t + i.index, p = d + i[0].length, m = i[1];
94
- n.add(
95
- d,
96
- p,
97
- N.widget({
98
- widget: new l(m),
90
+ const t = new w();
91
+ for (const { from: i, to: s } of e.visibleRanges) {
92
+ const o = e.state.doc.sliceString(i, s), c = /{{(.*?)}}/g;
93
+ let l;
94
+ for (; (l = c.exec(o)) !== null; ) {
95
+ const m = i + l.index, v = m + l[0].length, p = l[1];
96
+ t.add(
97
+ m,
98
+ v,
99
+ y.widget({
100
+ widget: new d(
101
+ p,
102
+ n.environments,
103
+ n.activeParsedEnvironments,
104
+ n.isReadOnly
105
+ ),
99
106
  side: 1
100
107
  })
101
108
  );
102
109
  }
103
110
  }
104
- return n.finish();
111
+ return t.finish();
105
112
  }
106
113
  },
107
114
  {
108
115
  decorations: (e) => e.decorations
109
116
  }
110
- ), T = y.domEventHandlers({
111
- keydown(e, n) {
112
- if (e.key === "Backspace") {
113
- const { state: t } = n, { from: a, to: o } = t.selection.main;
114
- if (a === o && a > 0 && t.doc.sliceString(a - 2, a) === "}}")
115
- return n.dispatch({
116
- changes: { from: a - 2, to: o },
117
- selection: { anchor: a - 2 }
118
- }), e.preventDefault(), !0;
117
+ ), A = N.domEventHandlers({
118
+ keydown(n, e) {
119
+ if (n.key === "Backspace") {
120
+ const { state: t } = e, { from: i, to: s } = t.selection.main;
121
+ if (i === s && i > 0 && t.doc.sliceString(i - 2, i) === "}}")
122
+ return e.dispatch({
123
+ changes: { from: i - 2, to: s },
124
+ selection: { anchor: i - 2 }
125
+ }), n.preventDefault(), !0;
119
126
  }
120
127
  return !1;
121
128
  }
122
129
  });
123
130
  export {
124
- T as backspaceCommand,
125
- V as pillPlugin
131
+ A as backspaceCommand,
132
+ $ as pillPlugin
126
133
  };
@@ -17,7 +17,7 @@ const U = { class: "gap-3 rounded bg-b-2 focus-within:bg-b-1 focus-within:shadow
17
17
  i.onload = async (v) => {
18
18
  var p;
19
19
  const w = (p = v.target) == null ? void 0 : p.result;
20
- _(w, h.value.uid, !1), n(), s("close");
20
+ _(w, h.value.uid), n(), s("close");
21
21
  }, i.readAsText(l);
22
22
  }
23
23
  },
@@ -1 +1 @@
1
- {"version":3,"file":"DarkModeIconToggle.vue.d.ts","sourceRoot":"","sources":["../../../src/components/DarkModeToggle/DarkModeIconToggle.vue"],"names":[],"mappings":";AAuGA,wBAKG"}
1
+ {"version":3,"file":"DarkModeIconToggle.vue.d.ts","sourceRoot":"","sources":["../../../src/components/DarkModeToggle/DarkModeIconToggle.vue"],"names":[],"mappings":";AAwGA,wBAKG"}
@@ -1,5 +1,5 @@
1
- import { defineComponent as c, openBlock as i, createElementBlock as l, unref as e, createVNode as r, withCtx as s, createTextVNode as p, toDisplayString as d } from "vue";
2
- import m from "../ScreenReader.vue.js";
1
+ import { defineComponent as c, openBlock as i, createElementBlock as l, unref as e, createVNode as r, withCtx as s, createTextVNode as p, toDisplayString as m } from "vue";
2
+ import d from "../ScreenReader.vue.js";
3
3
  import { ScalarIcon as u } from "@scalar/components";
4
4
  import { useDarkModeState as f } from "../../hooks/useDarkModeState.js";
5
5
  const b = /* @__PURE__ */ c({
@@ -7,7 +7,7 @@ const b = /* @__PURE__ */ c({
7
7
  setup(g) {
8
8
  const { toggleDarkMode: t, isDark: n } = f();
9
9
  return (k, o) => (i(), l("button", {
10
- class: "w-[37px] hover:bg-b-2 flex items-center justify-center rounded-lg p-[7px]",
10
+ class: "min-w-[37px] max-w-[42px] hover:bg-b-2 flex items-center justify-center rounded-lg p-[7px]",
11
11
  type: "button",
12
12
  onClick: o[0] || (o[0] = //@ts-ignore
13
13
  (...a) => e(t) && e(t)(...a))
@@ -17,9 +17,9 @@ const b = /* @__PURE__ */ c({
17
17
  icon: "LightDarkModeToggle",
18
18
  thickness: "1.5"
19
19
  }),
20
- r(m, null, {
20
+ r(d, null, {
21
21
  default: s(() => [
22
- p(" Switch to " + d(e(n) ? "Light" : "Dark") + " Mode ", 1)
22
+ p(" Switch to " + m(e(n) ? "Light" : "Dark") + " Mode ", 1)
23
23
  ]),
24
24
  _: 1
25
25
  })
@@ -7,7 +7,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
7
7
  isDisable: boolean;
8
8
  isEditable: boolean;
9
9
  }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
10
- change: (value: "GET" | "HEAD" | "PATCH" | "POST" | "PUT" | "TRACE" | "CONNECT" | "DELETE" | "OPTIONS") => void;
10
+ change: (value: "CONNECT" | "DELETE" | "GET" | "HEAD" | "OPTIONS" | "PATCH" | "POST" | "PUT" | "TRACE") => void;
11
11
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<{
12
12
  isSquare?: boolean;
13
13
  method: string;
@@ -17,7 +17,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
17
17
  isDisable: boolean;
18
18
  isEditable: boolean;
19
19
  }>>> & {
20
- onChange?: ((value: "GET" | "HEAD" | "PATCH" | "POST" | "PUT" | "TRACE" | "CONNECT" | "DELETE" | "OPTIONS") => any) | undefined;
20
+ onChange?: ((value: "CONNECT" | "DELETE" | "GET" | "HEAD" | "OPTIONS" | "PATCH" | "POST" | "PUT" | "TRACE") => any) | undefined;
21
21
  }, {
22
22
  isSquare: boolean;
23
23
  isEditable: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"SideNav.vue.d.ts","sourceRoot":"","sources":["../../../src/components/SideNav/SideNav.vue"],"names":[],"mappings":";AAwIA,wBAKG"}
1
+ {"version":3,"file":"SideNav.vue.d.ts","sourceRoot":"","sources":["../../../src/components/SideNav/SideNav.vue"],"names":[],"mappings":";AAkJA,wBAKG"}
@@ -1,45 +1,7 @@
1
- import { defineComponent as m, openBlock as t, createElementBlock as o, createVNode as r, createElementVNode as a, Fragment as _, renderList as f, unref as c, withCtx as p, createTextVNode as u, toDisplayString as d } from "vue";
2
- import x from "../DarkModeToggle/DarkModeIconToggle.vue.js";
3
- import { ROUTES as h } from "../../constants.js";
4
- import { useRouter as v } from "vue-router";
5
- import g from "./SideNavLink.vue.js";
6
- import N from "./WorkspaceProfileIcon.vue.js";
7
- /* empty css */
8
- const y = {
9
- "aria-label": "Side Navigation",
10
- class: "text-c-2 w-15 flex flex-col items-center px-2 py-2 scalar-sidenav",
11
- role: "navigation"
12
- }, S = { class: "mt-3.5 flex flex-col gap-1.5" }, k = { class: "mt-auto flex flex-col gap-2 py-1.5" }, E = { class: "flex items-center" }, L = /* @__PURE__ */ m({
13
- __name: "SideNav",
14
- setup(R) {
15
- const { currentRoute: n } = v();
16
- return (V, $) => (t(), o("nav", y, [
17
- r(N),
18
- a("ul", S, [
19
- (t(!0), o(_, null, f(c(h), ({ icon: s, name: e }, l) => {
20
- var i;
21
- return t(), o("li", { key: l }, [
22
- r(g, {
23
- active: (i = c(n).name) == null ? void 0 : i.startsWith(e),
24
- icon: s,
25
- name: e
26
- }, {
27
- default: p(() => [
28
- u(d(e), 1)
29
- ]),
30
- _: 2
31
- }, 1032, ["active", "icon", "name"])
32
- ]);
33
- }), 128))
34
- ]),
35
- a("ul", k, [
36
- a("li", E, [
37
- r(x)
38
- ])
39
- ])
40
- ]));
41
- }
42
- });
1
+ import o from "./SideNav.vue2.js";
2
+ /* empty css */
3
+ import a from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const m = /* @__PURE__ */ a(o, [["__scopeId", "data-v-10f3a9af"]]);
43
5
  export {
44
- L as default
6
+ m as default
45
7
  };
@@ -1,4 +1,46 @@
1
- import f from "./SideNav.vue.js";
1
+ import { defineComponent as _, openBlock as t, createElementBlock as o, createVNode as r, createElementVNode as a, Fragment as f, renderList as p, unref as c, withCtx as u, createTextVNode as d, toDisplayString as x } from "vue";
2
+ import v from "../DarkModeToggle/DarkModeIconToggle.vue.js";
3
+ import { ROUTES as h } from "../../constants.js";
4
+ import { useRouter as g } from "vue-router";
5
+ import N from "./SideNavLink.vue.js";
6
+ import y from "./WorkspaceProfileIcon.vue.js";
7
+ /* empty css */
8
+ const S = {
9
+ "aria-label": "Side Navigation",
10
+ class: "text-c-2 w-15 flex flex-col items-center px-2 py-2 scalar-sidenav relative",
11
+ role: "navigation"
12
+ }, k = { class: "mt-3.5 flex flex-col gap-1.5" }, E = { class: "mt-auto flex flex-col gap-2 py-1.5" }, R = { class: "flex items-center" }, O = /* @__PURE__ */ _({
13
+ __name: "SideNav",
14
+ setup(V) {
15
+ const { currentRoute: n } = g();
16
+ return ($, w) => (t(), o("nav", S, [
17
+ r(y),
18
+ a("ul", k, [
19
+ (t(!0), o(f, null, p(c(h), ({ icon: s, name: e, prettyName: l }, m) => {
20
+ var i;
21
+ return t(), o("li", { key: m }, [
22
+ r(N, {
23
+ active: (i = c(n).name) == null ? void 0 : i.startsWith(e),
24
+ icon: s,
25
+ name: e,
26
+ prettyName: l
27
+ }, {
28
+ default: u(() => [
29
+ d(x(e), 1)
30
+ ]),
31
+ _: 2
32
+ }, 1032, ["active", "icon", "name", "prettyName"])
33
+ ]);
34
+ }), 128))
35
+ ]),
36
+ a("ul", E, [
37
+ a("li", R, [
38
+ r(v)
39
+ ])
40
+ ])
41
+ ]));
42
+ }
43
+ });
2
44
  export {
3
- f as default
45
+ O as default
4
46
  };
@@ -7,10 +7,12 @@ declare function __VLS_template(): {
7
7
  declare const __VLS_component: import("vue").DefineComponent<__VLS_TypePropsToOption<{
8
8
  icon: IconProps["icon"];
9
9
  name: (typeof ROUTES)[number]["name"];
10
+ prettyName: (typeof ROUTES)[number]["prettyName"];
10
11
  active?: boolean;
11
12
  }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<{
12
13
  icon: IconProps["icon"];
13
14
  name: (typeof ROUTES)[number]["name"];
15
+ prettyName: (typeof ROUTES)[number]["prettyName"];
14
16
  active?: boolean;
15
17
  }>>>, {}, {}>;
16
18
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
@@ -1 +1 @@
1
- {"version":3,"file":"SideNavLink.vue.d.ts","sourceRoot":"","sources":["../../../src/components/SideNav/SideNavLink.vue"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEzC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAI/C,KAAK,SAAS,GAAG,YAAY,CAAC,OAAO,UAAU,CAAC,CAAC,QAAQ,CAAC,CAAA;AAgB1D,iBAAS,cAAc;qBAuDO,GAAG;EAgBhC;AACD,QAAA,MAAM,eAAe;UArFb,SAAS,CAAC,MAAM,CAAC;UACjB,CAAC,OAAO,MAAM,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC;aAC5B,OAAO;;UAFV,SAAS,CAAC,MAAM,CAAC;UACjB,CAAC,OAAO,MAAM,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC;aAC5B,OAAO;aAyFhB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAAvG,wBAAwG;AAOxG,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,SA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K,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,36 +1,45 @@
1
- import { defineComponent as r, resolveComponent as a, openBlock as s, createBlock as c, normalizeClass as i, unref as o, withCtx as l, createVNode as p, createElementVNode as u, renderSlot as m } from "vue";
2
- import { useWorkspace as d } from "../../store/workspace.js";
3
- import { ScalarIcon as f } from "@scalar/components";
4
- const k = { class: "sr-only" }, x = /* @__PURE__ */ r({
1
+ import { defineComponent as a, resolveComponent as s, openBlock as i, createBlock as c, unref as t, withCtx as p, createElementVNode as o, normalizeClass as l, createVNode as m, toDisplayString as u, renderSlot as d } from "vue";
2
+ import { useWorkspace as f } from "../../store/workspace.js";
3
+ import { ScalarIcon as v } from "@scalar/components";
4
+ import { useRouter as _ } from "vue-router";
5
+ const k = { class: "no-underline font-medium text-[11px] hidden scalar-app-show capitalize" }, g = { class: "sr-only" }, b = /* @__PURE__ */ a({
5
6
  __name: "SideNavLink",
6
7
  props: {
7
8
  icon: {},
8
9
  name: {},
10
+ prettyName: {},
9
11
  active: { type: Boolean }
10
12
  },
11
- setup(v) {
12
- const { activeWorkspace: t } = d();
13
- return (e, _) => {
14
- const n = a("router-link");
15
- return s(), c(n, {
13
+ setup(h) {
14
+ const { activeWorkspace: n } = f();
15
+ return _(), (e, x) => {
16
+ const r = s("router-link");
17
+ return i(), c(r, {
16
18
  activeClass: "active-link",
17
- class: i(["w-[37px] hover:bg-b-2 active:text-c-1 flex items-center justify-center rounded-lg p-[7px]", { "bg-b-2 transition-none hover:cursor-auto text-c-1": e.active }]),
18
- to: `/workspace/${o(t).uid}/${e.name}/default`
19
+ class: "flex flex-col items-center gap-1 group no-underline",
20
+ to: `/workspace/${t(n).uid}/${e.name}/default`
19
21
  }, {
20
- default: l(() => [
21
- p(o(f), {
22
- icon: e.icon,
23
- thickness: "1.5"
24
- }, null, 8, ["icon"]),
25
- u("span", k, [
26
- m(e.$slots, "default")
22
+ default: p(() => [
23
+ o("div", {
24
+ class: l(["min-w-[37px] max-w-[42px] group-hover:bg-b-2 active:text-c-1 flex items-center justify-center rounded-lg p-[7px] scalar-app-nav-padding", {
25
+ "bg-b-2 transition-none group-hover:cursor-auto text-c-1": e.active
26
+ }])
27
+ }, [
28
+ m(t(v), {
29
+ icon: e.icon,
30
+ thickness: "1.5"
31
+ }, null, 8, ["icon"])
32
+ ], 2),
33
+ o("div", k, u(e.prettyName), 1),
34
+ o("span", g, [
35
+ d(e.$slots, "default")
27
36
  ])
28
37
  ]),
29
38
  _: 3
30
- }, 8, ["class", "to"]);
39
+ }, 8, ["to"]);
31
40
  };
32
41
  }
33
42
  });
34
43
  export {
35
- x as default
44
+ b as default
36
45
  };
@@ -1 +1 @@
1
- {"version":3,"file":"WorkspaceProfileIcon.vue.d.ts","sourceRoot":"","sources":["../../../src/components/SideNav/WorkspaceProfileIcon.vue"],"names":[],"mappings":";iBAqGe;QACX,WAAW,EAAE,MAAM,CAAA;QACnB,QAAQ,CAAC,EAAE,MAAM,CAAA;KAClB;;iBAHY;QACX,WAAW,EAAE,MAAM,CAAA;QACnB,QAAQ,CAAC,EAA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AAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"SubpageHeader.vue.d.ts","sourceRoot":"","sources":["../../src/components/SubpageHeader.vue"],"names":[],"mappings":"AA+BA,iBAAS,cAAc;qBA2EO,GAAG;EAchC;AACD,QAAA,MAAM,eAAe,0NAKnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAAvG,wBAAwG;AAOxG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACpC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"SubpageHeader.vue.d.ts","sourceRoot":"","sources":["../../src/components/SubpageHeader.vue"],"names":[],"mappings":"AA+BA,iBAAS,cAAc;qBA4EO,GAAG;EAchC;AACD,QAAA,MAAM,eAAe,0NAKnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAAvG,wBAAwG;AAOxG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACpC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as r, resolveComponent as l, openBlock as s, createElementBlock as c, createElementVNode as t, createVNode as e, withCtx as a, unref as d, renderSlot as i } from "vue";
2
2
  import { ScalarIcon as u } from "@scalar/components";
3
- const p = { class: "flex flex-1 flex-col rounded-lg rounded-b-none rounded-r-none pt-0 h-full bg-b-2" }, m = { class: "lg:min-h-header items-center w-full p-1 t-app__top-container flex items-center" }, f = /* @__PURE__ */ t("span", null, "Back To Requests", -1), g = /* @__PURE__ */ r({
3
+ const p = { class: "flex flex-1 flex-col rounded-lg rounded-b-none rounded-r-none pt-0 h-full bg-b-2 relative" }, m = { class: "lg:min-h-header items-center w-full p-1 t-app__top-container flex items-center" }, f = /* @__PURE__ */ t("span", null, "Back To Requests", -1), g = /* @__PURE__ */ r({
4
4
  __name: "SubpageHeader",
5
5
  setup(_) {
6
6
  return (o, h) => {
@@ -1 +1 @@
1
- {"version":3,"file":"TopNav.vue.d.ts","sourceRoot":"","sources":["../../../src/components/TopNav/TopNav.vue"],"names":[],"mappings":";AAqPA,wBAKG"}
1
+ {"version":3,"file":"TopNav.vue.d.ts","sourceRoot":"","sources":["../../../src/components/TopNav/TopNav.vue"],"names":[],"mappings":";AAyXA,wBAKG"}
@@ -1,7 +1,7 @@
1
1
  import o from "./TopNav.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-31a24876"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-868c07b1"]]);
5
5
  export {
6
6
  m as default
7
7
  };
@@ -1,46 +1,77 @@
1
- import { defineComponent as k, computed as h, openBlock as c, createElementBlock as s, createElementVNode as l, unref as e, createVNode as p, toDisplayString as I, Fragment as g, renderList as b, createBlock as N, pushScopeId as x, popScopeId as y } from "vue";
2
- import { useTopNav as C } from "../../store/topNav.js";
3
- import { ScalarIcon as m } from "@scalar/components";
4
- import S from "./TopNavItem.vue.js";
5
- const w = (o) => (x("data-v-31a24876"), o = o(), y(), o), B = { class: "flex h-10 t-app__top-nav" }, T = /* @__PURE__ */ w(() => /* @__PURE__ */ l("div", { class: "t-app__top-nav-draggable" }, null, -1)), V = { class: "flex h-10 flex-1 items-center justify-center gap-1.5 text-sm font-medium relative" }, j = {
1
+ import { defineComponent as N, reactive as y, ref as x, watch as S, computed as C, openBlock as r, createElementBlock as u, createElementVNode as i, createVNode as v, unref as d, toDisplayString as w, Fragment as A, renderList as R, createBlock as z, pushScopeId as B, popScopeId as E } from "vue";
2
+ import { ROUTES as T } from "../../constants.js";
3
+ import { ScalarIcon as h } from "@scalar/components";
4
+ import { capitalize as V } from "@scalar/oas-utils/helpers";
5
+ import j from "./TopNavItem.vue.js";
6
+ import { useWorkspace as q } from "../../store/workspace.js";
7
+ const L = (l) => (B("data-v-868c07b1"), l = l(), E(), l), $ = { class: "flex h-10 t-app__top-nav" }, D = /* @__PURE__ */ L(() => /* @__PURE__ */ i("div", { class: "t-app__top-nav-draggable" }, null, -1)), F = { class: "flex h-10 flex-1 items-center justify-center gap-1.5 text-sm font-medium relative" }, M = {
6
8
  key: 0,
7
9
  class: "flex items-center gap-1 w-full justify-center"
8
- }, F = /* @__PURE__ */ k({
10
+ }, K = /* @__PURE__ */ N({
9
11
  __name: "TopNav",
10
- setup(o) {
11
- const {
12
- topNavItems: n,
13
- addNavItem: i,
14
- activeNavItemIdx: v,
15
- setNavItemIdx: d,
16
- removeNavItem: u
17
- } = C(), _ = h(() => v.value);
18
- return (z, r) => (c(), s("nav", B, [
19
- T,
20
- l("div", V, [
21
- e(n).length === 1 ? (c(), s("div", j, [
22
- p(e(m), {
23
- icon: e(n)[0].icon,
12
+ setup(l) {
13
+ const { activeRequest: f, router: n } = q(), t = y([{ label: "", path: "", icon: "Add" }]), a = x(0);
14
+ function p() {
15
+ var s;
16
+ const e = T.find((c) => n.currentRoute.value.name == c.name);
17
+ e && ((e == null ? void 0 : e.name) === "request" ? t[a.value] = {
18
+ label: ((s = f.value) == null ? void 0 : s.summary) || "",
19
+ path: n.currentRoute.value.path,
20
+ icon: e.icon
21
+ } : t[a.value] = {
22
+ label: V(e == null ? void 0 : e.name) || "",
23
+ path: n.currentRoute.value.path,
24
+ icon: e.icon
25
+ });
26
+ }
27
+ function m() {
28
+ n.push(t[a.value].path);
29
+ }
30
+ function _() {
31
+ t.push({ label: "", path: "", icon: "Add" }), a.value = t.length - 1, p();
32
+ }
33
+ function b(e) {
34
+ a.value = e, m();
35
+ }
36
+ S(
37
+ () => n.currentRoute.value.path,
38
+ () => {
39
+ p();
40
+ },
41
+ { immediate: !0 }
42
+ );
43
+ function k(e) {
44
+ t.splice(e, 1), a.value = Math.min(
45
+ a.value,
46
+ t.length - 1
47
+ ), m();
48
+ }
49
+ const g = C(() => a.value);
50
+ return (e, s) => (r(), u("nav", $, [
51
+ D,
52
+ i("div", F, [
53
+ t.length === 1 ? (r(), u("div", M, [
54
+ v(d(h), {
55
+ icon: t[0].icon,
24
56
  size: "xs",
25
57
  thickness: "2.5"
26
58
  }, null, 8, ["icon"]),
27
- l("div", null, I(e(n)[0].label), 1)
28
- ])) : (c(!0), s(g, { key: 1 }, b(e(n), (a, t) => (c(), N(S, {
29
- key: t,
30
- active: t === _.value,
31
- hotkey: (t + 1).toString(),
32
- icon: a.icon,
33
- label: a.label,
34
- onClick: (f) => e(d)(t),
35
- onClose: (f) => e(u)(t)
59
+ i("div", null, w(t[0].label), 1)
60
+ ])) : (r(!0), u(A, { key: 1 }, R(t, (c, o) => (r(), z(j, {
61
+ key: o,
62
+ active: o === g.value,
63
+ hotkey: (o + 1).toString(),
64
+ icon: c.icon,
65
+ label: c.label,
66
+ onClick: (I) => b(o),
67
+ onClose: (I) => k(o)
36
68
  }, null, 8, ["active", "hotkey", "icon", "label", "onClick", "onClose"]))), 128)),
37
- l("button", {
69
+ i("button", {
38
70
  class: "text-c-3 hover:bg-b-2 p-1.5 rounded-lg webkit-app-no-drag",
39
71
  type: "button",
40
- onClick: r[0] || (r[0] = //@ts-ignore
41
- (...a) => e(i) && e(i)(...a))
72
+ onClick: _
42
73
  }, [
43
- p(e(m), {
74
+ v(d(h), {
44
75
  icon: "Add",
45
76
  size: "xs",
46
77
  thickness: "2.5"
@@ -51,5 +82,5 @@ const w = (o) => (x("data-v-31a24876"), o = o(), y(), o), B = { class: "flex h-1
51
82
  }
52
83
  });
53
84
  export {
54
- F as default
85
+ K as default
55
86
  };
@@ -1,13 +1,17 @@
1
1
  export declare const ROUTES: readonly [{
2
+ readonly prettyName: "Request";
2
3
  readonly name: "request";
3
4
  readonly icon: "ExternalLink";
4
5
  }, {
6
+ readonly prettyName: "Cookies";
5
7
  readonly name: "cookies";
6
8
  readonly icon: "Cookie";
7
9
  }, {
10
+ readonly prettyName: "Env Vars";
8
11
  readonly name: "environment";
9
12
  readonly icon: "Brackets";
10
13
  }, {
14
+ readonly prettyName: "Servers";
11
15
  readonly name: "servers";
12
16
  readonly icon: "Server";
13
17
  }];
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;;;;;;;;;;EAMT,CAAA"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;EAMT,CAAA"}