@scalar/api-client 2.3.14 → 2.3.15

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 (53) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/components/DataTable/DataTable.vue.d.ts +2 -0
  3. package/dist/components/DataTable/DataTable.vue.d.ts.map +1 -1
  4. package/dist/components/DataTable/DataTable.vue.js +17 -15
  5. package/dist/components/DataTable/DataTableCell.vue.d.ts.map +1 -1
  6. package/dist/components/DataTable/DataTableCell.vue.js +6 -9
  7. package/dist/components/ImportCollection/ImportCollectionListener.vue.d.ts.map +1 -1
  8. package/dist/components/ImportCollection/ImportCollectionListener.vue.js +68 -23
  9. package/dist/components/ImportCollection/ImportNowButton.vue.d.ts.map +1 -1
  10. package/dist/components/ImportCollection/ImportNowButton.vue.js +41 -54
  11. package/dist/components/ImportCollection/utils/import-collection.d.ts +12 -0
  12. package/dist/components/ImportCollection/utils/import-collection.d.ts.map +1 -0
  13. package/dist/components/ImportCollection/utils/import-collection.js +29 -0
  14. package/dist/components/ImportCollection/utils/workspace-store-is-empty.d.ts +6 -0
  15. package/dist/components/ImportCollection/utils/workspace-store-is-empty.d.ts.map +1 -0
  16. package/dist/components/ImportCollection/utils/workspace-store-is-empty.js +7 -0
  17. package/dist/components/ScalarAsciiArt.vue.d.ts.map +1 -1
  18. package/dist/components/ScalarAsciiArt.vue.js +1 -1
  19. package/dist/components/ScalarAsciiArt.vue2.js +10 -8
  20. package/dist/components/ScalarHotkey.test.d.ts +2 -0
  21. package/dist/components/ScalarHotkey.test.d.ts.map +1 -0
  22. package/dist/components/ScalarHotkey.vue.d.ts.map +1 -1
  23. package/dist/components/ScalarHotkey.vue.js +34 -11
  24. package/dist/layouts/App/ApiClientApp.vue.d.ts.map +1 -1
  25. package/dist/layouts/Modal/ApiClientModal.vue.d.ts.map +1 -1
  26. package/dist/layouts/Modal/ApiClientModal.vue.js +1 -1
  27. package/dist/layouts/Web/ApiClientWeb.vue.d.ts.map +1 -1
  28. package/dist/style.css +1 -1
  29. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.d.ts.map +1 -1
  30. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.js +3 -3
  31. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue2.js +2 -1
  32. package/dist/views/Request/RequestSection/RequestBody.vue.d.ts.map +1 -1
  33. package/dist/views/Request/RequestSection/RequestBody.vue.js +2 -2
  34. package/dist/views/Request/RequestSection/RequestBody.vue2.js +4 -1
  35. package/dist/views/Request/RequestSection/RequestCodeExample.vue.d.ts.map +1 -1
  36. package/dist/views/Request/RequestSection/RequestCodeExample.vue.js +2 -2
  37. package/dist/views/Request/RequestSection/RequestCodeExample.vue2.js +4 -1
  38. package/dist/views/Request/RequestSection/RequestParams.vue.d.ts +1 -0
  39. package/dist/views/Request/RequestSection/RequestParams.vue.d.ts.map +1 -1
  40. package/dist/views/Request/RequestSection/RequestParams.vue.js +19 -16
  41. package/dist/views/Request/RequestSection/RequestSection.vue.d.ts.map +1 -1
  42. package/dist/views/Request/RequestSection/RequestSection.vue.js +1 -1
  43. package/dist/views/Request/RequestSection/RequestSection.vue2.js +9 -6
  44. package/dist/views/Request/RequestSection/RequestTable.vue.d.ts +1 -0
  45. package/dist/views/Request/RequestSection/RequestTable.vue.d.ts.map +1 -1
  46. package/dist/views/Request/RequestSection/RequestTable.vue.js +1 -1
  47. package/dist/views/Request/RequestSection/RequestTable.vue2.js +123 -126
  48. package/dist/views/Request/ResponseSection/RequestHeaders.vue.d.ts.map +1 -1
  49. package/dist/views/Request/ResponseSection/RequestHeaders.vue.js +53 -35
  50. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  51. package/dist/views/Request/ResponseSection/ResponseHeaders.vue.d.ts.map +1 -1
  52. package/dist/views/Request/ResponseSection/ResponseHeaders.vue.js +53 -35
  53. package/package.json +3 -3
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @scalar/api-client
2
2
 
