@scalar/api-client 2.1.36 → 2.1.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/dist/components/AddressBar/AddressBarServer.vue.d.ts.map +1 -1
  3. package/dist/components/AddressBar/AddressBarServer.vue.js +8 -7
  4. package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
  5. package/dist/components/CodeInput/CodeInput.vue.js +2 -2
  6. package/dist/components/CodeInput/CodeInput.vue2.js +43 -42
  7. package/dist/components/CodeInput/codeVariableWidget.d.ts +1 -2
  8. package/dist/components/CodeInput/codeVariableWidget.d.ts.map +1 -1
  9. package/dist/components/CodeInput/codeVariableWidget.js +38 -40
  10. package/dist/components/SideNav/SideNav.vue.d.ts.map +1 -1
  11. package/dist/components/SideNav/SideNav.vue.js +2 -2
  12. package/dist/components/SideNav/SideNav.vue2.js +42 -29
  13. package/dist/components/Sidebar/SidebarListElement.vue.d.ts +2 -0
  14. package/dist/components/Sidebar/SidebarListElement.vue.d.ts.map +1 -1
  15. package/dist/components/Sidebar/SidebarListElement.vue.js +1 -1
  16. package/dist/components/Sidebar/SidebarListElement.vue2.js +32 -28
  17. package/dist/layouts/App/create-api-client-app.d.ts +70 -6
  18. package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
  19. package/dist/layouts/Modal/create-api-client-modal.d.ts +140 -12
  20. package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
  21. package/dist/layouts/Web/create-api-client-web.d.ts +70 -6
  22. package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
  23. package/dist/libs/create-client.d.ts +76 -9
  24. package/dist/libs/create-client.d.ts.map +1 -1
  25. package/dist/libs/create-client.js +92 -80
  26. package/dist/store/collections.d.ts +1 -0
  27. package/dist/store/collections.d.ts.map +1 -1
  28. package/dist/store/cookies.d.ts +1 -0
  29. package/dist/store/cookies.d.ts.map +1 -1
  30. package/dist/store/environment.d.ts +1 -0
  31. package/dist/store/environment.d.ts.map +1 -1
  32. package/dist/store/environment.js +6 -7
  33. package/dist/store/request-example.d.ts +1 -0
  34. package/dist/store/request-example.d.ts.map +1 -1
  35. package/dist/store/requests.d.ts +55 -4
  36. package/dist/store/requests.d.ts.map +1 -1
  37. package/dist/store/security-schemes.d.ts +2 -1
  38. package/dist/store/security-schemes.d.ts.map +1 -1
  39. package/dist/store/security-schemes.js +9 -9
  40. package/dist/store/servers.d.ts +1 -0
  41. package/dist/store/servers.d.ts.map +1 -1
  42. package/dist/store/store.d.ts +138 -10
  43. package/dist/store/store.d.ts.map +1 -1
  44. package/dist/store/tags.d.ts +1 -0
  45. package/dist/store/tags.d.ts.map +1 -1
  46. package/dist/store/workspace.d.ts +1 -0
  47. package/dist/store/workspace.d.ts.map +1 -1
  48. package/dist/style.css +1 -1
  49. package/dist/views/Environment/Environment.vue.d.ts.map +1 -1
  50. package/dist/views/Environment/Environment.vue2.js +98 -83
  51. package/dist/views/Environment/EnvironmentColorModal.vue.d.ts +16 -0
  52. package/dist/views/Environment/EnvironmentColorModal.vue.d.ts.map +1 -0
  53. package/dist/views/Environment/EnvironmentColorModal.vue.js +40 -0
  54. package/dist/views/Environment/EnvironmentColorModal.vue2.js +4 -0
  55. package/dist/views/Environment/EnvironmentColors.vue.d.ts.map +1 -1
  56. package/dist/views/Environment/EnvironmentColors.vue.js +84 -29
  57. package/dist/views/Environment/EnvironmentModal.vue.d.ts +20 -0
  58. package/dist/views/Environment/EnvironmentModal.vue.d.ts.map +1 -0
  59. package/dist/views/Environment/EnvironmentModal.vue.js +52 -0
  60. package/dist/views/Environment/EnvironmentModal.vue2.js +4 -0
  61. package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts +2 -0
  62. package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts.map +1 -1
  63. package/dist/views/Environment/EnvironmentVariableDropdown.vue.js +51 -50
  64. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +2 -2
  65. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +12 -12
  66. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  67. package/package.json +8 -8
package/CHANGELOG.md CHANGED
@@ -1,5 +1,38 @@
1
1
  # @scalar/api-client
2
2
 
