@scalar/api-client 2.1.33 → 2.1.35

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 (106) hide show
  1. package/CHANGELOG.md +36 -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/CodeInput/CodeInput.vue.js +2 -2
  5. package/dist/components/ContextBar.vue.d.ts.map +1 -1
  6. package/dist/components/ContextBar.vue.js +1 -1
  7. package/dist/components/ContextBar.vue2.js +6 -6
  8. package/dist/components/DataTable/DataTableInput.vue.d.ts.map +1 -1
  9. package/dist/components/DataTable/DataTableInput.vue.js +3 -3
  10. package/dist/components/DataTable/DataTableInput.vue2.js +53 -40
  11. package/dist/components/ScalarHotkey.vue.d.ts +5 -6
  12. package/dist/components/ScalarHotkey.vue.d.ts.map +1 -1
  13. package/dist/components/ScalarHotkey.vue.js +9 -18
  14. package/dist/components/SideNav/SideNav.vue.d.ts.map +1 -1
  15. package/dist/components/SideNav/SideNav.vue.js +2 -2
  16. package/dist/components/SideNav/SideNav.vue2.js +8 -8
  17. package/dist/components/Sidebar/SidebarButton.vue.d.ts +4 -0
  18. package/dist/components/Sidebar/SidebarButton.vue.d.ts.map +1 -1
  19. package/dist/components/Sidebar/SidebarButton.vue.js +19 -17
  20. package/dist/components/TopNav/TopNav.vue.d.ts.map +1 -1
  21. package/dist/components/TopNav/TopNav.vue.js +2 -2
  22. package/dist/components/TopNav/TopNav.vue2.js +14 -14
  23. package/dist/components/ViewLayout/ViewLayoutSection.vue.d.ts.map +1 -1
  24. package/dist/components/ViewLayout/ViewLayoutSection.vue.js +6 -6
  25. package/dist/index.d.ts +1 -1
  26. package/dist/index.d.ts.map +1 -1
  27. package/dist/index.js +8 -8
  28. package/dist/layouts/App/ApiClientApp.vue.d.ts.map +1 -1
  29. package/dist/layouts/App/ApiClientApp.vue.js +35 -29
  30. package/dist/layouts/App/MainLayout.vue.d.ts.map +1 -1
  31. package/dist/layouts/App/MainLayout.vue.js +4 -4
  32. package/dist/layouts/App/create-api-client-app.d.ts +257 -45
  33. package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
  34. package/dist/layouts/App/create-api-client-app.js +10 -10
  35. package/dist/layouts/App/hotkeys.js +1 -1
  36. package/dist/layouts/Modal/create-api-client-modal.d.ts +514 -90
  37. package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
  38. package/dist/layouts/Modal/create-api-client-modal.js +24 -22
  39. package/dist/layouts/Web/ApiClientWeb.vue.d.ts.map +1 -1
  40. package/dist/layouts/Web/ApiClientWeb.vue.js +33 -27
  41. package/dist/layouts/Web/create-api-client-web.d.ts +258 -46
  42. package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
  43. package/dist/layouts/Web/create-api-client-web.js +9 -9
  44. package/dist/libs/create-client.d.ts +280 -50
  45. package/dist/libs/create-client.d.ts.map +1 -1
  46. package/dist/libs/create-client.js +25 -24
  47. package/dist/libs/hot-keys.d.ts +1 -1
  48. package/dist/libs/local-storage.d.ts +2 -2
  49. package/dist/libs/local-storage.d.ts.map +1 -1
  50. package/dist/libs/send-request.d.ts +2 -1
  51. package/dist/libs/send-request.d.ts.map +1 -1
  52. package/dist/libs/send-request.js +98 -97
  53. package/dist/router.d.ts +5 -5
  54. package/dist/router.d.ts.map +1 -1
  55. package/dist/router.js +32 -32
  56. package/dist/store/collections.d.ts +14 -4
  57. package/dist/store/collections.d.ts.map +1 -1
  58. package/dist/store/events.d.ts +1 -1
  59. package/dist/store/import-spec.d.ts +16 -31
  60. package/dist/store/import-spec.d.ts.map +1 -1
  61. package/dist/store/import-spec.js +43 -56
  62. package/dist/store/requests.d.ts +14 -14
  63. package/dist/store/store.d.ts +514 -90
  64. package/dist/store/store.d.ts.map +1 -1
  65. package/dist/store/store.js +43 -43
  66. package/dist/store/workspace.d.ts +10 -10
  67. package/dist/store/workspace.d.ts.map +1 -1
  68. package/dist/style.css +1 -1
  69. package/dist/views/Cookies/Cookies.vue.d.ts +5 -1
  70. package/dist/views/Cookies/Cookies.vue.d.ts.map +1 -1
  71. package/dist/views/Cookies/Cookies.vue2.js +64 -55
  72. package/dist/views/Environment/Environment.vue.d.ts +5 -1
  73. package/dist/views/Environment/Environment.vue.d.ts.map +1 -1
  74. package/dist/views/Environment/Environment.vue2.js +75 -66
  75. package/dist/views/Request/Request.vue.d.ts.map +1 -1
  76. package/dist/views/Request/Request.vue.js +1 -1
  77. package/dist/views/Request/Request.vue2.js +96 -90
  78. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.js +21 -21
  79. package/dist/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue.d.ts.map +1 -1
  80. package/dist/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue.js +79 -71
  81. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts +2 -0
  82. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts.map +1 -1
  83. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +2 -2
  84. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +105 -112
  85. package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue.d.ts +5 -1
  86. package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue.d.ts.map +1 -1
  87. package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue.js +38 -35
  88. package/dist/views/Request/RequestSection/RequestSection.vue.d.ts +5 -1
  89. package/dist/views/Request/RequestSection/RequestSection.vue.d.ts.map +1 -1
  90. package/dist/views/Request/RequestSection/RequestSection.vue.js +5 -118
  91. package/dist/views/Request/RequestSection/RequestSection.vue2.js +126 -0
  92. package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
  93. package/dist/views/Request/RequestSidebar.vue.js +4 -4
  94. package/dist/views/Request/RequestSidebar.vue2.js +43 -42
  95. package/dist/views/Request/ResponseSection/ResponseEmpty.vue.d.ts.map +1 -1
  96. package/dist/views/Request/ResponseSection/ResponseEmpty.vue.js +1 -1
  97. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +27 -26
  98. package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.d.ts.map +1 -1
  99. package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.js +1 -1
  100. package/dist/views/Request/ResponseSection/ResponseSection.vue.d.ts.map +1 -1
  101. package/dist/views/Request/ResponseSection/ResponseSection.vue.js +5 -99
  102. package/dist/views/Request/ResponseSection/ResponseSection.vue2.js +104 -2
  103. package/dist/views/Settings/SettingsGeneral.vue.js +3 -3
  104. package/dist/views/Settings/SettingsGeneralMode.vue.js +3 -3
  105. package/package.json +8 -8
  106. package/dist/views/Request/RequestSection/RequestSection.vue3.js +0 -5
