@scalar/api-client 2.2.6 → 2.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/components/AddressBar/AddressBar.vue.js +2 -2
  3. package/dist/components/AddressBar/AddressBar.vue2.js +1 -1
  4. package/dist/components/AddressBar/AddressBarServer.vue.js +18 -18
  5. package/dist/components/CommandPalette/CommandPaletteRequest.vue.js +20 -20
  6. package/dist/components/HttpMethod/HttpMethod.vue.js +2 -2
  7. package/dist/components/HttpMethod/HttpMethod.vue2.js +12 -12
  8. package/dist/components/HttpMethod/index.d.ts +0 -1
  9. package/dist/components/HttpMethod/index.d.ts.map +1 -1
  10. package/dist/components/HttpMethod/index.js +2 -4
  11. package/dist/components/ImportCollection/ImportCollectionModal.vue.d.ts.map +1 -1
  12. package/dist/components/ImportCollection/ImportCollectionModal.vue.js +119 -102
  13. package/dist/components/OpenApiClientButton.vue.d.ts +1 -0
  14. package/dist/components/OpenApiClientButton.vue.d.ts.map +1 -1
  15. package/dist/components/OpenApiClientButton.vue.js +2 -2
  16. package/dist/components/OpenApiClientButton.vue2.js +23 -17
  17. package/dist/components/Search/useSearch.d.ts.map +1 -1
  18. package/dist/components/Search/useSearch.js +45 -41
  19. package/dist/layouts/Modal/ApiClientModal.vue.d.ts.map +1 -1
  20. package/dist/layouts/Modal/ApiClientModal.vue.js +2 -2
  21. package/dist/layouts/Modal/ApiClientModal.vue2.js +28 -23
  22. package/dist/libs/create-client.d.ts +1 -0
  23. package/dist/libs/create-client.d.ts.map +1 -1
  24. package/dist/libs/create-client.js +31 -30
  25. package/dist/style.css +1 -1
  26. package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts.map +1 -1
  27. package/dist/views/Environment/EnvironmentVariableDropdown.vue.js +65 -62
  28. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts.map +1 -1
  29. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +1 -1
  30. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +82 -84
  31. package/dist/views/Request/RequestSection/RequestBody.vue.d.ts.map +1 -1
  32. package/dist/views/Request/RequestSection/RequestBody.vue.js +2 -2
  33. package/dist/views/Request/RequestSection/RequestBody.vue2.js +27 -24
  34. package/dist/views/Request/RequestSubpageHeader.vue.d.ts.map +1 -1
  35. package/dist/views/Request/RequestSubpageHeader.vue.js +3 -3
  36. package/dist/views/Request/RequestSubpageHeader.vue2.js +34 -32
  37. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  38. package/dist/views/Request/components/WorkspaceDropdown.vue.js +1 -1
  39. package/dist/views/Request/libs/live-sync.d.ts.map +1 -1
  40. package/dist/views/Request/libs/live-sync.js +77 -78
  41. package/package.json +10 -10
  42. package/dist/components/HttpMethod/helpers.d.ts +0 -4
  43. package/dist/components/HttpMethod/helpers.d.ts.map +0 -1
  44. package/dist/components/HttpMethod/helpers.js +0 -5
@@ -1,29 +1,34 @@
1
- import { defineComponent as B, ref as q, computed as l, watch as y, onMounted as H, onUnmounted as R, openBlock as c, createBlock as W, unref as r, withCtx as K, createElementBlock as a, createCommentVNode as p, createElementVNode as e, normalizeClass as G, Fragment as _, createVNode as d, toDisplayString as J, createTextVNode as L } from "vue";
2
- import Q from "../CommandPalette/WatchModeToggle.vue.js";
3
- import X from "./ImportNowButton.vue.js";
4
- import Y from "./IntegrationLogo.vue.js";
5
- import Z from "./PrefetchError.vue.js";
6
- import ee from "./WorkspaceSelector.vue.js";
7
- import { useUrlPrefetcher as te } from "./hooks/useUrlPrefetcher.js";
8
- import { getOpenApiDocumentVersion as M } from "./utils/getOpenApiDocumentVersion.js";
1
+ import { defineComponent as H, ref as W, computed as c, watch as _, onMounted as K, onUnmounted as G, openBlock as l, createBlock as J, unref as i, withCtx as Q, createElementBlock as a, createCommentVNode as m, createElementVNode as e, normalizeClass as X, Fragment as g, createVNode as d, toDisplayString as Y, createTextVNode as M } from "vue";
2
+ import Z from "../CommandPalette/WatchModeToggle.vue.js";
3
+ import ee from "./ImportNowButton.vue.js";
4
+ import te from "./IntegrationLogo.vue.js";
5
+ import oe from "./PrefetchError.vue.js";
6
+ import se from "./WorkspaceSelector.vue.js";
7
+ import { useUrlPrefetcher as ne } from "./hooks/useUrlPrefetcher.js";
8
+ import { getOpenApiDocumentVersion as U } from "./utils/getOpenApiDocumentVersion.js";
9
9
  import { isDocument as A } from "./utils/isDocument.js";
