@scalar/api-client 2.0.47 → 2.0.48

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 (72) hide show
  1. package/CHANGELOG.md +25 -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 +77 -71
  5. package/dist/components/CodeInput/CodeInput.vue.d.ts +3 -1
  6. package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
  7. package/dist/components/CodeInput/CodeInput.vue.js +2 -2
  8. package/dist/components/CodeInput/CodeInput.vue2.js +49 -44
  9. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -1
  10. package/dist/components/CommandPalette/TheCommandPalette.vue.js +2 -2
  11. package/dist/components/CommandPalette/TheCommandPalette.vue2.js +97 -106
  12. package/dist/components/Sidebar/Sidebar.vue.d.ts +24 -3
  13. package/dist/components/Sidebar/Sidebar.vue.d.ts.map +1 -1
  14. package/dist/components/Sidebar/Sidebar.vue.js +57 -19
  15. package/dist/components/TopNav/TopNav.vue.d.ts.map +1 -1
  16. package/dist/components/TopNav/TopNav.vue.js +1 -1
  17. package/dist/components/TopNav/TopNav.vue2.js +46 -43
  18. package/dist/index.d.ts +1 -1
  19. package/dist/index.d.ts.map +1 -1
  20. package/dist/index.js +9 -9
  21. package/dist/layouts/App/ApiClientApp.vue.js +1 -1
  22. package/dist/layouts/App/create-api-client-app.d.ts +56 -46
  23. package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
  24. package/dist/layouts/Modal/ApiClientModal.vue.d.ts.map +1 -1
  25. package/dist/layouts/Modal/ApiClientModal.vue.js +2 -2
  26. package/dist/layouts/Modal/ApiClientModal.vue2.js +20 -20
  27. package/dist/layouts/Modal/create-api-client-modal.d.ts +112 -92
  28. package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
  29. package/dist/libs/create-client.d.ts +56 -46
  30. package/dist/libs/create-client.d.ts.map +1 -1
  31. package/dist/libs/event-busses/{command-palette.d.ts → command-palette-bus.d.ts} +1 -1
  32. package/dist/libs/event-busses/command-palette-bus.d.ts.map +1 -0
  33. package/dist/libs/event-busses/{execute-requestBus.d.ts → execute-request-bus.d.ts} +1 -1
  34. package/dist/libs/event-busses/execute-request-bus.d.ts.map +1 -0
  35. package/dist/libs/event-busses/hot-keys-bus.d.ts +33 -0
  36. package/dist/libs/event-busses/hot-keys-bus.d.ts.map +1 -0
  37. package/dist/libs/event-busses/hot-keys-bus.js +33 -0
  38. package/dist/libs/event-busses/index.d.ts +3 -3
  39. package/dist/libs/event-busses/index.d.ts.map +1 -1
  40. package/dist/libs/event-busses/index.js +3 -3
  41. package/dist/libs/index.js +3 -3
  42. package/dist/libs/local-storage.d.ts +1 -1
  43. package/dist/libs/local-storage.d.ts.map +1 -1
  44. package/dist/libs/local-storage.js +15 -30
  45. package/dist/router.d.ts +2 -2
  46. package/dist/router.d.ts.map +1 -1
  47. package/dist/router.js +3 -3
  48. package/dist/store/workspace.d.ts +112 -92
  49. package/dist/store/workspace.d.ts.map +1 -1
  50. package/dist/store/workspace.js +140 -137
  51. package/dist/style.css +1 -1
  52. package/dist/views/Request/Request.vue.d.ts.map +1 -1
  53. package/dist/views/Request/Request.vue.js +1 -1
  54. package/dist/views/Request/Request.vue2.js +135 -131
  55. package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
  56. package/dist/views/Request/RequestSidebarItem.vue.js +1 -1
  57. package/dist/views/Request/RequestSidebarItem.vue2.js +252 -138
  58. package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts +27 -5
  59. package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts.map +1 -1
  60. package/dist/views/Request/RequestSidebarItemMenu.vue.js +4 -4
  61. package/dist/views/Request/RequestSidebarItemMenu.vue2.js +83 -158
  62. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  63. package/dist/views/Request/components/WorkspaceDropdown.vue.d.ts.map +1 -1
  64. package/dist/views/Request/components/WorkspaceDropdown.vue.js +214 -70
  65. package/package.json +6 -6
  66. package/dist/libs/event-busses/command-palette.d.ts.map +0 -1
  67. package/dist/libs/event-busses/execute-requestBus.d.ts.map +0 -1
  68. package/dist/libs/event-busses/hot-key.d.ts +0 -34
  69. package/dist/libs/event-busses/hot-key.d.ts.map +0 -1
  70. package/dist/libs/event-busses/hot-key.js +0 -25
  71. /package/dist/libs/event-busses/{command-palette.js → command-palette-bus.js} +0 -0
  72. /package/dist/libs/event-busses/{execute-requestBus.js → execute-request-bus.js} +0 -0
