@scalar/api-client 2.3.34 → 2.4.1

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 (94) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/dist/components/CodeInput/CodeInput.vue.js +2 -2
  3. package/dist/components/CodeInput/CodeInput.vue2.js +1 -1
  4. package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts.map +1 -1
  5. package/dist/components/CommandPalette/CommandPaletteImport.vue.js +74 -89
  6. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts +4 -0
  7. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -1
  8. package/dist/components/Server/ServerVariablesForm.vue.d.ts +2 -0
  9. package/dist/components/Server/ServerVariablesForm.vue.d.ts.map +1 -1
  10. package/dist/components/Server/ServerVariablesForm.vue.js +19 -18
  11. package/dist/components/TopNav/TopNavItem.vue.d.ts.map +1 -1
  12. package/dist/components/TopNav/TopNavItem.vue.js +3 -3
  13. package/dist/components/TopNav/TopNavItem.vue2.js +46 -54
  14. package/dist/components/ViewLayout/ViewLayoutCollapse.vue.js +1 -1
  15. package/dist/hooks/useClientConfig.d.ts +72 -6
  16. package/dist/hooks/useClientConfig.d.ts.map +1 -1
  17. package/dist/layouts/App/ApiClientApp.vue.d.ts +1 -1
  18. package/dist/layouts/App/ApiClientApp.vue.d.ts.map +1 -1
  19. package/dist/layouts/App/ApiClientApp.vue.js +45 -40
  20. package/dist/layouts/App/create-api-client-app.d.ts +72 -52
  21. package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
  22. package/dist/layouts/Modal/create-api-client-modal.d.ts +144 -104
  23. package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
  24. package/dist/layouts/Web/ApiClientWeb.vue.d.ts.map +1 -1
  25. package/dist/layouts/Web/ApiClientWeb.vue.js +49 -44
  26. package/dist/layouts/Web/create-api-client-web.d.ts +72 -52
  27. package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
  28. package/dist/libs/create-client.d.ts +72 -52
  29. package/dist/libs/create-client.d.ts.map +1 -1
  30. package/dist/libs/create-client.js +53 -49
  31. package/dist/libs/electron.d.ts +5 -0
  32. package/dist/libs/electron.d.ts.map +1 -0
  33. package/dist/libs/electron.js +4 -0
  34. package/dist/libs/find-request.d.ts +2 -0
  35. package/dist/libs/find-request.d.ts.map +1 -1
  36. package/dist/libs/send-request/create-fetch-query-params.d.ts +10 -3
  37. package/dist/libs/send-request/create-fetch-query-params.d.ts.map +1 -1
  38. package/dist/libs/send-request/create-fetch-query-params.js +28 -6
  39. package/dist/libs/send-request/create-request-operation.d.ts +3 -1
  40. package/dist/libs/send-request/create-request-operation.d.ts.map +1 -1
  41. package/dist/libs/send-request/create-request-operation.js +91 -87
  42. package/dist/libs/send-request/create-request-operation.test.d.ts +2 -0
  43. package/dist/libs/send-request/create-request-operation.test.d.ts.map +1 -1
  44. package/dist/plugins/hooks/usePluginManager.d.ts +8 -0
  45. package/dist/plugins/hooks/usePluginManager.d.ts.map +1 -0
  46. package/dist/plugins/hooks/usePluginManager.js +10 -0
  47. package/dist/plugins/index.d.ts +3 -0
  48. package/dist/plugins/index.d.ts.map +1 -0
  49. package/dist/plugins/index.js +7 -0
  50. package/dist/plugins/plugin-manager.d.ts +28 -0
  51. package/dist/plugins/plugin-manager.d.ts.map +1 -0
  52. package/dist/plugins/plugin-manager.js +24 -0
  53. package/dist/store/active-entities.d.ts +2 -0
  54. package/dist/store/active-entities.d.ts.map +1 -1
  55. package/dist/store/collections.d.ts +4 -4
  56. package/dist/store/cookies.d.ts +4 -4
  57. package/dist/store/environment.d.ts +4 -4
  58. package/dist/store/request-example.d.ts +4 -4
  59. package/dist/store/requests.d.ts +26 -4
  60. package/dist/store/requests.d.ts.map +1 -1
  61. package/dist/store/security-schemes.d.ts +24 -24
  62. package/dist/store/store.d.ts +72 -52
  63. package/dist/store/store.d.ts.map +1 -1
  64. package/dist/store/tags.d.ts +4 -4
  65. package/dist/store/workspace.d.ts +4 -4
  66. package/dist/style.css +1 -1
  67. package/dist/views/Request/Request.vue.d.ts.map +1 -1
  68. package/dist/views/Request/Request.vue.js +2 -2
  69. package/dist/views/Request/RequestRoot.vue.d.ts.map +1 -1
  70. package/dist/views/Request/RequestRoot.vue.js +1 -1
  71. package/dist/views/Request/RequestRoot.vue2.js +47 -45
  72. package/dist/views/Request/RequestSection/RequestParams.vue.d.ts.map +1 -1
  73. package/dist/views/Request/RequestSection/RequestParams.vue.js +61 -70
  74. package/dist/views/Request/RequestSection/RequestSection.vue.d.ts.map +1 -1
  75. package/dist/views/Request/RequestSection/RequestSection.vue.js +2 -2
  76. package/dist/views/Request/RequestSection/RequestSection.vue2.js +92 -77
  77. package/dist/views/Request/RequestSection/RequestTable.vue.d.ts.map +1 -1
  78. package/dist/views/Request/RequestSection/RequestTable.vue.js +4 -4
  79. package/dist/views/Request/RequestSection/RequestTable.vue2.js +59 -65
  80. package/dist/views/Request/RequestSection/RequestTableTooltip.vue.d.ts.map +1 -1
  81. package/dist/views/Request/RequestSection/RequestTableTooltip.vue.js +1 -1
  82. package/dist/views/Request/RequestSection/RequestTableTooltip.vue2.js +34 -35
  83. package/dist/views/Request/RequestSection/types/post-response.d.ts +7 -0
  84. package/dist/views/Request/RequestSection/types/post-response.d.ts.map +1 -0
  85. package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
  86. package/dist/views/Request/RequestSidebarItem.vue.js +3 -3
  87. package/dist/views/Request/RequestSidebarItem.vue2.js +132 -134
  88. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  89. package/dist/views/Request/ResponseSection/ResponseSection.vue.d.ts.map +1 -1
  90. package/dist/views/Request/ResponseSection/ResponseSection.vue.js +1 -1
  91. package/dist/views/Request/ResponseSection/ResponseSection.vue2.js +82 -70
  92. package/dist/views/Request/components/WorkspaceDropdown.vue.d.ts.map +1 -1
  93. package/dist/views/Request/components/WorkspaceDropdown.vue.js +80 -114
  94. package/package.json +25 -20
