@scalar/api-client 2.0.11 → 2.0.13

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 (44) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/App.vue.d.ts.map +1 -1
  3. package/dist/App.vue.js +38 -27
  4. package/dist/Modal/api-client-modal.d.ts +2 -1
  5. package/dist/Modal/api-client-modal.d.ts.map +1 -1
  6. package/dist/Modal/api-client-modal.js +49 -40
  7. package/dist/components/ActionModal/ActionModalFolder.vue.js +37 -35
  8. package/dist/components/AddressBar/AddressBar.vue.d.ts.map +1 -1
  9. package/dist/components/AddressBar/AddressBar.vue.js +1 -1
  10. package/dist/components/AddressBar/AddressBar.vue2.js +42 -42
  11. package/dist/components/AddressBar/AddressBarServer.vue.d.ts +1 -14
  12. package/dist/components/AddressBar/AddressBarServer.vue.d.ts.map +1 -1
  13. package/dist/components/AddressBar/AddressBarServer.vue.js +50 -55
  14. package/dist/components/Sidebar/Sidebar.vue.js +5 -5
  15. package/dist/index.d.ts +1 -1
  16. package/dist/index.d.ts.map +1 -1
  17. package/dist/index.js +8 -9
  18. package/dist/libs/index.d.ts +1 -0
  19. package/dist/libs/index.d.ts.map +1 -1
  20. package/dist/libs/index.js +10 -8
  21. package/dist/libs/local-storage.d.ts +9 -0
  22. package/dist/libs/local-storage.d.ts.map +1 -0
  23. package/dist/libs/local-storage.js +36 -0
  24. package/dist/router.d.ts +2 -2
  25. package/dist/router.d.ts.map +1 -1
  26. package/dist/router.js +13 -13
  27. package/dist/store/workspace.d.ts +511 -269
  28. package/dist/store/workspace.d.ts.map +1 -1
  29. package/dist/store/workspace.js +213 -157
  30. package/dist/style.css +1 -1
  31. package/dist/views/Request/Request.vue.d.ts.map +1 -1
  32. package/dist/views/Request/Request.vue.js +2 -2
  33. package/dist/views/Request/Request.vue2.js +93 -91
  34. package/dist/views/Request/RequestSection/RequestTable.vue.d.ts.map +1 -1
  35. package/dist/views/Request/RequestSection/RequestTable.vue.js +1 -1
  36. package/dist/views/Request/RequestSection/RequestTable.vue2.js +28 -28
  37. package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
  38. package/dist/views/Request/RequestSidebarItem.vue.js +2 -2
  39. package/dist/views/Request/RequestSidebarItem.vue2.js +25 -25
  40. package/dist/views/Request/ResponseSection/ResponseBody.vue.d.ts.map +1 -1
  41. package/dist/views/Request/ResponseSection/ResponseBody.vue.js +2 -2
  42. package/dist/views/Request/ResponseSection/ResponseBody.vue2.js +56 -56
  43. package/dist/views/Request/ResponseSection/ResponseEmpty.vue.js +11 -11
  44. package/package.json +4 -4
@@ -1,13 +1,13 @@
1
- import { defineComponent as b, computed as D, ref as v, watch as d, nextTick as m, openBlock as s, createBlock as f, withCtx as n, createTextVNode as C, toDisplayString as p, createVNode as c, createElementVNode as i, unref as w, withDirectives as L, withModifiers as B, createElementBlock as y, Fragment as S, renderList as V, vModelSelect as T, createCommentVNode as N } from "vue";
2
- import W from "../../../components/DataTable/DataTable.vue.js";
3
- import $ from "../../../components/DataTable/DataTableHeader.vue.js";
4
- import g from "../../../components/DataTable/DataTableRow.vue.js";
5
- import j from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
6
- import { useWorkspace as z } from "../../../store/workspace.js";
1
+ import { defineComponent as D, computed as C, ref as y, watch as m, nextTick as f, openBlock as c, createBlock as p, withCtx as r, createTextVNode as L, toDisplayString as v, createVNode as i, createElementVNode as u, unref as g, withDirectives as B, withModifiers as S, createElementBlock as h, Fragment as V, renderList as T, vModelSelect as W, createCommentVNode as N } from "vue";
2
+ import $ from "../../../components/DataTable/DataTable.vue.js";
3
+ import j from "../../../components/DataTable/DataTableHeader.vue.js";
4
+ import k from "../../../components/DataTable/DataTableRow.vue.js";
5
+ import z from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
6
+ import { useWorkspace as I } from "../../../store/workspace.js";
7
7
  import { ScalarIcon as M, ScalarCodeBlock as E } from "@scalar/components";