3
+ ## 2.3.15
4
+
5
+ ### Patch Changes
6
+
7
+ - ce91adc: fix(api-client): don't set html background from client
8
+ - 61e094b: fix(api-client): improve request table header a11y
9
+ - e7fb3eb: feat: skip the import modal when the workspace is empty
10
+
3
11
  ## 2.3.14
4
12
 
5
13
  ### Patch Changes
@@ -2,6 +2,8 @@ type __VLS_Props = {
2
2
  columns: (string | undefined)[];
3
3
  /** Scroll horizontally */
4
4
  scroll?: boolean;
5
+ /** Presentational table */
6
+ presentational?: boolean;
5
7
  };
6
8
  declare function __VLS_template(): {
7
9
  attrs: Partial<{}>;
@@ -1 +1 @@
1
- {"version":3,"file":"DataTable.vue.d.ts","sourceRoot":"","sources":["../../../src/components/DataTable/DataTable.vue"],"names":[],"mappings":"AAuCA,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,CAAA;IAC/B,0BAA0B;IAC1B,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAC;AASF,iBAAS,cAAc;WAuDT,OAAO,IAA6B;;yBATrB,GAAG;yBACH,GAAG;;;;EAa/B;AASD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe,6SAOnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAUpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"DataTable.vue.d.ts","sourceRoot":"","sources":["../../../src/components/DataTable/DataTable.vue"],"names":[],"mappings":"AA0CA,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,CAAA;IAC/B,0BAA0B;IAC1B,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,2BAA2B;IAC3B,cAAc,CAAC,EAAE,OAAO,CAAA;CACzB,CAAC;AASF,iBAAS,cAAc;WAuDT,OAAO,IAA6B;;yBATrB,GAAG;yBACH,GAAG;;;;EAa/B;AASD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe,6SAOnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAUpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -1,36 +1,38 @@
1
- import { defineComponent as t, openBlock as e, createElementBlock as l, normalizeProps as n, guardReactiveProps as m, unref as c, createElementVNode as i, normalizeClass as p, normalizeStyle as u, renderSlot as s, createCommentVNode as d } from "vue";
1
+ import { defineComponent as r, openBlock as o, createElementBlock as l, normalizeProps as n, guardReactiveProps as i, unref as m, createElementVNode as p, normalizeClass as c, normalizeStyle as u, renderSlot as t, createCommentVNode as d } from "vue";
2
2
  import { useBindCx as f } from "@scalar/components";
3
- const b = {
3
+ const b = ["role"], y = {
4
4
  key: 0,
5
5
  class: "sr-only"
6
- }, g = /* @__PURE__ */ t({
6
+ }, _ = /* @__PURE__ */ r({
7
7
  __name: "DataTable",
8
8
  props: {
9
9
  columns: {},
10
- scroll: { type: Boolean }
10
+ scroll: { type: Boolean },
11
+ presentational: { type: Boolean }
11
12
  },
12
13
  setup(v) {
13
14
  const { cx: a } = f();
14
- return (o, w) => (e(), l("div", n(m(
15
- c(a)(
16
- o.scroll ? "overflow-x-auto custom-scroll" : "overflow-visible",
15
+ return (e, w) => (o(), l("div", n(i(
16
+ m(a)(
17
+ e.scroll ? "overflow-x-auto custom-scroll" : "overflow-visible",
17
18
  "scalar-data-table bg-b-1"
18
19
  )
19
20
  )), [
20
- i("table", {
21
- class: p(["mb-0 grid min-h-8 auto-rows-auto", { "w-max min-w-full": o.scroll }]),
21
+ p("table", {
22
+ class: c(["mb-0 grid min-h-8 auto-rows-auto", { "w-max min-w-full": e.scroll }]),
23
+ role: e.presentational ? "presentation" : "table",
22
24
  style: u({
23
- gridTemplateColumns: o.columns.map((r) => r || "1fr").join(" ")
25
+ gridTemplateColumns: e.columns.map((s) => s || "1fr").join(" ")
24
26
  })
25
27
  }, [
26
- o.$slots.caption ? (e(), l("caption", b, [
27
- s(o.$slots, "caption")
28
+ e.$slots.caption ? (o(), l("caption", y, [
29
+ t(e.$slots, "caption")
28
30
  ])) : d("", !0),
29
- s(o.$slots, "default")
30
- ], 6)
31
+ t(e.$slots, "default")
32
+ ], 14, b)
31
33
  ], 16));
32
34
  }
33
35
  });
34
36
  export {
35
- g as default
37
+ _ as default
36
38
  };
@@ -1 +1 @@
1
- {"version":3,"file":"DataTableCell.vue.d.ts","sourceRoot":"","sources":["../../../src/components/DataTable/DataTableCell.vue"],"names":[],"mappings":"AA8BA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAA;AAIpC,KAAK,WAAW,GAAG;IACf,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CACxB,CAAC;AAeJ,iBAAS,cAAc;WAiDT,OAAO,IAA6B;;yBARrB,GAAG;;;;EAa/B;AAUD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;QAjFZ,MAAM,GAAG,SAAS;6EAwFzB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAepG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"DataTableCell.vue.d.ts","sourceRoot":"","sources":["../../../src/components/DataTable/DataTableCell.vue"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAA;AAIpC,KAAK,WAAW,GAAG;IACf,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CACxB,CAAC;AAeJ,iBAAS,cAAc;WAiDT,OAAO,IAA6B;;yBARrB,GAAG;;;;EAa/B;AAUD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;QAjFZ,MAAM,GAAG,SAAS;6EAwFzB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAepG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -1,4 +1,4 @@
1
- import { defineComponent as t, openBlock as o, createBlock as a, resolveDynamicComponent as l, mergeProps as n, unref as s, withCtx as p, renderSlot as d } from "vue";
1
+ import { defineComponent as t, openBlock as o, createBlock as a, resolveDynamicComponent as n, mergeProps as s, unref as l, withCtx as p, renderSlot as d } from "vue";
2
2
  import { useBindCx as m } from "@scalar/components";
3
3
  const f = /* @__PURE__ */ t({
4
4
  inheritAttrs: !1,
@@ -7,18 +7,15 @@ const f = /* @__PURE__ */ t({
7
7
  is: { default: "td" }
8
8
  },
9
9
  setup(b) {
10
- const { cx: r } = m();
11
- return (e, i) => (o(), a(l(e.is), n(
12
- s(r)(
10
+ const { cx: e } = m();
11
+ return (r, i) => (o(), a(n(r.is), s(
12
+ l(e)(
13
13
  "box-content max-h-8 min-h-8 min-w-8 border-l-0 border-t border-b-0 border-r flex text-sm last:border-r-0 group-last:border-b-transparent p-0 m-0 relative"
14
14
  ),
15
- {
16
- class: "group-[.alert]:bg-b-alert group-[.error]:bg-b-danger",
17
- role: "cell"
18
- }
15
+ { class: "group-[.alert]:bg-b-alert group-[.error]:bg-b-danger" }
19
16
  ), {
20
17
  default: p(() => [
21
- d(e.$slots, "default")
18
+ d(r.$slots, "default")
22
19
  ]),
23
20
  _: 3
24
21
  }, 16));
@@ -1 +1 @@
1
- {"version":3,"file":"ImportCollectionListener.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCollection/ImportCollectionListener.vue"],"names":[],"mappings":"AAqGA,iBAAS,cAAc;WAqHT,OAAO,IAA6B;;yBARpB,GAAG;;;;EAahC;AAgBD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe,+QAKnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAKpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"ImportCollectionListener.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCollection/ImportCollectionListener.vue"],"names":[],"mappings":"AAmQA,iBAAS,cAAc;WAqHT,OAAO,IAA6B;;yBARpB,GAAG;;;;EAahC;AAgBD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe,+QAKnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAKpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -1,33 +1,78 @@
1
- import { defineComponent as m, ref as r, openBlock as s, createElementBlock as p, Fragment as f, createVNode as n, renderSlot as _, nextTick as v } from "vue";
2
- import d from "./DropEventListener.vue.js";
3
- import I from "./ImportCollectionModal.vue.js";
1
+ import { defineComponent as I, ref as l, openBlock as k, createElementBlock as y, Fragment as w, createVNode as r, renderSlot as g, nextTick as h } from "vue";
2
+ import { useToasts as C } from "@scalar/use-toasts";
3
+ import { useRouter as T } from "vue-router";
4
+ import { workspaceStoreIsEmpty as $ } from "./utils/workspace-store-is-empty.js";
5
+ import { useActiveEntities as q } from "../../store/active-entities.js";
6
+ import E from "./DropEventListener.vue.js";
7
+ import F from "./ImportCollectionModal.vue.js";
4
8
  /* empty css */
5
- import y from "./PasteEventListener.vue.js";
6
- import $ from "./UrlQueryParameterChecker.vue.js";
7
- const C = /* @__PURE__ */ m({
9
+ import W from "./PasteEventListener.vue.js";
10
+ import x from "./UrlQueryParameterChecker.vue.js";
11
+ import { importCollection as B } from "./utils/import-collection.js";
12
+ import { useWorkspace as M } from "../../store/store.js";
13
+ const J = /* @__PURE__ */ I({
8
14
  __name: "ImportCollectionListener",
9
- setup(g) {
10
- const e = r(null), t = r(null), o = r(null);
11
- async function u() {
12
- e.value = null, t.value = null, o.value = null, await v();
15
+ setup(N) {
16
+ const m = M(), n = l(null), s = l(null), a = l(null);
17
+ async function p() {
18
+ n.value = null, s.value = null, a.value = null, await h();
13
19
  }
14
- async function l(a, i = null, c) {
15
- await u(), e.value = a, t.value = i, o.value = c;
20
+ async function i(e, t = null, o) {
21
+ if (await p(), $(m)) {
22
+ if (console.info("Workspace store is empty, directly importing:", e), await d(e))
23
+ return;
24
+ console.warn("Failed to import the collection from:", e);
25
+ }
26
+ n.value = e, s.value = t, a.value = o;
16
27
  }
17
- return (a, i) => (s(), p(f, null, [
18
- n(I, {
19
- eventType: o.value,
20
- integration: t.value,
21
- source: e.value,
22
- onImportFinished: u
28
+ const f = T(), { activeWorkspace: c } = q(), { toast: u } = C();
29
+ async function d(e) {
30
+ return e ? new Promise((t) => {
31
+ B({
32
+ store: m,
33
+ workspace: c.value,
34
+ source: e,
35
+ // Use watch mode by default.
36
+ watchMode: !0,
37
+ onSuccess(o) {
38
+ if (o) {
39
+ _(o), u("Import successful", "info"), t(!0);
40
+ return;
41
+ }
42
+ u("Import failed: No collection was created", "error"), t(!1);
43
+ },
44
+ onError(o) {
45
+ console.error("[importCollection]", o);
46
+ const v = (o == null ? void 0 : o.message) || "Unknown error";
47
+ u(`Import failed: ${v}`, "error"), t(!1);
48
+ }
49
+ });
50
+ }) : !1;
51
+ }
52
+ function _(e) {
53
+ var t;
54
+ e && f.push({
55
+ name: "request",
56
+ params: {
57
+ workspace: (t = c.value) == null ? void 0 : t.uid,
58
+ request: e == null ? void 0 : e.requests[0]
59
+ }
60
+ });
61
+ }
62
+ return (e, t) => (k(), y(w, null, [
63
+ r(F, {
64
+ eventType: a.value,
65
+ integration: s.value,
66
+ source: n.value,
67
+ onImportFinished: p
23
68
  }, null, 8, ["eventType", "integration", "source"]),
24
- n(y, { onInput: l }),
25
- n(d, { onInput: l }),
26
- n($, { onInput: l }),
27
- _(a.$slots, "default")
69
+ r(W, { onInput: i }),
70
+ r(E, { onInput: i }),
71
+ r(x, { onInput: i }),
72
+ g(e.$slots, "default")
28
73
  ], 64));
29
74
  }
30
75
  });
31
76
  export {
32
- C as default
77
+ J as default
33
78
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ImportNowButton.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCollection/ImportNowButton.vue"],"names":[],"mappings":"AAsHA,KAAK,WAAW,GAAG;IACjB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,OAAO,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAA;IAC3B,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB,CAAC;;;;;;AAiLF,wBAOG"}
1
+ {"version":3,"file":"ImportNowButton.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ImportCollection/ImportNowButton.vue"],"names":[],"mappings":"AA2GA,KAAK,WAAW,GAAG;IACjB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,OAAO,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAA;IAC3B,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB,CAAC;;;;;;AAqKF,wBAOG"}
@@ -1,87 +1,74 @@
1
- import { defineComponent as b, openBlock as i, createElementBlock as g, Fragment as B, createBlock as c, unref as l, withCtx as f, createTextVNode as d, createCommentVNode as F } from "vue";
2
- import { ScalarButton as y } from "@scalar/components";
3
- import { useToasts as I } from "@scalar/use-toasts";
4
- import { useRouter as U } from "vue-router";
5
- import { isUrl as q } from "./utils/isUrl.js";
6
- import { useActiveEntities as M } from "../../store/active-entities.js";
7
- import { useWorkspace as T } from "../../store/store.js";
8
- const _ = /* @__PURE__ */ b({
1
+ import { defineComponent as y, openBlock as o, createElementBlock as C, Fragment as h, createBlock as u, unref as a, withCtx as m, createTextVNode as p, createCommentVNode as v } from "vue";
2
+ import { ScalarButton as c } from "@scalar/components";
3
+ import { useToasts as b } from "@scalar/use-toasts";
4
+ import { useRouter as g } from "vue-router";
5
+ import { useActiveEntities as x } from "../../store/active-entities.js";
6
+ import { importCollection as B } from "./utils/import-collection.js";
7
+ import { useWorkspace as I } from "../../store/store.js";
8
+ const R = /* @__PURE__ */ y({
9
9
  __name: "ImportNowButton",
10
10
  props: {
11
11
  source: {},
12
12
  variant: {},
13
- watchMode: { type: Boolean }
13
+ watchMode: { type: Boolean, default: !0 }
14
14
  },
15
15
  emits: ["importFinished"],
16
- setup(k, { emit: w }) {
17
- const r = k, h = w, v = U(), { activeWorkspace: n } = M(), { importSpecFromUrl: C, importSpecFile: x } = T(), { toast: u } = I();
18
- async function a() {
19
- var o, t, m;
20
- try {
21
- if (r.source) {
22
- if (q(r.source)) {
23
- const [e, s] = await C(
24
- r.source,
25
- ((o = n.value) == null ? void 0 : o.uid) ?? "",
26
- {
27
- proxyUrl: (t = n.value) == null ? void 0 : t.proxyUrl,
28
- watchMode: r.watchMode
29
- }
30
- );
31
- e || p(s == null ? void 0 : s.collection);
32
- } else {
33
- const e = await x(
34
- r.source,
35
- ((m = n.value) == null ? void 0 : m.uid) ?? ""
36
- );
37
- p(e == null ? void 0 : e.collection);
38
- }
39
- u("Import successful", "info"), h("importFinished");
16
+ setup(r, { emit: f }) {
17
+ const d = f, l = g(), k = I(), { activeWorkspace: s } = x(), { toast: n } = b();
18
+ async function i() {
19
+ B({
20
+ store: k,
21
+ workspace: s.value,
22
+ source: r.source,
23
+ watchMode: r.watchMode,
24
+ onSuccess(t) {
25
+ t && (w(t), n("Import successful", "info"), d("importFinished"));
26
+ },
27
+ onError(t) {
28
+ console.error("[importCollection]", t);
29
+ const e = (t == null ? void 0 : t.message) || "Unknown error";
30
+ n(`Import failed: ${e}`, "error");
40
31
  }
41
- } catch (e) {
42
- console.error("[importCollection]", e);
43
- const s = (e == null ? void 0 : e.message) || "Unknown error";
44
- u(`Import failed: ${s}`, "error");
45
- }
32
+ });
46
33
  }
47
- function p(o) {
48
- var t;
49
- o && v.push({
34
+ function w(t) {
35
+ var e;
36
+ t && l.push({
50
37
  name: "request",
51
38
  params: {
52
- workspace: (t = n.value) == null ? void 0 : t.uid,
53
- request: o == null ? void 0 : o.requests[0]
39
+ workspace: (e = s.value) == null ? void 0 : e.uid,
40
+ request: t == null ? void 0 : t.requests[0]
54
41
  }
55
42
  });
56
43
  }
57
- return (o, t) => o.source ? (i(), g(B, { key: 0 }, [
58
- o.variant === "button" ? (i(), c(l(y), {
44
+ return (t, e) => t.source ? (o(), C(h, { key: 0 }, [
45
+ t.variant === "button" ? (o(), u(a(c), {
59
46
  key: 0,
60
47
  class: "mt-3 h-fit w-full rounded-lg px-6 py-2.5 font-bold",
61
48
  size: "md",
62
49
  type: "button",
63
- onClick: a
50
+ onClick: i
64
51
  }, {
65
- default: f(() => t[0] || (t[0] = [
66
- d(" Import Collection ")
52
+ default: m(() => e[0] || (e[0] = [
53
+ p(" Import Collection ")
67
54
  ])),
68
55
  _: 1
69
- })) : (i(), c(l(y), {
56
+ })) : (o(), u(a(c), {
70
57
  key: 1,
71
58
  class: "h-fit rounded-lg px-6 py-2.5 text-[21px] font-bold",
72
59
  size: "md",
73
60
  type: "button",
74
61
  variant: "ghost",
75
- onClick: a
62
+ onClick: i
76
63
  }, {
77
- default: f(() => t[1] || (t[1] = [
78
- d(" Try it in the browser ")
64
+ default: m(() => e[1] || (e[1] = [
65
+ p(" Try it in the browser ")
79
66
  ])),
80
67
  _: 1
81
68
  }))
82
- ], 64)) : F("", !0);
69
+ ], 64)) : v("", !0);
83
70
  }
84
71
  });
85
72
  export {
86
- _ as default
73
+ R as default
87
74
  };
@@ -0,0 +1,12 @@
1
+ import type { Collection } from '@scalar/oas-utils/entities/spec';
2
+ import type { WorkspaceStore } from '../../../store';
3
+ import type { Workspace } from '@scalar/oas-utils/entities/workspace';
4
+ export declare function importCollection({ store, workspace, source, watchMode, onSuccess, onError, }: {
5
+ store: WorkspaceStore;
6
+ workspace: Workspace | undefined;
7
+ source: string | null | undefined;
8
+ watchMode: boolean;
9
+ onSuccess: (collection: Collection | undefined) => void;
10
+ onError: (error: Error) => void;
11
+ }): Promise<void>;
12
+ //# sourceMappingURL=import-collection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"import-collection.d.ts","sourceRoot":"","sources":["../../../../src/components/ImportCollection/utils/import-collection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAA;AAGjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAC7C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AAErE,wBAAsB,gBAAgB,CAAC,EACrC,KAAK,EACL,SAAS,EACT,MAAM,EACN,SAAS,EACT,SAAS,EACT,OAAO,GACR,EAAE;IACD,KAAK,EAAE,cAAc,CAAA;IACrB,SAAS,EAAE,SAAS,GAAG,SAAS,CAAA;IAChC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;IACjC,SAAS,EAAE,OAAO,CAAA;IAClB,SAAS,EAAE,CAAC,UAAU,EAAE,UAAU,GAAG,SAAS,KAAK,IAAI,CAAA;IACvD,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAA;CAChC,iBAuBA"}
@@ -0,0 +1,29 @@
1
+ import { isUrl as f } from "./isUrl.js";
2
+ async function U({
3
+ store: t,
4
+ workspace: i,
5
+ source: o,
6
+ watchMode: n,
7
+ onSuccess: m,
8
+ onError: p
9
+ }) {
10
+ try {
11
+ if (o && i) {
12
+ if (f(o)) {
13
+ const [c, l] = await t.importSpecFromUrl(o, i.uid, {
14
+ proxyUrl: i.proxyUrl,
15
+ watchMode: n
16
+ });
17
+ c || m(l == null ? void 0 : l.collection);
18
+ return;
19
+ }
20
+ const r = await t.importSpecFile(o, i.uid);
21
+ m(r == null ? void 0 : r.collection);
22
+ }
23
+ } catch (r) {
24
+ p(r);
25
+ }
26
+ }
27
+ export {
28
+ U as importCollection
29
+ };
@@ -0,0 +1,6 @@
1
+ import type { WorkspaceStore } from '../../../store';
2
+ /**
3
+ * Checks whether the store is empty.
4
+ */
5
+ export declare function workspaceStoreIsEmpty(store: WorkspaceStore): boolean;
6
+ //# sourceMappingURL=workspace-store-is-empty.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspace-store-is-empty.d.ts","sourceRoot":"","sources":["../../../../src/components/ImportCollection/utils/workspace-store-is-empty.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAE7C;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,cAAc,WAK1D"}
@@ -0,0 +1,7 @@
1
+ function n(e) {
2
+ const t = Object.keys(e.workspaces).length === 1, c = Object.keys(e.collections).length === 1;
3
+ return t && c;
4
+ }
5
+ export {
6
+ n as workspaceStoreIsEmpty
7
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"ScalarAsciiArt.vue.d.ts","sourceRoot":"","sources":["../../src/components/ScalarAsciiArt.vue"],"names":[],"mappings":"AAkEA,KAAK,WAAW,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;;AA0FtD,wBAOG"}
1
+ {"version":3,"file":"ScalarAsciiArt.vue.d.ts","sourceRoot":"","sources":["../../src/components/ScalarAsciiArt.vue"],"names":[],"mappings":"AAoEA,KAAK,WAAW,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;;AA0FtD,wBAOG"}
@@ -1,7 +1,7 @@
1
1
  import o from "./ScalarAsciiArt.vue2.js";
2
2
  /* empty css */
3
3
  import r from "../_virtual/_plugin-vue_export-helper.js";
4
- const i = /* @__PURE__ */ r(o, [["__scopeId", "data-v-3d9351de"]]);
4
+ const i = /* @__PURE__ */ r(o, [["__scopeId", "data-v-55583e8a"]]);
5
5
  export {
6
6
  i as default
7
7
  };
@@ -1,5 +1,5 @@
1
- import { defineComponent as h, computed as f, openBlock as i, createElementBlock as l, normalizeClass as y, Fragment as v, renderList as x, normalizeStyle as m, createElementVNode as $, toDisplayString as k } from "vue";
2
- const p = 500, o = 100, B = /* @__PURE__ */ h({
1
+ import { defineComponent as h, computed as f, openBlock as i, createElementBlock as o, normalizeClass as y, Fragment as v, renderList as x, normalizeStyle as m, createElementVNode as $, toDisplayString as k } from "vue";
2
+ const p = 500, l = 100, B = /* @__PURE__ */ h({
3
3
  __name: "ScalarAsciiArt",
4
4
  props: {
5
5
  art: {},
@@ -10,16 +10,18 @@ const p = 500, o = 100, B = /* @__PURE__ */ h({
10
10
  `)), g = (a, s) => {
11
11
  var e, t, r, c;
12
12
  return {
13
- animationDuration: `${a * o}ms, ${p}ms`,
13
+ animationDuration: `${a * l}ms, ${p}ms`,
14
14
  animationTimingFunction: `steps(${a}), step-end`,
15
- animationDelay: `${s * o}ms, 0ms`,
16
- animationIterationCount: `1, ${((((e = n.value) == null ? void 0 : e.length) ?? 0) + (((c = (r = n.value) == null ? void 0 : r[((t = n.value) == null ? void 0 : t.length) - 1]) == null ? void 0 : c.length) ?? 0) + 5) * o / p}`
15
+ animationDelay: `${s * l}ms, 0ms`,
16
+ animationIterationCount: `1, ${((((e = n.value) == null ? void 0 : e.length) ?? 0) + (((c = (r = n.value) == null ? void 0 : r[((t = n.value) == null ? void 0 : t.length) - 1]) == null ? void 0 : c.length) ?? 0) + 5) * l / p}`
17
17
  };
18
18
  };
19
- return (a, s) => (i(), l("div", {
20
- class: y(["ascii-art font-code flex flex-col items-start text-[6px] leading-[7px]", { "ascii-art-animate": a.animate }])
19
+ return (a, s) => (i(), o("div", {
20
+ "aria-hidden": "true",
21
+ class: y(["ascii-art font-code flex flex-col items-start text-[6px] leading-[7px]", { "ascii-art-animate": a.animate }]),
22
+ role: "presentation"
21
23
  }, [
22
- (i(!0), l(v, null, x(n.value, (e, t) => (i(), l("span", {
24
+ (i(!0), o(v, null, x(n.value, (e, t) => (i(), o("span", {
23
25
  key: t,
24
26
  class: "inline-block",
25
27
  style: m({ width: `calc(${e.length + 1}ch)` })
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ScalarHotkey.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ScalarHotkey.test.d.ts","sourceRoot":"","sources":["../../src/components/ScalarHotkey.test.ts"],"names":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"ScalarHotkey.vue.d.ts","sourceRoot":"","sources":["../../src/components/ScalarHotkey.vue"],"names":[],"mappings":"AAkCA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAA;AAM3E,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,eAAe,CAAA;CAC3B,CAAC;;AAsEF,wBAOG"}
1
+ {"version":3,"file":"ScalarHotkey.vue.d.ts","sourceRoot":"","sources":["../../src/components/ScalarHotkey.vue"],"names":[],"mappings":"AA6DA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAA;AAM3E,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,eAAe,CAAA;CAC3B,CAAC;;AAsGF,wBAOG"}
@@ -1,21 +1,44 @@
1
- import { defineComponent as m, computed as r, openBlock as a, createElementBlock as c, normalizeProps as p, guardReactiveProps as s, unref as u, toDisplayString as f } from "vue";
2
- import { useBindCx as l } from "@scalar/components";
3
- import { isMacOS as x } from "@scalar/use-tooltip";
4
- const b = /* @__PURE__ */ m({
1
+ import { defineComponent as u, computed as i, openBlock as p, createElementBlock as y, normalizeProps as h, guardReactiveProps as b, unref as k, createElementVNode as a, toDisplayString as s } from "vue";
2
+ import { useBindCx as x } from "@scalar/components";
3
+ import { isMacOS as r } from "@scalar/use-tooltip";
4
+ const C = { "aria-hidden": "true" }, w = { class: "sr-only" }, A = /* @__PURE__ */ u({
5
5
  __name: "ScalarHotkey",
6
6
  props: {
7
7
  hotkey: {},
8
- modifier: {}
8
+ modifier: { default: () => ["Meta"] }
9
9
  },
10
- setup(t) {
11
- const e = t, { cx: i } = l(), o = r(() => e.modifier || "meta"), n = r(() => `${o.value === "meta" ? x() ? "⌘" : "^" : o.value} ${e.hotkey}`);
12
- return (d, y) => (a(), c("div", p(s(
13
- u(i)(
10
+ setup(e) {
11
+ const d = {
12
+ "⌘": "Command",
13
+ "^": "Control",
14
+ "⌥": "Option",
15
+ "⇧": "Shift",
16
+ "⇪": "Caps Lock",
17
+ "↵": "Enter",
18
+ "←": "Left Arrow",
19
+ "→": "Right Arrow",
20
+ "↑": "Up Arrow",
21
+ "↓": "Down Arrow"
22
+ }, c = {
23
+ Meta: r() ? "⌘" : "^",
24
+ default: r() ? "⌘" : "^",
25
+ Shift: "⇧",
26
+ Alt: "⌥",
27
+ Control: "^"
28
+ }, { cx: m } = x(), l = i(() => `${e.modifier.map((o) => c[o]).join("+")} ${e.hotkey}`), f = i(() => {
29
+ const t = e.modifier.map((n) => n === "Meta" ? r() ? "Command" : "Control" : n).join("+"), o = d[e.hotkey] ?? e.hotkey;
30
+ return `${t} ${o}`;
31
+ });
32
+ return (t, o) => (p(), y("div", h(b(
33
+ k(m)(
14
34
  "border-b-3 inline-block overflow-hidden rounded border-1/2 text-xxs rounded-b px-1 font-medium uppercase"
15
35
  )
16
- )), f(n.value), 17));
36
+ )), [
37
+ a("span", C, s(l.value), 1),
38
+ a("span", w, s(f.value), 1)
39
+ ], 16));
17
40
  }
18
41
  });
19
42
  export {
20
- b as default
43
+ A as default
21
44
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ApiClientApp.vue.d.ts","sourceRoot":"","sources":["../../../src/layouts/App/ApiClientApp.vue"],"names":[],"mappings":";;cAkK8B,MAAM;aAAO,MAAM;;;;cAAnB,MAAM;aAAO,MAAM;;;AA0LjD,wBAOG"}
1
+ {"version":3,"file":"ApiClientApp.vue.d.ts","sourceRoot":"","sources":["../../../src/layouts/App/ApiClientApp.vue"],"names":[],"mappings":";;cAiK8B,MAAM;aAAO,MAAM;;;;cAAnB,MAAM;aAAO,MAAM;;;AA0LjD,wBAOG"}
@@ -1 +1 @@
1
- {"version":3,"file":"ApiClientModal.vue.d.ts","sourceRoot":"","sources":["../../../src/layouts/Modal/ApiClientModal.vue"],"names":[],"mappings":";AAyaA,wBAMG"}
1
+ {"version":3,"file":"ApiClientModal.vue.d.ts","sourceRoot":"","sources":["../../../src/layouts/Modal/ApiClientModal.vue"],"names":[],"mappings":";AAwaA,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 a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-b0cf3ebb"]]);
5
+ const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-2835f298"]]);
6
6
  export {
7
7
  a as default
8
8
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ApiClientWeb.vue.d.ts","sourceRoot":"","sources":["../../../src/layouts/Web/ApiClientWeb.vue"],"names":[],"mappings":";AA2RA,wBAKG"}
1
+ {"version":3,"file":"ApiClientWeb.vue.d.ts","sourceRoot":"","sources":["../../../src/layouts/Web/ApiClientWeb.vue"],"names":[],"mappings":";AA0RA,wBAKG"}