@scalar/api-client 2.0.22 → 2.0.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (182) hide show
  1. package/CHANGELOG.md +48 -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 +80 -84
  5. package/dist/components/AddressBar/AddressBarHistory.vue.d.ts.map +1 -1
  6. package/dist/components/AddressBar/AddressBarHistory.vue.js +11 -10
  7. package/dist/components/AddressBar/AddressBarServer.vue.d.ts.map +1 -1
  8. package/dist/components/CodeInput/CodeInput.vue.d.ts +10 -0
  9. package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
  10. package/dist/components/CodeInput/CodeInput.vue.js +3 -2
  11. package/dist/components/CodeInput/CodeInput.vue2.js +42 -37
  12. package/dist/components/CodeInput/codeDropdownWidget.d.ts +24 -0
  13. package/dist/components/CodeInput/codeDropdownWidget.d.ts.map +1 -0
  14. package/dist/components/CodeInput/codeDropdownWidget.js +110 -0
  15. package/dist/components/CodeInput/codeVariableWidget.d.ts +8 -0
  16. package/dist/components/CodeInput/codeVariableWidget.d.ts.map +1 -0
  17. package/dist/components/CodeInput/codeVariableWidget.js +124 -0
  18. package/dist/components/CommandPalette/CommandPaletteCollection.vue.d.ts +2 -15
  19. package/dist/components/CommandPalette/CommandPaletteCollection.vue.d.ts.map +1 -1
  20. package/dist/components/CommandPalette/CommandPaletteCollection.vue.js +51 -54
  21. package/dist/components/CommandPalette/CommandPaletteExample.vue.d.ts +4 -2
  22. package/dist/components/CommandPalette/CommandPaletteExample.vue.d.ts.map +1 -1
  23. package/dist/components/CommandPalette/CommandPaletteExample.vue.js +106 -92
  24. package/dist/components/CommandPalette/CommandPaletteFolder.vue.d.ts +2 -15
  25. package/dist/components/CommandPalette/CommandPaletteFolder.vue.d.ts.map +1 -1
  26. package/dist/components/CommandPalette/CommandPaletteFolder.vue.js +68 -74
  27. package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts +2 -15
  28. package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts.map +1 -1
  29. package/dist/components/CommandPalette/CommandPaletteImport.vue.js +56 -62
  30. package/dist/components/CommandPalette/CommandPaletteRequest.vue.d.ts +2 -15
  31. package/dist/components/CommandPalette/CommandPaletteRequest.vue.d.ts.map +1 -1
  32. package/dist/components/CommandPalette/CommandPaletteRequest.vue.js +106 -99
  33. package/dist/components/CommandPalette/CommandPaletteWorkspace.vue.d.ts +7 -0
  34. package/dist/components/CommandPalette/CommandPaletteWorkspace.vue.d.ts.map +1 -0
  35. package/dist/components/CommandPalette/CommandPaletteWorkspace.vue.js +57 -0
  36. package/dist/components/CommandPalette/CommandPaletteWorkspace.vue2.js +4 -0
  37. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts +50 -0
  38. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -0
  39. package/dist/components/CommandPalette/TheCommandPalette.vue.js +9 -0
  40. package/dist/components/CommandPalette/TheCommandPalette.vue2.js +198 -0
  41. package/dist/components/CommandPalette/index.d.ts +2 -0
  42. package/dist/components/CommandPalette/index.d.ts.map +1 -0
  43. package/dist/components/CommandPalette/index.js +4 -0
  44. package/dist/components/ContextBar.vue.js +4 -4
  45. package/dist/components/DarkModeToggle/DarkModeIconToggle.vue.js +7 -6
  46. package/dist/components/DataTable/DataTableCheckbox.vue.d.ts.map +1 -1
  47. package/dist/components/DataTable/DataTableCheckbox.vue.js +3 -2
  48. package/dist/components/DataTable/DataTableInput.vue.d.ts +1 -1
  49. package/dist/components/DataTable/DataTableInput.vue.d.ts.map +1 -1
  50. package/dist/components/DataTable/DataTableInput.vue.js +3 -3
  51. package/dist/components/DataTable/DataTableInput.vue2.js +36 -49
  52. package/dist/components/DataTable/DataTableInputSelect.vue.d.ts.map +1 -1
  53. package/dist/components/DataTable/DataTableInputSelect.vue.js +15 -14
  54. package/dist/components/Search/SearchButton.vue.d.ts.map +1 -1
  55. package/dist/components/Search/SearchButton.vue.js +7 -6
  56. package/dist/components/SideNav/SideNav.vue.d.ts.map +1 -1
  57. package/dist/components/SideNav/SideNav.vue.js +26 -23
  58. package/dist/components/SideNav/SideNavLink.vue.d.ts +3 -2
  59. package/dist/components/SideNav/SideNavLink.vue.d.ts.map +1 -1
  60. package/dist/components/SideNav/SideNavLink.vue.js +18 -16
  61. package/dist/components/Sidebar/Sidebar.vue.d.ts +15 -2
  62. package/dist/components/Sidebar/Sidebar.vue.d.ts.map +1 -1
  63. package/dist/components/Sidebar/Sidebar.vue.js +14 -12
  64. package/dist/components/Sidebar/SidebarButton.vue.d.ts.map +1 -1
  65. package/dist/components/Sidebar/SidebarButton.vue.js +5 -5
  66. package/dist/components/Sidebar/SidebarListElementActions.vue.d.ts.map +1 -1
  67. package/dist/components/Sidebar/SidebarListElementActions.vue.js +2 -2
  68. package/dist/components/TopNav/TopNav.vue.d.ts.map +1 -1
  69. package/dist/components/TopNav/TopNav.vue.js +1 -1
  70. package/dist/components/TopNav/TopNav.vue2.js +31 -29
  71. package/dist/components/TopNav/TopNavItem.vue.d.ts +7 -3
  72. package/dist/components/TopNav/TopNavItem.vue.d.ts.map +1 -1
  73. package/dist/components/TopNav/TopNavItem.vue.js +2 -2
  74. package/dist/components/TopNav/TopNavItem.vue2.js +18 -18
  75. package/dist/components/ViewLayout/ViewLayout.vue.d.ts.map +1 -1
  76. package/dist/components/ViewLayout/ViewLayout.vue.js +1 -1
  77. package/dist/components/ViewLayout/ViewLayoutCollapse.vue.d.ts.map +1 -1
  78. package/dist/components/ViewLayout/ViewLayoutCollapse.vue.js +2 -1
  79. package/dist/constants.d.ts +13 -7
  80. package/dist/constants.d.ts.map +1 -1
  81. package/dist/constants.js +4 -4
  82. package/dist/index.d.ts +2 -4
  83. package/dist/index.d.ts.map +1 -1
  84. package/dist/index.js +11 -16
  85. package/dist/layouts/App/ApiClientApp.vue.d.ts.map +1 -0
  86. package/dist/layouts/App/ApiClientApp.vue.js +72 -0
  87. package/dist/{App → layouts/App}/createApiClientApp.d.ts +1 -1
  88. package/dist/layouts/App/createApiClientApp.d.ts.map +1 -0
  89. package/dist/{App → layouts/App}/createApiClientApp.js +2 -2
  90. package/dist/layouts/App/index.d.ts.map +1 -0
  91. package/dist/{Modal → layouts/Modal}/ApiClientModal.vue.d.ts +1 -0
  92. package/dist/layouts/Modal/ApiClientModal.vue.d.ts.map +1 -0
  93. package/dist/{Modal → layouts/Modal}/ApiClientModal.vue.js +2 -2
  94. package/dist/layouts/Modal/api-client-modal.d.ts.map +1 -0
  95. package/dist/{Modal → layouts/Modal}/api-client-modal.js +7 -7
  96. package/dist/layouts/Modal/index.d.ts.map +1 -0
  97. package/dist/libs/eventBusses/command-palette.d.ts +14 -0
  98. package/dist/libs/eventBusses/command-palette.d.ts.map +1 -0
  99. package/dist/libs/eventBusses/command-palette.js +5 -0
  100. package/dist/libs/local-storage.d.ts +1 -1
  101. package/dist/libs/local-storage.d.ts.map +1 -1
  102. package/dist/libs/local-storage.js +19 -19
  103. package/dist/router.d.ts +18 -6
  104. package/dist/router.d.ts.map +1 -1
  105. package/dist/router.js +107 -71
  106. package/dist/store/topNav.d.ts +94 -82
  107. package/dist/store/topNav.d.ts.map +1 -1
  108. package/dist/store/topNav.js +21 -20
  109. package/dist/store/workspace.d.ts +312 -82
  110. package/dist/store/workspace.d.ts.map +1 -1
  111. package/dist/store/workspace.js +299 -224
  112. package/dist/style.css +1 -1
  113. package/dist/views/Collection/Collection.vue.d.ts.map +1 -1
  114. package/dist/views/Components/Schemas/Schemas.vue.d.ts.map +1 -1
  115. package/dist/views/Cookies/Cookies.vue.d.ts.map +1 -1
  116. package/dist/views/Cookies/Cookies.vue2.js +9 -12
  117. package/dist/views/Environment/Environment.vue.d.ts.map +1 -1
  118. package/dist/views/Environment/Environment.vue2.js +22 -25
  119. package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts.map +1 -1
  120. package/dist/views/Environment/EnvironmentVariableDropdown.vue.js +38 -47
  121. package/dist/views/Request/Request.vue.d.ts.map +1 -1
  122. package/dist/views/Request/Request.vue.js +1 -1
  123. package/dist/views/Request/Request.vue2.js +125 -108
  124. package/dist/views/Request/RequestSection/RequestAuthDataTableInput.vue.d.ts +1 -1
  125. package/dist/views/Request/RequestSection/RequestAuthDataTableInput.vue.d.ts.map +1 -1
  126. package/dist/views/Request/RequestSection/RequestBody.vue.d.ts.map +1 -1
  127. package/dist/views/Request/RequestSection/RequestBody.vue.js +5 -4
  128. package/dist/views/Request/RequestSection/RequestSection.vue.js +3 -2
  129. package/dist/views/Request/RequestSection/RequestTable.vue.d.ts.map +1 -1
  130. package/dist/views/Request/RequestSection/RequestTable.vue.js +4 -4
  131. package/dist/views/Request/RequestSection/RequestTable.vue2.js +22 -21
  132. package/dist/views/Request/RequestSection/RequestTableTooltip.vue.d.ts.map +1 -1
  133. package/dist/views/Request/RequestSection/RequestTableTooltip.vue.js +6 -5
  134. package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
  135. package/dist/views/Request/RequestSidebarItem.vue.js +2 -2
  136. package/dist/views/Request/RequestSidebarItem.vue2.js +84 -79
  137. package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts.map +1 -1
  138. package/dist/views/Request/RequestSidebarItemMenu.vue.js +58 -38
  139. package/dist/views/Request/ResponseSection/ResponseSection.vue.d.ts.map +1 -1
  140. package/dist/views/Request/ResponseSection/ResponseSection.vue.js +3 -2
  141. package/dist/views/Request/components/OAuth2.vue.d.ts.map +1 -1
  142. package/dist/views/Request/components/OAuth2.vue.js +2 -0
  143. package/dist/{App.vue.d.ts → views/Request/components/WorkspaceDropdown.vue.d.ts} +1 -2
  144. package/dist/views/Request/components/WorkspaceDropdown.vue.d.ts.map +1 -0
  145. package/dist/views/Request/components/WorkspaceDropdown.vue.js +80 -0
  146. package/dist/views/Request/components/WorkspaceDropdown.vue2.js +4 -0
  147. package/dist/views/Request/components/index.d.ts +1 -0
  148. package/dist/views/Request/components/index.d.ts.map +1 -1
  149. package/dist/views/Request/components/index.js +4 -2
  150. package/dist/views/Servers/Servers.vue.d.ts.map +1 -1
  151. package/dist/views/Servers/Servers.vue2.js +12 -15
  152. package/package.json +19 -15
  153. package/dist/App/ApiClientApp.vue.d.ts.map +0 -1
  154. package/dist/App/ApiClientApp.vue.js +0 -56
  155. package/dist/App/createApiClientApp.d.ts.map +0 -1
  156. package/dist/App/index.d.ts.map +0 -1
  157. package/dist/App.vue.d.ts.map +0 -1
  158. package/dist/App.vue.js +0 -77
  159. package/dist/App.vue3.js +0 -5
  160. package/dist/Modal/ApiClientModal.vue.d.ts.map +0 -1
  161. package/dist/Modal/api-client-modal.d.ts.map +0 -1
  162. package/dist/Modal/index.d.ts.map +0 -1
  163. package/dist/components/AddressBar/AddressBarServer.vue.js +0 -106
  164. package/dist/components/AddressBar/AddressBarServer.vue2.js +0 -4
  165. package/dist/components/CommandPalette/CommandPalette.vue.d.ts +0 -17
  166. package/dist/components/CommandPalette/CommandPalette.vue.d.ts.map +0 -1
  167. package/dist/components/CommandPalette/CommandPalette.vue.js +0 -7
  168. package/dist/components/CommandPalette/CommandPalette.vue2.js +0 -184
  169. package/dist/main.d.ts +0 -2
  170. package/dist/main.d.ts.map +0 -1
  171. package/dist/views/Collection/Collection.vue.js +0 -4
  172. package/dist/views/Collection/Collection.vue2.js +0 -136
  173. package/dist/views/Components/Schemas/Schemas.vue.js +0 -4
  174. package/dist/views/Components/Schemas/Schemas.vue2.js +0 -20
  175. /package/dist/{App → layouts/App}/ApiClientApp.vue.d.ts +0 -0
  176. /package/dist/{App → layouts/App}/ApiClientApp.vue3.js +0 -0
  177. /package/dist/{App → layouts/App}/index.d.ts +0 -0
  178. /package/dist/{App → layouts/App}/index.js +0 -0
  179. /package/dist/{Modal → layouts/Modal}/ApiClientModal.vue2.js +0 -0
  180. /package/dist/{Modal → layouts/Modal}/api-client-modal.d.ts +0 -0
  181. /package/dist/{Modal → layouts/Modal}/index.d.ts +0 -0
  182. /package/dist/{Modal → layouts/Modal}/index.js +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,53 @@
