@scalar/api-client 2.1.19 → 2.1.20

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 (103) hide show
  1. package/CHANGELOG.md +12 -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 -79
  5. package/dist/components/AddressBar/AddressBarServer.vue.js +23 -23
  6. package/dist/components/CommandPalette/CommandPaletteServer.vue.d.ts.map +1 -1
  7. package/dist/components/CommandPalette/CommandPaletteServer.vue.js +62 -45
  8. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts +6 -0
  9. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts.map +1 -1
  10. package/dist/components/CommandPalette/TheCommandPalette.vue.js +4 -4
  11. package/dist/components/CommandPalette/TheCommandPalette.vue2.js +89 -91
  12. package/dist/components/ImportCollection/ImportCollectionModal.vue.d.ts.map +1 -1
  13. package/dist/components/ImportCollection/ImportCollectionModal.vue.js +29 -32
  14. package/dist/components/TopNav/TopNav.vue.d.ts.map +1 -1
  15. package/dist/components/TopNav/TopNav.vue.js +3 -3
  16. package/dist/components/TopNav/TopNav.vue2.js +41 -40
  17. package/dist/components/ViewLayout/ViewLayoutCollapse.vue.d.ts.map +1 -1
  18. package/dist/components/ViewLayout/ViewLayoutCollapse.vue.js +1 -1
  19. package/dist/layouts/App/ApiClientApp.vue.d.ts.map +1 -1
  20. package/dist/layouts/App/ApiClientApp.vue.js +38 -38
  21. package/dist/layouts/App/create-api-client-app.d.ts +33 -26
  22. package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
  23. package/dist/layouts/Modal/ApiClientModal.vue.js +1 -1
  24. package/dist/layouts/Modal/ApiClientModal.vue2.js +15 -15
  25. package/dist/layouts/Modal/create-api-client-modal.d.ts +66 -52
  26. package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
  27. package/dist/layouts/Web/ApiClientWeb.vue.d.ts.map +1 -1
  28. package/dist/layouts/Web/ApiClientWeb.vue.js +30 -30
  29. package/dist/layouts/Web/create-api-client-web.d.ts +33 -26
  30. package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
  31. package/dist/libs/create-client.d.ts +33 -26
  32. package/dist/libs/create-client.d.ts.map +1 -1
  33. package/dist/libs/event-bus.d.ts +41 -0
  34. package/dist/libs/event-bus.d.ts.map +1 -0
  35. package/dist/libs/event-bus.js +32 -0
  36. package/dist/libs/{event-busses/hot-keys-bus.d.ts → hot-keys.d.ts} +6 -7
  37. package/dist/libs/hot-keys.d.ts.map +1 -0
  38. package/dist/libs/hot-keys.js +45 -0
  39. package/dist/libs/index.d.ts +3 -1
  40. package/dist/libs/index.d.ts.map +1 -1
  41. package/dist/libs/index.js +31 -33
  42. package/dist/libs/send-request.d.ts +4 -1
  43. package/dist/libs/send-request.d.ts.map +1 -1
  44. package/dist/libs/send-request.js +103 -103
  45. package/dist/store/collections.d.ts +4 -4
  46. package/dist/store/events.d.ts +29 -0
  47. package/dist/store/events.d.ts.map +1 -0
  48. package/dist/store/events.js +31 -0
  49. package/dist/store/request-example.d.ts +2 -2
  50. package/dist/store/requests.d.ts +4 -4
  51. package/dist/store/security-schemes.d.ts +4 -4
  52. package/dist/store/servers.d.ts +4 -4
  53. package/dist/store/store.d.ts +66 -52
  54. package/dist/store/store.d.ts.map +1 -1
  55. package/dist/store/store.js +75 -73
  56. package/dist/store/tags.d.ts +4 -4
  57. package/dist/store/workspace.d.ts +4 -4
  58. package/dist/style.css +1 -1
  59. package/dist/views/Request/Request.vue.d.ts.map +1 -1
  60. package/dist/views/Request/Request.vue.js +1 -1
  61. package/dist/views/Request/Request.vue2.js +63 -63
  62. package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
  63. package/dist/views/Request/RequestSidebar.vue.js +1 -1
  64. package/dist/views/Request/RequestSidebar.vue2.js +101 -102
  65. package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
  66. package/dist/views/Request/RequestSidebarItem.vue.js +2 -2
  67. package/dist/views/Request/RequestSidebarItem.vue2.js +76 -76
  68. package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts.map +1 -1
  69. package/dist/views/Request/RequestSidebarItemMenu.vue.js +4 -4
  70. package/dist/views/Request/RequestSidebarItemMenu.vue2.js +33 -34
  71. package/dist/views/Request/ResponseSection/ResponseBodyVirtual.vue.d.ts +16 -0
  72. package/dist/views/Request/ResponseSection/ResponseBodyVirtual.vue.d.ts.map +1 -0
  73. package/dist/views/Request/ResponseSection/ResponseBodyVirtual.vue.js +31 -0
  74. package/dist/views/Request/ResponseSection/ResponseBodyVirtual.vue3.js +5 -0
  75. package/dist/views/Request/ResponseSection/ResponseEmpty.vue.d.ts.map +1 -1
  76. package/dist/views/Request/ResponseSection/ResponseEmpty.vue.js +1 -1
  77. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +30 -33
  78. package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue.d.ts.map +1 -1
  79. package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue.js +3 -3
  80. package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue2.js +17 -18
  81. package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.d.ts.map +1 -1
  82. package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.js +20 -20
  83. package/dist/views/Request/ResponseSection/ResponseSection.vue.d.ts.map +1 -1
  84. package/dist/views/Request/ResponseSection/ResponseSection.vue.js +68 -56
  85. package/dist/views/Request/components/WorkspaceDropdown.vue.js +29 -30
  86. package/package.json +5 -5
  87. package/dist/libs/event-busses/cancel-request-bus.d.ts +0 -2
  88. package/dist/libs/event-busses/cancel-request-bus.d.ts.map +0 -1
  89. package/dist/libs/event-busses/cancel-request-bus.js +0 -5
  90. package/dist/libs/event-busses/command-palette-bus.d.ts +0 -14
  91. package/dist/libs/event-busses/command-palette-bus.d.ts.map +0 -1
  92. package/dist/libs/event-busses/command-palette-bus.js +0 -5
  93. package/dist/libs/event-busses/execute-request-bus.d.ts +0 -2
  94. package/dist/libs/event-busses/execute-request-bus.d.ts.map +0 -1
  95. package/dist/libs/event-busses/execute-request-bus.js +0 -5
  96. package/dist/libs/event-busses/hot-keys-bus.d.ts.map +0 -1
  97. package/dist/libs/event-busses/hot-keys-bus.js +0 -47
  98. package/dist/libs/event-busses/index.d.ts +0 -6
  99. package/dist/libs/event-busses/index.d.ts.map +0 -1
  100. package/dist/libs/event-busses/index.js +0 -15
  101. package/dist/libs/event-busses/request-status-bus.d.ts +0 -5
  102. package/dist/libs/event-busses/request-status-bus.d.ts.map +0 -1
  103. package/dist/libs/event-busses/request-status-bus.js +0 -5
