@scalar/api-reference 1.25.127 → 1.25.128

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 (87) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/dist/browser/standalone.js +16046 -15965
  3. package/dist/browser/webpack-stats.json +1 -1
  4. package/dist/components/ApiReference.vue.d.ts.map +1 -1
  5. package/dist/components/ApiReference.vue.js +40 -64
  6. package/dist/components/ApiReferenceLayout.vue.d.ts +2 -2
  7. package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
  8. package/dist/components/ApiReferenceLayout.vue.js +2 -2
  9. package/dist/components/ApiReferenceLayout.vue2.js +158 -159
  10. package/dist/components/Content/ClientLibraries/ClientLibraries.vue.d.ts.map +1 -1
  11. package/dist/components/Content/ClientLibraries/ClientLibraries.vue.js +1 -1
  12. package/dist/components/Content/ClientLibraries/ClientLibraries.vue2.js +69 -17
  13. package/dist/components/Content/ClientLibraries/ClientSelector.vue.d.ts +5 -1
  14. package/dist/components/Content/ClientLibraries/ClientSelector.vue.d.ts.map +1 -1
  15. package/dist/components/Content/ClientLibraries/ClientSelector.vue.js +2 -2
  16. package/dist/components/Content/ClientLibraries/ClientSelector.vue2.js +73 -94
  17. package/dist/components/Content/ClientLibraries/useFeaturedHttpClients.d.ts +16 -0
  18. package/dist/components/Content/ClientLibraries/useFeaturedHttpClients.d.ts.map +1 -0
  19. package/dist/components/Content/ClientLibraries/useFeaturedHttpClients.js +36 -0
  20. package/dist/components/Content/Schema/Schema.vue.d.ts.map +1 -1
  21. package/dist/components/Content/Schema/Schema.vue.js +2 -2
  22. package/dist/components/Content/Schema/Schema.vue2.js +4 -1
  23. package/dist/components/Content/Schema/SchemaProperty.vue.d.ts +1 -1
  24. package/dist/components/Content/Schema/SchemaProperty.vue.js +1 -1
  25. package/dist/components/Content/Schema/SchemaProperty.vue2.js +1 -1
  26. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts.map +1 -1
  27. package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js +2 -2
  28. package/dist/components/Content/Schema/SchemaPropertyHeading.vue2.js +143 -124
  29. package/dist/components/GettingStarted.vue.d.ts.map +1 -1
  30. package/dist/components/GettingStarted.vue.js +1 -1
  31. package/dist/components/GettingStarted.vue2.js +13 -13
  32. package/dist/components/Layouts/ClassicLayout.vue.d.ts +3 -3
  33. package/dist/components/Layouts/ClassicLayout.vue.d.ts.map +1 -1
  34. package/dist/components/Layouts/Layouts.vue.d.ts +3 -3
  35. package/dist/components/Layouts/Layouts.vue.d.ts.map +1 -1
  36. package/dist/components/Layouts/ModernLayout.vue.d.ts +3 -3
  37. package/dist/components/Layouts/ModernLayout.vue.d.ts.map +1 -1
  38. package/dist/components/Layouts/ModernLayout.vue.js +2 -2
  39. package/dist/components/Section/CompactSection.vue.d.ts.map +1 -1
  40. package/dist/components/Section/CompactSection.vue.js +2 -2
  41. package/dist/components/Section/CompactSection.vue2.js +30 -29
  42. package/dist/esm.d.ts +5 -3
  43. package/dist/esm.d.ts.map +1 -1
  44. package/dist/features/ApiClientModal/ApiClientModal.vue.d.ts +2 -2
  45. package/dist/features/ApiClientModal/ApiClientModal.vue.d.ts.map +1 -1
  46. package/dist/features/ApiClientModal/useApiClient.d.ts +362 -342
  47. package/dist/features/ApiClientModal/useApiClient.d.ts.map +1 -1
  48. package/dist/features/ExampleRequest/ExampleRequest.vue.d.ts.map +1 -1
  49. package/dist/features/ExampleRequest/ExampleRequest.vue.js +1 -1
  50. package/dist/features/ExampleRequest/ExampleRequest.vue2.js +82 -74
  51. package/dist/features/ExampleResponses/ExampleResponse.vue.d.ts.map +1 -1
  52. package/dist/features/ExampleResponses/ExampleResponse.vue.js +2 -2
  53. package/dist/features/ExampleResponses/ExampleResponse.vue2.js +11 -11
  54. package/dist/features/ExampleResponses/ExampleResponses.vue.d.ts.map +1 -1
  55. package/dist/features/ExampleResponses/ExampleResponses.vue.js +2 -2
  56. package/dist/features/ExampleResponses/ExampleResponses.vue2.js +90 -78
  57. package/dist/features/Operation/components/ContentTypeSelect.vue.d.ts +1 -1
  58. package/dist/features/Operation/components/ContentTypeSelect.vue.d.ts.map +1 -1
  59. package/dist/features/Operation/components/ContentTypeSelect.vue.js +1 -1
  60. package/dist/features/Operation/components/ContentTypeSelect.vue2.js +29 -25
  61. package/dist/features/Operation/components/ParameterListItem.vue.d.ts.map +1 -1
  62. package/dist/features/Operation/components/ParameterListItem.vue.js +1 -1
  63. package/dist/features/Operation/components/ParameterListItem.vue2.js +40 -47
  64. package/dist/features/Operation/components/RequestBody.vue.d.ts.map +1 -1
  65. package/dist/features/Operation/components/RequestBody.vue.js +2 -2
  66. package/dist/features/Operation/layouts/ModernLayout.vue.js +2 -2
  67. package/dist/helpers/get-request.d.ts +1 -1
  68. package/dist/helpers/get-request.d.ts.map +1 -1
  69. package/dist/hooks/index.d.ts +0 -1
  70. package/dist/hooks/index.d.ts.map +1 -1
  71. package/dist/hooks/useConfig.d.ts +3 -3
  72. package/dist/hooks/useConfig.d.ts.map +1 -1
  73. package/dist/hooks/useConfig.js +5 -4
  74. package/dist/index.js +17 -19
  75. package/dist/standalone/lib/html-api.d.ts +3 -3
  76. package/dist/standalone/lib/html-api.d.ts.map +1 -1
  77. package/dist/standalone/lib/html-rendering.d.ts +23 -24
  78. package/dist/standalone/lib/html-rendering.d.ts.map +1 -1
  79. package/dist/standalone/lib/html-rendering.js +39 -29
  80. package/dist/stores/useHttpClientStore.d.ts.map +1 -1
  81. package/dist/style.css +1 -1
  82. package/dist/types.d.ts +19 -2
  83. package/dist/types.d.ts.map +1 -1
  84. package/package.json +11 -10
  85. package/dist/hooks/useDeprecationWarnings.d.ts +0 -6
  86. package/dist/hooks/useDeprecationWarnings.d.ts.map +0 -1
  87. package/dist/hooks/useDeprecationWarnings.js +0 -20
