@scalar/api-reference 1.25.72 → 1.25.75

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 (70) hide show
  1. package/CHANGELOG.md +65 -0
  2. package/dist/browser/standalone.js +12636 -12567
  3. package/dist/browser/webpack-stats.json +1 -1
  4. package/dist/components/Anchor/Anchor.vue.d.ts.map +1 -1
  5. package/dist/components/Anchor/Anchor.vue.js +2 -2
  6. package/dist/components/Content/ClientLibraries/ClientLibraries.vue.d.ts.map +1 -1
  7. package/dist/components/Content/ClientLibraries/ClientLibraries.vue.js +2 -2
  8. package/dist/components/Content/Content.vue.d.ts.map +1 -1
  9. package/dist/components/Content/Content.vue.js +2 -2
  10. package/dist/components/Content/Content.vue2.js +3 -3
  11. package/dist/components/Content/Introduction/Introduction.vue.js +1 -1
  12. package/dist/components/Content/Introduction/Introduction.vue2.js +32 -32
  13. package/dist/components/Content/Schema/Schema.vue.d.ts.map +1 -1
  14. package/dist/components/Content/Schema/Schema.vue.js +2 -2
  15. package/dist/components/Content/Schema/Schema.vue2.js +10 -11
  16. package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
  17. package/dist/components/Content/Schema/SchemaProperty.vue.js +1 -1
  18. package/dist/components/Content/Schema/SchemaProperty.vue2.js +12 -12
  19. package/dist/components/Content/Tag/Endpoints.vue.js +2 -2
  20. package/dist/components/Content/Tag/Endpoints.vue2.js +19 -19
  21. package/dist/components/Content/Tag/TagAccordion.vue.d.ts.map +1 -1
  22. package/dist/components/Content/Tag/TagAccordion.vue.js +2 -2
  23. package/dist/components/Layouts/ModernLayout.vue.d.ts.map +1 -1
  24. package/dist/components/Layouts/ModernLayout.vue.js +2 -2
  25. package/dist/components/Layouts/ModernLayout.vue2.js +30 -29
  26. package/dist/components/Section/CompactSection.vue.js +2 -2
  27. package/dist/components/Section/CompactSection.vue2.js +9 -8
  28. package/dist/components/Section/SectionColumn.vue.d.ts.map +1 -1
  29. package/dist/components/Section/SectionColumn.vue.js +4 -4
  30. package/dist/components/Section/SectionContainerAccordion.vue.d.ts.map +1 -1
  31. package/dist/components/Section/SectionContainerAccordion.vue.js +2 -2
  32. package/dist/components/Section/SectionHeader.vue.d.ts +2 -2
  33. package/dist/components/Section/SectionHeader.vue.d.ts.map +1 -1
  34. package/dist/components/Section/SectionHeader.vue.js +1 -1
  35. package/dist/components/Section/SectionHeader.vue2.js +16 -14
  36. package/dist/components/ShowMoreButton.vue.js +2 -2
  37. package/dist/components/Sidebar/SidebarElement.vue.d.ts.map +1 -1
  38. package/dist/components/Sidebar/SidebarElement.vue.js +2 -2
  39. package/dist/components/Sidebar/SidebarElement.vue2.js +3 -2
  40. package/dist/embeds/OpenApiDocument/OpenApiDocument.vue.d.ts.map +1 -1
  41. package/dist/features/ApiClientModal/useApiClient.d.ts +76 -74
  42. package/dist/features/ApiClientModal/useApiClient.d.ts.map +1 -1
  43. package/dist/features/BaseUrl/ServerUrlSelect.vue.js +3 -3
  44. package/dist/features/BaseUrl/ServerUrlSelect.vue2.js +5 -5
  45. package/dist/features/BaseUrl/ServerVariablesSelect.vue.js +2 -2
  46. package/dist/features/BaseUrl/ServerVariablesSelect.vue2.js +3 -3
  47. package/dist/features/Operation/components/ParameterHeaders.vue.js +3 -3
  48. package/dist/features/Operation/components/ParameterHeaders.vue2.js +7 -7
  49. package/dist/features/Operation/components/ParameterListItem.vue.d.ts.map +1 -1
  50. package/dist/features/Operation/components/ParameterListItem.vue.js +2 -2
  51. package/dist/features/Operation/components/ParameterListItem.vue2.js +3 -4
  52. package/dist/features/Operation/components/RequestBodyPropertiesChild.vue.d.ts.map +1 -1
  53. package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts.map +1 -1
  54. package/dist/features/Operation/layouts/ClassicLayout.vue.js +2 -2
  55. package/dist/features/Operation/layouts/ModernLayout.vue.js +1 -1
  56. package/dist/features/Operation/layouts/ModernLayout.vue2.js +95 -95
  57. package/dist/features/Search/SearchButton.vue.d.ts.map +1 -1
  58. package/dist/features/Search/SearchButton.vue.js +2 -2
  59. package/dist/features/Search/SearchButton.vue2.js +25 -28
  60. package/dist/features/Search/useSearchIndex.d.ts.map +1 -1
  61. package/dist/features/Search/useSearchIndex.js +51 -48
  62. package/dist/helpers/getExampleCode.d.ts +1 -1
  63. package/dist/helpers/getExampleCode.d.ts.map +1 -1
  64. package/dist/helpers/getExampleCode.js +0 -1
  65. package/dist/index.js +1 -1
  66. package/dist/legacy/components/SecuritySchemeSelector.vue.js +2 -2
  67. package/dist/legacy/components/SecuritySchemeSelector.vue2.js +3 -3
  68. package/dist/legacy/stores/useOpenApiStore.d.ts.map +1 -1
  69. package/dist/style.css +1 -1
  70. package/package.json +12 -12
