@scalar/api-client 2.2.4 → 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 (93) hide show
  1. package/CHANGELOG.md +62 -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.d.ts.map +1 -1
  5. package/dist/components/AddressBar/AddressBarServer.vue.js +28 -28
  6. package/dist/components/CommandPalette/CommandPaletteExample.vue.js +1 -1
  7. package/dist/components/CommandPalette/CommandPaletteRequest.vue.d.ts.map +1 -1
  8. package/dist/components/CommandPalette/CommandPaletteRequest.vue.js +41 -41
  9. package/dist/components/CommandPalette/CommandPaletteServer.vue.js +2 -2
  10. package/dist/components/CommandPalette/CommandPaletteTag.vue.js +5 -5
  11. package/dist/components/DataTable/DataTableCheckbox.vue.d.ts.map +1 -1
  12. package/dist/components/DataTable/DataTableCheckbox.vue.js +5 -6
  13. package/dist/components/DataTable/DataTableInputSelect.vue.d.ts.map +1 -1
  14. package/dist/components/DataTable/DataTableInputSelect.vue.js +8 -8
  15. package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.d.ts.map +1 -1
  16. package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +9 -10
  17. package/dist/components/HttpMethod/HttpMethod.vue.d.ts.map +1 -1
  18. package/dist/components/HttpMethod/HttpMethod.vue.js +2 -2
  19. package/dist/components/HttpMethod/HttpMethod.vue2.js +24 -25
  20. package/dist/components/HttpMethod/index.d.ts +0 -1
  21. package/dist/components/HttpMethod/index.d.ts.map +1 -1
  22. package/dist/components/HttpMethod/index.js +2 -4
  23. package/dist/components/ImportCollection/ImportCollectionModal.vue.d.ts.map +1 -1
  24. package/dist/components/ImportCollection/ImportCollectionModal.vue.js +121 -103
  25. package/dist/components/ImportCollection/WorkspaceSelector.vue.d.ts.map +1 -1
  26. package/dist/components/ImportCollection/WorkspaceSelector.vue.js +24 -26
  27. package/dist/components/ImportCollection/hooks/useUrlPrefetcher.d.ts +6 -0
  28. package/dist/components/ImportCollection/hooks/useUrlPrefetcher.d.ts.map +1 -1
  29. package/dist/components/ImportCollection/hooks/useUrlPrefetcher.js +28 -23
  30. package/dist/components/OpenApiClientButton.vue.d.ts +1 -0
  31. package/dist/components/OpenApiClientButton.vue.d.ts.map +1 -1
  32. package/dist/components/OpenApiClientButton.vue.js +2 -2
  33. package/dist/components/OpenApiClientButton.vue2.js +21 -15
  34. package/dist/components/Search/useSearch.d.ts.map +1 -1
  35. package/dist/components/Search/useSearch.js +45 -41
  36. package/dist/components/ViewLayout/ViewLayoutCollapse.vue.d.ts.map +1 -1
  37. package/dist/components/ViewLayout/ViewLayoutCollapse.vue.js +5 -6
  38. package/dist/layouts/App/create-api-client-app.d.ts +1 -0
  39. package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
  40. package/dist/layouts/Modal/ApiClientModal.vue.d.ts.map +1 -1
  41. package/dist/layouts/Modal/ApiClientModal.vue.js +2 -2
  42. package/dist/layouts/Modal/ApiClientModal.vue2.js +28 -23
  43. package/dist/layouts/Modal/create-api-client-modal.d.ts +2 -0
  44. package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
  45. package/dist/layouts/Web/create-api-client-web.d.ts +1 -0
  46. package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
  47. package/dist/libs/create-client.d.ts +3 -1
  48. package/dist/libs/create-client.d.ts.map +1 -1
  49. package/dist/libs/create-client.js +50 -48
  50. package/dist/store/store.d.ts +3 -1
  51. package/dist/store/store.d.ts.map +1 -1
  52. package/dist/store/store.js +47 -45
  53. package/dist/style.css +1 -1
  54. package/dist/views/Cookies/Cookies.vue.d.ts.map +1 -1
  55. package/dist/views/Cookies/Cookies.vue2.js +18 -20
  56. package/dist/views/Environment/EnvironmentVariableDropdown.vue.d.ts.map +1 -1
  57. package/dist/views/Environment/EnvironmentVariableDropdown.vue.js +63 -60
  58. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts.map +1 -1
  59. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.js +20 -19
  60. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts.map +1 -1
  61. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +1 -1
  62. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +84 -86
  63. package/dist/views/Request/RequestSection/RequestBody.vue.d.ts.map +1 -1
  64. package/dist/views/Request/RequestSection/RequestBody.vue.js +2 -2
  65. package/dist/views/Request/RequestSection/RequestBody.vue2.js +37 -36
  66. package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
  67. package/dist/views/Request/RequestSidebar.vue.js +3 -3
  68. package/dist/views/Request/RequestSidebar.vue2.js +60 -61
  69. package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
  70. package/dist/views/Request/RequestSidebarItem.vue.js +1 -1
  71. package/dist/views/Request/RequestSidebarItem.vue2.js +187 -195
  72. package/dist/views/Request/RequestSubpageHeader.vue.d.ts.map +1 -1
  73. package/dist/views/Request/RequestSubpageHeader.vue.js +3 -3
  74. package/dist/views/Request/RequestSubpageHeader.vue2.js +34 -36
  75. package/dist/views/Request/ResponseSection/ResponseBodyPreview.vue.d.ts.map +1 -1
  76. package/dist/views/Request/ResponseSection/ResponseBodyPreview.vue.js +1 -1
  77. package/dist/views/Request/ResponseSection/ResponseBodyPreview.vue2.js +5 -5
  78. package/dist/views/Request/ResponseSection/ResponseEmpty.vue.d.ts.map +1 -1
  79. package/dist/views/Request/ResponseSection/ResponseEmpty.vue.js +2 -2
  80. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +30 -25
  81. package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.d.ts.map +1 -1
  82. package/dist/views/Request/ResponseSection/ResponseMetaInformation.vue.js +41 -30
  83. package/dist/views/Request/components/WorkspaceDropdown.vue.d.ts.map +1 -1
  84. package/dist/views/Request/components/WorkspaceDropdown.vue.js +3 -5
  85. package/dist/views/Request/libs/live-sync.d.ts.map +1 -1
  86. package/dist/views/Request/libs/live-sync.js +77 -78
  87. package/dist/views/Request/libs/oauth2.d.ts +6 -2
  88. package/dist/views/Request/libs/oauth2.d.ts.map +1 -1
  89. package/dist/views/Request/libs/oauth2.js +43 -37
  90. package/package.json +10 -11
  91. package/dist/components/HttpMethod/helpers.d.ts +0 -4
  92. package/dist/components/HttpMethod/helpers.d.ts.map +0 -1
  93. package/dist/components/HttpMethod/helpers.js +0 -5