@@ -1 +1 @@
1
- {"version":3,"file":"Request.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/Request.vue"],"names":[],"mappings":";;cAwO8B,MAAM;aAAO,MAAM;;;;cAAnB,MAAM;aAAO,MAAM;;;AAkWjD,wBAMG"}
1
+ {"version":3,"file":"Request.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/Request.vue"],"names":[],"mappings":";;cA0O8B,MAAM;aAAO,MAAM;;;;cAAnB,MAAM;aAAO,MAAM;;;AAoWjD,wBAMG"}
@@ -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-8362ecae"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-adeb5a01"]]);
5
5
  export {
6
6
  m as default
7
7
  };
@@ -1,7 +1,7 @@
1
- import { defineComponent as z, ref as R, computed as J, watch as G, onMounted as K, onBeforeUnmount as P, openBlock as q, createElementBlock as X, Fragment as Y, createElementVNode as Z, normalizeClass as B, unref as s, createVNode as v, withCtx as C, createBlock as N, createCommentVNode as V } from "vue";
1
+ import { defineComponent as z, ref as y, computed as J, watch as G, onMounted as K, onBeforeUnmount as P, openBlock as w, createElementBlock as X, Fragment as Y, createElementVNode as Z, normalizeClass as N, unref as s, createVNode as v, withCtx as V, createBlock as B, createCommentVNode as g } from "vue";
2
2
  import ee from "../../components/ImportCurl/ImportCurlModal.vue.js";
3
- import oe from "../../components/ViewLayout/ViewLayout.vue.js";
4
- import te from "../../components/ViewLayout/ViewLayoutContent.vue.js";
3
+ import te from "../../components/ViewLayout/ViewLayout.vue.js";
4
+ import oe from "../../components/ViewLayout/ViewLayoutContent.vue.js";
5
5
  import { importCurlCommand as re } from "../../libs/importers/curl.js";
6
6
  import { createRequestOperation as ae } from "../../libs/send-request.js";
7
7
  import se from "./RequestSection/RequestSection.vue.js";
@@ -15,18 +15,16 @@ import { useRouter as ve } from "vue-router";
15
15
  import de from "./RequestSidebar.vue.js";
16
16
  import { ERRORS as ce } from "../../libs/errors.js";
17
17
  import { useWorkspace as pe } from "../../store/store.js";
