@scalar/api-client 2.34.1 → 2.36.0

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 (52) hide show
  1. package/CHANGELOG.md +59 -0
  2. package/dist/components/ViewLayout/ViewLayoutSection.vue.d.ts.map +1 -1
  3. package/dist/components/ViewLayout/ViewLayoutSection.vue.js +1 -1
  4. package/dist/style.css +1 -1
  5. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
  6. package/dist/v2/blocks/operation-block/OperationBlock.vue.js +88 -80
  7. package/dist/v2/blocks/operation-block/helpers/de-serialize-parameter.js +6 -4
  8. package/dist/v2/blocks/operation-block/helpers/validate-path-parameters.d.ts +16 -0
  9. package/dist/v2/blocks/operation-block/helpers/validate-path-parameters.d.ts.map +1 -0
  10. package/dist/v2/blocks/operation-block/helpers/validate-path-parameters.js +17 -0
  11. package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.d.ts.map +1 -1
  12. package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.js +90 -84
  13. package/dist/v2/blocks/request-block/helpers/get-default-headers.js +1 -1
  14. package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.d.ts.map +1 -1
  15. package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.js +76 -50
  16. package/dist/v2/components/sidebar/Sidebar.vue.d.ts.map +1 -1
  17. package/dist/v2/components/sidebar/Sidebar.vue.js +25 -23
  18. package/dist/v2/features/app/App.vue.d.ts.map +1 -1
  19. package/dist/v2/features/app/App.vue.js +41 -35
  20. package/dist/v2/features/app/app-events.d.ts +5 -2
  21. package/dist/v2/features/app/app-events.d.ts.map +1 -1
  22. package/dist/v2/features/app/app-events.js +58 -44
  23. package/dist/v2/features/app/app-state.d.ts.map +1 -1
  24. package/dist/v2/features/app/app-state.js +82 -80
  25. package/dist/v2/features/app/components/AppSidebar.vue.d.ts.map +1 -1
  26. package/dist/v2/features/app/components/AppSidebar.vue.js +2 -2
  27. package/dist/v2/features/app/components/AppSidebar.vue2.js +78 -76
  28. package/dist/v2/features/app/components/SidebarItemMenu.vue.d.ts.map +1 -1
  29. package/dist/v2/features/app/components/SidebarItemMenu.vue.js +73 -45
  30. package/dist/v2/features/collection/DocumentCollection.vue.d.ts.map +1 -1
  31. package/dist/v2/features/collection/DocumentCollection.vue.js +20 -20
  32. package/dist/v2/features/collection/OperationCollection.vue.d.ts.map +1 -1
  33. package/dist/v2/features/collection/OperationCollection.vue.js +7 -7
  34. package/dist/v2/features/collection/WorkspaceCollection.vue.d.ts.map +1 -1
  35. package/dist/v2/features/collection/WorkspaceCollection.vue.js +5 -4
  36. package/dist/v2/features/collection/components/Authentication.vue.d.ts.map +1 -1
  37. package/dist/v2/features/collection/components/Authentication.vue.js +1 -1
  38. package/dist/v2/features/collection/components/Authentication.vue2.js +84 -66
  39. package/dist/v2/features/collection/components/LabelInput.vue.d.ts.map +1 -1
  40. package/dist/v2/features/collection/components/LabelInput.vue.js +2 -2
  41. package/dist/v2/features/collection/components/LabelInput.vue2.js +1 -1
  42. package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.d.ts +5 -0
  43. package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.d.ts.map +1 -1
  44. package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.js +131 -96
  45. package/dist/v2/features/command-palette/hooks/use-command-palette-state.d.ts +25 -0
  46. package/dist/v2/features/command-palette/hooks/use-command-palette-state.d.ts.map +1 -1
  47. package/dist/v2/features/command-palette/hooks/use-command-palette-state.js +42 -36
  48. package/dist/v2/features/operation/Operation.vue.js +1 -1
  49. package/dist/v2/workspace-events.d.ts.map +1 -1
  50. package/dist/v2/workspace-events.js +8 -5
  51. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  52. package/package.json +18 -18
@@ -1,9 +1,9 @@
1
- import { isDefined as v } from "@scalar/helpers/array/is-defined";
1
+ import { isDefined as O } from "@scalar/helpers/array/is-defined";
2
2
  import { unpackProxyObject as D } from "@scalar/workspace-store/helpers/unpack-proxy";