1
1
  # @scalar/api-client
2
2
 
3
+ ## 2.0.25
4
+
5
+ ### Patch Changes
6
+
7
+ - 591fe24: fix: clipped border radius in requests items
8
+ - 7f17fe4: feat: move command palette into the client app base
9
+ - 1dab515: feat: revamp address bar
10
+ - 4d76ff5: feat: add support for multiple workspaces
11
+ - e8cd161: feat: store workspace in local storage
12
+ - a431eb0: fix: table checkbox for required params on import
13
+ - ff59399: fix: api client spacing issues, and icon thickness
14
+ - ec47287: feat: made request examples functional in client
15
+ - 747e80e: fix: only flex addressbar codemirror
16
+ - 9d561b7: fix: make app topbar draggable
17
+ - Updated dependencies [1dab515]
18
+ - Updated dependencies [5e060b1]
19
+ - Updated dependencies [ff59399]
20
+ - Updated dependencies [694c1d8]
21
+ - @scalar/oas-utils@0.2.15
22
+ - @scalar/themes@0.9.15
23
+ - @scalar/components@0.12.16
24
+ - @scalar/use-codemirror@0.11.7
25
+ - @scalar/object-utils@1.1.4
26
+ - @scalar/use-toasts@0.7.4
27
+ - @scalar/use-tooltip@1.0.2
28
+
29
+ ## 2.0.24
30
+
31
+ ### Patch Changes
32
+
33
+ - 7076725: feat(components): add outline icons
34
+ - 1e72b03: fix(components): polish history icon
35
+ - cbe984b: fix: adjust command palette icon thickness
36
+ - Updated dependencies [7076725]
37
+ - Updated dependencies [1e72b03]
38
+ - Updated dependencies [dd2a42e]
39
+ - @scalar/components@0.12.15
40
+
41
+ ## 2.0.23
42
+
43
+ ### Patch Changes
44
+
45
+ - 3928ac3: feat: add routing portion for multiple workspaces
46
+ - Updated dependencies [96e7106]
47
+ - @scalar/themes@0.9.14
48
+ - @scalar/components@0.12.14
49
+ - @scalar/oas-utils@0.2.14
50
+
3
51
  ## 2.0.22
