@scalar/api-client 2.2.22 → 2.2.24

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 (127) hide show
  1. package/CHANGELOG.md +22 -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 +69 -70
  5. package/dist/components/AddressBar/AddressBarServer.vue.d.ts.map +1 -1
  6. package/dist/components/AddressBar/AddressBarServer.vue.js +69 -61
  7. package/dist/components/AddressBar/AddressBarServerItem.vue.d.ts.map +1 -1
  8. package/dist/components/AddressBar/AddressBarServerItem.vue.js +17 -16
  9. package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
  10. package/dist/components/CodeInput/CodeInput.vue.js +2 -2
  11. package/dist/components/CodeInput/CodeInput.vue2.js +46 -46
  12. package/dist/components/CodeInput/codeVariableWidget.d.ts +4 -4
  13. package/dist/components/CodeInput/codeVariableWidget.d.ts.map +1 -1
  14. package/dist/components/CodeInput/codeVariableWidget.js +42 -38
  15. package/dist/components/CommandPalette/CommandPaletteCollection.vue.js +25 -24
  16. package/dist/components/CommandPalette/CommandPaletteExample.vue.d.ts +1 -1
  17. package/dist/components/CommandPalette/CommandPaletteExample.vue.d.ts.map +1 -1
  18. package/dist/components/CommandPalette/CommandPaletteExample.vue.js +64 -55
  19. package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts.map +1 -1
  20. package/dist/components/CommandPalette/CommandPaletteImport.vue.js +110 -106
  21. package/dist/components/CommandPalette/CommandPaletteRequest.vue.js +2 -2
  22. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts +1 -1
  23. package/dist/components/CommandPalette/TheCommandPalette.vue.js +1 -1
  24. package/dist/components/CommandPalette/TheCommandPalette.vue2.js +38 -37
  25. package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.d.ts.map +1 -1
  26. package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +52 -49
  27. package/dist/components/ImportCollection/DropEventListener.vue.d.ts.map +1 -1
  28. package/dist/components/ImportCollection/DropEventListener.vue.js +46 -43
  29. package/dist/components/ImportCollection/ImportCollectionModal.vue.js +40 -39
  30. package/dist/components/ImportCollection/ImportNowButton.vue.js +44 -42
  31. package/dist/components/ImportCollection/WorkspaceSelector.vue.js +76 -69
  32. package/dist/components/ScalarAsciiArt.vue.js +1 -1
  33. package/dist/components/ScalarAsciiArt.vue2.js +22 -19
  34. package/dist/components/Search/useSearch.d.ts.map +1 -1
  35. package/dist/components/Search/useSearch.js +57 -49
  36. package/dist/components/SideNav/SideNavRouterLink.vue.d.ts.map +1 -1
  37. package/dist/components/SideNav/SideNavRouterLink.vue.js +22 -19
  38. package/dist/components/Sidebar/SidebarListElement.vue.d.ts.map +1 -1
  39. package/dist/components/Sidebar/SidebarListElement.vue.js +2 -2
  40. package/dist/components/Sidebar/SidebarListElement.vue2.js +38 -36
  41. package/dist/components/TopNav/TopNav.vue.d.ts.map +1 -1
  42. package/dist/components/TopNav/TopNav.vue.js +71 -64
  43. package/dist/layouts/App/ApiClientApp.vue.js +4 -1
  44. package/dist/layouts/Modal/ApiClientModal.vue.js +2 -2
  45. package/dist/layouts/Modal/ApiClientModal.vue2.js +22 -19
  46. package/dist/layouts/Web/ApiClientWeb.vue.js +4 -1
  47. package/dist/libs/create-client.d.ts +10 -10
  48. package/dist/libs/create-client.d.ts.map +1 -1
  49. package/dist/libs/create-client.js +42 -36
  50. package/dist/libs/extractAttachmentFilename.d.ts +3 -0
  51. package/dist/libs/extractAttachmentFilename.d.ts.map +1 -1
  52. package/dist/libs/extractAttachmentFilename.js +7 -7
  53. package/dist/libs/importers/curl.d.ts.map +1 -1
  54. package/dist/libs/importers/curl.js +18 -18
  55. package/dist/libs/normalize-headers.d.ts.map +1 -1
  56. package/dist/libs/normalize-headers.js +2 -2
  57. package/dist/libs/parse-curl.js +39 -36
  58. package/dist/store/active-entities.d.ts +4 -4
  59. package/dist/store/active-entities.d.ts.map +1 -1
  60. package/dist/store/active-entities.js +88 -86
  61. package/dist/store/collections.d.ts.map +1 -1
  62. package/dist/store/collections.js +29 -29
  63. package/dist/store/request-example.d.ts.map +1 -1
  64. package/dist/store/request-example.js +27 -23
  65. package/dist/store/requests.d.ts.map +1 -1
  66. package/dist/store/requests.js +94 -77
  67. package/dist/store/security-schemes.d.ts.map +1 -1
  68. package/dist/store/security-schemes.js +27 -27
  69. package/dist/store/servers.d.ts.map +1 -1
  70. package/dist/store/servers.js +18 -18
  71. package/dist/store/tags.d.ts.map +1 -1
  72. package/dist/store/tags.js +35 -33
  73. package/dist/style.css +1 -1
  74. package/dist/views/Cookies/CookieForm.vue.d.ts.map +1 -1
  75. package/dist/views/Cookies/CookieForm.vue.js +14 -9
  76. package/dist/views/Cookies/Cookies.vue.d.ts.map +1 -1
  77. package/dist/views/Cookies/Cookies.vue2.js +39 -37
  78. package/dist/views/Environment/Environment.vue.d.ts.map +1 -1
  79. package/dist/views/Environment/Environment.vue2.js +94 -89
  80. package/dist/views/Request/Request.vue.d.ts.map +1 -1
  81. package/dist/views/Request/Request.vue.js +1 -1
  82. package/dist/views/Request/Request.vue2.js +118 -116
  83. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts.map +1 -1
  84. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.js +28 -25
  85. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts.map +1 -1
  86. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +1 -1
  87. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +38 -37
  88. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.d.ts.map +1 -1
  89. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.js +2 -2
  90. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue2.js +76 -73
  91. package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue.js +2 -2
  92. package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue2.js +80 -80
  93. package/dist/views/Request/RequestSection/RequestBody.vue.d.ts.map +1 -1
  94. package/dist/views/Request/RequestSection/RequestBody.vue.js +1 -1
  95. package/dist/views/Request/RequestSection/RequestBody.vue2.js +192 -178
  96. package/dist/views/Request/RequestSection/RequestParams.vue.d.ts.map +1 -1
  97. package/dist/views/Request/RequestSection/RequestParams.vue.js +80 -73
  98. package/dist/views/Request/RequestSection/RequestPathParams.vue.d.ts.map +1 -1
  99. package/dist/views/Request/RequestSection/RequestPathParams.vue.js +50 -48
  100. package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
  101. package/dist/views/Request/RequestSidebar.vue.js +1 -1
  102. package/dist/views/Request/RequestSidebar.vue2.js +149 -144
  103. package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
  104. package/dist/views/Request/RequestSidebarItem.vue.js +2 -2
  105. package/dist/views/Request/RequestSidebarItem.vue2.js +168 -150
  106. package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts.map +1 -1
  107. package/dist/views/Request/RequestSidebarItemMenu.vue.js +4 -4
  108. package/dist/views/Request/RequestSidebarItemMenu.vue2.js +80 -80
  109. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  110. package/dist/views/Request/ResponseSection/ResponseSection.vue.js +1 -1
  111. package/dist/views/Request/ResponseSection/ResponseSection.vue2.js +1 -1
  112. package/dist/views/Request/components/WorkspaceDropdown.vue.d.ts.map +1 -1
  113. package/dist/views/Request/components/WorkspaceDropdown.vue.js +166 -156
  114. package/dist/views/Request/handle-drag.d.ts.map +1 -1
  115. package/dist/views/Request/handle-drag.js +37 -31
  116. package/dist/views/Request/hooks/useOpenApiWatcher.js +27 -27
  117. package/dist/views/Request/libs/live-sync.d.ts.map +1 -1
  118. package/dist/views/Request/libs/live-sync.js +147 -130
  119. package/dist/views/Request/types/sidebar-item.d.ts +4 -1
  120. package/dist/views/Request/types/sidebar-item.d.ts.map +1 -1
  121. package/dist/views/Servers/ServerForm.vue.js +38 -35
  122. package/dist/views/Servers/Servers.vue2.js +38 -35
  123. package/dist/views/Settings/Settings.vue.d.ts.map +1 -1
  124. package/dist/views/Settings/Settings.vue2.js +15 -15
  125. package/dist/views/Settings/SettingsGeneral.vue.d.ts.map +1 -1
  126. package/dist/views/Settings/SettingsGeneral.vue.js +206 -174
  127. package/package.json +8 -8
