@scalar/api-reference 1.31.3 → 1.31.6

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 (166) hide show
  1. package/CHANGELOG.md +55 -0
  2. package/dist/browser/standalone.js +15752 -15637
  3. package/dist/browser/webpack-stats.json +1 -1
  4. package/dist/components/ApiReference.vue.js +6 -6
  5. package/dist/components/ApiReferenceLayout.vue.d.ts +6 -3
  6. package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
  7. package/dist/components/ApiReferenceLayout.vue.js +4 -2
  8. package/dist/components/ApiReferenceLayout.vue2.js +230 -153
  9. package/dist/components/Content/ClientLibraries/ClientLibraries.vue.js +2 -2
  10. package/dist/components/Content/ClientLibraries/ClientLibraries.vue2.js +1 -1
  11. package/dist/components/Content/Introduction/Description.vue.d.ts.map +1 -1
  12. package/dist/components/Content/Introduction/Description.vue.js +2 -2
  13. package/dist/components/Content/Lazy/Loading.vue.d.ts.map +1 -1
  14. package/dist/components/Content/Lazy/Loading.vue.js +1 -1
  15. package/dist/components/Content/Schema/SchemaComposition.vue.d.ts.map +1 -1
  16. package/dist/components/Content/Schema/SchemaComposition.vue.js +81 -101
  17. package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
  18. package/dist/components/Content/Schema/SchemaProperty.vue.js +2 -2
  19. package/dist/components/Content/Schema/SchemaProperty.vue2.js +114 -105
  20. package/dist/components/Content/Schema/helpers/merge-all-of-schemas.js +35 -35
  21. package/dist/components/Content/Schema/helpers/optimizeValueForDisplay.d.ts.map +1 -1
  22. package/dist/components/Content/Schema/helpers/optimizeValueForDisplay.js +17 -15
  23. package/dist/components/Content/Schema/helpers/schema-name.js +13 -21
  24. package/dist/components/Content/Tag/OperationsList.vue.d.ts.map +1 -1
  25. package/dist/components/Content/Tag/OperationsList.vue.js +1 -1
  26. package/dist/components/Content/Tag/OperationsList.vue2.js +10 -9
  27. package/dist/components/Content/Tag/OperationsListItem.vue.d.ts.map +1 -1
  28. package/dist/components/Content/Tag/OperationsListItem.vue.js +1 -1
  29. package/dist/components/Content/Tag/OperationsListItem.vue2.js +29 -28
  30. package/dist/components/Content/Tag/TagList.vue.d.ts.map +1 -1
  31. package/dist/components/Content/Tag/TagList.vue.js +35 -34
  32. package/dist/components/DocumentSelector/DocumentSelector.vue.d.ts.map +1 -1
  33. package/dist/components/DocumentSelector/DocumentSelector.vue.js +21 -28
  34. package/dist/components/GettingStarted.vue.d.ts.map +1 -1
  35. package/dist/components/GettingStarted.vue.js +3 -3
  36. package/dist/components/GettingStarted.vue2.js +23 -23
  37. package/dist/components/HttpMethod/HttpMethod.vue.d.ts +1 -20
  38. package/dist/components/HttpMethod/HttpMethod.vue.d.ts.map +1 -1
  39. package/dist/components/HttpMethod/HttpMethod.vue.js +12 -13
  40. package/dist/components/Section/CompactSection.vue.js +2 -2
  41. package/dist/components/Section/CompactSection.vue2.js +6 -6
  42. package/dist/components/Sidebar/Sidebar.vue.d.ts.map +1 -1
  43. package/dist/components/Sidebar/Sidebar.vue.js +2 -2
  44. package/dist/components/Sidebar/Sidebar.vue2.js +1 -1
  45. package/dist/components/Sidebar/SidebarElement.vue.js +1 -1
  46. package/dist/components/Sidebar/SidebarElement.vue2.js +5 -5
  47. package/dist/esm.d.ts.map +1 -1
  48. package/dist/features/DocumentSource/hooks/useDocumentFetcher.js +1 -1
  49. package/dist/features/DocumentSource/hooks/useDocumentSource.d.ts +1 -1
  50. package/dist/features/DocumentSource/hooks/useDocumentSource.d.ts.map +1 -1
  51. package/dist/features/DocumentSource/hooks/useDocumentSource.js +11 -11
  52. package/dist/features/DownloadLink/DownloadLink.vue.d.ts.map +1 -1
  53. package/dist/features/DownloadLink/DownloadLink.vue.js +2 -2
  54. package/dist/features/DownloadLink/DownloadLink.vue2.js +21 -21
  55. package/dist/features/ExampleRequest/ExampleRequest.vue.d.ts.map +1 -1
  56. package/dist/features/ExampleRequest/ExampleRequest.vue.js +1 -1
  57. package/dist/features/ExampleRequest/ExampleRequest.vue2.js +1 -1
  58. package/dist/features/Search/SearchButton.vue.d.ts.map +1 -1
  59. package/dist/features/Search/SearchButton.vue.js +2 -2
  60. package/dist/features/Search/SearchButton.vue2.js +16 -16
  61. package/dist/features/Search/SearchModal.vue.d.ts.map +1 -1
  62. package/dist/features/Search/SearchModal.vue.js +2 -2
  63. package/dist/features/Search/SearchModal.vue2.js +1 -1
  64. package/dist/features/Search/useSearchIndex.d.ts.map +1 -1
  65. package/dist/features/Search/useSearchIndex.js +29 -28
  66. package/dist/features/sidebar/helpers/create-sidebar.d.ts +26 -0
  67. package/dist/features/sidebar/helpers/create-sidebar.d.ts.map +1 -0
  68. package/dist/features/sidebar/hooks/useSidebar.d.ts +23 -0
  69. package/dist/features/sidebar/hooks/useSidebar.d.ts.map +1 -0
  70. package/dist/features/sidebar/index.d.ts +2 -0
  71. package/dist/features/sidebar/index.d.ts.map +1 -0
  72. package/dist/features/traverse-schema/helpers/get-tag.d.ts +4 -0
  73. package/dist/features/traverse-schema/helpers/get-tag.d.ts.map +1 -0
  74. package/dist/features/traverse-schema/helpers/operation-id-params.d.ts +8 -0
  75. package/dist/features/traverse-schema/helpers/operation-id-params.d.ts.map +1 -0
  76. package/dist/features/traverse-schema/helpers/operation-id-params.js +8 -0
  77. package/dist/features/traverse-schema/helpers/traverse-description.d.ts +9 -0
  78. package/dist/features/traverse-schema/helpers/traverse-description.d.ts.map +1 -0
  79. package/dist/features/traverse-schema/helpers/traverse-document.d.ts +16 -0
  80. package/dist/features/traverse-schema/helpers/traverse-document.d.ts.map +1 -0
  81. package/dist/features/traverse-schema/helpers/traverse-paths.d.ts +11 -0
  82. package/dist/features/traverse-schema/helpers/traverse-paths.d.ts.map +1 -0
  83. package/dist/features/traverse-schema/helpers/traverse-schemas.d.ts +6 -0
  84. package/dist/features/traverse-schema/helpers/traverse-schemas.d.ts.map +1 -0
  85. package/dist/features/traverse-schema/helpers/traverse-tags.d.ts +9 -0
  86. package/dist/features/traverse-schema/helpers/traverse-tags.d.ts.map +1 -0
  87. package/dist/features/traverse-schema/helpers/traverse-webhooks.d.ts +6 -0
  88. package/dist/features/traverse-schema/helpers/traverse-webhooks.d.ts.map +1 -0
  89. package/dist/features/traverse-schema/index.d.ts +4 -0
  90. package/dist/features/traverse-schema/index.d.ts.map +1 -0
  91. package/dist/features/traverse-schema/types.d.ts +51 -0
  92. package/dist/features/traverse-schema/types.d.ts.map +1 -0
  93. package/dist/helpers/parse.d.ts.map +1 -1
  94. package/dist/helpers/parse.js +16 -16
  95. package/dist/hooks/useNavState.d.ts +9 -4
  96. package/dist/hooks/useNavState.d.ts.map +1 -1
  97. package/dist/hooks/useNavState.js +31 -29
  98. package/dist/hooks/useSidebar.d.ts.map +1 -1
  99. package/dist/hooks/useSidebar.js +69 -68
  100. package/dist/index.d.ts +0 -3
  101. package/dist/index.d.ts.map +1 -1
  102. package/dist/index.js +37 -44
  103. package/dist/legacy/fixtures/httpRequestMethods.js +2 -6
  104. package/dist/libs/openapi.js +32 -32
  105. package/dist/stores/useHttpClientStore.js +9 -8
  106. package/dist/style.css +1 -1
  107. package/dist/types.d.ts +0 -1
  108. package/dist/types.d.ts.map +1 -1
  109. package/dist/v2/ApiReferenceWorkspace.vue.d.ts +40 -0
  110. package/dist/v2/ApiReferenceWorkspace.vue.d.ts.map +1 -0
  111. package/dist/v2/ApiReferenceWorkspace.vue.js +65 -0
  112. package/dist/v2/ApiReferenceWorkspace.vue3.js +5 -0
  113. package/dist/v2/events/definitions.d.ts +35 -0
  114. package/dist/v2/events/definitions.d.ts.map +1 -0
  115. package/dist/v2/events/index.d.ts +3 -0
  116. package/dist/v2/events/index.d.ts.map +1 -0
  117. package/dist/v2/events/listeners.d.ts +8 -0
  118. package/dist/v2/events/listeners.d.ts.map +1 -0
  119. package/dist/v2/events/listeners.js +15 -0
  120. package/dist/v2/styles.d.ts +2 -0
  121. package/dist/v2/styles.d.ts.map +1 -0
  122. package/package.json +13 -11
  123. package/dist/components/HttpMethod/constants.d.ts +0 -9
  124. package/dist/components/HttpMethod/constants.d.ts.map +0 -1
  125. package/dist/components/HttpMethod/constants.js +0 -36
  126. package/dist/components/HttpMethod/utils/isRequestMethod.d.ts +0 -4
  127. package/dist/components/HttpMethod/utils/isRequestMethod.d.ts.map +0 -1
  128. package/dist/components/HttpMethod/utils/isRequestMethod.js +0 -7
  129. package/dist/components/Layouts/ClassicLayout.vue.d.ts +0 -23
  130. package/dist/components/Layouts/ClassicLayout.vue.d.ts.map +0 -1
  131. package/dist/components/Layouts/ClassicLayout.vue.js +0 -67
  132. package/dist/components/Layouts/ClassicLayout.vue2.js +0 -4
  133. package/dist/components/Layouts/Layouts.vue.d.ts +0 -26
  134. package/dist/components/Layouts/Layouts.vue.d.ts.map +0 -1
  135. package/dist/components/Layouts/Layouts.vue.js +0 -35
  136. package/dist/components/Layouts/Layouts.vue2.js +0 -4
  137. package/dist/components/Layouts/ModernLayout.vue.d.ts +0 -23
  138. package/dist/components/Layouts/ModernLayout.vue.d.ts.map +0 -1
  139. package/dist/components/Layouts/ModernLayout.vue.js +0 -8
  140. package/dist/components/Layouts/ModernLayout.vue2.js +0 -102
  141. package/dist/components/Layouts/index.d.ts +0 -2
  142. package/dist/components/Layouts/index.d.ts.map +0 -1
  143. package/dist/components/SingleApiReference.vue.d.ts +0 -29
  144. package/dist/components/SingleApiReference.vue.d.ts.map +0 -1
  145. package/dist/components/SingleApiReference.vue.js +0 -57
  146. package/dist/components/SingleApiReference.vue3.js +0 -5
  147. package/dist/helpers/freeze-element.d.ts +0 -11
  148. package/dist/helpers/freeze-element.d.ts.map +0 -1
  149. package/dist/helpers/freeze-element.js +0 -20
  150. package/dist/helpers/is-mac-os.d.ts +0 -5
  151. package/dist/helpers/is-mac-os.d.ts.map +0 -1
  152. package/dist/helpers/is-mac-os.js +0 -4
  153. package/dist/helpers/measure.d.ts +0 -21
  154. package/dist/helpers/measure.d.ts.map +0 -1
  155. package/dist/helpers/measure.js +0 -7
  156. package/dist/helpers/scroll-to-id.d.ts +0 -7
  157. package/dist/helpers/scroll-to-id.d.ts.map +0 -1
  158. package/dist/helpers/scroll-to-id.js +0 -21
  159. package/dist/helpers/sleep.d.ts +0 -6
  160. package/dist/helpers/sleep.d.ts.map +0 -1
  161. package/dist/helpers/sleep.js +0 -4
  162. package/dist/legacy/helpers/index.d.ts +0 -2
  163. package/dist/legacy/helpers/index.d.ts.map +0 -1
  164. package/dist/legacy/helpers/normalizeRequestMethod.d.ts +0 -6
  165. package/dist/legacy/helpers/normalizeRequestMethod.d.ts.map +0 -1
  166. package/dist/legacy/helpers/normalizeRequestMethod.js +0 -10