3
+ ## 2.1.38
4
+
5
+ ### Patch Changes
6
+
7
+ - cf4e9c4: fix(components): resize and scroll scalar listbox and dropdown
8
+ - 743474e: feat: adds environment custom colors
9
+ - cfe9b85: fix: added safe parsing for oauth examples
10
+ - 0fb3a41: fix: sets default environment variable value
11
+ - 417e0c7: feat(api-client): add download button to scalar web
12
+ - 0e19781: feat: fix reactivitiy of references + client
13
+ - Updated dependencies [fb798c8]
14
+ - Updated dependencies [cf4e9c4]
15
+ - Updated dependencies [3bec045]
16
+ - Updated dependencies [743474e]
17
+ - Updated dependencies [cfe9b85]
18
+ - Updated dependencies [4d45f7b]
19
+ - Updated dependencies [6599473]
20
+ - Updated dependencies [bb3dc9d]
21
+ - Updated dependencies [0e19781]
22
+ - @scalar/types@0.0.18
23
+ - @scalar/components@0.12.63
24
+ - @scalar/oas-utils@0.2.65
25
+ - @scalar/themes@0.9.45
26
+ - @scalar/object-utils@1.1.11
27
+ - @scalar/use-codemirror@0.11.30
28
+
29
+ ## 2.1.37
30
+
31
+ ### Patch Changes
32
+
33
+ - Updated dependencies [931106f]
34
+ - @scalar/oas-utils@0.2.64
35
+
3
36
  ## 2.1.36
4
37
 
5
38
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"AddressBarServer.vue.d.ts","sourceRoot":"","sources":["../../../src/components/AddressBar/AddressBarServer.vue"],"names":[],"mappings":";AA8YA,wBAKG"}
1
+ {"version":3,"file":"AddressBarServer.vue.d.ts","sourceRoot":"","sources":["../../../src/components/AddressBar/AddressBarServer.vue"],"names":[],"mappings":";AAgZA,wBAKG"}
@@ -1,4 +1,4 @@
1
- import { defineComponent as O, computed as c, watch as R, openBlock as l, createBlock as S, unref as n, withCtx as k, createElementBlock as o, createCommentVNode as v, Fragment as m, renderList as g, createVNode as p, createElementVNode as i, withModifiers as V, toDisplayString as b } from "vue";
1
+ import { defineComponent as O, computed as c, watch as R, openBlock as l, createBlock as S, unref as n, withCtx as w, createElementBlock as o, createCommentVNode as v, Fragment as m, renderList as g, createVNode as p, createElementVNode as i, withModifiers as V, toDisplayString as b } from "vue";
2
2
  import { ScalarDropdown as W, ScalarDropdownDivider as C, ScalarDropdownItem as E, ScalarIcon as I } from "@scalar/components";
3
3
  import D from "./AddressBarServerItem.vue.js";
4
4
  import { useWorkspace as L } from "../../store/store.js";
