@scalar/api-client 2.0.24 → 2.0.26

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 (168) hide show
  1. package/CHANGELOG.md +39 -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 +79 -83
  5. package/dist/components/AddressBar/AddressBarHistory.vue.d.ts.map +1 -1
  6. package/dist/components/AddressBar/AddressBarHistory.vue.js +38 -38
  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 +2 -1
  11. package/dist/components/CodeInput/CodeInput.vue2.js +43 -38
  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/DataTable/DataTableInput.vue.d.ts +1 -1
  46. package/dist/components/DataTable/DataTableInput.vue.d.ts.map +1 -1
  47. package/dist/components/DataTable/DataTableInput.vue.js +3 -3
  48. package/dist/components/DataTable/DataTableInput.vue2.js +36 -49
  49. package/dist/components/SideNav/SideNav.vue.d.ts.map +1 -1
  50. package/dist/components/SideNav/SideNav.vue.js +26 -23
  51. package/dist/components/SideNav/SideNavLink.vue.d.ts +3 -2
  52. package/dist/components/SideNav/SideNavLink.vue.d.ts.map +1 -1
  53. package/dist/components/SideNav/SideNavLink.vue.js +5 -5
  54. package/dist/components/Sidebar/Sidebar.vue.d.ts +15 -2
  55. package/dist/components/Sidebar/Sidebar.vue.d.ts.map +1 -1
  56. package/dist/components/Sidebar/Sidebar.vue.js +14 -12
  57. package/dist/components/Sidebar/SidebarButton.vue.d.ts.map +1 -1
  58. package/dist/components/Sidebar/SidebarButton.vue.js +5 -5
  59. package/dist/components/TopNav/TopNav.vue.d.ts.map +1 -1
  60. package/dist/components/TopNav/TopNav.vue.js +2 -2
  61. package/dist/components/TopNav/TopNav.vue2.js +31 -28
  62. package/dist/components/TopNav/TopNavItem.vue.d.ts +7 -3
  63. package/dist/components/TopNav/TopNavItem.vue.d.ts.map +1 -1
  64. package/dist/components/TopNav/TopNavItem.vue.js +2 -2
  65. package/dist/components/TopNav/TopNavItem.vue2.js +16 -15
  66. package/dist/components/ViewLayout/ViewLayout.vue.d.ts.map +1 -1
  67. package/dist/components/ViewLayout/ViewLayout.vue.js +1 -1
  68. package/dist/components/ViewLayout/ViewLayoutCollapse.vue.d.ts.map +1 -1
  69. package/dist/components/ViewLayout/ViewLayoutCollapse.vue.js +2 -1
  70. package/dist/constants.d.ts +13 -7
  71. package/dist/constants.d.ts.map +1 -1
  72. package/dist/constants.js +4 -4
  73. package/dist/index.d.ts +3 -4
  74. package/dist/index.d.ts.map +1 -1
  75. package/dist/index.js +14 -16
  76. package/dist/layouts/App/ApiClientApp.vue.d.ts.map +1 -0
  77. package/dist/layouts/App/ApiClientApp.vue.js +72 -0
  78. package/dist/{App → layouts/App}/createApiClientApp.d.ts +1 -1
  79. package/dist/layouts/App/createApiClientApp.d.ts.map +1 -0
  80. package/dist/{App → layouts/App}/createApiClientApp.js +2 -2
  81. package/dist/layouts/App/index.d.ts.map +1 -0
  82. package/dist/{Modal → layouts/Modal}/ApiClientModal.vue.d.ts +1 -0
  83. package/dist/layouts/Modal/ApiClientModal.vue.d.ts.map +1 -0
  84. package/dist/{Modal → layouts/Modal}/ApiClientModal.vue.js +2 -2
  85. package/dist/{Modal → layouts/Modal}/api-client-modal.d.ts +1 -1
  86. package/dist/layouts/Modal/api-client-modal.d.ts.map +1 -0
  87. package/dist/{Modal → layouts/Modal}/api-client-modal.js +42 -42
  88. package/dist/layouts/Modal/index.d.ts.map +1 -0
  89. package/dist/libs/eventBusses/command-palette.d.ts +14 -0
  90. package/dist/libs/eventBusses/command-palette.d.ts.map +1 -0
  91. package/dist/libs/eventBusses/command-palette.js +5 -0
  92. package/dist/libs/local-storage.d.ts +1 -1
  93. package/dist/libs/local-storage.d.ts.map +1 -1
  94. package/dist/libs/local-storage.js +19 -19
  95. package/dist/router.d.ts +5 -10
  96. package/dist/router.d.ts.map +1 -1
  97. package/dist/router.js +23 -19
  98. package/dist/store/topNav.d.ts +94 -82
  99. package/dist/store/topNav.d.ts.map +1 -1
  100. package/dist/store/topNav.js +21 -20
  101. package/dist/store/workspace.d.ts +348 -94
  102. package/dist/store/workspace.d.ts.map +1 -1
  103. package/dist/store/workspace.js +314 -221
  104. package/dist/style.css +1 -1
  105. package/dist/views/Collection/Collection.vue.d.ts.map +1 -1
  106. package/dist/views/Components/Schemas/Schemas.vue.d.ts.map +1 -1
  107. package/dist/views/Cookies/Cookies.vue.d.ts.map +1 -1
  108. package/dist/views/Cookies/Cookies.vue2.js +27 -30
  109. package/dist/views/Environment/Environment.vue.d.ts.map +1 -1
  110. package/dist/views/Environment/Environment.vue2.js +22 -25
  111. package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts.map +1 -1
  112. package/dist/views/Environment/EnvironmentVariableDropdown.vue.js +38 -47
  113. package/dist/views/Request/Request.vue.d.ts.map +1 -1
  114. package/dist/views/Request/Request.vue.js +1 -1
  115. package/dist/views/Request/Request.vue2.js +130 -109
  116. package/dist/views/Request/RequestSection/RequestAuthDataTableInput.vue.d.ts +1 -1
  117. package/dist/views/Request/RequestSection/RequestAuthDataTableInput.vue.d.ts.map +1 -1
  118. package/dist/views/Request/RequestSection/RequestSection.vue.d.ts.map +1 -1
  119. package/dist/views/Request/RequestSection/RequestSection.vue.js +5 -4
  120. package/dist/views/Request/RequestSection/RequestTable.vue.d.ts.map +1 -1
  121. package/dist/views/Request/RequestSection/RequestTable.vue.js +1 -1
  122. package/dist/views/Request/RequestSection/RequestTable.vue2.js +19 -19
  123. package/dist/views/Request/RequestSection/RequestTableTooltip.vue.d.ts.map +1 -1
  124. package/dist/views/Request/RequestSection/RequestTableTooltip.vue.js +6 -5
  125. package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
  126. package/dist/views/Request/RequestSidebarItem.vue.js +2 -2
  127. package/dist/views/Request/RequestSidebarItem.vue2.js +78 -81
  128. package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts.map +1 -1
  129. package/dist/views/Request/RequestSidebarItemMenu.vue.js +60 -42
  130. package/dist/views/Request/ResponseSection/ResponseSection.vue.d.ts.map +1 -1
  131. package/dist/views/Request/ResponseSection/ResponseSection.vue.js +6 -5
  132. package/dist/views/Request/components/OAuth2.vue.d.ts.map +1 -1
  133. package/dist/views/Request/components/OAuth2.vue.js +2 -0
  134. package/dist/{App.vue.d.ts → views/Request/components/WorkspaceDropdown.vue.d.ts} +1 -2
  135. package/dist/views/Request/components/WorkspaceDropdown.vue.d.ts.map +1 -0
  136. package/dist/views/Request/components/WorkspaceDropdown.vue.js +80 -0
  137. package/dist/views/Request/components/WorkspaceDropdown.vue2.js +4 -0
  138. package/dist/views/Request/components/index.d.ts +1 -0
  139. package/dist/views/Request/components/index.d.ts.map +1 -1
  140. package/dist/views/Request/components/index.js +4 -2
  141. package/dist/views/Servers/Servers.vue.d.ts.map +1 -1
  142. package/dist/views/Servers/Servers.vue2.js +12 -15
  143. package/package.json +22 -18
  144. package/dist/App/ApiClientApp.vue.d.ts.map +0 -1
  145. package/dist/App/ApiClientApp.vue.js +0 -56
  146. package/dist/App/createApiClientApp.d.ts.map +0 -1
  147. package/dist/App/index.d.ts.map +0 -1
  148. package/dist/App.vue.d.ts.map +0 -1
  149. package/dist/App.vue.js +0 -77
  150. package/dist/App.vue3.js +0 -5
  151. package/dist/Modal/ApiClientModal.vue.d.ts.map +0 -1
  152. package/dist/Modal/api-client-modal.d.ts.map +0 -1
  153. package/dist/Modal/index.d.ts.map +0 -1
  154. package/dist/components/AddressBar/AddressBarServer.vue.js +0 -113
  155. package/dist/components/AddressBar/AddressBarServer.vue2.js +0 -4
  156. package/dist/components/CommandPalette/CommandPalette.vue.d.ts +0 -17
  157. package/dist/components/CommandPalette/CommandPalette.vue.d.ts.map +0 -1
  158. package/dist/components/CommandPalette/CommandPalette.vue.js +0 -7
  159. package/dist/components/CommandPalette/CommandPalette.vue2.js +0 -185
  160. package/dist/main.d.ts +0 -2
  161. package/dist/main.d.ts.map +0 -1
  162. /package/dist/{App → layouts/App}/ApiClientApp.vue.d.ts +0 -0
  163. /package/dist/{App → layouts/App}/ApiClientApp.vue3.js +0 -0
  164. /package/dist/{App → layouts/App}/index.d.ts +0 -0
  165. /package/dist/{App → layouts/App}/index.js +0 -0
  166. /package/dist/{Modal → layouts/Modal}/ApiClientModal.vue2.js +0 -0
  167. /package/dist/{Modal → layouts/Modal}/index.d.ts +0 -0
  168. /package/dist/{Modal → layouts/Modal}/index.js +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,44 @@