10
- import { isUrl as T } from "./utils/isUrl.js";
11
- import { useActiveEntities as oe } from "../../store/active-entities.js";
12
- import { useModal as se, ScalarModal as ne, ScalarIcon as ie } from "@scalar/components";
13
- import { isLocalUrl as re } from "@scalar/oas-utils/helpers";
14
- import { normalize as le } from "@scalar/openapi-parser";
15
- import { getThemeStyles as ce } from "@scalar/themes";
16
- import { useWorkspace as ae } from "../../store/store.js";
17
- const de = ["innerHTML"], me = { class: "flex flex-col h-screen justify-center px-6 overflow-hidden relative md:px-0" }, ue = {
10
+ import { isUrl as C } from "./utils/isUrl.js";
11
+ import { useActiveEntities as re } from "../../store/active-entities.js";
12
+ import { useModal as ie, ScalarModal as le, ScalarIcon as ce } from "@scalar/components";
13
+ import { isLocalUrl as ae } from "@scalar/oas-utils/helpers";
14
+ import { normalize as de } from "@scalar/openapi-parser";
15
+ import { getThemeStyles as me } from "@scalar/themes";
16
+ import { useColorMode as ue } from "@scalar/use-hooks/useColorMode";
17
+ import { useRouter as pe } from "vue-router";
18
+ import { useWorkspace as fe } from "../../store/store.js";
19
+ const ve = ["innerHTML"], he = { class: "flex flex-col h-screen justify-center px-6 overflow-hidden relative md:px-0" }, xe = {
18
20
  key: 0,
19
21
  class: "flex justify-center items-center mb-2 p-1"
20
- }, pe = { class: "rounded-xl size-10" }, fe = { class: "text-center text-md font-bold mb-2 line-clamp-1" }, ve = { class: "inline-flex flex-col gap-2 items-center z-10 w-full" }, he = { class: "flex justify-center" }, xe = { class: "inline-flex py-1 px-4 items-center text-xs font-medium text-c-3" }, ye = {
22
+ }, ye = { class: "rounded-xl size-10" }, _e = ["src"], ge = {
23
+ key: 2,
24
+ class: "text-center text-md font-bold mb-2 line-clamp-1"
25
+ }, be = { class: "inline-flex flex-col gap-2 items-center z-10 w-full" }, we = { class: "flex justify-center" }, ke = { class: "inline-flex py-1 px-4 items-center text-xs font-medium text-c-3" }, Ie = {
21
26
  key: 0,
22
27
  class: "text-sm overflow-hidden mt-5 pt-4 border-t-1/2"
23
- }, _e = { class: "flex items-center justify-center" }, be = { class: "flex flex-col justify-center items-center pb-8" }, ge = { class: "text-center flex items-center flex-col" }, we = { class: "mb-2 w-10 h-10 border rounded-[10px] flex items-center justify-center" }, ke = {
28
+ }, Le = { class: "flex items-center justify-center" }, Me = { class: "flex flex-col justify-center items-center pb-8" }, Ue = { class: "text-center flex items-center flex-col" }, Ae = { class: "mb-2 w-10 h-10 border rounded-[10px] flex items-center justify-center" }, Ce = {
24
29
  href: "https://scalar.com/download",
25
30
  target: "_blank"
26
- }, Ee = /* @__PURE__ */ B({
31
+ }, Ge = /* @__PURE__ */ H({
27
32
  __name: "ImportCollectionModal",
28
33
  props: {
29
34
  source: {},
@@ -31,84 +36,91 @@ const de = ["innerHTML"], me = { class: "flex flex-col h-screen justify-center p
31
36
  eventType: {}
32
37
  },
33
38
  emits: ["importFinished"],
34
- setup(U, { emit: P }) {
35
- const o = U, C = P, { activeWorkspace: m } = oe(), { workspaceMutators: D, events: V } = ae(), { prefetchResult: n, prefetchUrl: b, resetPrefetchResult: S } = te(), i = se(), f = q(!0);
36
- V.hotKeys.on(() => i.hide());
37
- const j = l(() => {
39
+ setup(T, { emit: P }) {
40
+ const s = T, D = P, { activeWorkspace: u } = re(), { workspaceMutators: V, events: j } = fe(), { prefetchResult: n, prefetchUrl: b, resetPrefetchResult: S } = ne(), r = ie(), f = W(!0);
41
+ j.hotKeys.on(() => r.hide());
42
+ const z = c(() => {
38
43
  try {
39
- return le(
40
- n.content || o.source || ""
44
+ return de(
45
+ n.content || s.source || ""
41
46
  );
42
47
  } catch {
43
48
  return;
44
49
  }
45
- }), z = l(() => {
46
- var s, t;
47
- return (t = (s = j.value) == null ? void 0 : s.info) == null ? void 0 : t.title;
48
- }), g = l(
49
- () => M(n.content || o.source || "")
50
- );
51
- y(
52
- () => o.source,
53
- async (s) => {
50
+ }), N = c(() => {
51
+ var o, t;
52
+ return (t = (o = z.value) == null ? void 0 : o.info) == null ? void 0 : t.title;
53
+ }), w = c(
54
+ () => U(n.content || s.source || "")
55
+ ), { darkLightMode: O } = ue(), { currentRoute: $ } = pe(), v = c(() => {
56
+ try {
57
+ const o = $.value.query, t = O.value === "dark" ? o.dark_logo : o.light_logo;
58
+ if (t) return decodeURIComponent(t);
59
+ } catch {
60
+ }
61
+ return null;
62
+ });
63
+ _(
64
+ () => s.source,
65
+ async (o) => {
54
66
  var t;
55
- if (S(), T(s)) {
56
- if (o.eventType && ["paste", "drop"].includes(o.eventType)) {
57
- const { error: u } = await b(
58
- s,
59
- (t = m.value) == null ? void 0 : t.proxyUrl
67
+ if (S(), C(o)) {
68
+ if (s.eventType && ["paste", "drop"].includes(s.eventType)) {
69
+ const { error: p } = await b(
70
+ o,
71
+ (t = u.value) == null ? void 0 : t.proxyUrl
60
72
  );
61
- u ? i.hide() : i.show();
73
+ p ? r.hide() : r.show();
62
74
  return;
63
75
  }
64
- b(s, m.value.proxyUrl), i.show();
76
+ b(o, u.value.proxyUrl), r.show();
65
77
  return;
66
78
  }
67
- s && A(s) && M(s) ? i.show() : i.hide();
79
+ o && A(o) && U(o) ? r.show() : r.hide();
68
80
  }
69
81
  );
70
- const N = l(() => !!o.source && T(o.source)), O = l(() => !!o.source && A(o.source)), v = l(() => n.url && re(n.url)), h = (s) => {
71
- document.body.classList.remove("has-no-import-url"), (N.value || O.value) && i.open ? document.body.classList.add("has-import-url") : document.body.classList.remove("has-import-url");
72
- }, $ = () => {
82
+ const E = c(() => !!s.source && C(s.source)), F = c(() => !!s.source && A(s.source)), h = c(() => n.url && ae(n.url)), x = (o) => {
83
+ document.body.classList.remove("has-no-import-url"), (E.value || F.value) && r.open ? document.body.classList.add("has-import-url") : document.body.classList.remove("has-import-url");
84
+ }, R = () => {
73
85
  document.body.classList.remove("has-import-url"), document.body.classList.add("has-no-import-url");
74
86
  };
75
- y(
76
- () => i.open,
77
- (s) => {
78
- s ? h() : $();
87
+ _(
88
+ () => r.open,
89
+ (o) => {
90
+ o ? x() : R();
79
91
  }
80
- ), y(
81
- () => o.source,
92
+ ), _(
93
+ () => s.source,
82
94
  () => {
83
- h();
95
+ x();
84
96
  }
85
- ), H(() => {
86
- h();
87
- }), R(() => {
97
+ ), K(() => {
98
+ x();
99
+ }), G(() => {
88
100
  document.body.classList.remove("has-import-url"), document.body.classList.remove("has-no-import-url");
89
101
  });
90
- const w = l(
91
- () => m.value && v.value && o.integration && `<style>${ce(o.integration)}</style>`
102
+ const k = c(
103
+ () => u.value && h.value && s.integration && `<style>${me(s.integration)}</style>`
92
104
  );
93
- function E() {
94
- v.value && o.integration && D.edit(
95
- m.value.uid,
105
+ function q() {
106
+ h.value && s.integration && V.edit(
107
+ u.value.uid,
96
108
  "themeId",
97
- o.integration
98
- ), C("importFinished");
109
+ s.integration
110
+ ), D("importFinished");
99
111
  }
100
- return (s, t) => (c(), W(r(ne), {
112
+ return (o, t) => (l(), J(i(le), {
101
113
  size: "full",
102
- state: r(i)
114
+ state: i(r)
103
115
  }, {
104
- default: K(() => {
105
- var x, u, k, I;
116
+ default: Q(() => {
117
+ var y, p, I, L;
106
118
  return [
107
- w.value ? (c(), a("div", {
119
+ k.value ? (l(), a("div", {
108
120
  key: 0,
109
- innerHTML: w.value
110
- }, null, 8, de)) : p("", !0),
111
- e("div", me, [
121
+ innerHTML: k.value
122
+ }, null, 8, ve)) : m("", !0),
123
+ e("div", he, [
112
124
  t[6] || (t[6] = e("div", { class: "section-flare" }, [
113
125
  e("div", { class: "section-flare-item" }),
114
126
  e("div", { class: "section-flare-item" }),
@@ -120,54 +132,59 @@ const de = ["innerHTML"], me = { class: "flex flex-col h-screen justify-center p
120
132
  e("div", { class: "section-flare-item" })
121
133
  ], -1)),
122
134
  e("div", {
123
- class: G(["flex items-center flex-col m-auto px-8 py-8 rounded-xl border-1/2 max-w-[380px] w-full transition-opacity", { "opacity-0": r(n).state === "loading" }])
135
+ class: X(["flex items-center flex-col m-auto px-8 py-8 rounded-xl border-1/2 max-w-[380px] w-full transition-opacity", { "opacity-0": i(n).state === "loading" }])
124
136
  }, [
125
- r(n).error && r(n).state === "idle" && !g.value ? (c(), a(_, { key: 0 }, [
137
+ i(n).error && i(n).state === "idle" && !w.value ? (l(), a(g, { key: 0 }, [
126
138
  t[1] || (t[1] = e("div", { class: "text-center text-md font-bold mb-2 line-clamp-1" }, " No OpenAPI document found ", -1)),
127
- d(Z, {
128
- url: ((x = r(n)) == null ? void 0 : x.input) || o.source
139
+ d(oe, {
140
+ url: ((y = i(n)) == null ? void 0 : y.input) || s.source
129
141
  }, null, 8, ["url"])
130
- ], 64)) : (c(), a(_, { key: 1 }, [
131
- v.value ? (c(), a("div", ue, [
132
- e("div", pe, [
133
- d(Y, { integration: s.integration }, null, 8, ["integration"])
142
+ ], 64)) : (l(), a(g, { key: 1 }, [
143
+ h.value ? (l(), a("div", xe, [
144
+ e("div", ye, [
145
+ d(te, { integration: o.integration }, null, 8, ["integration"])
134
146
  ])
135
- ])) : p("", !0),
136
- e("div", fe, J(z.value || "Untitled Collection"), 1),
147
+ ])) : v.value ? (l(), a("img", {
148
+ key: 1,
149
+ alt: "Logo",
150
+ class: "w-full object-contain mb-2",
151
+ src: v.value
152
+ }, null, 8, _e)) : m("", !0),
153
+ v.value ? m("", !0) : (l(), a("div", ge, Y(N.value || "Untitled Collection"), 1)),
137
154
  t[4] || (t[4] = e("div", { class: "text-c-1 text-sm font-medium text-center text-balance" }, " Import the OpenAPI document to instantly send API requests. No signup required. ", -1)),
138
- g.value ? (c(), a(_, { key: 1 }, [
139
- e("div", ve, [
140
- d(X, {
141
- source: ((u = r(n)) == null ? void 0 : u.url) ?? ((k = r(n)) == null ? void 0 : k.content) ?? s.source,
155
+ w.value ? (l(), a(g, { key: 3 }, [
156
+ e("div", be, [
157
+ d(ee, {
158
+ source: ((p = i(n)) == null ? void 0 : p.url) ?? ((I = i(n)) == null ? void 0 : I.content) ?? o.source,
142
159
  variant: "button",
143
160
  watchMode: f.value,
144
- onImportFinished: E
161
+ onImportFinished: q
145
162
  }, null, 8, ["source", "watchMode"])
146
163
  ]),
147
- e("div", he, [
148
- e("div", xe, [
149
- t[2] || (t[2] = L(" Import to: ")),
150
- d(ee)
164
+ e("div", we, [
165
+ e("div", ke, [
166
+ t[2] || (t[2] = M(" Import to: ")),
167
+ d(se)
151
168
  ])
152
169
  ]),
153
- (I = r(n)) != null && I.url ? (c(), a("div", ye, [
154
- e("div", _e, [
155
- d(Q, {
170
+ (L = i(n)) != null && L.url ? (l(), a("div", Ie, [
171
+ e("div", Le, [
172
+ d(Z, {
156
173
  modelValue: f.value,
157
- "onUpdate:modelValue": t[0] || (t[0] = (F) => f.value = F),
174
+ "onUpdate:modelValue": t[0] || (t[0] = (B) => f.value = B),
158
175
  disableToolTip: !0
159
176
  }, null, 8, ["modelValue"])
160
177
  ]),
161
178
  t[3] || (t[3] = e("div", { class: "pt-0 text-center text-balance font-medium text-xs text-c-3" }, " Automatically update your API client when the OpenAPI document content changes. ", -1))
162
- ])) : p("", !0)
163
- ], 64)) : p("", !0)
179
+ ])) : m("", !0)
180
+ ], 64)) : m("", !0)
164
181
  ], 64))
165
182
  ], 2),
166
- e("div", be, [
167
- e("div", ge, [
168
- e("div", we, [
169
- e("a", ke, [
170
- d(r(ie), {
183
+ e("div", Me, [
184
+ e("div", Ue, [
185
+ e("div", Ae, [
186
+ e("a", Ce, [
187
+ d(i(ce), {
171
188
  icon: "Logo",
172
189
  size: "xl"
173
190
  })
@@ -180,7 +197,7 @@ const de = ["innerHTML"], me = { class: "flex flex-col h-screen justify-center p
180
197
  target: "_blank"
181
198
  }, " Download Desktop App "),
182
199
  e("br"),
183
- L(" free · open-source · offline first ")
200
+ M(" free · open-source · offline first ")
184
201
  ], -1))
185
202
  ])
186
203
  ])
@@ -192,5 +209,5 @@ const de = ["innerHTML"], me = { class: "flex flex-col h-screen justify-center p
192
209
  }
193
210
  });
194
211
  export {
195
- Ee as default
212
+ Ge as default
196
213
  };
@@ -1,5 +1,6 @@
1
1
  type __VLS_Props = {
2
2
  buttonSource: 'sidebar' | 'modal';
3
+ source?: 'api-reference' | 'gitbook';
3
4
  isDevelopment?: boolean;
4
5
  integration?: string | null;
5
6
  url?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"OpenApiClientButton.vue.d.ts","sourceRoot":"","sources":["../../src/components/OpenApiClientButton.vue"],"names":[],"mappings":"AAmGA,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,SAAS,GAAG,OAAO,CAAA;IACjC,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,GAAG,CAAC,EAAE,MAAM,CAAA;CACb,CAAC;;AAyGF,wBAMG"}
1
+ {"version":3,"file":"OpenApiClientButton.vue.d.ts","sourceRoot":"","sources":["../../src/components/OpenApiClientButton.vue"],"names":[],"mappings":"AAuHA,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,SAAS,GAAG,OAAO,CAAA;IACjC,MAAM,CAAC,EAAE,eAAe,GAAG,SAAS,CAAA;IACpC,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,GAAG,CAAC,EAAE,MAAM,CAAA;CACb,CAAC;;AA4HF,wBAMG"}
@@ -1,7 +1,7 @@
1
1
  import t from "./OpenApiClientButton.vue2.js";
2
2
  /* empty css */
3
3
  import o from "../_virtual/_plugin-vue_export-helper.js";
4
- const f = /* @__PURE__ */ o(t, [["__scopeId", "data-v-3ceef301"]]);
4
+ const r = /* @__PURE__ */ o(t, [["__scopeId", "data-v-2e9f75f1"]]);
5
5
  export {
6
- f as default
6
+ r as default
7
7
  };
@@ -1,39 +1,45 @@
1
- import { defineComponent as a, computed as i, openBlock as c, createElementBlock as s, createVNode as m, unref as u, createTextVNode as l, createCommentVNode as f } from "vue";
2
- import { ScalarIcon as p } from "@scalar/components";
3
- import { makeUrlAbsolute as d } from "@scalar/oas-utils/helpers";
4
- const h = ["href"], P = /* @__PURE__ */ a({
1
+ import { defineComponent as i, computed as s, openBlock as m, createElementBlock as l, createVNode as u, unref as d, createTextVNode as f, createCommentVNode as g } from "vue";
2
+ import { ScalarIcon as h } from "@scalar/components";
3
+ import { makeUrlAbsolute as p } from "@scalar/oas-utils/helpers";
4
+ const k = ["href"], v = /* @__PURE__ */ i({
5
5
  __name: "OpenApiClientButton",
6
6
  props: {
7
7
  buttonSource: {},
8
+ source: { default: "api-reference" },
8
9
  isDevelopment: { type: Boolean },
9
10
  integration: {},
10
11
  url: {}
11
12
  },
12
- setup(n) {
13
- const o = i(() => {
14
- const r = n.url ?? (typeof window < "u" ? window.location.href : void 0), e = d(r);
15
- if (!(e != null && e.length))
13
+ setup(o) {
14
+ const a = s(() => {
15
+ const c = o.url ?? (typeof window < "u" ? window.location.href : void 0), t = p(c);
16
+ if (!(t != null && t.length))
16
17
  return;
17
- const t = new URL(
18
- n.isDevelopment ? "http://localhost:5065" : "https://client.scalar.com"
18
+ const e = new URL(
19
+ o.isDevelopment ? "http://localhost:5065" : "https://client.scalar.com"
19
20
  );
20
- return t.searchParams.set("url", e), n.integration !== null && t.searchParams.set("integration", n.integration ?? "vue"), t.searchParams.set("utm_source", "api-reference"), t.searchParams.set("utm_medium", "button"), t.searchParams.set("utm_campaign", n.buttonSource), t.toString();
21
+ if (e.searchParams.set("url", t), o.integration !== null && e.searchParams.set("integration", o.integration ?? "vue"), e.searchParams.set("utm_source", "api-reference"), e.searchParams.set("utm_medium", "button"), e.searchParams.set("utm_campaign", o.buttonSource), o.source === "gitbook") {
22
+ e.searchParams.set("utm_source", "gitbook");
23
+ const n = document.querySelector("img.dark\\:block[alt='Logo']"), r = document.querySelector("img.dark\\:hidden[alt='Logo']");
24
+ n && n instanceof HTMLImageElement && e.searchParams.set("dark_logo", encodeURIComponent(n.src)), r && r instanceof HTMLImageElement && e.searchParams.set("light_logo", encodeURIComponent(r.src));
25
+ }
26
+ return e.toString();
21
27
  });
22
- return (r, e) => o.value ? (c(), s("a", {
28
+ return (c, t) => a.value ? (m(), l("a", {
23
29
  key: 0,
24
30
  class: "open-api-client-button",
25
- href: o.value,
31
+ href: a.value,
26
32
  target: "_blank"
27
33
  }, [
28
- m(u(p), {
34
+ u(d(h), {
29
35
  icon: "ExternalLink",
30
36
  size: "xs",
31
37
  thickness: "2.5"
32
38
  }),
33
- e[0] || (e[0] = l(" Open API Client "))
34
- ], 8, h)) : f("", !0);
39
+ t[0] || (t[0] = f(" Open API Client "))
40
+ ], 8, k)) : g("", !0);
35
41
  }
36
42
  });
37
43
  export {
38
- P as default
44
+ v as default
39
45
  };
@@ -1 +1 @@
1
- {"version":3,"file":"useSearch.d.ts","sourceRoot":"","sources":["../../../src/components/Search/useSearch.ts"],"names":[],"mappings":"AAGA,OAAa,EAAE,KAAK,UAAU,EAAE,MAAM,SAAS,CAAA;AAI/C;;;GAGG;AACH,wBAAgB,SAAS;;;eAMd,MAAM;qBACA,MAAM;kBACT,MAAM;YACZ,MAAM;cACJ,MAAM;cACN,MAAM;;;iCA6EsB,UAAU;eAlFrC,MAAM;qBACA,MAAM;kBACT,MAAM;YACZ,MAAM;cACJ,MAAM;cACN,MAAM;MA6E0C;sBA1CjC,IAAI;;;uCAKe,IAAI,GAAG,MAAM;;EAmExD"}
1
+ {"version":3,"file":"useSearch.d.ts","sourceRoot":"","sources":["../../../src/components/Search/useSearch.ts"],"names":[],"mappings":"AAGA,OAAa,EAAE,KAAK,UAAU,EAAE,MAAM,SAAS,CAAA;AAI/C;;;GAGG;AACH,wBAAgB,SAAS;;;eAMd,MAAM;qBACA,MAAM;kBACT,MAAM;YACZ,MAAM;cACJ,MAAM;cACN,MAAM;;;iCAqFsB,UAAU;eA1FrC,MAAM;qBACA,MAAM;kBACT,MAAM;YACZ,MAAM;cACJ,MAAM;cACN,MAAM;MAqF0C;sBAlDjC,IAAI;;;uCAae,IAAI,GAAG,MAAM;;EAmExD"}
@@ -1,62 +1,66 @@
1
- import { useActiveEntities as w } from "../../store/active-entities.js";
2
- import T from "fuse.js";
3
- import { ref as a, watch as W, computed as x, nextTick as A } from "vue";
1
+ import { useActiveEntities as T } from "../../store/active-entities.js";
2
+ import W from "fuse.js";
3
+ import { ref as a, watch as f, computed as x, nextTick as A } from "vue";
4
4
  import { useRouter as E } from "vue-router";
5
5
  import { useWorkspace as I } from "../../store/store.js";
6
6
  function M() {
7
- const m = E(), { activeWorkspace: f, activeWorkspaceRequests: d } = w(), { requests: R } = I(), o = a([]), u = a([]), s = a(0), c = a(""), l = a(null), n = a([]), i = new T(o.value, {
7
+ const d = E(), { activeWorkspace: R, activeWorkspaceRequests: k } = T(), { requests: S } = I(), u = a([]), c = a([]), s = a(0), o = a(""), l = a(null), r = a([]), i = new W(u.value, {
8
8
  keys: ["title", "description", "body"]
9
- }), k = () => {
10
- c.value = "", s.value = 0, u.value = [], l.value instanceof HTMLInputElement && l.value.blur();
11
- }, S = (t) => {
12
- o.value = t.map((e) => ({
13
- id: e.uid,
14
- title: e.summary ?? e.method,
15
- description: e.description ?? "",
16
- httpVerb: e.method,
17
- path: e.path,
18
- link: `/workspace/${f.value.uid}/request/${e.uid}`
19
- })), i.setCollection(o.value);
20
- }, b = () => {
21
- s.value = 0, u.value = i.search(c.value);
22
- }, y = (t) => {
23
- const e = t === "up" ? -1 : 1, h = r.value.length;
24
- s.value = (s.value + e + h) % h, A(() => {
25
- const p = n.value[s.value];
26
- p instanceof HTMLElement && p.scrollIntoView({
9
+ }), b = () => {
10
+ o.value = "", s.value = 0, c.value = [], l.value instanceof HTMLInputElement && l.value.blur();
11
+ }, g = (e) => {
12
+ u.value = e.map((t) => ({
13
+ id: t.uid,
14
+ title: t.summary ?? t.method,
15
+ description: t.description ?? "",
16
+ httpVerb: t.method,
17
+ path: t.path,
18
+ link: `/workspace/${R.value.uid}/request/${t.uid}`
19
+ })), i.setCollection(u.value);
20
+ }, v = () => {
21
+ s.value = 0, c.value = i.search(o.value);
22
+ };
23
+ f(o, (e) => {
24
+ e.length ? v() : c.value = [];
25
+ });
26
+ const y = (e) => {
27
+ const t = e === "up" ? -1 : 1, p = n.value.length;
28
+ s.value = (s.value + t + p) % p, A(() => {
29
+ const m = r.value[s.value];
30
+ m instanceof HTMLElement && m.scrollIntoView({
27
31
  behavior: "smooth",
28
32
  block: "center"
29
33
  });
30
34
  });
31
- }, g = () => {
32
- s.value >= 0 && v(
33
- r.value[s.value]
35
+ }, w = () => {
36
+ s.value >= 0 && h(
37
+ n.value[s.value]
34
38
  );
35
39
  };
36
- W(
37
- d,
38
- (t) => {
39
- S(t.map((e) => R[e]));
40
+ f(
41
+ k,
42
+ (e) => {
43
+ g(e.map((t) => S[t]));
40
44
  },
41
45
  { immediate: !0 }
42
46
  );
43
- const v = (t) => {
44
- m.push(t.item.id), k();
45
- }, r = x(
46
- () => c.value.length === 0 ? o.value.map((t) => ({
47
- item: t
48
- })) : u.value
47
+ const h = (e) => {
48
+ d.push(e.item.id), b();
49
+ }, n = x(
50
+ () => o.value.length === 0 ? u.value.map((e) => ({
51
+ item: e
52
+ })) : c.value
49
53
  );
50
54
  return {
51
- searchText: c,
52
- searchResultsWithPlaceholderResults: r,
55
+ searchText: o,
56
+ searchResultsWithPlaceholderResults: n,
53
57
  selectedSearchResult: s,
54
- onSearchResultClick: v,
55
- fuseSearch: b,
58
+ onSearchResultClick: h,
59
+ fuseSearch: v,
56
60
  searchInputRef: l,
57
- searchResultRefs: n,
61
+ searchResultRefs: r,
58
62
  navigateSearchResults: y,
59
- selectSearchResult: g
63
+ selectSearchResult: w
60
64
  };
61
65
  }
62
66
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"ApiClientModal.vue.d.ts","sourceRoot":"","sources":["../../../src/layouts/Modal/ApiClientModal.vue"],"names":[],"mappings":";AA8YA,wBAMG"}
1
+ {"version":3,"file":"ApiClientModal.vue.d.ts","sourceRoot":"","sources":["../../../src/layouts/Modal/ApiClientModal.vue"],"names":[],"mappings":";AA+ZA,wBAMG"}
@@ -2,7 +2,7 @@ import o from "./ApiClientModal.vue2.js";
2
2
  /* empty css */
3
3
  /* empty css */
4
4
  import t from "../../_virtual/_plugin-vue_export-helper.js";
5
- const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-e68efb34"]]);
5
+ const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-d1ef066c"]]);
6
6
  export {
7
- m as default
7
+ a as default
8
8
  };
@@ -1,31 +1,31 @@
1
- import { defineComponent as p, ref as f, useId as v, watch as y, onBeforeMount as w, onMounted as h, onBeforeUnmount as _, withDirectives as k, openBlock as C, createElementBlock as E, createElementVNode as r, unref as t, createVNode as K, vShow as F } from "vue";
1
+ import { defineComponent as f, ref as v, useId as w, watch as y, onBeforeMount as h, onMounted as _, onBeforeUnmount as k, withDirectives as C, openBlock as E, createElementBlock as K, createElementVNode as l, unref as t, createVNode as d, withCtx as x, vShow as F } from "vue";
2
2
  import { useActiveEntities as M } from "../../store/active-entities.js";
3
- import { addScalarClassesToHeadless as x } from "@scalar/components";
4
- import { useFocusTrap as B } from "@vueuse/integrations/useFocusTrap";
5
- import { RouterView as P } from "vue-router";
6
- import { useWorkspace as T } from "../../store/store.js";
7
- import { handleHotKeyDown as b } from "../../libs/hot-keys.js";
8
- const A = { class: "scalar scalar-app" }, D = { class: "scalar-container z-overlay" }, S = ["id"], O = /* @__PURE__ */ p({
3
+ import { addScalarClassesToHeadless as T, ScalarTeleportRoot as B } from "@scalar/components";
4
+ import { useFocusTrap as P } from "@vueuse/integrations/useFocusTrap";
5
+ import { RouterView as S } from "vue-router";
6
+ import { useWorkspace as b } from "../../store/store.js";
7
+ import { handleHotKeyDown as A } from "../../libs/hot-keys.js";
8
+ const D = { class: "scalar scalar-app" }, V = { class: "scalar-container z-overlay" }, $ = ["id"], U = /* @__PURE__ */ f({
9
9
  __name: "ApiClientModal",
10
- setup(V) {
11
- const { activeWorkspace: d } = M(), { modalState: o, events: a } = T(), n = f(null), s = v(), { activate: m, deactivate: u } = B(n, {
10
+ setup(g) {
11
+ const { activeWorkspace: u } = M(), { modalState: o, events: a } = b(), n = v(null), r = w(), { activate: m, deactivate: p } = P(n, {
12
12
  allowOutsideClick: !0,
13
13
  initialFocus: () => n.value,
14
- fallbackFocus: `#${s}`
15
- }), l = (e) => b(e, a.hotKeys, d.value.hotKeyConfig);
14
+ fallbackFocus: `#${r}`
15
+ }), s = (e) => A(e, a.hotKeys, u.value.hotKeyConfig);
16
16
  y(
17
17
  () => o.open,
18
18
  (e) => {
19
- e ? (window.addEventListener("keydown", l), document.documentElement.style.overflow = "hidden", m()) : (window.removeEventListener("keydown", l), document.documentElement.style.removeProperty("overflow"), u());
19
+ e ? (window.addEventListener("keydown", s), document.documentElement.style.overflow = "hidden", m()) : (window.removeEventListener("keydown", s), document.documentElement.style.removeProperty("overflow"), p());
20
20
  }
21
- ), w(() => x());
21
+ ), h(() => T());
22
22
  const i = (e) => (e == null ? void 0 : e.closeModal) && o.open && o.hide();
23
- return h(() => a.hotKeys.on(i)), _(() => {
23
+ return _(() => a.hotKeys.on(i)), k(() => {
24
24
  document.documentElement.style.removeProperty("overflow"), a.hotKeys.off(i);
25
- }), (e, c) => k((C(), E("div", A, [
26
- r("div", D, [
27
- r("div", {
28
- id: t(s),
25
+ }), (e, c) => C((E(), K("div", D, [
26
+ l("div", V, [
27
+ l("div", {
28
+ id: t(r),
29
29
  ref_key: "client",
30
30
  ref: n,
31
31
  "aria-label": "API Client",
@@ -34,11 +34,16 @@ const A = { class: "scalar scalar-app" }, D = { class: "scalar-container z-overl
34
34
  role: "dialog",
35
35
  tabindex: "0"
36
36
  }, [
37
- K(t(P), { key: "$route.fullPath" })
38
- ], 8, S),
39
- r("div", {
37
+ d(t(B), null, {
38
+ default: x(() => [
39
+ d(t(S), { key: "$route.fullPath" })
40
+ ]),
41
+ _: 1
42
+ })
43
+ ], 8, $),
44
+ l("div", {
40
45
  class: "scalar-app-exit -z-1",
41
- onClick: c[0] || (c[0] = ($) => t(o).hide())
46
+ onClick: c[0] || (c[0] = (z) => t(o).hide())
42
47
  })
43
48
  ])
44
49
  ], 512)), [
@@ -47,5 +52,5 @@ const A = { class: "scalar scalar-app" }, D = { class: "scalar-container z-overl
47
52
  }
48
53
  });
49
54
  export {
50
- O as default
55
+ U as default
51
56
  };
@@ -14,6 +14,7 @@ export type ClientConfiguration = {
14
14
  export type OpenClientPayload = {
15
15
  path: string;
16
16
  method: LiteralUnion<RequestMethod | Lowercase<RequestMethod>, string>;
17
+ _source?: 'api-reference' | 'gitbook';
17
18
  };
18
19
  type CreateApiClientParams = {
19
20
  /** Element to mount the references to */