@scalar/api-client 2.2.35 → 2.2.38

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 (164) hide show
  1. package/CHANGELOG.md +61 -0
  2. package/dist/components/AddressBar/AddressBar.vue.d.ts.map +1 -1
  3. package/dist/components/AddressBar/AddressBar.vue.js +1 -1
  4. package/dist/components/AddressBar/AddressBar.vue2.js +107 -116
  5. package/dist/components/AddressBar/AddressBarHistory.vue.d.ts +2 -1
  6. package/dist/components/AddressBar/AddressBarHistory.vue.d.ts.map +1 -1
  7. package/dist/components/AddressBar/AddressBarHistory.vue.js +2 -2
  8. package/dist/components/AddressBar/AddressBarHistory.vue2.js +96 -76
  9. package/dist/components/AddressBar/AddressBarServer.vue.d.ts +5 -1
  10. package/dist/components/AddressBar/AddressBarServer.vue.d.ts.map +1 -1
  11. package/dist/components/AddressBar/AddressBarServer.vue.js +92 -86
  12. package/dist/components/AddressBar/AddressBarServerItem.vue.d.ts +7 -10
  13. package/dist/components/AddressBar/AddressBarServerItem.vue.d.ts.map +1 -1
  14. package/dist/components/AddressBar/AddressBarServerItem.vue.js +5 -52
  15. package/dist/components/AddressBar/AddressBarServerItem.vue2.js +75 -2
  16. package/dist/components/CodeInput/CodeInput.vue.d.ts +5 -0
  17. package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
  18. package/dist/components/CodeInput/CodeInput.vue.js +1 -1
  19. package/dist/components/CodeInput/CodeInput.vue2.js +126 -112
  20. package/dist/components/CodeInput/codeVariableWidget.d.ts +1 -4
  21. package/dist/components/CodeInput/codeVariableWidget.d.ts.map +1 -1
  22. package/dist/components/CommandPalette/CommandActionInput.vue.d.ts +1 -0
  23. package/dist/components/CommandPalette/CommandActionInput.vue.d.ts.map +1 -1
  24. package/dist/components/CommandPalette/CommandActionInput.vue.js +21 -18
  25. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -1
  26. package/dist/components/CommandPalette/TheCommandPalette.vue.js +2 -2
  27. package/dist/components/CommandPalette/TheCommandPalette.vue2.js +2 -2
  28. package/dist/components/DataTable/DataTableInput.vue.d.ts.map +1 -1
  29. package/dist/components/DataTable/DataTableInput.vue.js +2 -2
  30. package/dist/components/DataTable/DataTableInputSelect.vue.d.ts +1 -0
  31. package/dist/components/DataTable/DataTableInputSelect.vue.d.ts.map +1 -1
  32. package/dist/components/DataTable/DataTableInputSelect.vue.js +86 -54
  33. package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.d.ts.map +1 -1
  34. package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +22 -21
  35. package/dist/components/Form/Form.vue.d.ts.map +1 -1
  36. package/dist/components/Form/Form.vue.js +3 -3
  37. package/dist/components/Server/ServerVariablesForm.vue.d.ts +14 -0
  38. package/dist/components/Server/ServerVariablesForm.vue.d.ts.map +1 -0
  39. package/dist/components/Server/ServerVariablesForm.vue.js +47 -0
  40. package/dist/components/Server/ServerVariablesForm.vue2.js +4 -0
  41. package/dist/components/Server/ServerVariablesSelect.vue.d.ts +12 -0
  42. package/dist/components/Server/ServerVariablesSelect.vue.d.ts.map +1 -0
  43. package/dist/components/Server/ServerVariablesSelect.vue.js +54 -0
  44. package/dist/components/Server/ServerVariablesSelect.vue2.js +4 -0
  45. package/dist/components/Server/ServerVariablesTextbox.vue.d.ts +11 -0
  46. package/dist/components/Server/ServerVariablesTextbox.vue.d.ts.map +1 -0
  47. package/dist/components/Server/ServerVariablesTextbox.vue.js +29 -0
  48. package/dist/components/Server/ServerVariablesTextbox.vue2.js +4 -0
  49. package/dist/components/Server/types.d.ts +9 -0
  50. package/dist/components/Server/types.d.ts.map +1 -0
  51. package/dist/components/SideNav/SideHelp.vue.js +16 -16
  52. package/dist/components/Sidebar/Sidebar.vue.d.ts.map +1 -1
  53. package/dist/components/Sidebar/Sidebar.vue.js +2 -2
  54. package/dist/components/Sidebar/Sidebar.vue2.js +11 -10
  55. package/dist/components/Sidebar/SidebarListElement.vue.d.ts.map +1 -1
  56. package/dist/components/Sidebar/SidebarListElement.vue.js +1 -1
  57. package/dist/components/Sidebar/SidebarListElement.vue2.js +10 -9
  58. package/dist/components/TopNav/TopNav.vue.js +27 -27
  59. package/dist/components/ViewLayout/ViewLayoutCollapse.vue.d.ts +1 -1
  60. package/dist/components/ViewLayout/ViewLayoutCollapse.vue.d.ts.map +1 -1
  61. package/dist/layouts/App/create-api-client-app.d.ts +99 -84
  62. package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
  63. package/dist/layouts/Modal/create-api-client-modal.d.ts +198 -168
  64. package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
  65. package/dist/layouts/Web/create-api-client-web.d.ts +99 -84
  66. package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
  67. package/dist/libs/create-client.d.ts +110 -90
  68. package/dist/libs/create-client.d.ts.map +1 -1
  69. package/dist/libs/create-client.js +86 -81
  70. package/dist/libs/find-request.d.ts.map +1 -1
  71. package/dist/libs/importers/curl.js +4 -4
  72. package/dist/libs/index.js +18 -19
  73. package/dist/libs/send-request/index.js +3 -4
  74. package/dist/libs/send-request/send-request.d.ts +0 -14
  75. package/dist/libs/send-request/send-request.d.ts.map +1 -1
  76. package/dist/libs/send-request/send-request.js +120 -142
  77. package/dist/libs/send-request/set-request-cookies.d.ts +27 -0
  78. package/dist/libs/send-request/set-request-cookies.d.ts.map +1 -0
  79. package/dist/libs/send-request/set-request-cookies.js +54 -0
  80. package/dist/store/active-entities.d.ts +13 -4
  81. package/dist/store/active-entities.d.ts.map +1 -1
  82. package/dist/store/active-entities.js +15 -12
  83. package/dist/store/collections.d.ts.map +1 -1
  84. package/dist/store/cookies.d.ts +4 -58
  85. package/dist/store/cookies.d.ts.map +1 -1
  86. package/dist/store/cookies.js +5 -17
  87. package/dist/store/import-spec.d.ts.map +1 -1
  88. package/dist/store/request-example.d.ts +52 -2
  89. package/dist/store/request-example.d.ts.map +1 -1
  90. package/dist/store/requests.d.ts +2 -2
  91. package/dist/store/requests.d.ts.map +1 -1
  92. package/dist/store/servers.d.ts +40 -20
  93. package/dist/store/servers.d.ts.map +1 -1
  94. package/dist/store/store.d.ts +99 -86
  95. package/dist/store/store.d.ts.map +1 -1
  96. package/dist/store/store.js +51 -53
  97. package/dist/style.css +1 -1
  98. package/dist/views/Cookies/CookieForm.vue.d.ts.map +1 -1
  99. package/dist/views/Cookies/CookieForm.vue.js +24 -37
  100. package/dist/views/Cookies/CookieModal.vue.d.ts +21 -0
  101. package/dist/views/Cookies/CookieModal.vue.d.ts.map +1 -0
  102. package/dist/views/Cookies/CookieModal.vue.js +7 -0
  103. package/dist/views/Cookies/CookieModal.vue2.js +88 -0
  104. package/dist/views/Cookies/Cookies.vue.d.ts.map +1 -1
  105. package/dist/views/Cookies/Cookies.vue2.js +98 -119
  106. package/dist/views/Environment/Environment.vue2.js +1 -1
  107. package/dist/views/Request/Request.vue.d.ts.map +1 -1
  108. package/dist/views/Request/Request.vue.js +2 -2
  109. package/dist/views/Request/Request.vue2.js +88 -89
  110. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts.map +1 -1
  111. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +1 -1
  112. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +87 -88
  113. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.d.ts +2 -1
  114. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.d.ts.map +1 -1
  115. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.js +3 -3
  116. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue2.js +16 -17
  117. package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue.js +2 -2
  118. package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue2.js +1 -1
  119. package/dist/views/Request/RequestSection/RequestBody.vue.js +2 -2
  120. package/dist/views/Request/RequestSection/RequestBody.vue2.js +34 -34
  121. package/dist/views/Request/RequestSection/RequestParams.vue.d.ts +7 -0
  122. package/dist/views/Request/RequestSection/RequestParams.vue.d.ts.map +1 -1
  123. package/dist/views/Request/RequestSection/RequestParams.vue.js +79 -66
  124. package/dist/views/Request/RequestSection/RequestPathParams.vue.d.ts.map +1 -1
  125. package/dist/views/Request/RequestSection/RequestPathParams.vue.js +57 -74
  126. package/dist/views/Request/RequestSection/RequestSection.vue.d.ts.map +1 -1
  127. package/dist/views/Request/RequestSection/RequestSection.vue.js +2 -2
  128. package/dist/views/Request/RequestSection/RequestSection.vue2.js +91 -64
  129. package/dist/views/Request/RequestSection/RequestTable.vue.d.ts +9 -2
  130. package/dist/views/Request/RequestSection/RequestTable.vue.d.ts.map +1 -1
  131. package/dist/views/Request/RequestSection/RequestTable.vue.js +2 -2
  132. package/dist/views/Request/RequestSection/RequestTable.vue2.js +168 -129
  133. package/dist/views/Request/RequestSection/RequestTableTooltip.vue.d.ts.map +1 -1
  134. package/dist/views/Request/RequestSection/RequestTableTooltip.vue.js +5 -64
  135. package/dist/views/Request/RequestSection/RequestTableTooltip.vue2.js +46 -2
  136. package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
  137. package/dist/views/Request/RequestSidebar.vue.js +2 -2
  138. package/dist/views/Request/RequestSidebar.vue2.js +143 -143
  139. package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
  140. package/dist/views/Request/RequestSidebarItem.vue.js +1 -1
  141. package/dist/views/Request/RequestSidebarItem.vue2.js +71 -71
  142. package/dist/views/Request/RequestSubpageHeader.vue.d.ts.map +1 -1
  143. package/dist/views/Request/RequestSubpageHeader.vue.js +1 -1
  144. package/dist/views/Request/RequestSubpageHeader.vue2.js +37 -37
  145. package/dist/views/Request/ResponseSection/ResponseCookies.vue.js +19 -17
  146. package/dist/views/Request/ResponseSection/ResponseEmpty.vue.d.ts.map +1 -1
  147. package/dist/views/Request/ResponseSection/ResponseEmpty.vue.js +2 -2
  148. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +27 -27
  149. package/dist/views/Request/ResponseSection/ResponseHeaders.vue.js +31 -31
  150. package/dist/views/Request/handle-drag.d.ts +1 -1
  151. package/dist/views/Request/handle-drag.d.ts.map +1 -1
  152. package/dist/views/Request/handle-drag.js +27 -26
  153. package/dist/views/Request/hooks/useOpenApiWatcher.js +1 -1
  154. package/dist/views/Request/libs/request.d.ts +12 -0
  155. package/dist/views/Request/libs/request.d.ts.map +1 -0
  156. package/dist/views/Request/libs/request.js +4 -0
  157. package/dist/views/Request/libs/{live-sync.d.ts → watch-mode.d.ts} +1 -1
  158. package/dist/views/Request/libs/watch-mode.d.ts.map +1 -0
  159. package/dist/views/Request/libs/{live-sync.js → watch-mode.js} +6 -6
  160. package/dist/views/Servers/Servers.vue2.js +29 -29
  161. package/package.json +10 -12
  162. package/dist/views/Cookies/CookieRaw.vue.js +0 -28
  163. package/dist/views/Cookies/CookieRaw.vue2.js +0 -4
  164. package/dist/views/Request/libs/live-sync.d.ts.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,66 @@
