@scalar/api-client 2.3.26 → 2.3.27

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 (86) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
  3. package/dist/components/CodeInput/CodeInput.vue.js +2 -2
  4. package/dist/components/CodeInput/CodeInput.vue2.js +75 -72
  5. package/dist/components/CodeInput/codeVariableWidget.d.ts.map +1 -1
  6. package/dist/components/CodeInput/codeVariableWidget.js +48 -45
  7. package/dist/components/DataTable/DataTableInput.vue.d.ts +2 -0
  8. package/dist/components/DataTable/DataTableInput.vue.d.ts.map +1 -1
  9. package/dist/components/DataTable/DataTableInput.vue.js +3 -3
  10. package/dist/components/DataTable/DataTableInput.vue2.js +46 -43
  11. package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.d.ts +1 -1
  12. package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.d.ts.map +1 -1
  13. package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +82 -92
  14. package/dist/components/Form/Form.vue.d.ts +2 -2
  15. package/dist/components/Form/Form.vue.d.ts.map +1 -1
  16. package/dist/components/Form/Form.vue.js +17 -14
  17. package/dist/components/ImportCollection/IntegrationLogo.vue.d.ts.map +1 -1
  18. package/dist/components/ImportCollection/IntegrationLogo.vue.js +2 -1
  19. package/dist/components/SideNav/SideNav.vue.d.ts.map +1 -1
  20. package/dist/components/SideNav/SideNav.vue.js +30 -30
  21. package/dist/components/Sidebar/SidebarListElement.vue.d.ts +16 -0
  22. package/dist/components/Sidebar/SidebarListElement.vue.d.ts.map +1 -1
  23. package/dist/components/Sidebar/SidebarListElement.vue.js +3 -2
  24. package/dist/components/Sidebar/SidebarListElement.vue2.js +76 -54
  25. package/dist/components/ViewLayout/ViewLayoutSection.vue.d.ts +2 -2
  26. package/dist/components/ViewLayout/ViewLayoutSection.vue.d.ts.map +1 -1
  27. package/dist/components/ViewLayout/ViewLayoutSection.vue.js +5 -4
  28. package/dist/hooks/useClientConfig.d.ts +6 -6
  29. package/dist/hooks/useClientConfig.d.ts.map +1 -1
  30. package/dist/layouts/App/create-api-client-app.d.ts +3 -3
  31. package/dist/layouts/Modal/create-api-client-modal.d.ts +6 -6
  32. package/dist/layouts/Web/create-api-client-web.d.ts +3 -3
  33. package/dist/libs/create-client.d.ts +3 -3
  34. package/dist/libs/env-helpers.d.ts +10 -2
  35. package/dist/libs/env-helpers.d.ts.map +1 -1
  36. package/dist/libs/env-helpers.js +4 -2
  37. package/dist/libs/environment-parser.d.ts +1 -1
  38. package/dist/libs/hot-keys.d.ts +1 -1
  39. package/dist/libs/send-request/create-request-operation.d.ts.map +1 -1
  40. package/dist/libs/send-request/create-request-operation.js +9 -9
  41. package/dist/libs/send-request/create-request-operation.test.d.ts.map +1 -1
  42. package/dist/libs/string-template.d.ts.map +1 -1
  43. package/dist/libs/string-template.js +35 -21
  44. package/dist/routes.d.ts +10 -10
  45. package/dist/store/active-entities.js +34 -34
  46. package/dist/store/environment.js +1 -1
  47. package/dist/store/store.d.ts +3 -3
  48. package/dist/store/workspace.d.ts +2 -2
  49. package/dist/style.css +1 -1
  50. package/dist/views/Collection/CollectionCookies.vue.d.ts +1 -1
  51. package/dist/views/Collection/CollectionEnvironment.vue.d.ts +1 -1
  52. package/dist/views/Collection/CollectionOverview.vue.d.ts +1 -1
  53. package/dist/views/Collection/CollectionScripts.vue.d.ts +1 -1
  54. package/dist/views/Collection/CollectionServerForm.vue.d.ts.map +1 -1
  55. package/dist/views/Collection/CollectionServerForm.vue.js +39 -34
  56. package/dist/views/Collection/CollectionServers.vue.d.ts.map +1 -1
  57. package/dist/views/Collection/CollectionServers.vue2.js +58 -78
  58. package/dist/views/Collection/CollectionSync.vue.d.ts +1 -1
  59. package/dist/views/Cookies/CookieForm.vue.d.ts +1 -1
  60. package/dist/views/Cookies/CookieRaw.vue.d.ts +1 -1
  61. package/dist/views/Environment/Environment.vue.d.ts.map +1 -1
  62. package/dist/views/Environment/Environment.vue2.js +208 -188
  63. package/dist/views/Environment/EnvironmentColors.vue.js +5 -5
  64. package/dist/views/Environment/EnvironmentModal.vue.js +21 -21
  65. package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts.map +1 -1
  66. package/dist/views/Environment/EnvironmentVariableDropdown.vue.js +9 -9
  67. package/dist/views/Environment/handle-drag.d.ts +13 -0
  68. package/dist/views/Environment/handle-drag.d.ts.map +1 -0
  69. package/dist/views/Environment/handle-drag.js +32 -0
  70. package/dist/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue.d.ts.map +1 -1
  71. package/dist/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue.js +111 -88
  72. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTableInput.vue.d.ts.map +1 -1
  73. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTableInput.vue.js +1 -0
  74. package/dist/views/Request/RequestSection/RequestParams.vue.d.ts.map +1 -1
  75. package/dist/views/Request/RequestSection/RequestParams.vue.js +62 -56
  76. package/dist/views/Request/RequestSection/RequestSection.vue.d.ts +1 -1
  77. package/dist/views/Request/RequestSection/RequestSection.vue.d.ts.map +1 -1
  78. package/dist/views/Request/RequestSection/RequestSection.vue.js +4 -4
  79. package/dist/views/Request/RequestSection/RequestSection.vue2.js +42 -47
  80. package/dist/views/Request/RequestSection/RequestTable.vue.js +1 -1
  81. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  82. package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue.d.ts.map +1 -1
  83. package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue.js +2 -2
  84. package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue2.js +10 -10
  85. package/dist/views/Request/ResponseSection/ResponseSection.vue.d.ts +1 -1
  86. package/package.json +13 -13
