vitepress-openapi 0.2.13 → 0.2.14
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/dist/{OAJSONEditor-Cxpub1dW.js → OAJSONEditor-BeZ8k8oU.js} +1 -1
- package/dist/{OAJSONEditor-B27HNYxA.cjs → OAJSONEditor-uRw8XH0g.cjs} +2 -2
- package/dist/{engine-javascript-C27eFBsG.cjs → engine-javascript-BuuII3Kr.cjs} +2 -2
- package/dist/{engine-javascript-Jp6ImdBF.js → engine-javascript-C0OBEbU1.js} +12 -12
- package/dist/standalone.css +1385 -0
- package/dist/types/src/client.d.ts +1 -12
- package/dist/types/src/components/Common/OADocRoot.vue.d.ts +15 -0
- package/dist/types/src/composables/useSidebar.d.ts +16 -3
- package/dist/types/src/lib/docRoot.d.ts +3 -0
- package/dist/types/src/lib/sidebar/cleanSidebarItems.d.ts +2 -3
- package/dist/types/src/lib/utils/copyCode.d.ts +1 -0
- package/dist/types/src/vue.d.ts +35 -0
- package/dist/vitepress-openapi.client.cjs.js +1 -6
- package/dist/vitepress-openapi.client.es.js +10 -17169
- package/dist/vitepress-openapi.css +1 -1
- package/dist/vitepress-openapi.vue.cjs.js +1 -0
- package/dist/vitepress-openapi.vue.es.js +3 -0
- package/dist/vue-2Bqkyliz.js +17260 -0
- package/dist/vue-ue8NZ9rA.cjs +6 -0
- package/package.json +15 -3
- package/src/client.ts +6 -39
- package/src/components/Common/OADocRoot.vue +18 -0
- package/src/components/Feature/OAInfo.vue +11 -5
- package/src/components/Feature/OAIntroduction.vue +12 -6
- package/src/components/Feature/OAOperation.vue +22 -19
- package/src/components/Feature/OAServers.vue +11 -5
- package/src/components/Feature/OASpec.vue +25 -22
- package/src/composables/useSidebar.ts +18 -4
- package/src/lib/docRoot.ts +4 -0
- package/src/lib/sidebar/cleanSidebarItems.ts +4 -5
- package/src/lib/utils/copyCode.ts +46 -0
- package/src/standalone.css +38 -0
- package/src/vue.ts +81 -0
- package/dist/classPrivateFieldGet2-B5R_onup.js +0 -22
- package/dist/classPrivateFieldGet2-Bglvjmhn.cjs +0 -1
- package/dist/lib-DtBHFGXA.cjs +0 -1
- package/dist/lib-DuAv3NcE.js +0 -27
|
@@ -2,7 +2,6 @@ import type { Awaitable } from 'vitepress';
|
|
|
2
2
|
import type { EnhanceAppContext, Theme } from 'vitepress/client';
|
|
3
3
|
import type { Component } from 'vue';
|
|
4
4
|
import type { OpenApiSpecInstance } from './lib/spec/createOpenApiSpec';
|
|
5
|
-
import { DEFAULT_OPERATION_SLOTS } from './composables/useTheme';
|
|
6
5
|
interface OAEnhanceAppContext extends EnhanceAppContext {
|
|
7
6
|
openapi?: OpenApiSpecInstance | null;
|
|
8
7
|
}
|
|
@@ -12,14 +11,4 @@ interface VPTheme {
|
|
|
12
11
|
extends?: Theme;
|
|
13
12
|
}
|
|
14
13
|
export declare const theme: VPTheme;
|
|
15
|
-
export * from './
|
|
16
|
-
export { useOpenapi } from './composables/useOpenapi';
|
|
17
|
-
export { usePlayground } from './composables/usePlayground';
|
|
18
|
-
export { DEFAULT_OPERATION_SLOTS };
|
|
19
|
-
export { useShiki } from './composables/useShiki';
|
|
20
|
-
export { useTheme } from './composables/useTheme';
|
|
21
|
-
export { generateCodeSample } from './lib/codeSamples/generateCodeSample';
|
|
22
|
-
export { OARequest } from './lib/codeSamples/request';
|
|
23
|
-
export { createOpenApiSpec } from './lib/spec/createOpenApiSpec';
|
|
24
|
-
export { minifyHtml } from './lib/utils/minifyHtml';
|
|
25
|
-
export { locales } from './locales';
|
|
14
|
+
export * from './vue';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
declare var __VLS_1: {}, __VLS_3: {};
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
default?: (props: typeof __VLS_1) => any;
|
|
4
|
+
} & {
|
|
5
|
+
default?: (props: typeof __VLS_3) => any;
|
|
6
|
+
};
|
|
7
|
+
declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
8
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
9
|
+
declare const _default: typeof __VLS_export;
|
|
10
|
+
export default _default;
|
|
11
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
12
|
+
new (): {
|
|
13
|
+
$slots: S;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { OpenAPIV3 } from '@scalar/openapi-types';
|
|
2
|
-
import type { DefaultTheme } from 'vitepress';
|
|
3
2
|
import type { OpenAPIDocument } from '../types';
|
|
4
3
|
type MethodAliases = Record<string, string>;
|
|
5
4
|
export interface SidebarItemTemplateParams {
|
|
@@ -40,7 +39,21 @@ export interface SidebarGroupsConfig {
|
|
|
40
39
|
sidebarItemTemplate?: SidebarItemTemplateFn;
|
|
41
40
|
sidebarGroupTemplate?: SidebarGroupTemplateFn;
|
|
42
41
|
}
|
|
43
|
-
|
|
42
|
+
/**
|
|
43
|
+
* Same shape as VitePress' `SidebarItem`, so it can be used as `themeConfig.sidebar`,
|
|
44
|
+
* without depending on VitePress types (e.g. in a plain Vue app).
|
|
45
|
+
*/
|
|
46
|
+
export interface SidebarItem {
|
|
47
|
+
text?: string;
|
|
48
|
+
link?: string;
|
|
49
|
+
items?: SidebarItem[];
|
|
50
|
+
collapsed?: boolean;
|
|
51
|
+
base?: string;
|
|
52
|
+
docFooterText?: string;
|
|
53
|
+
rel?: string;
|
|
54
|
+
target?: string;
|
|
55
|
+
}
|
|
56
|
+
export interface OASidebarItem extends SidebarItem {
|
|
44
57
|
path?: string;
|
|
45
58
|
isOperation?: boolean;
|
|
46
59
|
flattenedItems?: OASidebarItem[];
|
|
@@ -59,6 +72,6 @@ export declare function useSidebar({ spec, linkPrefix, tagLinkPrefix, defaultTag
|
|
|
59
72
|
linkPrefix?: string;
|
|
60
73
|
sidebarItemTemplate?: SidebarItemTemplateFn;
|
|
61
74
|
sidebarGroupTemplate?: SidebarGroupTemplateFn;
|
|
62
|
-
}) =>
|
|
75
|
+
}) => SidebarItem[];
|
|
63
76
|
};
|
|
64
77
|
export {};
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
export declare function cleanSidebarItems(result: (OASidebarItem[] | OASidebarItem)): DefaultTheme.SidebarItem[] | DefaultTheme.SidebarItem;
|
|
1
|
+
import type { OASidebarItem, SidebarItem } from '../../composables/useSidebar';
|
|
2
|
+
export declare function cleanSidebarItems(result: (OASidebarItem[] | OASidebarItem)): SidebarItem[] | SidebarItem;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function setupCopyCode(): void;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { Plugin } from 'vue';
|
|
2
|
+
import type { PartialUseThemeConfig } from './composables/useTheme';
|
|
3
|
+
import type { OpenAPIDocument } from './types';
|
|
4
|
+
import { DEFAULT_OPERATION_SLOTS } from './composables/useTheme';
|
|
5
|
+
export interface VOpenapiOptions {
|
|
6
|
+
/** OpenAPI document (object, or a JSON/YAML string) used by components without their own `spec`. */
|
|
7
|
+
spec?: OpenAPIDocument | string;
|
|
8
|
+
/** Theme configuration, the same as `useTheme(config)`. */
|
|
9
|
+
config?: PartialUseThemeConfig;
|
|
10
|
+
/** Handle the copy buttons of code blocks. VitePress already does it, so its theme disables this. Default: true. */
|
|
11
|
+
copyCode?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Wrap the entry components (OAOperation, OASpec, OAIntroduction, OAInfo, OAServers) in a `.vp-doc`
|
|
14
|
+
* element, which `standalone.css` styles. VitePress pages are already inside `.vp-doc`, so its theme
|
|
15
|
+
* disables this. Default: true.
|
|
16
|
+
*/
|
|
17
|
+
vpDoc?: boolean;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Vue plugin to use the components in any Vue 3 app, without VitePress.
|
|
21
|
+
* It installs i18n and registers the components globally.
|
|
22
|
+
*/
|
|
23
|
+
export declare const VOpenapi: Plugin<[VOpenapiOptions?]>;
|
|
24
|
+
export * from './components';
|
|
25
|
+
export { useOpenapi } from './composables/useOpenapi';
|
|
26
|
+
export { usePlayground } from './composables/usePlayground';
|
|
27
|
+
export { DEFAULT_OPERATION_SLOTS };
|
|
28
|
+
export { useShiki } from './composables/useShiki';
|
|
29
|
+
export { type SidebarItem, useSidebar } from './composables/useSidebar';
|
|
30
|
+
export { type PartialUseThemeConfig, useTheme } from './composables/useTheme';
|
|
31
|
+
export { generateCodeSample } from './lib/codeSamples/generateCodeSample';
|
|
32
|
+
export { OARequest } from './lib/codeSamples/request';
|
|
33
|
+
export { createOpenApiSpec } from './lib/spec/createOpenApiSpec';
|
|
34
|
+
export { minifyHtml } from './lib/utils/minifyHtml';
|
|
35
|
+
export { locales } from './locales';
|