1
1
  # @scalar/api-client
2
2
 
3
+ ## 2.2.38
4
+
5
+ ### Patch Changes
6
+
7
+ - 7a18a2d: feat: favors layout hook over isReadOnly
8
+ - 12e7232: feat: adds parameter examples support
9
+ - b0d5511: fix: addressbar stylel in modal
10
+ - 974234f: fix: server variable type mismatch
11
+ - 6400bfc: feat: revamps address bar server menu
12
+ - 901970f: fix: removes application/json content type as default
13
+ - 6400bfc: feat: removes server from request variables table
14
+ - a4ec7fa: refactor: use request entity for TestRequestButton
15
+ - 5ab0663: feat: adds request example array multiselect
16
+ - 917214a: chore: update Scalar support email
17
+ - 42b58bf: fix: updates address bar ui
18
+ - 2ed681b: fix: updates markup in unordered list
19
+ - Updated dependencies [12e7232]
20
+ - Updated dependencies [8b5d905]
21
+ - Updated dependencies [776a4e2]
22
+ - Updated dependencies [2ed681b]
23
+ - Updated dependencies [8665004]
24
+ - Updated dependencies [4f12fe4]
25
+ - Updated dependencies [702c386]
26
+ - Updated dependencies [901970f]
27
+ - Updated dependencies [5ab0663]
28
+ - Updated dependencies [f1f39b0]
29
+ - Updated dependencies [917214a]
30
+ - Updated dependencies [f1f39b0]
31
+ - Updated dependencies [776a4e2]
32
+ - @scalar/oas-utils@0.2.100
33
+ - @scalar/components@0.13.17
34
+ - @scalar/themes@0.9.62
35
+ - @scalar/types@0.0.28
36
+ - @scalar/import@0.2.20
37
+ - @scalar/postman-to-openapi@0.1.23
38
+ - @scalar/use-codemirror@0.11.62
39
+ - @scalar/use-hooks@0.1.16
40
+ - @scalar/openapi-parser@0.10.4
41
+
42
+ ## 2.2.37
43
+
44
+ ### Patch Changes
45
+
46
+ - 9276103: fix: add back in using index as a key in a couple places
47
+ - de6cd98: feat: adds query parameters array support
48
+
49
+ ## 2.2.36
50
+
51
+ ### Patch Changes
52
+
53
+ - ca381b6: fix: avoids index as a key in list rendering
54
+ - c803e2d: feat: cookies 🍪
55
+ - ca381b6: fix: updates param tooltip function and style
56
+ - Updated dependencies [c803e2d]
57
+ - Updated dependencies [aac6c86]
58
+ - @scalar/oas-utils@0.2.99
59
+ - @scalar/components@0.13.16
60
+ - @scalar/import@0.2.19
61
+ - @scalar/postman-to-openapi@0.1.22
62
+ - @scalar/use-codemirror@0.11.61
63
+
3
64
  ## 2.2.35