@@ -12,7 +12,7 @@ const M = {
12
12
  __name: "AddressBarServer",
13
13
  setup(P) {
14
14
  const {
15
- activeRequest: w,
15
+ activeRequest: k,
16
16
  activeCollection: h,
17
17
  activeServer: x,
18
18
  isReadOnly: A,
@@ -22,7 +22,7 @@ const M = {
22
22
  } = L(), d = c(
23
23
  () => {
24
24
  var t, e;
25
- return (e = (t = w.value) == null ? void 0 : t.servers) == null ? void 0 : e.map((r) => {
25
+ return (e = (t = k.value) == null ? void 0 : t.servers) == null ? void 0 : e.map((r) => {
26
26
  var s;
27
27
  return {
28
28
  id: r,
@@ -47,7 +47,7 @@ const M = {
47
47
  return ((t = d.value) == null ? void 0 : t.length) && ((e = u.value) == null ? void 0 : e.length);
48
48
  }
49
49
  );
50
- R([h, w], ([t, e]) => {
50
+ R([h, k], ([t, e]) => {
51
51
  !t || t.selectedServerUid || e != null && e.selectedServerUid || B.edit(
52
52
  t.uid,
53
53
  "selectedServerUid",
@@ -64,9 +64,10 @@ const M = {
64
64
  var r, s;
65
65
  return d.value && ((r = d.value) == null ? void 0 : r.length) > 1 || u.value && ((s = u.value) == null ? void 0 : s.length) > 1 ? (l(), S(n(W), {
66
66
  key: 0,
67
+ class: "w-max",
67
68
  teleport: ".scalar-client"
68
69
  }, {
69
- items: k(() => [
70
+ items: w(() => [
70
71
  _.value ? (l(), o("div", M, " Request Servers ")) : v("", !0),
71
72
  (l(!0), o(m, null, g(d.value, (a) => (l(), S(D, {
72
73
  key: a.id,
@@ -85,7 +86,7 @@ const M = {
85
86
  n(A) ? v("", !0) : (l(), o(m, { key: 2 }, [
86
87
  p(n(C)),
87
88
  p(n(E), null, {
88
- default: k(() => [
89
+ default: w(() => [
89
90
  i("div", {
90
91
  class: "font-code text-xxs flex items-center gap-1.5",
91
92
  onClick: U
@@ -103,7 +104,7 @@ const M = {
103
104
  })
104
105
  ], 64))
105
106
  ]),
106
- default: k(() => [
107
+ default: w(() => [
107
108
  i("button", {
108
109
  class: "font-code lg:text-sm text-xs whitespace-nowrap border border-b-3 border-solid rounded px-1.5 py-0.5 text-c-2",
109
110
  type: "button",
@@ -1 +1 @@
1
- {"version":3,"file":"CodeInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CodeInput/CodeInput.vue"],"names":[],"mappings":"AAAA,OAiYO,EAGL,KAAK,kBAAkB,EAGxB,MAAM,wBAAwB,CAAA;;kBAcb,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;iBACV,OAAO;;;;;;;;kBAlBN,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;iBACV,OAAO;;;;;;gBAfP,OAAO;iBAHN,OAAO;sBAMF,OAAO;kBAMX,OAAO;0BACC,OAAO;cAGnB,OAAO;mBACF,OAAO;;qBA6WG,GAAG;kBACN,GAAG;;AAlY9B,wBA2bC;AAcD,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACpC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"CodeInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CodeInput/CodeInput.vue"],"names":[],"mappings":"AAAA,OAmYO,EAGL,KAAK,kBAAkB,EAGxB,MAAM,wBAAwB,CAAA;;kBAcb,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;iBACV,OAAO;;;;;;;;kBAlBN,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;iBACV,OAAO;;;;;;gBAfP,OAAO;iBAHN,OAAO;sBAMF,OAAO;kBAMX,OAAO;0BACC,OAAO;cAGnB,OAAO;mBACF,OAAO;;qBA8WG,GAAG;kBACN,GAAG;;AAnY9B,wBA6bC;AAcD,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACpC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -2,7 +2,7 @@ import o from "./CodeInput.vue2.js";
2
2
  /* empty css */
3
3
  /* empty css */
4
4
  import t from "../../_virtual/_plugin-vue_export-helper.js";
5
- const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-37f39e63"]]);
5
+ const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-9645481b"]]);
6
6
  export {
7
- f as default
7
+ a as default
8
8
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent as j, useAttrs as L, ref as u, toRef as r, watch as Q, computed as P, openBlock as a, createElementBlock as c, Fragment as z, createBlock as y, mergeProps as G, unref as d, withKeys as h, withModifiers as _, renderSlot as D, createCommentVNode as w } from "vue";
1
+ import { defineComponent as j, useAttrs as L, ref as u, toRef as r, watch as Q, computed as y, openBlock as a, createElementBlock as c, Fragment as z, createBlock as v, mergeProps as G, unref as i, withKeys as h, withModifiers as _, renderSlot as D, createCommentVNode as w } from "vue";
2
2
  import { useCodeMirror as H, useDropdown as J, colorPicker as X } from "@scalar/use-codemirror";
3
3
  import { nanoid as Y } from "nanoid";
4
4
  import q from "../DataTable/DataTableInputSelect.vue.js";
@@ -13,7 +13,7 @@ const te = ["id"], ne = {
13
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 pointer-events-none"
14
14
  }, ae = {
15
15
  inheritAttrs: !1
16
- }, me = /* @__PURE__ */ j({
16
+ }, fe = /* @__PURE__ */ j({
17
17
  ...ae,
18
18
  __name: "CodeInput",
19
19
  props: {
@@ -38,94 +38,94 @@ const te = ["id"], ne = {
38
38
  importCurl: { type: Boolean }
39
39
  },
40
40
  emits: ["submit", "update:modelValue", "curl"],
41
- setup(E, { expose: R, emit: $ }) {
42
- var x;
43
- const o = E, i = $, v = L(), O = v.id || `id-${Y()}`, g = u(!1), f = u(!1), V = u(""), B = u({ left: 0, top: 0 }), p = u(null), { activeEnvVariables: k, isReadOnly: C, environments: K, router: M } = le();
41
+ setup(R, { expose: $, emit: O }) {
42
+ var F;
43
+ const o = R, s = O, g = L(), K = g.id || `id-${Y()}`, V = u(!1), m = u(!1), B = u(""), k = u({ left: 0, top: 0 }), p = u(null), { activeEnvVariables: C, isReadOnly: S, activeEnvironment: x, router: M } = le();
44
44
  function A(e) {
45
45
  var l;
46
- return e === o.modelValue ? null : o.importCurl && e.trim().toLowerCase().startsWith("curl") ? (i("curl", e), (l = n.value) == null || l.dispatch({
46
+ return e === o.modelValue ? null : o.importCurl && e.trim().toLowerCase().startsWith("curl") ? (s("curl", e), (l = n.value) == null || l.dispatch({
47
47
  changes: {
48
48
  from: 0,
49
49
  to: n.value.state.doc.length,
50
50
  insert: String(o.modelValue)
51
51
  }
52
- }), null) : o.handleFieldChange ? o.handleFieldChange(e) : i("update:modelValue", e);
52
+ }), null) : o.handleFieldChange ? o.handleFieldChange(e) : s("update:modelValue", e);
53
53
  }
54
54
  function I(e) {
55
- return o.handleFieldSubmit ? o.handleFieldSubmit(e) : i("submit", e);
55
+ return o.handleFieldSubmit ? o.handleFieldSubmit(e) : s("submit", e);
56
56
  }
57
57
  function N(e) {
58
- g.value = !1, o.emitOnBlur && o.modelValue && I(e);
58
+ V.value = !1, o.emitOnBlur && o.modelValue && I(e);
59
59
  }
60
- const m = [];
61
- o.colorPicker && m.push(X), m.push(
60
+ const f = [];
61
+ o.colorPicker && f.push(X), f.push(
62
62
  Z({
63
- environments: K,
64
- activeEnvVariables: k,
65
- isReadOnly: C
63
+ activeEnvironment: x,
64
+ activeEnvVariables: C,
65
+ isReadOnly: S
66
66
  }),
67
67
  ee
68
68
  );
69
- const S = u(null), { codeMirror: n } = H({
69
+ const E = u(null), { codeMirror: n } = H({
70
70
  content: r(
71
71
  () => o.modelValue !== void 0 ? String(o.modelValue) : ""
72
72
  ),
73
73
  onChange: (e) => {
74
74
  A(e), U();
75
75
  },
76
- onFocus: () => g.value = !0,
76
+ onFocus: () => V.value = !0,
77
77
  onBlur: (e) => N(e),
78
- codeMirrorRef: S,
78
+ codeMirrorRef: E,
79
79
  disableTabIndent: r(() => o.disableTabIndent),
80
80
  disableEnter: r(() => o.disableEnter),
81
81
  disableCloseBrackets: r(() => o.disableCloseBrackets),
82
82
  lineNumbers: r(() => o.lineNumbers),
83
83
  language: r(() => o.language),
84
84
  lint: r(() => o.lint),
85
- extensions: m,
85
+ extensions: f,
86
86
  placeholder: r(() => o.placeholder)
87
87
  });
88
- (x = n.value) == null || x.focus(), Q(n, () => {
89
- n.value && Object.prototype.hasOwnProperty.call(v, "autofocus") && n.value.focus();
88
+ (F = n.value) == null || F.focus(), Q(n, () => {
89
+ n.value && Object.prototype.hasOwnProperty.call(g, "autofocus") && n.value.focus();
90
90
  });
91
91
  const { handleDropdownSelect: T, updateDropdownVisibility: U } = J({
92
92
  codeMirror: n,
93
- query: V,
94
- showDropdown: f,
95
- dropdownPosition: B
96
- }), W = P(() => {
93
+ query: B,
94
+ showDropdown: m,
95
+ dropdownPosition: k
96
+ }), W = y(() => {
97
97
  var e;
98
98
  return o.type === "boolean" || (e = o.type) != null && e.includes("boolean") || o.nullable ? ["true", "false", "null"] : ["true", "false"];
99
99
  });
100
- R({
100
+ $({
101
101
  focus: () => {
102
102
  var e;
103
103
  (e = n.value) == null || e.focus();
104
104
  }
105
105
  });
106
106
  const b = (e, l) => {
107
- var s, t, F;
108
- f.value && (e === "down" ? (l.preventDefault(), (s = p.value) == null || s.handleArrowKey("down")) : e === "up" ? (l.preventDefault(), (t = p.value) == null || t.handleArrowKey("up")) : e === "enter" && (l.preventDefault(), (F = p.value) == null || F.handleSelect()));
107
+ var d, t, P;
108
+ m.value && (e === "down" ? (l.preventDefault(), (d = p.value) == null || d.handleArrowKey("down")) : e === "up" ? (l.preventDefault(), (t = p.value) == null || t.handleArrowKey("up")) : e === "enter" && (l.preventDefault(), (P = p.value) == null || P.handleSelect()));
109
109
  };
110
110
  return (e, l) => {
111
- var s;
111
+ var d;
112
112
  return a(), c(z, null, [
113
- o.enum && o.enum.length ? (a(), y(q, {
113
+ o.enum && o.enum.length ? (a(), v(q, {
114
114
  key: 0,
115
115
  modelValue: o.modelValue,
116
116
  value: o.enum,
117
- "onUpdate:modelValue": l[0] || (l[0] = (t) => i("update:modelValue", t))
118
- }, null, 8, ["modelValue", "value"])) : o.type === "boolean" || (s = o.type) != null && s.includes("boolean") ? (a(), y(q, {
117
+ "onUpdate:modelValue": l[0] || (l[0] = (t) => s("update:modelValue", t))
118
+ }, null, 8, ["modelValue", "value"])) : o.type === "boolean" || (d = o.type) != null && d.includes("boolean") ? (a(), v(q, {
119
119
  key: 1,
120
120
  modelValue: o.modelValue,
121
121
  value: W.value,
122
- "onUpdate:modelValue": l[1] || (l[1] = (t) => i("update:modelValue", t))
122
+ "onUpdate:modelValue": l[1] || (l[1] = (t) => s("update:modelValue", t))
123
123
  }, null, 8, ["modelValue", "value"])) : (a(), c("div", G({
124
124
  key: 2,
125
- id: d(O)
125
+ id: i(K)
126
126
  }, e.$attrs, {
127
127
  ref_key: "codeMirrorRef",
128
- ref: S,
128
+ ref: E,
129
129
  class: ["peer font-code w-full whitespace-nowrap overflow-hidden text-xs leading-[1.44] relative", {
130
130
  "flow-code-input--error": e.error
131
131
  }],
@@ -140,20 +140,21 @@ const te = ["id"], ne = {
140
140
  ])) : w("", !0),
141
141
  D(e.$slots, "icon", {}, void 0, !0),
142
142
  e.required ? (a(), c("div", re, " Required ")) : w("", !0),
143
- f.value && o.withVariables && !d(C) ? (a(), y(oe, {
143
+ m.value && o.withVariables && !i(S) ? (a(), v(oe, {
144
144
  key: 5,
145
145
  ref_key: "dropdownRef",
146
146
  ref: p,
147
- activeEnvVariables: P(() => d(k)),
148
- dropdownPosition: B.value,
149
- query: V.value,
150
- router: d(M),
151
- onSelect: d(T)
152
- }, null, 8, ["activeEnvVariables", "dropdownPosition", "query", "router", "onSelect"])) : w("", !0)
147
+ activeEnvVariables: y(() => i(C)),
148
+ activeEnvironment: y(() => i(x)),
149
+ dropdownPosition: k.value,
150
+ query: B.value,
151
+ router: i(M),
152
+ onSelect: i(T)
153
+ }, null, 8, ["activeEnvVariables", "activeEnvironment", "dropdownPosition", "query", "router", "onSelect"])) : w("", !0)
153
154
  ], 64);
154
155
  };
155
156
  }
156
157
  });
157
158
  export {
158
- me as default
159
+ fe as default
159
160
  };
@@ -1,10 +1,9 @@
1
1
  import type { WorkspaceStore } from '../../store/index.js';
2
- import type { Environment } from '@scalar/oas-utils/entities/environment';
3
2
  import { Decoration, type DecorationSet, EditorView, ViewPlugin, type ViewUpdate } from '@scalar/use-codemirror';
4
3
  type ActiveParsedEnvironments = WorkspaceStore['activeEnvVariables'];
5
4
  type IsReadOnly = WorkspaceStore['isReadOnly'];
6
5
  export declare const pillPlugin: (props: {
7
- environments: Record<string, Environment>;
6
+ activeEnvironment: WorkspaceStore["activeEnvironment"];
8
7
  activeEnvVariables: ActiveParsedEnvironments;
9
8
  isReadOnly: IsReadOnly;
10
9
  }) => ViewPlugin<{
@@ -1 +1 @@
1
- {"version":3,"file":"codeVariableWidget.d.ts","sourceRoot":"","sources":["../../../src/components/CodeInput/codeVariableWidget.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAE7C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AAEzE,OAAO,EACL,UAAU,EACV,KAAK,aAAa,EAClB,UAAU,EAEV,UAAU,EACV,KAAK,UAAU,EAEhB,MAAM,wBAAwB,CAAA;AAG/B,KAAK,wBAAwB,GAAG,cAAc,CAAC,oBAAoB,CAAC,CAAA;AACpE,KAAK,UAAU,GAAG,cAAc,CAAC,YAAY,CAAC,CAAA;AAiH9C,eAAO,MAAM,UAAU,UAAW;IAChC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAA;IACzC,kBAAkB,EAAE,wBAAwB,CAAA;IAC5C,UAAU,EAAE,UAAU,CAAA;CACvB;iBAGkB,aAAa;mBAMX,UAAU;2BAMF,UAAU;EAiCpC,CAAA;AAEH,eAAO,MAAM,gBAAgB,uCA8B3B,CAAA"}
1
+ {"version":3,"file":"codeVariableWidget.d.ts","sourceRoot":"","sources":["../../../src/components/CodeInput/codeVariableWidget.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAI7C,OAAO,EACL,UAAU,EACV,KAAK,aAAa,EAClB,UAAU,EAEV,UAAU,EACV,KAAK,UAAU,EAEhB,MAAM,wBAAwB,CAAA;AAI/B,KAAK,wBAAwB,GAAG,cAAc,CAAC,oBAAoB,CAAC,CAAA;AACpE,KAAK,UAAU,GAAG,cAAc,CAAC,YAAY,CAAC,CAAA;AAqH9C,eAAO,MAAM,UAAU,UAAW;IAChC,iBAAiB,EAAE,cAAc,CAAC,mBAAmB,CAAC,CAAA;IACtD,kBAAkB,EAAE,wBAAwB,CAAA;IAC5C,UAAU,EAAE,UAAU,CAAA;CACvB;iBAGkB,aAAa;mBAMX,UAAU;2BAMF,UAAU;EAiCpC,CAAA;AAEH,eAAO,MAAM,gBAAgB,uCA8B3B,CAAA"}
@@ -1,37 +1,35 @@
1
1
  var v = Object.defineProperty;
2
- var u = (n, t, e) => t in n ? v(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
3
- var l = (n, t, e) => u(n, typeof t != "symbol" ? t + "" : t, e);
2
+ var u = (a, t, e) => t in a ? v(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
3
+ var l = (a, t, e) => u(a, typeof t != "symbol" ? t + "" : t, e);
4
4
  import { ScalarButton as h, ScalarIcon as f, ScalarTooltip as b } from "@scalar/components";
5
5
  import { variableRegex as g } from "@scalar/oas-utils/helpers";
6
- import { ViewPlugin as x, RangeSetBuilder as y, Decoration as w, EditorView as N, WidgetType as E } from "@scalar/use-codemirror";
7
- import { defineComponent as V, h as o, createApp as C } from "vue";
8
- import { parseEnvVariables as k } from "../../libs/environment-parser.js";
9
- const D = (n) => {
10
- var e;
11
- return ((e = n.value.find(
12
- (a) => a.key === "color"
13
- )) == null ? void 0 : e.value) || "grey";
14
- };
15
- class c extends E {
16
- constructor(e, a, i, s) {
6
+ import { ViewPlugin as x, RangeSetBuilder as y, Decoration as E, EditorView as w, WidgetType as N } from "@scalar/use-codemirror";
7
+ import { defineComponent as C, h as o, createApp as V } from "vue";
8
+ import { parseEnvVariables as D } from "../../libs/environment-parser.js";
9
+ const R = (a) => a.value ? a.value.color : "#8E8E8E";
10
+ class c extends N {
11
+ constructor(e, i, n, s) {
17
12
  super();
18
13
  l(this, "app");
19
- l(this, "environments");
14
+ l(this, "activeEnvironment");
20
15
  l(this, "activeEnvVariables");
21
16
  l(this, "isReadOnly");
22
- this.variableName = e, this.variableName = e, this.environments = a, this.activeEnvVariables = i, this.isReadOnly = s;
17
+ this.variableName = e, this.variableName = e, this.activeEnvironment = i, this.activeEnvVariables = n, this.isReadOnly = s;
23
18
  }
24
19
  toDOM() {
25
20
  const e = document.createElement("span");
26
21
  e.className = "cm-pill", e.textContent = `${this.variableName}`;
27
- const a = V({
22
+ const i = C({
28
23
  props: { variableName: { type: String, default: null } },
29
24
  render: () => {
30
- const i = k(this.activeEnvVariables.value).find(
25
+ const n = D(this.activeEnvVariables.value).find(
31
26
  (r) => r.key === this.variableName
32
27
  );
33
- i && (e.className += ` bg-${D(this.activeEnvVariables)}`);
34
- const s = i ? o("div", { class: "p-2" }, i.value) : o("div", { class: "divide-y divide-1/2 grid" }, [
28
+ n && e.style.setProperty(
29
+ "--tw-bg-base",
30
+ R(this.activeEnvironment)
31
+ );
32
+ const s = n ? o("div", { class: "p-2" }, n.value) : o("div", { class: "divide-y divide-1/2 grid" }, [
35
33
  o("span", { class: "p-2" }, "Variable not found"),
36
34
  !this.isReadOnly && o("div", { class: "p-1" }, [
37
35
  o(
@@ -72,7 +70,7 @@ class c extends E {
72
70
  );
73
71
  }
74
72
  });
75
- return this.app = C(a, { variableName: this.variableName }), this.app.mount(e), e;
73
+ return this.app = V(i, { variableName: this.variableName }), this.app.mount(e), e;
76
74
  }
77
75
  destroy() {
78
76
  this.app && this.app.unmount();
@@ -84,7 +82,7 @@ class c extends E {
84
82
  return !1;
85
83
  }
86
84
  }
87
- const P = (n) => x.fromClass(
85
+ const T = (a) => x.fromClass(
88
86
  class {
89
87
  constructor(t) {
90
88
  l(this, "decorations");
@@ -95,20 +93,20 @@ const P = (n) => x.fromClass(
95
93
  }
96
94
  buildDecorations(t) {
97
95
  const e = new y();
98
- for (const { from: a, to: i } of t.visibleRanges) {
99
- const s = t.state.doc.sliceString(a, i);
96
+ for (const { from: i, to: n } of t.visibleRanges) {
97
+ const s = t.state.doc.sliceString(i, n);
100
98
  let r;
101
99
  for (; (r = g.exec(s)) !== null; ) {
102
- const d = a + r.index, m = d + r[0].length, p = r[1];
100
+ const d = i + r.index, m = d + r[0].length, p = r[1];
103
101
  e.add(
104
102
  d,
105
103
  m,
106
- w.widget({
104
+ E.widget({
107
105
  widget: new c(
108
106
  p,
109
- n.environments,
110
- n.activeEnvVariables,
111
- n.isReadOnly
107
+ a.activeEnvironment,
108
+ a.activeEnvVariables,
109
+ a.isReadOnly
112
110
  ),
113
111
  side: 1
114
112
  })
@@ -121,25 +119,25 @@ const P = (n) => x.fromClass(
121
119
  {
122
120
  decorations: (t) => t.decorations
123
121
  }
124
- ), T = N.domEventHandlers({
125
- keydown(n, t) {
126
- if (n.key === "Backspace") {
127
- const { state: e } = t, { from: a, to: i } = e.selection.main;
128
- if (a === 0 && i === e.doc.length)
122
+ ), $ = w.domEventHandlers({
123
+ keydown(a, t) {
124
+ if (a.key === "Backspace") {
125
+ const { state: e } = t, { from: i, to: n } = e.selection.main;
126
+ if (i === 0 && n === e.doc.length)
129
127
  return t.dispatch({
130
128
  changes: { from: 0, to: e.doc.length },
131
129
  selection: { anchor: 0 }
132
- }), n.preventDefault(), !0;
133
- if (a === i && a > 0 && e.doc.sliceString(a - 2, a) === "}}")
130
+ }), a.preventDefault(), !0;
131
+ if (i === n && i > 0 && e.doc.sliceString(i - 2, i) === "}}")
134
132
  return t.dispatch({
135
- changes: { from: a - 2, to: i },
136
- selection: { anchor: a - 2 }
137
- }), n.preventDefault(), !0;
133
+ changes: { from: i - 2, to: n },
134
+ selection: { anchor: i - 2 }
135
+ }), a.preventDefault(), !0;
138
136
  }
139
137
  return !1;
140
138
  }
141
139
  });
142
140
  export {
143
- T as backspaceCommand,
144
- P as pillPlugin
141
+ $ as backspaceCommand,
142
+ T as pillPlugin
145
143
  };
@@ -1 +1 @@
1
- {"version":3,"file":"SideNav.vue.d.ts","sourceRoot":"","sources":["../../../src/components/SideNav/SideNav.vue"],"names":[],"mappings":";AA8KA,wBAKG"}
1
+ {"version":3,"file":"SideNav.vue.d.ts","sourceRoot":"","sources":["../../../src/components/SideNav/SideNav.vue"],"names":[],"mappings":";AAiPA,wBAKG"}
@@ -1,7 +1,7 @@
1
1
  import o from "./SideNav.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.js";
4
- const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-356a8069"]]);
4
+ const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-fa61e0e1"]]);
5
5
  export {
6
- p as default
6
+ f as default
7
7
  };
@@ -1,34 +1,39 @@
1
- import { defineComponent as d, openBlock as n, createElementBlock as i, createElementVNode as e, Fragment as u, renderList as x, unref as o, createVNode as r, withCtx as m, createTextVNode as f, toDisplayString as v } from "vue";
2
- import { ROUTES as y } from "../../constants.js";
3
- import { useRouter as N } from "vue-router";
4
- import h from "./SideHelp.vue.js";
5
- import _ from "./SideNavLink.vue.js";
1
+ import { defineComponent as _, openBlock as a, createElementBlock as n, createElementVNode as e, Fragment as u, renderList as x, unref as t, createVNode as o, withCtx as m, createTextVNode as p, toDisplayString as v } from "vue";
2
+ import { ROUTES as h } from "../../constants.js";
3
+ import { ScalarIcon as y } from "@scalar/components";
4
+ import { useRouter as b } from "vue-router";
5
+ import N from "./SideHelp.vue.js";
6
+ import d from "./SideNavLink.vue.js";
6
7
  const S = {
7
8
  "aria-label": "App Navigation",
8
- class: "text-c-2 sm:w-13 flex sm:flex-col justify-center items-center px-2 py-2 scalar-sidenav relative drag-region bg-b-1",
9
+ class: "text-c-2 sm:w-13 flex sm:flex-col justify-center items-center px-2 py-2 scalar-sidenav relative drag-region bg-b-1 group-sidenav",
9
10
  role: "navigation"
10
- }, b = { class: "flex sm:flex-col gap-1.5" }, k = { class: "mt-auto flex sm:flex-col gap-1.5 py-0.5" }, E = { class: "flex items-center no-drag-region" }, R = { class: "flex items-center no-drag-region" }, A = /* @__PURE__ */ d({
11
+ }, w = { class: "flex sm:flex-col gap-1.5" }, k = { class: "mt-auto flex sm:flex-col gap-1.5 py-0.5" }, E = { class: "flex items-center no-drag-region" }, R = { class: "flex items-center no-drag-region" }, V = { class: "hide-in-scalar-app" }, j = {
12
+ class: "min-w-[37px] max-w-[37px] hover:bg-b-2 flex items-center justify-center rounded-lg p-[8px] text-c-3 focus:text-c-1 scalar-app-nav-padding group-hover/sidenav:border-1/2 group-sidenav-hover cursor-pointer",
13
+ href: "https://scalar.com/download",
14
+ target: "_blank"
15
+ }, L = /* @__PURE__ */ _({
11
16
  __name: "SideNav",
12
- setup(V) {
13
- const { currentRoute: a } = N();
14
- return (w, l) => (n(), i("nav", S, [
15
- e("ul", b, [
16
- (n(!0), i(u, null, x(o(y).filter(
17
- (t) => t.name !== "settings"
18
- ), ({ icon: t, name: s, prettyName: g }, p) => {
19
- var c;
20
- return n(), i("li", {
21
- key: p,
17
+ setup(B) {
18
+ const { currentRoute: i } = b();
19
+ return (C, c) => (a(), n("nav", S, [
20
+ e("ul", w, [
21
+ (a(!0), n(u, null, x(t(h).filter(
22
+ (s) => s.name !== "settings"
23
+ ), ({ icon: s, name: r, prettyName: f }, g) => {
24
+ var l;
25
+ return a(), n("li", {
26
+ key: g,
22
27
  class: "no-drag-region"
23
28
  }, [
24
- r(_, {
25
- active: (c = o(a).name) == null ? void 0 : c.startsWith(s),
26
- icon: t,
27
- name: s,
28
- prettyName: g
29
+ o(d, {
30
+ active: (l = t(i).name) == null ? void 0 : l.startsWith(r),
31
+ icon: s,
32
+ name: r,
33
+ prettyName: f
29
34
  }, {
30
35
  default: m(() => [
31
- f(v(s), 1)
36
+ p(v(r), 1)
32
37
  ]),
33
38
  _: 2
34
39
  }, 1032, ["active", "icon", "name", "prettyName"])
@@ -37,25 +42,33 @@ const S = {
37
42
  ]),
38
43
  e("ul", k, [
39
44
  e("li", E, [
40
- r(_, {
41
- active: o(a).name === "settings",
45
+ o(d, {
46
+ active: t(i).name === "settings",
42
47
  icon: "Settings",
43
48
  name: "settings",
44
49
  prettyName: "Settings"
45
50
  }, {
46
- default: m(() => l[0] || (l[0] = [
47
- f(" Settings ")
51
+ default: m(() => c[0] || (c[0] = [
52
+ p(" Settings ")
48
53
  ])),
49
54
  _: 1
50
55
  }, 8, ["active"])
51
56
  ]),
52
57
  e("li", R, [
53
- r(h)
58
+ o(N)
59
+ ]),
60
+ e("li", V, [
61
+ e("a", j, [
62
+ o(t(y), {
63
+ icon: "Download",
64
+ thickness: "1.5"
65
+ })
66
+ ])
54
67
  ])
55
68
  ])
56
69
  ]));
57
70
  }
58
71
  });
59
72
  export {
60
- A as default
73
+ L as default
61
74
  };
@@ -10,6 +10,7 @@ declare const _default: import("vue").DefineComponent<{
10
10
  isCopyable?: boolean;
11
11
  }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
12
12
  delete: (id: string) => any;
13
+ colorModal: (id: string) => any;
13
14
  }, string, import("vue").PublicProps, Readonly<{
14
15
  variable: {
15
16
  uid: string;
@@ -22,6 +23,7 @@ declare const _default: import("vue").DefineComponent<{
22
23
  isCopyable?: boolean;
23
24
  }> & Readonly<{
24
25
  onDelete?: ((id: string) => any) | undefined;
26
+ onColorModal?: ((id: string) => any) | undefined;
25
27
  }>, {
26
28
  isDeletable: boolean;
27
29
  isCopyable: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"SidebarListElement.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Sidebar/SidebarListElement.vue"],"names":[],"mappings":";cAsFc;QACR,GAAG,EAAE,MAAM,CAAA;QACX,IAAI,EAAE,MAAM,CAAA;QACZ,KAAK,CAAC,EAAE,MAAM,CAAA;QACd,SAAS,CAAC,EAAE,OAAO,CAAA;KACpB;qBACgB,MAAM;kBACT,OAAO;iBACR,OAAO;;;;cARV;QACR,GAAG,EAAE,MAAM,CAAA;QACX,IAAI,EAAE,MAAM,CAAA;QACZ,KAAK,CAAC,EAAE,MAAM,CAAA;QACd,SAAS,CAAC,EAAE,OAAO,CAAA;KACpB;qBACgB,MAAM;kBACT,OAAO;iBACR,OAAO;;;;iBADN,OAAO;gBACR,OAAO;;AAyKxB,wBAUG"}
1
+ {"version":3,"file":"SidebarListElement.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Sidebar/SidebarListElement.vue"],"names":[],"mappings":";cA4Fc;QACR,GAAG,EAAE,MAAM,CAAA;QACX,IAAI,EAAE,MAAM,CAAA;QACZ,KAAK,CAAC,EAAE,MAAM,CAAA;QACd,SAAS,CAAC,EAAE,OAAO,CAAA;KACpB;qBACgB,MAAM;kBACT,OAAO;iBACR,OAAO;;;;;cARV;QACR,GAAG,EAAE,MAAM,CAAA;QACX,IAAI,EAAE,MAAM,CAAA;QACZ,KAAK,CAAC,EAAE,MAAM,CAAA;QACd,SAAS,CAAC,EAAE,OAAO,CAAA;KACpB;qBACgB,MAAM;kBACT,OAAO;iBACR,OAAO;;;;;iBADN,OAAO;gBACR,OAAO;;AAqLxB,wBAWG"}
@@ -1,7 +1,7 @@
1
1
  import t from "./SidebarListElement.vue2.js";
2
2
  /* empty css */
3
3
  import o from "../../_virtual/_plugin-vue_export-helper.js";
4
- const a = /* @__PURE__ */ o(t, [["__scopeId", "data-v-271914bc"]]);
4
+ const a = /* @__PURE__ */ o(t, [["__scopeId", "data-v-146f5335"]]);
5
5
  export {
6
6
  a as default
7
7
  };