4
52
 
5
53
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"AddressBar.vue.d.ts","sourceRoot":"","sources":["../../../src/components/AddressBar/AddressBar.vue"],"names":[],"mappings":";AAupBA,wBAKG"}
1
+ {"version":3,"file":"AddressBar.vue.d.ts","sourceRoot":"","sources":["../../../src/components/AddressBar/AddressBar.vue"],"names":[],"mappings":";AAkkBA,wBAKG"}
@@ -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 d = /* @__PURE__ */ r(o, [["__scopeId", "data-v-1d480492"]]);
4
+ const e = /* @__PURE__ */ r(o, [["__scopeId", "data-v-231a70ec"]]);
5
5
  export {
6
- d as default
6
+ e as default
7
7
  };
@@ -1,125 +1,121 @@
1
- import { defineComponent as I, ref as p, watch as B, unref as o, openBlock as D, createElementBlock as M, createElementVNode as l, createVNode as r, withCtx as S, normalizeClass as C, normalizeStyle as N, withKeys as V, withModifiers as $, toDisplayString as T, createCommentVNode as A, pushScopeId as K, popScopeId as O } from "vue";
2
- import { useWorkspace as U } from "../../store/workspace.js";
1
+ import { defineComponent as q, ref as m, watch as V, unref as l, openBlock as B, createElementBlock as I, createElementVNode as o, createVNode as r, withCtx as _, normalizeClass as b, normalizeStyle as R, createCommentVNode as z, pushScopeId as M, popScopeId as U } from "vue";
2
+ import $ from "../CodeInput/CodeInput.vue.js";
3
+ import { useWorkspace as O } from "../../store/workspace.js";
3
4
  import { Listbox as H } from "@headlessui/vue";