@@ -1,55 +1,62 @@
1
- import { defineComponent as ie, ref as h, watch as ue, onMounted as me, onBeforeUnmount as ce, openBlock as v, createBlock as g, withCtx as c, createVNode as m, createElementVNode as p, unref as r, createElementBlock as V, Fragment as A, renderList as B, normalizeClass as L, createTextVNode as K, toDisplayString as F, withDirectives as de, withModifiers as ve, createCommentVNode as G, vShow as fe, createSlots as pe } from "vue";
2
- import { useModal as O, ScalarIcon as J, ScalarButton as xe, ScalarModal as be } from "@scalar/components";
3
- import { LibraryIcon as he } from "@scalar/icons/library";
4
- import { useToasts as Ce } from "@scalar/use-toasts";
5
- import { useRouter as Ee, useRoute as ke } from "vue-router";
6
- import ye from "../../components/CodeInput/CodeInput.vue.js";
7
- import ge from "../../components/Sidebar/Actions/EditSidebarListElement.vue.js";
8
- import _e from "../../components/Sidebar/Sidebar.vue.js";
9
- import we from "../../components/Sidebar/SidebarButton.vue.js";
10
- import Ie from "../../components/Sidebar/SidebarList.vue.js";
11
- import T from "../../components/Sidebar/SidebarListElement.vue.js";
12
- import Me from "../../components/ViewLayout/ViewLayout.vue.js";
13
- import Se from "../../components/ViewLayout/ViewLayoutContent.vue.js";
14
- import $e from "../../components/ViewLayout/ViewLayoutSection.vue.js";
15
- import { useSidebar as Ve } from "../../hooks/useSidebar.js";
1
+ import { defineComponent as de, ref as C, computed as ve, watch as fe, onMounted as pe, onBeforeUnmount as be, openBlock as f, createBlock as _, withCtx as c, createVNode as u, createElementVNode as b, unref as l, createElementBlock as O, Fragment as B, renderList as L, normalizeClass as K, createTextVNode as G, toDisplayString as J, withDirectives as xe, withModifiers as he, createCommentVNode as T, vShow as Ee, createSlots as Ce } from "vue";
2
+ import { useModal as j, ScalarIcon as H, ScalarButton as ke, ScalarModal as ge } from "@scalar/components";
3
+ import { LibraryIcon as ye } from "@scalar/icons/library";
4
+ import { useToasts as _e } from "@scalar/use-toasts";
5
+ import { useRouter as we, useRoute as De } from "vue-router";
6
+ import Ie from "../../components/CodeInput/CodeInput.vue.js";
7
+ import Me from "../../components/Sidebar/Actions/EditSidebarListElement.vue.js";
8
+ import Se from "../../components/Sidebar/Sidebar.vue.js";
9
+ import $e from "../../components/Sidebar/SidebarButton.vue.js";
10
+ import Ve from "../../components/Sidebar/SidebarList.vue.js";
11
+ import P from "../../components/Sidebar/SidebarListElement.vue.js";
12
+ import Oe from "../../components/ViewLayout/ViewLayout.vue.js";
13
+ import je from "../../components/ViewLayout/ViewLayoutContent.vue.js";
14
+ import Fe from "../../components/ViewLayout/ViewLayoutSection.vue.js";
15
+ import { useSidebar as Ne } from "../../hooks/useSidebar.js";
16
16
  import { PathId as i } from "../../routes.js";
