@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
@@ -1 +1 @@
1
- {"version":3,"file":"Environment.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Environment/Environment.vue"],"names":[],"mappings":";WAmMS,OAAO;;WAAP,OAAO;;AA6VhB,wBAMG"}
1
+ {"version":3,"file":"Environment.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Environment/Environment.vue"],"names":[],"mappings":";WA6NS,OAAO;;WAAP,OAAO;;AAibhB,wBAMG"}
@@ -1,61 +1,70 @@
1
- import { defineComponent as C, ref as f, onMounted as V, onBeforeUnmount as S, openBlock as r, createBlock as c, withCtx as l, createVNode as u, createElementVNode as k, createElementBlock as d, Fragment as $, renderList as A, unref as i, createTextVNode as B, createSlots as K, createCommentVNode as I, toDisplayString as L, withKeys as R, nextTick as M } from "vue";
2
- import U from "../../components/CodeInput/CodeInput.vue.js";
3
- import T from "../../components/Sidebar/Sidebar.vue.js";
4
- import j from "../../components/Sidebar/SidebarButton.vue.js";
5
- import F from "../../components/Sidebar/SidebarList.vue.js";
6
- import H from "../../components/Sidebar/SidebarListElement.vue.js";
7
- import J from "../../components/ViewLayout/ViewLayout.vue.js";
8
- import O from "../../components/ViewLayout/ViewLayoutContent.vue.js";
9
- import W from "../../components/ViewLayout/ViewLayoutSection.vue.js";
10
- import { environmentSchema as q } from "@scalar/oas-utils/entities/environment";
11
- import { nanoid as z } from "nanoid";
12
- import { useRouter as G, useRoute as P } from "vue-router";
13
- import Q from "./EnvironmentColors.vue.js";
14
- import { useWorkspace as X } from "../../store/store.js";
15
- const Y = { class: "flex-1" }, Z = ["value"], ee = { class: "colors ml-auto" }, ye = /* @__PURE__ */ C({
1
+ import { defineComponent as B, ref as m, onMounted as K, onBeforeUnmount as L, openBlock as i, createBlock as p, withCtx as r, createVNode as u, createElementVNode as R, createElementBlock as y, Fragment as U, renderList as O, unref as a, createTextVNode as T, createSlots as j, createCommentVNode as F, toDisplayString as H, withKeys as J, nextTick as W } from "vue";
2
+ import q from "../../components/CodeInput/CodeInput.vue.js";
3
+ import z from "../../components/Sidebar/Sidebar.vue.js";
4
+ import G from "../../components/Sidebar/SidebarButton.vue.js";
5
+ import P from "../../components/Sidebar/SidebarList.vue.js";
6
+ import Q from "../../components/Sidebar/SidebarListElement.vue.js";
7
+ import X from "../../components/ViewLayout/ViewLayout.vue.js";
8
+ import Y from "../../components/ViewLayout/ViewLayoutContent.vue.js";
9
+ import Z from "../../components/ViewLayout/ViewLayoutSection.vue.js";
10
+ import { useModal as x } from "@scalar/components";
11
+ import { environmentSchema as ee } from "@scalar/oas-utils/entities/environment";
12
+ import { nanoid as te } from "nanoid";
13
+ import { useRouter as oe, useRoute as ne } from "vue-router";
14
+ import le from "./EnvironmentColorModal.vue.js";
15
+ import ae from "./EnvironmentModal.vue.js";
16
+ import { useWorkspace as re } from "../../store/store.js";
17
+ const ue = { class: "flex-1" }, ie = ["value"], we = /* @__PURE__ */ B({
16
18
  __name: "Environment",
17
19
  props: {
18
20
  isApp: { type: Boolean }
19
21
  },
20
- setup(te) {
21
- const g = G(), E = P(), { environments: o, environmentMutators: s, events: p } = X(), e = f(null), v = f(null), m = f(!1);
22
- function y() {
23
- const t = q.parse({
24
- name: "New Environment",
25
- uid: z(),
26
- color: "grey",
27
- raw: JSON.stringify({ exampleKey: "exampleValue" }, null, 2),
28
- parsed: [],
22
+ setup(se) {
23
+ const E = oe(), h = ne(), { environments: l, environmentMutators: s, events: k } = re(), d = x(), f = x(), t = m(null), g = m(null), c = m(!1), v = m(null), C = m("");
24
+ function _(e) {
25
+ const o = ee.parse({
26
+ name: e.name,
27
+ uid: te(),
28
+ color: e.color,
29
+ value: JSON.stringify({ exampleKey: "exampleValue" }, null, 2),
29
30
  isDefault: !1
30
31
  });
31
- s.add(t), e.value = t.uid, g.push(e.value);
32
+ s.add(o), t.value = o.uid, E.push(t.value), f.hide();
32
33
  }
33
- function x(t) {
34
- e.value && s.edit(e.value, "value", t);
34
+ function N(e) {
35
+ t.value && s.edit(t.value, "value", e);
35
36
  }
36
- const N = (t) => {
37
- s.delete(t), e.value === t && (e.value = null);
38
- }, D = (t) => e.value && s.edit(e.value, "color", t), b = () => {
39
- e.value && !o[e.value].isDefault && (m.value = !0, M(() => {
40
- var t;
41
- (t = v.value) == null || t.focus();
37
+ const w = (e) => {
38
+ s.delete(e), t.value === e && (t.value = null);
39
+ }, D = (e) => {
40
+ v.value = e, C.value = l[e].color || "", d.show();
41
+ }, M = (e) => {
42
+ v.value && (s.edit(v.value, "color", e), d.hide());
43
+ }, V = () => {
44
+ E.currentRoute.value.params.environment === "default" && (t.value = l.default.uid);
45
+ }, $ = () => {
46
+ t.value && !l[t.value].isDefault && (c.value = !0, W(() => {
47
+ var e;
48
+ (e = g.value) == null || e.focus();
42
49
  }));
43
- }, h = (t) => {
44
- const n = t.target.value;
45
- e.value && !o[e.value].isDefault && s.edit(e.value, "name", n);
46
- }, _ = (t) => {
47
- t != null && t.createNew && E.name === "environment" && y();
50
+ }, S = (e) => {
51
+ const n = e.target.value;
52
+ t.value && !l[t.value].isDefault && s.edit(t.value, "name", n);
53
+ }, b = (e) => {
54
+ e != null && e.createNew && h.name === "environment" && _({ name: "", color: "" });
55
+ }, A = () => {
56
+ f.show();
48
57
  };
49
- return V(() => {
50
- p.hotKeys.on(_);
51
- }), S(() => p.hotKeys.off(_)), (t, a) => (r(), c(J, null, {
52
- default: l(() => [
53
- u(T, { title: "Environment" }, {
54
- content: l(() => [
55
- k("div", Y, [
56
- u(F, null, {
57
- default: l(() => [
58
- (r(!0), d($, null, A(i(o), (n) => (r(), c(H, {
58
+ return K(() => {
59
+ V(), k.hotKeys.on(b);
60
+ }), L(() => k.hotKeys.off(b)), (e, o) => (i(), p(X, null, {
61
+ default: r(() => [
62
+ u(z, { title: "Environment" }, {
63
+ content: r(() => [
64
+ R("div", ue, [
65
+ u(P, null, {
66
+ default: r(() => [
67
+ (i(!0), y(U, null, O(a(l), (n) => (i(), p(Q, {
59
68
  key: n.uid,
60
69
  class: "text-xs",
61
70
  variable: {
@@ -65,79 +74,85 @@ const Y = { class: "flex-1" }, Z = ["value"], ee = { class: "colors ml-auto" },
65
74
  isDefault: n.isDefault
66
75
  },
67
76
  warningMessage: "Are you sure you want to delete this environment?",
68
- onClick: (w) => e.value = n.uid,
69
- onDelete: (w) => N(n.uid)
77
+ onClick: (I) => t.value = n.uid,
78
+ onColorModal: D,
79
+ onDelete: (I) => w(n.uid)
70
80
  }, null, 8, ["variable", "onClick", "onDelete"]))), 128))
71
81
  ]),
72
82
  _: 1
73
83
  })
74
84
  ])
75
85
  ]),
76
- button: l(() => [
77
- u(j, {
78
- click: y,
86
+ button: r(() => [
87
+ u(G, {
88
+ click: A,
79
89
  hotkey: "N",
80
- isApp: t.isApp
90
+ isApp: e.isApp
81
91
  }, {
82
- title: l(() => a[2] || (a[2] = [
83
- B("Add Environment")
92
+ title: r(() => o[4] || (o[4] = [
93
+ T("Add Environment")
84
94
  ])),
85
95
  _: 1
86
96
  }, 8, ["isApp"])
87
97
  ]),
88
98
  _: 1
89
99
  }),
90
- u(O, { class: "flex-1" }, {
91
- default: l(() => [
92
- u(W, null, K({
93
- default: l(() => [
94
- e.value ? (r(), c(U, {
100
+ u(Y, { class: "flex-1" }, {
101
+ default: r(() => [
102
+ u(Z, null, j({
103
+ default: r(() => [
104
+ t.value ? (i(), p(q, {
95
105
  key: 0,
96
106
  class: "pl-px pr-2 md:px-2 py-2.5",
97
107
  language: "json",
98
108
  lineNumbers: "",
99
- modelValue: i(o)[e.value].value,
100
- "onUpdate:modelValue": x
101
- }, null, 8, ["modelValue"])) : I("", !0)
109
+ modelValue: a(l)[t.value].value,
110
+ "onUpdate:modelValue": N
111
+ }, null, 8, ["modelValue"])) : F("", !0)
102
112
  ]),
103
113
  _: 2
104
114
  }, [
105
- e.value ? {
115
+ t.value ? {
106
116
  name: "title",
107
- fn: l(() => [
108
- !m.value || i(o)[e.value].isDefault ? (r(), d("span", {
117
+ fn: r(() => [
118
+ !c.value || a(l)[t.value].isDefault ? (i(), y("span", {
109
119
  key: 0,
110
- onDblclick: b
111
- }, L(i(o)[e.value].name), 33)) : (r(), d("input", {
120
+ onDblclick: $
121
+ }, H(a(l)[t.value].name), 33)) : (i(), y("input", {
112
122
  key: 1,
113
123
  ref_key: "nameInputRef",
114
- ref: v,
124
+ ref: g,
115
125
  class: "ring-1 ring-offset-4 ring-b-outline rounded",
116
126
  spellcheck: "false",
117
127
  type: "text",
118
- value: i(o)[e.value].name,
119
- onBlur: a[0] || (a[0] = (n) => m.value = !1),
120
- onInput: h,
121
- onKeyup: a[1] || (a[1] = R((n) => m.value = !1, ["enter"]))
122
- }, null, 40, Z)),
123
- k("div", ee, [
124
- u(Q, {
125
- activeColor: i(o)[e.value].color,
126
- onSelect: D
127
- }, null, 8, ["activeColor"])
128
- ])
128
+ value: a(l)[t.value].name,
129
+ onBlur: o[0] || (o[0] = (n) => c.value = !1),
130
+ onInput: S,
131
+ onKeyup: o[1] || (o[1] = J((n) => c.value = !1, ["enter"]))
132
+ }, null, 40, ie))
129
133
  ]),
130
134
  key: "0"
131
135
  } : void 0
132
136
  ]), 1024)
133
137
  ]),
134
138
  _: 1
135
- })
139
+ }),
140
+ u(le, {
141
+ selectedColor: C.value,
142
+ state: a(d),
143
+ onCancel: o[2] || (o[2] = (n) => a(d).hide()),
144
+ onSubmit: M
145
+ }, null, 8, ["selectedColor", "state"]),
146
+ u(ae, {
147
+ state: a(f),
148
+ onCancel: o[3] || (o[3] = (n) => a(f).hide()),
149
+ onSubmit: _
150
+ }, null, 8, ["state"])
136
151
  ]),
137
152
  _: 1
138
153
  }));
139
154
  }
140
155
  });
141
156
  export {
142
- ye as default
157
+ we as default
143
158
  };
@@ -0,0 +1,16 @@
1
+ import { type ModalState } from '@scalar/components';
2
+ declare const _default: import("vue").DefineComponent<{
3
+ state: ModalState;
4
+ selectedColor: string;
5
+ }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
6
+ submit: (color: string) => any;
7
+ cancel: () => any;
8
+ }, string, import("vue").PublicProps, Readonly<{
9
+ state: ModalState;
10
+ selectedColor: string;
11
+ }> & Readonly<{
12
+ onSubmit?: ((color: string) => any) | undefined;
13
+ onCancel?: (() => any) | undefined;
14
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
15
+ export default _default;
16
+ //# sourceMappingURL=EnvironmentColorModal.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EnvironmentColorModal.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Environment/EnvironmentColorModal.vue"],"names":[],"mappings":"AA2CA,OAAO,EAAE,KAAK,UAAU,EAAe,MAAM,oBAAoB,CAAA;;WAQxD,UAAU;mBACF,MAAM;;;;;WADd,UAAU;mBACF,MAAM;;;;;AAiJvB,wBAUG"}
@@ -0,0 +1,40 @@
1
+ import { defineComponent as c, ref as d, openBlock as f, createBlock as p, unref as u, withCtx as C, createElementVNode as v, createVNode as n } from "vue";
2
+ import x from "../../components/Sidebar/Actions/SidebarListElementForm.vue.js";
3
+ import { ScalarModal as _ } from "@scalar/components";
4
+ import E from "./EnvironmentColors.vue.js";
5
+ const S = { class: "flex flex-col gap-4" }, B = /* @__PURE__ */ c({
6
+ __name: "EnvironmentColorModal",
7
+ props: {
8
+ state: {},
9
+ selectedColor: {}
10
+ },
11
+ emits: ["cancel", "submit"],
12
+ setup(r, { emit: s }) {
13
+ const a = r, l = s, t = d(""), i = (o) => {
14
+ t.value = o;
15
+ };
16
+ return (o, e) => (f(), p(u(_), {
17
+ size: "xxs",
18
+ state: o.state,
19
+ title: "Edit Environment Color"
20
+ }, {
21
+ default: C(() => [
22
+ v("div", S, [
23
+ n(E, {
24
+ activeColor: t.value || a.selectedColor,
25
+ class: "p-1 w-full",
26
+ onSelect: i
27
+ }, null, 8, ["activeColor"]),
28
+ n(x, {
29
+ onCancel: e[0] || (e[0] = (m) => l("cancel")),
30
+ onSubmit: e[1] || (e[1] = (m) => l("submit", t.value))
31
+ })
32
+ ])
33
+ ]),
34
+ _: 1
35
+ }, 8, ["state"]));
36
+ }
37
+ });
38
+ export {
39
+ B as default
40
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./EnvironmentColorModal.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"EnvironmentColors.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Environment/EnvironmentColors.vue"],"names":[],"mappings":";iBA6Ce,MAAM;;;;iBAAN,MAAM;;;;AAiGrB,wBASG"}
1
+ {"version":3,"file":"EnvironmentColors.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Environment/EnvironmentColors.vue"],"names":[],"mappings":";iBAuHe,MAAM;;;;iBAAN,MAAM;;;;AA2OrB,wBASG"}
@@ -1,38 +1,93 @@
1
- import { defineComponent as c, openBlock as o, createElementBlock as l, Fragment as n, renderList as t, createElementVNode as a, normalizeClass as g, createBlock as i, unref as b, createCommentVNode as C } from "vue";
2
- import { ScalarIcon as m } from "@scalar/components";
3
- const p = { class: "flex flex-row gap-1.5 space-x-1" }, u = ["onClick"], v = /* @__PURE__ */ c({
1
+ import { defineComponent as h, ref as v, computed as x, watch as w, openBlock as n, createElementBlock as c, normalizeClass as E, Fragment as b, renderList as z, createElementVNode as s, normalizeStyle as m, createBlock as g, unref as p, createCommentVNode as a, withDirectives as B, vModelText as $, createVNode as F, nextTick as I } from "vue";
2
+ import { ScalarIcon as f } from "@scalar/components";
3
+ const D = ["onClick"], V = {
4
+ key: 1,
5
+ class: "!py-0 flex flex-1 gap-2 items-center rounded"
6
+ }, j = ["placeholder"], T = /* @__PURE__ */ h({
4
7
  __name: "EnvironmentColors",
5
8
  props: {
6
9
  activeColor: {}
7
10
  },
8
11
  emits: ["select"],
9
- setup(d) {
10
- const s = [
11
- { color: "grey", bgClass: "bg-grey" },
12
- { color: "red", bgClass: "bg-red" },
13
- { color: "yellow", bgClass: "bg-yellow" },
14
- { color: "green", bgClass: "bg-green" },
15
- { color: "orange", bgClass: "bg-orange" },
16
- { color: "blue", bgClass: "bg-blue" },
17
- { color: "text-c-2", bgClass: "bg-c-2" },
18
- { color: "purple", bgClass: "bg-purple" },
19
- { color: "pink", bgClass: "bg-pink" }
20
- ];
21
- return (r, f) => (o(), l("div", p, [
22
- (o(), l(n, null, t(s, (e) => a("div", {
23
- key: e.color,
24
- class: g(["flex h-5 w-5 cursor-pointer items-center justify-center rounded-full", e.bgClass]),
25
- onClick: (k) => r.$emit("select", e.color)
26
- }, [
27
- r.activeColor === e.color ? (o(), i(b(m), {
28
- key: 0,
29
- icon: "Checkmark",
30
- size: "xs"
31
- })) : C("", !0)
32
- ], 10, u)), 64))
33
- ]));
12
+ setup(y) {
13
+ const u = y, t = v(!1), o = v(""), i = v(null), d = [
14
+ { color: "#8E8E8E" },
15
+ { color: "#EF0006" },
16
+ { color: "#EDBE20" },
17
+ { color: "#069061" },
18
+ { color: "#FB892C" },
19
+ { color: "#0082D0" },
20
+ { color: "#5203D1" },
21
+ { color: "#FFC0CB" }
22
+ ], C = x(() => u.activeColor && !d.some((e) => e.color === u.activeColor) || o.value ? `background-color: ${u.activeColor || o.value};` : "background: linear-gradient(to right, rgb(235, 87, 87), rgb(242, 201, 76), rgb(76, 183, 130), rgb(78, 167, 252), rgb(250, 96, 122));"), k = () => {
23
+ t.value = !t.value, I(() => {
24
+ i.value && i.value.focus();
25
+ });
26
+ };
27
+ return w(o, (e) => {
28
+ e && !e.startsWith("#") && (o.value = `#${e}`), t.value = !0;
29
+ }), (e, r) => (n(), c("div", {
30
+ class: E(["flex flex-row gap-1.5 items-center justify-between space-x-1 min-h-10 min-w-[296px] py-1", t.value ? "pl-2 pr-1.5" : "px-2"])
31
+ }, [
32
+ t.value ? a("", !0) : (n(), c(b, { key: 0 }, [
33
+ (n(), c(b, null, z(d, (l) => s("div", {
34
+ key: l.color,
35
+ class: "flex h-5 w-5 cursor-pointer items-center justify-center rounded-full",
36
+ style: m({ backgroundColor: l.color }),
37
+ onClick: (N) => e.$emit("select", l.color)
38
+ }, [
39
+ e.activeColor === l.color && !o.value ? (n(), g(p(f), {
40
+ key: 0,
41
+ class: "text-c-btn",
42
+ icon: "Checkmark",
43
+ size: "xs"
44
+ })) : a("", !0)
45
+ ], 12, D)), 64)),
46
+ r[2] || (r[2] = s("hr", { class: "w-0.5 h-5 border-ghost border-l" }, null, -1)),
47
+ s("label", {
48
+ class: "cursor-pointer flex flex-row justify-center h-5 w-5 gap-2 items-center rounded-full z-10",
49
+ style: m(C.value),
50
+ onClick: k
51
+ }, [
52
+ !t.value && (e.activeColor === o.value || e.activeColor && !d.some((l) => l.color === e.activeColor)) ? (n(), g(p(f), {
53
+ key: 0,
54
+ class: "text-c-btn",
55
+ icon: "Checkmark",
56
+ size: "xs"
57
+ })) : a("", !0)
58
+ ], 4)
59
+ ], 64)),
60
+ t.value ? (n(), c("div", V, [
61
+ r[3] || (r[3] = s("span", { class: "absolute border border-dashed h-5 w-5 rounded-full" }, null, -1)),
62
+ s("span", {
63
+ class: "h-5 w-5 rounded-full z-[1]",
64
+ style: m(C.value)
65
+ }, null, 4),
66
+ B(s("input", {
67
+ ref_key: "customColorInputRef",
68
+ ref: i,
69
+ "onUpdate:modelValue": r[0] || (r[0] = (l) => o.value = l),
70
+ class: "border-transparent flex-1 outline-none w-full text-sm",
71
+ placeholder: e.activeColor || "#000000",
72
+ type: "text",
73
+ onInput: r[1] || (r[1] = (l) => e.$emit("select", o.value))
74
+ }, null, 40, j), [
75
+ [$, o.value]
76
+ ]),
77
+ s("button", {
78
+ class: "text-c-3 hover:bg-b-2 p-1.5 rounded-lg",
79
+ type: "button",
80
+ onClick: k
81
+ }, [
82
+ F(p(f), {
83
+ icon: "Checkmark",
84
+ size: "xs"
85
+ })
86
+ ])
87
+ ])) : a("", !0)
88
+ ], 2));
34
89
  }
35
90
  });
36
91
  export {
37
- v as default
92
+ T as default
38
93
  };
@@ -0,0 +1,20 @@
1
+ import { type ModalState } from '@scalar/components';
2
+ declare const _default: import("vue").DefineComponent<{
3
+ state: ModalState;
4
+ }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
5
+ submit: (environment: {
6
+ name: string;
7
+ color: string;
8
+ }) => any;
9
+ cancel: () => any;
10
+ }, string, import("vue").PublicProps, Readonly<{
11
+ state: ModalState;
12
+ }> & Readonly<{
13
+ onSubmit?: ((environment: {
14
+ name: string;
15
+ color: string;
16
+ }) => any) | undefined;
17
+ onCancel?: (() => any) | undefined;
18
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
19
+ export default _default;
20
+ //# sourceMappingURL=EnvironmentModal.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EnvironmentModal.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Environment/EnvironmentModal.vue"],"names":[],"mappings":"AAkEA,OAAO,EACL,KAAK,UAAU,EAGhB,MAAM,oBAAoB,CAAA;;WAQlB,UAAU;;;cA0LsB,MAAM;eAAS,MAAM;;;;WA1LrD,UAAU;;;cA0LsB,MAAM;eAAS,MAAM;;;;AAR9D,wBAUG"}
@@ -0,0 +1,52 @@
1
+ import { defineComponent as p, ref as m, watch as v, openBlock as f, createBlock as E, unref as s, withCtx as x, createElementVNode as C, createVNode as a } from "vue";
2
+ import S from "../../components/Sidebar/Actions/SidebarListElementForm.vue.js";
3
+ import { ScalarModal as V, ScalarTextField as b } from "@scalar/components";
4
+ import _ from "./EnvironmentColors.vue.js";
5
+ const w = { class: "flex flex-col gap-3" }, F = /* @__PURE__ */ p({
6
+ __name: "EnvironmentModal",
7
+ props: {
8
+ state: {}
9
+ },
10
+ emits: ["cancel", "submit"],
11
+ setup(i, { emit: u }) {
12
+ const c = i, r = u, o = m(""), l = m("#8E8E8E"), d = (t) => {
13
+ l.value = t;
14
+ };
15
+ return v(
16
+ () => c.state.open,
17
+ (t) => {
18
+ t && (o.value = "", l.value = "#8E8E8E");
19
+ }
20
+ ), (t, e) => (f(), E(s(V), {
21
+ size: "xxs",
22
+ state: t.state,
23
+ title: "Add Environment"
24
+ }, {
25
+ default: x(() => [
26
+ C("div", w, [
27
+ a(s(b), {
28
+ modelValue: o.value,
29
+ "onUpdate:modelValue": e[0] || (e[0] = (n) => o.value = n),
30
+ placeholder: "Environment name"
31
+ }, null, 8, ["modelValue"]),
32
+ a(_, {
33
+ activeColor: l.value,
34
+ class: "p-3 w-full",
35
+ onSelect: d
36
+ }, null, 8, ["activeColor"]),
37
+ a(S, {
38
+ onCancel: e[1] || (e[1] = (n) => r("cancel")),
39
+ onSubmit: e[2] || (e[2] = (n) => r("submit", {
40
+ name: o.value,
41
+ color: l.value
42
+ }))
43
+ })
44
+ ])
45
+ ]),
46
+ _: 1
47
+ }, 8, ["state"]));
48
+ }
49
+ });
50
+ export {
51
+ F as default
52
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./EnvironmentModal.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -2,6 +2,7 @@ import type { WorkspaceStore } from '../../store/index.js';
2
2
  import type { Router } from 'vue-router';
3
3
  declare const _default: import("vue").DefineComponent<{
4
4
  query: string;
5
+ activeEnvironment: WorkspaceStore["activeEnvironment"];
5
6
  activeEnvVariables: WorkspaceStore["activeEnvVariables"];
6
7
  router: Router;
7
8
  dropdownPosition?: {
@@ -15,6 +16,7 @@ declare const _default: import("vue").DefineComponent<{
15
16
  select: (variable: string) => any;
16
17
  }, string, import("vue").PublicProps, Readonly<{
17
18
  query: string;
19
+ activeEnvironment: WorkspaceStore["activeEnvironment"];
18
20
  activeEnvVariables: WorkspaceStore["activeEnvVariables"];
19
21
  router: Router;
20
22
  dropdownPosition?: {
@@ -1 +1 @@
1
- {"version":3,"file":"EnvironmentVariableDropdown.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Environment/EnvironmentVariableDropdown.vue"],"names":[],"mappings":"AA0JA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAK7C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;;WAK/B,MAAM;wBACO,cAAc,CAAC,oBAAoB,CAAC;YAChD,MAAM;uBAEK;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE;;gCAqDf,IAAI,GAAG,MAAM;;;;;WAzDvC,MAAM;wBACO,cAAc,CAAC,oBAAoB,CAAC;YAChD,MAAM;uBAEK;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE;;;;AAyRlD,wBAUG"}
1
+ {"version":3,"file":"EnvironmentVariableDropdown.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Environment/EnvironmentVariableDropdown.vue"],"names":[],"mappings":"AAkKA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAK7C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;;WAK/B,MAAM;uBACM,cAAc,CAAC,mBAAmB,CAAC;wBAClC,cAAc,CAAC,oBAAoB,CAAC;YAChD,MAAM;uBAEK;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE;;gCA0Df,IAAI,GAAG,MAAM;;;;;WA/DvC,MAAM;uBACM,cAAc,CAAC,mBAAmB,CAAC;wBAClC,cAAc,CAAC,oBAAoB,CAAC;YAChD,MAAM;uBAEK;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE;;;;AA+RlD,wBAUG"}