@scalar/api-client 2.2.11 → 2.2.15

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 (34) hide show
  1. package/CHANGELOG.md +57 -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 +114 -111
  5. package/dist/components/AddressBar/AddressBarServer.vue.d.ts.map +1 -1
  6. package/dist/components/AddressBar/AddressBarServer.vue.js +74 -81
  7. package/dist/components/AddressBar/AddressBarServerItem.vue.d.ts.map +1 -1
  8. package/dist/components/AddressBar/AddressBarServerItem.vue.js +19 -18
  9. package/dist/components/SideNav/SideNav.vue.js +6 -6
  10. package/dist/components/Sidebar/Sidebar.vue.js +2 -2
  11. package/dist/components/Sidebar/Sidebar.vue2.js +1 -1
  12. package/dist/components/ViewLayout/ViewLayoutSection.vue.js +3 -3
  13. package/dist/layouts/App/create-api-client-app.d.ts +1 -1
  14. package/dist/layouts/Modal/ApiClientModal.vue.d.ts.map +1 -1
  15. package/dist/layouts/Modal/ApiClientModal.vue.js +2 -2
  16. package/dist/layouts/Modal/create-api-client-modal.d.ts +2 -2
  17. package/dist/layouts/Web/create-api-client-web.d.ts +1 -1
  18. package/dist/libs/create-client.d.ts +1 -1
  19. package/dist/libs/create-client.d.ts.map +1 -1
  20. package/dist/libs/create-client.js +64 -51
  21. package/dist/libs/send-request/send-request.d.ts.map +1 -1
  22. package/dist/libs/send-request/send-request.js +47 -45
  23. package/dist/style.css +1 -1
  24. package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue.d.ts.map +1 -1
  25. package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue.js +1 -1
  26. package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue2.js +49 -48
  27. package/dist/views/Request/RequestSection/RequestPathParams.vue.d.ts.map +1 -1
  28. package/dist/views/Request/RequestSection/RequestPathParams.vue.js +53 -51
  29. package/dist/views/Request/RequestSection/RequestSection.vue.js +2 -2
  30. package/dist/views/Request/RequestSection/RequestSection.vue2.js +15 -15
  31. package/dist/views/Request/RequestSubpageHeader.vue.js +3 -3
  32. package/dist/views/Request/RequestSubpageHeader.vue2.js +1 -1
  33. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  34. package/package.json +11 -11
package/CHANGELOG.md CHANGED
@@ -1,5 +1,62 @@
1
1
  # @scalar/api-client
2
2
 
3
+ ## 2.2.15
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [c263aaf]
8
+ - Updated dependencies [573d113]
9
+ - Updated dependencies [c263aaf]
10
+ - @scalar/types@0.0.25
11
+ - @scalar/oas-utils@0.2.90
12
+ - @scalar/openapi-parser@0.10.1
13
+ - @scalar/themes@0.9.57
14
+ - @scalar/import@0.2.9
15
+ - @scalar/postman-to-openapi@0.1.13
16
+ - @scalar/components@0.13.7
17
+ - @scalar/use-hooks@0.1.10
18
+ - @scalar/use-codemirror@0.11.51
19
+
20
+ ## 2.2.14
21
+
22
+ ### Patch Changes
23
+
24
+ - 984e394: fix: hides flow row for unique scheme flow
25
+ - 40ec239: fix: updates address bar servers dropdown display logic
26
+
27
+ ## 2.2.13
28
+
29
+ ### Patch Changes
30
+
31
+ - 23daedd: feat(components): create ScalarHeader component
32
+ - Updated dependencies [23daedd]
33
+ - @scalar/components@0.13.6
34
+ - @scalar/themes@0.9.56
35
+ - @scalar/use-codemirror@0.11.50
36
+ - @scalar/oas-utils@0.2.89
37
+ - @scalar/use-hooks@0.1.9
38
+ - @scalar/import@0.2.8
39
+ - @scalar/postman-to-openapi@0.1.12
40
+
41
+ ## 2.2.12
42
+
43
+ ### Patch Changes
44
+
45
+ - fbef0c3: fix: displays server path variables
46
+ - fbef0c3: fix: sets server variables values in client
47
+ - Updated dependencies [fbef0c3]
48
+ - Updated dependencies [fbef0c3]
49
+ - Updated dependencies [fbef0c3]
50
+ - @scalar/openapi-parser@0.10.0
51
+ - @scalar/types@0.0.24
52
+ - @scalar/import@0.2.7
53
+ - @scalar/oas-utils@0.2.88
54
+ - @scalar/themes@0.9.55
55
+ - @scalar/postman-to-openapi@0.1.11
56
+ - @scalar/components@0.13.5
57
+ - @scalar/use-hooks@0.1.8
58
+ - @scalar/use-codemirror@0.11.49
59
+
3
60
  ## 2.2.11