17
- import { useActiveEntities as Oe } from "../../store/active-entities.js";
18
- import je from "./EnvironmentColorModal.vue.js";
19
- import Ne from "./EnvironmentModal.vue.js";
20
- import { useWorkspace as Re } from "../../store/store.js";
21
- const De = { class: "flex-1" }, Ue = ["onClick"], We = { class: "flex h-5 max-w-[14px] items-center justify-center" }, ln = /* @__PURE__ */ ie({
17
+ import { useActiveEntities as Re } from "../../store/active-entities.js";
18
+ import We from "./EnvironmentColorModal.vue.js";
19
+ import Ue from "./EnvironmentModal.vue.js";
20
+ import { environmentDragHandlerFactory as ze } from "./handle-drag.js";
21
+ import { useWorkspace as Ae } from "../../store/store.js";
22
+ const Be = { class: "flex-1" }, Le = ["onClick"], Ke = { class: "flex h-5 max-w-[14px] items-center justify-center" }, vn = /* @__PURE__ */ de({
22
23
  __name: "Environment",
23
- setup(ze) {
24
- const C = Ee(), E = ke(), {
25
- activeWorkspace: x,
26
- activeEnvironment: j,
27
- activeWorkspaceCollections: u,
28
- activeEnvVariables: H
29
- } = Oe(), { events: N, workspaceMutators: P, collectionMutators: k } = Re(), { collapsedSidebarFolders: y, toggleSidebarFolder: _ } = Ve(), w = O(), I = O(), M = O(), R = h(null), s = h("default"), D = h(""), b = h(void 0), d = h(void 0), S = h(void 0), { toast: U } = Ce(), q = (e) => JSON.parse(e);
30
- function W(e, o, n) {
24
+ setup(Ge) {
25
+ const k = we(), g = De(), {
26
+ activeWorkspace: p,
27
+ activeEnvironment: F,
28
+ activeWorkspaceCollections: d,
29
+ activeEnvVariables: q
30
+ } = Re(), { events: N, workspaceMutators: Q, collectionMutators: x } = Ae(), { collapsedSidebarFolders: y, toggleSidebarFolder: w } = Ne(), D = j(), I = j(), M = j(), R = C(null), s = C("default"), W = C(""), h = C(void 0), v = C(void 0), S = C(void 0), { toast: U } = _e(), X = (e) => JSON.parse(e);
31
+ function z(e, o, n) {
31
32
  var t;
32
33
  e && (o.uid === n ? U(
33
34
  `Environment name already used in ${(t = o.info) == null ? void 0 : t.title}`,
34
35
  "error"
35
36
  ) : U("Environment name already used in another collection", "error"));
36
37
  }
37
- function Q(e) {
38
- u.value.some(
38
+ const E = ve(() => d.value.filter(
39
+ (e) => {
40
+ var o;
41
+ return ((o = e.info) == null ? void 0 : o.title) !== "Drafts";
42
+ }
43
+ ));
44
+ function Y(e) {
45
+ E.value.some(
39
46
  (n) => {
40
47
  const t = Object.keys(
41
48
  n["x-scalar-environments"] || {}
42
49
  ).includes(e.name);
43
- return W(t, n, e.collectionId), t;
50
+ return z(t, n, e.collectionId), t;
44
51
  }
45
- ) || (e.collectionId && (k.addEnvironment(
52
+ ) || (e.collectionId && (x.addEnvironment(
46
53
  e.name,
47
54
  {
48
55
  variables: {},
49
56
  color: e.color
50
57
  },
51
58
  e.collectionId
52
- ), y[e.collectionId] || _(e.collectionId), C.push({
59
+ ), y[e.collectionId] || w(e.collectionId), k.push({
53
60
  name: "environment.collection",
54
61
  params: {
55
62
  [i.Collection]: e.collectionId,
@@ -57,176 +64,186 @@ const De = { class: "flex-1" }, Ue = ["onClick"], We = { class: "flex h-5 max-w-
57
64
  }
58
65
  })), I.hide());
59
66
  }
60
- function X(e) {
61
- var o, n;
62
- if (j) {
63
- const t = q(e);
64
- if (s.value === "default")
65
- P.edit(
66
- (o = x.value) == null ? void 0 : o.uid,
67
- "environments",
68
- t
69
- );
70
- else {
71
- const a = u.value.find(
72
- (l) => {
73
- var f;
74
- return (f = l["x-scalar-environments"]) == null ? void 0 : f[s.value ?? ""];
75
- }
76
- );
77
- if ((n = a == null ? void 0 : a["x-scalar-environments"]) != null && n[s.value ?? ""]) {
78
- const l = a["x-scalar-environments"][s.value ?? ""];
79
- l && (l.variables = t, k.edit(
80
- a.uid,
81
- "x-scalar-environments",
82
- a["x-scalar-environments"]
83
- ));
67
+ function Z(e) {
68
+ var n, t;
69
+ if (!F)
70
+ return;
71
+ const o = X(e);
72
+ if (s.value === "default")
73
+ Q.edit(
74
+ (n = p.value) == null ? void 0 : n.uid,
75
+ "environments",
76
+ o
77
+ );
78
+ else {
79
+ const a = d.value.find(
80
+ (r) => {
81
+ var m;
82
+ return (m = r["x-scalar-environments"]) == null ? void 0 : m[s.value ?? ""];
84
83
  }
84
+ );
85
+ if ((t = a == null ? void 0 : a["x-scalar-environments"]) != null && t[s.value ?? ""]) {
86
+ const r = a["x-scalar-environments"][s.value ?? ""];
87
+ r && (r.variables = o, x.edit(
88
+ a.uid,
89
+ "x-scalar-environments",
90
+ a["x-scalar-environments"]
91
+ ));
85
92
  }
86
93
  }
87
94
  }
88
95
  const $ = (e) => {
89
- b.value = e, I.show();
90
- }, Y = (e, o) => {
91
- d.value = e, b.value = o, S.value = e, M.show();
92
- }, Z = (e) => {
96
+ h.value = e, I.show();
97
+ }, ee = (e, o) => {
98
+ v.value = e, h.value = o, S.value = e, M.show();
99
+ }, ne = (e) => {
93
100
  var o, n, t;
94
- R.value = e, D.value = ((t = (n = (o = u.value.find(
101
+ R.value = e, W.value = ((t = (n = (o = d.value.find(
95
102
  (a) => {
96
- var l;
97
- return (l = a["x-scalar-environments"]) == null ? void 0 : l[e];
103
+ var r;
104
+ return (r = a["x-scalar-environments"]) == null ? void 0 : r[e];
98
105
  }
99
- )) == null ? void 0 : o["x-scalar-environments"]) == null ? void 0 : n[e]) == null ? void 0 : t.color) ?? "", w.show();
100
- }, ee = (e) => {
106
+ )) == null ? void 0 : o["x-scalar-environments"]) == null ? void 0 : n[e]) == null ? void 0 : t.color) ?? "", D.show();
107
+ }, te = (e) => {
101
108
  const o = R.value;
102
- typeof o == "string" && (u.value.some(
109
+ typeof o == "string" && (d.value.some(
103
110
  (t) => {
104
111
  var a;
105
112
  return (a = t["x-scalar-environments"]) == null ? void 0 : a[o];
106
113
  }
107
- ) && u.value.forEach((t) => {
114
+ ) && d.value.forEach((t) => {
108
115
  var a;
109
- (a = t["x-scalar-environments"]) != null && a[o] && (t["x-scalar-environments"][o].color = e, k.edit(
116
+ (a = t["x-scalar-environments"]) != null && a[o] && (t["x-scalar-environments"][o].color = e, x.edit(
110
117
  t.uid,
111
118
  "x-scalar-environments",
112
119
  t["x-scalar-environments"]
113
120
  ));
114
- }), w.hide());
121
+ }), D.hide());
115
122
  };
116
- function ne(e) {
117
- u.value.forEach((n) => {
118
- k.removeEnvironment(e, n.uid);
123
+ function oe(e) {
124
+ var n;
125
+ E.value.forEach((t) => {
126
+ x.removeEnvironment(e, t.uid);
119
127
  });
120
- const o = u.value.flatMap(
121
- (n) => Object.keys(n["x-scalar-environments"] || {})
128
+ const o = E.value.flatMap(
129
+ (t) => Object.keys(t["x-scalar-environments"] || {})
122
130
  );
123
131
  if (o.length > 0) {
124
- const n = o[o.length - 1];
125
- if (!n)
132
+ const t = o[o.length - 1];
133
+ if (!t)
126
134
  return;
127
- const t = u.value.find(
128
- (a) => Object.keys(a["x-scalar-environments"] || {}).includes(
129
- n
135
+ const a = d.value.find(
136
+ (r) => Object.keys(r["x-scalar-environments"] || {}).includes(
137
+ t
130
138
  )
131
139
  );
132
- s.value = n, C.push({
140
+ s.value = t, k.push({
133
141
  name: "environment.collection",
134
142
  params: {
135
- collectionId: t == null ? void 0 : t.uid,
136
- environmentId: n
143
+ [i.Collection]: a == null ? void 0 : a.uid,
144
+ [i.Environment]: t
137
145
  }
138
- }), t && !y[t.uid] && _(t.uid);
146
+ }), a && !y[a.uid] && w(a.uid);
139
147
  } else
140
- s.value = "default", C.push({
141
- name: "environment",
142
- params: { environment: "default" }
148
+ s.value = "default", k.push({
149
+ name: "environment.default",
150
+ params: {
151
+ [i.Workspace]: (n = p.value) == null ? void 0 : n.uid
152
+ }
143
153
  });
144
154
  }
145
- const te = () => s.value === "default" ? "Global Environment" : s.value, oe = () => {
155
+ const ae = () => s.value === "default" ? "Global Environment" : s.value, re = () => {
146
156
  var e, o, n, t;
147
- return s.value === "default" ? JSON.stringify((e = x.value) == null ? void 0 : e.environments, null, 2) : JSON.stringify(
148
- (t = (n = (o = u.value.find(
157
+ return s.value === "default" ? JSON.stringify((e = p.value) == null ? void 0 : e.environments, null, 2) : JSON.stringify(
158
+ (t = (n = (o = d.value.find(
149
159
  (a) => {
150
- var l;
151
- return (l = a["x-scalar-environments"]) == null ? void 0 : l[s.value ?? ""];
160
+ var r;
161
+ return (r = a["x-scalar-environments"]) == null ? void 0 : r[s.value ?? ""];
152
162
  }
153
163
  )) == null ? void 0 : o["x-scalar-environments"]) == null ? void 0 : n[s.value ?? ""]) == null ? void 0 : t.variables,
154
164
  null,
155
165
  2
156
166
  );
157
- }, ae = (e) => y[e], z = (e) => {
158
- e != null && e.createNew && E.name === "environment" && $();
167
+ }, le = (e) => y[e], A = (e) => {
168
+ e != null && e.createNew && g.name === "environment" && $();
159
169
  };
160
- ue(
161
- () => [E.params[i.Collection], E.params[i.Environment]],
170
+ fe(
171
+ () => [g.params[i.Collection], g.params[i.Environment]],
162
172
  ([e, o]) => {
163
173
  e ? s.value = o : s.value = "default";
164
174
  }
165
- ), me(() => {
166
- s.value = E.params[i.Environment] || "default", N.hotKeys.on(z);
167
- const e = E.params[i.Collection];
168
- e && !y[e] && _(e);
169
- }), ce(() => N.hotKeys.off(z));
170
- const le = (e, o, n) => {
171
- var a, l;
175
+ ), pe(() => {
176
+ s.value = g.params[i.Environment] || "default", N.hotKeys.on(A);
177
+ const e = g.params[i.Collection];
178
+ e && !y[e] && w(e);
179
+ }), be(() => N.hotKeys.off(A));
180
+ const se = (e, o, n) => {
181
+ var a, r;
172
182
  const t = n ? {
173
183
  name: "environment.collection",
174
184
  params: {
175
- [i.Workspace]: (a = x.value) == null ? void 0 : a.uid,
185
+ [i.Workspace]: (a = p.value) == null ? void 0 : a.uid,
176
186
  [i.Collection]: n,
177
187
  [i.Environment]: o
178
188
  }
179
189
  } : {
180
190
  name: "environment.default",
181
191
  params: {
182
- [i.Workspace]: (l = x.value) == null ? void 0 : l.uid,
192
+ [i.Workspace]: (r = p.value) == null ? void 0 : r.uid,
183
193
  [i.Environment]: o
184
194
  }
185
195
  };
186
- e.metaKey ? window.open(C.resolve(t).href, "_blank") : C.push(t);
196
+ e.metaKey ? window.open(k.resolve(t).href, "_blank") : k.push(t);
187
197
  };
188
- function re() {
189
- d.value = void 0, b.value = void 0, S.value = void 0, M.hide();
198
+ function ie() {
199
+ v.value = void 0, h.value = void 0, S.value = void 0, M.hide();
190
200
  }
191
- function se(e) {
192
- u.value.some(
201
+ function ue(e) {
202
+ E.value.some(
193
203
  (n) => {
194
204
  const t = Object.keys(
195
205
  n["x-scalar-environments"] || {}
196
206
  ).includes(e);
197
- return W(
207
+ return z(
198
208
  t,
199
209
  n,
200
- b.value
210
+ h.value
201
211
  ), t;
202
212
  }
203
- ) || (e && d.value !== "default" && u.value.forEach((n) => {
213
+ ) || (e && v.value !== "default" && d.value.forEach((n) => {
204
214
  var t;
205
- if ((t = n["x-scalar-environments"]) != null && t[d.value ?? ""]) {
206
- const a = n["x-scalar-environments"][d.value ?? ""];
207
- a && (delete n["x-scalar-environments"][d.value ?? ""], n["x-scalar-environments"][e] = a, k.edit(
215
+ if ((t = n["x-scalar-environments"]) != null && t[v.value ?? ""]) {
216
+ const a = n["x-scalar-environments"], r = {};
217
+ Object.keys(a).forEach((m) => {
218
+ const V = a[m];
219
+ V && (m === v.value ? r[e] = V : r[m] = V);
220
+ }), n["x-scalar-environments"] = r, x.edit(
208
221
  n.uid,
209
222
  "x-scalar-environments",
210
223
  n["x-scalar-environments"]
211
- ));
224
+ );
212
225
  }
213
- }), e && s.value === d.value && (s.value = e), d.value = void 0, b.value = void 0, S.value = void 0, M.hide());
226
+ }), e && s.value === v.value && (s.value = e), v.value = void 0, h.value = void 0, S.value = void 0, M.hide());
214
227
  }
215
- return (e, o) => (v(), g(Me, null, {
228
+ const { handleDragEnd: me, isDroppable: ce } = ze(
229
+ d,
230
+ x
231
+ );
232
+ return (e, o) => (f(), _(Oe, null, {
216
233
  default: c(() => [
217
- m(_e, { title: "Collections" }, {
234
+ u(Se, { title: "Collections" }, {
218
235
  content: c(() => [
219
- p("div", De, [
220
- m(Ie, null, {
236
+ b("div", Be, [
237
+ u(Ve, null, {
221
238
  default: c(() => [
222
- (v(), g(T, {
239
+ (f(), _(P, {
223
240
  key: "default",
224
241
  class: "text-xs",
225
242
  isCopyable: !1,
226
243
  to: {
227
- name: "environment.default",
244
+ name: "environment",
228
245
  params: {
229
- [r(i).Environment]: "default"
246
+ [l(i).Environment]: "default"
230
247
  }
231
248
  },
232
249
  type: "environment",
@@ -237,85 +254,88 @@ const De = { class: "flex-1" }, Ue = ["onClick"], We = { class: "flex h-5 max-w-
237
254
  isDefault: !0
238
255
  }
239
256
  }, null, 8, ["to"])),
240
- (v(!0), V(A, null, B(r(u), (n) => {
257
+ (f(!0), O(B, null, L(E.value, (n) => {
241
258
  var t;
242
- return v(), V("li", {
259
+ return f(), O("li", {
243
260
  key: n.uid,
244
261
  class: "gap-1/2 flex flex-col"
245
262
  }, [
246
- p("button", {
263
+ b("button", {
247
264
  class: "hover:bg-b-2 group flex w-full items-center gap-1.5 break-words rounded p-1.5 text-left text-sm font-medium",
248
265
  type: "button",
249
- onClick: (a) => r(_)(n.uid)
266
+ onClick: (a) => l(w)(n.uid)
250
267
  }, [
251
- p("span", We, [
252
- m(r(he), {
268
+ b("span", Ke, [
269
+ u(l(ye), {
253
270
  class: "text-sidebar-c-2 size-3.5 min-w-3.5 stroke-2 group-hover:hidden",
254
271
  src: n["x-scalar-icon"] || "interface-content-folder"
255
272
  }, null, 8, ["src"]),
256
- p("div", {
257
- class: L({
258
- "rotate-90": r(y)[n.uid]
273
+ b("div", {
274
+ class: K({
275
+ "rotate-90": l(y)[n.uid]
259
276
  })
260
277
  }, [
261
- m(r(J), {
278
+ u(l(H), {
262
279
  class: "text-c-3 hover:text-c-1 hidden text-sm group-hover:block",
263
280
  icon: "ChevronRight",
264
281
  size: "md"
265
282
  })
266
283
  ], 2)
267
284
  ]),
268
- K(" " + F(((t = n.info) == null ? void 0 : t.title) ?? ""), 1)
269
- ], 8, Ue),
270
- de(p("div", {
271
- class: L({
285
+ G(" " + J(((t = n.info) == null ? void 0 : t.title) ?? ""), 1)
286
+ ], 8, Le),
287
+ xe(b("div", {
288
+ class: K({
272
289
  "before:bg-border before:z-1 relative mb-[.5px] before:pointer-events-none before:absolute before:left-3 before:top-0 before:h-[calc(100%_+_.5px)] before:w-[.5px] last:mb-0 last:before:h-full": Object.keys(n["x-scalar-environments"] || {}).length > 0
273
290
  })
274
291
  }, [
275
- (v(!0), V(A, null, B(n["x-scalar-environments"], (a, l) => (v(), g(T, {
276
- key: l,
277
- class: "text-xs [&>a]:pl-5",
292
+ (f(!0), O(B, null, L(n["x-scalar-environments"], (a, r) => (f(), _(P, {
293
+ key: r,
294
+ class: "text-xs",
278
295
  collectionId: n.uid,
279
296
  isCopyable: !1,
280
297
  isDeletable: !0,
281
298
  isRenameable: !0,
299
+ isDraggable: !0,
300
+ isDroppable: l(ce),
282
301
  to: {
283
- name: "collection.environment",
302
+ name: "environment.collection",
284
303
  params: {
285
- [r(i).Collection]: n.uid,
286
- [r(i).Environment]: l
304
+ [l(i).Collection]: n.uid,
305
+ [l(i).Environment]: r
287
306
  }
288
307
  },
289
308
  type: "environment",
290
309
  variable: {
291
- name: l,
292
- uid: l,
293
- color: a.color ?? "#8E8E8E",
310
+ name: r,
311
+ uid: r,
312
+ color: a.color ?? "#FFFFFF",
294
313
  isDefault: !1
295
314
  },
296
315
  warningMessage: "Are you sure you want to delete this environment?",
297
- onClick: ve((f) => le(f, l, n.uid), ["prevent"]),
298
- onColorModal: (f) => Z(l),
299
- onDelete: (f) => ne(l),
300
- onRename: (f) => Y(l, n.uid)
301
- }, null, 8, ["collectionId", "to", "variable", "onClick", "onColorModal", "onDelete", "onRename"]))), 128)),
302
- Object.keys(n["x-scalar-environments"] || {}).length === 0 ? (v(), g(r(xe), {
316
+ onClick: he((m) => se(m, r, n.uid), ["prevent"]),
317
+ onColorModal: (m) => ne(r),
318
+ onDelete: (m) => oe(r),
319
+ onRename: (m) => ee(r, n.uid),
320
+ onOnDragEnd: l(me)
321
+ }, null, 8, ["collectionId", "isDroppable", "to", "variable", "onClick", "onColorModal", "onDelete", "onRename", "onOnDragEnd"]))), 128)),
322
+ Object.keys(n["x-scalar-environments"] || {}).length === 0 ? (f(), _(l(ke), {
303
323
  key: 0,
304
324
  class: "text-c-1 hover:bg-b-2 flex h-8 w-full justify-start gap-1.5 py-0 pl-6 text-xs",
305
325
  variant: "ghost",
306
326
  onClick: (a) => $(n.uid)
307
327
  }, {
308
328
  default: c(() => [
309
- m(r(J), {
329
+ u(l(H), {
310
330
  icon: "Add",
311
331
  size: "sm"
312
332
  }),
313
- o[2] || (o[2] = p("span", null, "Add Environment", -1))
333
+ o[2] || (o[2] = b("span", null, "Add Environment", -1))
314
334
  ]),
315
335
  _: 2
316
- }, 1032, ["onClick"])) : G("", !0)
336
+ }, 1032, ["onClick"])) : T("", !0)
317
337
  ], 2), [
318
- [fe, ae(n.uid)]
338
+ [Ee, le(n.uid)]
319
339
  ])
320
340
  ]);
321
341
  }), 128))
@@ -325,42 +345,42 @@ const De = { class: "flex-1" }, Ue = ["onClick"], We = { class: "flex h-5 max-w-
325
345
  ])
326
346
  ]),
327
347
  button: c(() => [
328
- m(we, {
348
+ u($e, {
329
349
  click: $,
330
350
  hotkey: "N"
331
351
  }, {
332
352
  title: c(() => o[3] || (o[3] = [
333
- K(" Add Environment ")
353
+ G(" Add Environment ")
334
354
  ])),
335
355
  _: 1
336
356
  })
337
357
  ]),
338
358
  _: 1
339
359
  }),
340
- m(Se, { class: "flex-1" }, {
360
+ u(je, { class: "flex-1" }, {
341
361
  default: c(() => [
342
- m($e, null, pe({
362
+ u(Fe, null, Ce({
343
363
  default: c(() => [
344
- s.value && r(x) ? (v(), g(ye, {
364
+ s.value && l(p) ? (f(), _(Ie, {
345
365
  key: 0,
346
366
  class: "py-2 pl-px pr-2 md:px-4",
347
- envVariables: r(H),
348
- environment: r(j),
367
+ envVariables: l(q),
368
+ environment: l(F),
349
369
  isCopyable: "",
350
370
  language: "json",
351
371
  lineNumbers: "",
352
372
  lint: "",
353
- modelValue: oe(),
354
- workspace: r(x),
355
- "onUpdate:modelValue": X
356
- }, null, 8, ["envVariables", "environment", "modelValue", "workspace"])) : G("", !0)
373
+ modelValue: re(),
374
+ workspace: l(p),
375
+ "onUpdate:modelValue": Z
376
+ }, null, 8, ["envVariables", "environment", "modelValue", "workspace"])) : T("", !0)
357
377
  ]),
358
378
  _: 2
359
379
  }, [
360
380
  s.value ? {
361
381
  name: "title",
362
382
  fn: c(() => [
363
- p("span", null, F(te()), 1)
383
+ b("span", null, J(ae()), 1)
364
384
  ]),
365
385
  key: "0"
366
386
  } : void 0
@@ -368,29 +388,29 @@ const De = { class: "flex-1" }, Ue = ["onClick"], We = { class: "flex h-5 max-w-
368
388
  ]),
369
389
  _: 1
370
390
  }),
371
- m(je, {
372
- selectedColor: D.value,
373
- state: r(w),
374
- onCancel: o[0] || (o[0] = (n) => r(w).hide()),
375
- onSubmit: ee
391
+ u(We, {
392
+ selectedColor: W.value,
393
+ state: l(D),
394
+ onCancel: o[0] || (o[0] = (n) => l(D).hide()),
395
+ onSubmit: te
376
396
  }, null, 8, ["selectedColor", "state"]),
377
- m(Ne, {
378
- activeWorkspaceCollections: r(u),
379
- collectionId: b.value,
380
- state: r(I),
381
- onCancel: o[1] || (o[1] = (n) => r(I).hide()),
382
- onSubmit: Q
397
+ u(Ue, {
398
+ activeWorkspaceCollections: E.value,
399
+ collectionId: h.value,
400
+ state: l(I),
401
+ onCancel: o[1] || (o[1] = (n) => l(I).hide()),
402
+ onSubmit: Y
383
403
  }, null, 8, ["activeWorkspaceCollections", "collectionId", "state"]),
384
- m(r(be), {
404
+ u(l(ge), {
385
405
  size: "xxs",
386
- state: r(M),
387
- title: `Edit ${d.value}`
406
+ state: l(M),
407
+ title: `Edit ${v.value}`
388
408
  }, {
389
409
  default: c(() => [
390
- m(ge, {
410
+ u(Me, {
391
411
  name: S.value ?? "",
392
- onClose: re,
393
- onEdit: se
412
+ onClose: ie,
413
+ onEdit: ue
394
414
  }, null, 8, ["name"])
395
415
  ]),
396
416
  _: 1
@@ -401,5 +421,5 @@ const De = { class: "flex-1" }, Ue = ["onClick"], We = { class: "flex h-5 max-w-
401
421
  }
402
422
  });
403
423
  export {
404
- ln as default
424
+ vn as default
405
425
  };
@@ -1,15 +1,15 @@
1
- import { defineComponent as F, ref as v, computed as I, watch as S, openBlock as t, createElementBlock as d, Fragment as w, normalizeClass as s, normalizeStyle as f, createBlock as h, unref as m, createCommentVNode as c, renderList as j, createElementVNode as n, withDirectives as D, vModelText as V, createVNode as $, nextTick as N } from "vue";
1
+ import { defineComponent as E, ref as v, computed as I, watch as S, openBlock as t, createElementBlock as d, Fragment as w, normalizeClass as s, normalizeStyle as f, createBlock as h, unref as m, createCommentVNode as c, renderList as j, createElementVNode as n, withDirectives as D, vModelText as V, createVNode as $, nextTick as N } from "vue";
2
2
  import { ScalarIcon as p } from "@scalar/components";
3
- const R = ["onClick"], T = ["placeholder"], U = /* @__PURE__ */ F({
3
+ const R = ["onClick"], T = ["placeholder"], U = /* @__PURE__ */ E({
4
4
  __name: "EnvironmentColors",
5
5
  props: {
6
6
  activeColor: {},
7
7
  selector: { type: Boolean, default: !1 }
8
8
  },
9
9
  emits: ["select"],
10
- setup(x, { emit: E }) {
11
- const e = x, z = E, o = v(""), C = v(null), a = v(!1), u = v(!1), k = [
12
- { color: "#8E8E8E" },
10
+ setup(x, { emit: F }) {
11
+ const e = x, z = F, o = v(""), C = v(null), a = v(!1), u = v(!1), k = [
12
+ { color: "#FFFFFF" },
13
13
  { color: "#EF0006" },
14
14
  { color: "#EDBE20" },
15
15
  { color: "#069061" },