@scalar/api-client 2.2.40 → 2.2.42

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 (78) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist/components/AddressBar/AddressBar.vue.d.ts.map +1 -1
  3. package/dist/components/AddressBar/AddressBar.vue.js +2 -2
  4. package/dist/components/AddressBar/AddressBar.vue2.js +35 -31
  5. package/dist/components/AddressBar/index.d.ts +1 -2
  6. package/dist/components/AddressBar/index.d.ts.map +1 -1
  7. package/dist/components/DataTable/DataTableInputSelect.vue.js +29 -29
  8. package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +7 -7
  9. package/dist/components/ImportCollection/WorkspaceSelector.vue.js +21 -21
  10. package/dist/components/{AddressBar/AddressBarServer.vue.d.ts → Server/ServerDropdown.vue.d.ts} +6 -1
  11. package/dist/components/Server/ServerDropdown.vue.d.ts.map +1 -0
  12. package/dist/components/Server/ServerDropdown.vue.js +155 -0
  13. package/dist/components/Server/ServerDropdown.vue2.js +4 -0
  14. package/dist/components/Server/ServerDropdownItem.vue.d.ts +19 -0
  15. package/dist/components/Server/ServerDropdownItem.vue.d.ts.map +1 -0
  16. package/dist/components/Server/ServerDropdownItem.vue.js +7 -0
  17. package/dist/components/Server/ServerDropdownItem.vue2.js +81 -0
  18. package/dist/components/Server/ServerVariablesForm.vue.js +20 -20
  19. package/dist/components/Server/ServerVariablesTextbox.vue.d.ts.map +1 -1
  20. package/dist/components/Server/ServerVariablesTextbox.vue.js +4 -4
  21. package/dist/components/Server/index.d.ts +3 -0
  22. package/dist/components/Server/index.d.ts.map +1 -0
  23. package/dist/components/Server/index.js +6 -0
  24. package/dist/components/ViewLayout/ViewLayoutCollapse.vue.d.ts +1 -5
  25. package/dist/components/ViewLayout/ViewLayoutCollapse.vue.d.ts.map +1 -1
  26. package/dist/hooks/useLayout.d.ts +2 -0
  27. package/dist/hooks/useLayout.d.ts.map +1 -1
  28. package/dist/layouts/App/create-api-client-app.d.ts +30 -40
  29. package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
  30. package/dist/layouts/Modal/ApiClientModal.vue.js +2 -2
  31. package/dist/layouts/Modal/ApiClientModal.vue2.js +5 -5
  32. package/dist/layouts/Modal/create-api-client-modal.d.ts +60 -80
  33. package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
  34. package/dist/layouts/Web/create-api-client-web.d.ts +30 -40
  35. package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
  36. package/dist/libs/create-client.d.ts +30 -40
  37. package/dist/libs/create-client.d.ts.map +1 -1
  38. package/dist/store/active-entities.d.ts +6 -8
  39. package/dist/store/active-entities.d.ts.map +1 -1
  40. package/dist/store/servers.d.ts +30 -40
  41. package/dist/store/servers.d.ts.map +1 -1
  42. package/dist/store/store.d.ts +30 -40
  43. package/dist/store/store.d.ts.map +1 -1
  44. package/dist/style.css +1 -1
  45. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts +0 -1
  46. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts.map +1 -1
  47. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.js +40 -42
  48. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts +1 -1
  49. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts.map +1 -1
  50. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +2 -2
  51. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +72 -72
  52. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.d.ts +1 -2
  53. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.d.ts.map +1 -1
  54. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.js +3 -3
  55. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue2.js +18 -17
  56. package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue.d.ts +1 -1
  57. package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue.d.ts.map +1 -1
  58. package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue.js +1 -1
  59. package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue2.js +12 -11
  60. package/dist/views/Request/RequestSection/RequestSection.vue.d.ts.map +1 -1
  61. package/dist/views/Request/RequestSection/RequestSection.vue.js +1 -1
  62. package/dist/views/Request/RequestSection/RequestSection.vue2.js +1 -0
  63. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  64. package/dist/views/Servers/index.d.ts +2 -0
  65. package/dist/views/Servers/index.d.ts.map +1 -0
  66. package/dist/views/Servers/index.js +4 -0
  67. package/dist/views/Settings/SettingsGeneral.vue.d.ts.map +1 -1
  68. package/dist/views/Settings/SettingsGeneral.vue.js +196 -160
  69. package/dist/views/Settings/components/SettingsAppearance.vue.d.ts.map +1 -1
  70. package/dist/views/Settings/components/SettingsAppearance.vue.js +50 -39
  71. package/package.json +21 -11
  72. package/dist/components/AddressBar/AddressBarServer.vue.d.ts.map +0 -1
  73. package/dist/components/AddressBar/AddressBarServer.vue.js +0 -123
  74. package/dist/components/AddressBar/AddressBarServer.vue2.js +0 -4
  75. package/dist/components/AddressBar/AddressBarServerItem.vue.d.ts +0 -10
  76. package/dist/components/AddressBar/AddressBarServerItem.vue.d.ts.map +0 -1
  77. package/dist/components/AddressBar/AddressBarServerItem.vue.js +0 -7
  78. package/dist/components/AddressBar/AddressBarServerItem.vue2.js +0 -77