package/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # @scalar/api-client
2
2
 
3
+ ## 2.2.24
4
+
5
+ ### Patch Changes
6
+
7
+ - 6890d7e: style: updates address bar server ui for multi server type
8
+ - ca2d98b: fix: sets active server on send request for non draft request only
9
+ - 6890d7e: fix: updates selected server logic on collection server selection
10
+ - Updated dependencies [ca2d98b]
11
+ - @scalar/oas-utils@0.2.93
12
+ - @scalar/import@0.2.13
13
+ - @scalar/postman-to-openapi@0.1.16
14
+
15
+ ## 2.2.23
16
+
17
+ ### Patch Changes
18
+
19
+ - 02b4201: fix(api-client): strict TS config (enable noUncheckedIndexedAccess)
20
+ - Updated dependencies [02b4201]
21
+ - @scalar/oas-utils@0.2.92
22
+ - @scalar/import@0.2.12
23
+ - @scalar/postman-to-openapi@0.1.15
24
+
3
25
  ## 2.2.22
4
26
 
5
27
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"AddressBar.vue.d.ts","sourceRoot":"","sources":["../../../src/components/AddressBar/AddressBar.vue"],"names":[],"mappings":";;;;;AAwxBA,wBAMG"}
1
+ {"version":3,"file":"AddressBar.vue.d.ts","sourceRoot":"","sources":["../../../src/components/AddressBar/AddressBar.vue"],"names":[],"mappings":";;;;;AA6xBA,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 f = /* @__PURE__ */ r(o, [["__scopeId", "data-v-cbfd1fad"]]);
4
+ const a = /* @__PURE__ */ r(o, [["__scopeId", "data-v-e6e6f37d"]]);
5
5
  export {
6
- f as default
6
+ a as default
7
7
  };
@@ -1,51 +1,50 @@
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 = {
1
+ import { defineComponent as P, ref as i, computed as D, watch as Q, onMounted as W, onBeforeUnmount as j, unref as o, openBlock as B, createElementBlock as F, createElementVNode as r, createVNode as u, withCtx as E, normalizeClass as S, normalizeStyle as G, createBlock as J, createCommentVNode as V } from "vue";
2
+ import X from "../CodeInput/CodeInput.vue.js";
3
+ import { useActiveEntities as Y } from "../../store/active-entities.js";
4
+ import { Listbox as Z } from "@headlessui/vue";
5
+ import { ScalarButton as ee, ScalarIcon as te } from "@scalar/components";
6
+ import { REQUEST_METHODS as le } from "@scalar/oas-utils/helpers";
7
+ import { isMacOS as oe } from "@scalar/use-tooltip";
8
+ import { useMagicKeys as re, whenever as ae } from "@vueuse/core";
9
+ import se from "../HttpMethod/HttpMethod.vue.js";
10
+ import ne from "./AddressBarHistory.vue.js";
11
+ import ie from "./AddressBarServer.vue.js";
12
+ import { useWorkspace as ue } from "../../store/store.js";
13
+ const de = {
14
14
  key: 0,
15
15
  class: "scalar-address-bar order-last lg:order-none lg:w-auto w-full"
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 = {
16
+ }, fe = { class: "m-auto flex flex-row items-center" }, ce = { class: "pointer-events-none absolute left-0 top-0 block h-full w-full overflow-hidden" }, me = { class: "flex gap-1" }, ve = { class: "codemirror-bg-switcher scroll-timeline-x scroll-timeline-x-hidden relative flex w-full" }, pe = {
17
17
  "aria-hidden": "true",
18
18
  class: "inline-flex gap-1 items-center"
19
- }, Be = /* @__PURE__ */ $({
19
+ }, Se = /* @__PURE__ */ P({
20
20
  __name: "AddressBar",
21
21
  emits: ["importCurl"],
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
- () => d.executeRequest.emit()
22
+ setup(xe) {
23
+ const { activeRequest: l, activeExample: M, activeServer: m, activeCollection: v } = Y(), { isReadOnly: p, requestMutators: c, requestHistory: I, events: d } = ue(), x = i(I[0]), h = i(null), b = re(), U = D(
24
+ () => oe() ? b.meta_enter : b.ctrl_enter
27
25
  );
28
- const U = (e) => {
29
- !l.value || l.value.path === e || m.edit(l.value.uid, "path", e);
26
+ ae(U, () => d.executeRequest.emit());
27
+ const H = (e) => {
28
+ !l.value || l.value.path === e || c.edit(l.value.uid, "path", e);
30
29
  };
31
- P(
30
+ Q(
32
31
  () => {
33
32
  var e;
34
33
  return (e = l.value) == null ? void 0 : e.path;
35
34
  },
36
35
  (e) => {
37
- !l.value || !e || U(e);
36
+ !l.value || !e || H(e);
38
37
  }
39
38
  );
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);
39
+ const a = i(100), g = i(0), s = i(!1), n = i();
40
+ function K() {
41
+ s.value ? a.value -= (a.value - 15) / 60 : a.value -= g.value / 20, a.value <= 0 && (clearInterval(n.value), n.value = void 0, a.value = 100, s.value = !1);
43
42
  }
44
43
  function L() {
45
- n.value || (s.value = !0, n.value = setInterval(H, 20));
44
+ n.value || (s.value = !0, n.value = setInterval(K, 20));
46
45
  }
47
46
  function z() {
48
- b.value = a.value, s.value = !1;
47
+ g.value = a.value, s.value = !1;
49
48
  }
50
49
  function A() {
51
50
  clearInterval(n.value), n.value = void 0, a.value = 100, s.value = !1;
@@ -53,86 +52,86 @@ const ie = {
53
52
  d.requestStatus.on((e) => {
54
53
  e === "start" && L(), e === "stop" && z(), e === "abort" && A();
55
54
  });
56
- function K(e) {
57
- l.value && m.edit(l.value.uid, "method", e);
55
+ function O(e) {
56
+ l.value && c.edit(l.value.uid, "method", e);
58
57
  }
59
- function O() {
58
+ function N() {
60
59
  if (!l.value) return;
61
60
  const { method: e } = l.value;
62
- return ee[e].backgroundColor;
61
+ return le[e].backgroundColor;
63
62
  }
64
- function g() {
63
+ function w() {
65
64
  s.value || (s.value = !0, d.executeRequest.emit());
66
65
  }
67
- function N(e) {
68
- l.value && m.edit(l.value.uid, "path", e);
66
+ function T(e) {
67
+ l.value && c.edit(l.value.uid, "path", e);
69
68
  }
70
- function w(e) {
69
+ function y(e) {
71
70
  var t;
72
- e != null && e.focusAddressBar && ((t = x.value) == null || t.focus());
71
+ e != null && e.focusAddressBar && ((t = h.value) == null || t.focus());
73
72
  }
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)
73
+ return W(() => d.hotKeys.on(y)), j(() => d.hotKeys.off(y)), (e, t) => o(l) && o(M) ? (B(), F("div", de, [
74
+ r("div", fe, [
75
+ u(o(Z), {
76
+ modelValue: x.value,
77
+ "onUpdate:modelValue": t[1] || (t[1] = (f) => x.value = f)
79
78
  }, {
80
- default: B(({ open: f }) => {
81
- var y, C, k, _, R;
79
+ default: E(({ open: f }) => {
80
+ var C, k, _, R, q;
82
81
  return [
83
82
  r("div", {
84
- class: E([
83
+ class: S([
85
84
  "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
85
  { "border-transparent overflow-visible rounded-b-none": f }
87
86
  ])
88
87
  }, [
89
- r("div", de, [
88
+ r("div", ce, [
90
89
  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)` })
90
+ class: S(["bg-mix-transparent bg-mix-amount-90 absolute left-0 top-0 h-full w-full z-context", N()]),
91
+ style: G({ transform: `translate3d(-${a.value}%,0,0)` })
93
92
  }, null, 6)
94
93
  ]),
95
- r("div", fe, [
96
- u(re, {
97
- isEditable: !o(v),
94
+ r("div", me, [
95
+ u(se, {
96
+ isEditable: !o(p),
98
97
  isSquare: "",
99
98
  method: o(l).method,
100
99
  teleport: "",
101
- onChange: K
100
+ onChange: O
102
101
  }, null, 8, ["isEditable", "method"])
103
102
  ]),
104
- r("div", me, [
103
+ r("div", ve, [
105
104
  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, {
105
+ (k = (C = o(v)) == null ? void 0 : C.servers) != null && k.length ? (B(), J(ie, { key: 0 })) : V("", !0),
106
+ u(X, {
108
107
  ref_key: "addressBarRef",
109
- ref: x,
108
+ ref: h,
110
109
  "aria-label": "Path",
111
110
  class: "outline-none",
112
111
  disableCloseBrackets: "",
113
- disabled: o(v),
112
+ disabled: o(p),
114
113
  disableEnter: "",
115
114
  disableTabIndent: "",
116
115
  emitOnBlur: !1,
117
116
  importCurl: "",
118
117
  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",
118
+ placeholder: (_ = o(m)) != null && _.uid && ((q = (R = o(v)) == null ? void 0 : R.servers) != null && q.includes(o(m).uid)) ? "" : "Enter a URL or cURL command",
120
119
  server: "",
121
- onCurl: t[0] || (t[0] = (T) => e.$emit("importCurl", T)),
122
- onSubmit: g,
123
- "onUpdate:modelValue": N
120
+ onCurl: t[0] || (t[0] = ($) => e.$emit("importCurl", $)),
121
+ onSubmit: w,
122
+ "onUpdate:modelValue": T
124
123
  }, null, 8, ["disabled", "modelValue", "placeholder"]),
125
124
  t[3] || (t[3] = r("div", { class: "fade-right" }, null, -1))
126
125
  ]),
127
- u(ae, { open: f }, null, 8, ["open"]),
128
- u(o(Y), {
126
+ u(ne, { open: f }, null, 8, ["open"]),
127
+ u(o(ee), {
129
128
  class: "relative h-auto shrink-0 overflow-hidden !pl-2 !pr-2.5 !py-1 font-bold",
130
129
  disabled: s.value,
131
- onClick: g
130
+ onClick: w
132
131
  }, {
133
- default: B(() => [
134
- r("span", ce, [
135
- u(o(Z), {
132
+ default: E(() => [
133
+ r("span", pe, [
134
+ u(o(te), {
136
135
  class: "relative shrink-0 fill-current",
137
136
  icon: "Play",
138
137
  size: "xs"
@@ -149,9 +148,9 @@ const ie = {
149
148
  _: 1
150
149
  }, 8, ["modelValue"])
151
150
  ])
152
- ])) : S("", !0);
151
+ ])) : V("", !0);
153
152
  }
154
153
  });
155
154
  export {
156
- Be as default
155
+ Se as default
157
156
  };
@@ -1 +1 @@
1
- {"version":3,"file":"AddressBarServer.vue.d.ts","sourceRoot":"","sources":["../../../src/components/AddressBar/AddressBarServer.vue"],"names":[],"mappings":";AA6UA,wBAMG"}
1
+ {"version":3,"file":"AddressBarServer.vue.d.ts","sourceRoot":"","sources":["../../../src/components/AddressBar/AddressBarServer.vue"],"names":[],"mappings":";AAyVA,wBAMG"}
@@ -1,93 +1,101 @@
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 = {
1
+ import { defineComponent as U, computed as i, watch as V, openBlock as l, createBlock as p, unref as o, withCtx as m, createElementBlock as a, createCommentVNode as x, Fragment as d, renderList as b, createVNode as c, createElementVNode as n, createTextVNode as E, toDisplayString as O } from "vue";
2
+ import { useActiveEntities as R } from "../../store/active-entities.js";
3
+ import { ScalarDropdown as W, ScalarDropdownDivider as h, ScalarDropdownItem as I, ScalarIcon as L } from "@scalar/components";
4
+ import g from "./AddressBarServerItem.vue.js";
5
+ import { useWorkspace as T } from "../../store/store.js";
6
+ const j = {
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
- }, j = {
9
+ }, z = {
10
10
  key: 0,
11
- class: "text-xxs text-c-2 ml-8"
12
- }, z = { class: "flex items-center justify-center h-4 w-4" }, H = /* @__PURE__ */ B({
11
+ class: "text-xxs text-c-2 px-2.5 py-1"
12
+ }, F = { class: "flex items-center justify-center h-4 w-4" }, J = /* @__PURE__ */ U({
13
13
  __name: "AddressBarServer",
14
- setup(F) {
15
- const { activeRequest: x, activeCollection: f, activeServer: u } = O(), { isReadOnly: g, servers: S, collectionMutators: A, events: C } = L(), w = i(
14
+ setup(M) {
15
+ const { activeRequest: u, activeCollection: f, activeServer: v } = R(), { isReadOnly: A, servers: S, collectionMutators: C, events: D } = T(), y = i(
16
16
  () => {
17
- var t, e;
18
- return (e = (t = x.value) == null ? void 0 : t.servers) == null ? void 0 : e.map((r) => {
19
- var n;
17
+ var r, e;
18
+ return (e = (r = u.value) == null ? void 0 : r.servers) == null ? void 0 : e.map((t) => {
19
+ var s;
20
20
  return {
21
- id: r,
22
- label: ((n = S[r]) == null ? void 0 : n.url) ?? "Unknown server"
21
+ id: t,
22
+ label: ((s = S[t]) == null ? void 0 : s.url) ?? "Unknown server"
23
23
  };
24
24
  });
25
25
  }
26
- ), y = i(
26
+ ), w = i(
27
27
  () => {
28
- var t, e;
29
- return (e = (t = f.value) == null ? void 0 : t.servers) == null ? void 0 : e.map((r) => {
30
- var n;
31
- return {
32
- id: r,
33
- label: ((n = S[r]) == null ? void 0 : n.url) ?? "Unknown server"
34
- };
35
- });
28
+ var r, e;
29
+ return (
30
+ // Filters out servers already present in the request
31
+ (e = (r = f.value) == null ? void 0 : r.servers) == null ? void 0 : e.filter(
32
+ (t) => {
33
+ var s, _;
34
+ return !((_ = (s = u.value) == null ? void 0 : s.servers) != null && _.includes(t));
35
+ }
36
+ ).map((t) => {
37
+ var s;
38
+ return {
39
+ id: t,
40
+ label: ((s = S[t]) == null ? void 0 : s.url) ?? "Unknown server"
41
+ };
42
+ })
43
+ );
36
44
  }
37
45
  ), k = i(
38
46
  () => {
39
- var t, e;
40
- return ((t = w.value) == null ? void 0 : t.length) && ((e = y.value) == null ? void 0 : e.length);
47
+ var r, e;
48
+ return ((r = y.value) == null ? void 0 : r.length) && ((e = w.value) == null ? void 0 : e.length);
41
49
  }
42
50
  );
43
- U([f, x], ([t, e]) => {
44
- !t || t.selectedServerUid || e != null && e.selectedServerUid || A.edit(
45
- t.uid,
46
- "selectedServerUid",
47
- t.servers[0]
48
- );
51
+ V([f, u], ([r, e]) => {
52
+ var s;
53
+ if (!r || r.selectedServerUid || e != null && e.selectedServerUid)
54
+ return;
55
+ const t = (s = r.servers) == null ? void 0 : s[0];
56
+ t && C.edit(r.uid, "selectedServerUid", t);
49
57
  });
50
- const D = () => C.commandPalette.emit({
58
+ const N = () => D.commandPalette.emit({
51
59
  commandName: "Add Server"
52
- }), N = i(() => {
53
- var t, e, r;
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) || "";
60
+ }), B = i(() => {
61
+ var r, e, t;
62
+ return (e = (r = v.value) == null ? void 0 : r.url) != null && e.endsWith("/") ? v.value.url.slice(0, -1) : ((t = v.value) == null ? void 0 : t.url) || "";
55
63
  });
56
- return (t, e) => (s(), v(l(R), {
64
+ return (r, e) => (l(), p(o(W), {
57
65
  class: "w-max",
58
66
  teleport: ""
59
67
  }, {
60
68
  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,
69
+ k.value ? (l(), a("div", z, " Request ")) : x("", !0),
70
+ (l(!0), a(d, null, b(y.value, (t) => (l(), p(g, {
71
+ key: t.id,
72
+ serverOption: t,
65
73
  type: "request"
66
74
  }, 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,
75
+ k.value ? (l(), a(d, { key: 1 }, [
76
+ c(o(h)),
77
+ e[1] || (e[1] = n("div", { class: "text-xxs text-c-2 px-2.5 py-1" }, "Collection", -1))
78
+ ], 64)) : x("", !0),
79
+ (l(!0), a(d, null, b(w.value, (t) => (l(), p(g, {
80
+ key: t.id,
81
+ serverOption: t,
74
82
  type: "collection"
75
83
  }, null, 8, ["serverOption"]))), 128)),
76
- l(g) ? p("", !0) : (s(), a(d, { key: 2 }, [
77
- c(l(b)),
78
- c(l(W), null, {
84
+ o(A) ? x("", !0) : (l(), a(d, { key: 2 }, [
85
+ c(o(h)),
86
+ c(o(I), null, {
79
87
  default: m(() => [
80
- o("div", {
88
+ n("div", {
81
89
  class: "font-code text-xxs flex items-center gap-1.5",
82
- onClick: D
90
+ onClick: N
83
91
  }, [
84
- o("div", z, [
85
- c(l(I), {
92
+ n("div", F, [
93
+ c(o(L), {
86
94
  icon: "Add",
87
95
  size: "sm"
88
96
  })
89
97
  ]),
90
- e[2] || (e[2] = o("span", null, "Add Server", -1))
98
+ e[2] || (e[2] = n("span", null, "Add Server", -1))
91
99
  ])
92
100
  ]),
93
101
  _: 1
@@ -95,9 +103,9 @@ const T = {
95
103
  ], 64))
96
104
  ]),
97
105
  default: m(() => [
98
- o("button", T, [
99
- e[0] || (e[0] = o("span", { class: "sr-only" }, "Server:", -1)),
100
- V(" " + E(N.value), 1)
106
+ n("button", j, [
107
+ e[0] || (e[0] = n("span", { class: "sr-only" }, "Server:", -1)),
108
+ E(" " + O(B.value), 1)
101
109
  ])
102
110
  ]),
103
111
  _: 1
@@ -105,5 +113,5 @@ const T = {
105
113
  }
106
114
  });
107
115
  export {
108
- H as default
116
+ J as default
109
117
  };
@@ -1 +1 @@
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
+ {"version":3,"file":"AddressBarServerItem.vue.d.ts","sourceRoot":"","sources":["../../../src/components/AddressBar/AddressBarServerItem.vue"],"names":[],"mappings":"AAyEA,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,wBAyJK"}
@@ -1,48 +1,49 @@
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";
1
+ import { defineComponent as m, openBlock as f, createBlock as S, unref as l, withCtx as h, createElementVNode as n, normalizeClass as w, createVNode as k, toDisplayString as x } from "vue";
2
+ import { useActiveEntities as g } from "../../store/active-entities.js";
3
3
  import { ScalarDropdownItem as y, ScalarIcon as C } from "@scalar/components";
4
4
  import { useWorkspace as O } from "../../store/store.js";
5
- const b = { class: "whitespace-nowrap text-ellipsis overflow-hidden" }, _ = /* @__PURE__ */ v({
5
+ const b = { class: "whitespace-nowrap text-ellipsis overflow-hidden" }, _ = /* @__PURE__ */ m({
6
6
  __name: "AddressBarServerItem",
7
7
  props: {
8
8
  serverOption: {},
9
9
  type: {}
10
10
  },
11
- setup(l) {
12
- const r = l, { activeCollection: o, activeRequest: s, activeServer: a } = x(), { collectionMutators: c, requestMutators: p } = O(), d = (e) => {
13
- r.type === "collection" && o.value ? c.edit(
11
+ setup(a) {
12
+ const i = a, { activeCollection: o, activeRequest: r, activeServer: c } = g(), { collectionMutators: p, requestMutators: d } = O(), u = (e) => {
13
+ var t, s;
14
+ i.type === "collection" && o.value ? ((s = (t = r.value) == null ? void 0 : t.servers) != null && s.length && (r.value.selectedServerUid = ""), p.edit(
14
15
  o.value.uid,
15
16
  "selectedServerUid",
16
17
  e
17
- ) : r.type === "request" && s.value && p.edit(
18
- s.value.uid,
18
+ )) : i.type === "request" && r.value && d.edit(
19
+ r.value.uid,
19
20
  "selectedServerUid",
20
21
  e
21
22
  );
22
- }, u = (e) => {
23
+ }, v = (e) => {
23
24
  var t;
24
- return ((t = a.value) == null ? void 0 : t.uid) === e;
25
+ return ((t = c.value) == null ? void 0 : t.uid) === e;
25
26
  };
26
- return (e, t) => (m(), f(i(y), {
27
+ return (e, t) => (f(), S(l(y), {
27
28
  key: "serverOption.id",
28
29
  class: "flex gap-1.5 group/item items-center whitespace-nowrap text-ellipsis overflow-hidden w-full",
29
30
  value: e.serverOption.id,
30
- onClick: t[0] || (t[0] = (g) => d(e.serverOption.id))
31
+ onClick: t[0] || (t[0] = (s) => u(e.serverOption.id))
31
32
  }, {
32
- default: S(() => [
33
+ default: h(() => [
33
34
  n("div", {
34
35
  class: w([
35
36
  "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"
37
+ v(e.serverOption.id) ? "bg-c-accent text-b-1" : "group-hover/item:shadow-border text-transparent"
37
38
  ])
38
39
  }, [
39
- h(i(C), {
40
+ k(l(C), {
40
41
  icon: "Checkmark",
41
42
  size: "xs",
42
43
  thickness: "2.5"
43
44
  })
44
45
  ], 2),
45
- n("span", b, k(e.serverOption.label), 1)
46
+ n("span", b, x(e.serverOption.label), 1)
46
47
  ]),
47
48
  _: 1
48
49
  }, 8, ["value"]));
@@ -1 +1 @@
1
- {"version":3,"file":"CodeInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CodeInput/CodeInput.vue"],"names":[],"mappings":"AAAA,OA8cO,EAGL,KAAK,kBAAkB,EAGxB,MAAM,wBAAwB,CAAA;;kBAkBb,OAAO;gBACT,MAAM,GAAG,MAAM;YACnB,OAAO;iBACF,OAAO;kBACN,OAAO;WACd,OAAO;uBACK,OAAO;eACf,kBAAkB;wBACT,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;wBACnB,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;kBACzB,MAAM;eACT,OAAO;mBACH,OAAO;2BACC,OAAO;WACvB,MAAM,EAAE;WACR,MAAM;eACF,OAAO;oBACF,OAAO;iBACV,OAAO;iBACP,OAAO;cACV,MAAM,GAAG,MAAM;;;;;;;;kBApBX,OAAO;gBACT,MAAM,GAAG,MAAM;YACnB,OAAO;iBACF,OAAO;kBACN,OAAO;WACd,OAAO;uBACK,OAAO;eACf,kBAAkB;wBACT,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;wBACnB,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;kBACzB,MAAM;eACT,OAAO;mBACH,OAAO;2BACC,OAAO;WACvB,MAAM,EAAE;WACR,MAAM;eACF,OAAO;oBACF,OAAO;iBACV,OAAO;iBACP,OAAO;cACV,MAAM,GAAG,MAAM;;;;;;gBAjBZ,OAAO;iBAHN,OAAO;sBAMF,OAAO;kBAMX,OAAO;0BACC,OAAO;cAGnB,OAAO;mBACF,OAAO;gBAEV,OAAO;;qBAqZM,GAAG;kBACN,GAAG;;AA5a9B,wBAweC;AAgBD,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"CodeInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CodeInput/CodeInput.vue"],"names":[],"mappings":"AAAA,OAgdO,EAGL,KAAK,kBAAkB,EAGxB,MAAM,wBAAwB,CAAA;;kBAkBb,OAAO;gBACT,MAAM,GAAG,MAAM;YACnB,OAAO;iBACF,OAAO;kBACN,OAAO;WACd,OAAO;uBACK,OAAO;eACf,kBAAkB;wBACT,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;wBACnB,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;kBACzB,MAAM;eACT,OAAO;mBACH,OAAO;2BACC,OAAO;WACvB,MAAM,EAAE;WACR,MAAM;eACF,OAAO;oBACF,OAAO;iBACV,OAAO;iBACP,OAAO;cACV,MAAM,GAAG,MAAM;;;;;;;;kBApBX,OAAO;gBACT,MAAM,GAAG,MAAM;YACnB,OAAO;iBACF,OAAO;kBACN,OAAO;WACd,OAAO;uBACK,OAAO;eACf,kBAAkB;wBACT,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;wBACnB,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;kBACzB,MAAM;eACT,OAAO;mBACH,OAAO;2BACC,OAAO;WACvB,MAAM,EAAE;WACR,MAAM;eACF,OAAO;oBACF,OAAO;iBACV,OAAO;iBACP,OAAO;cACV,MAAM,GAAG,MAAM;;;;;;gBAjBZ,OAAO;iBAHN,OAAO;sBAMF,OAAO;kBAMX,OAAO;0BACC,OAAO;cAGnB,OAAO;mBACF,OAAO;gBAEV,OAAO;;qBAuZM,GAAG;kBACN,GAAG;;AA9a9B,wBA0eC;AAgBD,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -2,7 +2,7 @@ import o from "./CodeInput.vue2.js";
2
2
  /* empty css */
3
3
  /* empty css */
4
4
  import t from "../../_virtual/_plugin-vue_export-helper.js";
5
- const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-4b3bb606"]]);
5
+ const _ = /* @__PURE__ */ t(o, [["__scopeId", "data-v-958f2326"]]);
6
6
  export {
7
- a as default
7
+ _ as default
8
8
  };