@scalar/api-client 2.2.6 → 2.2.8

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 (58) hide show
  1. package/CHANGELOG.md +25 -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/CommandPaletteImport.vue.d.ts.map +1 -1
  6. package/dist/components/CommandPalette/CommandPaletteImport.vue.js +108 -106
  7. package/dist/components/CommandPalette/CommandPaletteRequest.vue.js +20 -20
  8. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts +1 -1
  9. package/dist/components/CommandPalette/TheCommandPalette.vue.js +2 -2
  10. package/dist/components/CommandPalette/TheCommandPalette.vue2.js +12 -12
  11. package/dist/components/HttpMethod/HttpMethod.vue.js +2 -2
  12. package/dist/components/HttpMethod/HttpMethod.vue2.js +12 -12
  13. package/dist/components/HttpMethod/index.d.ts +0 -1
  14. package/dist/components/HttpMethod/index.d.ts.map +1 -1
  15. package/dist/components/HttpMethod/index.js +2 -4
  16. package/dist/components/ImportCollection/ImportCollectionModal.vue.d.ts.map +1 -1
  17. package/dist/components/ImportCollection/ImportCollectionModal.vue.js +119 -102
  18. package/dist/components/OpenApiClientButton.vue.d.ts +1 -0
  19. package/dist/components/OpenApiClientButton.vue.d.ts.map +1 -1
  20. package/dist/components/OpenApiClientButton.vue.js +2 -2
  21. package/dist/components/OpenApiClientButton.vue2.js +23 -17
  22. package/dist/components/Search/useSearch.d.ts.map +1 -1
  23. package/dist/components/Search/useSearch.js +45 -41
  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 +28 -23
  27. package/dist/libs/create-client.d.ts +1 -0
  28. package/dist/libs/create-client.d.ts.map +1 -1
  29. package/dist/libs/create-client.js +31 -30
  30. package/dist/libs/index.d.ts +1 -0
  31. package/dist/libs/index.d.ts.map +1 -1
  32. package/dist/libs/index.js +28 -24
  33. package/dist/libs/postman.d.ts +11 -0
  34. package/dist/libs/postman.d.ts.map +1 -0
  35. package/dist/libs/postman.js +39 -0
  36. package/dist/style.css +1 -1
  37. package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts.map +1 -1
  38. package/dist/views/Environment/EnvironmentVariableDropdown.vue.js +65 -62
  39. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts.map +1 -1
  40. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +1 -1
  41. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +82 -84
  42. package/dist/views/Request/RequestSection/RequestBody.vue.d.ts.map +1 -1
  43. package/dist/views/Request/RequestSection/RequestBody.vue.js +2 -2
  44. package/dist/views/Request/RequestSection/RequestBody.vue2.js +27 -24
  45. package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
  46. package/dist/views/Request/RequestSidebar.vue.js +4 -4
  47. package/dist/views/Request/RequestSidebar.vue2.js +32 -30
  48. package/dist/views/Request/RequestSubpageHeader.vue.d.ts.map +1 -1
  49. package/dist/views/Request/RequestSubpageHeader.vue.js +3 -3
  50. package/dist/views/Request/RequestSubpageHeader.vue2.js +34 -32
  51. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  52. package/dist/views/Request/components/WorkspaceDropdown.vue.js +1 -1
  53. package/dist/views/Request/libs/live-sync.d.ts.map +1 -1
  54. package/dist/views/Request/libs/live-sync.js +77 -78
  55. package/package.json +10 -9
  56. package/dist/components/HttpMethod/helpers.d.ts +0 -4
  57. package/dist/components/HttpMethod/helpers.d.ts.map +0 -1
  58. package/dist/components/HttpMethod/helpers.js +0 -5
@@ -1,5 +1,5 @@
1
- import { defineComponent as q, ref as i, computed as T, watch as F, onMounted as G, onBeforeUnmount as Q, openBlock as a, createBlock as z, unref as r, withCtx as y, createElementVNode as u, createVNode as p, createTextVNode as K, createElementBlock as m, withDirectives as M, withKeys as w, withModifiers as g, vModelText as j, Fragment as A, renderList as B, toDisplayString as N, vShow as J, normalizeClass as X, createCommentVNode as Y, resolveDynamicComponent as Z, mergeProps as ee, nextTick as V } from "vue";
2
- import { useModal as oe, ScalarIcon as S } from "@scalar/components";
1
+ import { defineComponent as q, ref as i, computed as T, watch as F, onMounted as G, onBeforeUnmount as Q, openBlock as a, createBlock as z, unref as r, withCtx as y, createElementVNode as u, createVNode as p, createTextVNode as K, createElementBlock as m, withDirectives as M, withKeys as w, withModifiers as g, vModelText as j, Fragment as P, renderList as B, toDisplayString as N, vShow as J, normalizeClass as X, createCommentVNode as Y, resolveDynamicComponent as Z, mergeProps as ee, nextTick as V } from "vue";
2
+ import { useModal as oe, ScalarIcon as A } from "@scalar/components";
3
3
  import { Dialog as te, DialogPanel as ne, DialogTitle as ae } from "@headlessui/vue";