18
- import { executeRequestBus as g } from "../../libs/event-busses/execute-request-bus.js";
19
- import { cancelRequestBus as fe } from "../../libs/event-busses/cancel-request-bus.js";
20
- const $e = /* @__PURE__ */ z({
18
+ const Me = /* @__PURE__ */ z({
21
19
  __name: "Request",
22
20
  emits: ["newTab"],
23
- setup(Re) {
24
- var E;
25
- const I = pe(), { toast: w } = ie(), {
26
- activeCollection: b,
21
+ setup(fe) {
22
+ var O;
23
+ const I = pe(), { toast: b } = ie(), {
24
+ activeCollection: x,
27
25
  activeExample: d,
28
26
  activeEnvironment: M,
29
- activeRequest: x,
27
+ activeRequest: S,
30
28
  activeWorkspace: a,
31
29
  activeServer: T,
32
30
  cookies: U,
@@ -35,103 +33,105 @@ const $e = /* @__PURE__ */ z({
35
33
  securitySchemes: $,
36
34
  requestMutators: H,
37
35
  serverMutators: L,
38
- servers: _
39
- } = I, u = R(!((E = a.value) != null && E.isReadOnly)), S = R(), e = R(), y = R(""), A = ve(), j = J(
40
- () => h.findLast((t) => {
41
- var o;
42
- return t.request.uid === ((o = d.value) == null ? void 0 : o.uid);
36
+ servers: _,
37
+ events: c
38
+ } = I, u = y(!((O = a.value) != null && O.isReadOnly)), k = y(), e = y(), q = y(""), A = ve(), j = J(
39
+ () => h.findLast((o) => {
40
+ var t;
41
+ return o.request.uid === ((t = d.value) == null ? void 0 : t.uid);
43
42
  })
44
43
  ), D = me("(max-width: 780px)");
45
- G(D, (t) => u.value = !t);
46
- const k = async () => {
47
- var p;
48
- if (!x.value || !d.value || !b.value)
44
+ G(D, (o) => u.value = !o);
45
+ const E = async () => {
46
+ var f;
47
+ if (!S.value || !d.value || !x.value)
49
48
  return;
50
- const t = ne.parse(((p = M.value) == null ? void 0 : p.value) || "{}");
51
- t.error && console.error("INVALID ENVIRONMENT!");
52
- const o = t.error || typeof t.data != "object" ? {} : t.data ?? {}, r = a.value.cookies.map((f) => U[f]), [n, i] = ae({
53
- auth: b.value.auth,
54
- request: x.value,
49
+ const o = ne.parse(((f = M.value) == null ? void 0 : f.value) || "{}");
50
+ o.error && console.error("INVALID ENVIRONMENT!");
51
+ const t = o.error || typeof o.data != "object" ? {} : o.data ?? {}, r = a.value.cookies.map((R) => U[R]), [n, i] = ae({
52
+ auth: x.value.auth,
53
+ request: S.value,
55
54
  example: d.value,
56
55
  proxy: a.value.proxyUrl ?? "",
57
- environment: o,
56
+ environment: t,
58
57
  globalCookies: r,
58
+ status: c.requestStatus,
59
59
  securitySchemes: $,
60
60
  server: T.value
61
61
  });
62
62
  if (n) {
63
- w(n.message, "error");
63
+ b(n.message, "error");
64
64
  return;
65
65
  }
66
- S.value = i.controller;
67
- const [m, c] = await i.sendRequest();
68
- m ? w(m.message, "error") : h.push(c);
66
+ k.value = i.controller;
67
+ const [m, p] = await i.sendRequest();
68
+ m ? b(m.message, "error") : h.push(p);
69
69
  }, F = async () => {
70
- var t;
71
- return (t = S.value) == null ? void 0 : t.abort(ce.REQUEST_ABORTED);
70
+ var o;
71
+ return (o = k.value) == null ? void 0 : o.abort(ce.REQUEST_ABORTED);
72
72
  };
73
73
  K(() => {
74
- g.on(k), fe.on(F);
75
- }), P(() => g.off(k));
76
- function Q({ requestName: t }) {
74
+ c.executeRequest.on(E), c.cancelRequest.on(F);
75
+ }), P(() => c.executeRequest.off(E));
76
+ function Q({ requestName: o }) {
77
77
  var r, n, i, m;
78
78
  if (!e.value) return;
79
79
  if (e.value.servers) {
80
- const c = Object.values(_).find(
81
- (p) => {
82
- var f, O;
83
- return p.url === ((O = (f = e == null ? void 0 : e.value) == null ? void 0 : f.servers) == null ? void 0 : O[0]);
80
+ const p = Object.values(_).find(
81
+ (f) => {
82
+ var R, C;
83
+ return f.url === ((C = (R = e == null ? void 0 : e.value) == null ? void 0 : R.servers) == null ? void 0 : C[0]);
84
84
  }
85
85
  );
86
- c ? y.value = c.uid : y.value = L.add(
86
+ p ? q.value = p.uid : q.value = L.add(
87
87
  { url: e.value.servers[0] },
88
88
  a.value.collections[0]
89
89
  ).uid;
90
90
  }
91
- const o = H.add(
91
+ const t = H.add(
92
92
  {
93
- summary: t,
93
+ summary: o,
94
94
  path: (r = e == null ? void 0 : e.value) == null ? void 0 : r.path,
95
95
  method: (n = e == null ? void 0 : e.value) == null ? void 0 : n.method,
96
96
  parameters: (i = e == null ? void 0 : e.value) == null ? void 0 : i.parameters,
97
- selectedServerUid: y.value,
97
+ selectedServerUid: q.value,
98
98
  requestBody: (m = e == null ? void 0 : e.value) == null ? void 0 : m.requestBody
99
99
  },
100
100
  a.value.collections[0]
101
101
  );
102
- o && A.push(
103
- `/workspace/${a.value.uid}/request/${o.uid}`
102
+ t && A.push(
103
+ `/workspace/${a.value.uid}/request/${t.uid}`
104
104
  ), l.hide();
105
105
  }
106
- function W(t) {
107
- e.value = re(t), l.show();
106
+ function W(o) {
107
+ e.value = re(o), l.show();
108
108
  }
109
- return (t, o) => (q(), X(Y, null, [
109
+ return (o, t) => (w(), X(Y, null, [
110
110
  Z("div", {
111
- class: B(["flex flex-1 flex-col pt-0 h-full bg-b-1 relative overflow-hidden", {
111
+ class: N(["flex flex-1 flex-col pt-0 h-full bg-b-1 relative overflow-hidden", {
112
112
  "!mr-0 !mb-0 !border-0": s(a).isReadOnly
113
113
  }])
114
114
  }, [
115
115
  v(ue, {
116
116
  modelValue: u.value,
117
- "onUpdate:modelValue": o[0] || (o[0] = (r) => u.value = r),
117
+ "onUpdate:modelValue": t[0] || (t[0] = (r) => u.value = r),
118
118
  isReadonly: s(a).isReadOnly,
119
- onHideModal: o[1] || (o[1] = () => s(l).hide()),
119
+ onHideModal: t[1] || (t[1] = () => s(l).hide()),
120
120
  onImportCurl: W
121
121
  }, null, 8, ["modelValue", "isReadonly"]),
122
- v(oe, null, {
123
- default: C(() => [
122
+ v(te, null, {
123
+ default: V(() => [
124
124
  v(de, {
125
125
  isReadonly: s(a).isReadOnly,
126
126
  showSidebar: u.value,
127
- onNewTab: o[2] || (o[2] = (r) => t.$emit("newTab", r)),
128
- "onUpdate:showSidebar": o[3] || (o[3] = (r) => u.value = r)
127
+ onNewTab: t[2] || (t[2] = (r) => o.$emit("newTab", r)),
128
+ "onUpdate:showSidebar": t[3] || (t[3] = (r) => u.value = r)
129
129
  }, null, 8, ["isReadonly", "showSidebar"]),
130
- s(d) ? (q(), N(te, {
130
+ s(d) ? (w(), B(oe, {
131
131
  key: 0,
132
- class: B(["flex-1", [u.value ? "sidebar-active-hide-layout" : ""]])
132
+ class: N(["flex-1", [u.value ? "sidebar-active-hide-layout" : ""]])
133
133
  }, {
134
- default: C(() => {
134
+ default: V(() => {
135
135
  var r;
136
136
  return [
137
137
  v(se),
@@ -141,21 +141,21 @@ const $e = /* @__PURE__ */ z({
141
141
  ];
142
142
  }),
143
143
  _: 1
144
- }, 8, ["class"])) : V("", !0)
144
+ }, 8, ["class"])) : g("", !0)
145
145
  ]),
146
146
  _: 1
147
147
  })
148
148
  ], 2),
149
- e.value ? (q(), N(ee, {
149
+ e.value ? (w(), B(ee, {
150
150
  key: 0,
151
151
  parsedCurl: e.value,
152
152
  state: s(l),
153
- onClose: o[4] || (o[4] = (r) => s(l).hide()),
153
+ onClose: t[4] || (t[4] = (r) => s(l).hide()),
154
154
  onImportCurl: Q
155
- }, null, 8, ["parsedCurl", "state"])) : V("", !0)
155
+ }, null, 8, ["parsedCurl", "state"])) : g("", !0)
156
156
  ], 64));
157
157
  }
158
158
  });
159
159
  export {
160
- $e as default
160
+ Me as default
161
161
  };
@@ -1 +1 @@
1
- {"version":3,"file":"RequestSidebar.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/RequestSidebar.vue"],"names":[],"mappings":";iBAoVe,OAAO;gBACR,OAAO;;;;cAMkB,MAAM;aAAO,MAAM;;;iBAP3C,OAAO;gBACR,OAAO;;;cAMkB,MAAM;aAAO,MAAM;;;;AAimB1D,wBAOG;AAOH,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":"RequestSidebar.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/RequestSidebar.vue"],"names":[],"mappings":";iBAuVe,OAAO;gBACR,OAAO;;;;cAMkB,MAAM;aAAO,MAAM;;;iBAP3C,OAAO;gBACR,OAAO;;;cAMkB,MAAM;aAAO,MAAM;;;;AAomB1D,wBAOG;AAOH,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 "./RequestSidebar.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-c76358d8"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-254a8369"]]);
5
5
  export {
6
6
  m as default
7
7
  };
@@ -1,156 +1,155 @@
1
- import { defineComponent as Q, reactive as X, watch as Y, onMounted as Z, onBeforeUnmount as _, openBlock as a, createElementBlock as h, Fragment as S, withDirectives as ee, createVNode as l, unref as e, normalizeClass as b, createSlots as te, withCtx as n, createElementVNode as i, isRef as oe, withKeys as v, withModifiers as c, createBlock as d, renderList as C, createTextVNode as D, toDisplayString as re, createCommentVNode as $, vShow as se, pushScopeId as ae, popScopeId as ie } from "vue";
2
- import ne from "../../assets/rabbit.ascii.js";
3
- import le from "../../assets/rabbitjump.ascii.js";
4
- import de from "../../components/HttpMethod/HttpMethod.vue.js";
5
- import B from "../../components/ScalarAsciiArt.vue.js";
6
- import { useSearch as me } from "../../components/Search/useSearch.js";
7
- import pe from "../../components/Sidebar/SidebarButton.vue.js";
8
- import ue from "./RequestSidebarItemMenu.vue.js";
9
- import { dragHandlerFactory as ce } from "./handle-drag.js";
10
- import { ScalarSearchInput as fe, ScalarSearchResultList as be, ScalarSearchResultItem as he, ScalarIcon as V } from "@scalar/components";
11
- import { LibraryIcon as Se } from "@scalar/icons";
12
- import ve from "./RequestSidebarItem.vue.js";
13
- import Re from "../../components/Sidebar/Sidebar.vue.js";
14
- import we from "./components/WorkspaceDropdown.vue.js";
1
+ import { defineComponent as J, reactive as Q, watch as X, onMounted as Y, onBeforeUnmount as Z, openBlock as a, createElementBlock as S, Fragment as v, withDirectives as _, createVNode as l, unref as e, normalizeClass as h, createSlots as ee, withCtx as n, createElementVNode as i, isRef as te, withKeys as R, withModifiers as c, createBlock as d, renderList as D, createTextVNode as $, toDisplayString as oe, createCommentVNode as V, vShow as se, pushScopeId as re, popScopeId as ae } from "vue";
2
+ import ie from "../../assets/rabbit.ascii.js";
3
+ import ne from "../../assets/rabbitjump.ascii.js";
4
+ import le from "../../components/HttpMethod/HttpMethod.vue.js";
5
+ import q from "../../components/ScalarAsciiArt.vue.js";
6
+ import { useSearch as de } from "../../components/Search/useSearch.js";
7
+ import me from "../../components/Sidebar/SidebarButton.vue.js";
8
+ import pe from "./RequestSidebarItemMenu.vue.js";
9
+ import { dragHandlerFactory as ue } from "./handle-drag.js";
10
+ import { ScalarSearchInput as ce, ScalarSearchResultList as fe, ScalarSearchResultItem as be, ScalarIcon as P } from "@scalar/components";
11
+ import { LibraryIcon as he } from "@scalar/icons";
12
+ import Se from "./RequestSidebarItem.vue.js";
13
+ import ve from "../../components/Sidebar/Sidebar.vue.js";
14
+ import Re from "./components/WorkspaceDropdown.vue.js";
15
15
  import { useSidebar as ye } from "../../hooks/useSidebar.js";
16
- import { useWorkspace as ke } from "../../store/store.js";
17
- import { hotKeyBus as q } from "../../libs/event-busses/hot-keys-bus.js";
18
- import { commandPaletteBus as E } from "../../libs/event-busses/command-palette-bus.js";
19
- const ge = (p) => (ae("data-v-c76358d8"), p = p(), ie(), p), Ie = { class: "search-button-fade sticky px-3 py-2.5 top-0 z-1" }, xe = { class: "empty-sidebar-item-content px-2.5 py-2.5" }, Ce = { class: "w-[60px] h-[68px] m-auto rabbit-ascii mt-2 relative" }, De = /* @__PURE__ */ ge(() => /* @__PURE__ */ i("div", { class: "text-center text-balance text-sm mb-2 mt-2" }, [
16
+ import { useWorkspace as we } from "../../store/store.js";
17
+ const ke = (p) => (re("data-v-254a8369"), p = p(), ae(), p), ge = { class: "search-button-fade sticky px-3 py-2.5 top-0 z-1" }, Ie = { class: "empty-sidebar-item-content px-2.5 py-2.5" }, xe = { class: "w-[60px] h-[68px] m-auto rabbit-ascii mt-2 relative" }, Ce = /* @__PURE__ */ ke(() => /* @__PURE__ */ i("div", { class: "text-center text-balance text-sm mb-2 mt-2" }, [
20
18
  /* @__PURE__ */ i("b", { class: "font-medium" }, "Let's Get Started"),
21
19
  /* @__PURE__ */ i("p", { class: "mt-2" }, " Create request, folder, collection or import OpenAPI document ")
22
- ], -1)), je = /* @__PURE__ */ Q({
20
+ ], -1)), Ue = /* @__PURE__ */ J({
23
21
  __name: "RequestSidebar",
24
22
  props: {
25
23
  showSidebar: { type: Boolean },
26
24
  isReadonly: { type: Boolean }
27
25
  },
28
26
  emits: ["update:showSidebar", "newTab"],
29
- setup(p, { emit: F }) {
30
- const M = p, R = F, w = ke(), {
31
- activeWorkspaceCollections: O,
32
- activeRequest: P,
33
- activeWorkspaceRequests: N,
34
- findRequestParents: T,
35
- isReadOnly: z
36
- } = w, { handleDragEnd: A, isDroppable: K } = ce(w), { collapsedSidebarFolders: L, setCollapsedSidebarFolder: U } = ye(), u = X({ open: !1 });
37
- Y(
38
- P,
39
- (r) => {
40
- r && T(r).forEach(
41
- (t) => U(t, !0)
27
+ setup(p, { emit: B }) {
28
+ const E = p, y = B, w = we(), {
29
+ activeWorkspaceCollections: F,
30
+ activeRequest: M,
31
+ activeWorkspaceRequests: O,
32
+ findRequestParents: K,
33
+ isReadOnly: N,
34
+ events: f
35
+ } = w, { handleDragEnd: T, isDroppable: z } = ue(w), { collapsedSidebarFolders: A, setCollapsedSidebarFolder: L } = ye(), u = Q({ open: !1 });
36
+ X(
37
+ M,
38
+ (s) => {
39
+ s && K(s).forEach(
40
+ (t) => L(t, !0)
42
41
  );
43
42
  },
44
43
  { immediate: !0 }
45
44
  );
46
45
  const {
47
- searchText: f,
48
- searchResultsWithPlaceholderResults: y,
49
- selectedSearchResult: k,
50
- onSearchResultClick: W,
51
- fuseSearch: H,
52
- searchInputRef: g,
53
- searchResultRefs: j,
54
- navigateSearchResults: I,
55
- selectSearchResult: G
56
- } = me(), x = (r) => {
46
+ searchText: b,
47
+ searchResultsWithPlaceholderResults: k,
48
+ selectedSearchResult: g,
49
+ onSearchResultClick: U,
50
+ fuseSearch: W,
51
+ searchInputRef: I,
52
+ searchResultRefs: H,
53
+ navigateSearchResults: x,
54
+ selectSearchResult: j
55
+ } = de(), C = (s) => {
57
56
  var t;
58
- r.toggleSidebar && R("update:showSidebar", M.showSidebar), r.openCommandPalette && (r.openCommandPalette.preventDefault(), E.emit()), r.focusRequestSearch && ((t = g.value) == null || t.focus());
57
+ s && (s.toggleSidebar && y("update:showSidebar", E.showSidebar), s.openCommandPalette && (s.openCommandPalette.preventDefault(), f.commandPalette.emit()), s.focusRequestSearch && ((t = I.value) == null || t.focus()));
59
58
  };
60
- return Z(() => q.on(x)), _(() => {
61
- q.off(x);
62
- }), (r, t) => (a(), h(S, null, [
63
- ee(l(e(Re), {
64
- class: b([r.showSidebar ? "sidebar-active-width" : ""]),
65
- showSidebar: r.showSidebar,
66
- "onUpdate:showSidebar": t[8] || (t[8] = (o) => r.$emit("update:showSidebar", o))
67
- }, te({
59
+ return Y(() => f.hotKeys.on(C)), Z(() => {
60
+ f.hotKeys.off(C);
61
+ }), (s, t) => (a(), S(v, null, [
62
+ _(l(e(ve), {
63
+ class: h([s.showSidebar ? "sidebar-active-width" : ""]),
64
+ showSidebar: s.showSidebar,
65
+ "onUpdate:showSidebar": t[8] || (t[8] = (o) => s.$emit("update:showSidebar", o))
66
+ }, ee({
68
67
  content: n(() => [
69
- i("div", Ie, [
70
- l(e(fe), {
68
+ i("div", ge, [
69
+ l(e(ce), {
71
70
  ref_key: "searchInputRef",
72
- ref: g,
73
- modelValue: e(f),
74
- "onUpdate:modelValue": t[0] || (t[0] = (o) => oe(f) ? f.value = o : null),
71
+ ref: I,
72
+ modelValue: e(b),
73
+ "onUpdate:modelValue": t[0] || (t[0] = (o) => te(b) ? b.value = o : null),
75
74
  sidebar: "",
76
- onInput: e(H),
75
+ onInput: e(W),
77
76
  onKeydown: [
78
- t[1] || (t[1] = v(c((o) => e(I)("down"), ["stop"]), ["down"])),
79
- t[2] || (t[2] = v(c((o) => e(G)(), ["stop"]), ["enter"])),
80
- t[3] || (t[3] = v(c((o) => e(I)("up"), ["stop"]), ["up"]))
77
+ t[1] || (t[1] = R(c((o) => e(x)("down"), ["stop"]), ["down"])),
78
+ t[2] || (t[2] = R(c((o) => e(j)(), ["stop"]), ["enter"])),
79
+ t[3] || (t[3] = R(c((o) => e(x)("up"), ["stop"]), ["up"]))
81
80
  ]
82
81
  }, null, 8, ["modelValue", "onInput"])
83
82
  ]),
84
83
  i("div", {
85
- class: b(["custom-scroll flex flex-1 flex-col overflow-visible px-3 pb-3 pt-0", {
86
- "pb-14": !r.isReadonly
84
+ class: h(["custom-scroll flex flex-1 flex-col overflow-visible px-3 pb-3 pt-0", {
85
+ "pb-14": !s.isReadonly
87
86
  }]),
88
87
  onDragenter: t[6] || (t[6] = c(() => {
89
88
  }, ["prevent"])),
90
89
  onDragover: t[7] || (t[7] = c(() => {
91
90
  }, ["prevent"]))
92
91
  }, [
93
- e(f) ? (a(), d(e(be), {
92
+ e(b) ? (a(), d(e(fe), {
94
93
  key: 0,
95
94
  class: "gap-px custom-scroll",
96
- noResults: !e(y).length
95
+ noResults: !e(k).length
97
96
  }, {
98
97
  default: n(() => [
99
- (a(!0), h(S, null, C(e(y), (o, m) => (a(), d(e(he), {
98
+ (a(!0), S(v, null, D(e(k), (o, m) => (a(), d(e(be), {
100
99
  id: `#search-input-${o.item.id}`,
101
100
  key: o.refIndex,
102
101
  ref_for: !0,
103
- ref: (s) => e(j)[m] = s,
104
- active: e(k) === m,
102
+ ref: (r) => e(H)[m] = r,
103
+ active: e(g) === m,
105
104
  class: "px-2",
106
- onClick: (s) => e(W)(o),
107
- onFocus: (s) => k.value = m
105
+ onClick: (r) => e(U)(o),
106
+ onFocus: (r) => g.value = m
108
107
  }, {
109
108
  addon: n(() => [
110
- l(de, {
109
+ l(le, {
111
110
  class: "font-bold",
112
111
  method: o.item.httpVerb ?? "get"
113
112
  }, null, 8, ["method"])
114
113
  ]),
115
114
  default: n(() => [
116
- D(re(o.item.title) + " ", 1)
115
+ $(oe(o.item.title) + " ", 1)
117
116
  ]),
118
117
  _: 2
119
118
  }, 1032, ["id", "active", "onClick", "onFocus"]))), 128))
120
119
  ]),
121
120
  _: 1
122
- }, 8, ["noResults"])) : (a(!0), h(S, { key: 1 }, C(e(O), (o) => {
121
+ }, 8, ["noResults"])) : (a(!0), S(v, { key: 1 }, D(e(F), (o) => {
123
122
  var m;
124
- return a(), d(ve, {
123
+ return a(), d(Se, {
125
124
  key: o.uid,
126
- isDraggable: !r.isReadonly && ((m = o.info) == null ? void 0 : m.title) !== "Drafts",
127
- isDroppable: e(K),
125
+ isDraggable: !s.isReadonly && ((m = o.info) == null ? void 0 : m.title) !== "Drafts",
126
+ isDroppable: e(z),
128
127
  menuItem: u,
129
128
  parentUids: [],
130
129
  uid: o.uid,
131
- onNewTab: t[4] || (t[4] = (s, J) => R("newTab", { name: s, uid: J })),
132
- onOnDragEnd: e(A),
133
- onOpenMenu: t[5] || (t[5] = (s) => Object.assign(u, s))
130
+ onNewTab: t[4] || (t[4] = (r, G) => y("newTab", { name: r, uid: G })),
131
+ onOnDragEnd: e(T),
132
+ onOpenMenu: t[5] || (t[5] = (r) => Object.assign(u, r))
134
133
  }, {
135
134
  leftIcon: n(() => {
136
- var s;
135
+ var r;
137
136
  return [
138
- ((s = o.info) == null ? void 0 : s.title) === "Drafts" ? (a(), d(e(V), {
137
+ ((r = o.info) == null ? void 0 : r.title) === "Drafts" ? (a(), d(e(P), {
139
138
  key: 0,
140
139
  class: "text-sidebar-c-2 group-hover:hidden",
141
140
  icon: "Scribble",
142
141
  thickness: "2.5"
143
- })) : (a(), d(e(Se), {
142
+ })) : (a(), d(e(he), {
144
143
  key: 1,
145
144
  class: "text-sidebar-c-2 size-3.5 stroke-[2.5] group-hover:hidden",
146
145
  src: o["x-scalar-icon"] || "interface-content-folder"
147
146
  }, null, 8, ["src"])),
148
147
  i("div", {
149
- class: b({
150
- "rotate-90": e(L)[o.uid]
148
+ class: h({
149
+ "rotate-90": e(A)[o.uid]
151
150
  })
152
151
  }, [
153
- l(e(V), {
152
+ l(e(P), {
154
153
  class: "text-c-3 hidden text-sm group-hover:block",
155
154
  icon: "ChevronRight",
156
155
  size: "sm"
@@ -165,29 +164,29 @@ const ge = (p) => (ae("data-v-c76358d8"), p = p(), ie(), p), Ie = { class: "sear
165
164
  ]),
166
165
  button: n(() => [
167
166
  i("div", {
168
- class: b({
169
- "empty-sidebar-item": e(N).length <= 1
167
+ class: h({
168
+ "empty-sidebar-item": e(O).length <= 1
170
169
  })
171
170
  }, [
172
- i("div", xe, [
173
- i("div", Ce, [
174
- l(B, {
175
- art: e(ne),
171
+ i("div", Ie, [
172
+ i("div", xe, [
173
+ l(q, {
174
+ art: e(ie),
176
175
  class: "font-bold rabbitsit"
177
176
  }, null, 8, ["art"]),
178
- l(B, {
179
- art: e(le),
177
+ l(q, {
178
+ art: e(ne),
180
179
  class: "font-bold absolute top-0 left-0 rabbitjump"
181
180
  }, null, 8, ["art"])
182
181
  ]),
183
- De
182
+ Ce
184
183
  ]),
185
- r.isReadonly ? $("", !0) : (a(), d(pe, {
184
+ s.isReadonly ? V("", !0) : (a(), d(me, {
186
185
  key: 0,
187
- click: e(E).emit
186
+ click: e(f).commandPalette.emit
188
187
  }, {
189
188
  title: n(() => [
190
- D("Add Item")
189
+ $("Add Item")
191
190
  ]),
192
191
  _: 1
193
192
  }, 8, ["click"]))
@@ -195,24 +194,24 @@ const ge = (p) => (ae("data-v-c76358d8"), p = p(), ie(), p), Ie = { class: "sear
195
194
  ]),
196
195
  _: 2
197
196
  }, [
198
- r.isReadonly ? void 0 : {
197
+ s.isReadonly ? void 0 : {
199
198
  name: "header",
200
199
  fn: n(() => [
201
- l(e(we), { class: "min-h-11 xl:min-h-header xl:py-2.5 py-1 px-2.5 border-b-1/2" })
200
+ l(e(Re), { class: "min-h-11 xl:min-h-header xl:py-2.5 py-1 px-2.5 border-b-1/2" })
202
201
  ]),
203
202
  key: "0"
204
203
  }
205
204
  ]), 1032, ["class", "showSidebar"]), [
206
- [se, r.showSidebar]
205
+ [se, s.showSidebar]
207
206
  ]),
208
- !e(z) && u ? (a(), d(ue, {
207
+ !e(N) && u ? (a(), d(pe, {
209
208
  key: 0,
210
209
  menuItem: u,
211
210
  onCloseMenu: t[9] || (t[9] = (o) => u.open = !1)
212
- }, null, 8, ["menuItem"])) : $("", !0)
211
+ }, null, 8, ["menuItem"])) : V("", !0)
213
212
  ], 64));
214
213
  }
215
214
  });
216
215
  export {
217
- je as default
216
+ Ue as default
218
217
  };
@@ -1 +1 @@
1
- {"version":3,"file":"RequestSidebarItem.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/RequestSidebarItem.vue"],"names":[],"mappings":"AA2bA,OAAO,KAAK,EAAe,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAEzE,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,WAAW,EACjB,MAAM,mBAAmB,CAAA;AAwO1B,iBAAS,cAAc;gBAjMT,IAAI;;gBAAJ,IAAI;EAwvBjB;AACD,QAAA,MAAM,eAAe;IAxxBjB;;;;OAIG;kBACW,OAAO;IACrB;;;;OAIG;kBACW,cAAc,CAAC,aAAa,CAAC;IAC3C,oEAAoE;gBACxD,MAAM,EAAE;IACpB,0DAA0D;SACrD,MAAM;IAC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N,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"}
@@ -2,7 +2,7 @@ import t from "./RequestSidebarItem.vue2.js";
2
2
  /* empty css */
3
3
  /* empty css */
4
4
  import o from "../../_virtual/_plugin-vue_export-helper.js";
5
- const p = /* @__PURE__ */ o(t, [["__scopeId", "data-v-a2f84453"]]);
5
+ const a = /* @__PURE__ */ o(t, [["__scopeId", "data-v-9324d78b"]]);
6
6
  export {
7
- p as default
7
+ a as default
8
8
  };