@scalar/api-client 2.0.25 → 2.0.27

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 (39) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/components/AddressBar/AddressBarHistory.vue.d.ts.map +1 -1
  3. package/dist/components/AddressBar/AddressBarHistory.vue.js +38 -38
  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 +11 -11
  7. package/dist/components/CodeInput/codeVariableWidget.d.ts.map +1 -1
  8. package/dist/components/CodeInput/codeVariableWidget.js +48 -46
  9. package/dist/components/HttpMethod/HttpMethod.vue.d.ts.map +1 -1
  10. package/dist/components/HttpMethod/HttpMethod.vue.js +23 -30
  11. package/dist/components/Sidebar/SidebarToggle.vue.d.ts +20 -0
  12. package/dist/components/Sidebar/SidebarToggle.vue.d.ts.map +1 -0
  13. package/dist/components/Sidebar/SidebarToggle.vue.js +48 -0
  14. package/dist/components/Sidebar/SidebarToggle.vue2.js +4 -0
  15. package/dist/index.d.ts +1 -0
  16. package/dist/index.d.ts.map +1 -1
  17. package/dist/index.js +13 -10
  18. package/dist/layouts/Modal/api-client-modal.d.ts +1 -1
  19. package/dist/layouts/Modal/api-client-modal.d.ts.map +1 -1
  20. package/dist/layouts/Modal/api-client-modal.js +41 -41
  21. package/dist/store/workspace.d.ts +36 -12
  22. package/dist/store/workspace.d.ts.map +1 -1
  23. package/dist/store/workspace.js +163 -149
  24. package/dist/style.css +1 -1
  25. package/dist/views/Cookies/Cookies.vue2.js +22 -22
  26. package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts.map +1 -1
  27. package/dist/views/Environment/EnvironmentVariableDropdown.vue.js +32 -30
  28. package/dist/views/Request/Request.vue.d.ts.map +1 -1
  29. package/dist/views/Request/Request.vue.js +1 -1
  30. package/dist/views/Request/Request.vue2.js +97 -98
  31. package/dist/views/Request/RequestSection/RequestBody.vue.d.ts.map +1 -1
  32. package/dist/views/Request/RequestSection/RequestBody.vue.js +155 -125
  33. package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts.map +1 -1
  34. package/dist/views/Request/RequestSidebarItemMenu.vue.js +44 -46
  35. package/dist/views/Request/ResponseSection/ResponseBody.vue.d.ts +0 -5
  36. package/dist/views/Request/ResponseSection/ResponseBody.vue.d.ts.map +1 -1
  37. package/dist/views/Request/ResponseSection/ResponseBody.vue.js +2 -2
  38. package/dist/views/Request/ResponseSection/ResponseBody.vue2.js +24 -113
  39. package/package.json +4 -4
@@ -1 +1 @@
1
- {"version":3,"file":"ResponseBody.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/ResponseSection/ResponseBody.vue"],"names":[],"mappings":";WA4KW,MAAM;YACL,OAAO;UACT,GAAG;aACA;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAA;KAAE,EAAE;;;;;WAHtD,MAAM;YACL,OAAO;UACT,GAAG;aACA;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAA;KAAE,EAAE;;;;;UADvD,GAAG;YADD,OAAO;;AAsQnB,wBAMG;AAOH,KAAK,kBAAkB,CAAC,CAAC,EAAE,CAAC,IAAI;KAC1B,CAAC,IAAI,MAAM,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,SAAS,MAAM,CAAC,GAC7C,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG;QAAE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;KAAC,CAAC,GACvC,CAAC,CAAC,CAAC,CAAC;CACP,CAAC;AAEN,KAAK,cAAc,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CA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,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC;AAExD,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import o from "./ResponseBody.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-cc2ae6a8"]]);
4
+ const e = /* @__PURE__ */ t(o, [["__scopeId", "data-v-223b333c"]]);
5
5
  export {
6
- r as default
6
+ e as default
7
7
  };