@@ -1 +1 @@
1
- {"version":3,"file":"ApiReference.vue.d.ts","sourceRoot":"","sources":["../../src/components/ApiReference.vue"],"names":[],"mappings":"AAqGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAiE9C,iBAAS,cAAc;WAyFT,OAAO,IAA6B;;wBATrB,GAAG;wBACH,GAAG;;;;EAa/B;AAeD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;kFAOnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAWpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"ApiReference.vue.d.ts","sourceRoot":"","sources":["../../src/components/ApiReference.vue"],"names":[],"mappings":"AAsFA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAgD7C,iBAAS,cAAc;WAyFT,OAAO,IAA6B;;wBATrB,GAAG;wBACH,GAAG;;;;EAa/B;AAeD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;kFAOnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAWpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -1,78 +1,54 @@
1
- import { defineComponent as y, watch as w, computed as n, toRef as m, openBlock as f, createElementBlock as x, Fragment as U, createBlock as V, resolveDynamicComponent as $, withCtx as i, createTextVNode as b, toDisplayString as B, createCommentVNode as N, createVNode as R, unref as a, renderSlot as d } from "vue";
2
- import { migrateThemeVariables as T } from "@scalar/themes";
3
- import { useColorMode as _ } from "@scalar/use-hooks/useColorMode";
4
- import { useSeoMeta as h } from "@unhead/vue";
5
- import { useFavicon as E } from "@vueuse/core";
6
- import { useReactiveSpec as F } from "../hooks/useReactiveSpec.js";
1
+ import { defineComponent as S, computed as p, watch as M, toRef as c, openBlock as l, createElementBlock as D, Fragment as y, createBlock as w, resolveDynamicComponent as R, withCtx as a, createTextVNode as $, toDisplayString as x, createCommentVNode as B, createVNode as N, unref as t, renderSlot as u } from "vue";
2
+ import { apiReferenceConfigurationSchema as U } from "@scalar/types/api-reference";
3
+ import { useColorMode as V } from "@scalar/use-hooks/useColorMode";
4
+ import { useSeoMeta as _ } from "@unhead/vue";
5
+ import { useFavicon as F } from "@vueuse/core";
6
+ import { useReactiveSpec as T } from "../hooks/useReactiveSpec.js";
7
7
  import A from "./Layouts/Layouts.vue.js";
8
- const K = /* @__PURE__ */ y({
8
+ const H = /* @__PURE__ */ S({
9
9
  __name: "ApiReference",
10
10
  props: {
11
11
  configuration: {}
12
12
  },
13
13
  emits: ["updateContent"],
14
- setup(v) {
15
- var c, u, l;
16
- const t = v, { toggleColorMode: g, isDarkMode: s } = _({
17
- initialColorMode: (c = t.configuration) != null && c.darkMode ? "dark" : void 0,
18
- overrideColorMode: (u = t.configuration) == null ? void 0 : u.forceDarkModeState
14
+ setup(m) {
15
+ var i;
16
+ const f = m, e = p(
17
+ () => U.parse(f.configuration)
18
+ ), { toggleColorMode: d, isDarkMode: n } = V({
19
+ initialColorMode: e.value.darkMode ? "dark" : void 0,
20
+ overrideColorMode: e.value.forceDarkModeState
19
21
  });
20
- w(
21
- () => {
22
- var o;
23
- return (o = t.configuration) == null ? void 0 : o.darkMode;
24
- },
25
- (o) => s.value = !!o
26
- );
27
- const C = n(() => {
28
- var o, r;
29
- if ((o = t.configuration) != null && o.customCss)
30
- return T((r = t.configuration) == null ? void 0 : r.customCss);
31
- }), e = n(() => {
32
- var o;
33
- return {
34
- spec: {
35
- content: void 0,
36
- url: void 0,
37
- ...(o = t.configuration) == null ? void 0 : o.spec
38
- },
39
- proxyUrl: void 0,
40
- theme: "default",
41
- showSidebar: !0,
42
- isEditable: !1,
43
- ...t.configuration,
44
- customCss: C.value
45
- };
46
- });
47
- (l = e.value) != null && l.metaData && h(e.value.metaData);
48
- const { parsedSpec: k, rawSpec: S } = F({
49
- proxyUrl: m(
50
- () => e.value.proxyUrl || e.value.proxy || ""
51
- ),
52
- specConfig: m(() => e.value.spec || {})
53
- }), M = n(() => e.value.favicon);
54
- return E(M), (o, r) => {
55
- var p;
56
- return f(), x(U, null, [
57
- (p = e.value) != null && p.customCss ? (f(), V($("style"), { key: 0 }, {
58
- default: i(() => [
59
- b(B(e.value.customCss), 1)
22
+ M(
23
+ () => e.value.darkMode,
24
+ (o) => n.value = !!o
25
+ ), (i = e.value) != null && i.metaData && _(e.value.metaData);
26
+ const { parsedSpec: v, rawSpec: C } = T({
27
+ proxyUrl: c(() => e.value.proxyUrl || ""),
28
+ specConfig: c(() => e.value.spec || {})
29
+ }), g = p(() => e.value.favicon);
30
+ return F(g), (o, r) => {
31
+ var s;
32
+ return l(), D(y, null, [
33
+ (s = e.value) != null && s.customCss ? (l(), w(R("style"), { key: 0 }, {
34
+ default: a(() => [
35
+ $(x(e.value.customCss), 1)
60
36
  ]),
61
37
  _: 1
62
- })) : N("", !0),
63
- R(a(A), {
38
+ })) : B("", !0),
39
+ N(t(A), {
64
40
  configuration: e.value,
65
- isDark: a(s),
66
- parsedSpec: a(k),
67
- rawSpec: a(S),
68
- onToggleDarkMode: r[0] || (r[0] = () => a(g)()),
69
- onUpdateContent: r[1] || (r[1] = (D) => o.$emit("updateContent", D))
41
+ isDark: t(n),
42
+ parsedSpec: t(v),
43
+ rawSpec: t(C),
44
+ onToggleDarkMode: r[0] || (r[0] = () => t(d)()),
45
+ onUpdateContent: r[1] || (r[1] = (k) => o.$emit("updateContent", k))
70
46
  }, {
71
- footer: i(() => [
72
- d(o.$slots, "footer")
47
+ footer: a(() => [
48
+ u(o.$slots, "footer")
73
49
  ]),
74
- "content-end": i(() => [
75
- d(o.$slots, "footer")
50
+ "content-end": a(() => [
51
+ u(o.$slots, "footer")
76
52
  ]),
77
53
  _: 3
78
54
  }, 8, ["configuration", "isDark", "parsedSpec", "rawSpec"])
@@ -81,5 +57,5 @@ const K = /* @__PURE__ */ y({
81
57
  }
82
58
  });
83
59
  export {
84
- K as default
60
+ H as default
85
61
  };
@@ -4,16 +4,16 @@ type __VLS_Props = Omit<ReferenceLayoutProps, 'isDark'>;
4
4
  declare function __VLS_template(): {
5
5
  attrs: Partial<{}>;
6
6
  slots: Readonly<{
7
- footer: (props: ReferenceSlotProps) => any;
8
7
  header: (props: ReferenceSlotProps) => any;
8
+ footer: (props: ReferenceSlotProps) => any;
9
9
  editor: (props: ReferenceSlotProps) => any;
10
10
  "content-start": (props: ReferenceSlotProps) => any;
11
11
  "content-end": (props: ReferenceSlotProps) => any;
12
12
  "sidebar-start": (props: ReferenceSlotProps) => any;
13
13
  "sidebar-end": (props: ReferenceSlotProps) => any;
14
14
  }> & {
15
- footer: (props: ReferenceSlotProps) => any;
16
15
  header: (props: ReferenceSlotProps) => any;
16
+ footer: (props: ReferenceSlotProps) => any;
17
17
  editor: (props: ReferenceSlotProps) => any;
18
18
  "content-start": (props: ReferenceSlotProps) => any;
19
19
  "content-end": (props: ReferenceSlotProps) => any;
@@ -1 +1 @@
1
- {"version":3,"file":"ApiReferenceLayout.vue.d.ts","sourceRoot":"","sources":["../../src/components/ApiReferenceLayout.vue"],"names":[],"mappings":"AA8nBA,OAAO,EAGL,KAAK,OAAO,EACb,MAAM,gBAAgB,CAAA;AAuBvB,OAAO,KAAK,EACV,oBAAoB,EAEpB,kBAAkB,EACnB,MAAM,UAAU,CAAA;AAOjB,KAAK,WAAW,GAAG,IAAI,CAAC,oBAAoB,EAAE,QAAQ,CAAC,CAAC;AA2RxD,iBAAS,cAAc;WAoPT,OAAO,IAA6B;;wBA1fZ,kBAAkB,KAAK,GAAG;wBAA1B,kBAAkB,KAAK,GAAG;wBAA1B,kBAAkB,KAAK,GAAG;iCAA1B,kBAAkB,KAAK,GAAG;+BAA1B,kBAAkB,KAAK,GAAG;iCAA1B,kBAAkB,KAAK,GAAG;+BAA1B,kBAAkB,KAAK,GAAG;;wBAA1B,kBAAkB,KAAK,GAAG;wBAA1B,kBAAkB,KAAK,GAAG;wBAA1B,kBAAkB,KAAK,GAAG;iCAA1B,kBAAkB,KAAK,GAAG;+BAA1B,kBAAkB,KAAK,GAAG;iCAA1B,kBAAkB,KAAK,GAAG;+BAA1B,kBAAkB,KAAK,GAAG;;;;;;EA+f/D;AAuBD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;YAxiBqB,OAAO;eAAS,MAAM;;;;;;;;YAAtB,OAAO;eAAS,MAAM;;;;;;kFA+iB9D,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAWpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"ApiReferenceLayout.vue.d.ts","sourceRoot":"","sources":["../../src/components/ApiReferenceLayout.vue"],"names":[],"mappings":"AAgoBA,OAAO,EAGL,KAAK,OAAO,EACb,MAAM,gBAAgB,CAAA;AA6BvB,OAAO,KAAK,EACV,oBAAoB,EAEpB,kBAAkB,EACnB,MAAM,SAAS,CAAA;AAIhB,KAAK,WAAW,GAAG,IAAI,CAAC,oBAAoB,EAAE,QAAQ,CAAC,CAAC;AA0RxD,iBAAS,cAAc;WAoPT,OAAO,IAA6B;;wBArfZ,kBAAkB,KAAK,GAAG;wBAA1B,kBAAkB,KAAK,GAAG;wBAA1B,kBAAkB,KAAK,GAAG;iCAA1B,kBAAkB,KAAK,GAAG;+BAA1B,kBAAkB,KAAK,GAAG;iCAA1B,kBAAkB,KAAK,GAAG;+BAA1B,kBAAkB,KAAK,GAAG;;wBAA1B,kBAAkB,KAAK,GAAG;wBAA1B,kBAAkB,KAAK,GAAG;wBAA1B,kBAAkB,KAAK,GAAG;iCAA1B,kBAAkB,KAAK,GAAG;+BAA1B,kBAAkB,KAAK,GAAG;iCAA1B,kBAAkB,KAAK,GAAG;+BAA1B,kBAAkB,KAAK,GAAG;;;;;;EA0f/D;AAwBD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;YAxiBqB,OAAO;eAAS,MAAM;;;;;;;;YAAtB,OAAO;eAAS,MAAM;;;;;;kFA+iB9D,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAWpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -2,7 +2,7 @@ import o from "./ApiReferenceLayout.vue2.js";
2
2
  /* empty css */
3
3
  /* empty css */
4
4
  import t from "../_virtual/_plugin-vue_export-helper.js";
5
- const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-6712abf1"]]);
5
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-fb8f58f4"]]);
6
6
  export {
7
- f as default
7
+ m as default
8
8
  };
@@ -1,27 +1,27 @@
1
- import { defineComponent as se, ref as $, computed as v, onBeforeMount as M, onMounted as le, onUnmounted as de, watch as R, onServerPrefetch as ce, useSSRContext as ue, getCurrentInstance as fe, provide as b, openBlock as w, createElementBlock as y, Fragment as D, createElementVNode as d, normalizeClass as pe, unref as s, normalizeStyle as me, renderSlot as c, normalizeProps as u, guardReactiveProps as f, createVNode as p, withCtx as m, createCommentVNode as E, withDirectives as ge, vShow as Se, createSlots as he } from "vue";
2
- import { provideUseId as ve } from "@headlessui/vue";
3
- import { LAYOUT_SYMBOL as be } from "@scalar/api-client/hooks";
4
- import { createWorkspaceStore as we, WORKSPACE_SYMBOL as ye, createActiveEntitiesStore as Ce, ACTIVE_ENTITIES_SYMBOL as Te } from "@scalar/api-client/store";
5
- import { addScalarClassesToHeadless as $e, ScalarErrorBoundary as Re } from "@scalar/components";
6
- import { defaultStateFactory as H } from "@scalar/oas-utils/helpers";
7
- import { hasObtrusiveScrollbars as Ee, getThemeStyles as Ie } from "@scalar/themes";
8
- import { useToasts as Oe, ScalarToasts as ke } from "@scalar/use-toasts";
9
- import { useMediaQuery as Ae, useResizeObserver as Be, useDebounceFn as Fe } from "@vueuse/core";
10
- import { CONFIGURATION_SYMBOL as Le } from "../hooks/useConfig.js";
11
- import { useHttpClientStore as Pe } from "../stores/useHttpClientStore.js";
12
- import Me from "./GettingStarted.vue.js";
13
- import { downloadSpecBus as U, downloadSpecFile as De } from "../helpers/specDownloads.js";
14
- import { useDeprecationWarnings as He } from "../hooks/useDeprecationWarnings.js";
15
- import Ue from "./Sidebar/Sidebar.vue.js";
16
- import Ne from "./Content/Content.vue.js";
1
+ import { defineComponent as le, computed as h, ref as R, onBeforeMount as H, onMounted as de, onUnmounted as ue, watch as E, onServerPrefetch as ce, useSSRContext as pe, getCurrentInstance as fe, provide as w, openBlock as y, createElementBlock as C, Fragment as _, createElementVNode as u, normalizeClass as me, unref as l, normalizeStyle as ve, renderSlot as c, normalizeProps as p, guardReactiveProps as f, createVNode as m, withCtx as v, createCommentVNode as O, withDirectives as Se, vShow as ge, createSlots as he } from "vue";
2
+ import { provideUseId as be } from "@headlessui/vue";
3
+ import { LAYOUT_SYMBOL as we } from "@scalar/api-client/hooks";
4
+ import { createWorkspaceStore as ye, WORKSPACE_SYMBOL as Ce, createActiveEntitiesStore as Te, ACTIVE_ENTITIES_SYMBOL as $e } from "@scalar/api-client/store";
5
+ import { addScalarClassesToHeadless as Re, ScalarErrorBoundary as Ee } from "@scalar/components";
6
+ import { defaultStateFactory as D } from "@scalar/oas-utils/helpers";
7
+ import { hasObtrusiveScrollbars as Oe, getThemeStyles as Ie } from "@scalar/themes";
8
+ import { apiReferenceConfigurationSchema as ke } from "@scalar/types/api-reference";
9
+ import { useToasts as Ae, ScalarToasts as Fe } from "@scalar/use-toasts";
10
+ import { useMediaQuery as Le, useResizeObserver as Pe, useDebounceFn as Me } from "@vueuse/core";
11
+ import Be from "./GettingStarted.vue.js";
12
+ import { CONFIGURATION_SYMBOL as He } from "../hooks/useConfig.js";
13
+ import { useHttpClientStore as _e } from "../stores/useHttpClientStore.js";
14
+ import { downloadSpecBus as N, downloadSpecFile as De } from "../helpers/specDownloads.js";
15
+ import Ne from "./Sidebar/Sidebar.vue.js";
16
+ import Ue from "./Content/Content.vue.js";
17
17
  import Ye from "../features/ApiClientModal/ApiClientModal.vue.js";
18
18
  import { useSidebar as ze } from "../hooks/useSidebar.js";
19
19
  import { useNavState as Ve } from "../hooks/useNavState.js";
20
- import { sleep as We } from "../helpers/sleep.js";
21
- const Ge = ["innerHTML"], Ke = { class: "references-header" }, je = ["aria-label"], Qe = { class: "references-navigation-list" }, qe = { class: "references-editor" }, Je = { class: "references-editor-textarea" }, Xe = ["aria-label"], Ze = {
20
+ import { sleep as Ge } from "../helpers/sleep.js";
21
+ const Ke = ["innerHTML"], We = { class: "references-header" }, je = ["aria-label"], Qe = { class: "references-navigation-list" }, qe = { class: "references-editor" }, Je = { class: "references-editor-textarea" }, Xe = ["aria-label"], Ze = {
22
22
  key: 0,
23
23
  class: "references-footer"
24
- }, vt = /* @__PURE__ */ se({
24
+ }, bt = /* @__PURE__ */ le({
25
25
  inheritAttrs: !1,
26
26
  __name: "ApiReferenceLayout",
27
27
  props: {
@@ -30,16 +30,18 @@ const Ge = ["innerHTML"], Ke = { class: "references-header" }, je = ["aria-label
30
30
  rawSpec: {}
31
31
  },
32
32
  emits: ["changeTheme", "updateContent", "loadSwaggerFile", "linkSwaggerFile", "toggleDarkMode"],
33
- setup(N) {
34
- const o = N, { initializeToasts: Y, toast: z } = Oe();
33
+ setup(U) {
34
+ const i = U, a = h(
35
+ () => ke.parse(i.configuration)
36
+ ), { initializeToasts: Y, toast: z } = Ae();
35
37
  Y((e) => z(e));
36
- const V = Ae("(min-width: 1150px)"), W = $("100dvh"), g = $(null);
37
- Be(g, (e) => {
38
- W.value = e[0].contentRect.height + "px";
38
+ const V = Le("(min-width: 1150px)"), G = R("100dvh"), S = R(null);
39
+ Pe(S, (e) => {
40
+ G.value = e[0].contentRect.height + "px";
39
41
  });
40
- const G = v(Ee), {
41
- breadcrumb: K,
42
- collapsedSidebarItems: h,
42
+ const K = h(Oe), {
43
+ breadcrumb: W,
44
+ collapsedSidebarItems: b,
43
45
  isSidebarOpen: j,
44
46
  setCollapsedSidebarItem: I,
45
47
  hideModels: Q,
@@ -48,159 +50,156 @@ const Ge = ["innerHTML"], Ke = { class: "references-header" }, je = ["aria-label
48
50
  scrollToOperation: X
49
51
  } = ze(), {
50
52
  getReferenceHash: Z,
51
- getPathRoutingId: O,
52
- getSectionId: _,
53
- getTagId: x,
54
- hash: ee,
55
- isIntersectionEnabled: k,
56
- pathRouting: C,
57
- updateHash: A,
58
- replaceUrlState: te
53
+ getPathRoutingId: k,
54
+ getSectionId: x,
55
+ getTagId: ee,
56
+ hash: te,
57
+ isIntersectionEnabled: A,
58
+ pathRouting: T,
59
+ updateHash: F,
60
+ replaceUrlState: ae
59
61
  } = Ve();
60
- if (o.configuration.pathRouting && (C.value = o.configuration.pathRouting), o.configuration.redirect && typeof window < "u") {
61
- const e = o.configuration.redirect(
62
- (C.value ? window.location.pathname : "") + window.location.hash
62
+ if (a.value.pathRouting && (T.value = a.value.pathRouting), i.configuration.redirect && typeof window < "u") {
63
+ const e = i.configuration.redirect(
64
+ (T.value ? window.location.pathname : "") + window.location.hash
63
65
  );
64
66
  e && history.replaceState({}, "", e);
65
67
  }
66
- M(() => A());
67
- const B = async (e) => {
68
+ H(() => F());
69
+ const L = async (e) => {
68
70
  var t;
69
- k.value = !1, A(), e ? X(e) : (t = g.value) == null || t.scrollTo(0, 0), await We(100), k.value = !0;
70
- }, F = $(0);
71
- M(() => $e()), le(() => {
72
- var r, a, n;
73
- history.scrollRestoration = "manual", U.on(({ specTitle: i }) => {
74
- De(o.rawSpec, i);
71
+ A.value = !1, F(), e ? X(e) : (t = S.value) == null || t.scrollTo(0, 0), await Ge(100), A.value = !0;
72
+ }, P = R(0);
73
+ H(() => Re()), de(() => {
74
+ var o, r, s;
75
+ history.scrollRestoration = "manual", N.on(({ specTitle: n }) => {
76
+ De(i.rawSpec, n);
75
77
  });
76
- const e = (a = (r = g.value) == null ? void 0 : r.parentElement) == null ? void 0 : a.getBoundingClientRect(), t = (n = g.value) == null ? void 0 : n.getBoundingClientRect();
78
+ const e = (r = (o = S.value) == null ? void 0 : o.parentElement) == null ? void 0 : r.getBoundingClientRect(), t = (s = S.value) == null ? void 0 : s.getBoundingClientRect();
77
79
  if (e && t) {
78
- const i = t.top - e.top;
79
- F.value = i < 2 ? 0 : i;
80
+ const n = t.top - e.top;
81
+ P.value = n < 2 ? 0 : n;
80
82
  }
81
83
  window.onhashchange = () => {
82
- B(Z());
83
- }, window.onpopstate = () => C.value && B(O(window.location.pathname));
84
+ L(Z());
85
+ }, window.onpopstate = () => T.value && L(k(window.location.pathname));
84
86
  });
85
- const oe = v(
86
- () => V.value || !o.configuration.isEditable
87
- ), L = Fe((e) => {
87
+ const oe = h(
88
+ () => V.value || !a.value.isEditable
89
+ ), M = Me((e) => {
88
90
  if ((e.target.scrollTop ?? 0) < 50) {
89
- const r = o.configuration.pathRouting ? o.configuration.pathRouting.basePath : window.location.pathname;
90
- te("", r + window.location.search);
91
+ const o = a.value.pathRouting ? a.value.pathRouting.basePath : window.location.pathname;
92
+ ae("", o + window.location.search);
91
93
  }
92
- }), l = v(() => ({
93
- breadcrumb: K.value,
94
- spec: o.parsedSpec
94
+ }), d = h(() => ({
95
+ breadcrumb: W.value,
96
+ spec: i.parsedSpec
95
97
  }));
96
- de(() => {
97
- U.reset();
98
- }), R(() => o.parsedSpec, J, { deep: !0 }), ce(() => {
99
- var t, r;
100
- const e = ue();
101
- if (e && (e.payload || (e.payload = { data: H() }), (t = e.payload).data || (t.data = H()), o.configuration.pathRouting)) {
102
- const a = O(e.url);
103
- ee.value = a, e.payload.data.hash = a;
104
- for (const n in h)
105
- Object.hasOwn(h, n) && delete h[n];
106
- if (a)
107
- I(_(a), !0);
98
+ ue(() => {
99
+ N.reset();
100
+ }), E(() => i.parsedSpec, J, { deep: !0 }), ce(() => {
101
+ var t, o;
102
+ const e = pe();
103
+ if (e && (e.payload || (e.payload = { data: D() }), (t = e.payload).data || (t.data = D()), a.value.pathRouting)) {
104
+ const r = k(e.url);
105
+ te.value = r, e.payload.data.hash = r;
106
+ for (const s in b)
107
+ Object.hasOwn(b, s) && delete b[s];
108
+ if (r)
109
+ I(x(r), !0);
108
110
  else {
109
- const n = (r = o.parsedSpec.tags) == null ? void 0 : r[0];
110
- n && I(x(n), !0);
111
+ const s = (o = i.parsedSpec.tags) == null ? void 0 : o[0];
112
+ s && I(ee(s), !0);
111
113
  }
112
- e.payload.data["useSidebarContent-collapsedSidebarItems"] = h;
114
+ e.payload.data["useSidebarContent-collapsedSidebarItems"] = b;
113
115
  }
114
- }), ve(() => {
115
- var a;
116
+ }), be(() => {
117
+ var r;
116
118
  const e = fe(), t = "scalar-instance-id";
117
119
  if (!e) return t;
118
- let r = e.uid;
119
- return typeof window > "u" ? (e.attrs || (e.attrs = {}), e.attrs[t] = r) : (a = e.vnode.el) != null && a.getAttribute && (r = e.vnode.el.getAttribute(t)), `${t}-${r}`;
120
+ let o = e.uid;
121
+ return typeof window > "u" ? (e.attrs || (e.attrs = {}), e.attrs[t] = o) : (r = e.vnode.el) != null && r.getAttribute && (o = e.vnode.el.getAttribute(t)), `${t}-${o}`;
120
122
  });
121
- const T = we({
122
- proxyUrl: o.configuration.proxyUrl || o.configuration.proxy,
123
- themeId: o.configuration.theme,
123
+ const $ = ye({
124
124
  useLocalStorage: !1,
125
- hideClientButton: o.configuration.hideClientButton,
126
- integration: o.configuration._integration
125
+ ...a.value
127
126
  });
128
- R(
129
- () => o.rawSpec,
127
+ E(
128
+ () => i.rawSpec,
130
129
  (e) => {
131
130
  var t;
132
- return e && T.importSpecFile(e, "default", {
131
+ return e && $.importSpecFile(e, "default", {
133
132
  shouldLoad: !1,
134
- documentUrl: (t = o.configuration.spec) == null ? void 0 : t.url,
133
+ documentUrl: (t = a.value.spec) == null ? void 0 : t.url,
135
134
  setCollectionSecurity: !0,
136
- ...o.configuration
135
+ ...a.value
137
136
  });
138
137
  },
139
138
  { immediate: !0 }
140
- ), b(ye, T);
141
- const re = Ce(T);
142
- b(Te, re), b(be, "modal"), b(Le, o.configuration ?? {});
143
- function P(e, t) {
144
- R(
145
- () => o.configuration[e],
146
- (r) => {
147
- typeof r < "u" && t(r);
139
+ ), w(Ce, $);
140
+ const re = Te($);
141
+ w($e, re), w(we, "modal"), w(He, a.value);
142
+ function B(e, t) {
143
+ E(
144
+ () => a.value[e],
145
+ (o) => {
146
+ typeof o < "u" && t(o);
148
147
  },
149
148
  { immediate: !0 }
150
149
  );
151
150
  }
152
- const { setExcludedClients: ae, setDefaultHttpClient: ne } = Pe();
153
- P("defaultHttpClient", ne), P("hiddenClients", ae), Q.value = o.configuration.hideModels ?? !1, q.value = o.configuration.defaultOpenAllTags ?? !1, He(o.configuration);
154
- const ie = v(
151
+ const { setExcludedClients: se, setDefaultHttpClient: ne } = _e();
152
+ B("defaultHttpClient", ne), B("hiddenClients", se), Q.value = a.value.hideModels ?? !1, q.value = a.value.defaultOpenAllTags ?? !1;
153
+ const ie = h(
155
154
  () => `<style>
156
- ${Ie(o.configuration.theme, {
157
- fonts: o.configuration.withDefaultFonts
155
+ ${Ie(a.value.theme, {
156
+ fonts: a.value.withDefaultFonts
158
157
  })}</style>`
159
158
  );
160
159
  return (e, t) => {
161
- var r, a, n;
162
- return w(), y(D, null, [
163
- d("div", { innerHTML: ie.value }, null, 8, Ge),
164
- d("div", {
160
+ var o, r, s;
161
+ return y(), C(_, null, [
162
+ u("div", { innerHTML: ie.value }, null, 8, Ke),
163
+ u("div", {
165
164
  ref_key: "documentEl",
166
- ref: g,
167
- class: pe(["scalar-app scalar-api-reference references-layout", [
165
+ ref: S,
166
+ class: me(["scalar-app scalar-api-reference references-layout", [
168
167
  {
169
- "scalar-scrollbars-obtrusive": G.value,
170
- "references-editable": e.configuration.isEditable,
171
- "references-sidebar": e.configuration.showSidebar,
172
- "references-sidebar-mobile-open": s(j),
173
- "references-classic": e.configuration.layout === "classic"
168
+ "scalar-scrollbars-obtrusive": K.value,
169
+ "references-editable": a.value.isEditable,
170
+ "references-sidebar": a.value.showSidebar,
171
+ "references-sidebar-mobile-open": l(j),
172
+ "references-classic": a.value.layout === "classic"
174
173
  },
175
174
  e.$attrs.class
176
175
  ]]),
177
- style: me({
178
- "--scalar-y-offset": `var(--scalar-custom-header-height, ${F.value}px)`
176
+ style: ve({
177
+ "--scalar-y-offset": `var(--scalar-custom-header-height, ${P.value}px)`
179
178
  }),
180
179
  onScrollPassive: t[4] || (t[4] = //@ts-ignore
181
- (...i) => s(L) && s(L)(...i))
180
+ (...n) => l(M) && l(M)(...n))
182
181
  }, [
183
- d("div", Ke, [
184
- c(e.$slots, "header", u(f(l.value)), void 0, !0)
182
+ u("div", We, [
183
+ c(e.$slots, "header", p(f(d.value)), void 0, !0)
185
184
  ]),
186
- e.configuration.showSidebar ? (w(), y("aside", {
185
+ a.value.showSidebar ? (y(), C("aside", {
187
186
  key: 0,
188
- "aria-label": `Sidebar for ${(r = e.parsedSpec.info) == null ? void 0 : r.title}`,
187
+ "aria-label": `Sidebar for ${(o = e.parsedSpec.info) == null ? void 0 : o.title}`,
189
188
  class: "references-navigation t-doc__sidebar"
190
189
  }, [
191
- d("div", Qe, [
192
- p(s(Re), null, {
193
- default: m(() => [
194
- p(s(Ue), {
195
- operationsSorter: e.configuration.operationsSorter,
190
+ u("div", Qe, [
191
+ m(l(Ee), null, {
192
+ default: v(() => [
193
+ m(l(Ne), {
194
+ operationsSorter: a.value.operationsSorter,
196
195
  parsedSpec: e.parsedSpec,
197
- tagsSorter: e.configuration.tagsSorter
196
+ tagsSorter: a.value.tagsSorter
198
197
  }, {
199
- "sidebar-start": m(() => [
200
- c(e.$slots, "sidebar-start", u(f(l.value)), void 0, !0)
198
+ "sidebar-start": v(() => [
199
+ c(e.$slots, "sidebar-start", p(f(d.value)), void 0, !0)
201
200
  ]),
202
- "sidebar-end": m(() => [
203
- c(e.$slots, "sidebar-end", u(f(l.value)), void 0, !0)
201
+ "sidebar-end": v(() => [
202
+ c(e.$slots, "sidebar-end", p(f(d.value)), void 0, !0)
204
203
  ]),
205
204
  _: 3
206
205
  }, 8, ["operationsSorter", "parsedSpec", "tagsSorter"])
@@ -208,42 +207,42 @@ const Ge = ["innerHTML"], Ke = { class: "references-header" }, je = ["aria-label
208
207
  _: 3
209
208
  })
210
209
  ])
211
- ], 8, je)) : E("", !0),
212
- ge(d("div", qe, [
213
- d("div", Je, [
214
- c(e.$slots, "editor", u(f(l.value)), void 0, !0)
210
+ ], 8, je)) : O("", !0),
211
+ Se(u("div", qe, [
212
+ u("div", Je, [
213
+ c(e.$slots, "editor", p(f(d.value)), void 0, !0)
215
214
  ])
216
215
  ], 512), [
217
- [Se, e.configuration.isEditable]
216
+ [ge, a.value.isEditable]
218
217
  ]),
219
- oe.value ? (w(), y(D, { key: 1 }, [
220
- d("main", {
221
- "aria-label": `Open API Documentation for ${(a = e.parsedSpec.info) == null ? void 0 : a.title}`,
218
+ oe.value ? (y(), C(_, { key: 1 }, [
219
+ u("main", {
220
+ "aria-label": `Open API Documentation for ${(r = e.parsedSpec.info) == null ? void 0 : r.title}`,
222
221
  class: "references-rendered"
223
222
  }, [
224
- p(s(Ne), {
225
- layout: e.configuration.layout,
223
+ m(l(Ue), {
224
+ layout: a.value.layout,
226
225
  parsedSpec: e.parsedSpec
227
226
  }, he({
228
- start: m(() => [
229
- c(e.$slots, "content-start", u(f(l.value)), void 0, !0)
227
+ start: v(() => [
228
+ c(e.$slots, "content-start", p(f(d.value)), void 0, !0)
230
229
  ]),
231
- end: m(() => [
232
- c(e.$slots, "content-end", u(f(l.value)), void 0, !0)
230
+ end: v(() => [
231
+ c(e.$slots, "content-end", p(f(d.value)), void 0, !0)
233
232
  ]),
234
233
  _: 2
235
234
  }, [
236
- (n = e.configuration) != null && n.isEditable ? {
235
+ (s = a.value) != null && s.isEditable ? {
237
236
  name: "empty-state",
238
- fn: m(() => {
239
- var i;
237
+ fn: v(() => {
238
+ var n;
240
239
  return [
241
- p(Me, {
242
- theme: ((i = e.configuration) == null ? void 0 : i.theme) || "default",
243
- onChangeTheme: t[0] || (t[0] = (S) => e.$emit("changeTheme", S)),
244
- onLinkSwaggerFile: t[1] || (t[1] = (S) => e.$emit("linkSwaggerFile")),
245
- onLoadSwaggerFile: t[2] || (t[2] = (S) => e.$emit("loadSwaggerFile")),
246
- onUpdateContent: t[3] || (t[3] = (S) => e.$emit("updateContent", S))
240
+ m(Be, {
241
+ theme: ((n = a.value) == null ? void 0 : n.theme) || "default",
242
+ onChangeTheme: t[0] || (t[0] = (g) => e.$emit("changeTheme", g)),
243
+ onLinkSwaggerFile: t[1] || (t[1] = (g) => e.$emit("linkSwaggerFile")),
244
+ onLoadSwaggerFile: t[2] || (t[2] = (g) => e.$emit("loadSwaggerFile")),
245
+ onUpdateContent: t[3] || (t[3] = (g) => e.$emit("updateContent", g))
247
246
  }, null, 8, ["theme"])
248
247
  ];
249
248
  }),
@@ -251,17 +250,17 @@ const Ge = ["innerHTML"], Ke = { class: "references-header" }, je = ["aria-label
251
250
  } : void 0
252
251
  ]), 1032, ["layout", "parsedSpec"])
253
252
  ], 8, Xe),
254
- e.$slots.footer ? (w(), y("div", Ze, [
255
- c(e.$slots, "footer", u(f(l.value)), void 0, !0)
256
- ])) : E("", !0)
257
- ], 64)) : E("", !0),
258
- p(s(Ye), { configuration: e.configuration }, null, 8, ["configuration"])
253
+ e.$slots.footer ? (y(), C("div", Ze, [
254
+ c(e.$slots, "footer", p(f(d.value)), void 0, !0)
255
+ ])) : O("", !0)
256
+ ], 64)) : O("", !0),
257
+ m(l(Ye), { configuration: a.value }, null, 8, ["configuration"])
259
258
  ], 38),
260
- p(s(ke))
259
+ m(l(Fe))
261
260
  ], 64);
262
261
  };
263
262
  }
264
263
  });
265
264
  export {
266
- vt as default
265
+ bt as default
267
266
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ClientLibraries.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/ClientLibraries/ClientLibraries.vue"],"names":[],"mappings":";AAiIA,wBAKG"}
1
+ {"version":3,"file":"ClientLibraries.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Content/ClientLibraries/ClientLibraries.vue"],"names":[],"mappings":";AAwRA,wBAKG"}
@@ -1,7 +1,7 @@
1
1
  import o from "./ClientLibraries.vue2.js";
2
2
  /* empty css */
3
3
  import r from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const e = /* @__PURE__ */ r(o, [["__scopeId", "data-v-35fd541a"]]);
4
+ const e = /* @__PURE__ */ r(o, [["__scopeId", "data-v-b367b3f5"]]);
5
5
  export {
6
6
  e as default
7
7
  };