4
61
 
5
62
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"AddressBar.vue.d.ts","sourceRoot":"","sources":["../../../src/components/AddressBar/AddressBar.vue"],"names":[],"mappings":";;;;;AAswBA,wBAMG"}
1
+ {"version":3,"file":"AddressBar.vue.d.ts","sourceRoot":"","sources":["../../../src/components/AddressBar/AddressBar.vue"],"names":[],"mappings":";;;;;AAuxBA,wBAMG"}
@@ -1,7 +1,7 @@
1
1
  import o from "./AddressBar.vue2.js";
2
2
  /* empty css */
3
3
  import r from "../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-455b0236"]]);
4
+ const f = /* @__PURE__ */ r(o, [["__scopeId", "data-v-cb8f6677"]]);
5
5
  export {
6
- m as default
6
+ f as default
7
7
  };
@@ -1,154 +1,157 @@
1
- import { defineComponent as H, ref as u, watch as L, onMounted as z, onBeforeUnmount as A, unref as a, openBlock as K, createElementBlock as O, createElementVNode as o, createVNode as n, withCtx as w, normalizeClass as y, normalizeStyle as N, createCommentVNode as T } from "vue";
2
- import $ from "../CodeInput/CodeInput.vue.js";
3
- import { useActiveEntities as P } from "../../store/active-entities.js";
4
- import { Listbox as D } from "@headlessui/vue";
5
- import { ScalarButton as Q, ScalarIcon as W } from "@scalar/components";
6
- import { REQUEST_METHODS as j } from "@scalar/oas-utils/helpers";
7
- import { isMacOS as F } from "@scalar/use-tooltip";
8
- import { useMagicKeys as G, whenever as J } from "@vueuse/core";
9
- import X from "../HttpMethod/HttpMethod.vue.js";
10
- import Y from "./AddressBarHistory.vue.js";
11
- import Z from "./AddressBarServer.vue.js";
12
- import { useWorkspace as ee } from "../../store/store.js";
13
- const te = {
1
+ import { defineComponent as $, ref as i, watch as P, onMounted as D, onBeforeUnmount as Q, unref as o, openBlock as q, createElementBlock as W, createElementVNode as r, createVNode as u, withCtx as B, normalizeClass as E, normalizeStyle as j, createBlock as F, createCommentVNode as S } from "vue";
2
+ import G from "../CodeInput/CodeInput.vue.js";
3
+ import { useActiveEntities as J } from "../../store/active-entities.js";
4
+ import { Listbox as X } from "@headlessui/vue";
5
+ import { ScalarButton as Y, ScalarIcon as Z } from "@scalar/components";
6
+ import { REQUEST_METHODS as ee } from "@scalar/oas-utils/helpers";
7
+ import { isMacOS as te } from "@scalar/use-tooltip";
8
+ import { useMagicKeys as le, whenever as oe } from "@vueuse/core";
9
+ import re from "../HttpMethod/HttpMethod.vue.js";
10
+ import ae from "./AddressBarHistory.vue.js";
11
+ import se from "./AddressBarServer.vue.js";
12
+ import { useWorkspace as ne } from "../../store/store.js";
13
+ const ie = {
14
14
  key: 0,
15
15
  class: "order-last lg:order-none lg:w-auto w-full"
16
- }, le = { class: "m-auto flex flex-row items-center" }, oe = { class: "pointer-events-none absolute left-0 top-0 block h-full w-full overflow-hidden" }, ae = { class: "flex gap-1" }, re = { class: "codemirror-bg-switcher scroll-timeline-x scroll-timeline-x-hidden relative flex w-full" }, se = {
16
+ }, ue = { class: "m-auto flex flex-row items-center" }, de = { class: "pointer-events-none absolute left-0 top-0 block h-full w-full overflow-hidden" }, fe = { class: "flex gap-1" }, me = { class: "codemirror-bg-switcher scroll-timeline-x scroll-timeline-x-hidden relative flex w-full" }, ce = {
17
17
  "aria-hidden": "true",
18
18
  class: "inline-flex gap-1 items-center"
19
- }, we = /* @__PURE__ */ H({
19
+ }, Be = /* @__PURE__ */ $({
20
20
  __name: "AddressBar",
21
21
  emits: ["importCurl"],
22
- setup(ne) {
23
- const { activeRequest: l, activeExample: C, activeServer: _ } = P(), { isReadOnly: c, requestMutators: m, requestHistory: R, events: d } = ee(), v = u(R[0]), p = u(null), x = G();
24
- J(
25
- F() ? x.meta_enter : x.ctrl_enter,
22
+ setup(ve) {
23
+ const { activeRequest: l, activeExample: V, activeServer: M, activeCollection: c } = J(), { isReadOnly: v, requestMutators: m, requestHistory: I, events: d } = ne(), p = i(I[0]), x = i(null), h = le();
24
+ oe(
25
+ te() ? h.meta_enter : h.ctrl_enter,
26
26
  () => d.executeRequest.emit()
27
27
  );
28
- const k = (e) => {
28
+ const U = (e) => {
29
29
  !l.value || l.value.path === e || m.edit(l.value.uid, "path", e);
30
30
  };
31
- L(
31
+ P(
32
32
  () => {
33
33
  var e;
34
34
  return (e = l.value) == null ? void 0 : e.path;
35
35
  },
36
36
  (e) => {
37
- !l.value || !e || k(e);
37
+ !l.value || !e || U(e);
38
38
  }
39
39
  );
40
- const r = u(100), h = u(0), s = u(!1), i = u();
41
- function q() {
42
- s.value ? r.value -= (r.value - 15) / 60 : r.value -= h.value / 20, r.value <= 0 && (clearInterval(i.value), i.value = void 0, r.value = 100, s.value = !1);
40
+ const a = i(100), b = i(0), s = i(!1), n = i();
41
+ function H() {
42
+ s.value ? a.value -= (a.value - 15) / 60 : a.value -= b.value / 20, a.value <= 0 && (clearInterval(n.value), n.value = void 0, a.value = 100, s.value = !1);
43
43
  }
44
- function B() {
45
- i.value || (s.value = !0, i.value = setInterval(q, 20));
44
+ function L() {
45
+ n.value || (s.value = !0, n.value = setInterval(H, 20));
46
46
  }
47
- function E() {
48
- h.value = r.value, s.value = !1;
47
+ function z() {
48
+ b.value = a.value, s.value = !1;
49
49
  }
50
- function S() {
51
- clearInterval(i.value), i.value = void 0, r.value = 100, s.value = !1;
50
+ function A() {
51
+ clearInterval(n.value), n.value = void 0, a.value = 100, s.value = !1;
52
52
  }
53
53
  d.requestStatus.on((e) => {
54
- e === "start" && B(), e === "stop" && E(), e === "abort" && S();
54
+ e === "start" && L(), e === "stop" && z(), e === "abort" && A();
55
55
  });
56
- function V(e) {
56
+ function K(e) {
57
57
  l.value && m.edit(l.value.uid, "method", e);
58
58
  }
59
- function M() {
59
+ function O() {
60
60
  if (!l.value) return;
61
61
  const { method: e } = l.value;
62
- return j[e].backgroundColor;
62
+ return ee[e].backgroundColor;
63
63
  }
64
- function b() {
64
+ function g() {
65
65
  s.value || (s.value = !0, d.executeRequest.emit());
66
66
  }
67
- function I(e) {
67
+ function N(e) {
68
68
  l.value && m.edit(l.value.uid, "path", e);
69
69
  }
70
- function g(e) {
70
+ function w(e) {
71
71
  var t;
72
- e != null && e.focusAddressBar && ((t = p.value) == null || t.focus());
72
+ e != null && e.focusAddressBar && ((t = x.value) == null || t.focus());
73
73
  }
74
- return z(() => d.hotKeys.on(g)), A(() => d.hotKeys.off(g)), (e, t) => a(l) && a(C) ? (K(), O("div", te, [
75
- o("div", le, [
76
- n(a(D), {
77
- modelValue: v.value,
78
- "onUpdate:modelValue": t[1] || (t[1] = (f) => v.value = f)
74
+ return D(() => d.hotKeys.on(w)), Q(() => d.hotKeys.off(w)), (e, t) => o(l) && o(V) ? (q(), W("div", ie, [
75
+ r("div", ue, [
76
+ u(o(X), {
77
+ modelValue: p.value,
78
+ "onUpdate:modelValue": t[1] || (t[1] = (f) => p.value = f)
79
79
  }, {
80
- default: w(({ open: f }) => [
81
- o("div", {
82
- class: y([
83
- "addressbar-bg-states text-xxs relative flex w-full xl:min-w-[720px] xl:max-w-[720px] lg:min-w-[580px] lg:max-w-[580px] order-last overflow-hidden lg:order-none flex-1 flex-row items-stretch rounded-lg border-1/2 p-[3px]",
84
- { "border-transparent overflow-visible rounded-b-none": f }
85
- ])
86
- }, [
87
- o("div", oe, [
88
- o("div", {
89
- class: y(["bg-mix-transparent bg-mix-amount-90 absolute left-0 top-0 h-full w-full z-context", M()]),
90
- style: N({ transform: `translate3d(-${r.value}%,0,0)` })
91
- }, null, 6)
92
- ]),
93
- o("div", ae, [
94
- n(X, {
95
- isEditable: !a(c),
96
- isSquare: "",
97
- method: a(l).method,
98
- teleport: "",
99
- onChange: V
100
- }, null, 8, ["isEditable", "method"])
101
- ]),
102
- o("div", re, [
103
- t[2] || (t[2] = o("div", { class: "fade-left" }, null, -1)),
104
- n(Z),
105
- n($, {
106
- ref_key: "addressBarRef",
107
- ref: p,
108
- "aria-label": "Path",
109
- class: "outline-none",
110
- disableCloseBrackets: "",
111
- disabled: a(c),
112
- disableEnter: "",
113
- disableTabIndent: "",
114
- emitOnBlur: !1,
115
- importCurl: "",
116
- modelValue: a(l).path,
117
- placeholder: a(_) ? "" : "Enter a URL or cURL command",
118
- server: "",
119
- onCurl: t[0] || (t[0] = (U) => e.$emit("importCurl", U)),
120
- onSubmit: b,
121
- "onUpdate:modelValue": I
122
- }, null, 8, ["disabled", "modelValue", "placeholder"]),
123
- t[3] || (t[3] = o("div", { class: "fade-right" }, null, -1))
124
- ]),
125
- n(Y, { open: f }, null, 8, ["open"]),
126
- n(a(Q), {
127
- class: "relative h-auto shrink-0 overflow-hidden !pl-2 !pr-2.5 !py-1 font-bold",
128
- disabled: s.value,
129
- onClick: b
130
- }, {
131
- default: w(() => [
132
- o("span", se, [
133
- n(a(W), {
134
- class: "relative shrink-0 fill-current",
135
- icon: "Play",
136
- size: "xs"
137
- }),
138
- t[4] || (t[4] = o("span", { class: "text-xxs lg:flex hidden" }, "Send", -1))
139
- ]),
140
- t[5] || (t[5] = o("span", { class: "sr-only" }, " Send Request ", -1))
80
+ default: B(({ open: f }) => {
81
+ var y, C, k, _, R;
82
+ return [
83
+ r("div", {
84
+ class: E([
85
+ "addressbar-bg-states text-xxs relative flex w-full xl:min-w-[720px] xl:max-w-[720px] lg:min-w-[580px] lg:max-w-[580px] order-last overflow-hidden lg:order-none flex-1 flex-row items-stretch rounded-lg border-1/2 p-[3px]",
86
+ { "border-transparent overflow-visible rounded-b-none": f }
87
+ ])
88
+ }, [
89
+ r("div", de, [
90
+ r("div", {
91
+ class: E(["bg-mix-transparent bg-mix-amount-90 absolute left-0 top-0 h-full w-full z-context", O()]),
92
+ style: j({ transform: `translate3d(-${a.value}%,0,0)` })
93
+ }, null, 6)
94
+ ]),
95
+ r("div", fe, [
96
+ u(re, {
97
+ isEditable: !o(v),
98
+ isSquare: "",
99
+ method: o(l).method,
100
+ teleport: "",
101
+ onChange: K
102
+ }, null, 8, ["isEditable", "method"])
141
103
  ]),
142
- _: 1
143
- }, 8, ["disabled"])
144
- ], 2)
145
- ]),
104
+ r("div", me, [
105
+ t[2] || (t[2] = r("div", { class: "fade-left" }, null, -1)),
106
+ (C = (y = o(c)) == null ? void 0 : y.servers) != null && C.length ? (q(), F(se, { key: 0 })) : S("", !0),
107
+ u(G, {
108
+ ref_key: "addressBarRef",
109
+ ref: x,
110
+ "aria-label": "Path",
111
+ class: "outline-none",
112
+ disableCloseBrackets: "",
113
+ disabled: o(v),
114
+ disableEnter: "",
115
+ disableTabIndent: "",
116
+ emitOnBlur: !1,
117
+ importCurl: "",
118
+ modelValue: o(l).path,
119
+ placeholder: (R = (k = o(c)) == null ? void 0 : k.servers) != null && R.includes((_ = o(M)) == null ? void 0 : _.uid) ? "" : "Enter a URL or cURL command",
120
+ server: "",
121
+ onCurl: t[0] || (t[0] = (T) => e.$emit("importCurl", T)),
122
+ onSubmit: g,
123
+ "onUpdate:modelValue": N
124
+ }, null, 8, ["disabled", "modelValue", "placeholder"]),
125
+ t[3] || (t[3] = r("div", { class: "fade-right" }, null, -1))
126
+ ]),
127
+ u(ae, { open: f }, null, 8, ["open"]),
128
+ u(o(Y), {
129
+ class: "relative h-auto shrink-0 overflow-hidden !pl-2 !pr-2.5 !py-1 font-bold",
130
+ disabled: s.value,
131
+ onClick: g
132
+ }, {
133
+ default: B(() => [
134
+ r("span", ce, [
135
+ u(o(Z), {
136
+ class: "relative shrink-0 fill-current",
137
+ icon: "Play",
138
+ size: "xs"
139
+ }),
140
+ t[4] || (t[4] = r("span", { class: "text-xxs lg:flex hidden" }, "Send", -1))
141
+ ]),
142
+ t[5] || (t[5] = r("span", { class: "sr-only" }, " Send Request ", -1))
143
+ ]),
144
+ _: 1
145
+ }, 8, ["disabled"])
146
+ ], 2)
147
+ ];
148
+ }),
146
149
  _: 1
147
150
  }, 8, ["modelValue"])
148
151
  ])
149
- ])) : T("", !0);
152
+ ])) : S("", !0);
150
153
  }
151
154
  });
152
155
  export {
153
- we as default
156
+ Be as default
154
157
  };
@@ -1 +1 @@
1
- {"version":3,"file":"AddressBarServer.vue.d.ts","sourceRoot":"","sources":["../../../src/components/AddressBar/AddressBarServer.vue"],"names":[],"mappings":";AAoWA,wBAKG"}
1
+ {"version":3,"file":"AddressBarServer.vue.d.ts","sourceRoot":"","sources":["../../../src/components/AddressBar/AddressBarServer.vue"],"names":[],"mappings":";AA6UA,wBAMG"}
@@ -1,116 +1,109 @@
1
- import { defineComponent as V, computed as c, watch as E, openBlock as l, createBlock as S, unref as o, withCtx as w, createElementBlock as n, createCommentVNode as v, Fragment as m, renderList as g, createVNode as p, createElementVNode as a, createTextVNode as O, toDisplayString as b } from "vue";
2
- import { useActiveEntities as R } from "../../store/active-entities.js";
3
- import { ScalarDropdown as W, ScalarDropdownDivider as A, ScalarDropdownItem as I, ScalarIcon as L } from "@scalar/components";
4
- import C from "./AddressBarServerItem.vue.js";
5
- import { useWorkspace as T } from "../../store/store.js";
6
- const j = {
1
+ import { defineComponent as B, computed as i, watch as U, openBlock as s, createBlock as v, unref as l, withCtx as m, createElementBlock as a, createCommentVNode as p, Fragment as d, renderList as _, createVNode as c, createElementVNode as o, createTextVNode as V, toDisplayString as E } from "vue";
2
+ import { useActiveEntities as O } from "../../store/active-entities.js";
3
+ import { ScalarDropdown as R, ScalarDropdownDivider as b, ScalarDropdownItem as W, ScalarIcon as I } from "@scalar/components";
4
+ import h from "./AddressBarServerItem.vue.js";
5
+ import { useWorkspace as L } from "../../store/store.js";
6
+ const T = {
7
7
  class: "font-code lg:text-sm text-xs whitespace-nowrap border border-b-3 border-solid rounded px-1.5 py-0.5 text-c-2 -outline-offset-1",
8
8
  type: "button"
9
- }, z = {
9
+ }, j = {
10
10
  key: 0,
11
11
  class: "text-xxs text-c-2 ml-8"
12
- }, F = { class: "flex items-center justify-center h-4 w-4" }, M = {
13
- key: 1,
14
- class: "flex whitespace-nowrap items-center font-code lg:text-sm text-xs"
15
- }, K = /* @__PURE__ */ V({
12
+ }, z = { class: "flex items-center justify-center h-4 w-4" }, H = /* @__PURE__ */ B({
16
13
  __name: "AddressBarServer",
17
- setup(P) {
18
- const { activeRequest: y, activeCollection: k, activeServer: x } = R(), { isReadOnly: D, servers: _, collectionMutators: N, events: B } = T(), d = c(
14
+ setup(F) {
15
+ const { activeRequest: x, activeCollection: f, activeServer: u } = O(), { isReadOnly: g, servers: S, collectionMutators: A, events: C } = L(), w = i(
19
16
  () => {
20
17
  var t, e;
21
- return (e = (t = y.value) == null ? void 0 : t.servers) == null ? void 0 : e.map((r) => {
22
- var s;
18
+ return (e = (t = x.value) == null ? void 0 : t.servers) == null ? void 0 : e.map((r) => {
19
+ var n;
23
20
  return {
24
21
  id: r,
25
- label: ((s = _[r]) == null ? void 0 : s.url) ?? "Unknown server"
22
+ label: ((n = S[r]) == null ? void 0 : n.url) ?? "Unknown server"
26
23
  };
27
24
  });
28
25
  }
29
- ), u = c(
26
+ ), y = i(
30
27
  () => {
31
28
  var t, e;
32
- return (e = (t = k.value) == null ? void 0 : t.servers) == null ? void 0 : e.map((r) => {
33
- var s;
29
+ return (e = (t = f.value) == null ? void 0 : t.servers) == null ? void 0 : e.map((r) => {
30
+ var n;
34
31
  return {
35
32
  id: r,
36
- label: ((s = _[r]) == null ? void 0 : s.url) ?? "Unknown server"
33
+ label: ((n = S[r]) == null ? void 0 : n.url) ?? "Unknown server"
37
34
  };
38
35
  });
39
36
  }
40
- ), h = c(
37
+ ), k = i(
41
38
  () => {
42
39
  var t, e;
43
- return ((t = d.value) == null ? void 0 : t.length) && ((e = u.value) == null ? void 0 : e.length);
40
+ return ((t = w.value) == null ? void 0 : t.length) && ((e = y.value) == null ? void 0 : e.length);
44
41
  }
45
42
  );
46
- E([k, y], ([t, e]) => {
47
- !t || t.selectedServerUid || e != null && e.selectedServerUid || N.edit(
43
+ U([f, x], ([t, e]) => {
44
+ !t || t.selectedServerUid || e != null && e.selectedServerUid || A.edit(
48
45
  t.uid,
49
46
  "selectedServerUid",
50
47
  t.servers[0]
51
48
  );
52
49
  });
53
- const U = () => B.commandPalette.emit({
50
+ const D = () => C.commandPalette.emit({
54
51
  commandName: "Add Server"
55
- }), f = c(() => {
52
+ }), N = i(() => {
56
53
  var t, e, r;
57
- return (e = (t = x.value) == null ? void 0 : t.url) != null && e.endsWith("/") ? x.value.url.slice(0, -1) : ((r = x.value) == null ? void 0 : r.url) || "";
54
+ return (e = (t = u.value) == null ? void 0 : t.url) != null && e.endsWith("/") ? u.value.url.slice(0, -1) : ((r = u.value) == null ? void 0 : r.url) || "";
58
55
  });
59
- return (t, e) => {
60
- var r, s;
61
- return d.value && ((r = d.value) == null ? void 0 : r.length) > 1 || u.value && ((s = u.value) == null ? void 0 : s.length) > 1 ? (l(), S(o(W), {
62
- key: 0,
63
- class: "w-max",
64
- teleport: ""
65
- }, {
66
- items: w(() => [
67
- h.value ? (l(), n("div", z, " Request Servers ")) : v("", !0),
68
- (l(!0), n(m, null, g(d.value, (i) => (l(), S(C, {
69
- key: i.id,
70
- serverOption: i,
71
- type: "request"
72
- }, null, 8, ["serverOption"]))), 128)),
73
- h.value ? (l(), n(m, { key: 1 }, [
74
- p(o(A)),
75
- e[1] || (e[1] = a("div", { class: "text-xxs text-c-2 ml-8" }, "Collection Servers", -1))
76
- ], 64)) : v("", !0),
77
- (l(!0), n(m, null, g(u.value, (i) => (l(), S(C, {
78
- key: i.id,
79
- serverOption: i,
80
- type: "collection"
81
- }, null, 8, ["serverOption"]))), 128)),
82
- o(D) ? v("", !0) : (l(), n(m, { key: 2 }, [
83
- p(o(A)),
84
- p(o(I), null, {
85
- default: w(() => [
86
- a("div", {
87
- class: "font-code text-xxs flex items-center gap-1.5",
88
- onClick: U
89
- }, [
90
- a("div", F, [
91
- p(o(L), {
92
- icon: "Add",
93
- size: "sm"
94
- })
95
- ]),
96
- e[2] || (e[2] = a("span", null, "Add Server", -1))
97
- ])
98
- ]),
99
- _: 1
100
- })
101
- ], 64))
102
- ]),
103
- default: w(() => [
104
- a("button", j, [
105
- e[0] || (e[0] = a("span", { class: "sr-only" }, "Server:", -1)),
106
- O(" " + b(f.value), 1)
107
- ])
108
- ]),
109
- _: 1
110
- })) : f.value ? (l(), n("div", M, b(f.value), 1)) : v("", !0);
111
- };
56
+ return (t, e) => (s(), v(l(R), {
57
+ class: "w-max",
58
+ teleport: ""
59
+ }, {
60
+ items: m(() => [
61
+ k.value ? (s(), a("div", j, " Request Servers ")) : p("", !0),
62
+ (s(!0), a(d, null, _(w.value, (r) => (s(), v(h, {
63
+ key: r.id,
64
+ serverOption: r,
65
+ type: "request"
66
+ }, null, 8, ["serverOption"]))), 128)),
67
+ k.value ? (s(), a(d, { key: 1 }, [
68
+ c(l(b)),
69
+ e[1] || (e[1] = o("div", { class: "text-xxs text-c-2 ml-8" }, "Collection Servers", -1))
70
+ ], 64)) : p("", !0),
71
+ (s(!0), a(d, null, _(y.value, (r) => (s(), v(h, {
72
+ key: r.id,
73
+ serverOption: r,
74
+ type: "collection"
75
+ }, null, 8, ["serverOption"]))), 128)),
76
+ l(g) ? p("", !0) : (s(), a(d, { key: 2 }, [
77
+ c(l(b)),
78
+ c(l(W), null, {
79
+ default: m(() => [
80
+ o("div", {
81
+ class: "font-code text-xxs flex items-center gap-1.5",
82
+ onClick: D
83
+ }, [
84
+ o("div", z, [
85
+ c(l(I), {
86
+ icon: "Add",
87
+ size: "sm"
88
+ })
89
+ ]),
90
+ e[2] || (e[2] = o("span", null, "Add Server", -1))
91
+ ])
92
+ ]),
93
+ _: 1
94
+ })
95
+ ], 64))
96
+ ]),
97
+ default: m(() => [
98
+ o("button", T, [
99
+ e[0] || (e[0] = o("span", { class: "sr-only" }, "Server:", -1)),
100
+ V(" " + E(N.value), 1)
101
+ ])
102
+ ]),
103
+ _: 1
104
+ }));
112
105
  }
113
106
  });
114
107
  export {
115
- K as default
108
+ H as default
116
109
  };
@@ -1 +1 @@
1
- {"version":3,"file":"AddressBarServerItem.vue.d.ts","sourceRoot":"","sources":["../../../src/components/AddressBar/AddressBarServerItem.vue"],"names":[],"mappings":"AAoEA,MAAM,MAAM,YAAY,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CACvD;;kBAIe,YAAY;UACpB,YAAY,GAAG,SAAS;;kBADhB,YAAY;UACpB,YAAY,GAAG,SAAS;;AAJhC,wBAuJK"}
1
+ {"version":3,"file":"AddressBarServerItem.vue.d.ts","sourceRoot":"","sources":["../../../src/components/AddressBar/AddressBarServerItem.vue"],"names":[],"mappings":"AAqEA,MAAM,MAAM,YAAY,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CACvD;;kBAIe,YAAY;UACpB,YAAY,GAAG,SAAS;;kBADhB,YAAY;UACpB,YAAY,GAAG,SAAS;;AAJhC,wBAqJK"}
@@ -1,15 +1,15 @@
1
- import { defineComponent as v, openBlock as f, createBlock as m, unref as i, withCtx as S, createElementVNode as a, normalizeClass as x, createVNode as h, toDisplayString as w } from "vue";
2
- import { useActiveEntities as k } from "../../store/active-entities.js";
3
- import { ScalarDropdownItem as C, ScalarIcon as g } from "@scalar/components";
4
- import { useWorkspace as y } from "../../store/store.js";
5
- const O = { class: "whitespace-nowrap text-ellipsis overflow-hidden" }, _ = /* @__PURE__ */ v({
1
+ import { defineComponent as v, openBlock as m, createBlock as f, unref as i, withCtx as S, createElementVNode as n, normalizeClass as w, createVNode as h, toDisplayString as k } from "vue";
2
+ import { useActiveEntities as x } from "../../store/active-entities.js";
3
+ import { ScalarDropdownItem as y, ScalarIcon as C } from "@scalar/components";
4
+ import { useWorkspace as O } from "../../store/store.js";
5
+ const b = { class: "whitespace-nowrap text-ellipsis overflow-hidden" }, _ = /* @__PURE__ */ v({
6
6
  __name: "AddressBarServerItem",
7
7
  props: {
8
8
  serverOption: {},
9
9
  type: {}
10
10
  },
11
11
  setup(l) {
12
- const r = l, { activeCollection: o, activeRequest: s, activeServer: n } = k(), { collectionMutators: c, requestMutators: p } = y(), d = (e) => {
12
+ const r = l, { activeCollection: o, activeRequest: s, activeServer: a } = x(), { collectionMutators: c, requestMutators: p } = O(), d = (e) => {
13
13
  r.type === "collection" && o.value ? c.edit(
14
14
  o.value.uid,
15
15
  "selectedServerUid",
@@ -21,27 +21,28 @@ const O = { class: "whitespace-nowrap text-ellipsis overflow-hidden" }, _ = /* @
21
21
  );
22
22
  }, u = (e) => {
23
23
  var t;
24
- return ((t = n.value) == null ? void 0 : t.uid) === e;
24
+ return ((t = a.value) == null ? void 0 : t.uid) === e;
25
25
  };
26
- return (e, t) => (f(), m(i(C), {
27
- class: "flex !gap-1.5 group font-code text-xxs whitespace-nowrap text-ellipsis overflow-hidden",
26
+ return (e, t) => (m(), f(i(y), {
27
+ key: "serverOption.id",
28
+ class: "flex gap-1.5 group/item items-center whitespace-nowrap text-ellipsis overflow-hidden w-full",
28
29
  value: e.serverOption.id,
29
- onClick: t[0] || (t[0] = (b) => d(e.serverOption.id))
30
+ onClick: t[0] || (t[0] = (g) => d(e.serverOption.id))
30
31
  }, {
31
32
  default: S(() => [
32
- a("div", {
33
- class: x([
34
- "flex size-4 items-center justify-center rounded-full p-[3px]",
35
- u(e.serverOption.id) ? "bg-c-accent text-b-1" : "group-hover:shadow-border text-transparent"
33
+ n("div", {
34
+ class: w([
35
+ "flex size-4 items-center justify-center p-0.75 text-b-1 rounded-full",
36
+ u(e.serverOption.id) ? "bg-c-accent text-b-1" : "group-hover/item:shadow-border text-transparent"
36
37
  ])
37
38
  }, [
38
- h(i(g), {
39
- class: "relative top-[0.5px] size-2.5",
39
+ h(i(C), {
40
40
  icon: "Checkmark",
41
- thickness: "3.5"
41
+ size: "xs",
42
+ thickness: "2.5"
42
43
  })
43
44
  ], 2),
44
- a("span", O, w(e.serverOption.label), 1)
45
+ n("span", b, k(e.serverOption.label), 1)
45
46
  ]),
46
47
  _: 1
47
48
  }, 8, ["value"]));