@@ -1,3 +1,7 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
1
+ declare const _default: import("vue").DefineComponent<{
2
+ isApp: boolean;
3
+ }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
4
+ isApp: boolean;
5
+ }> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
2
6
  export default _default;
3
7
  //# sourceMappingURL=Cookies.vue.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Cookies.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Cookies/Cookies.vue"],"names":[],"mappings":";AA0gBA,wBAKG"}
1
+ {"version":3,"file":"Cookies.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Cookies/Cookies.vue"],"names":[],"mappings":";WAwMS,OAAO;;WAAP,OAAO;;AAmWhB,wBAMG"}
@@ -1,22 +1,25 @@
1
- import { defineComponent as L, computed as V, onMounted as D, openBlock as l, createBlock as y, withCtx as a, createVNode as s, unref as n, createElementVNode as f, createElementBlock as m, Fragment as _, renderList as v, normalizeClass as w, createTextVNode as x, toDisplayString as S, withDirectives as O, vShow as $ } from "vue";
2
- import M from "../../components/Sidebar/SidebarButton.vue.js";
3
- import N from "../../components/Sidebar/SidebarList.vue.js";
4
- import B from "../../components/Sidebar/SidebarListElement.vue.js";
5
- import F from "../../components/ViewLayout/ViewLayout.vue.js";
1
+ import { defineComponent as L, computed as V, onMounted as D, onBeforeUnmount as M, openBlock as n, createBlock as O, withCtx as a, createVNode as s, unref as l, createElementVNode as f, createElementBlock as m, Fragment as _, renderList as x, normalizeClass as $, createTextVNode as k, toDisplayString as j, withDirectives as A, vShow as E } from "vue";
2
+ import R from "../../components/Sidebar/SidebarButton.vue.js";
3
+ import F from "../../components/Sidebar/SidebarList.vue.js";
4
+ import K from "../../components/Sidebar/SidebarListElement.vue.js";
5
+ import H from "../../components/ViewLayout/ViewLayout.vue.js";
6
6
  import I from "../../components/ViewLayout/ViewLayoutContent.vue.js";