8
- import { getThemeStyles as I } from "@scalar/themes";
9
- import { useDarkModeState as R } from "../../../hooks/useDarkModeState.js";
10
- const F = { class: "text-c-2 group-hover:text-c-1 flex h-full w-full items-center justify-start rounded px-1.5" }, H = { class: "capitalize" }, O = ["value"], Y = /* @__PURE__ */ b({
8
+ import { getThemeStyles as R } from "@scalar/themes";
9
+ import { useDarkModeState as F } from "../../../hooks/useDarkModeState.js";
10
+ const H = { class: "text-c-2 group-hover:text-c-1 flex h-full w-full items-center justify-start rounded px-1.5" }, O = { class: "capitalize" }, P = ["value"], Z = /* @__PURE__ */ D({
11
11
  __name: "ResponseBody",
12
12
  props: {
13
13
  title: {},
@@ -15,80 +15,80 @@ const F = { class: "text-c-2 group-hover:text-c-1 flex h-full w-full items-cente
15
15
  data: { default: null },
16
16
  headers: {}
17
17
  },
18
- setup(h) {
19
- const u = h, { workspace: k } = z(), _ = D(() => {
18
+ setup(_) {
19
+ const d = _, { activeWorkspace: w } = I(), x = C(() => {
20
20
  var t;
21
- const o = ((t = u.headers.find((e) => e.name.toLowerCase() === "content-type")) == null ? void 0 : t.value) ?? "";
21
+ const o = ((t = d.headers.find((e) => e.name.toLowerCase() === "content-type")) == null ? void 0 : t.value) ?? "";
22
22
  return o.includes("json") ? "json" : o.includes("html") ? "html" : "plaintext";
23
- }), a = v(null), l = v("raw"), x = ["raw", "preview"], { isDark: r } = R();
24
- return d(
25
- () => l.value,
23
+ }), a = y(null), n = y("raw"), b = ["raw", "preview"], { isDark: s } = F();
24
+ return m(
25
+ () => n.value,
26
26
  async (o) => {
27
27
  var t;
28
- if (o === "preview" && (await m(), a.value)) {
28
+ if (o === "preview" && (await f(), a.value)) {
29
29
  const e = a.value.contentDocument || ((t = a.value.contentWindow) == null ? void 0 : t.document);
30
30
  if (!e) return;
31
- e.open(), e.write(u.data), e.close();
31
+ e.open(), e.write(d.data), e.close();
32
32
  }
33
33
  }
34
- ), d(
35
- () => r.value,
34
+ ), m(
35
+ () => s.value,
36
36
  async (o) => {
37
37
  var t;
38
- if (await m(), a.value) {
38
+ if (await f(), a.value) {
39
39
  const e = a.value.contentDocument || ((t = a.value.contentWindow) == null ? void 0 : t.document);
40
40
  if (!e) return;
41
- e.body.classList.toggle("dark-mode", r.value), e.body.classList.toggle("light-mode", !r.value);
41
+ e.body.classList.toggle("dark-mode", s.value), e.body.classList.toggle("light-mode", !s.value);
42
42
  }
43
43
  }
44
- ), d(
45
- () => l.value,
44
+ ), m(
45
+ () => n.value,
46
46
  async (o) => {
47
- var t;
48
- if (o === "preview" && (await m(), a.value)) {
49
- const e = a.value.contentDocument || ((t = a.value.contentWindow) == null ? void 0 : t.document);
50
- if (!e) return;
51
- e.open(), e.write(u.data), e.body.classList.toggle("dark-mode", r.value), e.body.classList.toggle("light-mode", !r.value), e.write(
47
+ var t, e;
48
+ if (o === "preview" && (await f(), a.value)) {
49
+ const l = a.value.contentDocument || ((t = a.value.contentWindow) == null ? void 0 : t.document);
50
+ if (!l) return;
51
+ l.open(), l.write(d.data), l.body.classList.toggle("dark-mode", s.value), l.body.classList.toggle("light-mode", !s.value), l.write(
52
52
  "<style>body,html {body:not(:has(* + style + style)) {font-family: var(--scalar-font-code); font-size: 12px; font-weight: 400;background:var(--scalar-background-1); color: var(--scalar-color-2)}</style>"
53
- ), e.write(
54
- `<style>${I(k.themeId)}</style>`
55
- ), e.close();
53
+ ), (e = w.value) != null && e.themeId && l.write(
54
+ `<style>${R(w.value.themeId)}</style>`
55
+ ), l.close();
56
56
  }
57
57
  }
58
- ), (o, t) => (s(), f(j, null, {
59
- title: n(() => [
60
- C(p(o.title), 1)
58
+ ), (o, t) => (c(), p(z, null, {
59
+ title: r(() => [
60
+ L(v(o.title), 1)
61
61
  ]),
62
- default: n(() => [
63
- o.active ? (s(), f(W, {
62
+ default: r(() => [
63
+ o.active ? (c(), p($, {
64
64
  key: 0,
65
65
  columns: [""]
66
66
  }, {
67
- default: n(() => [
68
- c(g, null, {
69
- default: n(() => [
70
- c($, { class: "relative col-span-full flex h-8 cursor-pointer items-center px-[2.25px] py-[2.25px]" }, {
71
- default: n(() => [
72
- i("div", F, [
73
- i("span", H, p(l.value), 1),
74
- c(w(M), {
67
+ default: r(() => [
68
+ i(k, null, {
69
+ default: r(() => [
70
+ i(j, { class: "relative col-span-full flex h-8 cursor-pointer items-center px-[2.25px] py-[2.25px]" }, {
71
+ default: r(() => [
72
+ u("div", H, [
73
+ u("span", O, v(n.value), 1),
74
+ i(g(M), {
75
75
  class: "text-c-3 ml-1 mt-px",
76
76
  icon: "ChevronDown",
77
77
  size: "xs"
78
78
  })
79
79
  ]),
80
- L(i("select", {
81
- "onUpdate:modelValue": t[0] || (t[0] = (e) => l.value = e),
80
+ B(u("select", {
81
+ "onUpdate:modelValue": t[0] || (t[0] = (e) => n.value = e),
82
82
  class: "absolute inset-0 w-auto opacity-0",
83
- onClick: t[1] || (t[1] = B(() => {
83
+ onClick: t[1] || (t[1] = S(() => {
84
84
  }, ["prevent"]))
85
85
  }, [
86
- (s(), y(S, null, V(x, (e) => i("option", {
86
+ (c(), h(V, null, T(b, (e) => u("option", {
87
87
  key: e,
88
88
  value: e
89
- }, p(e), 9, O)), 64))
89
+ }, v(e), 9, P)), 64))
90
90
  ], 512), [
91
- [T, l.value]
91
+ [W, n.value]
92
92
  ])
93
93
  ]),
94
94
  _: 1
@@ -96,14 +96,14 @@ const F = { class: "text-c-2 group-hover:text-c-1 flex h-full w-full items-cente
96
96
  ]),
97
97
  _: 1
98
98
  }),
99
- c(g, null, {
100
- default: n(() => [
101
- l.value === "raw" ? (s(), f(w(E), {
99
+ i(k, null, {
100
+ default: r(() => [
101
+ n.value === "raw" ? (c(), p(g(E), {
102
102
  key: 0,
103
103
  class: "force-text-sm rounded-b border-t-0",
104
104
  content: o.data,
105
- lang: _.value
106
- }, null, 8, ["content", "lang"])) : (s(), y("iframe", {
105
+ lang: x.value
106
+ }, null, 8, ["content", "lang"])) : (c(), h("iframe", {
107
107
  key: 1,
108
108
  ref_key: "iframe",
109
109
  ref: a,
@@ -124,5 +124,5 @@ const F = { class: "text-c-2 group-hover:text-c-1 flex h-full w-full items-cente
124
124
  }
125
125
  });
126
126
  export {
127
- Y as default
127
+ Z as default
128
128
  };
@@ -1,38 +1,38 @@
1
- import { defineComponent as l, openBlock as r, createElementBlock as c, createElementVNode as e, createVNode as t, unref as o, createTextVNode as n, createCommentVNode as m } from "vue";
1
+ import { defineComponent as a, openBlock as r, createElementBlock as c, createElementVNode as e, createVNode as t, unref as o, createTextVNode as n, createCommentVNode as m } from "vue";
2
2
  import p from "../../../assets/computer.ascii.js";
3
3
  import u from "../../../components/ScalarAsciiArt.vue.js";
4
- import a from "../../../components/ScalarHotkey.vue.js";
4
+ import i from "../../../components/ScalarHotkey.vue.js";
5
5
  import { useWorkspace as f } from "../../../store/workspace.js";
6
6
  import { executeRequestBus as _ } from "../../../libs/eventBusses/executeRequestBus.js";
7
- const d = { class: "relative col-1 flex-center gap-6 p-2 capitalize" }, x = { class: "flex h-[calc(100%_-_50px)] flex-col items-center justify-center" }, k = { class: "text-c-3 right-4 mt-auto flex w-full flex-col items-end gap-2 text-sm" }, y = {
7
+ const d = { class: "relative col-1 flex-center gap-6 p-2 capitalize" }, x = { class: "flex h-[calc(100%_-_50px)] flex-col items-center justify-center" }, y = { class: "text-c-3 right-4 mt-auto flex w-full flex-col items-end gap-2 text-sm" }, h = {
8
8
  key: 0,
9
9
  class: "flex items-center gap-1.5",
10
10
  type: "button"
11
- }, w = /* @__PURE__ */ l({
11
+ }, B = /* @__PURE__ */ a({
12
12
  __name: "ResponseEmpty",
13
- setup(h) {
14
- const { workspace: i } = f();
13
+ setup(k) {
14
+ const { isReadOnly: l } = f();
15
15
  return (N, s) => (r(), c("div", d, [
16
16
  e("div", x, [
17
17
  t(u, { art: o(p) }, null, 8, ["art"])
18
18
  ]),
19
- e("div", k, [
19
+ e("div", y, [
20
20
  e("button", {
21
21
  class: "flex items-center gap-1.5",
22
22
  type: "button",
23
23
  onClick: s[0] || (s[0] = (g) => o(_).emit())
24
24
  }, [
25
25
  n(" Send Request "),
26
- t(a, { hotkey: "↵" })
26
+ t(i, { hotkey: "↵" })
27
27
  ]),
28
- o(i).isReadOnly ? m("", !0) : (r(), c("button", y, [
28
+ o(l) ? m("", !0) : (r(), c("button", h, [
29
29
  n(" New Request "),
30
- t(a, { hotkey: "N" })
30
+ t(i, { hotkey: "N" })
31
31
  ]))
32
32
  ])
33
33
  ]));
34
34
  }
35
35
  });
36
36
  export {
37
- w as default
37
+ B as default
38
38
  };
package/package.json CHANGED
@@ -18,7 +18,7 @@
18
18
  "rest",
19
19
  "testing"
20
20
  ],
21
- "version": "2.0.11",
21
+ "version": "2.0.13",
22
22
  "engines": {
23
23
  "node": ">=18"
24
24
  },
@@ -112,9 +112,9 @@
112
112
  "zod": "^3.22.4",
113
113
  "@scalar/components": "0.12.10",
114
114
  "@scalar/draggable": "0.1.3",
115
- "@scalar/oas-utils": "0.2.11",
116
- "@scalar/object-utils": "1.1.3",
117
- "@scalar/themes": "0.9.12",
115
+ "@scalar/oas-utils": "0.2.12",
116
+ "@scalar/object-utils": "1.1.4",
117
+ "@scalar/themes": "0.9.13",
118
118
  "@scalar/use-codemirror": "0.11.4",
119
119
  "@scalar/use-toasts": "0.7.4",
120
120
  "@scalar/use-tooltip": "1.0.2"