@@ -1,102 +0,0 @@
1
- import { defineComponent as B, useSlots as D, watch as m, computed as w, createBlock as u, openBlock as t, normalizeClass as $, createSlots as M, withCtx as n, createVNode as f, unref as i, createCommentVNode as d, createElementBlock as p, renderSlot as c, normalizeProps as g, guardReactiveProps as S, isRef as V, renderList as K } from "vue";
2
- import { OpenApiClientButton as H } from "@scalar/api-client/components";
3
- import { ScalarSidebarFooter as L, ScalarColorModeToggleButton as N } from "@scalar/components";
4
- import { getObjectKeys as O } from "@scalar/oas-utils/helpers";
5
- import { useBreakpoints as R } from "@scalar/use-hooks/useBreakpoints";
6
- import U from "../ApiReferenceLayout.vue.js";
7
- import z from "../MobileHeader.vue.js";
8
- import { useNavState as A } from "../../hooks/useNavState.js";
9
- import { useSidebar as T } from "../../hooks/useSidebar.js";
10
- import j from "../../features/Search/SearchButton.vue.js";
11
- const E = { key: 0 }, F = {
12
- key: 1,
13
- class: "scalar-api-references-standalone-search"
14
- }, P = { key: 1 }, x = /* @__PURE__ */ B({
15
- __name: "ModernLayout",
16
- props: {
17
- configuration: {},
18
- dereferencedDocument: {},
19
- originalDocument: {},
20
- isDark: { type: Boolean },
21
- parsedSpec: {},
22
- rawSpec: {}
23
- },
24
- emits: ["toggleDarkMode", "updateContent"],
25
- setup(k) {
26
- const s = k, h = D(), { mediaQueries: b } = R(), { isSidebarOpen: a } = T(), v = !1;
27
- m(b.lg, (e, o) => {
28
- o && !e && (a.value = !1);
29
- });
30
- const { hash: y } = A();
31
- m(y, (e, o) => {
32
- e && e !== o && (a.value = !1);
33
- });
34
- const C = w(
35
- () => O(h).filter((e) => e !== "sidebar-start")
36
- );
37
- return (e, o) => (t(), u(U, {
38
- class: $({
39
- "scalar-api-references-standalone-mobile": e.configuration.showSidebar ?? !0
40
- }),
41
- configuration: e.configuration,
42
- parsedSpec: e.parsedSpec,
43
- rawSpec: e.rawSpec,
44
- onUpdateContent: o[2] || (o[2] = (r) => e.$emit("updateContent", r))
45
- }, M({
46
- header: n(() => [
47
- e.configuration.showSidebar ?? !0 ? (t(), u(z, {
48
- key: 0,
49
- open: i(a),
50
- "onUpdate:open": o[0] || (o[0] = (r) => V(a) ? a.value = r : null)
51
- }, null, 8, ["open"])) : d("", !0)
52
- ]),
53
- "sidebar-start": n((r) => {
54
- var l;
55
- return [
56
- e.$slots["document-selector"] ? (t(), p("div", E, [
57
- c(e.$slots, "document-selector", {}, void 0, !0)
58
- ])) : d("", !0),
59
- s.configuration.hideSearch ? d("", !0) : (t(), p("div", F, [
60
- f(i(j), {
61
- searchHotKey: (l = s.configuration) == null ? void 0 : l.searchHotKey,
62
- spec: r.spec
63
- }, null, 8, ["searchHotKey", "spec"])
64
- ])),
65
- c(e.$slots, "sidebar-start", g(S(r)), void 0, !0)
66
- ];
67
- }),
68
- "sidebar-end": n(() => [
69
- f(i(L), { class: "darklight-reference" }, {
70
- toggle: n(() => [
71
- s.configuration.hideDarkModeToggle ? (t(), p("span", P)) : (t(), u(i(N), {
72
- key: 0,
73
- modelValue: e.isDark,
74
- "onUpdate:modelValue": o[1] || (o[1] = (r) => e.$emit("toggleDarkMode"))
75
- }, null, 8, ["modelValue"]))
76
- ]),
77
- default: n(() => [
78
- s.configuration.hideClientButton ? d("", !0) : (t(), u(i(H), {
79
- key: 0,
80
- buttonSource: "sidebar",
81
- integration: e.configuration._integration,
82
- isDevelopment: v,
83
- url: e.configuration.url
84
- }, null, 8, ["integration", "url"]))
85
- ]),
86
- _: 1
87
- })
88
- ]),
89
- _: 2
90
- }, [
91
- K(C.value, (r) => ({
92
- name: r,
93
- fn: n((l) => [
94
- c(e.$slots, r, g(S(l || {})), void 0, !0)
95
- ])
96
- }))
97
- ]), 1032, ["class", "configuration", "parsedSpec", "rawSpec"]));
98
- }
99
- });
100
- export {
101
- x as default
102
- };
@@ -1,2 +0,0 @@
1
- export { default as Layouts } from './Layouts.vue.js';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Layouts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,eAAe,CAAA"}
@@ -1,29 +0,0 @@
1
- import type { ApiReferenceConfiguration } from '@scalar/types/api-reference';
2
- type __VLS_Props = {
3
- configuration: Partial<ApiReferenceConfiguration>;
4
- };
5
- declare function __VLS_template(): {
6
- attrs: Partial<{}>;
7
- slots: {
8
- footer?(_: {}): any;
9
- footer?(_: {}): any;
10
- "document-selector"?(_: {}): any;
11
- "sidebar-start"?(_: {}): any;
12
- };
13
- refs: {};
14
- rootEl: any;
15
- };
16
- type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
17
- declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
18
- updateContent: (value: string) => any;
19
- }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
20
- onUpdateContent?: ((value: string) => any) | undefined;
21
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
22
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
23
- export default _default;
24
- type __VLS_WithTemplateSlots<T, S> = T & {
25
- new (): {
26
- $slots: S;
27
- };
28
- };
29
- //# sourceMappingURL=SingleApiReference.vue.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SingleApiReference.vue.d.ts","sourceRoot":"","sources":["../../src/components/SingleApiReference.vue"],"names":[],"mappings":"AAsEA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAA;AAU5E,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,OAAO,CAAC,yBAAyB,CAAC,CAAA;CAClD,CAAC;AAoCF,iBAAS,cAAc;WAuGT,OAAO,IAA6B;;wBAXrB,GAAG;wBACH,GAAG;qCACU,GAAG;iCACP,GAAG;;;;EAaxC;AAYD,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,57 +0,0 @@
1
- import { defineComponent as c, watch as l, computed as g, createElementBlock as C, openBlock as f, Fragment as k, createBlock as M, createCommentVNode as D, createVNode as p, resolveDynamicComponent as v, withCtx as t, createTextVNode as $, toDisplayString as S, unref as i, renderSlot as r } from "vue";
2
- import { useColorMode as y } from "@scalar/use-hooks/useColorMode";
3
- import { useSeoMeta as B } from "@unhead/vue";
4
- import { useFavicon as N } from "@vueuse/core";
5
- import V from "./Layouts/Layouts.vue.js";
6
- const E = /* @__PURE__ */ c({
7
- __name: "SingleApiReference",
8
- props: {
9
- configuration: {}
10
- },
11
- emits: ["updateContent"],
12
- setup(e) {
13
- const { toggleColorMode: u, isDarkMode: a } = y({
14
- initialColorMode: e.configuration.darkMode ? "dark" : void 0,
15
- overrideColorMode: e.configuration.forceDarkModeState
16
- });
17
- l(
18
- () => e.configuration.darkMode,
19
- (o) => a.value = !!o
20
- ), e.configuration.metaData && B(e.configuration.metaData);
21
- const d = g(() => e.configuration.favicon);
22
- return N(d), (o, n) => {
23
- var s;
24
- return f(), C(k, null, [
25
- (s = o.configuration) != null && s.customCss ? (f(), M(v("style"), { key: 0 }, {
26
- default: t(() => [
27
- $(S(o.configuration.customCss), 1)
28
- ]),
29
- _: 1
30
- })) : D("", !0),
31
- p(i(V), {
32
- configuration: o.configuration,
33
- isDark: i(a),
34
- onToggleDarkMode: n[0] || (n[0] = () => i(u)()),
35
- onUpdateContent: n[1] || (n[1] = (m) => o.$emit("updateContent", m))
36
- }, {
37
- footer: t(() => [
38
- r(o.$slots, "footer")
39
- ]),
40
- "content-end": t(() => [
41
- r(o.$slots, "footer")
42
- ]),
43
- "document-selector": t(() => [
44
- r(o.$slots, "document-selector")
45
- ]),
46
- "sidebar-start": t(() => [
47
- r(o.$slots, "sidebar-start")
48
- ]),
49
- _: 3
50
- }, 8, ["configuration", "isDark"])
51
- ], 64);
52
- };
53
- }
54
- });
55
- export {
56
- E as default
57
- };
@@ -1,5 +0,0 @@
1
- import o from "./SingleApiReference.vue.js";
2
- /* empty css */
3
- export {
4
- o as default
5
- };
@@ -1,11 +0,0 @@
1
- /**
2
- * Scroll Freezing Utility
3
- * "Freezes" the scroll position of an element, so that it doesn't move when the rest of the content changes
4
- *
5
- * @example
6
- * const unfreeze = freezeElement(document.querySelector('#your-element'))
7
- * ... content changes ...
8
- * unfreeze()
9
- */
10
- export declare const freezeElement: (element: HTMLElement) => () => void;
11
- //# sourceMappingURL=freeze-element.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"freeze-element.d.ts","sourceRoot":"","sources":["../../src/helpers/freeze-element.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,eAAO,MAAM,aAAa,YAAa,WAAW,eAiCjD,CAAA"}
@@ -1,20 +0,0 @@
1
- const s = (t) => {
2
- if (!t)
3
- return () => null;
4
- const e = t.getBoundingClientRect().top, r = new MutationObserver(() => {
5
- const n = t.getBoundingClientRect().top;
6
- if (n !== e) {
7
- const o = n - e;
8
- window.scrollBy(0, o);
9
- }
10
- });
11
- return r.observe(document.body, {
12
- childList: !0,
13
- subtree: !0,
14
- attributes: !0,
15
- characterData: !0
16
- }), () => r.disconnect();
17
- };
18
- export {
19
- s as freezeElement
20
- };
@@ -1,5 +0,0 @@
1
- /**
2
- * Checks whether the user is on macOS
3
- */
4
- export declare const isMacOs: () => boolean;
5
- //# sourceMappingURL=is-mac-os.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"is-mac-os.d.ts","sourceRoot":"","sources":["../../src/helpers/is-mac-os.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,OAAO,eAAoF,CAAA"}
@@ -1,4 +0,0 @@
1
- const a = () => typeof navigator < "u" ? /Mac/.test(navigator.platform) : !1;
2
- export {
3
- a as isMacOs
4
- };
@@ -1,21 +0,0 @@
1
- /**
2
- * Measures the execution time of a function and logs it.
3
- * Works with both async and sync functions.
4
- * Returns the result of the measured function.
5
- *
6
- * @example
7
- * ```ts
8
- * // Async function
9
- * const result = await measure('api-call', async () => {
10
- * return await fetchData()
11
- * })
12
- *
13
- * // Sync function
14
- * const result = measure('computation', () => {
15
- * return heavyComputation()
16
- * })
17
- * ```
18
- */
19
- export declare function measure<T>(name: string, fn: () => Promise<T>): Promise<T>;
20
- export declare function measure<T>(name: string, fn: () => T): T;
21
- //# sourceMappingURL=measure.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"measure.d.ts","sourceRoot":"","sources":["../../src/helpers/measure.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAA;AAC1E,wBAAgB,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAAA"}
@@ -1,7 +0,0 @@
1
- function c(n, o) {
2
- const r = performance.now(), t = o(), e = performance.now(), s = Math.round(e - r);
3
- return console.info(`${n}: ${s} ms`), t;
4
- }
5
- export {
6
- c as measure
7
- };
@@ -1,7 +0,0 @@
1
- /**
2
- * Tiny wrapper around the scrollIntoView API
3
- *
4
- * Also focuses the element if the focus flag is true
5
- */
6
- export declare const scrollToId: (id: string, focus?: boolean) => Promise<void>;
7
- //# sourceMappingURL=scroll-to-id.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"scroll-to-id.d.ts","sourceRoot":"","sources":["../../src/helpers/scroll-to-id.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,UAAU,OAAc,MAAM,UAAU,OAAO,kBAkC3D,CAAA"}
@@ -1,21 +0,0 @@
1
- const l = async (t, r) => {
2
- const n = (e) => {
3
- e.scrollIntoView(), r && e.focus();
4
- }, o = document.getElementById(t);
5
- if (o) {
6
- n(o);
7
- return;
8
- }
9
- const s = Date.now() + 1e3, c = () => {
10
- const e = document.getElementById(t);
11
- if (e) {
12
- n(e);
13
- return;
14
- }
15
- Date.now() < s && requestAnimationFrame(c);
16
- };
17
- requestAnimationFrame(c);
18
- };
19
- export {
20
- l as scrollToId
21
- };
@@ -1,6 +0,0 @@
1
- /**
2
- * Little helper for sleeping for x milliseconds
3
- * an async await friendly setTimeout
4
- */
5
- export declare const sleep: (ms: number) => Promise<unknown>;
6
- //# sourceMappingURL=sleep.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sleep.d.ts","sourceRoot":"","sources":["../../src/helpers/sleep.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,KAAK,OAAQ,MAAM,qBAA0C,CAAA"}
@@ -1,4 +0,0 @@
1
- const s = (e) => new Promise((o) => setTimeout(o, e));
2
- export {
3
- s as sleep
4
- };
@@ -1,2 +0,0 @@
1
- export { normalizeRequestMethod } from './normalizeRequestMethod.js';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/legacy/helpers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA"}
@@ -1,6 +0,0 @@
1
- import type { RequestMethod } from '@scalar/oas-utils/entities/spec';
2
- /**
3
- * Get a normalized request method (e.g. GET, POST, etc.)
4
- */
5
- export declare const normalizeRequestMethod: (method?: string) => RequestMethod;
6
- //# sourceMappingURL=normalizeRequestMethod.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"normalizeRequestMethod.d.ts","sourceRoot":"","sources":["../../../src/legacy/helpers/normalizeRequestMethod.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAA;AAMpE;;GAEG;AACH,eAAO,MAAM,sBAAsB,YAAa,MAAM,KAAG,aAkBxD,CAAA"}
@@ -1,10 +0,0 @@
1
- import { isRequestMethod as s } from "../fixtures/httpRequestMethods.js";
2
- const e = "get", r = (t) => {
3
- if (typeof t != "string")
4
- return console.warn(`Request method is not a string. Using ${e} as the default.`), e;
5
- const o = t.trim().toUpperCase();
6
- return s(o) ? o : (console.warn(`${t} is not a valid request method. Using ${e} as the default.`), e);
7
- };
8
- export {
9
- r as normalizeRequestMethod
10
- };