@scalar/api-reference 1.31.4 → 1.31.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- package/dist/browser/standalone.js +15407 -15317
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/ApiReference.vue.js +6 -6
- package/dist/components/ApiReferenceLayout.vue.d.ts +6 -3
- package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
- package/dist/components/ApiReferenceLayout.vue.js +4 -2
- package/dist/components/ApiReferenceLayout.vue2.js +230 -151
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue2.js +138 -129
- package/dist/components/GettingStarted.vue.d.ts.map +1 -1
- package/dist/components/GettingStarted.vue.js +3 -3
- package/dist/components/GettingStarted.vue2.js +23 -23
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +37 -44
- package/dist/libs/openapi.js +32 -32
- package/dist/style.css +1 -1
- package/dist/v2/ApiReferenceWorkspace.vue.d.ts +40 -0
- package/dist/v2/ApiReferenceWorkspace.vue.d.ts.map +1 -0
- package/dist/v2/ApiReferenceWorkspace.vue.js +65 -0
- package/dist/v2/ApiReferenceWorkspace.vue3.js +5 -0
- package/dist/v2/events/definitions.d.ts +35 -0
- package/dist/v2/events/definitions.d.ts.map +1 -0
- package/dist/v2/events/index.d.ts +3 -0
- package/dist/v2/events/index.d.ts.map +1 -0
- package/dist/v2/events/listeners.d.ts +8 -0
- package/dist/v2/events/listeners.d.ts.map +1 -0
- package/dist/v2/events/listeners.js +15 -0
- package/dist/v2/styles.d.ts +2 -0
- package/dist/v2/styles.d.ts.map +1 -0
- package/package.json +12 -11
- package/dist/components/Layouts/ClassicLayout.vue.d.ts +0 -23
- package/dist/components/Layouts/ClassicLayout.vue.d.ts.map +0 -1
- package/dist/components/Layouts/ClassicLayout.vue.js +0 -67
- package/dist/components/Layouts/ClassicLayout.vue2.js +0 -4
- package/dist/components/Layouts/Layouts.vue.d.ts +0 -26
- package/dist/components/Layouts/Layouts.vue.d.ts.map +0 -1
- package/dist/components/Layouts/Layouts.vue.js +0 -35
- package/dist/components/Layouts/Layouts.vue2.js +0 -4
- package/dist/components/Layouts/ModernLayout.vue.d.ts +0 -23
- package/dist/components/Layouts/ModernLayout.vue.d.ts.map +0 -1
- package/dist/components/Layouts/ModernLayout.vue.js +0 -8
- package/dist/components/Layouts/ModernLayout.vue2.js +0 -102
- package/dist/components/Layouts/index.d.ts +0 -2
- package/dist/components/Layouts/index.d.ts.map +0 -1
- package/dist/components/SingleApiReference.vue.d.ts +0 -29
- package/dist/components/SingleApiReference.vue.d.ts.map +0 -1
- package/dist/components/SingleApiReference.vue.js +0 -57
- package/dist/components/SingleApiReference.vue3.js +0 -5
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* API Reference Workspace will be a temporary wrapping layer for handling all workspace state.
|
|
3
|
+
*
|
|
4
|
+
* Once the migration to the new workspace store is complete the top level component composition
|
|
5
|
+
* can be simplified to handle two use cases:
|
|
6
|
+
*
|
|
7
|
+
* - Externally provided store (store is initialized outside of the component and passed in)
|
|
8
|
+
* - Standalone mode (store is initialized inside the component and configuration is merged)
|
|
9
|
+
*
|
|
10
|
+
* The configuration should be merged with the workspace store and all components should consume
|
|
11
|
+
* only portions of the workspace store.
|
|
12
|
+
*
|
|
13
|
+
* No state updates should be handled in children of this components. When updates are required
|
|
14
|
+
* a custom event should be emitted to the workspace store and handled here.
|
|
15
|
+
*/
|
|
16
|
+
import type { ApiReferenceConfiguration } from '@scalar/types';
|
|
17
|
+
type __VLS_Props = {
|
|
18
|
+
configuration: Partial<ApiReferenceConfiguration>;
|
|
19
|
+
};
|
|
20
|
+
declare function __VLS_template(): {
|
|
21
|
+
attrs: Partial<{}>;
|
|
22
|
+
slots: {
|
|
23
|
+
footer?(_: {}): any;
|
|
24
|
+
footer?(_: {}): any;
|
|
25
|
+
"document-selector"?(_: {}): any;
|
|
26
|
+
"sidebar-start"?(_: {}): any;
|
|
27
|
+
};
|
|
28
|
+
refs: {};
|
|
29
|
+
rootEl: any;
|
|
30
|
+
};
|
|
31
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
32
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
33
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
34
|
+
export default _default;
|
|
35
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
36
|
+
new (): {
|
|
37
|
+
$slots: S;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=ApiReferenceWorkspace.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ApiReferenceWorkspace.vue.d.ts","sourceRoot":"","sources":["../../src/v2/ApiReferenceWorkspace.vue"],"names":[],"mappings":"AAyHA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAA;AAY9D,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,OAAO,CAAC,yBAAyB,CAAC,CAAA;CAClD,CAAC;AAiEF,iBAAS,cAAc;WAuGT,OAAO,IAA6B;;wBAXrB,GAAG;wBACH,GAAG;qCACU,GAAG;iCACP,GAAG;;;;EAaxC;AAWD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe,kSAMnB,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"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { defineComponent as g, shallowRef as p, watch as s, computed as C, createElementBlock as M, openBlock as c, Fragment as v, createBlock as D, createCommentVNode as y, createVNode as S, resolveDynamicComponent as $, withCtx as t, createTextVNode as w, toDisplayString as B, unref as u, renderSlot as n } from "vue";
|
|
2
|
+
import { useColorMode as N } from "@scalar/use-hooks/useColorMode";
|
|
3
|
+
import { createWorkspaceStoreSync as R } from "@scalar/workspace-store/client";
|
|
4
|
+
import { useSeoMeta as V } from "@unhead/vue";
|
|
5
|
+
import { useFavicon as b } from "@vueuse/core";
|
|
6
|
+
import A from "../components/ApiReferenceLayout.vue.js";
|
|
7
|
+
import { onCustomEvent as E } from "./events/listeners.js";
|
|
8
|
+
const q = /* @__PURE__ */ g({
|
|
9
|
+
__name: "ApiReferenceWorkspace",
|
|
10
|
+
props: {
|
|
11
|
+
configuration: {}
|
|
12
|
+
},
|
|
13
|
+
setup(e) {
|
|
14
|
+
const m = p(null), r = R();
|
|
15
|
+
E(m, "scalar-update-dark-mode", (o) => {
|
|
16
|
+
r.update("x-scalar-dark-mode", o.data.value);
|
|
17
|
+
});
|
|
18
|
+
const { toggleColorMode: l, isDarkMode: i } = N({
|
|
19
|
+
initialColorMode: e.configuration.darkMode ? "dark" : void 0,
|
|
20
|
+
overrideColorMode: e.configuration.forceDarkModeState
|
|
21
|
+
});
|
|
22
|
+
s(
|
|
23
|
+
() => e.configuration.darkMode,
|
|
24
|
+
(o) => r.update("x-scalar-dark-mode", !!o)
|
|
25
|
+
), s(
|
|
26
|
+
() => i,
|
|
27
|
+
() => r.update("x-scalar-dark-mode", i.value)
|
|
28
|
+
), e.configuration.metaData && V(e.configuration.metaData);
|
|
29
|
+
const f = C(() => e.configuration.favicon);
|
|
30
|
+
return b(f), (o, a) => {
|
|
31
|
+
var d;
|
|
32
|
+
return c(), M(v, null, [
|
|
33
|
+
(d = o.configuration) != null && d.customCss ? (c(), D($("style"), { key: 0 }, {
|
|
34
|
+
default: t(() => [
|
|
35
|
+
w(B(o.configuration.customCss), 1)
|
|
36
|
+
]),
|
|
37
|
+
_: 1
|
|
38
|
+
})) : y("", !0),
|
|
39
|
+
S(A, {
|
|
40
|
+
configuration: o.configuration,
|
|
41
|
+
isDark: !!u(r).workspace["x-scalar-dark-mode"],
|
|
42
|
+
onToggleDarkMode: a[0] || (a[0] = () => u(l)()),
|
|
43
|
+
onUpdateContent: a[1] || (a[1] = (k) => o.$emit("updateContent", k))
|
|
44
|
+
}, {
|
|
45
|
+
footer: t(() => [
|
|
46
|
+
n(o.$slots, "footer")
|
|
47
|
+
]),
|
|
48
|
+
"content-end": t(() => [
|
|
49
|
+
n(o.$slots, "footer")
|
|
50
|
+
]),
|
|
51
|
+
"document-selector": t(() => [
|
|
52
|
+
n(o.$slots, "document-selector")
|
|
53
|
+
]),
|
|
54
|
+
"sidebar-start": t(() => [
|
|
55
|
+
n(o.$slots, "sidebar-start")
|
|
56
|
+
]),
|
|
57
|
+
_: 3
|
|
58
|
+
}, 8, ["configuration", "isDark"])
|
|
59
|
+
], 64);
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
export {
|
|
64
|
+
q as default
|
|
65
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Event definitions for scalar blocks
|
|
3
|
+
*
|
|
4
|
+
* Events can have a typed payload using the `data` property.
|
|
5
|
+
*/
|
|
6
|
+
export type ApiReferenceEvents = {
|
|
7
|
+
'scalar-update-sidebar': {
|
|
8
|
+
data: {
|
|
9
|
+
value: boolean;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
'scalar-update-dark-mode': {
|
|
13
|
+
data: {
|
|
14
|
+
value: boolean;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
'scalar-update-active-document': {
|
|
18
|
+
data: {
|
|
19
|
+
value: string;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export type ApiReferenceEvent = Prettify<keyof ApiReferenceEvents>;
|
|
24
|
+
/**
|
|
25
|
+
* Scalar blocks will use vanilla events to allow more flexibility in integrations
|
|
26
|
+
*
|
|
27
|
+
* Event can include typed payloads using the `data` property. A target for the dispatch must be provided.
|
|
28
|
+
*/
|
|
29
|
+
export declare function emitCustomEvent<E extends ApiReferenceEvent>(target: HTMLElement, event: E, data: ApiReferenceEvents[E]['data']): void;
|
|
30
|
+
/** Type helper for expanding complex types */
|
|
31
|
+
type Prettify<T> = {
|
|
32
|
+
[K in keyof T]: T[K];
|
|
33
|
+
} & {};
|
|
34
|
+
export {};
|
|
35
|
+
//# sourceMappingURL=definitions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"definitions.d.ts","sourceRoot":"","sources":["../../../src/v2/events/definitions.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,uBAAuB,EAAE;QACvB,IAAI,EAAE;YACJ,KAAK,EAAE,OAAO,CAAA;SACf,CAAA;KACF,CAAA;IACD,yBAAyB,EAAE;QACzB,IAAI,EAAE;YACJ,KAAK,EAAE,OAAO,CAAA;SACf,CAAA;KACF,CAAA;IACD,+BAA+B,EAAE;QAC/B,IAAI,EAAE;YACJ,KAAK,EAAE,MAAM,CAAA;SACd,CAAA;KACF,CAAA;CACF,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CAAC,MAAM,kBAAkB,CAAC,CAAA;AAElE;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,iBAAiB,EACzD,MAAM,EAAE,WAAW,EACnB,KAAK,EAAE,CAAC,EACR,IAAI,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,QAKpC;AAED,8CAA8C;AAC9C,KAAK,QAAQ,CAAC,CAAC,IAAI;KAChB,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACrB,GAAG,EAAE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/v2/events/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,kBAAkB,EAAE,KAAK,iBAAiB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAChG,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ApiReferenceEvent, ApiReferenceEvents } from './definitions';
|
|
2
|
+
import { type Ref } from 'vue';
|
|
3
|
+
/**
|
|
4
|
+
* Vue wrapper for attaching and removing event listeners
|
|
5
|
+
*
|
|
6
|
+
*/
|
|
7
|
+
export declare function onCustomEvent<E extends ApiReferenceEvent>(el: Ref<HTMLElement | null>, event: E, handler: (event: ApiReferenceEvents[E]) => void): void;
|
|
8
|
+
//# sourceMappingURL=listeners.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"listeners.d.ts","sourceRoot":"","sources":["../../../src/v2/events/listeners.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAC1E,OAAO,EAAmB,KAAK,GAAG,EAAS,MAAM,KAAK,CAAA;AAEtD;;;GAGG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,iBAAiB,EACvD,EAAE,EAAE,GAAG,CAAC,WAAW,GAAG,IAAI,CAAC,EAC3B,KAAK,EAAE,CAAC,EACR,OAAO,EAAE,CAAC,KAAK,EAAE,kBAAkB,CAAC,CAAC,CAAC,KAAK,IAAI,QAsBhD"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { watch as o, onBeforeUnmount as u } from "vue";
|
|
2
|
+
function m(t, e, r) {
|
|
3
|
+
o(
|
|
4
|
+
() => t.value,
|
|
5
|
+
(n) => {
|
|
6
|
+
n && n.addEventListener(e, r);
|
|
7
|
+
},
|
|
8
|
+
{ immediate: !0 }
|
|
9
|
+
), u(() => {
|
|
10
|
+
t.value && t.value.removeEventListener(e, r);
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
m as onCustomEvent
|
|
15
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/v2/styles.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"vue",
|
|
21
21
|
"vue3"
|
|
22
22
|
],
|
|
23
|
-
"version": "1.31.
|
|
23
|
+
"version": "1.31.7",
|
|
24
24
|
"engines": {
|
|
25
25
|
"node": ">=20"
|
|
26
26
|
},
|
|
@@ -54,19 +54,20 @@
|
|
|
54
54
|
"nanoid": "^5.1.5",
|
|
55
55
|
"vue": "^3.5.12",
|
|
56
56
|
"zod": "3.24.1",
|
|
57
|
-
"@scalar/api-client": "2.5.
|
|
57
|
+
"@scalar/api-client": "2.5.4",
|
|
58
58
|
"@scalar/code-highlight": "0.1.2",
|
|
59
|
-
"@scalar/components": "0.14.
|
|
60
|
-
"@scalar/helpers": "0.0.
|
|
59
|
+
"@scalar/components": "0.14.7",
|
|
60
|
+
"@scalar/helpers": "0.0.3",
|
|
61
61
|
"@scalar/icons": "0.4.2",
|
|
62
|
-
"@scalar/oas-utils": "0.4.
|
|
62
|
+
"@scalar/oas-utils": "0.4.4",
|
|
63
63
|
"@scalar/openapi-parser": "0.15.0",
|
|
64
|
-
"@scalar/
|
|
64
|
+
"@scalar/themes": "0.13.2",
|
|
65
65
|
"@scalar/snippetz": "0.3.0",
|
|
66
|
-
"@scalar/use-hooks": "0.2.2",
|
|
67
66
|
"@scalar/types": "0.2.2",
|
|
68
|
-
"@scalar/
|
|
69
|
-
"@scalar/use-toasts": "0.8.0"
|
|
67
|
+
"@scalar/openapi-types": "0.3.2",
|
|
68
|
+
"@scalar/use-toasts": "0.8.0",
|
|
69
|
+
"@scalar/workspace-store": "0.3.1",
|
|
70
|
+
"@scalar/use-hooks": "0.2.2"
|
|
70
71
|
},
|
|
71
72
|
"devDependencies": {
|
|
72
73
|
"@tailwindcss/vite": "^4.1.7",
|
|
@@ -83,9 +84,9 @@
|
|
|
83
84
|
"vite-plugin-banner": "^0.7.1",
|
|
84
85
|
"vite-plugin-css-injected-by-js": "^3.4.0",
|
|
85
86
|
"vitest": "^1.6.0",
|
|
87
|
+
"@scalar/build-tooling": "0.2.2",
|
|
86
88
|
"@scalar/galaxy": "0.5.0",
|
|
87
|
-
"@scalar/react-renderer": "0.2.0"
|
|
88
|
-
"@scalar/build-tooling": "0.2.2"
|
|
89
|
+
"@scalar/react-renderer": "0.2.0"
|
|
89
90
|
},
|
|
90
91
|
"scripts": {
|
|
91
92
|
"build": "pnpm build:default && pnpm build:standalone && pnpm types:build && tsc-alias -p tsconfig.build.json",
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { DocumentSelectorSlot, ReferenceLayoutProps, ReferenceLayoutSlots } from '../../types';
|
|
2
|
-
declare function __VLS_template(): {
|
|
3
|
-
attrs: Partial<{}>;
|
|
4
|
-
slots: Readonly<ReferenceLayoutSlots & DocumentSelectorSlot> & ReferenceLayoutSlots & DocumentSelectorSlot;
|
|
5
|
-
refs: {};
|
|
6
|
-
rootEl: any;
|
|
7
|
-
};
|
|
8
|
-
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
9
|
-
declare const __VLS_component: import("vue").DefineComponent<ReferenceLayoutProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
10
|
-
updateContent: (v: string) => any;
|
|
11
|
-
toggleDarkMode: () => any;
|
|
12
|
-
}, string, import("vue").PublicProps, Readonly<ReferenceLayoutProps> & Readonly<{
|
|
13
|
-
onUpdateContent?: ((v: string) => any) | undefined;
|
|
14
|
-
onToggleDarkMode?: (() => any) | undefined;
|
|
15
|
-
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
16
|
-
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
17
|
-
export default _default;
|
|
18
|
-
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
19
|
-
new (): {
|
|
20
|
-
$slots: S;
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
//# sourceMappingURL=ClassicLayout.vue.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ClassicLayout.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Layouts/ClassicLayout.vue"],"names":[],"mappings":"AAwEA,OAAO,KAAK,EACV,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,SAAS,CAAA;AAwBhB,iBAAS,cAAc;WAyHT,OAAO,IAA6B;;;;EAKjD;AAcD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;kFAQnB,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,67 +0,0 @@
|
|
|
1
|
-
import { defineComponent as g, useSlots as S, computed as k, createBlock as c, openBlock as r, createSlots as y, withCtx as n, createVNode as h, createElementBlock as C, createCommentVNode as i, renderSlot as d, unref as p, renderList as v, normalizeProps as w, guardReactiveProps as D } from "vue";
|
|
2
|
-
import { ScalarColorModeToggleIcon as $ } from "@scalar/components";
|
|
3
|
-
import B from "../ApiReferenceLayout.vue.js";
|
|
4
|
-
import H from "../ClassicHeader.vue.js";
|
|
5
|
-
import M from "../../features/Search/SearchButton.vue.js";
|
|
6
|
-
const K = {
|
|
7
|
-
key: 0,
|
|
8
|
-
class: "w-64 empty:hidden"
|
|
9
|
-
}, T = /* @__PURE__ */ g({
|
|
10
|
-
__name: "ClassicLayout",
|
|
11
|
-
props: {
|
|
12
|
-
configuration: {},
|
|
13
|
-
dereferencedDocument: {},
|
|
14
|
-
originalDocument: {},
|
|
15
|
-
isDark: { type: Boolean },
|
|
16
|
-
parsedSpec: {},
|
|
17
|
-
rawSpec: {}
|
|
18
|
-
},
|
|
19
|
-
emits: ["toggleDarkMode", "updateContent"],
|
|
20
|
-
setup(u) {
|
|
21
|
-
const a = u, m = S(), l = k(() => ({ ...a.configuration, showSidebar: !1 }));
|
|
22
|
-
return (e, o) => (r(), c(B, {
|
|
23
|
-
configuration: l.value,
|
|
24
|
-
parsedSpec: e.parsedSpec,
|
|
25
|
-
rawSpec: e.rawSpec,
|
|
26
|
-
onUpdateContent: o[1] || (o[1] = (t) => e.$emit("updateContent", t))
|
|
27
|
-
}, y({
|
|
28
|
-
"content-start": n(({ spec: t }) => [
|
|
29
|
-
h(H, null, {
|
|
30
|
-
"dark-mode-toggle": n(() => [
|
|
31
|
-
a.configuration.hideDarkModeToggle ? i("", !0) : (r(), c(p($), {
|
|
32
|
-
key: 0,
|
|
33
|
-
class: "text-c-2 hover:text-c-1",
|
|
34
|
-
mode: e.isDark ? "dark" : "light",
|
|
35
|
-
style: { transform: "scale(1.4)" },
|
|
36
|
-
variant: "icon",
|
|
37
|
-
onClick: o[0] || (o[0] = (s) => e.$emit("toggleDarkMode"))
|
|
38
|
-
}, null, 8, ["mode"]))
|
|
39
|
-
]),
|
|
40
|
-
default: n(() => [
|
|
41
|
-
e.$slots["document-selector"] ? (r(), C("div", K, [
|
|
42
|
-
d(e.$slots, "document-selector")
|
|
43
|
-
])) : i("", !0),
|
|
44
|
-
a.configuration.hideSearch ? i("", !0) : (r(), c(p(M), {
|
|
45
|
-
key: 1,
|
|
46
|
-
class: "t-doc__sidebar",
|
|
47
|
-
searchHotKey: l.value.searchHotKey,
|
|
48
|
-
spec: t
|
|
49
|
-
}, null, 8, ["searchHotKey", "spec"]))
|
|
50
|
-
]),
|
|
51
|
-
_: 2
|
|
52
|
-
}, 1024)
|
|
53
|
-
]),
|
|
54
|
-
_: 2
|
|
55
|
-
}, [
|
|
56
|
-
v(m, (t, s) => ({
|
|
57
|
-
name: s,
|
|
58
|
-
fn: n((f) => [
|
|
59
|
-
d(e.$slots, s, w(D(f || {})))
|
|
60
|
-
])
|
|
61
|
-
}))
|
|
62
|
-
]), 1032, ["configuration", "parsedSpec", "rawSpec"]));
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
export {
|
|
66
|
-
T as default
|
|
67
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This component allows dynamic selection of various layout configurations
|
|
3
|
-
*/
|
|
4
|
-
import type { DocumentSelectorSlot, ReferenceLayoutProps, ReferenceLayoutSlots } from '../../types';
|
|
5
|
-
declare function __VLS_template(): {
|
|
6
|
-
attrs: Partial<{}>;
|
|
7
|
-
slots: Readonly<ReferenceLayoutSlots & DocumentSelectorSlot> & ReferenceLayoutSlots & DocumentSelectorSlot;
|
|
8
|
-
refs: {};
|
|
9
|
-
rootEl: any;
|
|
10
|
-
};
|
|
11
|
-
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
12
|
-
declare const __VLS_component: import("vue").DefineComponent<ReferenceLayoutProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
13
|
-
updateContent: (v: string) => any;
|
|
14
|
-
toggleDarkMode: () => any;
|
|
15
|
-
}, string, import("vue").PublicProps, Readonly<ReferenceLayoutProps> & Readonly<{
|
|
16
|
-
onUpdateContent?: ((v: string) => any) | undefined;
|
|
17
|
-
onToggleDarkMode?: (() => any) | undefined;
|
|
18
|
-
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
19
|
-
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
20
|
-
export default _default;
|
|
21
|
-
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
22
|
-
new (): {
|
|
23
|
-
$slots: S;
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
//# sourceMappingURL=Layouts.vue.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Layouts.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Layouts/Layouts.vue"],"names":[],"mappings":"AA4CA;;GAEG;AACH,OAAO,KAAK,EACV,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,aAAa,CAAA;AA2BpB,iBAAS,cAAc;WAuET,OAAO,IAA6B;;;;EAKjD;AAWD,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,35 +0,0 @@
|
|
|
1
|
-
import { defineComponent as l, useSlots as d, createBlock as u, openBlock as c, resolveDynamicComponent as f, mergeProps as g, createSlots as D, renderList as k, withCtx as y, renderSlot as C, normalizeProps as S, guardReactiveProps as $ } from "vue";
|
|
2
|
-
import M from "./ClassicLayout.vue.js";
|
|
3
|
-
import n from "./ModernLayout.vue.js";
|
|
4
|
-
const P = /* @__PURE__ */ l({
|
|
5
|
-
__name: "Layouts",
|
|
6
|
-
props: {
|
|
7
|
-
configuration: {},
|
|
8
|
-
dereferencedDocument: {},
|
|
9
|
-
originalDocument: {},
|
|
10
|
-
isDark: { type: Boolean },
|
|
11
|
-
parsedSpec: {},
|
|
12
|
-
rawSpec: {}
|
|
13
|
-
},
|
|
14
|
-
emits: ["toggleDarkMode", "updateContent"],
|
|
15
|
-
setup(s) {
|
|
16
|
-
const a = s, i = d(), p = {
|
|
17
|
-
modern: n,
|
|
18
|
-
classic: M
|
|
19
|
-
};
|
|
20
|
-
return (o, e) => (c(), u(f(p[o.configuration.layout ?? "modern"] ?? n), g(a, {
|
|
21
|
-
onToggleDarkMode: e[0] || (e[0] = (t) => o.$emit("toggleDarkMode")),
|
|
22
|
-
onUpdateContent: e[1] || (e[1] = (t) => o.$emit("updateContent", t))
|
|
23
|
-
}), D({ _: 2 }, [
|
|
24
|
-
k(i, (t, r) => ({
|
|
25
|
-
name: r,
|
|
26
|
-
fn: y((m) => [
|
|
27
|
-
C(o.$slots, r, S($(m || {})))
|
|
28
|
-
])
|
|
29
|
-
}))
|
|
30
|
-
]), 1040));
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
export {
|
|
34
|
-
P as default
|
|
35
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { DocumentSelectorSlot, ReferenceLayoutProps, ReferenceLayoutSlots } from '../../types';
|
|
2
|
-
declare function __VLS_template(): {
|
|
3
|
-
attrs: Partial<{}>;
|
|
4
|
-
slots: Readonly<ReferenceLayoutSlots & DocumentSelectorSlot> & ReferenceLayoutSlots & DocumentSelectorSlot;
|
|
5
|
-
refs: {};
|
|
6
|
-
rootEl: any;
|
|
7
|
-
};
|
|
8
|
-
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
9
|
-
declare const __VLS_component: import("vue").DefineComponent<ReferenceLayoutProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
10
|
-
updateContent: (v: string) => any;
|
|
11
|
-
toggleDarkMode: () => any;
|
|
12
|
-
}, string, import("vue").PublicProps, Readonly<ReferenceLayoutProps> & Readonly<{
|
|
13
|
-
onUpdateContent?: ((v: string) => any) | undefined;
|
|
14
|
-
onToggleDarkMode?: (() => any) | undefined;
|
|
15
|
-
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
16
|
-
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
17
|
-
export default _default;
|
|
18
|
-
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
19
|
-
new (): {
|
|
20
|
-
$slots: S;
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
//# sourceMappingURL=ModernLayout.vue.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ModernLayout.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Layouts/ModernLayout.vue"],"names":[],"mappings":"AAuJA,OAAO,KAAK,EACV,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,SAAS,CAAA;AA2ChB,iBAAS,cAAc;WA+JT,OAAO,IAA6B;;;;EAKjD;AAkBD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;kFAQnB,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,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 +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"}
|