3
- import { resolve as y } from "@scalar/workspace-store/resolve";
4
- const T = 10, q = "additionalProperty", j = (/* @__PURE__ */ new Date()).toISOString(), k = j.split("T")[0], C = j.split("T")[1].split(".")[0], M = {
3
+ import { resolve as s } from "@scalar/workspace-store/resolve";
4
+ const T = 10, q = "additionalProperty", j = (/* @__PURE__ */ new Date()).toISOString(), C = j.split("T")[0], k = j.split("T")[1].split(".")[0], M = {
5
5
  "date-time": j,
6
- date: k,
6
+ date: C,
7
7
  email: "hello@example.com",
8
8
  hostname: "example.com",
9
9
  // https://tools.ietf.org/html/rfc6531#section-3.3
@@ -21,14 +21,20 @@ const T = 10, q = "additionalProperty", j = (/* @__PURE__ */ new Date()).toISOSt
21
21
  // https://tools.ietf.org/html/draft-handrews-relative-json-pointer-01
22
22
  "relative-json-pointer": "1/nested/objects",
23
23
  // full-time in https://tools.ietf.org/html/rfc3339#section-5.6
24
- time: C,
24
+ time: k,
25
25
  // either a URI or relative-reference https://tools.ietf.org/html/rfc3986#section-4.1
26
26
  "uri-reference": "../folder",
27
27
  "uri-template": "https://example.com/{id}",
28
28
  uri: "https://example.com",
29
29
  uuid: "123e4567-e89b-12d3-a456-426614174000",
30
30
  "object-id": "6592008029c8c3e4dc76256c"
31
- }, S = (e, i = !1, o = "") => "type" in e && e.type === "string" && "format" in e && e.format === "binary" ? "@filename" : i && "format" in e && e.format ? M[e.format] ?? o : o, A = /* @__PURE__ */ new WeakMap(), P = /* @__PURE__ */ new WeakMap(), N = (e) => D(e, { depth: 1 }), I = (e) => {
31
+ }, I = (e) => {
32
+ if (!("propertyNames" in e) || !e.propertyNames)
33
+ return;
34
+ const i = s.schema(e.propertyNames);
35
+ if (i && "enum" in i && Array.isArray(i.enum) && i.enum.length > 0)
36
+ return i.enum;
37
+ }, S = (e, i = !1, o = "") => "type" in e && e.type === "string" && "format" in e && e.format === "binary" ? "@filename" : i && "format" in e && e.format ? M[e.format] ?? o : o, A = /* @__PURE__ */ new WeakMap(), P = /* @__PURE__ */ new WeakMap(), N = (e) => D(e, { depth: 1 }), R = (e) => {
32
38
  if (!e)
33
39
  return;
34
40
  const i = P.get(e);
@@ -37,81 +43,81 @@ const T = 10, q = "additionalProperty", j = (/* @__PURE__ */ new Date()).toISOSt
37
43
  if ("required" in e) {
38
44
  const o = e.required;
39
45
  if (Array.isArray(o) && o.length > 0) {
40
- const l = new Set(o);
41
- return P.set(e, l), l;
46
+ const a = new Set(o);
47
+ return P.set(e, a), a;
42
48
  }
43
49
  }
44
50
  }, d = (e, i, o) => {
45
51
  if (typeof i != "object" || i === null)
46
52
  return i;
47
- const l = N(e), f = A.get(l) ?? /* @__PURE__ */ new Map();
48
- return f && f.set(o, i), A.set(l, f), i;
49
- }, R = (e) => !!(e.allOf || e.oneOf || e.anyOf), _ = (e, i, o, l) => {
50
- if (e.deprecated || l?.mode === "write" && e.readOnly || l?.mode === "read" && e.writeOnly)
53
+ const a = N(e), f = A.get(a) ?? /* @__PURE__ */ new Map();
54
+ return f && f.set(o, i), A.set(a, f), i;
55
+ }, _ = (e) => !!(e.allOf || e.oneOf || e.anyOf), F = (e, i, o, a) => {
56
+ if (e.deprecated || a?.mode === "write" && e.readOnly || a?.mode === "read" && e.writeOnly)
51
57
  return !0;
52
- if (l?.omitEmptyAndOptionalProperties !== !0 || "type" in e && (e.type === "object" || e.type === "array") || R(e) || "examples" in e && Array.isArray(e.examples) && e.examples.length > 0 || "example" in e && e.example !== void 0 || "default" in e && e.default !== void 0 || "const" in e && e.const !== void 0 || "enum" in e && Array.isArray(e.enum) && e.enum.length > 0)
58
+ if (a?.omitEmptyAndOptionalProperties !== !0 || "type" in e && (e.type === "object" || e.type === "array") || _(e) || "examples" in e && Array.isArray(e.examples) && e.examples.length > 0 || "example" in e && e.example !== void 0 || "default" in e && e.default !== void 0 || "const" in e && e.const !== void 0 || "enum" in e && Array.isArray(e.enum) && e.enum.length > 0)
53
59
  return !1;
54
- const r = o ?? e.title ?? "", t = I(i);
60
+ const r = o ?? e.title ?? "", t = R(i);
55
61
  return !(t ? t.has(r) : !1);
56
- }, E = (e, i) => Array.isArray(e) && Array.isArray(i) ? [...e, ...i] : e && typeof e == "object" && i && typeof i == "object" ? { ...e, ...i } : i, F = (e, i, o, l, f) => {
62
+ }, E = (e, i) => Array.isArray(e) && Array.isArray(i) ? [...e, ...i] : e && typeof e == "object" && i && typeof i == "object" ? { ...e, ...i } : i, L = (e, i, o, a, f) => {
57
63
  const r = {};
58
64
  if ("properties" in e && e.properties) {
59
65
  const t = Object.keys(e.properties), n = t.length;
60
- for (let a = 0; a < n; a++) {
61
- const g = t[a], u = y.schema(e.properties[g]);
66
+ for (let l = 0; l < n; l++) {
67
+ const c = t[l], u = s.schema(e.properties[c]);
62
68
  if (!u)
63
69
  continue;
64
- const s = i?.xml && "xml" in u ? u.xml?.name : void 0, m = c(u, i, {
70
+ const y = i?.xml && "xml" in u ? u.xml?.name : void 0, m = g(u, i, {
65
71
  level: o + 1,
66
72
  parentSchema: e,
67
- name: g,
68
- seen: l
73
+ name: c,
74
+ seen: a
69
75
  });
70
- typeof m < "u" && (r[s ?? g] = m);
76
+ typeof m < "u" && (r[y ?? c] = m);
71
77
  }
72
78
  }
73
79
  if ("patternProperties" in e && e.patternProperties)
74
80
  for (const t of Object.keys(e.patternProperties)) {
75
- const n = y.schema(e.patternProperties[t]);
76
- n && (r[t] = c(n, i, {
81
+ const n = s.schema(e.patternProperties[t]);
82
+ n && (r[t] = g(n, i, {
77
83
  level: o + 1,
78
84
  parentSchema: e,
79
85
  name: t,
80
- seen: l
86
+ seen: a
81
87
  }));
82
88
  }
83
89
  if ("additionalProperties" in e && e.additionalProperties) {
84
- const t = typeof e.additionalProperties == "boolean" ? e.additionalProperties : y.schema(e.additionalProperties), n = e.additionalProperties === !0 || typeof e.additionalProperties == "object" && Object.keys(e.additionalProperties).length === 0, a = typeof t == "object" && "x-additionalPropertiesName" in t && typeof t["x-additionalPropertiesName"] == "string" && t["x-additionalPropertiesName"].trim().length > 0 ? t["x-additionalPropertiesName"].trim() : q;
85
- r[a] = n ? "anything" : typeof t == "object" ? c(t, i, {
90
+ const t = typeof e.additionalProperties == "boolean" ? e.additionalProperties : s.schema(e.additionalProperties), n = e.additionalProperties === !0 || typeof e.additionalProperties == "object" && Object.keys(e.additionalProperties).length === 0, l = typeof t == "object" && "x-additionalPropertiesName" in t && typeof t["x-additionalPropertiesName"] == "string" && t["x-additionalPropertiesName"].trim().length > 0, c = l ? void 0 : I(e), u = l ? t["x-additionalPropertiesName"].trim() : q, y = n ? "anything" : typeof t == "object" ? g(t, i, {
86
91
  level: o + 1,
87
- seen: l
92
+ seen: a
88
93
  }) : "anything";
94
+ c && c.length > 0 ? r[String(c[0])] = y : r[u] = y;
89
95
  }
90
96
  if (e.oneOf?.[0])
91
97
  Object.assign(
92
98
  r,
93
- c(y.schema(e.oneOf[0]), i, {
99
+ g(s.schema(e.oneOf[0]), i, {
94
100
  level: o + 1,
95
- seen: l
101
+ seen: a
96
102
  })
97
103
  );
98
104
  else if (e.anyOf?.[0])
99
105
  Object.assign(
100
106
  r,
101
- c(y.schema(e.anyOf[0]), i, {
107
+ g(s.schema(e.anyOf[0]), i, {
102
108
  level: o + 1,
103
- seen: l
109
+ seen: a
104
110
  })
105
111
  );
106
112
  else if (Array.isArray(e.allOf) && e.allOf.length > 0) {
107
113
  let t = r;
108
114
  for (const n of e.allOf) {
109
- const a = c(y.schema(n), i, {
115
+ const l = g(s.schema(n), i, {
110
116
  level: o + 1,
111
117
  parentSchema: e,
112
- seen: l
118
+ seen: a
113
119
  });
114
- t = E(t, a);
120
+ t = E(t, l);
115
121
  }
116
122
  t && typeof t == "object" && Object.assign(r, t);
117
123
  }
@@ -120,54 +126,54 @@ const T = 10, q = "additionalProperty", j = (/* @__PURE__ */ new Date()).toISOSt
120
126
  return t[e.xml.name] = r, d(e, t, f);
121
127
  }
122
128
  return d(e, r, f);
123
- }, L = (e, i, o, l, f) => {
124
- const r = "items" in e ? y.schema(e.items) : void 0, t = r && typeof r == "object" && "xml" in r ? r.xml?.name : void 0, n = !!(i?.xml && "xml" in e && e.xml?.wrapped && t);
129
+ }, U = (e, i, o, a, f) => {
130
+ const r = "items" in e ? s.schema(e.items) : void 0, t = r && typeof r == "object" && "xml" in r ? r.xml?.name : void 0, n = !!(i?.xml && "xml" in e && e.xml?.wrapped && t);
125
131
  if (e.example !== void 0)
126
132
  return d(e, n ? { [t]: e.example } : e.example, f);
127
133
  if (r && typeof r == "object") {
128
134
  if (Array.isArray(r.allOf) && r.allOf.length > 0) {
129
- const s = r.allOf.filter(v), m = y.schema(s[0]);
135
+ const y = r.allOf.filter(O), m = s.schema(y[0]);
130
136
  if (m && typeof m == "object" && "type" in m && m.type === "object") {
131
- const b = c({ type: "object", allOf: s }, i, {
137
+ const b = g({ type: "object", allOf: y }, i, {
132
138
  level: o + 1,
133
139
  parentSchema: e,
134
- seen: l
140
+ seen: a
135
141
  });
136
142
  return d(e, n ? [{ [t]: b }] : [b], f);
137
143
  }
138
- const O = s.map(
139
- (p) => c(y.schema(p), i, {
144
+ const v = y.map(
145
+ (p) => g(s.schema(p), i, {
140
146
  level: o + 1,
141
147
  parentSchema: e,
142
- seen: l
148
+ seen: a
143
149
  })
144
- ).filter(v);
150
+ ).filter(O);
145
151
  return d(
146
152
  e,
147
- n ? O.map((p) => ({ [t]: p })) : O,
153
+ n ? v.map((p) => ({ [t]: p })) : v,
148
154
  f
149
155
  );
150
156
  }
151
157
  const u = r.anyOf || r.oneOf;
152
158
  if (u && u.length > 0) {
153
- const s = u[0], m = c(y.schema(s), i, {
159
+ const y = u[0], m = g(s.schema(y), i, {
154
160
  level: o + 1,
155
161
  parentSchema: e,
156
- seen: l
162
+ seen: a
157
163
  });
158
164
  return d(e, n ? [{ [t]: m }] : [m], f);
159
165
  }
160
166
  }
161
- const a = r && typeof r == "object" && ("type" in r && r.type === "object" || "properties" in r), g = r && typeof r == "object" && ("type" in r && r.type === "array" || "items" in r);
162
- if (r && typeof r == "object" && ("type" in r && r.type || a || g)) {
163
- const u = c(r, i, {
167
+ const l = r && typeof r == "object" && ("type" in r && r.type === "object" || "properties" in r), c = r && typeof r == "object" && ("type" in r && r.type === "array" || "items" in r);
168
+ if (r && typeof r == "object" && ("type" in r && r.type || l || c)) {
169
+ const u = g(r, i, {
164
170
  level: o + 1,
165
- seen: l
171
+ seen: a
166
172
  });
167
173
  return d(e, n ? [{ [t]: u }] : [u], f);
168
174
  }
169
175
  return d(e, [], f);
170
- }, U = (e, i, o) => {
176
+ }, W = (e, i, o) => {
171
177
  if ("type" in e && e.type && !Array.isArray(e.type))
172
178
  switch (e.type) {
173
179
  case "string":
@@ -183,13 +189,13 @@ const T = 10, q = "additionalProperty", j = (/* @__PURE__ */ new Date()).toISOSt
183
189
  default:
184
190
  return;
185
191
  }
186
- }, W = (e, i, o) => {
192
+ }, X = (e, i, o) => {
187
193
  if ("type" in e && Array.isArray(e.type)) {
188
194
  if (e.type.includes("null"))
189
195
  return null;
190
- const l = e.type[0];
191
- if (l)
192
- switch (l) {
196
+ const a = e.type[0];
197
+ if (a)
198
+ switch (a) {
193
199
  case "string":
194
200
  return S(e, i, o ?? "");
195
201
  case "boolean":
@@ -204,93 +210,93 @@ const T = 10, q = "additionalProperty", j = (/* @__PURE__ */ new Date()).toISOSt
204
210
  return;
205
211
  }
206
212
  }
207
- }, X = (e) => JSON.stringify({
213
+ }, z = (e) => JSON.stringify({
208
214
  emptyString: e?.emptyString,
209
215
  xml: e?.xml,
210
216
  mode: e?.mode,
211
217
  variables: e?.variables,
212
218
  omitEmptyAndOptionalProperties: e?.omitEmptyAndOptionalProperties
213
- }), c = (e, i, {
219
+ }), g = (e, i, {
214
220
  level: o = 0,
215
- parentSchema: l,
221
+ parentSchema: a,
216
222
  name: f,
217
223
  seen: r = /* @__PURE__ */ new WeakSet()
218
224
  } = {}) => {
219
- const t = y.schema(e);
220
- if (!v(t))
225
+ const t = s.schema(e);
226
+ if (!O(t))
221
227
  return;
222
228
  const n = N(t);
223
229
  if (r.has(n))
224
230
  return;
225
231
  r.add(n);
226
- const a = X(i), g = A.get(n)?.get(a);
227
- if (typeof g < "u")
228
- return r.delete(n), g;
232
+ const l = z(i), c = A.get(n)?.get(l);
233
+ if (typeof c < "u")
234
+ return r.delete(n), c;
229
235
  if (o > T)
230
236
  return r.delete(n), "[Max Depth Exceeded]";
231
237
  const u = !!i?.emptyString;
232
- if (_(t, l, f, i)) {
238
+ if (F(t, a, f, i)) {
233
239
  r.delete(n);
234
240
  return;
235
241
  }
236
242
  if ("x-variable" in t && t["x-variable"]) {
237
243
  const p = i?.variables?.[t["x-variable"]];
238
244
  if (p !== void 0)
239
- return "type" in t && (t.type === "number" || t.type === "integer") ? (r.delete(n), d(t, Number(p), a)) : (r.delete(n), d(t, p, a));
245
+ return "type" in t && (t.type === "number" || t.type === "integer") ? (r.delete(n), d(t, Number(p), l)) : (r.delete(n), d(t, p, l));
240
246
  }
241
247
  if (Array.isArray(t.examples) && t.examples.length > 0)
242
- return r.delete(n), d(t, t.examples[0], a);
248
+ return r.delete(n), d(t, t.examples[0], l);
243
249
  if (t.example !== void 0)
244
- return r.delete(n), d(t, t.example, a);
250
+ return r.delete(n), d(t, t.example, l);
245
251
  if (t.default !== void 0)
246
- return r.delete(n), d(t, t.default, a);
252
+ return r.delete(n), d(t, t.default, l);
247
253
  if (t.const !== void 0)
248
- return r.delete(n), d(t, t.const, a);
254
+ return r.delete(n), d(t, t.const, l);
249
255
  if (Array.isArray(t.enum) && t.enum.length > 0)
250
- return r.delete(n), d(t, t.enum[0], a);
256
+ return r.delete(n), d(t, t.enum[0], l);
251
257
  if ("properties" in t || "type" in t && t.type === "object") {
252
- const p = F(t, i, o, r, a);
258
+ const p = L(t, i, o, r, l);
253
259
  return r.delete(n), p;
254
260
  }
255
261
  if ("type" in t && t.type === "array" || "items" in t) {
256
- const p = L(t, i, o, r, a);
262
+ const p = U(t, i, o, r, l);
257
263
  return r.delete(n), p;
258
264
  }
259
- const s = U(t, u, i?.emptyString);
260
- if (s !== void 0)
261
- return r.delete(n), d(t, s, a);
265
+ const y = W(t, u, i?.emptyString);
266
+ if (y !== void 0)
267
+ return r.delete(n), d(t, y, l);
262
268
  const m = t.oneOf || t.anyOf;
263
269
  if (Array.isArray(m) && m.length > 0) {
264
270
  for (const p of m) {
265
- const b = y.schema(p);
271
+ const b = s.schema(p);
266
272
  if (b && (!("type" in b) || b.type !== "null"))
267
273
  return r.delete(n), d(
268
274
  t,
269
- c(b, i, {
275
+ g(b, i, {
270
276
  level: o + 1,
271
277
  seen: r
272
278
  }),
273
- a
279
+ l
274
280
  );
275
281
  }
276
- return r.delete(n), d(t, null, a);
282
+ return r.delete(n), d(t, null, l);
277
283
  }
278
284
  if (Array.isArray(t.allOf) && t.allOf.length > 0) {
279
285
  let p;
280
286
  const b = t.allOf;
281
287
  for (const w of b) {
282
- const x = c(w, i, {
288
+ const x = g(w, i, {
283
289
  level: o + 1,
284
290
  parentSchema: t,
285
291
  seen: r
286
292
  });
287
293
  p === void 0 ? p = x : p && typeof p == "object" && x && typeof x == "object" ? p = E(p, x) : x !== void 0 && (p = x);
288
294
  }
289
- return r.delete(n), d(t, p ?? null, a);
295
+ return r.delete(n), d(t, p ?? null, l);
290
296
  }
291
- const O = W(t, u, i?.emptyString);
292
- return O !== void 0 ? (r.delete(n), d(t, O, a)) : (r.delete(n), d(t, null, a));
297
+ const v = X(t, u, i?.emptyString);
298
+ return v !== void 0 ? (r.delete(n), d(t, v, l)) : (r.delete(n), d(t, null, l));
293
299
  };
294
300
  export {
295
- c as getExampleFromSchema
301
+ g as getExampleFromSchema
296
302
  };
@@ -1,7 +1,7 @@
1
1
  import { canMethodHaveBody as m } from "@scalar/helpers/http/can-method-have-body";
2
2
  import { getResolvedRef as r } from "@scalar/workspace-store/helpers/get-resolved-ref";
3
3
  import { isElectron as y } from "../../../../libs/electron.js";
4
- const l = "2.34.1", T = "application/json", C = "*/*", a = (n, s, o) => ({
4
+ const l = "2.36.0", T = "application/json", C = "*/*", a = (n, s, o) => ({
5
5
  name: n,
6
6
  defaultValue: s,
7
7
  isOverridden: o.has(n.toLowerCase())
@@ -1 +1 @@
1
- {"version":3,"file":"EnvironmentSelector.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue"],"names":[],"mappings":"AAqLA,KAAK,WAAW,GAAG;IACjB,qCAAqC;IACrC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;IACvB,qCAAqC;IACrC,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC3B,CAAC;AAyZF,QAAA,MAAM,YAAY;;;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"EnvironmentSelector.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue"],"names":[],"mappings":"AAmOA,KAAK,WAAW,GAAG;IACjB,qCAAqC;IACrC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;IACvB,qCAAqC;IACrC,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC3B,CAAC;AAghBF,QAAA,MAAM,YAAY;;;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -1,37 +1,39 @@
1
- import { defineComponent as _, computed as u, createElementBlock as x, openBlock as s, createVNode as n, unref as e, withCtx as c, normalizeClass as m, createElementVNode as t, toDisplayString as p, createBlock as v, createCommentVNode as f, withModifiers as g, Fragment as D, renderList as A } from "vue";
2
- import { ScalarDropdown as j, ScalarButton as B, ScalarIcon as d, ScalarDropdownItem as h, ScalarDropdownDivider as y } from "@scalar/components";
3
- const I = { class: "relative flex items-center" }, V = { class: "flex items-center gap-1.5" }, $ = { class: "text-xxs line-clamp-1 max-w-[120px] text-left font-medium" }, L = { class: "overflow-hidden text-ellipsis" }, N = { class: "flex h-4 w-4 items-center justify-center" }, F = {
4
- key: 3,
1
+ import { defineComponent as j, computed as o, createElementBlock as p, openBlock as s, createVNode as a, unref as e, withCtx as l, normalizeClass as x, createElementVNode as t, toDisplayString as h, createBlock as u, createCommentVNode as v, withModifiers as C, Fragment as B, renderList as I } from "vue";
2
+ import { ScalarDropdown as $, ScalarButton as N, ScalarIcon as m, ScalarDropdownItem as b, ScalarDropdownDivider as k } from "@scalar/components";
3
+ const V = { class: "relative flex items-center" }, L = { class: "flex max-w-[220px] min-w-0 items-center gap-1.5" }, M = { class: "text-xxs block max-w-[160px] min-w-0 truncate text-left font-medium" }, U = { class: "min-w-0 flex-1 truncate" }, _ = { class: "bg-c-accent text-b-1 mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center rounded-full p-[3px]" }, F = { class: "min-w-0 flex-1 text-left" }, G = { class: "block truncate" }, O = { class: "flex h-4 w-4 items-center justify-center" }, P = {
4
+ key: 5,
5
5
  class: "text-c-3 px-2 py-1.5 text-xs"
6
- }, R = /* @__PURE__ */ _({
6
+ }, H = /* @__PURE__ */ j({
7
7
  __name: "EnvironmentSelector",
8
8
  props: {
9
9
  environments: { default: () => [] },
10
10
  activeEnvironment: {}
11
11
  },
12
12
  emits: ["select:environment", "add:environment"],
13
- setup(r, { emit: C }) {
14
- const b = C, a = u(() => !!r.activeEnvironment), l = u(() => r.environments.length > 0), k = u(() => a.value ? r.activeEnvironment : l.value ? "Select Environment" : "Add Environment"), S = u(() => a.value ? "bg-c-accent/10 text-c-accent hover:bg-c-accent/20 border-c-accent/30" : l.value ? "hover:bg-b-2 text-c-2 border-transparent" : "hover:bg-b-2 text-c-3 border-transparent"), z = () => {
15
- b("add:environment");
16
- }, w = (E) => {
17
- b("select:environment", E);
13
+ setup(n, { emit: S }) {
14
+ const w = S, r = o(() => !!n.activeEnvironment), c = o(() => n.environments.length > 0), z = o(() => n.activeEnvironment ? n.environments.includes(n.activeEnvironment) : !1), d = o(
15
+ () => r.value && !z.value
16
+ ), E = o(() => d.value ? `${n.activeEnvironment} (Unavailable)` : r.value ? n.activeEnvironment : c.value ? "Select Environment" : "Add Environment"), A = o(() => d.value ? "hover:bg-b-2 text-c-2 border-transparent" : r.value ? "bg-c-accent/10 text-c-accent hover:bg-c-accent/20 border-c-accent/30" : c.value ? "hover:bg-b-2 text-c-2 border-transparent" : "hover:bg-b-2 text-c-3 border-transparent"), D = () => {
17
+ w("add:environment");
18
+ }, g = (y) => {
19
+ w("select:environment", y);
18
20
  };
19
- return (E, i) => (s(), x("div", I, [
20
- n(e(j), null, {
21
- items: c(() => [
22
- a.value ? (s(), v(e(h), {
21
+ return (y, i) => (s(), p("div", V, [
22
+ a(e($), null, {
23
+ items: l(() => [
24
+ r.value ? (s(), u(e(b), {
23
25
  key: 0,
24
26
  class: "group/item flex w-full items-center gap-1.5",
25
- onClick: i[0] || (i[0] = g((o) => w(""), ["stop"]))
27
+ onClick: i[0] || (i[0] = C((f) => g(""), ["stop"]))
26
28
  }, {
27
- default: c(() => [
29
+ default: l(() => [
28
30
  t("div", {
29
- class: m([
31
+ class: x([
30
32
  "flex h-4 w-4 items-center justify-center rounded-full p-[3px]",
31
- r.activeEnvironment ? "shadow-border text-transparent" : "bg-c-accent text-b-1"
33
+ n.activeEnvironment ? "shadow-border text-transparent" : "bg-c-accent text-b-1"
32
34
  ])
33
35
  }, [
34
- n(e(d), {
36
+ a(e(m), {
35
37
  class: "size-2.5",
36
38
  icon: "Checkmark",
37
39
  thickness: "3"
@@ -40,66 +42,90 @@ const I = { class: "relative flex items-center" }, V = { class: "flex items-cent
40
42
  i[1] || (i[1] = t("span", { class: "text-c-2" }, "No Environment", -1))
41
43
  ]),
42
44
  _: 1
43
- })) : f("", !0),
44
- a.value && l.value ? (s(), v(e(y), { key: 1 })) : f("", !0),
45
- (s(!0), x(D, null, A(r.environments, (o) => (s(), v(e(h), {
46
- key: o,
47
- class: "group/item flex w-full items-center gap-1.5 overflow-hidden text-ellipsis whitespace-nowrap",
48
- onClick: g((G) => w(o), ["stop"])
45
+ })) : v("", !0),
46
+ r.value && c.value ? (s(), u(e(k), { key: 1 })) : v("", !0),
47
+ (s(!0), p(B, null, I(n.environments, (f) => (s(), u(e(b), {
48
+ key: f,
49
+ class: "group/item flex w-full min-w-0 items-center gap-1.5 overflow-hidden text-ellipsis whitespace-nowrap",
50
+ onClick: C((R) => g(f), ["stop"])
49
51
  }, {
50
- default: c(() => [
52
+ default: l(() => [
51
53
  t("div", {
52
- class: m([
54
+ class: x([
53
55
  "flex h-4 w-4 items-center justify-center rounded-full p-[3px]",
54
- r.activeEnvironment === o ? "bg-c-accent text-b-1" : "shadow-border text-transparent"
56
+ n.activeEnvironment === f ? "bg-c-accent text-b-1" : "shadow-border text-transparent"
55
57
  ])
56
58
  }, [
57
- n(e(d), {
59
+ a(e(m), {
58
60
  class: "size-2.5",
59
61
  icon: "Checkmark",
60
62
  thickness: "3"
61
63
  })
62
64
  ], 2),
63
- t("span", L, p(o), 1)
65
+ t("span", U, h(f), 1)
64
66
  ]),
65
67
  _: 2
66
68
  }, 1032, ["onClick"]))), 128)),
67
- l.value ? (s(), v(e(y), { key: 2 })) : f("", !0),
68
- n(e(h), {
69
+ d.value ? (s(), u(e(k), { key: 2 })) : v("", !0),
70
+ d.value ? (s(), u(e(b), {
71
+ key: 3,
72
+ class: "group/item flex h-auto w-full min-w-0 items-start gap-1.5 overflow-hidden",
73
+ disabled: ""
74
+ }, {
75
+ default: l(() => [
76
+ t("div", _, [
77
+ a(e(m), {
78
+ class: "size-2.5",
79
+ icon: "Checkmark",
80
+ thickness: "3"
81
+ })
82
+ ]),
83
+ t("div", F, [
84
+ t("span", G, h(n.activeEnvironment), 1),
85
+ i[2] || (i[2] = t("span", { class: "text-c-3 block truncate text-xs" }, " Not available in this context ", -1))
86
+ ])
87
+ ]),
88
+ _: 1
89
+ })) : v("", !0),
90
+ c.value ? (s(), u(e(k), { key: 4 })) : v("", !0),
91
+ a(e(b), {
69
92
  class: "text-c-accent flex items-center gap-1.5",
70
- onClick: z
93
+ onClick: D
71
94
  }, {
72
- default: c(() => [
73
- t("div", N, [
74
- n(e(d), {
95
+ default: l(() => [
96
+ t("div", O, [
97
+ a(e(m), {
75
98
  icon: "Add",
76
99
  size: "sm"
77
100
  })
78
101
  ]),
79
- t("span", null, p(l.value ? "New Environment" : "Create Environment"), 1)
102
+ t("span", null, h(c.value ? "New Environment" : "Create Environment"), 1)
80
103
  ]),
81
104
  _: 1
82
105
  }),
83
- !l.value && !a.value ? (s(), x("div", F, [...i[2] || (i[2] = [
106
+ !c.value && !r.value ? (s(), p("div", P, [...i[3] || (i[3] = [
84
107
  t("p", { class: "mb-1" }, " Environments let you manage variables like API keys and base URLs across different contexts. ", -1)
85
- ])])) : f("", !0)
108
+ ])])) : v("", !0)
86
109
  ]),
87
- default: c(() => [
88
- n(e(B), {
89
- "aria-label": `Current environment: ${k.value}`,
90
- class: m(["line-clamp-1 h-full w-fit justify-start border px-2 py-1 font-normal transition-colors", S.value]),
110
+ default: l(() => [
111
+ a(e(N), {
112
+ "aria-label": `Current environment: ${E.value}`,
113
+ class: x(["line-clamp-1 h-full w-fit justify-start border px-2 py-1 font-normal transition-colors", A.value]),
91
114
  size: "sm",
92
115
  variant: "ghost"
93
116
  }, {
94
- default: c(() => [
95
- t("div", V, [
96
- n(e(d), {
97
- class: m(["shrink-0", a.value ? "text-c-accent" : "text-c-3"]),
117
+ default: l(() => [
118
+ t("div", L, [
119
+ a(e(m), {
120
+ class: x([
121
+ "shrink-0",
122
+ r.value && !d.value ? "text-c-accent" : "text-c-3"
123
+ ]),
98
124
  icon: "Globe",
99
125
  size: "sm"
100
126
  }, null, 8, ["class"]),
101
- t("span", $, p(k.value), 1),
102
- n(e(d), {
127
+ t("span", M, h(E.value), 1),
128
+ a(e(m), {
103
129
  class: "shrink-0",
104
130
  icon: "ChevronDown",
105
131
  size: "xs"
@@ -115,5 +141,5 @@ const I = { class: "relative flex items-center" }, V = { class: "flex items-cent
115
141
  }
116
142
  });
117
143
  export {
118
- R as default
144
+ H as default
119
145
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Sidebar.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/sidebar/Sidebar.vue"],"names":[],"mappings":"AA4LA,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,oBAAoB,CAAA;AAE3B,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,YAAY,EAClB,MAAM,iBAAiB,CAAA;AACxB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AACxE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAA;AAKhF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAIrD,KAAK,WAAW,GAAG;IACjB,iDAAiD;IACjD,YAAY,EAAE,YAAY,CAAC,cAAc,CAAC,CAAA;IAC1C,4BAA4B;IAC5B,MAAM,EAAE,YAAY,CAAA;IACpB,qCAAqC;IACrC,eAAe,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAA;IAC/B,2CAA2C;IAC3C,UAAU,EAAE,cAAc,EAAE,CAAA;IAC5B,+CAA+C;IAC/C,SAAS,EAAE,iBAAiB,EAAE,CAAA;IAC9B;;;;OAIG;IACH,WAAW,CAAC,EACR,OAAO,GACP,CAAC,CAAC,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,KAAK,OAAO,CAAC,CAAA;CACxE,CAAC;AAkBF,KAAK,WAAW,GAAG;IACjB,uCAAuC;IACvC,eAAe,CAAC,IAAI,OAAO,CAAA;IAC3B,sDAAsD;IACtD,SAAS,CAAC,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE,cAAc,CAAA;KAAE,GAAG,OAAO,CAAA;IACpD,mDAAmD;IACnD,MAAM,CAAC,IAAI,OAAO,CAAA;IAClB,yDAAyD;IACzD,KAAK,CAAC,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE,cAAc,CAA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