1
1
  # @scalar/api-client
2
2
 
3
+ ## 2.0.26
4
+
5
+ ### Patch Changes
6
+
7
+ - 54f7654: fix: add local storage to client.scalar/com
8
+ - b0b3290: feat: create a default workspace if no OpenAPI document is passed to the modal
9
+ - 7e01b12: fix: only trigger codeinput change event if the value has changed
10
+ - b7211fb: fix: request history
11
+ - Updated dependencies [67aefbf]
12
+ - Updated dependencies [7761630]
13
+ - @scalar/components@0.12.17
14
+ - @scalar/oas-utils@0.2.16
15
+
16
+ ## 2.0.25
17
+
18
+ ### Patch Changes
19
+
20
+ - 591fe24: fix: clipped border radius in requests items
21
+ - 7f17fe4: feat: move command palette into the client app base
22
+ - 1dab515: feat: revamp address bar
23
+ - 4d76ff5: feat: add support for multiple workspaces
24
+ - e8cd161: feat: store workspace in local storage
25
+ - a431eb0: fix: table checkbox for required params on import
26
+ - ff59399: fix: api client spacing issues, and icon thickness
27
+ - ec47287: feat: made request examples functional in client
28
+ - 747e80e: fix: only flex addressbar codemirror
29
+ - 9d561b7: fix: make app topbar draggable
30
+ - Updated dependencies [1dab515]
31
+ - Updated dependencies [5e060b1]
32
+ - Updated dependencies [ff59399]
33
+ - Updated dependencies [694c1d8]
34
+ - @scalar/oas-utils@0.2.15
35
+ - @scalar/themes@0.9.15
36
+ - @scalar/components@0.12.16
37
+ - @scalar/use-codemirror@0.11.7
38
+ - @scalar/object-utils@1.1.4
39
+ - @scalar/use-toasts@0.7.4
40
+ - @scalar/use-tooltip@1.0.2
41
+
3
42
  ## 2.0.24