4
- import { ScalarButton as L, ScalarIcon as P } from "@scalar/components";
5
- import { REQUEST_METHODS as W } from "@scalar/oas-utils/helpers";
6
- import { isMacOS as Q } from "@scalar/use-tooltip";
7
- import { useMagicKeys as j, whenever as F } from "@vueuse/core";
8
- import G from "../HttpMethod/HttpMethod.vue.js";
9
- import J from "./AddressBarHistory.vue.js";
10
- import X from "./AddressBarServer.vue.js";
11
- import { executeRequestBus as m } from "../../libs/eventBusses/executeRequestBus.js";
12
- const v = (d) => (K("data-v-1d480492"), d = d(), O(), d), Y = {
5
+ import { ScalarButton as N, ScalarIcon as T } from "@scalar/components";
6
+ import { REQUEST_METHODS as L } from "@scalar/oas-utils/helpers";
7
+ import { isMacOS as A } from "@scalar/use-tooltip";
8
+ import { useMagicKeys as D, whenever as K } from "@vueuse/core";
9
+ import Q from "../HttpMethod/HttpMethod.vue.js";
10
+ import W from "./AddressBarHistory.vue.js";
11
+ import { executeRequestBus as c } from "../../libs/eventBusses/executeRequestBus.js";
12
+ const f = (n) => (M("data-v-231a70ec"), n = n(), U(), n), j = {
13
13
  key: 0,
14
14
  class: "order-last lg:order-none lg:w-auto w-full"
15
- }, Z = { class: "m-auto flex basis-1/2 flex-row items-center" }, ee = { class: "pointer-events-none absolute left-0 top-0 z-10 block h-full w-full overflow-hidden" }, te = { class: "flex gap-1" }, oe = { class: "scroll-timeline-x scroll-timeline-x-hidden relative flex w-full" }, le = /* @__PURE__ */ v(() => /* @__PURE__ */ l("div", { class: "fade-left" }, null, -1)), ne = ["contenteditable"], se = /* @__PURE__ */ v(() => /* @__PURE__ */ l("div", { class: "fade-right" }, null, -1)), ae = /* @__PURE__ */ v(() => /* @__PURE__ */ l("span", { class: "text-xxs relative z-10 lg:flex hidden" }, "Send", -1)), _e = /* @__PURE__ */ I({
15
+ }, F = { class: "m-auto flex basis-1/2 flex-row items-center" }, G = { class: "pointer-events-none absolute left-0 top-0 z-10 block h-full w-full overflow-hidden" }, J = { class: "flex gap-1" }, P = { class: "scroll-timeline-x scroll-timeline-x-hidden relative flex w-full" }, X = /* @__PURE__ */ f(() => /* @__PURE__ */ o("div", { class: "fade-left" }, null, -1)), Y = /* @__PURE__ */ f(() => /* @__PURE__ */ o("div", { class: "fade-right" }, null, -1)), Z = /* @__PURE__ */ f(() => /* @__PURE__ */ o("span", { class: "text-xxs relative z-10 lg:flex hidden" }, "Send", -1)), me = /* @__PURE__ */ q({
16
16
  __name: "AddressBar",
17
- setup(d) {
17
+ setup(n) {
18
18
  const {
19
19
  activeRequest: t,
20
- activeExample: k,
21
- isReadOnly: x,
22
- requestMutators: h,
23
- requestsHistory: R
24
- } = U(), g = p(R.value[0]), _ = j();
25
- F(
26
- Q() ? _.meta_enter : _.ctrl_enter,
27
- () => m.emit()
20
+ activeExample: i,
21
+ isReadOnly: p,
22
+ requestMutators: v,
23
+ requestExampleMutators: g,
24
+ requestsHistory: w
25
+ } = O(), x = m(w.value[0]), h = D();
26
+ K(
27
+ A() ? h.meta_enter : h.ctrl_enter,
28
+ () => c.emit()
28
29
  );
29
- const w = (e) => {
30
- !t.value || t.value.path === e || h.edit(t.value.uid, "path", e);
30
+ const k = (e) => {
31
+ !t.value || t.value.path === e || v.edit(t.value.uid, "path", e);
31
32
  };
32
- B(
33
+ V(
33
34
  () => {
34
35
  var e;
35
36
  return (e = t.value) == null ? void 0 : e.path;
36
37
  },
37
38
  (e) => {
38
- t.value && w(e);
39
+ t.value && k(e);
39
40
  }
40
41
  );
41
- const u = p(100), c = p(!1);
42
- m.on(() => {
43
- if (c.value) return;
44
- c.value = !0;
42
+ const d = m(100), u = m(!1);
43
+ c.on(() => {
44
+ if (u.value) return;
45
+ u.value = !0;
45
46
  const e = setInterval(() => {
46
- u.value -= 5, u.value <= 0 && (clearInterval(e), u.value = 100, c.value = !1);
47
+ d.value -= 5, d.value <= 0 && (clearInterval(e), d.value = 100, u.value = !1);
47
48
  }, 20);
48
49
  });
49
50
  function E(e) {
50
- t.value && h.edit(t.value.uid, "method", e);
51
+ t.value && v.edit(t.value.uid, "method", e);
51
52
  }
52
- function q() {
53
+ function S() {
53
54
  if (!t.value) return;
54
55
  const { method: e } = t.value;
55
- return W[e].backgroundColor;
56
+ return L[e].backgroundColor;
56
57
  }
57
- const z = (e) => {
58
- var y;
59
- e.preventDefault();
60
- const a = (((y = e.clipboardData) == null ? void 0 : y.getData("text/plain")) || "").replace(/\n/g, ""), s = window.getSelection();
61
- if (!s || s.rangeCount === 0) return;
62
- const i = s.getRangeAt(0);
63
- i.deleteContents();
64
- const b = document.createTextNode(a);
65
- i.insertNode(b), i.setStartAfter(b), s.removeAllRanges(), s.addRange(i);
66
- const f = i.startContainer.parentElement;
67
- f && (f.scrollLeft = f.scrollWidth);
58
+ const y = (e) => {
59
+ i.value && g.edit(i.value.uid, "url", e);
68
60
  };
69
- return (e, n) => o(t) && o(k) ? (D(), M("div", Y, [
70
- l("div", Z, [
71
- r(o(H), {
72
- modelValue: g.value,
73
- "onUpdate:modelValue": n[3] || (n[3] = (a) => g.value = a)
61
+ return (e, a) => l(t) && l(i) ? (B(), I("div", j, [
62
+ o("div", F, [
63
+ r(l(H), {
64
+ modelValue: x.value,
65
+ "onUpdate:modelValue": a[2] || (a[2] = (s) => x.value = s)
74
66
  }, {
75
- default: S(({ open: a }) => [
76
- l("div", {
77
- class: C([
67
+ default: _(({ open: s }) => [
68
+ o("div", {
69
+ class: b([
78
70
  "text-xxs bg-b-1 relative flex w-full lg:min-w-[720px] lg:max-w-[720px] order-last lg:order-none flex-1 flex-row items-stretch rounded border p-[3px]",
79
- { "rounded-b-none": a },
80
- { "border-transparent": a }
71
+ { "rounded-b-none": s },
72
+ { "border-transparent": s }
81
73
  ])
82
74
  }, [
83
- l("div", ee, [
84
- l("div", {
85
- class: C(["bg-mix-transparent bg-mix-amount-95 absolute left-0 top-0 h-full w-full", q()]),
86
- style: N({ transform: `translate3d(-${u.value}%,0,0)` })
75
+ o("div", G, [
76
+ o("div", {
77
+ class: b(["bg-mix-transparent bg-mix-amount-95 absolute left-0 top-0 h-full w-full", S()]),
78
+ style: R({ transform: `translate3d(-${d.value}%,0,0)` })
87
79
  }, null, 6)
88
80
  ]),
89
- l("div", te, [
90
- r(G, {
81
+ o("div", J, [
82
+ r(Q, {
91
83
  class: "font-code text-xxs font-medium",
92
- isEditable: !o(x),
84
+ isEditable: !l(p),
93
85
  isSquare: "",
94
- method: o(t).method,
86
+ method: l(t).method,
95
87
  onChange: E
96
- }, null, 8, ["isEditable", "method"]),
97
- r(X)
88
+ }, null, 8, ["isEditable", "method"])
98
89
  ]),
99
- l("div", oe, [
100
- le,
101
- l("div", {
102
- class: "scroll-timeline-x-address font-code text-c-1 flex flex-1 items-center whitespace-nowrap lg:text-sm text-xs font-medium leading-[24.5px] outline-none",
103
- contenteditable: !o(x),
104
- onInput: n[0] || (n[0] = (s) => w(s.target.innerText)),
105
- onKeydown: n[1] || (n[1] = V($((s) => o(m).emit(), ["prevent"]), ["enter"])),
106
- onPaste: z
107
- }, T(o(t).path), 41, ne),
108
- se
90
+ o("div", P, [
91
+ X,
92
+ r($, {
93
+ disableCloseBrackets: "",
94
+ disabled: l(p),
95
+ disableEnter: "",
96
+ disableTabIndent: "",
97
+ emitOnBlur: !1,
98
+ modelValue: l(i).url,
99
+ placeholder: "Enter URL to get started",
100
+ server: "",
101
+ onSubmit: a[0] || (a[0] = (C) => l(c).emit()),
102
+ "onUpdate:modelValue": y
103
+ }, null, 8, ["disabled", "modelValue"]),
104
+ Y
109
105
  ]),
110
- r(J, { open: a }, null, 8, ["open"]),
111
- r(o(L), {
106
+ r(W, { open: s }, null, 8, ["open"]),
107
+ r(l(N), {
112
108
  class: "relative h-auto shrink-0 gap-1 overflow-hidden pl-2 pr-2.5 py-1 z-[1]",
113
- disabled: c.value,
114
- onClick: n[2] || (n[2] = (s) => o(m).emit())
109
+ disabled: u.value,
110
+ onClick: a[1] || (a[1] = (C) => l(c).emit())
115
111
  }, {
116
- default: S(() => [
117
- r(o(P), {
118
- class: "relative z-10 shrink-0",
112
+ default: _(() => [
113
+ r(l(T), {
114
+ class: "relative z-10 shrink-0 fill-current",
119
115
  icon: "Play",
120
116
  size: "xs"
121
117
  }),
122
- ae
118
+ Z
123
119
  ]),
124
120
  _: 1
125
121
  }, 8, ["disabled"])
@@ -128,9 +124,9 @@ const v = (d) => (K("data-v-1d480492"), d = d(), O(), d), Y = {
128
124
  _: 1
129
125
  }, 8, ["modelValue"])
130
126
  ])
131
- ])) : A("", !0);
127
+ ])) : z("", !0);
132
128
  }
133
129
  });
134
130
  export {
135
- _e as default
131
+ me as default
136
132
  };
@@ -1 +1 @@
1
- {"version":3,"file":"AddressBarHistory.vue.d.ts","sourceRoot":"","sources":["../../../src/components/AddressBar/AddressBarHistory.vue"],"names":[],"mappings":";UA6HQ,OAAO;;UAAP,OAAO;;AAqPf,wBAMG;AAOH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
1
+ {"version":3,"file":"AddressBarHistory.vue.d.ts","sourceRoot":"","sources":["../../../src/components/AddressBar/AddressBarHistory.vue"],"names":[],"mappings":";UA8HQ,OAAO;;UAAP,OAAO;;AAqPf,wBAMG;AAOH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
@@ -1,4 +1,4 @@
1
- import { defineComponent as U, openBlock as n, createElementBlock as f, Fragment as d, unref as t, createBlock as i, withCtx as m, createVNode as x, createCommentVNode as b, createElementVNode as o, normalizeClass as g, renderList as k, toDisplayString as c } from "vue";
1
+ import { defineComponent as q, openBlock as n, createElementBlock as f, Fragment as d, unref as t, createBlock as i, withCtx as m, createVNode as x, createCommentVNode as b, createElementVNode as o, normalizeClass as h, renderList as U, toDisplayString as c } from "vue";
2
2
  import { formatMs as w } from "../../libs/formatters.js";
3
3
  import { useWorkspace as y } from "../../store/workspace.js";
4
4
  import { ListboxButton as C, ListboxOptions as L, ListboxOption as R } from "@headlessui/vue";
@@ -7,20 +7,20 @@ import { httpStatusCodes as S } from "@scalar/oas-utils/helpers";
7
7
  import { useRouter as H } from "vue-router";
8
8
  import P from "../HttpMethod/HttpMethod.vue.js";
9
9
  import { getStatusCodeColor as z } from "./httpStatusCodeColors.js";
10
- const E = { class: "font-code flex flex-1 gap-1.5 text-sm font-medium" }, N = { class: "text-c-2 gap-0" }, V = { class: "font-code text-c-3 flex flex-row items-center gap-1.5 text-sm font-medium" }, Q = /* @__PURE__ */ U({
10
+ const E = { class: "font-code flex flex-1 gap-1.5 text-sm font-medium" }, N = { class: "text-c-2 gap-0" }, V = { class: "font-code text-c-3 flex flex-row items-center gap-1.5 text-sm font-medium" }, Q = /* @__PURE__ */ q({
11
11
  __name: "AddressBarHistory",
12
12
  props: {
13
13
  open: { type: Boolean }
14
14
  },
15
15
  setup($) {
16
- const { requestsHistory: u, activeRequest: h, requestExampleMutators: _ } = y(), v = H();
16
+ const { requestsHistory: u, activeRequest: g, requestExampleMutators: _ } = y(), v = H();
17
17
  function p(a, r) {
18
18
  const e = new URL(a.responseURL), s = new URLSearchParams(e.search).get("scalar_url");
19
19
  return s ? new URL(s)[r].toString() : e.origin;
20
20
  }
21
- function q(a) {
21
+ function k(a) {
22
22
  const r = u.value[a];
23
- h.value.uid !== r.request.requestUid && v.push(`/request/${r.request.requestUid}`), _.set(r.request);
23
+ g.value.uid !== r.request.requestUid && v.push(`/request/${r.request.requestUid}`), _.set(r.request);
24
24
  }
25
25
  return (a, r) => (n(), f(d, null, [
26
26
  t(u).length ? (n(), i(t(C), {
@@ -31,24 +31,25 @@ const E = { class: "font-code flex flex-1 gap-1.5 text-sm font-medium" }, N = {
31
31
  x(t(B), {
32
32
  class: "text-c-3",
33
33
  icon: "History",
34
- size: "xs"
34
+ size: "sm",
35
+ thickness: "2.25"
35
36
  })
36
37
  ]),
37
38
  _: 1
38
39
  })) : b("", !0),
39
40
  o("div", {
40
- class: g([
41
+ class: h([
41
42
  "absolute left-0 top-[33px] w-full rounded before:pointer-events-none before:absolute before:left-0 before:top-[-33px] before:h-[calc(100%+33px)] before:w-full before:rounded z-50",
42
43
  { "before:shadow-lg": a.open }
43
44
  ])
44
45
  }, [
45
46
  x(t(L), { class: "bg-b-1 custom-scroll bg-mix-transparent bg-mix-amount-30 max-h-[300px] rounded-b p-[3px] pt-0 backdrop-blur" }, {
46
47
  default: m(() => [
47
- (n(!0), f(d, null, k(t(u), ({ response: e }, l) => (n(), i(t(R), {
48
+ (n(!0), f(d, null, U(t(u), ({ response: e }, l) => (n(), i(t(R), {
48
49
  key: l,
49
50
  class: "ui-active:bg-b-2 text-c-1 ui-active:text-c-1 flex cursor-pointer flex-row gap-2.5 rounded py-1.5 pr-3",
50
51
  value: l,
51
- onClick: (s) => q(l)
52
+ onClick: (s) => k(l)
52
53
  }, {
53
54
  default: m(() => {
54
55
  var s;
@@ -64,7 +65,7 @@ const E = { class: "font-code flex flex-1 gap-1.5 text-sm font-medium" }, N = {
64
65
  o("div", V, [
65
66
  o("span", null, c(t(w)(e.duration)), 1),
66
67
  o("span", {
67
- class: g([t(z)(e.status).color])
68
+ class: h([t(z)(e.status).color])
68
69
  }, c(e.status), 3),
69
70
  o("span", null, c((s = t(S)[e.status]) == null ? void 0 : s.name), 1)
70
71
  ])
@@ -1 +1 @@
1
- {"version":3,"file":"AddressBarServer.vue.d.ts","sourceRoot":"","sources":["../../../src/components/AddressBar/AddressBarServer.vue"],"names":[],"mappings":";AA6YA,wBAKG"}
1
+ {"version":3,"file":"AddressBarServer.vue.d.ts","sourceRoot":"","sources":["../../../src/components/AddressBar/AddressBarServer.vue"],"names":[],"mappings":";AA2ZA,wBAKG"}
@@ -17,6 +17,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
17
17
  enum?: string[];
18
18
  type?: string;
19
19
  nullable?: boolean;
20
+ withVariables?: boolean;
21
+ withServers?: boolean;
20
22
  }>, {
21
23
  disableCloseBrackets: boolean;
22
24
  disableEnter: boolean;
@@ -24,6 +26,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
24
26
  emitOnBlur: boolean;
25
27
  colorPicker: boolean;
26
28
  nullable: boolean;
29
+ withVariables: boolean;
30
+ withServers: boolean;
27
31
  }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
28
32
  submit: (v: string) => void;
29
33
  "update:modelValue": (v: string) => void;
@@ -45,6 +49,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
45
49
  enum?: string[];
46
50
  type?: string;
47
51
  nullable?: boolean;
52
+ withVariables?: boolean;
53
+ withServers?: boolean;
48
54
  }>, {
49
55
  disableCloseBrackets: boolean;
50
56
  disableEnter: boolean;
@@ -52,16 +58,20 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
52
58
  emitOnBlur: boolean;
53
59
  colorPicker: boolean;
54
60
  nullable: boolean;
61
+ withVariables: boolean;
62
+ withServers: boolean;
55
63
  }>>> & {
56
64
  onSubmit?: ((v: string) => any) | undefined;
57
65
  "onUpdate:modelValue"?: ((v: string) => any) | undefined;
58
66
  }, {
59
67
  nullable: boolean;
68
+ withServers: boolean;
60
69
  colorPicker: boolean;
61
70
  emitOnBlur: boolean;
62
71
  disableTabIndent: boolean;
63
72
  disableEnter: boolean;
64
73
  disableCloseBrackets: boolean;
74
+ withVariables: boolean;
65
75
  }, {}>, {
66
76
  warning?(_: {}): any;
67
77
  icon?(_: {}): any;
@@ -1 +1 @@
1
- {"version":3,"file":"CodeInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CodeInput/CodeInput.vue"],"names":[],"mappings":"AAAA,OA0PO,EAGL,KAAK,kBAAkB,EAExB,MAAM,wBAAwB,CAAA;;kBAWb,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;;;;;;;;;;;;kBAhBJ,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;;;;;;;;;;;;cAAP,OAAO;iBAhBJ,OAAO;gBAGR,OAAO;sBAGD,OAAO;kBAMX,OAAO;0BACC,OAAO;;qBAmPJ,GAAG;kBACN,GAAG;;AApQ9B,wBAuSC;AAMD,KAAK,kBAAkB,CAAC,CAAC,EAAE,CAAC,IAAI;KAC1B,CAAC,IAAI,MAAM,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,SAAS,MAAM,CAAC,GAC7C,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG;QAAE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;KAAC,CAAC,GACvC,CAAC,CAAC,CAAC,CAAC;CACP,CAAC;AAEN,KAAK,cAAc,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC;AAExD,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACpC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC;AAEN,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
1
+ {"version":3,"file":"CodeInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CodeInput/CodeInput.vue"],"names":[],"mappings":"AAAA,OAoRO,EAGL,KAAK,kBAAkB,EAExB,MAAM,wBAAwB,CAAA;;kBAeb,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;kBACT,OAAO;;;;;;;;;;;;;;kBAlBP,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;kBACT,OAAO;;;;;;;;;;;;;;cAFV,OAAO;iBAEJ,OAAO;iBAlBP,OAAO;gBAGR,OAAO;sBAGD,OAAO;kBAMX,OAAO;0BACC,OAAO;mBAId,OAAO;;qBAwPG,GAAG;kBACN,GAAG;;AA7Q9B,wBAgTC;AAMD,KAAK,kBAAkB,CAAC,CAAC,EAAE,CAAC,IAAI;KAC1B,CAAC,IAAI,MAAM,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,SAAS,MAAM,CAAC,GAC7C,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG;QAAE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;KAAC,CAAC,GACvC,CAAC,CAAC,CAAC,CAAC;CACP,CAAC;AAEN,KAAK,cAAc,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC;AAExD,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACpC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC;AAEN,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
@@ -1,7 +1,8 @@
1
1
  import o from "./CodeInput.vue2.js";
2
2
  /* empty css */
3
+ /* empty css */
3
4
  import t from "../../_virtual/_plugin-vue_export-helper.js";
4
- const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-c8194af4"]]);
5
+ const _ = /* @__PURE__ */ t(o, [["__scopeId", "data-v-93d0e1be"]]);
5
6
  export {
6
- f as default
7
+ _ as default
7
8
  };
@@ -1,17 +1,20 @@
1
- import { defineComponent as F, useAttrs as S, ref as b, toRef as o, watch as $, computed as O, openBlock as t, createElementBlock as u, Fragment as P, createBlock as y, mergeProps as q, unref as E, renderSlot as h, createCommentVNode as g } from "vue";
1
+ import { defineComponent as S, useAttrs as P, ref as b, toRef as o, watch as O, computed as $, openBlock as t, createElementBlock as s, Fragment as R, createBlock as h, mergeProps as q, unref as E, renderSlot as y, createCommentVNode as g } from "vue";
2
2
  import { useCodeMirror as I, colorPicker as M } from "@scalar/use-codemirror";
3
3
  import { nanoid as N } from "nanoid";
4
4
  import B from "../DataTable/DataTableInputSelect.vue.js";
5
- const R = ["id"], T = {
5
+ import { dropdownPlugin as T } from "./codeDropdownWidget.js";
6
+ import { pillPlugin as A, backspaceCommand as U } from "./codeVariableWidget.js";
7
+ import { useWorkspace as W } from "../../store/workspace.js";
8
+ const j = ["id"], z = {
6
9
  key: 3,
7
10
  class: "absolute centered-y right-7 text-orange text-xs"
8
- }, A = {
11
+ }, D = {
9
12
  key: 4,
10
13
  class: "required absolute centered-y right-0 pt-px pr-2 text-xxs text-c-3 bg-b-1 shadow-[-8px_0_4px_var(--scalar-background-1)] opacity-100 duration-150 transition-opacity peer-has-[.cm-focused]:opacity-0"
11
- }, U = {
14
+ }, G = {
12
15
  inheritAttrs: !1
13
- }, H = /* @__PURE__ */ F({
14
- ...U,
16
+ }, Z = /* @__PURE__ */ S({
17
+ ...G,
15
18
  __name: "CodeInput",
16
19
  props: {
17
20
  colorPicker: { type: Boolean, default: !1 },
@@ -30,79 +33,81 @@ const R = ["id"], T = {
30
33
  disableCloseBrackets: { type: Boolean, default: !1 },
31
34
  enum: {},
32
35
  type: {},
33
- nullable: { type: Boolean, default: !1 }
36
+ nullable: { type: Boolean, default: !1 },
37
+ withVariables: { type: Boolean, default: !0 },
38
+ withServers: { type: Boolean, default: !1 }
34
39
  },
35
40
  emits: ["submit", "update:modelValue"],
36
- setup(V, { emit: k }) {
41
+ setup(v, { emit: k }) {
37
42
  var m;
38
- const e = V, a = k, s = S(), v = s.id || `id-${N()}`, i = b(!1);
43
+ const e = v, a = k, d = P(), V = d.id || `id-${N()}`, p = b(!1), { activeWorkspace: w } = W();
39
44
  function C(l) {
40
45
  return e.handleFieldChange ? e.handleFieldChange(l) : a("update:modelValue", l);
41
46
  }
42
47
  function _(l) {
43
48
  return e.handleFieldSubmit ? e.handleFieldSubmit(l) : a("submit", l);
44
49
  }
45
- function w(l) {
46
- i.value = !1, e.emitOnBlur && e.modelValue && _(l);
50
+ function x(l) {
51
+ p.value = !1, e.emitOnBlur && e.modelValue && _(l);
47
52
  }
48
- const c = [];
49
- e.colorPicker && c.push(M);
50
- const p = b(null), { codeMirror: n } = I({
53
+ const n = [];
54
+ e.colorPicker && n.push(M), e.withVariables && !w.value.isReadOnly && n.push(T({ withServers: e.withServers })), n.push(A, U);
55
+ const c = b(null), { codeMirror: r } = I({
51
56
  content: o(
52
57
  () => e.modelValue !== void 0 ? String(e.modelValue) : ""
53
58
  ),
54
59
  onChange: C,
55
- onFocus: () => i.value = !0,
56
- onBlur: (l) => w(l),
57
- codeMirrorRef: p,
60
+ onFocus: () => p.value = !0,
61
+ onBlur: (l) => x(l),
62
+ codeMirrorRef: c,
58
63
  disableTabIndent: o(() => e.disableTabIndent),
59
64
  disableEnter: o(() => e.disableEnter),
60
65
  disableCloseBrackets: o(() => e.disableCloseBrackets),
61
66
  lineNumbers: o(() => e.lineNumbers),
62
67
  language: o(() => e.language),
63
68
  lint: o(() => e.lint),
64
- extensions: c,
69
+ extensions: n,
65
70
  placeholder: o(() => e.placeholder)
66
71
  });
67
- (m = n.value) == null || m.focus(), $(n, () => {
68
- n.value && Object.prototype.hasOwnProperty.call(s, "autofocus") && n.value.focus();
72
+ (m = r.value) == null || m.focus(), O(r, () => {
73
+ r.value && Object.prototype.hasOwnProperty.call(d, "autofocus") && r.value.focus();
69
74
  });
70
- const x = O(() => {
75
+ const F = $(() => {
71
76
  var l;
72
77
  return e.type === "boolean" || (l = e.type) != null && l.includes("boolean") || e.nullable ? ["true", "false", "null"] : ["true", "false"];
73
78
  });
74
- return (l, r) => {
79
+ return (l, u) => {
75
80
  var f;
76
- return t(), u(P, null, [
77
- e.enum && e.enum.length ? (t(), y(B, {
81
+ return t(), s(R, null, [
82
+ e.enum && e.enum.length ? (t(), h(B, {
78
83
  key: 0,
79
84
  modelValue: e.modelValue,
80
85
  value: e.enum,
81
- "onUpdate:modelValue": r[0] || (r[0] = (d) => a("update:modelValue", d))
82
- }, null, 8, ["modelValue", "value"])) : e.type === "boolean" || (f = e.type) != null && f.includes("boolean") ? (t(), y(B, {
86
+ "onUpdate:modelValue": u[0] || (u[0] = (i) => a("update:modelValue", i))
87
+ }, null, 8, ["modelValue", "value"])) : e.type === "boolean" || (f = e.type) != null && f.includes("boolean") ? (t(), h(B, {
83
88
  key: 1,
84
89
  modelValue: e.modelValue,
85
- value: x.value,
86
- "onUpdate:modelValue": r[1] || (r[1] = (d) => a("update:modelValue", d))
87
- }, null, 8, ["modelValue", "value"])) : (t(), u("div", q({
90
+ value: F.value,
91
+ "onUpdate:modelValue": u[1] || (u[1] = (i) => a("update:modelValue", i))
92
+ }, null, 8, ["modelValue", "value"])) : (t(), s("div", q({
88
93
  key: 2,
89
- id: E(v)
94
+ id: E(V)
90
95
  }, l.$attrs, {
91
96
  ref_key: "codeMirrorRef",
92
- ref: p,
97
+ ref: c,
93
98
  class: ["peer font-code w-full whitespace-nowrap text-xs leading-[1.44] relative", {
94
99
  "flow-code-input--error": l.error
95
100
  }]
96
- }), null, 16, R)),
97
- l.$slots.warning ? (t(), u("div", T, [
98
- h(l.$slots, "warning", {}, void 0, !0)
101
+ }), null, 16, j)),
102
+ l.$slots.warning ? (t(), s("div", z, [
103
+ y(l.$slots, "warning", {}, void 0, !0)
99
104
  ])) : g("", !0),
100
- h(l.$slots, "icon", {}, void 0, !0),
101
- l.required ? (t(), u("div", A, " Required ")) : g("", !0)
105
+ y(l.$slots, "icon", {}, void 0, !0),
106
+ l.required ? (t(), s("div", D, " Required ")) : g("", !0)
102
107
  ], 64);
103
108
  };
104
109
  }
105
110
  });
106
111
  export {
107
- H as default
112
+ Z as default
108
113
  };
@@ -0,0 +1,24 @@
1
+ import { type DecorationSet, type EditorView, ViewPlugin, type ViewUpdate, WidgetType } from '@scalar/use-codemirror';
2
+ declare class DropdownWidget extends WidgetType {
3
+ private queryTerm;
4
+ private onSelect;
5
+ private dropdown;
6
+ private withServers?;
7
+ constructor(queryTerm: string, onSelect: (item: string) => void, withServers?: boolean);
8
+ updateQueryTerm(newQueryTerm: string): void;
9
+ getQueryTerm(): string;
10
+ toDOM(view: EditorView): HTMLSpanElement;
11
+ destroy(): void;
12
+ eq(other: WidgetType): boolean;
13
+ }
14
+ export declare const dropdownPlugin: (props: {
15
+ withServers?: boolean;
16
+ }) => ViewPlugin<{
17
+ decorations: DecorationSet;
18
+ widget: DropdownWidget | null;
19
+ view: EditorView;
20
+ handleDropdownSelect(item: string): void;
21
+ update(update: ViewUpdate): void;
22
+ }>;
23
+ export {};
24
+ //# sourceMappingURL=codeDropdownWidget.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codeDropdownWidget.d.ts","sourceRoot":"","sources":["../../../src/components/CodeInput/codeDropdownWidget.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,UAAU,EAEf,UAAU,EACV,KAAK,UAAU,EACf,UAAU,EACX,MAAM,wBAAwB,CAAA;AAK/B,cAAM,cAAe,SAAQ,UAAU;IACrC,OAAO,CAAC,SAAS,CAAQ;IACzB,OAAO,CAAC,QAAQ,CAAwB;IACxC,OAAO,CAAC,QAAQ,CAAY;IAC5B,OAAO,CAAC,WAAW,CAAC,CAAS;gBAG3B,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,EAChC,WAAW,CAAC,EAAE,OAAO;IAQvB,eAAe,CAAC,YAAY,EAAE,MAAM;IAMpC,YAAY;IAIZ,KAAK,CAAC,IAAI,EAAE,UAAU;IAoCtB,OAAO;IAOP,EAAE,CAAC,KAAK,EAAE,UAAU;CAGrB;AAED,eAAO,MAAM,cAAc,UAAW;IAAE,WAAW,CAAC,EAAE,OAAO,CAAA;CAAE;iBAG5C,aAAa;YAClB,cAAc,GAAG,IAAI;UACvB,UAAU;+BAQW,MAAM;mBAqClB,UAAU;EAsC5B,CAAA"}