7
- import { ScalarIcon as j } from "@scalar/components";
8
- import { cookieSchema as R } from "@scalar/oas-utils/entities/cookie";
9
- import { useRouter as A } from "vue-router";
10
- import H from "./CookieForm.vue.js";
11
- import P from "./CookieRaw.vue.js";
12
- import { useSidebar as T } from "../../hooks/useSidebar.js";
13
- import { useWorkspace as W } from "../../store/store.js";
14
- import q from "../../components/Sidebar/Sidebar.vue.js";
15
- const G = { class: "flex-1" }, J = ["onClick"], K = { class: "before:bg-border before:pointer-events-none before:z-1 before:absolute before:left-[calc(1rem_-_1.5px)] before:top-0 before:h-[calc(100%_+_.5px)] last:before:h-full before:w-[.5px] mb-[.5px] last:mb-0 relative" }, Q = ["onClick"], U = { class: "before:bg-border before:pointer-events-none before:z-1 before:absolute before:left-[calc(1.75rem_-_1.5px)] before:top-0 before:h-[calc(100%_+_.5px)] last:before:h-full before:w-[.5px] mb-[.5px] last:mb-0 relative" }, de = /* @__PURE__ */ L({
7
+ import { ScalarIcon as N } from "@scalar/components";
8
+ import { cookieSchema as P } from "@scalar/oas-utils/entities/cookie";
9
+ import { useRouter as T, useRoute as U } from "vue-router";
10
+ import W from "./CookieForm.vue.js";
11
+ import q from "./CookieRaw.vue.js";
12
+ import { useSidebar as G } from "../../hooks/useSidebar.js";
13
+ import { useWorkspace as J } from "../../store/store.js";
14
+ import Q from "../../components/Sidebar/Sidebar.vue.js";
15
+ const X = { class: "flex-1" }, Y = ["onClick"], Z = { class: "before:bg-border before:pointer-events-none before:z-1 before:absolute before:left-[calc(1rem_-_1.5px)] before:top-0 before:h-[calc(100%_+_.5px)] last:before:h-full before:w-[.5px] mb-[.5px] last:mb-0 relative" }, ee = ["onClick"], te = { class: "before:bg-border before:pointer-events-none before:z-1 before:absolute before:left-[calc(1.75rem_-_1.5px)] before:top-0 before:h-[calc(100%_+_.5px)] last:before:h-full before:w-[.5px] mb-[.5px] last:mb-0 relative" }, xe = /* @__PURE__ */ L({
16
16
  __name: "Cookies",
17
- setup(X) {
18
- const { cookies: p, cookieMutators: g } = W(), { collapsedSidebarFolders: i, toggleSidebarFolder: k } = T(), b = A(), E = () => {
19
- const t = Object.keys(p).length, e = R.parse({
17
+ props: {
18
+ isApp: { type: Boolean }
19
+ },
20
+ setup(oe) {
21
+ const { cookies: d, cookieMutators: v, events: g } = J(), { collapsedSidebarFolders: i, toggleSidebarFolder: y } = G(), b = T(), z = U(), C = () => {
22
+ const t = Object.keys(d).length, e = P.parse({
20
23
  name: `Cookie ${t}`,
21
24
  value: "",
22
25
  domain: "example.com",
@@ -25,10 +28,10 @@ const G = { class: "flex-1" }, J = ["onClick"], K = { class: "before:bg-border b
25
28
  httpOnly: !1,
26
29
  sameSite: "None"
27
30
  });
28
- g.add(e), b.push(e.uid);
29
- }, z = (t) => {
30
- g.delete(t);
31
- const e = Object.values(p).filter(
31
+ v.add(e), b.push(e.uid);
32
+ }, B = (t) => {
33
+ v.delete(t);
34
+ const e = Object.values(d).filter(
32
35
  (o) => o.uid !== t
33
36
  );
34
37
  if (e.length > 1) {
@@ -37,73 +40,75 @@ const G = { class: "flex-1" }, J = ["onClick"], K = { class: "before:bg-border b
37
40
  } else e.length === 1 && e[0].uid === "default" && b.push("default");
38
41
  }, h = V(() => {
39
42
  const t = {};
40
- return Object.values(p).forEach((e) => {
43
+ return Object.values(d).forEach((e) => {
41
44
  e.domain && e.path && (t[e.domain] || (t[e.domain] = {}), t[e.domain][e.path] || (t[e.domain][e.path] = []), t[e.domain][e.path].push(e));
42
45
  }), t;
43
- }), C = (t) => i[t];
46
+ }), w = (t) => i[t], S = (t) => {
47
+ t != null && t.createNew && z.name === "cookies" && C();
48
+ };
44
49
  return D(() => {
45
50
  const t = Object.keys(h.value), e = Object.entries(h.value).flatMap(
46
- ([o, r]) => Object.keys(r).map((d) => o + d)
51
+ ([o, r]) => Object.keys(r).map((p) => o + p)
47
52
  );
48
53
  t.forEach((o) => {
49
54
  i[o] = !0;
50
55
  }), e.forEach((o) => {
51
56
  i[o] = !0;
52
- });
53
- }), (t, e) => (l(), y(F, null, {
57
+ }), g.hotKeys.on(S);
58
+ }), M(() => g.hotKeys.off(S)), (t, e) => (n(), O(H, null, {
54
59
  default: a(() => [
55
- s(n(q), { title: "Cookies" }, {
60
+ s(l(Q), { title: "Cookies" }, {
56
61
  content: a(() => [
57
- f("div", G, [
58
- s(N, null, {
62
+ f("div", X, [
63
+ s(F, null, {
59
64
  default: a(() => [
60
- (l(!0), m(_, null, v(h.value, (o, r) => (l(), m("div", { key: r }, [
65
+ (n(!0), m(_, null, x(h.value, (o, r) => (n(), m("div", { key: r }, [
61
66
  f("button", {
62
67
  class: "flex font-medium gap-1.5 items-center px-2 py-1.5 text-left text-sm w-full break-words rounded hover:bg-b-2",
63
68
  type: "button",
64
- onClick: (d) => n(k)(r)
69
+ onClick: (p) => l(y)(r)
65
70
  }, [
66
- s(n(j), {
67
- class: w(["text-c-3", {
68
- "rotate-90": n(i)[r]
71
+ s(l(N), {
72
+ class: $(["text-c-3", {
73
+ "rotate-90": l(i)[r]
69
74
  }]),
70
75
  icon: "ChevronRight",
71
76
  size: "sm",
72
77
  thickness: "2.5"
73
78
  }, null, 8, ["class"]),
74
- x(" " + S(r), 1)
75
- ], 8, J),
76
- O(f("div", K, [
77
- (l(!0), m(_, null, v(o, (d, c) => (l(), m("div", { key: c }, [
79
+ k(" " + j(r), 1)
80
+ ], 8, Y),
81
+ A(f("div", Z, [
82
+ (n(!0), m(_, null, x(o, (p, c) => (n(), m("div", { key: c }, [
78
83
  f("button", {
79
84
  class: "flex font-medium gap-1.5 items-center pl-5 pr-2 py-1.5 text-left text-sm w-full break-words rounded hover:bg-b-2",
80
85
  type: "button",
81
- onClick: (u) => n(k)(r + c)
86
+ onClick: (u) => l(y)(r + c)
82
87
  }, [
83
- s(n(j), {
84
- class: w(["text-c-3", {
85
- "rotate-90": n(i)[r + c]
88
+ s(l(N), {
89
+ class: $(["text-c-3", {
90
+ "rotate-90": l(i)[r + c]
86
91
  }]),
87
92
  icon: "ChevronRight",
88
93
  size: "sm",
89
94
  thickness: "2.5"
90
95
  }, null, 8, ["class"]),
91
- x(" " + S(c), 1)
92
- ], 8, Q),
93
- O(f("div", U, [
94
- (l(!0), m(_, null, v(d, (u) => (l(), y(B, {
96
+ k(" " + j(c), 1)
97
+ ], 8, ee),
98
+ A(f("div", te, [
99
+ (n(!0), m(_, null, x(p, (u) => (n(), O(K, {
95
100
  key: u.uid,
96
101
  class: "cookie text-xs",
97
102
  variable: { name: u.name, uid: u.uid },
98
103
  warningMessage: "Are you sure you want to delete this cookie?",
99
- onDelete: (Y) => z(u.uid)
104
+ onDelete: (re) => B(u.uid)
100
105
  }, null, 8, ["variable", "onDelete"]))), 128))
101
106
  ], 512), [
102
- [$, C(r + c)]
107
+ [E, w(r + c)]
103
108
  ])
104
109
  ]))), 128))
105
110
  ], 512), [
106
- [$, C(r)]
111
+ [E, w(r)]
107
112
  ])
108
113
  ]))), 128))
109
114
  ]),
@@ -112,19 +117,23 @@ const G = { class: "flex-1" }, J = ["onClick"], K = { class: "before:bg-border b
112
117
  ])
113
118
  ]),
114
119
  button: a(() => [
115
- s(M, { click: E }, {
120
+ s(R, {
121
+ click: C,
122
+ hotkey: "N",
123
+ isApp: t.isApp
124
+ }, {
116
125
  title: a(() => e[0] || (e[0] = [
117
- x("Add Item")
126
+ k("Add Cookie")
118
127
  ])),
119
128
  _: 1
120
- })
129
+ }, 8, ["isApp"])
121
130
  ]),
122
131
  _: 1
123
132
  }),
124
133
  s(I, { class: "flex-1" }, {
125
134
  default: a(() => [
126
- s(H),
127
- s(P)
135
+ s(W),
136
+ s(q)
128
137
  ]),
129
138
  _: 1
130
139
  })
@@ -134,5 +143,5 @@ const G = { class: "flex-1" }, J = ["onClick"], K = { class: "before:bg-border b
134
143
  }
135
144
  });
136
145
  export {
137
- de as default
146
+ xe as default
138
147
  };
@@ -1,3 +1,7 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
1
+ declare const _default: import("vue").DefineComponent<{
2
+ isApp: boolean;
3
+ }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
4
+ isApp: boolean;
5
+ }> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
2
6
  export default _default;
3
7
  //# sourceMappingURL=Environment.vue.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Environment.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Environment/Environment.vue"],"names":[],"mappings":";AA6fA,wBAKG"}
1
+ {"version":3,"file":"Environment.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Environment/Environment.vue"],"names":[],"mappings":";WAmMS,OAAO;;WAAP,OAAO;;AA6VhB,wBAMG"}
@@ -1,56 +1,61 @@
1
- import { defineComponent as C, ref as d, onMounted as V, openBlock as r, createBlock as v, withCtx as o, createVNode as u, createElementVNode as _, createElementBlock as c, Fragment as w, renderList as S, unref as i, createTextVNode as I, createSlots as $, createCommentVNode as h, toDisplayString as L, withKeys as B, nextTick as R } from "vue";
2
- import A from "../../components/CodeInput/CodeInput.vue.js";
3
- import K from "../../components/Sidebar/Sidebar.vue.js";
4
- import M from "../../components/Sidebar/SidebarButton.vue.js";
5
- import T from "../../components/Sidebar/SidebarList.vue.js";
6
- import U from "../../components/Sidebar/SidebarListElement.vue.js";
7
- import j from "../../components/ViewLayout/ViewLayout.vue.js";
8
- import F from "../../components/ViewLayout/ViewLayoutContent.vue.js";
9
- import J from "../../components/ViewLayout/ViewLayoutSection.vue.js";
10
- import { environmentSchema as O } from "@scalar/oas-utils/entities/environment";
11
- import { nanoid as W } from "nanoid";
12
- import { useRouter as q } from "vue-router";
13
- import z from "./EnvironmentColors.vue.js";
14
- import { useWorkspace as G } from "../../store/store.js";
15
- const H = { class: "flex-1" }, P = ["value"], Q = { class: "colors ml-auto" }, ve = /* @__PURE__ */ C({
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({
16
16
  __name: "Environment",
17
- setup(X) {
18
- const f = q(), { environments: l, environmentMutators: s } = G(), e = d(null), p = d(null), m = d(!1);
17
+ props: {
18
+ isApp: { type: Boolean }
19
+ },
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);
19
22
  function y() {
20
- const t = O.parse({
23
+ const t = q.parse({
21
24
  name: "New Environment",
22
- uid: W(),
25
+ uid: z(),
23
26
  color: "grey",
24
27
  raw: JSON.stringify({ exampleKey: "exampleValue" }, null, 2),
25
28
  parsed: [],
26
29
  isDefault: !1
27
30
  });
28
- s.add(t), e.value = t.uid, f.push(e.value);
31
+ s.add(t), e.value = t.uid, g.push(e.value);
29
32
  }
30
- function E(t) {
33
+ function x(t) {
31
34
  e.value && s.edit(e.value, "value", t);
32
35
  }
33
- const g = (t) => {
36
+ const N = (t) => {
34
37
  s.delete(t), e.value === t && (e.value = null);
35
- }, k = (t) => e.value && s.edit(e.value, "color", t), x = () => {
36
- f.currentRoute.value.params.environment === "default" && (e.value = l.default.uid);
37
- }, D = () => {
38
- e.value && !l[e.value].isDefault && (m.value = !0, R(() => {
38
+ }, D = (t) => e.value && s.edit(e.value, "color", t), b = () => {
39
+ e.value && !o[e.value].isDefault && (m.value = !0, M(() => {
39
40
  var t;
40
- (t = p.value) == null || t.focus();
41
+ (t = v.value) == null || t.focus();
41
42
  }));
42
- }, N = (t) => {
43
+ }, h = (t) => {
43
44
  const n = t.target.value;
44
- e.value && !l[e.value].isDefault && s.edit(e.value, "name", n);
45
+ e.value && !o[e.value].isDefault && s.edit(e.value, "name", n);
46
+ }, _ = (t) => {
47
+ t != null && t.createNew && E.name === "environment" && y();
45
48
  };
46
- return V(x), (t, a) => (r(), v(j, null, {
47
- default: o(() => [
48
- u(K, { title: "Environment" }, {
49
- content: o(() => [
50
- _("div", H, [
51
- u(T, null, {
52
- default: o(() => [
53
- (r(!0), c(w, null, S(i(l), (n) => (r(), v(U, {
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, {
54
59
  key: n.uid,
55
60
  class: "text-xs",
56
61
  variable: {
@@ -60,61 +65,65 @@ const H = { class: "flex-1" }, P = ["value"], Q = { class: "colors ml-auto" }, v
60
65
  isDefault: n.isDefault
61
66
  },
62
67
  warningMessage: "Are you sure you want to delete this environment?",
63
- onClick: (b) => e.value = n.uid,
64
- onDelete: (b) => g(n.uid)
68
+ onClick: (w) => e.value = n.uid,
69
+ onDelete: (w) => N(n.uid)
65
70
  }, null, 8, ["variable", "onClick", "onDelete"]))), 128))
66
71
  ]),
67
72
  _: 1
68
73
  })
69
74
  ])
70
75
  ]),
71
- button: o(() => [
72
- u(M, { click: y }, {
73
- title: o(() => a[2] || (a[2] = [
74
- I("Add Environment")
76
+ button: l(() => [
77
+ u(j, {
78
+ click: y,
79
+ hotkey: "N",
80
+ isApp: t.isApp
81
+ }, {
82
+ title: l(() => a[2] || (a[2] = [
83
+ B("Add Environment")
75
84
  ])),
76
85
  _: 1
77
- })
86
+ }, 8, ["isApp"])
78
87
  ]),
79
88
  _: 1
80
89
  }),
81
- u(F, { class: "flex-1" }, {
82
- default: o(() => [
83
- u(J, null, $({
84
- default: o(() => [
85
- e.value ? (r(), v(A, {
90
+ u(O, { class: "flex-1" }, {
91
+ default: l(() => [
92
+ u(W, null, K({
93
+ default: l(() => [
94
+ e.value ? (r(), c(U, {
86
95
  key: 0,
87
96
  class: "pl-px pr-2 md:px-2 py-2.5",
88
97
  language: "json",
89
98
  lineNumbers: "",
90
- modelValue: i(l)[e.value].value,
91
- "onUpdate:modelValue": E
92
- }, null, 8, ["modelValue"])) : h("", !0)
99
+ modelValue: i(o)[e.value].value,
100
+ "onUpdate:modelValue": x
101
+ }, null, 8, ["modelValue"])) : I("", !0)
93
102
  ]),
94
103
  _: 2
95
104
  }, [
96
105
  e.value ? {
97
106
  name: "title",
98
- fn: o(() => [
99
- !m.value || i(l)[e.value].isDefault ? (r(), c("span", {
107
+ fn: l(() => [
108
+ !m.value || i(o)[e.value].isDefault ? (r(), d("span", {
100
109
  key: 0,
101
- onDblclick: D
102
- }, L(i(l)[e.value].name), 33)) : (r(), c("input", {
110
+ onDblclick: b
111
+ }, L(i(o)[e.value].name), 33)) : (r(), d("input", {
103
112
  key: 1,
104
113
  ref_key: "nameInputRef",
105
- ref: p,
114
+ ref: v,
106
115
  class: "ring-1 ring-offset-4 ring-b-outline rounded",
107
116
  spellcheck: "false",
108
117
  type: "text",
109
- value: i(l)[e.value].name,
118
+ value: i(o)[e.value].name,
110
119
  onBlur: a[0] || (a[0] = (n) => m.value = !1),
111
- onInput: N,
112
- onKeyup: a[1] || (a[1] = B((n) => m.value = !1, ["enter"]))
113
- }, null, 40, P)),
114
- _("div", Q, [
115
- u(z, {
116
- activeColor: i(l)[e.value].color,
117
- onSelect: k
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
118
127
  }, null, 8, ["activeColor"])
119
128
  ])
120
129
  ]),
@@ -130,5 +139,5 @@ const H = { class: "flex-1" }, P = ["value"], Q = { class: "colors ml-auto" }, v
130
139
  }
131
140
  });
132
141
  export {
133
- ve as default
142
+ ye as default
134
143
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Request.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/Request.vue"],"names":[],"mappings":";;cA8lB8B,MAAM;aAAO,MAAM;;;;cAAnB,MAAM;aAAO,MAAM;;;AANjD,wBAQG"}
1
+ {"version":3,"file":"Request.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/Request.vue"],"names":[],"mappings":";;cAkoB8B,MAAM;aAAO,MAAM;;;;cAAnB,MAAM;aAAO,MAAM;;;AANjD,wBAQG"}
@@ -1,7 +1,7 @@
1
1
  import o from "./Request.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-e56f92be"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-b089a05e"]]);
5
5
  export {
6
6
  m as default
7
7
  };