4
43
 
5
44
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"AddressBar.vue.d.ts","sourceRoot":"","sources":["../../../src/components/AddressBar/AddressBar.vue"],"names":[],"mappings":";AAwpBA,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-02983c4d"]]);
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-02983c4d"), 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), {
112
+ default: _(() => [
113
+ r(l(T), {
118
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-02983c4d"), 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":";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
+ {"version":3,"file":"AddressBarHistory.vue.d.ts","sourceRoot":"","sources":["../../../src/components/AddressBar/AddressBarHistory.vue"],"names":[],"mappings":";UAkHQ,OAAO;;UAAP,OAAO;;AA0Of,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,34 +1,34 @@
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";
1
+ import { defineComponent as y, openBlock as n, createElementBlock as p, Fragment as f, unref as e, createBlock as i, withCtx as m, createVNode as d, createCommentVNode as x, createElementVNode as r, normalizeClass as h, renderList as k, toDisplayString as u } from "vue";
2
2
  import { formatMs as w } from "../../libs/formatters.js";
3
- import { useWorkspace as y } from "../../store/workspace.js";
4
- import { ListboxButton as C, ListboxOptions as L, ListboxOption as R } from "@headlessui/vue";
5
- import { ScalarIcon as B } from "@scalar/components";
6
- import { httpStatusCodes as S } from "@scalar/oas-utils/helpers";
7
- import { useRouter as H } from "vue-router";
3
+ import { useWorkspace as C } from "../../store/workspace.js";
4
+ import { ListboxButton as q, ListboxOptions as U, ListboxOption as L } from "@headlessui/vue";
5
+ import { ScalarIcon as R } from "@scalar/components";
6
+ import { httpStatusCodes as B } from "@scalar/oas-utils/helpers";
7
+ import { useRouter as S } 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__ */ q({
10
+ const E = { class: "font-code flex flex-1 gap-1.5 text-sm font-medium" }, H = { class: "text-c-2 gap-0" }, N = { class: "font-code text-c-3 flex flex-row items-center gap-1.5 text-sm font-medium" }, G = /* @__PURE__ */ y({
11
11
  __name: "AddressBarHistory",
12
12
  props: {
13
13
  open: { type: Boolean }
14
14
  },
15
- setup($) {
16
- const { requestsHistory: u, activeRequest: g, requestExampleMutators: _ } = y(), v = H();
17
- function p(a, r) {
18
- const e = new URL(a.responseURL), s = new URLSearchParams(e.search).get("scalar_url");
19
- return s ? new URL(s)[r].toString() : e.origin;
15
+ setup(V) {
16
+ const { activeRequest: l, requestExampleMutators: b } = C(), g = S();
17
+ function _(a) {
18
+ const o = new URL(a), s = new URLSearchParams(o.search).get("scalar_url");
19
+ return s ? new URL(s).href : o.href;
20
20
  }
21
- function k(a) {
22
- const r = u.value[a];
23
- g.value.uid !== r.request.requestUid && v.push(`/request/${r.request.requestUid}`), _.set(r.request);
21
+ function v(a) {
22
+ const o = l.value.history[a];
23
+ l.value.uid !== o.request.requestUid && g.push(`/request/${o.request.requestUid}`), b.set(o.request);
24
24
  }
25
- return (a, r) => (n(), f(d, null, [
26
- t(u).length ? (n(), i(t(C), {
25
+ return (a, o) => (n(), p(f, null, [
26
+ e(l).history.length ? (n(), i(e(q), {
27
27
  key: 0,
28
28
  class: "hover:bg-b-2 mr-1 rounded p-1.5"
29
29
  }, {
30
30
  default: m(() => [
31
- x(t(B), {
31
+ d(e(R), {
32
32
  class: "text-c-3",
33
33
  icon: "History",
34
34
  size: "sm",
@@ -36,38 +36,38 @@ const E = { class: "font-code flex flex-1 gap-1.5 text-sm font-medium" }, N = {
36
36
  })
37
37
  ]),
38
38
  _: 1
39
- })) : b("", !0),
40
- o("div", {
39
+ })) : x("", !0),
40
+ r("div", {
41
41
  class: h([
42
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",
43
43
  { "before:shadow-lg": a.open }
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
+ d(e(U), { class: "bg-b-1 custom-scroll bg-mix-transparent bg-mix-amount-30 max-h-[300px] rounded-b p-[3px] pt-0 backdrop-blur" }, {
47
47
  default: m(() => [
48
- (n(!0), f(d, null, U(t(u), ({ response: e }, l) => (n(), i(t(R), {
49
- key: l,
48
+ (n(!0), p(f, null, k(e(l).history, ({ response: t }, s) => (n(), i(e(L), {
49
+ key: s,
50
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",
51
- value: l,
52
- onClick: (s) => k(l)
51
+ value: s,
52
+ onClick: (c) => v(s)
53
53
  }, {
54
54
  default: m(() => {
55
- var s;
55
+ var c;
56
56
  return [
57
- o("div", E, [
58
- e.config.method ? (n(), i(P, {
57
+ r("div", E, [
58
+ t.config.method ? (n(), i(P, {
59
59
  key: 0,
60
60
  class: "text-[11px] min-w-[44px]",
61
- method: e.config.method
62
- }, null, 8, ["method"])) : b("", !0),
63
- o("span", N, c(p(e.request, "origin") + p(e.request, "pathname")), 1)
61
+ method: t.config.method
62
+ }, null, 8, ["method"])) : x("", !0),
63
+ r("span", H, u(_(t.config.url)), 1)
64
64
  ]),
65
- o("div", V, [
66
- o("span", null, c(t(w)(e.duration)), 1),
67
- o("span", {
68
- class: h([t(z)(e.status).color])
69
- }, c(e.status), 3),
70
- o("span", null, c((s = t(S)[e.status]) == null ? void 0 : s.name), 1)
65
+ r("div", N, [
66
+ r("span", null, u(e(w)(t.duration)), 1),
67
+ r("span", {
68
+ class: h([e(z)(t.status).color])
69
+ }, u(t.status), 3),
70
+ r("span", null, u((c = e(B)[t.status]) == null ? void 0 : c.name), 1)
71
71
  ])
72
72
  ];
73
73
  }),
@@ -81,5 +81,5 @@ const E = { class: "font-code flex flex-1 gap-1.5 text-sm font-medium" }, N = {
81
81
  }
82
82
  });
83
83
  export {
84
- Q as default
84
+ G as default
85
85
  };
@@ -1 +1 @@
1
- {"version":3,"file":"AddressBarServer.vue.d.ts","sourceRoot":"","sources":["../../../src/components/AddressBar/AddressBarServer.vue"],"names":[],"mappings":";AA0ZA,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,OAuRO,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;;qBA2PG,GAAG;kBACN,GAAG;;AAhR9B,wBAmTC;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 f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-ee1f4723"]]);
5
6
  export {
6
7
  f 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 i, 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: V }) {
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 = V, d = P(), k = d.id || `id-${N()}`, p = b(!1), { activeWorkspace: w } = W();
39
44
  function C(l) {
40
- return e.handleFieldChange ? e.handleFieldChange(l) : a("update:modelValue", l);
45
+ return l === e.modelValue ? null : 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(), i(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] = (s) => a("update:modelValue", s))
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] = (s) => a("update:modelValue", s))
92
+ }, null, 8, ["modelValue", "value"])) : (t(), i("div", q({
88
93
  key: 2,
89
- id: E(v)
94
+ id: E(k)
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(), i("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(), i("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
  };