@@ -1,32 +1,31 @@
1
- import { defineComponent as K, ref as u, computed as N, onMounted as F, onBeforeUnmount as I, openBlock as a, createElementBlock as s, Fragment as d, withDirectives as k, createElementVNode as c, vShow as L, unref as p, createVNode as S, vModelText as q, renderList as V, toDisplayString as B, normalizeClass as T, createTextVNode as U, createCommentVNode as G, createBlock as H, resolveDynamicComponent as O } from "vue";
2
- import { useModal as Q, ScalarIcon as g } from "@scalar/components";
3
- import { useMagicKeys as j, whenever as b } from "@vueuse/core";
1
+ import { defineComponent as M, ref as d, computed as N, onMounted as F, onBeforeUnmount as q, openBlock as n, createElementBlock as s, Fragment as f, withDirectives as h, createElementVNode as m, vShow as x, unref as p, createVNode as w, vModelText as K, renderList as P, toDisplayString as B, normalizeClass as T, createTextVNode as U, createCommentVNode as H, createBlock as G, resolveDynamicComponent as Q } from "vue";
2
+ import { useModal as j, ScalarIcon as y } from "@scalar/components";
4
3
  import { useRouter as J } from "vue-router";
5
- import { isMacOS as X } from "@scalar/use-tooltip";
6
- import { useWorkspace as Y } from "../../store/workspace.js";
7
- import Z from "./CommandPaletteCollection.vue.js";
8
- import ee from "./CommandPaletteExample.vue.js";
9
- import oe from "./CommandPaletteFolder.vue.js";
10
- import te from "./CommandPaletteImport.vue.js";
11
- import ne from "./CommandPaletteRequest.vue.js";
12
- import ae from "./CommandPaletteWorkspace.vue.js";
13
- import { commandPaletteBus as M } from "../../libs/event-busses/command-palette.js";
14
- const le = { class: "commandmenu" }, re = { class: "bg-b-2 flex items-center rounded mb-2 pl-2 focus-within:bg-b-1 focus-within:shadow-border" }, se = { for: "commandmenu" }, me = ["onClick"], ce = {
4
+ import { useWorkspace as O } from "../../store/workspace.js";
5
+ import X from "./CommandPaletteCollection.vue.js";
6
+ import Y from "./CommandPaletteExample.vue.js";
7
+ import Z from "./CommandPaletteFolder.vue.js";
8
+ import ee from "./CommandPaletteImport.vue.js";
9
+ import oe from "./CommandPaletteRequest.vue.js";
10
+ import te from "./CommandPaletteWorkspace.vue.js";
11
+ import { commandPaletteBus as E } from "../../libs/event-busses/command-palette-bus.js";
12
+ import { hotKeyBus as I } from "../../libs/event-busses/hot-keys-bus.js";
13
+ const ne = { class: "commandmenu" }, ae = { class: "bg-b-2 flex items-center rounded mb-2 pl-2 focus-within:bg-b-1 focus-within:shadow-border" }, le = { for: "commandmenu" }, se = ["onClick"], ce = {
15
14
  key: 0,
16
15
  class: "text-c-3 text-center text-sm p-2 pt-3"
17
- }, ie = {
16
+ }, me = {
18
17
  name: "TheCommandPalette"
19
- }, ue = {
20
- "Import Collection": te,
21
- "Create Request": ne,
22
- "Create Workspace": ae,
23
- "Add Folder": oe,
24
- "Create Collection": Z,
25
- "Add Example": ee
26
- }, Se = /* @__PURE__ */ K({
27
- ...ie,
28
- setup(de) {
29
- const w = [
18
+ }, re = {
19
+ "Import Collection": ee,
20
+ "Create Request": oe,
21
+ "Create Workspace": te,
22
+ "Add Folder": Z,
23
+ "Create Collection": X,
24
+ "Add Example": Y
25
+ }, ye = /* @__PURE__ */ M({
26
+ ...me,
27
+ setup(ie) {
28
+ const C = [
30
29
  {
31
30
  label: "Add to Request Sidebar",
32
31
  commands: [
@@ -76,140 +75,132 @@ const le = { class: "commandmenu" }, re = { class: "bg-b-2 flex items-center rou
76
75
  }
77
76
  ]
78
77
  }
79
- ], v = j(), l = Q(), { push: P } = J(), { activeWorkspace: W } = Y(), A = u(), i = u(""), m = u(null), o = u(-1), _ = u([]), f = N(
80
- () => w.reduce((e, n) => {
81
- const t = n.commands.filter(
82
- (C) => C.name.toLowerCase().includes(i.value.toLowerCase())
78
+ ], r = j(), { push: V } = J(), { activeWorkspace: W } = O(), S = d(), i = d(""), u = d(null), a = d(-1), $ = d([]), k = N(
79
+ () => C.reduce((e, t) => {
80
+ const o = t.commands.filter(
81
+ (c) => c.name.toLowerCase().includes(i.value.toLowerCase())
83
82
  );
84
- return [...e, ...t];
83
+ return [...e, ...o];
85
84
  }, [])
86
- ), h = () => {
87
- l.hide(), i.value = "", m.value = null, window.removeEventListener("keydown", y, !0), o.value = -1;
88
- };
89
- b(v.escape, () => {
90
- l.open && h();
91
- }), b(v.enter, () => {
92
- if (!l.open || o.value === -1) return;
93
- const e = f.value[o.value];
94
- $(e);
95
- }), b(v.ArrowDown, () => {
96
- var e;
97
- l.open && (o.value < f.value.length - 1 ? o.value++ : o.value = 0, (e = _.value[o.value]) == null || e.scrollIntoView({
98
- behavior: "smooth",
99
- block: "center"
100
- }));
101
- }), b(v.ArrowUp, () => {
102
- var e;
103
- l.open && (o.value > 0 ? o.value-- : o.value = f.value.length - 1, (e = _.value[o.value]) == null || e.scrollIntoView({
104
- behavior: "smooth",
105
- block: "center"
106
- }));
107
- });
108
- const $ = (e) => {
109
- "path" in e ? (P(`/workspace/${W.value.uid}${e.path}`), h()) : m.value = e.name;
110
- }, D = u(), R = ({
85
+ ), v = () => {
86
+ r.hide(), i.value = "", u.value = null, a.value = -1;
87
+ }, A = (e) => {
88
+ "path" in e ? (V(`/workspace/${W.value.uid}${e.path}`), v()) : u.value = e.name;
89
+ }, R = d(), g = ({
111
90
  commandName: e,
112
- metaData: n
91
+ metaData: t
113
92
  } = {}) => {
114
- var t;
115
- m.value = e ?? null, A.value = n, l.show(), (t = D.value) == null || t.focus(), window.addEventListener("keydown", y, !0);
116
- };
117
- F(() => M.on(R)), I(() => M.off(R));
118
- const z = (e) => X() ? e.metaKey && e.key === "Enter" : e.ctrlKey && e.key === "Enter", y = (e) => {
119
- z(e) && !m.value && (e.stopPropagation(), e.preventDefault());
93
+ var o;
94
+ u.value = e ?? null, S.value = t, r.show(), (o = R.value) == null || o.focus();
95
+ }, L = (e) => {
96
+ var c;
97
+ if (!r.open) return;
98
+ const t = e === "up" ? -1 : 1, o = k.value.length;
99
+ a.value = (a.value + t + o) % o, (c = $.value[a.value]) == null || c.scrollIntoView({
100
+ behavior: "smooth",
101
+ block: "center"
102
+ });
103
+ }, z = () => {
104
+ if (a.value === -1) return;
105
+ const e = k.value[a.value];
106
+ A(e);
107
+ }, D = (e) => {
108
+ r.open && (e.closeModal && v(), e.commandPaletteUp && L("up"), e.commandPaletteDown && L("down"), e.commandPaletteSelect && z());
120
109
  };
121
- return I(() => {
122
- window.removeEventListener("keydown", y, !0);
123
- }), (e, n) => (a(), s(d, null, [
124
- k(c("div", {
110
+ return F(() => {
111
+ E.on(g), I.on(D);
112
+ }), q(() => {
113
+ E.off(g), I.off(D);
114
+ }), (e, t) => (n(), s(f, null, [
115
+ h(m("div", {
125
116
  class: "commandmenu-clickout",
126
- onClick: n[0] || (n[0] = (t) => h())
117
+ onClick: t[0] || (t[0] = (o) => v())
127
118
  }, null, 512), [
128
- [L, p(l).open]
119
+ [x, p(r).open]
129
120
  ]),
130
- k(c("div", le, [
131
- m.value ? (a(), s(d, { key: 1 }, [
132
- c("button", {
121
+ h(m("div", ne, [
122
+ u.value ? (n(), s(f, { key: 1 }, [
123
+ m("button", {
133
124
  class: "absolute p-0.75 hover:bg-b-3 rounded text-c-3 active:text-c-1 m-1.5 z-10",
134
125
  type: "button",
135
- onClick: n[2] || (n[2] = (t) => m.value = null)
126
+ onClick: t[2] || (t[2] = (o) => u.value = null)
136
127
  }, [
137
- S(p(g), {
128
+ w(p(y), {
138
129
  icon: "ChevronLeft",
139
130
  size: "md",
140
131
  thickness: "1.5"
141
132
  })
142
133
  ]),
143
- (a(), H(O(ue[m.value]), {
144
- metaData: A.value,
145
- onClose: h
134
+ (n(), G(Q(re[u.value]), {
135
+ metaData: S.value,
136
+ onClose: v
146
137
  }, null, 40, ["metaData"]))
147
- ], 64)) : (a(), s(d, { key: 0 }, [
148
- c("div", re, [
149
- c("label", se, [
150
- S(p(g), {
138
+ ], 64)) : (n(), s(f, { key: 0 }, [
139
+ m("div", ae, [
140
+ m("label", le, [
141
+ w(p(y), {
151
142
  class: "text-c-1 mr-2.5",
152
143
  icon: "Search",
153
144
  size: "sm",
154
145
  thickness: "1.5"
155
146
  })
156
147
  ]),
157
- k(c("input", {
148
+ h(m("input", {
158
149
  id: "commandmenu",
159
150
  ref_key: "commandInputRef",
160
- ref: D,
161
- "onUpdate:modelValue": n[1] || (n[1] = (t) => i.value = t),
151
+ ref: R,
152
+ "onUpdate:modelValue": t[1] || (t[1] = (o) => i.value = o),
162
153
  autocomplete: "off",
163
154
  autofocus: "",
164
155
  class: "w-full rounded bg-none border-none py-1.5 text-sm focus:outline-none",
165
156
  placeholder: "Search commands...",
166
157
  type: "text"
167
158
  }, null, 512), [
168
- [q, i.value]
159
+ [K, i.value]
169
160
  ])
170
161
  ]),
171
- (a(), s(d, null, V(w, (t, C) => (a(), s(d, {
172
- key: t.label
162
+ (n(), s(f, null, P(C, (o, c) => (n(), s(f, {
163
+ key: o.label
173
164
  }, [
174
- k(c("div", { class: "text-c-3 font-medium text-xs mt-2" }, B(t.label), 513), [
165
+ h(m("div", { class: "text-c-3 font-medium text-xs mt-2" }, B(o.label), 513), [
175
166
  [
176
- L,
177
- t.commands.filter(
178
- (r) => r.name.toLowerCase().includes(i.value.toLowerCase())
167
+ x,
168
+ o.commands.filter(
169
+ (l) => l.name.toLowerCase().includes(i.value.toLowerCase())
179
170
  ).length > 0
180
171
  ]
181
172
  ]),
182
- (a(!0), s(d, null, V(t.commands.filter(
183
- (r) => r.name.toLowerCase().includes(i.value.toLowerCase())
184
- ), (r, x) => (a(), s("div", {
185
- key: r.name,
173
+ (n(!0), s(f, null, P(o.commands.filter(
174
+ (l) => l.name.toLowerCase().includes(i.value.toLowerCase())
175
+ ), (l, _) => (n(), s("div", {
176
+ key: l.name,
186
177
  ref_for: !0,
187
- ref: (E) => {
188
- E && (_.value[x] = E);
178
+ ref: (b) => {
179
+ b && ($.value[_] = b);
189
180
  },
190
181
  class: T(["commandmenu-item text-sm flex items-center py-1.5 px-2 rounded hover:bg-b-2 cursor-pointer", {
191
- "bg-b-2": C > 0 ? o.value === x + w[C - 1].commands.length : o.value === x
182
+ "bg-b-2": c > 0 ? a.value === _ + C[c - 1].commands.length : a.value === _
192
183
  }]),
193
- onClick: (E) => $(r)
184
+ onClick: (b) => A(l)
194
185
  }, [
195
- S(p(g), {
186
+ w(p(y), {
196
187
  class: "text-c-1 mr-2.5",
197
- icon: r.icon,
188
+ icon: l.icon,
198
189
  size: "md",
199
190
  thickness: "1.5"
200
191
  }, null, 8, ["icon"]),
201
- U(" " + B(r.name), 1)
202
- ], 10, me))), 128))
192
+ U(" " + B(l.name), 1)
193
+ ], 10, se))), 128))
203
194
  ], 64))), 64)),
204
- f.value.length ? G("", !0) : (a(), s("div", ce, " No commands found "))
195
+ k.value.length ? H("", !0) : (n(), s("div", ce, " No commands found "))
205
196
  ], 64))
206
197
  ], 512), [
207
- [L, p(l).open]
198
+ [x, p(r).open]
208
199
  ])
209
200
  ], 64));
210
201
  }
211
202
  });
212
203
  export {
213
- ue as PaletteComponents,
214
- Se as default
204
+ re as PaletteComponents,
205
+ ye as default
215
206
  };
@@ -1,15 +1,36 @@
1
1
  declare function __VLS_template(): {
2
2
  header?(_: {}): any;
3
+ title?(_: {}): any;
3
4
  content?(_: {}): any;
4
5
  button?(_: {}): any;
5
6
  };
6
- declare const __VLS_component: import("vue").DefineComponent<__VLS_TypePropsToOption<{
7
+ declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<{
7
8
  title?: string;
8
- }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<{
9
+ showSideBar: boolean;
10
+ }>, {
11
+ showSideBar: boolean;
12
+ }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
13
+ "update:showSideBar": (v: boolean) => void;
14
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<{
9
15
  title?: string;
10
- }>>>, {}, {}>;
16
+ showSideBar: boolean;
17
+ }>, {
18
+ showSideBar: boolean;
19
+ }>>> & {
20
+ "onUpdate:showSideBar"?: ((v: boolean) => any) | undefined;
21
+ }, {
22
+ showSideBar: boolean;
23
+ }, {}>;
11
24
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
12
25
  export default _default;
26
+ type __VLS_WithDefaults<P, D> = {
27
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
28
+ default: D[K];
29
+ }> : P[K];
30
+ };
31
+ type __VLS_Prettify<T> = {
32
+ [K in keyof T]: T[K];
33
+ } & {};
13
34
  type __VLS_WithTemplateSlots<T, S> = T & {
14
35
  new (): {
15
36
  $slots: S;
@@ -1 +1 @@
1
- {"version":3,"file":"Sidebar.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Sidebar/Sidebar.vue"],"names":[],"mappings":"AAuDA,iBAAS,cAAc;oBAwDK,GAAG;qBACF,GAAG;oBACJ,GAAG;EAe9B;AACD,QAAA,MAAM,eAAe;YApFW,MAAM;;YAAN,MAAM;aA0FpC,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAAvG,wBAAwG;AAOxG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACpC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC;AAEN,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
+ {"version":3,"file":"Sidebar.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Sidebar/Sidebar.vue"],"names":[],"mappings":"AA+QA,iBAAS,cAAc;oBAqEK,GAAG;mBACJ,GAAG;qBACD,GAAG;oBACJ,GAAG;EAoB9B;AACD,QAAA,MAAM,eAAe;YAlMW,MAAM;iBAAe,OAAO;;;;;;YAA5B,MAAM;iBAAe,OAAO;;;;;;iBAAP,OAAO;MAyM1D,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAAvG,wBAAwG;AAOxG,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,CAAC;CAAG,GAAG,EAAE,CAAC;AAExD,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACpC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC;AAEN,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,31 +1,69 @@
1
- import { defineComponent as a, openBlock as o, createElementBlock as r, renderSlot as t, unref as l, createElementVNode as n, toDisplayString as i, createCommentVNode as d, normalizeClass as m } from "vue";
2
- import { useWorkspace as c } from "../../store/workspace.js";
3
- const p = { class: "w-sidebar relative flex flex-col border-r-1/2 bg-b-1" }, b = {
1
+ import { defineComponent as B, ref as n, watch as L, onMounted as W, withDirectives as k, openBlock as h, createElementBlock as v, normalizeClass as g, normalizeStyle as D, renderSlot as a, unref as b, createElementVNode as i, createCommentVNode as I, vShow as _ } from "vue";
2
+ import { useWorkspace as $ } from "../../store/workspace.js";
3
+ const C = {
4
4
  key: 0,
5
5
  class: "xl:min-h-header py-2.5 flex items-center border-b-1/2 px-4 text-sm"
6
- }, f = { class: "font-medium m-0 text-sm" }, x = /* @__PURE__ */ a({
6
+ }, z = { class: "font-medium m-0 text-sm whitespace-nowrap" }, X = /* @__PURE__ */ B({
7
7
  __name: "Sidebar",
8
8
  props: {
9
- title: {}
9
+ title: {},
10
+ showSideBar: { type: Boolean, default: !0 }
10
11
  },
11
- setup(h) {
12
- const { isReadOnly: s } = c();
13
- return (e, u) => (o(), r("aside", p, [
14
- t(e.$slots, "header"),
15
- !l(s) && e.title ? (o(), r("div", b, [
16
- n("h2", f, i(e.title), 1)
17
- ])) : d("", !0),
18
- n("div", {
19
- class: m(["custom-scroll sidebar-height", {
20
- "sidebar-mask": !l(s)
12
+ emits: ["update:showSideBar"],
13
+ setup(w, { emit: S }) {
14
+ const d = w, l = S, { isReadOnly: c } = $(), r = n(!1), m = n(null), s = n(localStorage.getItem("sidebarWidth") || "280px"), u = () => {
15
+ (s.value === "0px" || localStorage.getItem("sidebarWidth") === "0px") && (s.value = "280px");
16
+ }, x = (e) => {
17
+ e.preventDefault();
18
+ const o = e.clientX, y = parseInt(
19
+ getComputedStyle(m.value).width || "280px",
20
+ 10
21
+ ), p = (E) => {
22
+ r.value = !0, document.body.classList.add("dragging");
23
+ let t = y + E.clientX - o;
24
+ t > 420 && (t = 420 + (t - 420) * 0.2), t < 240 ? (t = 0, l("update:showSideBar", !1)) : l("update:showSideBar", !0), s.value = `${t}px`, localStorage.setItem("sidebarWidth", `${Math.min(t, 420)}px`);
25
+ }, f = () => {
26
+ r.value = !1, document.body.classList.remove("dragging"), document.documentElement.removeEventListener("mousemove", p, !1), document.documentElement.removeEventListener("mouseup", f, !1), parseInt(s.value, 10) > 420 && (s.value = "360px");
27
+ };
28
+ document.documentElement.addEventListener("mousemove", p, !1), document.documentElement.addEventListener("mouseup", f, !1);
29
+ };
30
+ return L(
31
+ () => d.showSideBar,
32
+ (e) => {
33
+ const o = document.querySelector(".sidebar");
34
+ o && (e ? o.classList.remove("blur-content") : (o.classList.add("blur-content"), document.body.classList.remove("dragging"))), u();
35
+ }
36
+ ), W(() => {
37
+ u();
38
+ }), (e, o) => k((h(), v("aside", {
39
+ ref_key: "sidebarRef",
40
+ ref: m,
41
+ class: g(["sidebar overflow-hidden relative flex flex-col border-r-1/2 bg-b-1", { dragging: r.value }]),
42
+ style: D({ width: s.value })
43
+ }, [
44
+ a(e.$slots, "header"),
45
+ !b(c) && e.title ? (h(), v("div", C, [
46
+ i("h2", z, [
47
+ a(e.$slots, "title")
48
+ ])
49
+ ])) : I("", !0),
50
+ i("div", {
51
+ class: g(["custom-scroll sidebar-height", {
52
+ "sidebar-mask": !b(c)
21
53
  }])
22
54
  }, [
23
- t(e.$slots, "content")
55
+ a(e.$slots, "content")
24
56
  ], 2),
25
- t(e.$slots, "button")
26
- ]));
57
+ a(e.$slots, "button"),
58
+ i("div", {
59
+ class: "resizer",
60
+ onMousedown: x
61
+ }, null, 32)
62
+ ], 6)), [
63
+ [_, d.showSideBar]
64
+ ]);
27
65
  }
28
66
  });
29
67
  export {
30
- x as default
68
+ X as default
31
69
  };
@@ -1 +1 @@
1
- {"version":3,"file":"TopNav.vue.d.ts","sourceRoot":"","sources":["../../../src/components/TopNav/TopNav.vue"],"names":[],"mappings":";AAyXA,wBAKG"}
1
+ {"version":3,"file":"TopNav.vue.d.ts","sourceRoot":"","sources":["../../../src/components/TopNav/TopNav.vue"],"names":[],"mappings":";AAqZA,wBAKG"}
@@ -1,7 +1,7 @@
1
1
  import o from "./TopNav.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.js";
4
- const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-76f92299"]]);
4
+ const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-19efa966"]]);
5
5
  export {
6
6
  f as default
7
7
  };
@@ -1,77 +1,80 @@
1
- import { defineComponent as N, reactive as y, ref as x, watch as S, computed as C, openBlock as r, createElementBlock as u, createElementVNode as i, createVNode as v, unref as d, toDisplayString as w, Fragment as A, renderList as R, createBlock as z, pushScopeId as B, popScopeId as E } from "vue";
2
- import { ROUTES as T } from "../../constants.js";
3
- import { ScalarIcon as h } from "@scalar/components";
4
- import { capitalize as V } from "@scalar/oas-utils/helpers";
5
- import j from "./TopNavItem.vue.js";
6
- import { useWorkspace as q } from "../../store/workspace.js";
7
- const L = (l) => (B("data-v-76f92299"), l = l(), E(), l), $ = { class: "flex h-10 t-app__top-nav" }, D = /* @__PURE__ */ L(() => /* @__PURE__ */ i("div", { class: "t-app__top-nav-draggable" }, null, -1)), F = { class: "flex h-10 flex-1 items-center justify-center gap-1.5 text-sm font-medium relative" }, M = {
1
+ import { defineComponent as x, reactive as S, ref as T, watch as C, computed as B, onMounted as R, onBeforeUnmount as w, openBlock as i, createElementBlock as p, createElementVNode as r, createVNode as _, unref as g, toDisplayString as A, Fragment as M, renderList as z, createBlock as E, pushScopeId as L, popScopeId as V } from "vue";
2
+ import { ROUTES as j } from "../../constants.js";
3
+ import { ScalarIcon as b } from "@scalar/components";
4
+ import { capitalize as q } from "@scalar/oas-utils/helpers";
5
+ import K from "./TopNavItem.vue.js";
6
+ import { useWorkspace as U } from "../../store/workspace.js";
7
+ import { hotKeyBus as k } from "../../libs/event-busses/hot-keys-bus.js";
8
+ const $ = (l) => (L("data-v-19efa966"), l = l(), V(), l), D = { class: "flex h-10 t-app__top-nav" }, F = /* @__PURE__ */ $(() => /* @__PURE__ */ r("div", { class: "t-app__top-nav-draggable" }, null, -1)), H = { class: "flex h-10 flex-1 items-center justify-center gap-1.5 text-sm font-medium relative" }, O = {
8
9
  key: 0,
9
10
  class: "flex items-center gap-1 w-full justify-center"
10
- }, K = /* @__PURE__ */ N({
11
+ }, Z = /* @__PURE__ */ x({
11
12
  __name: "TopNav",
12
13
  setup(l) {
13
- const { activeRequest: f, router: n } = q(), t = y([{ label: "", path: "", icon: "Add" }]), a = x(0);
14
- function p() {
14
+ const { activeRequest: N, router: o } = U(), t = S([{ label: "", path: "", icon: "Add" }]), a = T(0);
15
+ function m() {
15
16
  var s;
16
- const e = T.find((c) => n.currentRoute.value.name == c.name);
17
+ const e = j.find((c) => o.currentRoute.value.name == c.name);
17
18
  e && ((e == null ? void 0 : e.name) === "request" ? t[a.value] = {
18
- label: ((s = f.value) == null ? void 0 : s.summary) || "",
19
- path: n.currentRoute.value.path,
19
+ label: ((s = N.value) == null ? void 0 : s.summary) || "",
20
+ path: o.currentRoute.value.path,
20
21
  icon: e.icon
21
22
  } : t[a.value] = {
22
- label: V(e == null ? void 0 : e.name) || "",
23
- path: n.currentRoute.value.path,
23
+ label: q(e == null ? void 0 : e.name) || "",
24
+ path: o.currentRoute.value.path,
24
25
  icon: e.icon
25
26
  });
26
27
  }
27
- function m() {
28
- n.push(t[a.value].path);
28
+ function v() {
29
+ o.push(t[a.value].path);
29
30
  }
30
- function _() {
31
- t.push({ label: "", path: "", icon: "Add" }), a.value = t.length - 1, p();
31
+ function d() {
32
+ t.push({ label: "", path: "", icon: "Add" }), a.value = t.length - 1, m();
32
33
  }
33
- function b(e) {
34
- a.value = e, m();
34
+ function u(e) {
35
+ a.value = e, v();
35
36
  }
36
- S(
37
- () => n.currentRoute.value.path,
37
+ C(
38
+ () => o.currentRoute.value.path,
38
39
  () => {
39
- p();
40
+ m();
40
41
  },
41
42
  { immediate: !0 }
42
43
  );
43
- function k(e) {
44
+ function f(e) {
44
45
  t.splice(e, 1), a.value = Math.min(
45
46
  a.value,
46
47
  t.length - 1
47
- ), m();
48
+ ), v();
48
49
  }
49
- const g = C(() => a.value);
50
- return (e, s) => (r(), u("nav", $, [
51
- D,
52
- i("div", F, [
53
- t.length === 1 ? (r(), u("div", M, [
54
- v(d(h), {
50
+ const I = B(() => a.value), h = (e) => {
51
+ e.addTopNav && d(), e.closeTopNav && f(a.value), e.navigateTopNavLeft && u(Math.max(a.value - 1, 0)), e.navigateTopNavRight && u(Math.min(a.value + 1, t.length - 1));
52
+ };
53
+ return R(() => k.on(h)), w(() => k.off(h)), (e, s) => (i(), p("nav", D, [
54
+ F,
55
+ r("div", H, [
56
+ t.length === 1 ? (i(), p("div", O, [
57
+ _(g(b), {
55
58
  icon: t[0].icon,
56
59
  size: "xs",
57
60
  thickness: "2.5"
58
61
  }, null, 8, ["icon"]),
59
- i("div", null, w(t[0].label), 1)
60
- ])) : (r(!0), u(A, { key: 1 }, R(t, (c, o) => (r(), z(j, {
61
- key: o,
62
- active: o === g.value,
63
- hotkey: (o + 1).toString(),
62
+ r("div", null, A(t[0].label), 1)
63
+ ])) : (i(!0), p(M, { key: 1 }, z(t, (c, n) => (i(), E(K, {
64
+ key: n,
65
+ active: n === I.value,
66
+ hotkey: (n + 1).toString(),
64
67
  icon: c.icon,
65
68
  label: c.label,
66
- onClick: (I) => b(o),
67
- onClose: (I) => k(o)
69
+ onClick: (y) => u(n),
70
+ onClose: (y) => f(n)
68
71
  }, null, 8, ["active", "hotkey", "icon", "label", "onClick", "onClose"]))), 128)),
69
- i("button", {
72
+ r("button", {
70
73
  class: "text-c-3 hover:bg-b-3 p-1.5 rounded-lg webkit-app-no-drag",
71
74
  type: "button",
72
- onClick: _
75
+ onClick: d
73
76
  }, [
74
- v(d(h), {
77
+ _(g(b), {
75
78
  icon: "Add",
76
79
  size: "xs",
77
80
  thickness: "2.5"
@@ -82,5 +85,5 @@ const L = (l) => (B("data-v-76f92299"), l = l(), E(), l), $ = { class: "flex h-1
82
85
  }
83
86
  });
84
87
  export {
85
- K as default
88
+ Z as default
86
89
  };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export * from './layouts/Modal/index.js';
2
2
  export * from './layouts/App/index.js';
3
3
  export { useWorkspace } from './store/workspace.js';
4
- export { createModalRouter, webHashRouter, router } from './router.js';
4
+ export { createModalRouter, createWebHashRouter, router } from './router.js';
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,eAAe,CAAA;AAE7B,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,eAAe,CAAA;AAE7B,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA"}
package/dist/index.js CHANGED
@@ -1,18 +1,18 @@
1
- import { useWorkspace as t } from "./store/workspace.js";
2
- import { createModalRouter as a, router as i, webHashRouter as l } from "./router.js";
3
- import { default as m } from "./layouts/App/ApiClientApp.vue.js";
1
+ import { useWorkspace as o } from "./store/workspace.js";
2
+ import { createModalRouter as a, createWebHashRouter as i, router as l } from "./router.js";
3
+ import { default as c } from "./layouts/App/ApiClientApp.vue.js";
4
4
  /* empty css */
5
- import { default as c } from "./layouts/Modal/ApiClientModal.vue.js";
5
+ import { default as A } from "./layouts/Modal/ApiClientModal.vue.js";
6
6
  import { createApiClientModal as n, createApiClientModalSync as u } from "./layouts/Modal/create-api-client-modal.js";
7
7
  import { createApiClientApp as s } from "./layouts/App/create-api-client-app.js";
8
8
  export {
9
- m as ApiClientApp,
10
- c as ApiClientModal,
9
+ c as ApiClientApp,
10
+ A as ApiClientModal,
11
11
  s as createApiClientApp,
12
12
  n as createApiClientModal,
13
13
  u as createApiClientModalSync,
14
14
  a as createModalRouter,
15
- i as router,
16
- t as useWorkspace,
17
- l as webHashRouter
15
+ i as createWebHashRouter,
16
+ l as router,
17
+ o as useWorkspace
18
18
  };
@@ -10,7 +10,7 @@ import { RouterView as A } from "vue-router";
10
10
  import { loadAllResources as D } from "../../libs/local-storage.js";
11
11
  import N from "../../components/CommandPalette/TheCommandPalette.vue.js";
12
12
  import { useDarkModeState as b } from "../../hooks/useDarkModeState.js";
13
- import { handleHotKeyDown as H } from "../../libs/event-busses/hot-key.js";
13
+ import { handleHotKeyDown as H } from "../../libs/event-busses/hot-keys-bus.js";
14
14
  const V = ["innerHTML"], F = {
15
15
  key: 0,
16
16
  class: "flex min-h-0 flex-1"