@@ -1,17 +1,19 @@
1
- import { defineComponent as C, computed as c, ref as T, useId as w, createBlock as t, openBlock as n, withCtx as v, createElementVNode as u, normalizeClass as y, createElementBlock as k, createVNode as h, Fragment as b, createCommentVNode as d } from "vue";
2
- import x from "../../../components/SectionFilter.vue.js";
3
- import V from "../../../components/ViewLayout/ViewLayoutSection.vue.js";
4
- import I from "./RequestHeaders.vue.js";
5
- import $ from "./ResponseBody.vue.js";
6
- import g from "./ResponseBodyStreaming.vue.js";
7
- import z from "./ResponseBodyVirtual.vue.js";
1
+ import { defineComponent as j, computed as c, ref as w, useId as T, createBlock as l, openBlock as a, withCtx as v, createElementVNode as m, normalizeClass as b, createElementBlock as y, createVNode as A, Fragment as k, createCommentVNode as d, renderList as x, unref as B, withDirectives as I, resolveDynamicComponent as S, mergeProps as $, vShow as E } from "vue";
2
+ import { ScalarErrorBoundary as z } from "@scalar/components";
3
+ import O from "../../../components/SectionFilter.vue.js";
4
+ import L from "../../../components/ViewLayout/ViewLayoutSection.vue.js";
5
+ import M from "./RequestHeaders.vue.js";
6
+ import N from "./ResponseBody.vue.js";
7
+ import W from "./ResponseBodyStreaming.vue.js";
8
+ import D from "./ResponseBodyVirtual.vue.js";
8
9
  /* empty css */