4
65
 
5
66
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"AddressBar.vue.d.ts","sourceRoot":"","sources":["../../../src/components/AddressBar/AddressBar.vue"],"names":[],"mappings":";;;;;AAmwBA,wBAMG"}
1
+ {"version":3,"file":"AddressBar.vue.d.ts","sourceRoot":"","sources":["../../../src/components/AddressBar/AddressBar.vue"],"names":[],"mappings":";;;;;AA0vBA,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 a = /* @__PURE__ */ r(o, [["__scopeId", "data-v-1dff60b8"]]);
4
+ const a = /* @__PURE__ */ r(o, [["__scopeId", "data-v-893bff81"]]);
5
5
  export {
6
6
  a as default
7
7
  };
@@ -1,151 +1,142 @@
1
- import { defineComponent as T, ref as n, watch as $, unref as a, openBlock as _, createElementBlock as P, createElementVNode as r, createVNode as u, withCtx as y, normalizeClass as B, normalizeStyle as D, createBlock as K, createCommentVNode as E } from "vue";
2
- import Q from "../CodeInput/CodeInput.vue.js";
3
- import { useActiveEntities as W } from "../../store/active-entities.js";
4
- import { Listbox as j } from "@headlessui/vue";
5
- import { ScalarButton as F, ScalarIcon as G } from "@scalar/components";
6
- import { REQUEST_METHODS as J } from "@scalar/oas-utils/helpers";
7
- import X from "../HttpMethod/HttpMethod.vue.js";
8
- import Y from "./AddressBarHistory.vue.js";
9
- import Z from "./AddressBarServer.vue.js";
10
- import { useWorkspace as ee } from "../../store/store.js";
11
- const le = {
12
- key: 0,
13
- class: "scalar-address-bar order-last lg:order-none lg:w-auto w-full"
14
- }, te = { class: "m-auto flex flex-row items-center" }, ae = { class: "pointer-events-none absolute left-0 top-0 block h-full w-full overflow-hidden" }, re = { class: "flex gap-1" }, oe = { class: "codemirror-bg-switcher scroll-timeline-x scroll-timeline-x-hidden relative flex w-full" }, se = {
1
+ import { defineComponent as M, useId as H, ref as n, watch as N, unref as l, openBlock as q, createElementBlock as T, createElementVNode as r, normalizeClass as $, normalizeStyle as O, createVNode as u, createBlock as P, createCommentVNode as y, withCtx as D } from "vue";
2
+ import K from "../CodeInput/CodeInput.vue.js";
3
+ import { useActiveEntities as Q } from "../../store/active-entities.js";
4
+ import { ScalarButton as W, ScalarIcon as j } from "@scalar/components";
5
+ import { REQUEST_METHODS as F } from "@scalar/oas-utils/helpers";
6
+ import G from "../HttpMethod/HttpMethod.vue.js";
7
+ import J from "./AddressBarHistory.vue.js";
8
+ import X from "./AddressBarServer.vue.js";
9
+ import { useWorkspace as Y } from "../../store/store.js";
10
+ import { useLayout as Z } from "../../hooks/useLayout.js";
11
+ const ee = ["id"], te = { class: "m-auto flex flex-row items-center" }, le = { class: "addressbar-bg-states group text-xxs relative flex w-full xl:min-w-[720px] xl:max-w-[720px] lg:min-w-[580px] lg:max-w-[580px] order-last lg:order-none flex-1 flex-row items-stretch rounded-lg p-0.75 max-w-[calc(100dvw-24px)]" }, ae = { class: "border rounded-lg pointer-events-none absolute left-0 top-0 block h-full w-full overflow-hidden" }, re = { class: "flex gap-1 z-context-plus" }, oe = { class: "codemirror-bg-switcher scroll-timeline-x scroll-timeline-x-hidden z-context-plus relative flex w-full" }, se = {
15
12
  "aria-hidden": "true",
16
13
  class: "inline-flex gap-1 items-center"
17
- }, be = /* @__PURE__ */ T({
14
+ }, ge = /* @__PURE__ */ M({
18
15
  __name: "AddressBar",
19
16
  emits: ["importCurl"],
20
17
  setup(ie) {
21
- const { activeRequest: l, activeExample: S, activeServer: v, activeCollection: p } = W(), { isReadOnly: x, requestMutators: f, requestHistory: V, events: c } = ee(), h = n(V[0]), b = n(null), I = (e) => {
22
- !l.value || l.value.path === e || f.edit(l.value.uid, "path", e);
18
+ const d = H(), { activeRequest: t, activeExample: B, activeServer: v, activeCollection: p } = Q(), { requestMutators: c, events: f } = Y(), { layout: x } = Z(), h = n(null), E = (e) => {
19
+ !t.value || t.value.path === e || c.edit(t.value.uid, "path", e);
23
20
  };
24
- $(
21
+ N(
25
22
  () => {
26
23
  var e;
27
- return (e = l.value) == null ? void 0 : e.path;
24
+ return (e = t.value) == null ? void 0 : e.path;
28
25
  },
29
26
  (e) => {
30
- !l.value || !e || I(e);
27
+ !t.value || !e || E(e);
31
28
  }
32
29
  );
33
30
  const o = n(100), g = n(0), s = n(!1), i = n();
34
- function U() {
31
+ function R() {
35
32
  s.value ? o.value -= (o.value - 15) / 60 : o.value -= g.value / 20, o.value <= 0 && (clearInterval(i.value), i.value = void 0, o.value = 100, s.value = !1);
36
33
  }
37
- function L() {
38
- i.value || (s.value = !0, i.value = setInterval(U, 20));
34
+ function S() {
35
+ i.value || (s.value = !0, i.value = setInterval(R, 20));
39
36
  }
40
37
  function z() {
41
38
  g.value = o.value, s.value = !1;
42
39
  }
43
- function A() {
40
+ function I() {
44
41
  clearInterval(i.value), i.value = void 0, o.value = 100, s.value = !1;
45
42
  }
46
- c.requestStatus.on((e) => {
47
- e === "start" && L(), e === "stop" && z(), e === "abort" && A();
43
+ f.requestStatus.on((e) => {
44
+ e === "start" && S(), e === "stop" && z(), e === "abort" && I();
48
45
  });
49
- function H(e) {
50
- l.value && f.edit(l.value.uid, "method", e);
46
+ function V(e) {
47
+ t.value && c.edit(t.value.uid, "method", e);
51
48
  }
52
- function M() {
53
- if (!l.value) return;
54
- const { method: e } = l.value;
55
- return J[e].backgroundColor;
49
+ function L() {
50
+ if (!t.value) return;
51
+ const { method: e } = t.value;
52
+ return F[e].backgroundColor;
56
53
  }
57
54
  function m() {
58
55
  var e;
59
- s.value || (s.value = !0, c.executeRequest.emit({ requestUid: (e = l.value) == null ? void 0 : e.uid }));
56
+ s.value || (s.value = !0, f.executeRequest.emit({ requestUid: (e = t.value) == null ? void 0 : e.uid }));
60
57
  }
61
- c.hotKeys.on((e) => {
62
- var t;
63
- e != null && e.focusAddressBar && ((t = b.value) == null || t.focus()), e != null && e.executeRequest && m();
58
+ f.hotKeys.on((e) => {
59
+ var a;
60
+ e != null && e.focusAddressBar && ((a = h.value) == null || a.focus()), e != null && e.executeRequest && m();
64
61
  });
65
- function N(e) {
66
- l.value && f.edit(l.value.uid, "path", e);
62
+ function U(e) {
63
+ t.value && c.edit(t.value.uid, "path", e);
67
64
  }
68
- return (e, t) => a(l) && a(S) ? (_(), P("div", le, [
69
- r("div", te, [
70
- u(a(j), {
71
- modelValue: h.value,
72
- "onUpdate:modelValue": t[1] || (t[1] = (d) => h.value = d)
73
- }, {
74
- default: y(({ open: d }) => {
75
- var w, C, k, q, R;
76
- return [
65
+ return (e, a) => {
66
+ var b, w, C, _, k;
67
+ return l(t) && l(B) ? (q(), T("div", {
68
+ key: 0,
69
+ id: l(d),
70
+ class: "scalar-address-bar order-last lg:order-none lg:w-auto w-full [--scalar-address-bar-height:32px] h-[--scalar-address-bar-height]"
71
+ }, [
72
+ r("div", te, [
73
+ r("div", le, [
74
+ r("div", ae, [
77
75
  r("div", {
78
- class: B([
79
- "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]",
80
- { "border-transparent overflow-visible rounded-b-none": d }
81
- ])
82
- }, [
83
- r("div", ae, [
84
- r("div", {
85
- class: B(["bg-mix-transparent bg-mix-amount-90 absolute left-0 top-0 h-full w-full z-context", M()]),
86
- style: D({ transform: `translate3d(-${o.value}%,0,0)` })
87
- }, null, 6)
88
- ]),
89
- r("div", re, [
90
- u(X, {
91
- isEditable: !a(x),
92
- isSquare: "",
93
- method: a(l).method,
94
- teleport: "",
95
- onChange: H
96
- }, null, 8, ["isEditable", "method"])
76
+ class: $(["bg-mix-transparent bg-mix-amount-90 absolute left-0 top-0 h-full w-full z-context", L()]),
77
+ style: O({ transform: `translate3d(-${o.value}%,0,0)` })
78
+ }, null, 6)
79
+ ]),
80
+ r("div", re, [
81
+ u(G, {
82
+ isEditable: l(x) !== "modal",
83
+ isSquare: "",
84
+ method: l(t).method,
85
+ teleport: "",
86
+ onChange: V
87
+ }, null, 8, ["isEditable", "method"])
88
+ ]),
89
+ r("div", oe, [
90
+ (w = (b = l(p)) == null ? void 0 : b.servers) != null && w.length ? (q(), P(X, {
91
+ key: 0,
92
+ target: l(d)
93
+ }, null, 8, ["target"])) : y("", !0),
94
+ a[1] || (a[1] = r("div", { class: "fade-left" }, null, -1)),
95
+ u(K, {
96
+ ref_key: "addressBarRef",
97
+ ref: h,
98
+ "aria-label": "Path",
99
+ class: "outline-none min-w-fit",
100
+ disableCloseBrackets: "",
101
+ disabled: l(x) === "modal",
102
+ disableEnter: "",
103
+ disableTabIndent: "",
104
+ emitOnBlur: !1,
105
+ importCurl: "",
106
+ modelValue: l(t).path,
107
+ placeholder: (C = l(v)) != null && C.uid && ((k = (_ = l(p)) == null ? void 0 : _.servers) != null && k.includes(l(v).uid)) ? "" : "Enter a URL or cURL command",
108
+ server: "",
109
+ onCurl: a[0] || (a[0] = (A) => e.$emit("importCurl", A)),
110
+ onSubmit: m,
111
+ "onUpdate:modelValue": U
112
+ }, null, 8, ["disabled", "modelValue", "placeholder"]),
113
+ a[2] || (a[2] = r("div", { class: "fade-right" }, null, -1))
114
+ ]),
115
+ u(J, { target: l(d) }, null, 8, ["target"]),
116
+ u(l(W), {
117
+ class: "relative h-auto shrink-0 z-context-plus overflow-hidden pl-2 pr-2.5 py-1 font-bold",
118
+ disabled: s.value,
119
+ onClick: m
120
+ }, {
121
+ default: D(() => [
122
+ r("span", se, [
123
+ u(l(j), {
124
+ class: "relative shrink-0 fill-current",
125
+ icon: "Play",
126
+ size: "xs"
127
+ }),
128
+ a[3] || (a[3] = r("span", { class: "text-xxs lg:flex hidden" }, "Send", -1))
97
129
  ]),
98
- r("div", oe, [
99
- t[2] || (t[2] = r("div", { class: "fade-left" }, null, -1)),
100
- (C = (w = a(p)) == null ? void 0 : w.servers) != null && C.length ? (_(), K(Z, { key: 0 })) : E("", !0),
101
- u(Q, {
102
- ref_key: "addressBarRef",
103
- ref: b,
104
- "aria-label": "Path",
105
- class: "outline-none",
106
- disableCloseBrackets: "",
107
- disabled: a(x),
108
- disableEnter: "",
109
- disableTabIndent: "",
110
- emitOnBlur: !1,
111
- importCurl: "",
112
- modelValue: a(l).path,
113
- placeholder: (k = a(v)) != null && k.uid && ((R = (q = a(p)) == null ? void 0 : q.servers) != null && R.includes(a(v).uid)) ? "" : "Enter a URL or cURL command",
114
- server: "",
115
- onCurl: t[0] || (t[0] = (O) => e.$emit("importCurl", O)),
116
- onSubmit: m,
117
- "onUpdate:modelValue": N
118
- }, null, 8, ["disabled", "modelValue", "placeholder"]),
119
- t[3] || (t[3] = r("div", { class: "fade-right" }, null, -1))
120
- ]),
121
- u(Y, { open: d }, null, 8, ["open"]),
122
- u(a(F), {
123
- class: "relative h-auto shrink-0 overflow-hidden !pl-2 !pr-2.5 !py-1 font-bold",
124
- disabled: s.value,
125
- onClick: m
126
- }, {
127
- default: y(() => [
128
- r("span", se, [
129
- u(a(G), {
130
- class: "relative shrink-0 fill-current",
131
- icon: "Play",
132
- size: "xs"
133
- }),
134
- t[4] || (t[4] = r("span", { class: "text-xxs lg:flex hidden" }, "Send", -1))
135
- ]),
136
- t[5] || (t[5] = r("span", { class: "sr-only" }, " Send Request ", -1))
137
- ]),
138
- _: 1
139
- }, 8, ["disabled"])
140
- ], 2)
141
- ];
142
- }),
143
- _: 1
144
- }, 8, ["modelValue"])
145
- ])
146
- ])) : E("", !0);
130
+ a[4] || (a[4] = r("span", { class: "sr-only" }, " Send Request ", -1))
131
+ ]),
132
+ _: 1
133
+ }, 8, ["disabled"])
134
+ ])
135
+ ])
136
+ ], 8, ee)) : y("", !0);
137
+ };
147
138
  }
148
139
  });
149
140
  export {
150
- be as default
141
+ ge as default
151
142
  };
@@ -1,5 +1,6 @@
1
1
  type __VLS_Props = {
2
- open: boolean;
2
+ /** The id of the target to use for the popover (e.g. address bar) */
3
+ target: string;
3
4
  };
4
5
  declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
5
6
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"file":"AddressBarHistory.vue.d.ts","sourceRoot":"","sources":["../../../src/components/AddressBar/AddressBarHistory.vue"],"names":[],"mappings":"AAmIA,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,OAAO,CAAA;CACd,CAAC;;AAoOF,wBAMG"}
1
+ {"version":3,"file":"AddressBarHistory.vue.d.ts","sourceRoot":"","sources":["../../../src/components/AddressBar/AddressBarHistory.vue"],"names":[],"mappings":"AAiLA,KAAK,WAAW,GAAG;IACjB,qEAAqE;IACrE,MAAM,EAAE,MAAM,CAAA;CACf,CAAC;;AAmQF,wBAOG"}
@@ -1,7 +1,7 @@
1
1
  import o from "./AddressBarHistory.vue2.js";
2
2
  /* empty css */
3
3
  import r from "../../_virtual/_plugin-vue_export-helper.js";
4
- const d = /* @__PURE__ */ r(o, [["__scopeId", "data-v-69d275b6"]]);
4
+ const a = /* @__PURE__ */ r(o, [["__scopeId", "data-v-f70f1917"]]);
5
5
  export {
6
- d as default
6
+ a as default
7
7
  };
@@ -1,90 +1,110 @@
1
- import { defineComponent as C, computed as q, openBlock as u, createElementBlock as b, Fragment as h, createBlock as i, unref as o, withCtx as c, createVNode as x, createCommentVNode as v, createElementVNode as s, normalizeClass as g, renderList as B, toDisplayString as l } from "vue";
2
- import { formatMs as H } from "../../libs/formatters.js";
3
- import { useActiveEntities as y } from "../../store/active-entities.js";
4
- import { ListboxButton as E, ListboxOptions as L, ListboxOption as S } from "@headlessui/vue";
5
- import { ScalarIcon as z } from "@scalar/components";
6
- import { httpStatusCodes as M } from "@scalar/oas-utils/helpers";
7
- import { useRouter as N } from "vue-router";
8
- import U from "../HttpMethod/HttpMethod.vue.js";
9
- import { getStatusCodeColor as V } from "./httpStatusCodeColors.js";
10
- import { useWorkspace as $ } from "../../store/store.js";
11
- const A = { class: "min-w-0" }, I = { class: "min-w-0 truncate text-c-1" }, T = /* @__PURE__ */ C({
1
+ import { defineComponent as q, ref as C, computed as y, openBlock as n, createBlock as i, unref as e, withCtx as a, createVNode as d, createSlots as S, createElementVNode as l, createCommentVNode as h, normalizeStyle as w, createElementBlock as B, Fragment as H, renderList as V, toDisplayString as c, normalizeClass as z } from "vue";
2
+ import { formatMs as L } from "../../libs/formatters.js";
3
+ import { useActiveEntities as E } from "../../store/active-entities.js";
4
+ import { Listbox as U, ListboxButton as F, ListboxOptions as M, ListboxOption as N } from "@headlessui/vue";
5
+ import { ScalarFloating as R, ScalarIcon as $, ScalarFloatingBackdrop as A } from "@scalar/components";
6
+ import { httpStatusCodes as I } from "@scalar/oas-utils/helpers";
7
+ import { useRouter as O } from "vue-router";
8
+ import D from "../HttpMethod/HttpMethod.vue.js";
9
+ import { getStatusCodeColor as W } from "./httpStatusCodeColors.js";
10
+ import { useWorkspace as j } from "../../store/store.js";
11
+ const G = { class: "min-w-0" }, J = { class: "min-w-0 truncate text-c-1" }, re = /* @__PURE__ */ q({
12
12
  __name: "AddressBarHistory",
13
13
  props: {
14
- open: { type: Boolean }
14
+ target: {}
15
15
  },
16
- setup(O) {
17
- const { activeRequest: d } = y(), { requestHistory: k, requestExampleMutators: _ } = $(), p = N(), m = q(
18
- () => k.filter((t) => {
19
- var r;
20
- return t.request.requestUid === ((r = d.value) == null ? void 0 : r.uid);
16
+ setup(K) {
17
+ const { activeRequest: p } = E(), { requestHistory: f, requestExampleMutators: k } = j(), v = O(), x = C(f[0]), g = y(
18
+ () => f.filter((o) => {
19
+ var t;
20
+ return o.request.requestUid === ((t = p.value) == null ? void 0 : t.uid);
21
21
  }).slice().reverse()
22
22
  );
23
- function w(t) {
24
- var n;
25
- const r = p.currentRoute.value.params.workspace;
26
- ((n = d.value) == null ? void 0 : n.uid) !== t.request.requestUid && p.push(
27
- `/workspace/${r}/request/${t.request.requestUid}`
28
- ), _.set({ ...t.request });
23
+ function _(o) {
24
+ var r;
25
+ const t = v.currentRoute.value.params.workspace;
26
+ ((r = p.value) == null ? void 0 : r.uid) !== o.request.requestUid && v.push(
27
+ `/workspace/${t}/request/${o.request.requestUid}`
28
+ ), k.set({ ...o.request });
29
29
  }
30
- return (t, r) => {
31
- var n;
32
- return u(), b(h, null, [
33
- (n = m.value) != null && n.length ? (u(), i(o(E), {
34
- key: 0,
35
- class: "addressbar-history-button mr-1 rounded-lg p-1.5 text-c-3 focus:text-c-1"
36
- }, {
37
- default: c(() => [
38
- x(o(z), {
39
- icon: "History",
40
- size: "sm",
41
- thickness: "2.25"
42
- })
43
- ]),
44
- _: 1
45
- })) : v("", !0),
46
- s("div", {
47
- class: g([
48
- "absolute bg-white left-0 top-8 w-full rounded-lg before:pointer-events-none before:absolute before:left-0 before:-top-8 before:h-[calc(100%+32px)] before:w-full before:rounded-lg z-context",
49
- { "before:shadow-lg": t.open }
50
- ])
30
+ return (o, t) => (n(), i(e(U), {
31
+ modelValue: x.value,
32
+ "onUpdate:modelValue": t[0] || (t[0] = (r) => x.value = r)
33
+ }, {
34
+ default: a(({ open: r }) => [
35
+ d(e(R), {
36
+ offset: 0,
37
+ resize: "",
38
+ target: o.target
39
+ }, S({
40
+ default: a(() => {
41
+ var u;
42
+ return [
43
+ (u = g.value) != null && u.length ? (n(), i(e(F), {
44
+ key: 0,
45
+ class: "addressbar-history-button z-context-plus mr-1 rounded-lg p-1.5 text-c-3 focus:text-c-1"
46
+ }, {
47
+ default: a(() => [
48
+ d(e($), {
49
+ icon: "History",
50
+ size: "sm",
51
+ thickness: "2.25"
52
+ }),
53
+ t[1] || (t[1] = l("span", { class: "sr-only" }, "Request History", -1))
54
+ ]),
55
+ _: 1
56
+ })) : h("", !0)
57
+ ];
58
+ }),
59
+ _: 2
51
60
  }, [
52
- x(o(L), { class: "bg-b-1 border-t custom-scroll max-h-[300px] rounded-b-lg p-[3px] grid grid-cols-[44px,1fr,repeat(3,auto)] items-center" }, {
53
- default: c(() => [
54
- (u(!0), b(h, null, B(m.value, (e, f) => (u(), i(o(S), {
55
- key: f,
56
- class: "contents font-code text-sm *:rounded-none first:*:rounded-l last:*:rounded-r *:h-8 *:ui-active:bg-b-2 *:flex *:items-center *:cursor-pointer *:px-1.5 text-c-2 font-medium",
57
- value: f,
58
- onClick: (a) => w(e)
61
+ r ? {
62
+ name: "floating",
63
+ fn: a(({ width: u }) => [
64
+ d(e(M), {
65
+ class: "address-bg-states border-t custom-scroll max-h-[inherit] p-0.75 grid grid-cols-[44px,1fr,repeat(3,auto)] items-center",
66
+ style: w({ width: u })
59
67
  }, {
60
- default: c(() => {
61
- var a;
62
- return [
63
- e.response.method ? (u(), i(U, {
64
- key: 0,
65
- class: "text-[11px]",
66
- method: e.response.method
67
- }, null, 8, ["method"])) : v("", !0),
68
- s("div", A, [
69
- s("div", I, l(e.response.path), 1)
70
- ]),
71
- s("div", null, l(o(H)(e.response.duration)), 1),
72
- s("div", {
73
- class: g([o(V)(e.response.status).color])
74
- }, l(e.response.status), 3),
75
- s("div", null, l((a = o(M)[e.response.status]) == null ? void 0 : a.name), 1)
76
- ];
77
- }),
68
+ default: a(() => [
69
+ (n(!0), B(H, null, V(g.value, (s, b) => (n(), i(e(N), {
70
+ key: s.timestamp,
71
+ class: "contents font-code text-sm *:rounded-none first:*:rounded-l last:*:rounded-r *:h-8 *:ui-active:bg-b-2 *:flex *:items-center *:cursor-pointer *:px-1.5 text-c-2 font-medium",
72
+ value: b,
73
+ onClick: (m) => _(s)
74
+ }, {
75
+ default: a(() => {
76
+ var m;
77
+ return [
78
+ s.response.method ? (n(), i(D, {
79
+ key: 0,
80
+ class: "text-[11px]",
81
+ method: s.response.method
82
+ }, null, 8, ["method"])) : h("", !0),
83
+ l("div", G, [
84
+ l("div", J, c(s.response.path), 1)
85
+ ]),
86
+ l("div", null, c(e(L)(s.response.duration)), 1),
87
+ l("div", {
88
+ class: z([e(W)(s.response.status).color])
89
+ }, c(s.response.status), 3),
90
+ l("div", null, c((m = e(I)[s.response.status]) == null ? void 0 : m.name), 1)
91
+ ];
92
+ }),
93
+ _: 2
94
+ }, 1032, ["value", "onClick"]))), 128))
95
+ ]),
78
96
  _: 2
79
- }, 1032, ["value", "onClick"]))), 128))
97
+ }, 1032, ["style"]),
98
+ d(e(A), { class: "-top-[--scalar-address-bar-height] rounded-lg" })
80
99
  ]),
81
- _: 1
82
- })
83
- ], 2)
84
- ], 64);
85
- };
100
+ key: "0"
101
+ } : void 0
102
+ ]), 1032, ["target"])
103
+ ]),
104
+ _: 1
105
+ }, 8, ["modelValue"]));
86
106
  }
87
107
  });
88
108
  export {
89
- T as default
109
+ re as default
90
110
  };
@@ -1,3 +1,7 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
1
+ type __VLS_Props = {
2
+ /** The id of the target to use for the popover (e.g. address bar) */
3
+ target: string;
4
+ };
5
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
2
6
  export default _default;
3
7
  //# sourceMappingURL=AddressBarServer.vue.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AddressBarServer.vue.d.ts","sourceRoot":"","sources":["../../../src/components/AddressBar/AddressBarServer.vue"],"names":[],"mappings":";AAyVA,wBAMG"}
1
+ {"version":3,"file":"AddressBarServer.vue.d.ts","sourceRoot":"","sources":["../../../src/components/AddressBar/AddressBarServer.vue"],"names":[],"mappings":"AAmJA,KAAK,WAAW,GAAG;IACjB,qEAAqE;IACrE,MAAM,EAAE,MAAM,CAAA;CACf,CAAC;;AAoOF,wBAOG"}