4
4
  import { useRouter as le } from "vue-router";
5
5
  import { ROUTES as se } from "../../constants.js";
@@ -24,7 +24,7 @@ const he = {
24
24
  }, we = {
25
25
  name: "TheCommandPalette"
26
26
  }, ge = {
27
- "Import from OpenAPI/Swagger": ie,
27
+ "Import from OpenAPI/Swagger/Postman": ie,
28
28
  "Create Request": ue,
29
29
  "Create Workspace": fe,
30
30
  "Add Tag": pe,
@@ -33,8 +33,8 @@ const he = {
33
33
  "Add Example": ce
34
34
  }, Ve = /* @__PURE__ */ q({
35
35
  ...we,
36
- setup(Ae) {
37
- const P = [
36
+ setup(Pe) {
37
+ const S = [
38
38
  {
39
39
  label: "",
40
40
  commands: [
@@ -43,7 +43,7 @@ const he = {
43
43
  icon: "ExternalLink"
44
44
  },
45
45
  {
46
- name: "Import from OpenAPI/Swagger",
46
+ name: "Import from OpenAPI/Swagger/Postman",
47
47
  icon: "Import"
48
48
  },
49
49
  {
@@ -92,7 +92,7 @@ const he = {
92
92
  }))
93
93
  }
94
94
  ], d = oe(), { push: W } = le(), { activeWorkspace: H } = re(), { events: f } = ve(), x = i(), l = i(""), s = i(null), c = i(-1), D = i([]), v = T(
95
- () => P.reduce((e, o) => {
95
+ () => S.reduce((e, o) => {
96
96
  const t = o.commands.filter(
97
97
  (n) => n.name.toLowerCase().includes(l.value.toLowerCase())
98
98
  );
@@ -164,7 +164,7 @@ const he = {
164
164
  type: "button",
165
165
  onClick: o[3] || (o[3] = (t) => s.value = null)
166
166
  }, [
167
- p(r(S), {
167
+ p(r(A), {
168
168
  icon: "ChevronLeft",
169
169
  size: "md",
170
170
  thickness: "1.5"
@@ -177,7 +177,7 @@ const he = {
177
177
  ])) : (a(), m("div", he, [
178
178
  u("div", Ce, [
179
179
  u("label", xe, [
180
- p(r(S), {
180
+ p(r(A), {
181
181
  class: "text-c-2 mr-2.5",
182
182
  icon: "Search",
183
183
  size: "md",
@@ -203,7 +203,7 @@ const he = {
203
203
  [j, l.value]
204
204
  ])
205
205
  ]),
206
- (a(), m(A, null, B(P, (t) => (a(), m(A, {
206
+ (a(), m(P, null, B(S, (t) => (a(), m(P, {
207
207
  key: t.label
208
208
  }, [
209
209
  M(u("div", { class: "text-c-3 font-medium text-xs px-2 mb-1 mt-2" }, N(t.label), 513), [
@@ -214,7 +214,7 @@ const he = {
214
214
  ).length > 0
215
215
  ]
216
216
  ]),
217
- (a(!0), m(A, null, B(t.commands.filter(
217
+ (a(!0), m(P, null, B(t.commands.filter(
218
218
  (n) => n.name.toLowerCase().includes(l.value.toLowerCase())
219
219
  ), (n, C) => {
220
220
  var L;
@@ -229,7 +229,7 @@ const he = {
229
229
  }]),
230
230
  onClick: (b) => $(n)
231
231
  }, [
232
- p(r(S), {
232
+ p(r(A), {
233
233
  class: "text-c-2 mr-2.5",
234
234
  icon: n.icon,
235
235
  size: "md",
@@ -1,7 +1,7 @@
1
1
  import t from "./HttpMethod.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-fcbb6eeb"]]);
4
+ const _ = /* @__PURE__ */ o(t, [["__scopeId", "data-v-46723816"]]);
5
5
  export {
6
- f as default
6
+ _ as default
7
7
  };
@@ -1,5 +1,5 @@
1
- import { defineComponent as g, computed as a, openBlock as c, createBlock as y, unref as t, withCtx as q, createElementVNode as s, normalizeClass as l, toDisplayString as p, createElementBlock as w } from "vue";
2
- import { cva as k, ScalarListbox as x, cx as m } from "@scalar/components";
1
+ import { defineComponent as g, computed as a, openBlock as c, createBlock as y, unref as t, withCtx as q, createElementVNode as l, normalizeClass as s, toDisplayString as p, createElementBlock as k } from "vue";
2
+ import { cva as w, ScalarListbox as x, cx as m } from "@scalar/components";
3
3
  import { getHttpMethodInfo as f, REQUEST_METHODS as B } from "@scalar/oas-utils/helpers";
4
4
  const H = /* @__PURE__ */ g({
5
5
  __name: "HttpMethod",
@@ -12,12 +12,12 @@ const H = /* @__PURE__ */ g({
12
12
  setup(b, { emit: h }) {
13
13
  const r = b, v = h, o = a(() => f(r.method)), n = Object.entries(B).map(([e]) => ({
14
14
  id: e,
15
- label: e.charAt(0) + e.toLowerCase().slice(1),
15
+ label: e.toUpperCase(),
16
16
  color: f(e).color
17
17
  })), i = a({
18
18
  get: () => n.find(({ id: e }) => e === r.method),
19
19
  set: (e) => (e == null ? void 0 : e.id) && v("change", e.id)
20
- }), d = k({
20
+ }), d = w({
21
21
  base: "text-center font-code text-3xs justify-center items-center flex",
22
22
  variants: {
23
23
  isSquare: {
@@ -34,25 +34,25 @@ const H = /* @__PURE__ */ g({
34
34
  key: 0,
35
35
  modelValue: i.value,
36
36
  "onUpdate:modelValue": u[0] || (u[0] = (S) => i.value = S),
37
- class: "mt-1 font-code text-sm uppercase",
37
+ class: "mt-1 font-code text-sm scalar-client",
38
38
  options: t(n)
39
39
  }, {
40
40
  default: q(() => [
41
- s("div", {
42
- class: l(["h-full", { "pointer-events-none": !e.isEditable }])
41
+ l("div", {
42
+ class: s(["h-full", { "pointer-events-none": !e.isEditable }])
43
43
  }, [
44
- s("button", {
45
- class: l(["relative h-full", t(m)(t(d)({ isSquare: e.isSquare, isEditable: e.isEditable }), o.value.color)]),
44
+ l("button", {
45
+ class: s(["relative h-full", t(m)(t(d)({ isSquare: e.isSquare, isEditable: e.isEditable }), o.value.color)]),
46
46
  type: "button"
47
47
  }, [
48
- s("span", null, p(E.value), 1)
48
+ l("span", null, p(E.value), 1)
49
49
  ], 2)
50
50
  ], 2)
51
51
  ]),
52
52
  _: 1
53
- }, 8, ["modelValue", "options"])) : (c(), w("div", {
53
+ }, 8, ["modelValue", "options"])) : (c(), k("div", {
54
54
  key: 1,
55
- class: l(["relative gap-1 whitespace-nowrap", t(m)(t(d)({ isSquare: e.isSquare, isEditable: e.isEditable }), o.value.color)]),
55
+ class: s(["relative gap-1 whitespace-nowrap", t(m)(t(d)({ isSquare: e.isSquare, isEditable: e.isEditable }), o.value.color)]),
56
56
  type: "button"
57
57
  }, p(o.value.short), 3));
58
58
  }
@@ -1,3 +1,2 @@
1
1
  export { default as HttpMethod } from './HttpMethod.vue.js';
2
- export * from './helpers.js';
3
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/HttpMethod/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,kBAAkB,CAAA;AACxD,cAAc,WAAW,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/HttpMethod/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,kBAAkB,CAAA"}
@@ -1,6 +1,4 @@
1
- import { default as e } from "./HttpMethod.vue.js";
2
- import { isHTTPMethod as d } from "./helpers.js";
1
+ import { default as o } from "./HttpMethod.vue.js";
3
2
  export {
4
- e as HttpMethod,
5
- d as isHTTPMethod
3
+ o as HttpMethod
6
4
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ImportCollectionModal.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCollection/ImportCollectionModal.vue"],"names":[],"mappings":"AA2XA,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,SAAS,EAAE,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,IAAI,CAAA;CAC7C,CAAC;;;;;;AAybF,wBAQG"}
1
+ {"version":3,"file":"ImportCollectionModal.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCollection/ImportCollectionModal.vue"],"names":[],"mappings":"AA4ZA,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,SAAS,EAAE,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,IAAI,CAAA;CAC7C,CAAC;;;;;;AAodF,wBAQG"}
@@ -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"}