@@ -1,4 +1,4 @@
1
- import { defineComponent as f, openBlock as e, createBlock as m, unref as a, withCtx as c, createElementVNode as p, normalizeClass as o, createVNode as d, createElementBlock as l, Fragment as n, createTextVNode as u, renderList as _ } from "vue";
1
+ import { defineComponent as f, openBlock as e, createBlock as m, unref as a, withCtx as c, createElementVNode as p, normalizeClass as o, createVNode as d, createElementBlock as l, Fragment as i, createTextVNode as u, renderList as _ } from "vue";
2
2
  import v from "../../../components/Content/Schema/SchemaProperty.vue.js";
3
3
  import { Disclosure as k, DisclosureButton as B, DisclosurePanel as H } from "@headlessui/vue";
4
4
  import { ScalarIcon as S } from "@scalar/components";
@@ -29,11 +29,11 @@ const V = /* @__PURE__ */ f({
29
29
  d(a(S), {
30
30
  class: o(["headers-card-title-icon", { "headers-card-title-icon--open": r }]),
31
31
  icon: "Add",
32
- thickness: "3"
32
+ size: "sm"
33
33
  }, null, 8, ["class"]),
34
- r ? (e(), l(n, { key: 0 }, [
34
+ r ? (e(), l(i, { key: 0 }, [
35
35
  u(" Hide Headers ")
36
- ], 64)) : (e(), l(n, { key: 1 }, [
36
+ ], 64)) : (e(), l(i, { key: 1 }, [
37
37
  u(" Show Headers ")
38
38
  ], 64))
39
39
  ]),
@@ -41,10 +41,10 @@ const V = /* @__PURE__ */ f({
41
41
  }, 1024),
42
42
  d(a(H), null, {
43
43
  default: c(() => [
44
- (e(!0), l(n, null, _(t.headers, (s, i) => (e(), m(v, {
45
- key: i,
44
+ (e(!0), l(i, null, _(t.headers, (s, n) => (e(), m(v, {
45
+ key: n,
46
46
  description: s.description,
47
- name: `${i}`,
47
+ name: `${n}`,
48
48
  value: h(s) ? s.schema : void 0
49
49
  }, null, 8, ["description", "name", "value"]))), 128))
50
50
  ]),
@@ -1 +1 @@
1
- {"version":3,"file":"ParameterListItem.vue.d.ts","sourceRoot":"","sources":["../../../../src/features/Operation/components/ParameterListItem.vue"],"names":[],"mappings":"AAiOA,OAAO,KAAK,EAAe,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAQlE,KAAK,WAAW,GAAG;IACf,SAAS,EAAE,SAAS,CAAA;IACpB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B,CAAC;;kBAFe,OAAO;sBACH,OAAO;;AA6O9B,wBAQG"}
1
+ {"version":3,"file":"ParameterListItem.vue.d.ts","sourceRoot":"","sources":["../../../../src/features/Operation/components/ParameterListItem.vue"],"names":[],"mappings":"AAmOA,OAAO,KAAK,EAAe,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAQlE,KAAK,WAAW,GAAG;IACf,SAAS,EAAE,SAAS,CAAA;IACpB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B,CAAC;;kBAFe,OAAO;sBACH,OAAO;;AA6O9B,wBAQG"}
@@ -1,7 +1,7 @@
1
1
  import t from "./ParameterListItem.vue2.js";
2
2
  /* empty css */
3
- import a from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const e = /* @__PURE__ */ a(t, [["__scopeId", "data-v-4f7aa604"]]);
3
+ import o from "../../../_virtual/_plugin-vue_export-helper.js";
4
+ const e = /* @__PURE__ */ o(t, [["__scopeId", "data-v-9508a2d2"]]);
5
5
  export {
6
6
  e as default
7
7
  };
@@ -5,7 +5,7 @@ import { ScalarIcon as T } from "@scalar/components";
5
5
  import _ from "./ContentTypeSelect.vue.js";
6
6
  import I from "./ParameterHeaders.vue.js";
7
7
  import N from "../../../components/Content/Schema/SchemaProperty.vue.js";
8
- const P = { class: "parameter-item" }, j = { class: "parameter-item-name" }, E = { class: "parameter-item-type" }, z = { class: "absolute right-0" }, J = /* @__PURE__ */ k({
8
+ const P = { class: "parameter-item" }, j = { class: "parameter-item-name" }, E = { class: "parameter-item-type" }, R = { class: "absolute right-0" }, J = /* @__PURE__ */ k({
9
9
  __name: "ParameterListItem",
10
10
  props: {
11
11
  parameter: {},
@@ -29,8 +29,7 @@ const P = { class: "parameter-item" }, j = { class: "parameter-item-name" }, E =
29
29
  r(n(T), {
30
30
  class: "parameter-item-icon",
31
31
  icon: p ? "ChevronDown" : "ChevronRight",
32
- size: "md",
33
- thickness: "1.75"
32
+ thickness: "1.5"
34
33
  }, null, 8, ["icon"]),
35
34
  r(V, null, {
36
35
  default: m(() => [
@@ -40,7 +39,7 @@ const P = { class: "parameter-item" }, j = { class: "parameter-item-name" }, E =
40
39
  }, 1024),
41
40
  u("span", j, c(e.parameter.name), 1),
42
41
  u("span", E, c(e.parameter.description), 1),
43
- u("div", z, [
42
+ u("div", R, [
44
43
  a.value && t.parameter.content ? (s(), i(_, {
45
44
  key: 0,
46
45
  class: "parameter-item-content-type",
@@ -1 +1 @@
1
- {"version":3,"file":"RequestBodyPropertiesChild.vue.d.ts","sourceRoot":"","sources":["../../../../src/features/Operation/components/RequestBodyPropertiesChild.vue"],"names":[],"mappings":"AAmCA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAKhD,KAAK,WAAW,GAAG;IAAE,iBAAiB,EAAE,iBAAiB,CAAA;CAAE,CAAC;;AAsF5D,wBAMG"}
1
+ {"version":3,"file":"RequestBodyPropertiesChild.vue.d.ts","sourceRoot":"","sources":["../../../../src/features/Operation/components/RequestBodyPropertiesChild.vue"],"names":[],"mappings":"AAmCA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAKhD,KAAK,WAAW,GAAG;IAAE,iBAAiB,EAAE,iBAAiB,CAAA;CAAE,CAAC;;AAqF5D,wBAMG"}
@@ -1 +1 @@
1
- {"version":3,"file":"ClassicLayout.vue.d.ts","sourceRoot":"","sources":["../../../../src/features/Operation/layouts/ClassicLayout.vue"],"names":[],"mappings":"AA4RA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAShE,KAAK,WAAW,GAAG;IACjB,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,SAAS,EAAE,oBAAoB,CAAA;CAChC,CAAC;;AAsPF,wBAOG"}
1
+ {"version":3,"file":"ClassicLayout.vue.d.ts","sourceRoot":"","sources":["../../../../src/features/Operation/layouts/ClassicLayout.vue"],"names":[],"mappings":"AAkSA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAShE,KAAK,WAAW,GAAG;IACjB,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,SAAS,EAAE,oBAAoB,CAAA;CAChC,CAAC;;AAuPF,wBAOG"}
@@ -1,7 +1,7 @@
1
1
  import o from "./ClassicLayout.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const c = /* @__PURE__ */ t(o, [["__scopeId", "data-v-d9c1078a"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-5753de10"]]);
5
5
  export {
6
- c as default
6
+ m as default
7
7
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./ModernLayout.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-f977f73f"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-aec31ba9"]]);
5
5
  export {
6
6
  m as default
7
7
  };
@@ -1,117 +1,117 @@
1
- import { defineComponent as s, openBlock as l, createBlock as m, unref as r, withCtx as t, createVNode as e, createTextVNode as d, createCommentVNode as c, createElementVNode as n, normalizeClass as _, toDisplayString as h } from "vue";
2
- import S from "../../../components/OperationPath.vue.js";
3
- import { ScalarMarkdown as C, ScalarErrorBoundary as u } from "@scalar/components";
4
- import v from "../components/OperationParameters.vue.js";
5
- import k from "../components/OperationResponses.vue.js";
6
- import y from "../../../components/Section/Section.vue.js";
7
- import B from "../../../components/Section/SectionContent.vue.js";
8
- import g from "../../../components/Section/SectionColumns.vue.js";
9
- import f from "../../../components/Section/SectionColumn.vue.js";
1
+ import { defineComponent as c, openBlock as m, createBlock as d, unref as r, withCtx as t, createVNode as e, createTextVNode as u, createCommentVNode as _, createElementVNode as a, normalizeClass as h, toDisplayString as S } from "vue";
2
+ import C from "../../../components/OperationPath.vue.js";
3
+ import { ScalarMarkdown as v, ScalarErrorBoundary as f } from "@scalar/components";
4
+ import k from "../components/OperationParameters.vue.js";
5
+ import y from "../components/OperationResponses.vue.js";
6
+ import B from "../../../components/Section/Section.vue.js";
7
+ import g from "../../../components/Section/SectionContent.vue.js";
10
8
  import E from "../../../components/Badge/Badge.vue.js";
11
9
  import N from "../../../components/Section/SectionHeader.vue.js";
12
10
  import V from "../../../components/Anchor/Anchor.vue.js";
13
- import b from "../../ExampleRequest/ExampleRequest.vue.js";
14
- import w from "../../TestRequestButton/TestRequestButton.vue.js";
15
- import R from "../../ExampleResponses/ExampleResponses.vue.js";
16
- const q = { class: "operation-details" }, D = { class: "examples" }, U = /* @__PURE__ */ s({
11
+ import b from "../../../components/Section/SectionColumns.vue.js";
12
+ import s from "../../../components/Section/SectionColumn.vue.js";
13
+ import w from "../../ExampleRequest/ExampleRequest.vue.js";
14
+ import R from "../../TestRequestButton/TestRequestButton.vue.js";
15
+ import q from "../../ExampleResponses/ExampleResponses.vue.js";
16
+ const D = { class: "operation-details" }, M = { class: "examples" }, W = /* @__PURE__ */ c({
17
17
  __name: "ModernLayout",
18
18
  props: {
19
19
  id: {},
20
20
  operation: {}
21
21
  },
22
- setup(M) {
23
- return (o, i) => (l(), m(r(y), {
22
+ setup(T) {
23
+ return (o, n) => (m(), d(r(B), {
24
24
  id: o.id,
25
25
  label: o.operation.name
26
26
  }, {
27
27
  default: t(() => [
28
- e(r(B), null, {
29
- default: t(() => [
30
- e(r(g), null, {
31
- default: t(() => [
32
- e(r(f), null, {
33
- default: t(() => {
34
- var a, p;
35
- return [
36
- (a = o.operation.information) != null && a.deprecated ? (l(), m(r(E), { key: 0 }, {
37
- default: t(() => i[0] || (i[0] = [
38
- d(" Deprecated ")
39
- ])),
40
- _: 1
41
- })) : c("", !0),
42
- n("div", {
43
- class: _((p = o.operation.information) != null && p.deprecated ? "deprecated" : "")
44
- }, [
45
- e(r(N), { level: 3 }, {
28
+ e(r(g), null, {
29
+ default: t(() => {
30
+ var i, p;
31
+ return [
32
+ (i = o.operation.information) != null && i.deprecated ? (m(), d(r(E), { key: 0 }, {
33
+ default: t(() => n[0] || (n[0] = [
34
+ u(" Deprecated ")
35
+ ])),
36
+ _: 1
37
+ })) : _("", !0),
38
+ a("div", {
39
+ class: h((p = o.operation.information) != null && p.deprecated ? "deprecated" : "")
40
+ }, [
41
+ e(r(N), { level: 3 }, {
42
+ default: t(() => [
43
+ e(r(V), {
44
+ id: o.id ?? ""
45
+ }, {
46
+ default: t(() => [
47
+ u(S(o.operation.name), 1)
48
+ ]),
49
+ _: 1
50
+ }, 8, ["id"])
51
+ ]),
52
+ _: 1
53
+ })
54
+ ], 2),
55
+ e(r(b), null, {
56
+ default: t(() => [
57
+ e(r(s), null, {
58
+ default: t(() => [
59
+ a("div", D, [
60
+ e(r(v), {
61
+ value: o.operation.description,
62
+ withImages: ""
63
+ }, null, 8, ["value"]),
64
+ e(k, { operation: o.operation }, null, 8, ["operation"]),
65
+ e(y, { operation: o.operation }, null, 8, ["operation"])
66
+ ])
67
+ ]),
68
+ _: 1
69
+ }),
70
+ e(r(s), null, {
71
+ default: t(() => [
72
+ a("div", M, [
73
+ e(r(f), null, {
46
74
  default: t(() => [
47
- e(r(V), {
48
- id: o.id ?? ""
75
+ e(r(w), {
76
+ fallback: "",
77
+ operation: o.operation
49
78
  }, {
50
- default: t(() => [
51
- d(h(o.operation.name), 1)
79
+ header: t(() => {
80
+ var l;
81
+ return [
82
+ e(C, {
83
+ class: "example-path",
84
+ deprecated: (l = o.operation.information) == null ? void 0 : l.deprecated,
85
+ path: o.operation.path
86
+ }, null, 8, ["deprecated", "path"])
87
+ ];
88
+ }),
89
+ footer: t(() => [
90
+ e(r(R), { operation: o.operation }, null, 8, ["operation"])
52
91
  ]),
53
92
  _: 1
54
- }, 8, ["id"])
93
+ }, 8, ["operation"])
94
+ ]),
95
+ _: 1
96
+ }),
97
+ e(r(f), null, {
98
+ default: t(() => [
99
+ e(r(q), {
100
+ operation: o.operation,
101
+ style: { "margin-top": "12px" }
102
+ }, null, 8, ["operation"])
55
103
  ]),
56
104
  _: 1
57
105
  })
58
- ], 2),
59
- n("div", q, [
60
- e(r(C), {
61
- value: o.operation.description,
62
- withImages: ""
63
- }, null, 8, ["value"]),
64
- e(v, { operation: o.operation }, null, 8, ["operation"]),
65
- e(k, { operation: o.operation }, null, 8, ["operation"])
66
106
  ])
67
- ];
68
- }),
69
- _: 1
70
- }),
71
- e(r(f), null, {
72
- default: t(() => [
73
- n("div", D, [
74
- e(r(u), null, {
75
- default: t(() => [
76
- e(r(b), {
77
- fallback: "",
78
- operation: o.operation
79
- }, {
80
- header: t(() => {
81
- var a;
82
- return [
83
- e(S, {
84
- class: "example-path",
85
- deprecated: (a = o.operation.information) == null ? void 0 : a.deprecated,
86
- path: o.operation.path
87
- }, null, 8, ["deprecated", "path"])
88
- ];
89
- }),
90
- footer: t(() => [
91
- e(r(w), { operation: o.operation }, null, 8, ["operation"])
92
- ]),
93
- _: 1
94
- }, 8, ["operation"])
95
- ]),
96
- _: 1
97
- }),
98
- e(r(u), null, {
99
- default: t(() => [
100
- e(r(R), {
101
- operation: o.operation,
102
- style: { "margin-top": "12px" }
103
- }, null, 8, ["operation"])
104
- ]),
105
- _: 1
106
- })
107
- ])
108
- ]),
109
- _: 1
110
- })
111
- ]),
112
- _: 1
113
- })
114
- ]),
107
+ ]),
108
+ _: 1
109
+ })
110
+ ]),
111
+ _: 1
112
+ })
113
+ ];
114
+ }),
115
115
  _: 1
116
116
  })
117
117
  ]),
@@ -120,5 +120,5 @@ const q = { class: "operation-details" }, D = { class: "examples" }, U = /* @__P
120
120
  }
121
121
  });
122
122
  export {
123
- U as default
123
+ W as default
124
124
  };
@@ -1 +1 @@
1
- {"version":3,"file":"SearchButton.vue.d.ts","sourceRoot":"","sources":["../../../src/features/Search/SearchButton.vue"],"names":[],"mappings":"AA0HA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAShD,KAAK,WAAW,GAAG;IACf,IAAI,EAAE,IAAI,CAAA;IACV,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,CAAC;;kBADe,MAAM;;AA4HzB,wBAOG"}
1
+ {"version":3,"file":"SearchButton.vue.d.ts","sourceRoot":"","sources":["../../../src/features/Search/SearchButton.vue"],"names":[],"mappings":"AAyHA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAShD,KAAK,WAAW,GAAG;IACf,IAAI,EAAE,IAAI,CAAA;IACV,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,CAAC;;kBADe,MAAM;;AA2HzB,wBAOG"}
@@ -1,7 +1,7 @@
1
1
  import o from "./SearchButton.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.js";
4
- const e = /* @__PURE__ */ t(o, [["__scopeId", "data-v-3ed69c39"]]);
4
+ const c = /* @__PURE__ */ t(o, [["__scopeId", "data-v-ce119e9f"]]);
5
5
  export {
6
- e as default
6
+ c as default
7
7
  };
@@ -1,57 +1,54 @@
1
- import { defineComponent as h, openBlock as u, createElementBlock as f, Fragment as y, createElementVNode as o, normalizeClass as S, unref as a, createVNode as l, toDisplayString as c } from "vue";
2
- import { useModal as b, ScalarIcon as k } from "@scalar/components";
3
- import { useMagicKeys as K, whenever as v } from "@vueuse/core";
1
+ import { defineComponent as u, openBlock as h, createElementBlock as f, Fragment as y, createElementVNode as t, normalizeClass as S, unref as a, createVNode as l, toDisplayString as c } from "vue";
2
+ import { useModal as k, ScalarIcon as b } from "@scalar/components";
3
+ import { useMagicKeys as v, useEventListener as K } from "@vueuse/core";
4
4
  import g from "./SearchModal.vue.js";
5
5
  import { isMacOs as r } from "../../helpers/isMacOs.js";
6
6
  import { useApiClient as w } from "../ApiClientModal/useApiClient.js";
7
- const C = { class: "sidebar-search-input" }, H = { class: "sidebar-search-shortcut" }, M = { class: "sidebar-search-key" }, N = /* @__PURE__ */ h({
7
+ const C = { class: "sidebar-search-input" }, E = { class: "sidebar-search-shortcut" }, M = { class: "sidebar-search-key" }, O = /* @__PURE__ */ u({
8
8
  __name: "SearchButton",
9
9
  props: {
10
10
  spec: {},
11
11
  searchHotKey: { default: "k" }
12
12
  },
13
13
  setup(i) {
14
- const n = i, t = b(), { client: p } = w(), d = K({
14
+ const p = i, o = k(), { client: d } = w(), n = v({
15
15
  passive: !1,
16
- onEventFired(e) {
17
- !r() && e.ctrlKey && e.key === n.searchHotKey && (e.preventDefault(), e.stopPropagation());
16
+ onEventFired(s) {
17
+ !r() && s.ctrlKey && s.key === p.searchHotKey && (s.preventDefault(), s.stopPropagation());
18
18
  }
19
19
  });
20
- return v(
21
- d[`${r() ? "meta" : "control"}_${n.searchHotKey}`],
22
- () => {
23
- var e;
24
- (e = p.value) != null && e.modalState.open || (t.open ? t.hide() : t.show());
25
- }
26
- ), (e, s) => (u(), f(y, null, [
27
- o("button", {
28
- class: S(["sidebar-search", e.$attrs.class]),
20
+ return K(document, "keydown", (s) => {
21
+ var e;
22
+ (r() ? n.meta.value : n.ctrl.value) && s.key === "k" && ((e = d.value) != null && e.modalState.open || (o.open ? o.hide() : o.show()));
23
+ }), (s, e) => (h(), f(y, null, [
24
+ t("button", {
25
+ class: S(["sidebar-search", s.$attrs.class]),
29
26
  type: "button",
30
- onClick: s[0] || (s[0] = //@ts-ignore
31
- (...m) => a(t).show && a(t).show(...m))
27
+ onClick: e[0] || (e[0] = //@ts-ignore
28
+ (...m) => a(o).show && a(o).show(...m))
32
29
  }, [
33
- l(a(k), {
30
+ l(a(b), {
34
31
  class: "scalar-search-icon",
35
32
  icon: "Search",
36
33
  size: "sm",
37
34
  thickness: "2.5"
38
35
  }),
39
- o("div", C, [
40
- s[2] || (s[2] = o("span", { class: "sr-only" }, "Open ", -1)),
41
- s[3] || (s[3] = o("span", { class: "sidebar-search-placeholder" }, "Search", -1)),
42
- o("span", H, [
43
- s[1] || (s[1] = o("span", { class: "sr-only" }, "(Keyboard Shortcut)", -1)),
44
- o("kbd", M, c(a(r)() ? "⌘" : "⌃") + c(e.searchHotKey), 1)
36
+ t("div", C, [
37
+ e[2] || (e[2] = t("span", { class: "sr-only" }, "Open ", -1)),
38
+ e[3] || (e[3] = t("span", { class: "sidebar-search-placeholder" }, "Search", -1)),
39
+ t("span", E, [
40
+ e[1] || (e[1] = t("span", { class: "sr-only" }, "(Keyboard Shortcut)", -1)),
41
+ t("kbd", M, c(a(r)() ? "⌘" : "⌃") + c(s.searchHotKey), 1)
45
42
  ])
46
43
  ])
47
44
  ], 2),
48
45
  l(g, {
49
- modalState: a(t),
50
- parsedSpec: e.spec
46
+ modalState: a(o),
47
+ parsedSpec: s.spec
51
48
  }, null, 8, ["modalState", "parsedSpec"])
52
49
  ], 64));
53
50
  }
54
51
  });
55
52
  export {
56
- N as default
53
+ O as default
57
54
  };
@@ -1 +1 @@
1
- {"version":3,"file":"useSearchIndex.d.ts","sourceRoot":"","sources":["../../../src/features/Search/useSearchIndex.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AACtE,OAAa,EAAE,KAAK,UAAU,EAAE,MAAM,SAAS,CAAA;AAC/C,OAAO,EAAE,KAAK,GAAG,EAAwB,MAAM,KAAK,CAAA;AAIpD,OAAO,EACL,KAAK,QAAQ,EAId,MAAM,aAAa,CAAA;AAEpB,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,KAAK,CAAA;AAEvE,MAAM,MAAM,QAAQ,GAAG;IACrB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,SAAS,CAAA;IACf,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,WAAW,EAAE,MAAM,CAAA;IACnB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,QAAQ,CAAA;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,SAAS,CAAC,EAAE,oBAAoB,CAAA;CACjC,CAAA;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,EAC7B,aAAa,GACd,EAAE;IACD,aAAa,EAAE,GAAG,CAAC,IAAI,CAAC,CAAA;CACzB;uBAoByB,IAAI;sBALL,IAAI;;;;EAoK5B"}
1
+ {"version":3,"file":"useSearchIndex.d.ts","sourceRoot":"","sources":["../../../src/features/Search/useSearchIndex.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AACtE,OAAa,EAAE,KAAK,UAAU,EAAE,MAAM,SAAS,CAAA;AAC/C,OAAO,EAAE,KAAK,GAAG,EAAwB,MAAM,KAAK,CAAA;AAIpD,OAAO,EACL,KAAK,QAAQ,EAId,MAAM,aAAa,CAAA;AAEpB,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,KAAK,CAAA;AAEvE,MAAM,MAAM,QAAQ,GAAG;IACrB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,SAAS,CAAA;IACf,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,WAAW,EAAE,MAAM,CAAA;IACnB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,QAAQ,CAAA;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,SAAS,CAAC,EAAE,oBAAoB,CAAA;CACjC,CAAA;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,EAC7B,aAAa,GACd,EAAE;IACD,aAAa,EAAE,GAAG,CAAC,IAAI,CAAC,CAAA;CACzB;uBA4ByB,IAAI;sBAbL,IAAI;;;;EA4K5B"}
@@ -1,5 +1,5 @@
1
- import H from "fuse.js";
2
- import { ref as c, computed as N, watch as V } from "vue";
1
+ import N from "fuse.js";
2
+ import { ref as h, watch as R, computed as V } from "vue";
3
3
  import { extractRequestBody as A } from "../../helpers/specHelpers.js";
4
4
  import { useSidebar as B } from "../../hooks/useSidebar.js";
5
5
  import { getHeadingsFromMarkdown as P } from "../../helpers/getHeadingsFromMarkdown.js";
@@ -9,56 +9,59 @@ import { useNavState as J } from "../../hooks/useNavState.js";
9
9
  function te({
10
10
  specification: a
11
11
  }) {
12
- const { getHeadingId: O, getWebhookId: R, getModelId: T, getOperationId: j, getTagId: L } = J(), { hideModels: W } = B(), o = c([]), n = c([]), h = c(0), s = c(""), d = new H(o.value, {
12
+ const { getHeadingId: T, getWebhookId: j, getModelId: L, getOperationId: W, getTagId: q } = J(), { hideModels: C } = B(), o = h([]), r = h([]), d = h(0), s = h(""), i = new N(o.value, {
13
13
  keys: ["title", "description", "body"]
14
- }), q = () => {
15
- h.value = 0, n.value = d.search(s.value);
14
+ }), p = () => {
15
+ d.value = 0, r.value = i.search(s.value);
16
16
  };
17
- function C() {
18
- s.value = "", h.value = 0, n.value = [];
17
+ R(s, (l) => {
18
+ l.length ? p() : r.value = [];
19
+ });
20
+ function F() {
21
+ s.value = "", d.value = 0, r.value = [];
19
22
  }
20
- const F = N(
21
- () => s.value.length === 0 ? o.value.slice(0, 25).map((r) => ({
22
- item: r
23
- })) : n.value.slice(0, 25)
23
+ const H = V(
24
+ () => s.value.length === 0 ? o.value.slice(0, 25).map((u) => ({
25
+ item: u
26
+ })) : r.value.slice(0, 25)
24
27
  );
25
- return V(
28
+ return R(
26
29
  a.value,
27
30
  async () => {
28
- var b, y, g, I, k, M, w, D, $;
29
- if (o.value = [], !((y = (b = a.value) == null ? void 0 : b.tags) != null && y.length) && !((I = (g = a.value) == null ? void 0 : g.webhooks) != null && I.length)) {
30
- d.setCollection([]);
31
+ var y, g, I, k, M, w, D, $, E;
32
+ if (o.value = [], !((g = (y = a.value) == null ? void 0 : y.tags) != null && g.length) && !((k = (I = a.value) == null ? void 0 : I.webhooks) != null && k.length)) {
33
+ i.setCollection([]);
31
34
  return;
32
35
  }
33
- const i = [], r = P(
34
- ((M = (k = a.value) == null ? void 0 : k.info) == null ? void 0 : M.description) ?? ""
36
+ const l = [], u = P(
37
+ ((w = (M = a.value) == null ? void 0 : M.info) == null ? void 0 : w.description) ?? ""
35
38
  );
36
- r.length && (r.forEach((e) => {
37
- i.push({
39
+ u.length && (u.forEach((e) => {
40
+ l.push({
38
41
  type: "heading",
39
42
  title: `Info > ${e.value}`,
40
43
  description: "",
41
- href: `#${O(e)}`,
44
+ href: `#${T(e)}`,
42
45
  tag: e.slug,
43
46
  body: ""
44
47
  });
45
- }), o.value = o.value.concat(i)), (D = (w = a.value) == null ? void 0 : w.tags) == null || D.forEach((e) => {
46
- const E = {
48
+ }), o.value = o.value.concat(l)), ($ = (D = a.value) == null ? void 0 : D.tags) == null || $.forEach((e) => {
49
+ const S = {
47
50
  title: e["x-displayName"] ?? e.name,
48
- href: `#${L(e)}`,
51
+ href: `#${q(e)}`,
49
52
  description: e.description,
50
53
  type: "tag",
51
54
  tag: e.name,
52
55
  body: ""
53
56
  };
54
- o.value.push(E), e.operations && e.operations.forEach((t) => {
55
- const { parameterMap: u } = z(t), S = A(t) || u.value;
56
- let v = null;
57
- typeof S != "boolean" && (v = S);
58
- const x = {
57
+ o.value.push(S), e.operations && e.operations.forEach((t) => {
58
+ const { parameterMap: n } = z(t), x = A(t) || n.value;
59
+ let f = null;
60
+ typeof x != "boolean" && (f = x);
61
+ const O = {
59
62
  type: "req",
60
63
  title: t.name ?? t.path,
61
- href: `#${j(t, e)}`,
64
+ href: `#${W(t, e)}`,
62
65
  operationId: t.operationId,
63
66
  description: t.description ?? "",
64
67
  httpVerb: t.httpVerb,
@@ -66,44 +69,44 @@ function te({
66
69
  tag: e.name,
67
70
  operation: t
68
71
  };
69
- v && (x.body = v), o.value.push(x);
72
+ f && (O.body = f), o.value.push(O);
70
73
  });
71
74
  });
72
- const l = ($ = a.value) == null ? void 0 : $.webhooks, f = [];
73
- l && Object.keys(l).forEach((e) => {
75
+ const c = (E = a.value) == null ? void 0 : E.webhooks, m = [];
76
+ c && Object.keys(c).forEach((e) => {
74
77
  Object.keys(
75
- l[e]
78
+ c[e]
76
79
  ).forEach((t) => {
77
- var u;
78
- f.push({
80
+ var n;
81
+ m.push({
79
82
  type: "webhook",
80
- title: `Webhook: ${(u = l[e][t]) == null ? void 0 : u.name}`,
81
- href: `#${R(e, t)}`,
83
+ title: `Webhook: ${(n = c[e][t]) == null ? void 0 : n.name}`,
84
+ href: `#${j(e, t)}`,
82
85
  description: e,
83
86
  httpVerb: t,
84
87
  tag: e,
85
88
  body: ""
86
89
  });
87
- }), o.value = o.value.concat(f);
90
+ }), o.value = o.value.concat(m);
88
91
  });
89
- const p = W.value ? {} : G(a.value), m = [];
90
- p && (Object.keys(p).forEach((e) => {
91
- m.push({
92
+ const v = C.value ? {} : G(a.value), b = [];
93
+ v && (Object.keys(v).forEach((e) => {
94
+ b.push({
92
95
  type: "model",
93
96
  title: "Model",
94
- href: `#${T(e)}`,
95
- description: p[e].title ?? e,
97
+ href: `#${L(e)}`,
98
+ description: v[e].title ?? e,
96
99
  tag: e,
97
100
  body: ""
98
101
  });
99
- }), o.value = o.value.concat(m)), d.setCollection(o.value);
102
+ }), o.value = o.value.concat(b)), i.setCollection(o.value);
100
103
  },
101
104
  { immediate: !0 }
102
105
  ), {
103
- resetSearch: C,
104
- fuseSearch: q,
105
- selectedSearchResult: h,
106
- searchResultsWithPlaceholderResults: F,
106
+ resetSearch: F,
107
+ fuseSearch: p,
108
+ selectedSearchResult: d,
109
+ searchResultsWithPlaceholderResults: H,
107
110
  searchText: s
108
111
  };
109
112
  }
@@ -5,5 +5,5 @@ export type ClientId<T extends SnippetzTargetId> = HttpSnippetLiteClientId | Sni
5
5
  /**
6
6
  * Returns a code example for given HAR request
7
7
  */
8
- export declare function getExampleCode<T extends SnippetzTargetId>(request: Request, target: TargetId, client: ClientId<T>): Promise<string>;
8
+ export declare function getExampleCode<T extends SnippetzTargetId>(request: Request, target: TargetId, client: ClientId<T>): Promise<string | undefined>;
9
9
  //# sourceMappingURL=getExampleCode.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getExampleCode.d.ts","sourceRoot":"","sources":["../../src/helpers/getExampleCode.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,QAAQ,IAAI,gBAAgB,EACjC,KAAK,QAAQ,IAAI,gBAAgB,EAElC,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAEL,KAAK,QAAQ,IAAI,uBAAuB,EACxC,KAAK,QAAQ,IAAI,uBAAuB,EACzC,MAAM,kBAAkB,CAAA;AAEzB,MAAM,MAAM,QAAQ,GAAG,uBAAuB,GAAG,gBAAgB,CAAA;AACjE,MAAM,MAAM,QAAQ,CAAC,CAAC,SAAS,gBAAgB,IAC3C,uBAAuB,GACvB,gBAAgB,CAAC,CAAC,CAAC,CAAA;AAEvB;;GAEG;AACH,wBAAsB,cAAc,CAAC,CAAC,SAAS,gBAAgB,EAC7D,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,QAAQ,EAChB,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,mBA0CpB"}
1
+ {"version":3,"file":"getExampleCode.d.ts","sourceRoot":"","sources":["../../src/helpers/getExampleCode.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,QAAQ,IAAI,gBAAgB,EACjC,KAAK,QAAQ,IAAI,gBAAgB,EAElC,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAEL,KAAK,QAAQ,IAAI,uBAAuB,EACxC,KAAK,QAAQ,IAAI,uBAAuB,EACzC,MAAM,kBAAkB,CAAA;AAEzB,MAAM,MAAM,QAAQ,GAAG,uBAAuB,GAAG,gBAAgB,CAAA;AACjE,MAAM,MAAM,QAAQ,CAAC,CAAC,SAAS,gBAAgB,IAC3C,uBAAuB,GACvB,gBAAgB,CAAC,CAAC,CAAC,CAAA;AAEvB;;GAEG;AACH,wBAAsB,cAAc,CAAC,CAAC,SAAS,gBAAgB,EAC7D,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,QAAQ,EAChB,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,+BAyCpB"}
@@ -5,7 +5,6 @@ async function f(t, e, p) {
5
5
  if (o().hasPlugin(r, p))
6
6
  return o().print(
7
7
  r,
8
- // @ts-expect-error Typecasting fails, but shouldn’t be necessary soon anway.
9
8
  p,
10
9
  t
11
10
  );