9
- import E from "./ResponseCookies.vue.js";
10
- import O from "./ResponseEmpty.vue.js";
11
- import N from "./ResponseHeaders.vue.js";
12
- import S from "./ResponseLoadingOverlay.vue.js";
13
- import W from "./ResponseMetaInformation.vue.js";
14
- const F = { class: "flex h-8 flex-1 items-center" }, L = ["id", "role"], A = 2e5, se = /* @__PURE__ */ C({
10
+ import F from "./ResponseCookies.vue.js";
11
+ import P from "./ResponseEmpty.vue.js";
12
+ import U from "./ResponseHeaders.vue.js";
13
+ import K from "./ResponseLoadingOverlay.vue.js";
14
+ import Z from "./ResponseMetaInformation.vue.js";
15
+ import { usePluginManager as G } from "../../../plugins/hooks/usePluginManager.js";
16
+ const J = { class: "flex h-8 flex-1 items-center" }, Q = ["id", "role"], g = 2e5, me = /* @__PURE__ */ j({
15
17
  __name: "ResponseSection",
16
18
  props: {
17
19
  collection: {},
@@ -21,38 +23,38 @@ const F = { class: "flex h-8 flex-1 items-center" }, L = ["id", "role"], A = 2e5
21
23
  response: {},
22
24
  requestResult: {}
23
25
  },
24
- setup(l) {
25
- const m = c(() => {
26
+ setup(r) {
27
+ const R = G().getViewComponents("response.section"), f = c(() => {
26
28
  var o;
27
- const e = (o = l.response) == null ? void 0 : o.headers;
28
- return e ? Object.keys(e).map((a) => ({
29
- name: a,
30
- value: e[a] ?? "",
29
+ const e = (o = r.response) == null ? void 0 : o.headers;
30
+ return e ? Object.keys(e).map((n) => ({
31
+ name: n,
32
+ value: e[n] ?? "",
31
33
  required: !1
32
34
  })) : [];
33
- }), B = c(
35
+ }), q = c(
34
36
  () => {
35
37
  var e;
36
- return ((e = l.response) == null ? void 0 : e.cookieHeaderKeys.flatMap((o) => {
38
+ return ((e = r.response) == null ? void 0 : e.cookieHeaderKeys.flatMap((o) => {
37
39
  var i, p;
38
- const a = (p = (i = l.response) == null ? void 0 : i.headers) == null ? void 0 : p[o];
39
- return a ? {
40
+ const n = (p = (i = r.response) == null ? void 0 : i.headers) == null ? void 0 : p[o];
41
+ return n ? {
40
42
  name: o,
41
- value: a,
43
+ value: n,
42
44
  required: !1
43
45
  } : [];
44
46
  })) ?? [];
45
47
  }
46
- ), R = ["Cookies", "Headers", "Body"], s = T("All"), f = c(() => ["All", ...R]), r = c(
48
+ ), C = ["Cookies", "Headers", "Body"], s = w("All"), h = c(() => ["All", ...C]), t = c(
47
49
  () => Object.fromEntries(
48
- f.value.map((e) => [e, w()])
50
+ h.value.map((e) => [e, T()])
49
51
  )
50
- ), q = c(() => {
52
+ ), H = c(() => {
51
53
  var i, p;
52
- if (!l.response || !("size" in l.response))
54
+ if (!r.response || !("size" in r.response))
53
55
  return !1;
54
- const e = ((i = l.response.headers) == null ? void 0 : i["content-type"]) || ((p = l.response.headers) == null ? void 0 : p["Content-Type"]);
55
- return !e || (l.response.size ?? 0) <= A || e.includes("text/html") ? !1 : [
56
+ const e = ((i = r.response.headers) == null ? void 0 : i["content-type"]) || ((p = r.response.headers) == null ? void 0 : p["Content-Type"]);
57
+ return !e || (r.response.size ?? 0) <= g || e.includes("text/html") ? !1 : [
56
58
  // Text types
57
59
  "text/",
58
60
  // JSON types
@@ -79,105 +81,115 @@ const F = { class: "flex h-8 flex-1 items-center" }, L = ["id", "role"], A = 2e5
79
81
  "application/x-java-source",
80
82
  // Form data
81
83
  "application/x-www-form-urlencoded"
82
- ].some((j) => e.includes(j)) && (l.response.size ?? 0) > A;
83
- }), H = c(
84
+ ].some((u) => e.includes(u)) && (r.response.size ?? 0) > g;
85
+ }), V = c(
84
86
  () => {
85
87
  var e;
86
- return ((e = l.requestResult) == null ? void 0 : e.request.parameters.headers.filter((o) => o.enabled).map((o) => ({
88
+ return ((e = r.requestResult) == null ? void 0 : e.request.parameters.headers.filter((o) => o.enabled).map((o) => ({
87
89
  name: o.key,
88
90
  value: o.value,
89
91
  required: !0
90
92
  }))) ?? [];
91
93
  }
92
94
  );
93
- return (e, o) => (n(), t(V, { "aria-label": "Response" }, {
95
+ return (e, o) => (a(), l(L, { "aria-label": "Response" }, {
94
96
  title: v(() => [
95
- u("div", F, [
96
- u("div", {
97
+ m("div", J, [
98
+ m("div", {
97
99
  "aria-live": "polite",
98
- class: y(["flex items-center", { "animate-response-heading": e.response }])
100
+ class: b(["flex items-center", { "animate-response-heading": e.response }])
99
101
  }, [
100
- o[1] || (o[1] = u("span", { class: "response-heading pointer-events-none absolute" }, " Response ", -1)),
101
- e.response ? (n(), t(W, {
102
+ o[1] || (o[1] = m("span", { class: "response-heading pointer-events-none absolute" }, " Response ", -1)),
103
+ e.response ? (a(), l(Z, {
102
104
  key: 0,
103
105
  class: "animate-response-children",
104
106
  response: e.response
105
107
  }, null, 8, ["response"])) : d("", !0)
106
108
  ], 2),
107
- h(x, {
109
+ A(O, {
108
110
  modelValue: s.value,
109
- "onUpdate:modelValue": o[0] || (o[0] = (a) => s.value = a),
110
- filterIds: r.value,
111
- filters: f.value
111
+ "onUpdate:modelValue": o[0] || (o[0] = (n) => s.value = n),
112
+ filterIds: t.value,
113
+ filters: h.value
112
114
  }, null, 8, ["modelValue", "filterIds", "filters"])
113
115
  ])
114
116
  ]),
115
117
  default: v(() => {
116
- var a, i, p;
118
+ var n, i, p;
117
119
  return [
118
- u("div", {
119
- id: r.value.All,
120
- class: y(["custom-scroll response-section-content relative grid h-full justify-stretch", {
120
+ m("div", {
121
+ id: t.value.All,
122
+ class: b(["custom-scroll response-section-content relative grid h-full justify-stretch", {
121
123
  "content-start": e.response
122
124
  }]),
123
125
  role: s.value === "All" && e.response ? "tabpanel" : "none"
124
126
  }, [
125
- e.response ? (n(), k(b, { key: 1 }, [
126
- s.value === "All" || s.value === "Cookies" ? (n(), t(E, {
127
+ e.response ? (a(), y(k, { key: 1 }, [
128
+ s.value === "All" || s.value === "Cookies" ? (a(), l(F, {
127
129
  key: 0,
128
130
  class: "response-section-content-cookies",
129
- id: r.value.Cookies,
130
- cookies: B.value,
131
+ id: t.value.Cookies,
132
+ cookies: q.value,
131
133
  role: s.value === "All" ? "none" : "tabpanel"
132
134
  }, null, 8, ["id", "cookies", "role"])) : d("", !0),
133
- s.value === "All" || s.value === "Headers" ? (n(), t(I, {
135
+ s.value === "All" || s.value === "Headers" ? (a(), l(M, {
134
136
  key: 1,
135
137
  class: "response-section-content-headers",
136
- id: r.value.Headers,
137
- headers: H.value,
138
+ id: t.value.Headers,
139
+ headers: V.value,
138
140
  role: s.value === "All" ? "none" : "tabpanel"
139
141
  }, null, 8, ["id", "headers", "role"])) : d("", !0),
140
- s.value === "All" || s.value === "Headers" ? (n(), t(N, {
142
+ s.value === "All" || s.value === "Headers" ? (a(), l(U, {
141
143
  key: 2,
142
144
  class: "response-section-content-headers",
143
- id: r.value.Headers,
144
- headers: m.value,
145
+ id: t.value.Headers,
146
+ headers: f.value,
145
147
  role: s.value === "All" ? "none" : "tabpanel"
146
148
  }, null, 8, ["id", "headers", "role"])) : d("", !0),
147
- s.value === "All" || s.value === "Body" ? (n(), k(b, { key: 3 }, [
148
- "reader" in e.response ? (n(), t(g, {
149
+ (a(!0), y(k, null, x(B(R), (u) => (a(), l(B(z), {
150
+ key: u.component
151
+ }, {
152
+ default: v(() => [
153
+ I((a(), l(S(u.component), $({ ref_for: !0 }, u.props ?? {}), null, 16)), [
154
+ [E, s.value === "All" || s.value === u.title]
155
+ ])
156
+ ]),
157
+ _: 2
158
+ }, 1024))), 128)),
159
+ s.value === "All" || s.value === "Body" ? (a(), y(k, { key: 3 }, [
160
+ "reader" in e.response ? (a(), l(W, {
149
161
  key: 0,
150
162
  class: "response-section-content-body",
151
- id: r.value.Body,
163
+ id: t.value.Body,
152
164
  reader: e.response.reader
153
- }, null, 8, ["id", "reader"])) : q.value && typeof ((a = e.response) == null ? void 0 : a.data) == "string" ? (n(), t(z, {
165
+ }, null, 8, ["id", "reader"])) : H.value && typeof ((n = e.response) == null ? void 0 : n.data) == "string" ? (a(), l(D, {
154
166
  key: 1,
155
- id: r.value.Body,
167
+ id: t.value.Body,
156
168
  content: e.response.data,
157
169
  data: (i = e.response) == null ? void 0 : i.data,
158
- headers: m.value,
170
+ headers: f.value,
159
171
  role: s.value === "All" ? "none" : "tabpanel"
160
- }, null, 8, ["id", "content", "data", "headers", "role"])) : (n(), t($, {
172
+ }, null, 8, ["id", "content", "data", "headers", "role"])) : (a(), l(N, {
161
173
  key: 2,
162
174
  class: "response-section-content-body",
163
- id: r.value.Body,
175
+ id: t.value.Body,
164
176
  layout: "client",
165
177
  active: !0,
166
178
  data: (p = e.response) == null ? void 0 : p.data,
167
- headers: m.value,
179
+ headers: f.value,
168
180
  role: s.value === "All" ? "none" : "tabpanel",
169
181
  title: "Body"
170
182
  }, null, 8, ["id", "data", "headers", "role"]))
171
183
  ], 64)) : d("", !0)
172
- ], 64)) : (n(), t(O, {
184
+ ], 64)) : (a(), l(P, {
173
185
  key: 0,
174
186
  collection: e.collection,
175
187
  operation: e.operation,
176
188
  workspace: e.workspace,
177
189
  numWorkspaceRequests: e.numWorkspaceRequests
178
190
  }, null, 8, ["collection", "operation", "workspace", "numWorkspaceRequests"])),
179
- h(S)
180
- ], 10, L)
191
+ A(K)
192
+ ], 10, Q)
181
193
  ];
182
194
  }),
183
195
  _: 1
@@ -185,5 +197,5 @@ const F = { class: "flex h-8 flex-1 items-center" }, L = ["id", "role"], A = 2e5
185
197
  }
186
198
  });
187
199
  export {
188
- se as default
200
+ me as default
189
201
  };
@@ -1 +1 @@
1
- {"version":3,"file":"WorkspaceDropdown.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/components/WorkspaceDropdown.vue"],"names":[],"mappings":";AA4zBA,wBAMG"}
1
+ {"version":3,"file":"WorkspaceDropdown.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/components/WorkspaceDropdown.vue"],"names":[],"mappings":";AA+sBA,wBAMG"}
@@ -1,143 +1,109 @@
1
- import { defineComponent as L, computed as O, ref as D, createElementBlock as z, openBlock as c, createElementVNode as a, createVNode as n, unref as t, withCtx as o, toDisplayString as C, Fragment as I, renderList as U, createBlock as g, withModifiers as r } from "vue";
2
- import { useModal as S, ScalarDropdown as $, ScalarButton as E, ScalarDropdownItem as u, ScalarListboxCheckbox as V, ScalarIcon as p, ScalarTooltip as q, ScalarDropdownDivider as F, ScalarModal as N } from "@scalar/components";
1
+ import { defineComponent as L, computed as V, ref as y, createElementBlock as C, openBlock as f, createElementVNode as l, createVNode as s, unref as e, withCtx as a, toDisplayString as D, Fragment as I, renderList as O, createBlock as S, withModifiers as v, createCommentVNode as U } from "vue";
2
+ import { useModal as $, ScalarDropdown as N, ScalarButton as z, ScalarDropdownItem as h, ScalarListboxCheckbox as q, ScalarIcon as k, ScalarDropdownDivider as F, ScalarModal as E } from "@scalar/components";
3
3
  import { useRouter as P } from "vue-router";
4
4
  import Y from "../../../components/Sidebar/Actions/DeleteSidebarListElement.vue.js";
5
5
  import G from "../../../components/Sidebar/Actions/EditSidebarListElement.vue.js";
6
6
  import { useActiveEntities as H } from "../../../store/active-entities.js";
7
7
  import { useWorkspace as J } from "../../../store/store.js";
8
- const K = { class: "flex w-[inherit] items-center text-sm" }, Q = { class: "m-0 flex items-center gap-1.5 font-bold" }, X = { class: "line-clamp-1 text-left" }, Z = { class: "overflow-hidden text-ellipsis" }, ee = { class: "flex h-4 w-4 items-center justify-center" }, de = /* @__PURE__ */ L({
8
+ const K = { class: "flex w-[inherit] items-center text-sm" }, Q = { class: "m-0 flex items-center gap-1.5 font-bold" }, X = { class: "line-clamp-1 text-left" }, Z = { class: "overflow-hidden text-ellipsis" }, ee = { class: "flex h-4 w-4 items-center justify-center" }, ce = /* @__PURE__ */ L({
9
9
  __name: "WorkspaceDropdown",
10
10
  setup(te) {
11
- const { activeWorkspace: m } = H(), { workspaces: d, workspaceMutators: b, events: T } = J(), { push: _ } = P(), j = (s) => {
12
- var e;
13
- s !== ((e = m.value) == null ? void 0 : e.uid) && _({
11
+ const { activeWorkspace: c } = H(), { workspaces: r, workspaceMutators: _, events: T } = J(), { push: g } = P(), j = (o) => {
12
+ var t;
13
+ o !== ((t = c.value) == null ? void 0 : t.uid) && g({
14
14
  name: "workspace",
15
15
  params: {
16
- workspace: s
16
+ workspace: o
17
17
  }
18
18
  });
19
- }, y = O(() => Object.keys(d).length === 1), B = () => T.commandPalette.emit({ commandName: "Create Workspace" }), f = D(""), i = D(""), v = S(), w = S(), M = (s) => {
20
- const e = d[s];
21
- e && (f.value = e.name, i.value = s, v.show());
22
- }, R = (s) => {
23
- s.trim() && (b.edit(i.value, "name", s.trim()), v.hide());
24
- }, W = (s) => {
25
- const e = d[s];
26
- e && (f.value = e.name, i.value = s, w.show());
19
+ }, b = V(() => Object.keys(r).length === 1), B = () => T.commandPalette.emit({ commandName: "Create Workspace" }), d = y(""), i = y(""), u = $(), p = $(), W = (o) => {
20
+ const t = r[o];
21
+ t && (d.value = t.name, i.value = o, u.show());
22
+ }, R = (o) => {
23
+ o.trim() && (_.edit(i.value, "name", o.trim()), u.hide());
24
+ }, M = (o) => {
25
+ const t = r[o];
26
+ t && (d.value = t.name, i.value = o, p.show());
27
27
  }, A = async () => {
28
- var s;
29
- if (!y.value) {
30
- const e = ((s = m.value) == null ? void 0 : s.uid) === i.value, l = { ...d };
31
- if (delete l[i.value], b.delete(i.value), e) {
32
- const k = Object.keys(l)[0];
33
- await _({
28
+ var o;
29
+ if (!b.value) {
30
+ const t = ((o = c.value) == null ? void 0 : o.uid) === i.value, n = { ...r };
31
+ if (delete n[i.value], _.delete(i.value), t) {
32
+ const m = Object.keys(n)[0];
33
+ await g({
34
34
  name: "workspace",
35
35
  params: {
36
- workspace: k
36
+ workspace: m
37
37
  }
38
38
  });
39
39
  }
40
40
  }
41
- w.hide();
41
+ p.hide();
42
42
  };
43
- return (s, e) => (c(), z("div", null, [
44
- a("div", K, [
45
- n(t($), null, {
46
- items: o(() => [
47
- (c(!0), z(I, null, U(t(d), (l, k) => (c(), g(t(u), {
48
- key: k,
43
+ return (o, t) => (f(), C("div", null, [
44
+ l("div", K, [
45
+ s(e(N), null, {
46
+ items: a(() => [
47
+ (f(!0), C(I, null, O(e(r), (n, m) => (f(), S(e(h), {
48
+ key: m,
49
49
  class: "group/item flex w-full items-center gap-1.5 overflow-hidden text-ellipsis whitespace-nowrap",
50
- onClick: r((x) => j(l.uid), ["stop"])
50
+ onClick: v((w) => j(n.uid), ["stop"])
51
51
  }, {
52
- default: o(() => {
53
- var x;
52
+ default: a(() => {
53
+ var w;
54
54
  return [
55
- n(t(V), {
56
- selected: ((x = t(m)) == null ? void 0 : x.uid) === k
55
+ s(e(q), {
56
+ selected: ((w = e(c)) == null ? void 0 : w.uid) === m
57
57
  }, null, 8, ["selected"]),
58
- a("span", Z, C(l.name), 1),
59
- n(t($), {
58
+ l("span", Z, D(n.name), 1),
59
+ s(e(N), {
60
60
  placement: "right-start",
61
61
  teleport: ""
62
62
  }, {
63
- items: o(() => [
64
- n(t(u), {
63
+ items: a(() => [
64
+ s(e(h), {
65
65
  class: "flex gap-2",
66
- onMousedown: (h) => M(l.uid),
67
- onTouchend: r((h) => M(l.uid), ["prevent"])
66
+ onMousedown: (x) => W(n.uid),
67
+ onTouchend: v((x) => W(n.uid), ["prevent"])
68
68
  }, {
69
- default: o(() => [
70
- n(t(p), {
69
+ default: a(() => [
70
+ s(e(k), {
71
71
  class: "inline-flex",
72
72
  icon: "Edit",
73
73
  size: "md",
74
74
  thickness: "1.5"
75
75
  }),
76
- e[4] || (e[4] = a("span", null, "Rename", -1))
76
+ t[2] || (t[2] = l("span", null, "Rename", -1))
77
77
  ]),
78
78
  _: 2
79
79
  }, 1032, ["onMousedown", "onTouchend"]),
80
- y.value ? (c(), g(t(q), {
80
+ b.value ? U("", !0) : (f(), S(e(h), {
81
81
  key: 0,
82
- class: "z-overlay",
83
- side: "bottom"
84
- }, {
85
- trigger: o(() => [
86
- n(t(u), {
87
- class: "flex w-full gap-2",
88
- disabled: "",
89
- onMousedown: e[0] || (e[0] = r(() => {
90
- }, ["prevent"])),
91
- onTouchend: e[1] || (e[1] = r(() => {
92
- }, ["prevent"]))
93
- }, {
94
- default: o(() => [
95
- n(t(p), {
96
- class: "inline-flex",
97
- icon: "Delete",
98
- size: "md",
99
- thickness: "1.5"
100
- }),
101
- e[5] || (e[5] = a("span", null, "Delete", -1))
102
- ]),
103
- _: 1
104
- })
105
- ]),
106
- content: o(() => e[6] || (e[6] = [
107
- a("div", { class: "w-content bg-b-1 text-xxs text-c-1 pointer-events-none z-10 grid min-w-48 gap-1.5 rounded p-2 leading-5 shadow-lg" }, [
108
- a("div", { class: "text-c-2 flex items-center" }, [
109
- a("span", null, "Only workspace cannot be deleted.")
110
- ])
111
- ], -1)
112
- ])),
113
- _: 1
114
- })) : (c(), g(t(u), {
115
- key: 1,
116
- class: "flex !gap-2",
117
- onMousedown: r((h) => W(l.uid), ["prevent"]),
118
- onTouchend: r((h) => W(l.uid), ["prevent"])
82
+ class: "flex gap-2",
83
+ onMousedown: v((x) => M(n.uid), ["prevent"]),
84
+ onTouchend: v((x) => M(n.uid), ["prevent"])
119
85
  }, {
120
- default: o(() => [
121
- n(t(p), {
86
+ default: a(() => [
87
+ s(e(k), {
122
88
  class: "inline-flex",
123
89
  icon: "Delete",
124
- size: "sm",
90
+ size: "md",
125
91
  thickness: "1.5"
126
92
  }),
127
- e[7] || (e[7] = a("span", null, "Delete", -1))
93
+ t[3] || (t[3] = l("span", null, "Delete", -1))
128
94
  ]),
129
95
  _: 2
130
96
  }, 1032, ["onMousedown", "onTouchend"]))
131
97
  ]),
132
- default: o(() => [
133
- n(t(E), {
98
+ default: a(() => [
99
+ s(e(z), {
134
100
  class: "hover:bg-b-3 -mr-1 ml-auto aspect-square h-fit px-0.5 py-0 group-hover/item:flex",
135
101
  size: "sm",
136
102
  type: "button",
137
103
  variant: "ghost"
138
104
  }, {
139
- default: o(() => [
140
- n(t(p), {
105
+ default: a(() => [
106
+ s(e(k), {
141
107
  icon: "Ellipses",
142
108
  size: "sm"
143
109
  })
@@ -151,34 +117,34 @@ const K = { class: "flex w-[inherit] items-center text-sm" }, Q = { class: "m-0
151
117
  }),
152
118
  _: 2
153
119
  }, 1032, ["onClick"]))), 128)),
154
- n(t(F)),
155
- n(t(u), {
120
+ s(e(F)),
121
+ s(e(h), {
156
122
  class: "flex items-center gap-1.5",
157
123
  onClick: B
158
124
  }, {
159
- default: o(() => [
160
- a("div", ee, [
161
- n(t(p), {
125
+ default: a(() => [
126
+ l("div", ee, [
127
+ s(e(k), {
162
128
  icon: "Add",
163
129
  size: "sm"
164
130
  })
165
131
  ]),
166
- e[8] || (e[8] = a("span", null, "Create Workspace", -1))
132
+ t[4] || (t[4] = l("span", null, "Create Workspace", -1))
167
133
  ]),
168
134
  _: 1
169
135
  })
170
136
  ]),
171
- default: o(() => [
172
- n(t(E), {
137
+ default: a(() => [
138
+ s(e(z), {
173
139
  class: "text-c-1 hover:bg-b-2 line-clamp-1 h-full w-fit justify-start px-1.5 py-1.5 font-normal",
174
140
  fullWidth: "",
175
141
  variant: "ghost"
176
142
  }, {
177
- default: o(() => {
178
- var l;
143
+ default: a(() => {
144
+ var n;
179
145
  return [
180
- a("div", Q, [
181
- a("h2", X, C((l = t(m)) == null ? void 0 : l.name), 1)
146
+ l("div", Q, [
147
+ l("h2", X, D((n = e(c)) == null ? void 0 : n.name), 1)
182
148
  ])
183
149
  ];
184
150
  }),
@@ -188,30 +154,30 @@ const K = { class: "flex w-[inherit] items-center text-sm" }, Q = { class: "m-0
188
154
  _: 1
189
155
  })
190
156
  ]),
191
- n(t(N), {
157
+ s(e(E), {
192
158
  size: "xxs",
193
- state: t(w),
159
+ state: e(p),
194
160
  title: "Delete workspace"
195
161
  }, {
196
- default: o(() => [
197
- n(Y, {
198
- variableName: f.value,
162
+ default: a(() => [
163
+ s(Y, {
164
+ variableName: d.value,
199
165
  warningMessage: "This cannot be undone. You’re about to delete the workspace and everything inside it.",
200
- onClose: e[2] || (e[2] = (l) => t(w).hide()),
166
+ onClose: t[0] || (t[0] = (n) => e(p).hide()),
201
167
  onDelete: A
202
168
  }, null, 8, ["variableName"])
203
169
  ]),
204
170
  _: 1
205
171
  }, 8, ["state"]),
206
- n(t(N), {
172
+ s(e(E), {
207
173
  size: "xxs",
208
- state: t(v),
174
+ state: e(u),
209
175
  title: "Rename Workspace"
210
176
  }, {
211
- default: o(() => [
212
- n(G, {
213
- name: f.value,
214
- onClose: e[3] || (e[3] = (l) => t(v).hide()),
177
+ default: a(() => [
178
+ s(G, {
179
+ name: d.value,
180
+ onClose: t[1] || (t[1] = (n) => e(u).hide()),
215
181
  onEdit: R
216
182
  }, null, 8, ["name"])
217
183
  ]),
@@ -221,5 +187,5 @@ const K = { class: "flex w-[inherit] items-center text-sm" }, Q = { class: "m-0
221
187
  }
222
188
  });
223
189
  export {
224
- de as default
190
+ ce as default
225
191
  };
package/package.json CHANGED
@@ -18,9 +18,9 @@
18
18
  "rest",
19
19
  "testing"
20
20
  ],
21
- "version": "2.3.34",
21
+ "version": "2.4.1",
22
22
  "engines": {
23
- "node": ">=18"
23
+ "node": ">=20"
24
24
  },
25
25
  "type": "module",
26
26
  "main": "dist/index.js",
@@ -125,6 +125,11 @@
125
125
  "types": "./dist/libs/send-request/index.d.ts",
126
126
  "default": "./dist/libs/send-request/index.js"
127
127
  },
128
+ "./plugins": {
129
+ "import": "./dist/plugins/index.js",
130
+ "types": "./dist/plugins/index.d.ts",
131
+ "default": "./dist/plugins/index.js"
132
+ },
128
133
  "./store": {
129
134
  "import": "./dist/store/index.js",
130
135
  "types": "./dist/store/index.d.ts",
@@ -199,22 +204,22 @@
199
204
  "whatwg-mimetype": "^4.0.0",
200
205
  "yaml": "^2.4.5",
201
206
  "zod": "3.24.1",
202
- "@scalar/components": "0.13.59",
203
- "@scalar/draggable": "0.1.11",
204
- "@scalar/icons": "0.3.7",
205
- "@scalar/import": "0.3.27",
206
- "@scalar/oas-utils": "0.2.144",
207
- "@scalar/openapi-parser": "0.10.17",
208
- "@scalar/object-utils": "1.1.14",
209
- "@scalar/postman-to-openapi": "0.2.17",
210
- "@scalar/openapi-types": "0.2.3",
211
- "@scalar/snippetz": "0.2.20",
212
- "@scalar/types": "0.1.16",
213
- "@scalar/use-codemirror": "0.11.104",
214
- "@scalar/themes": "0.11.3",
215
- "@scalar/use-hooks": "0.1.50",
216
- "@scalar/use-tooltip": "1.0.7",
217
- "@scalar/use-toasts": "0.7.10"
207
+ "@scalar/draggable": "0.2.0",
208
+ "@scalar/components": "0.14.1",
209
+ "@scalar/icons": "0.4.1",
210
+ "@scalar/oas-utils": "0.3.1",
211
+ "@scalar/import": "0.4.1",
212
+ "@scalar/openapi-parser": "0.11.0",
213
+ "@scalar/openapi-types": "0.3.1",
214
+ "@scalar/object-utils": "1.2.1",
215
+ "@scalar/snippetz": "0.3.0",
216
+ "@scalar/themes": "0.12.1",
217
+ "@scalar/postman-to-openapi": "0.3.1",
218
+ "@scalar/types": "0.2.1",
219
+ "@scalar/use-codemirror": "0.12.1",
220
+ "@scalar/use-hooks": "0.2.1",
221
+ "@scalar/use-toasts": "0.8.0",
222
+ "@scalar/use-tooltip": "1.1.0"
218
223
  },
219
224
  "devDependencies": {
220
225
  "@types/shell-quote": "^1.7.5",
@@ -229,8 +234,8 @@
229
234
  "vite": "5.4.19",
230
235
  "vite-svg-loader": "^5.1.0",
231
236
  "vitest": "^1.6.0",
232
- "@scalar/galaxy": "0.3.2",
233
- "@scalar/build-tooling": "0.1.19"
237
+ "@scalar/galaxy": "0.4.1",
238
+ "@scalar/build-tooling": "0.2.0"
234
239
  },
235
240
  "scripts": {
236
241
  "build": "scalar-build-vite",