@@ -1 +1 @@
1
- {"version":3,"file":"HttpMethod.vue.d.ts","sourceRoot":"","sources":["../../../src/components/HttpMethod/HttpMethod.vue"],"names":[],"mappings":"AAkGA,KAAK,WAAW,GAAG;IACf,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,CAAC;;;;;;cAHW,OAAO;gBAEL,OAAO;;AAwIxB,wBAQG"}
1
+ {"version":3,"file":"HttpMethod.vue.d.ts","sourceRoot":"","sources":["../../../src/components/HttpMethod/HttpMethod.vue"],"names":[],"mappings":"AAgGA,KAAK,WAAW,GAAG;IACf,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,CAAC;;;;;;cAHW,OAAO;gBAEL,OAAO;;AAwIxB,wBAQG"}
@@ -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 m = /* @__PURE__ */ o(t, [["__scopeId", "data-v-a2902675"]]);
4
+ const _ = /* @__PURE__ */ o(t, [["__scopeId", "data-v-46723816"]]);
5
5
  export {
6
- m as default
6
+ _ as default
7
7
  };
@@ -1,8 +1,7 @@
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 { ScalarListbox as x } from "@scalar/components";
3
- import { getHttpMethodInfo as m, REQUEST_METHODS as k } from "@scalar/oas-utils/helpers";
4
- import { cva as B, cx as f } from "cva";
5
- const L = /* @__PURE__ */ g({
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
+ import { getHttpMethodInfo as f, REQUEST_METHODS as B } from "@scalar/oas-utils/helpers";
4
+ const H = /* @__PURE__ */ g({
6
5
  __name: "HttpMethod",
7
6
  props: {
8
7
  isSquare: { type: Boolean, default: !1 },
@@ -11,14 +10,14 @@ const L = /* @__PURE__ */ g({
11
10
  },
12
11
  emits: ["change"],
13
12
  setup(b, { emit: h }) {
14
- const r = b, v = h, o = a(() => m(r.method)), i = Object.entries(k).map(([e]) => ({
13
+ const r = b, v = h, o = a(() => f(r.method)), n = Object.entries(B).map(([e]) => ({
15
14
  id: e,
16
- label: e.charAt(0) + e.toLowerCase().slice(1),
17
- color: m(e).color
18
- })), n = a({
19
- get: () => i.find(({ id: e }) => e === r.method),
15
+ label: e.toUpperCase(),
16
+ color: f(e).color
17
+ })), i = a({
18
+ get: () => n.find(({ id: e }) => e === r.method),
20
19
  set: (e) => (e == null ? void 0 : e.id) && v("change", e.id)
21
- }), d = B({
20
+ }), d = w({
22
21
  base: "text-center font-code text-3xs justify-center items-center flex",
23
22
  variants: {
24
23
  isSquare: {
@@ -26,38 +25,38 @@ const L = /* @__PURE__ */ g({
26
25
  false: "rounded-full"
27
26
  },
28
27
  isEditable: {
29
- true: "px-0 http-bg-gradient rounded-md border-1/2 border-r-1/2",
30
- false: "cusor-pointer"
28
+ true: "http-bg-gradient rounded-md border-1/2 border-r-1/2",
29
+ false: "cursor-auto"
31
30
  }
32
31
  }
33
32
  }), E = a(() => o.value.short);
34
33
  return (e, u) => e.isEditable ? (c(), y(t(x), {
35
34
  key: 0,
36
- modelValue: n.value,
37
- "onUpdate:modelValue": u[0] || (u[0] = (S) => n.value = S),
38
- class: "mt-1 font-code text-sm uppercase",
39
- options: t(i)
35
+ modelValue: i.value,
36
+ "onUpdate:modelValue": u[0] || (u[0] = (S) => i.value = S),
37
+ class: "mt-1 font-code text-sm scalar-client",
38
+ options: t(n)
40
39
  }, {
41
40
  default: q(() => [
42
- s("div", {
43
- class: l(["h-full", { "pointer-events-none": !e.isEditable }])
41
+ l("div", {
42
+ class: s(["h-full", { "pointer-events-none": !e.isEditable }])
44
43
  }, [
45
- s("button", {
46
- class: l(["relative h-full", t(f)(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)]),
47
46
  type: "button"
48
47
  }, [
49
- s("span", null, p(E.value), 1)
48
+ l("span", null, p(E.value), 1)
50
49
  ], 2)
51
50
  ], 2)
52
51
  ]),
53
52
  _: 1
54
- }, 8, ["modelValue", "options"])) : (c(), w("div", {
53
+ }, 8, ["modelValue", "options"])) : (c(), k("div", {
55
54
  key: 1,
56
- class: l(["relative gap-1 whitespace-nowrap", t(f)(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)]),
57
56
  type: "button"
58
57
  }, p(o.value.short), 3));
59
58
  }
60
59
  });
61
60
  export {
62
- L as default
61
+ H as default
63
62
  };
@@ -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":"AAyXA,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;;;;;;AAqbF,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 F, ref as B, computed as l, watch as x, onMounted as q, onUnmounted as H, openBlock as c, createBlock as R, unref as r, withCtx as W, createElementBlock as a, createCommentVNode as p, createElementVNode as e, normalizeClass as K, Fragment as y, createVNode as d, toDisplayString as G, createTextVNode as I } from "vue";
2
- import J from "../CommandPalette/WatchModeToggle.vue.js";
3
- import Q from "./ImportNowButton.vue.js";
4
- import X from "./IntegrationLogo.vue.js";
5
- import Y from "./PrefetchError.vue.js";
6
- import Z from "./WorkspaceSelector.vue.js";
7
- import { useUrlPrefetcher as ee } from "./hooks/useUrlPrefetcher.js";
8
- import { getOpenApiDocumentVersion as L } from "./utils/getOpenApiDocumentVersion.js";
9
- import { isDocument as M } from "./utils/isDocument.js";
10
- import { isUrl as A } from "./utils/isUrl.js";
11
- import { useActiveEntities as te } from "../../store/active-entities.js";
12
- import { useModal as oe, ScalarModal as se, ScalarIcon as ne } from "@scalar/components";
13
- import { isLocalUrl as ie } from "@scalar/oas-utils/helpers";
14
- import { normalize as re } from "@scalar/openapi-parser";
15
- import { getThemeStyles as le } from "@scalar/themes";
16
- import { useWorkspace as ce } from "../../store/store.js";
17
- const ae = ["innerHTML"], de = { class: "flex flex-col h-screen justify-center px-6 overflow-hidden relative md:px-0" }, me = {
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
+ import { isDocument as A } from "./utils/isDocument.js";
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
- }, ue = { class: "rounded-xl size-10" }, pe = { class: "text-center text-md font-bold mb-2 line-clamp-1" }, fe = { class: "inline-flex flex-col gap-2 items-center z-10 w-full" }, ve = { class: "flex justify-center" }, he = { class: "inline-flex py-1 px-4 items-center text-xs font-medium text-c-3" }, xe = {
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
- }, ye = { class: "flex items-center justify-center" }, _e = { class: "flex flex-col justify-center items-center pb-8" }, be = { class: "text-center flex items-center flex-col" }, ge = { class: "mb-2 w-10 h-10 border rounded-[10px] flex items-center justify-center" }, we = {
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
- }, $e = /* @__PURE__ */ F({
31
+ }, Ge = /* @__PURE__ */ H({
27
32
  __name: "ImportCollectionModal",
28
33
  props: {
29
34
  source: {},
@@ -31,83 +36,91 @@ const ae = ["innerHTML"], de = { class: "flex flex-col h-screen justify-center p
31
36
  eventType: {}
32
37
  },
33
38
  emits: ["importFinished"],
34
- setup(T, { emit: U }) {
35
- const o = T, P = U, { activeWorkspace: m } = te(), { workspaceMutators: C, events: D } = ce(), { prefetchResult: n, prefetchUrl: _, resetPrefetchResult: V } = ee(), i = oe(), f = B(!0);
36
- D.hotKeys.on(() => i.hide());
37
- const S = 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 re(
40
- n.content || o.source || ""
44
+ return de(
45
+ n.content || s.source || ""
41
46
  );
42
47
  } catch {
43
48
  return;
44
49
  }
45
- }), j = l(() => {
46
- var s, t;
47
- return (t = (s = S.value) == null ? void 0 : s.info) == null ? void 0 : t.title;
48
- }), b = l(
49
- () => L(n.content || o.source || "")
50
- );
51
- x(
52
- () => o.source,
53
- async (s) => {
54
- if (V(), A(s)) {
55
- if (o.eventType && ["paste", "drop"].includes(o.eventType)) {
56
- const { error: u } = await _(
57
- s,
58
- m.value.proxyUrl
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) => {
66
+ var t;
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
59
72
  );
60
- u ? i.hide() : i.show();
73
+ p ? r.hide() : r.show();
61
74
  return;
62
75
  }
63
- _(s, m.value.proxyUrl), i.show();
76
+ b(o, u.value.proxyUrl), r.show();
64
77
  return;
65
78
  }
66
- s && M(s) && L(s) ? i.show() : i.hide();
79
+ o && A(o) && U(o) ? r.show() : r.hide();
67
80
  }
68
81
  );
69
- const z = l(() => !!o.source && A(o.source)), N = l(() => !!o.source && M(o.source)), v = l(() => n.url && ie(n.url)), h = (s) => {
70
- document.body.classList.remove("has-no-import-url"), (z.value || N.value) && i.open ? document.body.classList.add("has-import-url") : document.body.classList.remove("has-import-url");
71
- }, O = () => {
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 = () => {
72
85
  document.body.classList.remove("has-import-url"), document.body.classList.add("has-no-import-url");
73
86
  };
74
- x(
75
- () => i.open,
76
- (s) => {
77
- s ? h() : O();
87
+ _(
88
+ () => r.open,
89
+ (o) => {
90
+ o ? x() : R();
78
91
  }
79
- ), x(
80
- () => o.source,
92
+ ), _(
93
+ () => s.source,
81
94
  () => {
82
- h();
95
+ x();
83
96
  }
84
- ), q(() => {
85
- h();
86
- }), H(() => {
97
+ ), K(() => {
98
+ x();
99
+ }), G(() => {
87
100
  document.body.classList.remove("has-import-url"), document.body.classList.remove("has-no-import-url");
88
101
  });
89
- const g = l(
90
- () => m.value && v.value && o.integration && `<style>${le(o.integration)}</style>`
102
+ const k = c(
103
+ () => u.value && h.value && s.integration && `<style>${me(s.integration)}</style>`
91
104
  );
92
- function $() {
93
- v.value && o.integration && C.edit(
94
- m.value.uid,
105
+ function q() {
106
+ h.value && s.integration && V.edit(
107
+ u.value.uid,
95
108
  "themeId",
96
- o.integration
97
- ), P("importFinished");
109
+ s.integration
110
+ ), D("importFinished");
98
111
  }
99
- return (s, t) => (c(), R(r(se), {
112
+ return (o, t) => (l(), J(i(le), {
100
113
  size: "full",
101
- state: r(i)
114
+ state: i(r)
102
115
  }, {
103
- default: W(() => {
104
- var u, w, k;
116
+ default: Q(() => {
117
+ var y, p, I, L;
105
118
  return [
106
- g.value ? (c(), a("div", {
119
+ k.value ? (l(), a("div", {
107
120
  key: 0,
108
- innerHTML: g.value
109
- }, null, 8, ae)) : p("", !0),
110
- e("div", de, [
121
+ innerHTML: k.value
122
+ }, null, 8, ve)) : m("", !0),
123
+ e("div", he, [
111
124
  t[6] || (t[6] = e("div", { class: "section-flare" }, [
112
125
  e("div", { class: "section-flare-item" }),
113
126
  e("div", { class: "section-flare-item" }),
@@ -119,54 +132,59 @@ const ae = ["innerHTML"], de = { class: "flex flex-col h-screen justify-center p
119
132
  e("div", { class: "section-flare-item" })
120
133
  ], -1)),
121
134
  e("div", {
122
- class: K(["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" }])
123
136
  }, [
124
- r(n).error && r(n).state === "idle" && !b.value ? (c(), a(y, { key: 0 }, [
137
+ i(n).error && i(n).state === "idle" && !w.value ? (l(), a(g, { key: 0 }, [
125
138
  t[1] || (t[1] = e("div", { class: "text-center text-md font-bold mb-2 line-clamp-1" }, " No OpenAPI document found ", -1)),
126
- d(Y, {
127
- url: ((u = r(n)) == null ? void 0 : u.input) || o.source
139
+ d(oe, {
140
+ url: ((y = i(n)) == null ? void 0 : y.input) || s.source
128
141
  }, null, 8, ["url"])
129
- ], 64)) : (c(), a(y, { key: 1 }, [
130
- v.value ? (c(), a("div", me, [
131
- e("div", ue, [
132
- d(X, { 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"])
133
146
  ])
134
- ])) : p("", !0),
135
- e("div", pe, G(j.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)),
136
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)),
137
- b.value ? (c(), a(y, { key: 1 }, [
138
- e("div", fe, [
139
- d(Q, {
140
- source: ((w = r(n)) == null ? void 0 : w.url) ?? 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,
141
159
  variant: "button",
142
160
  watchMode: f.value,
143
- onImportFinished: $
161
+ onImportFinished: q
144
162
  }, null, 8, ["source", "watchMode"])
145
163
  ]),
146
- e("div", ve, [
147
- e("div", he, [
148
- t[2] || (t[2] = I(" Import to: ")),
149
- d(Z)
164
+ e("div", we, [
165
+ e("div", ke, [
166
+ t[2] || (t[2] = M(" Import to: ")),
167
+ d(se)
150
168
  ])
151
169
  ]),
152
- (k = r(n)) != null && k.url ? (c(), a("div", xe, [
153
- e("div", ye, [
154
- d(J, {
170
+ (L = i(n)) != null && L.url ? (l(), a("div", Ie, [
171
+ e("div", Le, [
172
+ d(Z, {
155
173
  modelValue: f.value,
156
- "onUpdate:modelValue": t[0] || (t[0] = (E) => f.value = E),
174
+ "onUpdate:modelValue": t[0] || (t[0] = (B) => f.value = B),
157
175
  disableToolTip: !0
158
176
  }, null, 8, ["modelValue"])
159
177
  ]),
160
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))
161
- ])) : p("", !0)
162
- ], 64)) : p("", !0)
179
+ ])) : m("", !0)
180
+ ], 64)) : m("", !0)
163
181
  ], 64))
164
182
  ], 2),
165
- e("div", _e, [
166
- e("div", be, [
167
- e("div", ge, [
168
- e("a", we, [
169
- d(r(ne), {
183
+ e("div", Me, [
184
+ e("div", Ue, [
185
+ e("div", Ae, [
186
+ e("a", Ce, [
187
+ d(i(ce), {
170
188
  icon: "Logo",
171
189
  size: "xl"
172
190
  })
@@ -179,7 +197,7 @@ const ae = ["innerHTML"], de = { class: "flex flex-col h-screen justify-center p
179
197
  target: "_blank"
180
198
  }, " Download Desktop App "),
181
199
  e("br"),
182
- I(" free · open-source · offline first ")
200
+ M(" free · open-source · offline first ")
183
201
  ], -1))
184
202
  ])
185
203
  ])
@@ -191,5 +209,5 @@ const ae = ["innerHTML"], de = { class: "flex flex-col h-screen justify-center p
191
209
  }
192
210
  });
193
211
  export {
194
- $e as default
212
+ Ge as default
195
213
  };
@@ -1 +1 @@
1
- {"version":3,"file":"WorkspaceSelector.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCollection/WorkspaceSelector.vue"],"names":[],"mappings":";AA+bA,wBAKG"}
1
+ {"version":3,"file":"WorkspaceSelector.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCollection/WorkspaceSelector.vue"],"names":[],"mappings":";AA2bA,wBAKG"}
@@ -1,6 +1,6 @@
1
- import { defineComponent as y, ref as W, openBlock as d, createElementBlock as x, Fragment as w, createElementVNode as t, createVNode as s, unref as e, withCtx as o, renderList as D, createBlock as N, withModifiers as k, normalizeClass as M, toDisplayString as h, withDirectives as z, vModelText as B, createTextVNode as V } from "vue";
1
+ import { defineComponent as y, ref as W, openBlock as m, createElementBlock as x, Fragment as w, createElementVNode as t, createVNode as s, unref as e, withCtx as a, renderList as D, createBlock as N, withModifiers as k, normalizeClass as z, toDisplayString as v, withDirectives as M, vModelText as B, createTextVNode as V } from "vue";
2
2
  import { useActiveEntities as j } from "../../store/active-entities.js";
3
- import { useModal as E, ScalarDropdown as T, ScalarDropdownItem as v, ScalarIcon as m, ScalarDropdownDivider as $, ScalarButton as _, ScalarModal as A } from "@scalar/components";
3
+ import { useModal as E, ScalarDropdown as T, ScalarDropdownItem as h, ScalarIcon as d, ScalarDropdownDivider as $, ScalarButton as _, ScalarModal as A } from "@scalar/components";
4
4
  import { useToasts as I } from "@scalar/use-toasts";
5
5
  import { useRouter as F } from "vue-router";
6
6
  import { useWorkspace as L } from "../../store/store.js";
@@ -29,63 +29,61 @@ const P = { class: "flex items-center text-sm w-[inherit]" }, R = { class: "font
29
29
  }
30
30
  }), r.value = "", c.hide();
31
31
  };
32
- return (n, a) => (d(), x(w, null, [
32
+ return (n, o) => (m(), x(w, null, [
33
33
  t("div", P, [
34
34
  s(e(T), null, {
35
- items: o(() => [
36
- (d(!0), x(w, null, D(e(b), (l, p) => (d(), N(e(v), {
35
+ items: a(() => [
36
+ (m(!0), x(w, null, D(e(b), (l, p) => (m(), N(e(h), {
37
37
  key: p,
38
38
  class: "flex gap-1.5 group/item items-center whitespace-nowrap text-ellipsis overflow-hidden w-full",
39
39
  onClick: k((J) => C(p), ["stop"])
40
40
  }, {
41
- default: o(() => [
41
+ default: a(() => [
42
42
  t("div", {
43
- class: M([
43
+ class: z([
44
44
  "flex items-center justify-center rounded-full p-[3px] w-4 h-4",
45
45
  e(i).uid === p ? "bg-c-accent text-b-1" : "group-hover/item:shadow-border text-transparent"
46
46
  ])
47
47
  }, [
48
- s(e(m), {
48
+ s(e(d), {
49
49
  class: "size-2.5",
50
50
  icon: "Checkmark",
51
51
  thickness: "3.5"
52
52
  })
53
53
  ], 2),
54
- t("span", q, h(l.name), 1)
54
+ t("span", q, v(l.name), 1)
55
55
  ]),
56
56
  _: 2
57
57
  }, 1032, ["onClick"]))), 128)),
58
58
  s(e($)),
59
- s(e(v), {
59
+ s(e(h), {
60
60
  class: "flex items-center gap-1.5",
61
- onClick: a[0] || (a[0] = (l) => e(c).show())
61
+ onClick: o[0] || (o[0] = (l) => e(c).show())
62
62
  }, {
63
- default: o(() => [
63
+ default: a(() => [
64
64
  t("div", G, [
65
- s(e(m), {
66
- class: "h-2.5",
65
+ s(e(d), {
67
66
  icon: "Add",
68
- thickness: "3"
67
+ size: "sm"
69
68
  })
70
69
  ]),
71
- a[2] || (a[2] = t("span", null, "New Workspace", -1))
70
+ o[2] || (o[2] = t("span", null, "New Workspace", -1))
72
71
  ]),
73
72
  _: 1
74
73
  })
75
74
  ]),
76
- default: o(() => [
75
+ default: a(() => [
77
76
  s(e(_), {
78
77
  class: "font-normal h-full justify-start line-clamp-1 py-1 px-1.5 text-c-1 hover:bg-b-2 w-fit text-c-3",
79
78
  fullWidth: "",
80
79
  variant: "ghost"
81
80
  }, {
82
- default: o(() => [
81
+ default: a(() => [
83
82
  t("div", R, [
84
- t("h2", U, h(e(i).name), 1),
85
- s(e(m), {
86
- class: "size-3",
83
+ t("h2", U, v(e(i).name), 1),
84
+ s(e(d), {
87
85
  icon: "ChevronDown",
88
- thickness: "3"
86
+ size: "md"
89
87
  })
90
88
  ])
91
89
  ]),
@@ -101,13 +99,13 @@ const P = { class: "flex items-center text-sm w-[inherit]" }, R = { class: "font
101
99
  state: e(c),
102
100
  variant: "form"
103
101
  }, {
104
- default: o(() => [
102
+ default: a(() => [
105
103
  t("form", {
106
104
  class: "flex gap-1 rounded",
107
105
  onSubmit: k(S, ["prevent"])
108
106
  }, [
109
- z(t("input", {
110
- "onUpdate:modelValue": a[1] || (a[1] = (l) => r.value = l),
107
+ M(t("input", {
108
+ "onUpdate:modelValue": o[1] || (o[1] = (l) => r.value = l),
111
109
  class: "border-none outline-none flex-1 w-full text-sm min-h-8 p-1.5",
112
110
  placeholder: "New Workspace",
113
111
  type: "text"
@@ -119,7 +117,7 @@ const P = { class: "flex items-center text-sm w-[inherit]" }, R = { class: "font
119
117
  disabled: !r.value.trim(),
120
118
  type: "submit"
121
119
  }, {
122
- default: o(() => a[3] || (a[3] = [
120
+ default: a(() => o[3] || (o[3] = [
123
121
  V(" Continue ")
124
122
  ])),
125
123
  _: 1
@@ -22,6 +22,12 @@ export declare function useUrlPrefetcher(): {
22
22
  url: null;
23
23
  input: string | null;
24
24
  error: null;
25
+ } | {
26
+ state: string;
27
+ content: string;
28
+ url: null;
29
+ error: null;
30
+ input?: undefined;
25
31
  } | {
26
32
  state: string;
27
33
  content: string;
@@ -1 +1 @@
1
- {"version":3,"file":"useUrlPrefetcher.d.ts","sourceRoot":"","sources":["../../../../src/components/ImportCollection/hooks/useUrlPrefetcher.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,MAAM,GAAG,SAAS,CAAA;IACzB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;IAClB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CACrB,CAAA;AAED;;GAEG;AACH,wBAAgB,gBAAgB;;eAVvB,MAAM,GAAG,SAAS;iBAChB,MAAM,GAAG,IAAI;eACf,MAAM,GAAG,IAAI;aACf,MAAM,GAAG,IAAI;eACX,MAAM,GAAG,IAAI;;yBAiHX,MAAM,GAAG,IAAI,UACZ,MAAM;;;;;;;;;;;;;;;;;;;;EAoBjB"}
1
+ {"version":3,"file":"useUrlPrefetcher.d.ts","sourceRoot":"","sources":["../../../../src/components/ImportCollection/hooks/useUrlPrefetcher.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,MAAM,GAAG,SAAS,CAAA;IACzB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;IAClB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CACrB,CAAA;AAED;;GAEG;AACH,wBAAgB,gBAAgB;;eAVvB,MAAM,GAAG,SAAS;iBAChB,MAAM,GAAG,IAAI;eACf,MAAM,GAAG,IAAI;aACf,MAAM,GAAG,IAAI;eACX,MAAM,GAAG,IAAI;;yBAuHX,MAAM,GAAG,IAAI,UACZ,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;EAoBjB"}