@@ -1,128 +1,39 @@
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
- import { ScalarIcon as M, ScalarCodeBlock as E } from "@scalar/components";
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({
1
+ import { defineComponent as s, computed as u, ref as d, toRef as i, openBlock as f, createBlock as m, withCtx as o, createTextVNode as p, toDisplayString as _, createElementVNode as h } from "vue";
2
+ import y from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
3
+ import { useCodeMirror as g } from "@scalar/use-codemirror";
4
+ const x = /* @__PURE__ */ s({
11
5
  __name: "ResponseBody",
12
6
  props: {
13
7
  title: {},
14
- active: { type: Boolean, default: !1 },
15
8
  data: { default: null },
16
9
  headers: {}
17
10
  },
18
- setup(_) {
19
- const d = _, { activeWorkspace: w } = I(), x = C(() => {
11
+ setup(a) {
12
+ const r = a, l = u(() => {
20
13
  var t;
21
- const o = ((t = d.headers.find((e) => e.name.toLowerCase() === "content-type")) == null ? void 0 : t.value) ?? "";
22
- return o.includes("json") ? "json" : o.includes("html") ? "html" : "plaintext";
23
- }), a = y(null), n = y("raw"), b = ["raw", "preview"], { isDark: s } = F();
24
- return m(
25
- () => n.value,
26
- async (o) => {
27
- var t;
28
- if (o === "preview" && (await f(), a.value)) {
29
- const e = a.value.contentDocument || ((t = a.value.contentWindow) == null ? void 0 : t.document);
30
- if (!e) return;
31
- e.open(), e.write(d.data), e.close();
32
- }
33
- }
34
- ), m(
35
- () => s.value,
36
- async (o) => {
37
- var t;
38
- if (await f(), a.value) {
39
- const e = a.value.contentDocument || ((t = a.value.contentWindow) == null ? void 0 : t.document);
40
- if (!e) return;
41
- e.body.classList.toggle("dark-mode", s.value), e.body.classList.toggle("light-mode", !s.value);
42
- }
43
- }
44
- ), m(
45
- () => n.value,
46
- async (o) => {
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
- "<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 = w.value) != null && e.themeId && l.write(
54
- `<style>${R(w.value.themeId)}</style>`
55
- ), l.close();
56
- }
57
- }
58
- ), (o, t) => (c(), p(z, null, {
59
- title: r(() => [
60
- L(v(o.title), 1)
14
+ const e = ((t = r.headers.find((c) => c.name.toLowerCase() === "content-type")) == null ? void 0 : t.value) ?? "";
15
+ return e.includes("json") ? "json" : (e.includes("html"), "html");
16
+ }), n = d(null);
17
+ return g({
18
+ codeMirrorRef: n,
19
+ readOnly: !0,
20
+ lineNumbers: !0,
21
+ content: i(() => r.data),
22
+ language: l
23
+ }), (e, t) => (f(), m(y, null, {
24
+ title: o(() => [
25
+ p(_(e.title), 1)
61
26
  ]),
62
- default: r(() => [
63
- o.active ? (c(), p($, {
64
- key: 0,
65
- columns: [""]
66
- }, {
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
- class: "text-c-3 ml-1 mt-px",
76
- icon: "ChevronDown",
77
- size: "xs"
78
- })
79
- ]),
80
- B(u("select", {
81
- "onUpdate:modelValue": t[0] || (t[0] = (e) => n.value = e),
82
- class: "absolute inset-0 w-auto opacity-0",
83
- onClick: t[1] || (t[1] = S(() => {
84
- }, ["prevent"]))
85
- }, [
86
- (c(), h(V, null, T(b, (e) => u("option", {
87
- key: e,
88
- value: e
89
- }, v(e), 9, P)), 64))
90
- ], 512), [
91
- [W, n.value]
92
- ])
93
- ]),
94
- _: 1
95
- })
96
- ]),
97
- _: 1
98
- }),
99
- i(k, null, {
100
- default: r(() => [
101
- n.value === "raw" ? (c(), p(g(E), {
102
- key: 0,
103
- class: "force-text-sm rounded-b border-t-0",
104
- content: o.data,
105
- lang: x.value
106
- }, null, 8, ["content", "lang"])) : (c(), h("iframe", {
107
- key: 1,
108
- ref_key: "iframe",
109
- ref: a,
110
- allowfullscreen: "",
111
- allowtransparency: "true",
112
- class: "w-full aspect-video",
113
- frameborder: "0"
114
- }, null, 512))
115
- ]),
116
- _: 1
117
- })
118
- ]),
119
- _: 1
120
- })) : N("", !0)
27
+ default: o(() => [
28
+ h("div", {
29
+ ref_key: "codeMirrorRef",
30
+ ref: n
31
+ }, null, 512)
121
32
  ]),
122
33
  _: 1
123
34
  }));
124
35
  }
125
36
  });
126
37
  export {
127
- Z as default
38
+ x as default
128
39
  };
package/package.json CHANGED
@@ -18,7 +18,7 @@
18
18
  "rest",
19
19
  "testing"
20
20
  ],
21
- "version": "2.0.25",
21
+ "version": "2.0.27",
22
22
  "engines": {
23
23
  "node": ">=18"
24
24
  },
@@ -118,12 +118,12 @@
118
118
  "vue": "^3.4.29",
119
119
  "vue-router": "^4.3.0",
120
120
  "zod": "^3.22.4",
121
- "@scalar/components": "0.12.16",
122
121
  "@scalar/draggable": "0.1.3",
122
+ "@scalar/components": "0.12.18",
123
123
  "@scalar/object-utils": "1.1.4",
124
+ "@scalar/oas-utils": "0.2.16",
124
125
  "@scalar/themes": "0.9.15",
125
- "@scalar/oas-utils": "0.2.15",
126
- "@scalar/use-codemirror": "0.11.7",
126
+ "@scalar/use-codemirror": "0.11.8",
127
127
  "@scalar/use-toasts": "0.7.4",
128
128
  "@scalar/use-tooltip": "1.0.2"
129
129
  },