@@ -1,67 +1,78 @@
1
- import { defineComponent as k, openBlock as o, createElementBlock as x, createVNode as l, unref as e, normalizeClass as n, withCtx as d, createElementVNode as i, createBlock as a, createCommentVNode as c, createTextVNode as f } from "vue";
2
- import { ScalarButton as u, ScalarIcon as m } from "@scalar/components";
3
- import { useColorMode as b } from "@scalar/use-hooks/useColorMode";
4
- const g = { class: "flex flex-col gap-2" }, y = { class: "flex items-center justify-center w-5 h-5 rounded-full border-[1.5px] p-1" }, w = { class: "flex items-center justify-center w-5 h-5 rounded-full border-[1.5px] p-1" }, C = { class: "flex items-center justify-center w-5 h-5 rounded-full border-[1.5px] p-1" }, z = /* @__PURE__ */ k({
1
+ import { defineComponent as b, openBlock as o, createElementBlock as y, createVNode as l, unref as e, normalizeClass as s, withCtx as c, createElementVNode as i, createBlock as d, createCommentVNode as u, createTextVNode as f } from "vue";
2
+ import { cva as g, ScalarButton as m, cx as p, ScalarIcon as k } from "@scalar/components";
3
+ import { useColorMode as v } from "@scalar/use-hooks/useColorMode";
4
+ const C = { class: "flex flex-col gap-2" }, z = /* @__PURE__ */ b({
5
5
  __name: "SettingsAppearance",
6
6
  setup(h) {
7
- const { colorMode: s, setColorMode: r } = b();
8
- return (v, t) => (o(), x("div", g, [
9
- l(e(u), {
10
- class: n([
11
- "w-full shadow-none text-c-1 justify-start pl-2 gap-2 border-1/2",
12
- e(s) === "system" ? "bg-b-2 text-c-1" : "bg-b-1"
13
- ]),
14
- onClick: t[0] || (t[0] = (p) => e(r)("system"))
7
+ const { colorMode: r, setColorMode: n } = v(), a = g({
8
+ base: "w-full shadow-none text-c-1 justify-start pl-2 gap-2 border-1/2",
9
+ variants: {
10
+ active: {
11
+ true: "bg-primary text-c-1 hover:bg-inherit",
12
+ false: "bg-b-1"
13
+ }
14
+ }
15
+ });
16
+ return (w, t) => (o(), y("div", C, [
17
+ l(e(m), {
18
+ class: s(e(p)(e(a)({ active: e(r) === "system" }))),
19
+ onClick: t[0] || (t[0] = (x) => e(n)("system"))
15
20
  }, {
16
- default: d(() => [
17
- i("div", y, [
18
- e(s) === "system" ? (o(), a(e(m), {
21
+ default: c(() => [
22
+ i("div", {
23
+ class: s(["flex items-center justify-center w-5 h-5 rounded-full border-[1.5px] p-1", {
24
+ "bg-c-accent border-transparent text-b-1": e(r) === "system"
25
+ }])
26
+ }, [
27
+ e(r) === "system" ? (o(), d(e(k), {
19
28
  key: 0,
20
29
  icon: "Checkmark",
21
30
  size: "xs",
22
31
  thickness: "3.5"
23
- })) : c("", !0)
24
- ]),
32
+ })) : u("", !0)
33
+ ], 2),
25
34
  t[3] || (t[3] = f(" System Preference (default) "))
26
35
  ]),
27
36
  _: 1
28
37
  }, 8, ["class"]),
29
- l(e(u), {
30
- class: n([
31
- "w-full shadow-none text-c-1 justify-start pl-2 gap-2 border-1/2",
32
- e(s) === "light" ? "bg-b-2 text-c-1" : "bg-b-1"
33
- ]),
34
- onClick: t[1] || (t[1] = (p) => e(r)("light"))
38
+ l(e(m), {
39
+ class: s(e(p)(e(a)({ active: e(r) === "light" }))),
40
+ onClick: t[1] || (t[1] = (x) => e(n)("light"))
35
41
  }, {
36
- default: d(() => [
37
- i("div", w, [
38
- e(s) === "light" ? (o(), a(e(m), {
42
+ default: c(() => [
43
+ i("div", {
44
+ class: s(["flex items-center justify-center w-5 h-5 rounded-full border-[1.5px] p-1", {
45
+ "bg-c-accent border-transparent text-b-1": e(r) === "light"
46
+ }])
47
+ }, [
48
+ e(r) === "light" ? (o(), d(e(k), {
39
49
  key: 0,
40
50
  icon: "Checkmark",
41
51
  size: "xs",
42
52
  thickness: "3.5"
43
- })) : c("", !0)
44
- ]),
53
+ })) : u("", !0)
54
+ ], 2),
45
55
  t[4] || (t[4] = f(" Light Mode Always "))
46
56
  ]),
47
57
  _: 1
48
58
  }, 8, ["class"]),
49
- l(e(u), {
50
- class: n([
51
- "w-full shadow-none text-c-1 justify-start pl-2 gap-2 mb-8 border-1/2",
52
- e(s) === "dark" ? "bg-b-2 text-c-1" : "bg-b-1"
53
- ]),
54
- onClick: t[2] || (t[2] = (p) => e(r)("dark"))
59
+ l(e(m), {
60
+ class: s(e(p)(e(a)({ active: e(r) === "dark" }))),
61
+ onClick: t[2] || (t[2] = (x) => e(n)("dark"))
55
62
  }, {
56
- default: d(() => [
57
- i("div", C, [
58
- e(s) === "dark" ? (o(), a(e(m), {
63
+ default: c(() => [
64
+ i("div", {
65
+ class: s(["flex items-center justify-center w-5 h-5 rounded-full border-[1.5px] p-1", {
66
+ "bg-c-accent border-transparent text-b-1": e(r) === "dark"
67
+ }])
68
+ }, [
69
+ e(r) === "dark" ? (o(), d(e(k), {
59
70
  key: 0,
60
71
  icon: "Checkmark",
61
72
  size: "xs",
62
73
  thickness: "3.5"
63
- })) : c("", !0)
64
- ]),
74
+ })) : u("", !0)
75
+ ], 2),
65
76
  t[5] || (t[5] = f(" Dark Mode Always "))
66
77
  ]),
67
78
  _: 1
package/package.json CHANGED
@@ -18,7 +18,7 @@
18
18
  "rest",
19
19
  "testing"
20
20
  ],
21
- "version": "2.2.40",
21
+ "version": "2.2.42",
22
22
  "engines": {
23
23
  "node": ">=18"
24
24
  },
@@ -30,6 +30,11 @@
30
30
  "types": "./dist/index.d.ts",
31
31
  "default": "./dist/index.js"
32
32
  },
33
+ "./views/Servers": {
34
+ "import": "./dist/views/Servers/index.js",
35
+ "types": "./dist/views/Servers/index.d.ts",
36
+ "default": "./dist/views/Servers/index.js"
37
+ },
33
38
  "./views/Request/types": {
34
39
  "import": "./dist/views/Request/types/index.js",
35
40
  "types": "./dist/views/Request/types/index.d.ts",
@@ -120,6 +125,11 @@
120
125
  "types": "./dist/components/Sidebar/index.d.ts",
121
126
  "default": "./dist/components/Sidebar/index.js"
122
127
  },
128
+ "./components/Server": {
129
+ "import": "./dist/components/Server/index.js",
130
+ "types": "./dist/components/Server/index.d.ts",
131
+ "default": "./dist/components/Server/index.js"
132
+ },
123
133
  "./components/ImportCollection": {
124
134
  "import": "./dist/components/ImportCollection/index.js",
125
135
  "types": "./dist/components/ImportCollection/index.d.ts",
@@ -179,20 +189,20 @@
179
189
  "yaml": "^2.4.5",
180
190
  "zod": "^3.23.8",
181
191
  "@scalar/draggable": "0.1.8",
182
- "@scalar/components": "0.13.17",
192
+ "@scalar/components": "0.13.18",
183
193
  "@scalar/icons": "0.1.2",
184
- "@scalar/oas-utils": "0.2.100",
185
- "@scalar/import": "0.2.20",
194
+ "@scalar/import": "0.2.21",
186
195
  "@scalar/object-utils": "1.1.12",
196
+ "@scalar/oas-utils": "0.2.101",
187
197
  "@scalar/openapi-parser": "0.10.4",
188
- "@scalar/postman-to-openapi": "0.1.23",
189
198
  "@scalar/openapi-types": "0.1.6",
190
- "@scalar/themes": "0.9.62",
191
- "@scalar/types": "0.0.28",
192
- "@scalar/use-codemirror": "0.11.62",
193
- "@scalar/use-hooks": "0.1.16",
194
- "@scalar/use-toasts": "0.7.8",
195
- "@scalar/use-tooltip": "1.0.5"
199
+ "@scalar/themes": "0.9.63",
200
+ "@scalar/postman-to-openapi": "0.1.24",
201
+ "@scalar/types": "0.0.29",
202
+ "@scalar/use-codemirror": "0.11.63",
203
+ "@scalar/use-hooks": "0.1.17",
204
+ "@scalar/use-tooltip": "1.0.5",
205
+ "@scalar/use-toasts": "0.7.8"
196
206
  },
197
207
  "devDependencies": {
198
208
  "@types/shell-quote": "^1.7.5",
@@ -1 +0,0 @@
1
- {"version":3,"file":"AddressBarServer.vue.d.ts","sourceRoot":"","sources":["../../../src/components/AddressBar/AddressBarServer.vue"],"names":[],"mappings":"AAmJA,KAAK,WAAW,GAAG;IACjB,qEAAqE;IACrE,MAAM,EAAE,MAAM,CAAA;CACf,CAAC;;AAoOF,wBAOG"}
@@ -1,123 +0,0 @@
1
- import { defineComponent as D, computed as n, watch as U, openBlock as s, createBlock as v, unref as l, withCtx as i, createElementVNode as a, createElementBlock as c, Fragment as m, renderList as b, createVNode as d, createCommentVNode as k, createTextVNode as V, toDisplayString as z } from "vue";
2
- import { useActiveEntities as E } from "../../store/active-entities.js";
3
- import { ScalarPopover as L, ScalarDropdownDivider as W, ScalarIcon as F, ScalarFloatingBackdrop as I, ScalarButton as O } from "@scalar/components";
4
- import y from "./AddressBarServerItem.vue.js";
5
- import { useWorkspace as P } from "../../store/store.js";
6
- import { useLayout as T } from "../../hooks/useLayout.js";
7
- const j = { class: "custom-scroll flex border-t p-1 flex-col gap-1 max-h-[inherit]" }, M = { class: "flex items-center justify-center h-4 w-4" }, X = /* @__PURE__ */ D({
8
- __name: "AddressBarServer",
9
- props: {
10
- target: {}
11
- },
12
- setup(R) {
13
- const { activeRequest: u, activeCollection: f, activeServer: p } = E(), { servers: x, collectionMutators: w, events: A } = P(), { layout: B } = T(), S = n(
14
- () => {
15
- var t, e;
16
- return (e = (t = u.value) == null ? void 0 : t.servers) == null ? void 0 : e.map((r) => {
17
- var o;
18
- return {
19
- id: r,
20
- label: ((o = x[r]) == null ? void 0 : o.url) ?? "Unknown server"
21
- };
22
- });
23
- }
24
- ), g = n(
25
- () => {
26
- var t, e;
27
- return (
28
- // Filters out servers already present in the request
29
- (e = (t = f.value) == null ? void 0 : t.servers) == null ? void 0 : e.filter(
30
- (r) => {
31
- var o, h;
32
- return !((h = (o = u.value) == null ? void 0 : o.servers) != null && h.includes(r));
33
- }
34
- ).map((r) => {
35
- var o;
36
- return {
37
- id: r,
38
- label: ((o = x[r]) == null ? void 0 : o.url) ?? "Unknown server"
39
- };
40
- })
41
- );
42
- }
43
- ), C = n(
44
- () => {
45
- var t, e;
46
- return ((t = S.value) == null ? void 0 : t.length) && ((e = g.value) == null ? void 0 : e.length);
47
- }
48
- );
49
- U([f, u], ([t, e]) => {
50
- var o;
51
- if (!t || t.selectedServerUid || e != null && e.selectedServerUid)
52
- return;
53
- const r = (o = t.servers) == null ? void 0 : o[0];
54
- r && w.edit(t.uid, "selectedServerUid", r);
55
- });
56
- const _ = () => A.commandPalette.emit({
57
- commandName: "Add Server"
58
- }), N = n(() => {
59
- var t, e, r;
60
- return (e = (t = p.value) == null ? void 0 : t.url) != null && e.endsWith("/") ? p.value.url.slice(0, -1) : ((r = p.value) == null ? void 0 : r.url) || "";
61
- });
62
- return (t, e) => (s(), v(l(L), {
63
- class: "max-h-[inherit] p-0 text-sm",
64
- offset: 0,
65
- placement: "bottom-start",
66
- resize: "",
67
- target: t.target,
68
- teleport: `#${t.target}`
69
- }, {
70
- popover: i(() => [
71
- a("div", j, [
72
- (s(!0), c(m, null, b(S.value, (r) => (s(), v(y, {
73
- key: r.id,
74
- serverOption: r,
75
- type: "request"
76
- }, null, 8, ["serverOption"]))), 128)),
77
- C.value ? (s(), c(m, { key: 0 }, [
78
- d(l(W)),
79
- e[1] || (e[1] = a("div", { class: "text-xxs text-c-2 px-2.5 py-1" }, "Collection", -1))
80
- ], 64)) : k("", !0),
81
- (s(!0), c(m, null, b(g.value, (r) => (s(), v(y, {
82
- key: r.id,
83
- serverOption: r,
84
- type: "collection"
85
- }, null, 8, ["serverOption"]))), 128)),
86
- l(B) !== "modal" ? (s(), c("button", {
87
- key: 1,
88
- class: "rounded text-xxs flex items-center gap-1.5 p-1.75 hover:bg-b-2 cursor-pointer",
89
- type: "button",
90
- onClick: _
91
- }, [
92
- a("div", M, [
93
- d(l(F), {
94
- icon: "Add",
95
- size: "sm"
96
- })
97
- ]),
98
- e[2] || (e[2] = a("span", null, "Add Server", -1))
99
- ])) : k("", !0)
100
- ])
101
- ]),
102
- backdrop: i(() => [
103
- d(l(I), { class: "-top-[--scalar-address-bar-height] rounded-lg" })
104
- ]),
105
- default: i(() => [
106
- d(l(O), {
107
- class: "font-code z-context-plus lg:text-sm text-xs whitespace-nowrap border ml-0.75 rounded px-1.5 h-6.5 text-c-2 hover:bg-b-2",
108
- variant: "ghost"
109
- }, {
110
- default: i(() => [
111
- e[0] || (e[0] = a("span", { class: "sr-only" }, "Server:", -1)),
112
- V(" " + z(N.value), 1)
113
- ]),
114
- _: 1
115
- })
116
- ]),
117
- _: 1
118
- }, 8, ["target", "teleport"]));
119
- }
120
- });
121
- export {
122
- X as default
123
- };
@@ -1,4 +0,0 @@
1
- import f from "./AddressBarServer.vue.js";
2
- export {
3
- f as default
4
- };
@@ -1,10 +0,0 @@
1
- type __VLS_Props = {
2
- serverOption: {
3
- id: string;
4
- label: string;
5
- };
6
- type: 'collection' | 'request';
7
- };
8
- declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, HTMLDivElement>;
9
- export default _default;
10
- //# sourceMappingURL=AddressBarServerItem.vue.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AddressBarServerItem.vue.d.ts","sourceRoot":"","sources":["../../../src/components/AddressBar/AddressBarServerItem.vue"],"names":[],"mappings":"AAkHA,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAA;IAC3C,IAAI,EAAE,YAAY,GAAG,SAAS,CAAA;CAC/B,CAAC;;AA4LF,wBAOG"}
@@ -1,7 +0,0 @@
1
- import r from "./AddressBarServerItem.vue2.js";
2
- /* empty css */
3
- import o from "../../_virtual/_plugin-vue_export-helper.js";
4
- const s = /* @__PURE__ */ o(r, [["__scopeId", "data-v-7b0b0967"]]);
5
- export {
6
- s as default
7
- };
@@ -1,77 +0,0 @@
1
- import { defineComponent as M, useId as O, computed as d, openBlock as c, createElementBlock as v, normalizeClass as h, createElementVNode as u, unref as i, withModifiers as V, createVNode as p, toDisplayString as E, createCommentVNode as _ } from "vue";
2
- import q from "../Server/ServerVariablesForm.vue.js";
3
- import { useActiveEntities as B } from "../../store/active-entities.js";
4
- import { ScalarListboxCheckbox as I, ScalarMarkdown as N } from "@scalar/components";
5
- import { useWorkspace as U } from "../../store/store.js";
6
- const A = ["aria-controls", "aria-expanded"], $ = { class: "whitespace-nowrap text-ellipsis overflow-hidden" }, j = ["id"], z = { key: 0 }, D = { class: "description px-3 py-1.5 text-c-3" }, J = /* @__PURE__ */ M({
7
- __name: "AddressBarServerItem",
8
- props: {
9
- serverOption: {},
10
- type: {}
11
- },
12
- setup(x) {
13
- const l = x, b = O(), { activeCollection: m, activeRequest: s, activeServer: t } = B(), { collectionMutators: S, requestMutators: y, serverMutators: g } = U(), k = (e) => {
14
- var a, r;
15
- l.type === "collection" && m.value ? ((r = (a = s.value) == null ? void 0 : a.servers) != null && r.length && (s.value.selectedServerUid = ""), S.edit(
16
- m.value.uid,
17
- "selectedServerUid",
18
- e
19
- )) : l.type === "request" && s.value && y.edit(
20
- s.value.uid,
21
- "selectedServerUid",
22
- e
23
- );
24
- }, o = d(
25
- () => {
26
- var e;
27
- return ((e = t.value) == null ? void 0 : e.uid) === l.serverOption.id;
28
- }
29
- ), C = d(
30
- () => {
31
- var e;
32
- return ((e = t.value) == null ? void 0 : e.variables) && Object.keys(t.value.variables).length > 0;
33
- }
34
- ), n = d(() => o.value && C.value), w = (e, a) => {
35
- if (!t.value) return;
36
- const r = t.value.variables || {};
37
- r[e] = { ...r[e], default: a }, g.edit(t.value.uid, "variables", r);
38
- };
39
- return (e, a) => {
40
- var r, f;
41
- return c(), v("div", {
42
- class: h(["min-h-fit rounded flex flex-col border group/item", { "border-transparent": !o.value }])
43
- }, [
44
- u("button", {
45
- "aria-controls": n.value ? i(b) : void 0,
46
- "aria-expanded": n.value,
47
- class: h(["cursor-pointer rounded flex items-center gap-1.5 min-h-8 px-1.5", o.value ? "text-c-1 bg-b-2" : "hover:bg-b-2"]),
48
- type: "button",
49
- onClick: a[0] || (a[0] = V((L) => k(e.serverOption.id), ["stop"]))
50
- }, [
51
- p(i(I), { selected: o.value }, null, 8, ["selected"]),
52
- u("span", $, E(e.serverOption.label), 1)
53
- ], 10, A),
54
- n.value ? (c(), v("div", {
55
- key: 0,
56
- id: i(b),
57
- class: "bg-b-2 border-t divide divide-y *:pl-4 rounded-b"
58
- }, [
59
- p(q, {
60
- variables: (r = i(t)) == null ? void 0 : r.variables,
61
- "onUpdate:variable": w
62
- }, null, 8, ["variables"]),
63
- (f = i(t)) != null && f.description ? (c(), v("div", z, [
64
- u("div", D, [
65
- p(i(N), {
66
- value: i(t).description
67
- }, null, 8, ["value"])
68
- ])
69
- ])) : _("", !0)
70
- ], 8, j)) : _("", !0)
71
- ], 2);
72
- };
73
- }
74
- });
75
- export {
76
- J as default
77
- };