@nuxtjs/mdc 0.16.1 → 0.17.1
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/README.md +8 -8
- package/dist/config.d.mts +1 -1
- package/dist/module.d.mts +18 -39
- package/dist/module.json +3 -3
- package/dist/module.mjs +11 -6
- package/dist/runtime/components/MDC.vue +25 -33
- package/dist/runtime/components/MDC.vue.d.ts +140 -0
- package/dist/runtime/components/MDCCached.vue +117 -0
- package/dist/runtime/components/MDCCached.vue.d.ts +155 -0
- package/dist/runtime/components/MDCRenderer.vue +19 -13
- package/dist/runtime/components/MDCRenderer.vue.d.ts +11 -123
- package/dist/runtime/components/MDCSlot.vue.d.ts +2 -2
- package/dist/runtime/components/prose/ProseA.vue +5 -7
- package/dist/runtime/components/prose/ProseA.vue.d.ts +36 -0
- package/dist/runtime/components/prose/ProseBlockquote.vue.d.ts +12 -0
- package/dist/runtime/components/prose/ProseCode.vue.d.ts +12 -0
- package/dist/runtime/components/prose/ProseEm.vue.d.ts +12 -0
- package/dist/runtime/components/prose/ProseH1.vue +7 -7
- package/dist/runtime/components/prose/ProseH1.vue.d.ts +17 -0
- package/dist/runtime/components/prose/ProseH2.vue +7 -7
- package/dist/runtime/components/prose/ProseH2.vue.d.ts +17 -0
- package/dist/runtime/components/prose/ProseH3.vue +7 -7
- package/dist/runtime/components/prose/ProseH3.vue.d.ts +17 -0
- package/dist/runtime/components/prose/ProseH4.vue +7 -7
- package/dist/runtime/components/prose/ProseH4.vue.d.ts +17 -0
- package/dist/runtime/components/prose/ProseH5.vue +7 -7
- package/dist/runtime/components/prose/ProseH5.vue.d.ts +17 -0
- package/dist/runtime/components/prose/ProseH6.vue +7 -7
- package/dist/runtime/components/prose/ProseH6.vue.d.ts +17 -0
- package/dist/runtime/components/prose/ProseHr.vue.d.ts +2 -0
- package/dist/runtime/components/prose/ProseImg.vue +15 -18
- package/dist/runtime/components/prose/ProseImg.vue.d.ts +41 -0
- package/dist/runtime/components/prose/ProseLi.vue.d.ts +12 -0
- package/dist/runtime/components/prose/ProseOl.vue.d.ts +12 -0
- package/dist/runtime/components/prose/ProseP.vue.d.ts +12 -0
- package/dist/runtime/components/prose/ProsePre.vue +4 -4
- package/dist/runtime/components/prose/ProsePre.vue.d.ts +69 -0
- package/dist/runtime/components/prose/ProseScript.vue +4 -4
- package/dist/runtime/components/prose/ProseScript.vue.d.ts +14 -0
- package/dist/runtime/components/prose/ProseStrong.vue.d.ts +12 -0
- package/dist/runtime/components/prose/ProseTable.vue.d.ts +12 -0
- package/dist/runtime/components/prose/ProseTbody.vue.d.ts +12 -0
- package/dist/runtime/components/prose/ProseTd.vue.d.ts +12 -0
- package/dist/runtime/components/prose/ProseTh.vue.d.ts +12 -0
- package/dist/runtime/components/prose/ProseThead.vue.d.ts +12 -0
- package/dist/runtime/components/prose/ProseTr.vue.d.ts +12 -0
- package/dist/runtime/components/prose/ProseUl.vue.d.ts +12 -0
- package/dist/runtime/highlighter/shiki.d.ts +1 -1
- package/dist/runtime/highlighter/shiki.js +9 -6
- package/dist/runtime/index.d.ts +1 -0
- package/dist/runtime/index.js +1 -0
- package/dist/runtime/parser/cached.d.ts +2 -0
- package/dist/runtime/parser/cached.js +44 -0
- package/dist/runtime/parser/compiler.js +11 -9
- package/dist/runtime/parser/handlers/utils.js +6 -2
- package/dist/runtime/parser/index.js +9 -5
- package/dist/runtime/stringify/index.d.ts +1 -1
- package/dist/runtime/stringify/mdc-remark.js +50 -14
- package/dist/runtime/utils/slot.d.ts +1 -1
- package/dist/shared/{mdc.86c0ccda.d.ts → mdc.BkZUOs7X.d.mts} +3 -18
- package/dist/types.d.mts +3 -5
- package/package.json +36 -38
- package/dist/config.d.ts +0 -4
- package/dist/module.cjs +0 -5
- package/dist/module.d.ts +0 -603
- package/dist/shared/mdc.86c0ccda.d.mts +0 -82
- package/dist/types.d.ts +0 -7
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import type { PropType, DefineComponent } from 'vue';
|
|
2
|
+
import type { MDCParseOptions } from '@nuxtjs/mdc';
|
|
3
|
+
declare var __VLS_1: {
|
|
4
|
+
data: any;
|
|
5
|
+
body: any;
|
|
6
|
+
toc: any;
|
|
7
|
+
excerpt: any;
|
|
8
|
+
error: import("nuxt/app").NuxtError<unknown> | null;
|
|
9
|
+
};
|
|
10
|
+
type __VLS_Slots = {} & {
|
|
11
|
+
default?: (props: typeof __VLS_1) => any;
|
|
12
|
+
};
|
|
13
|
+
declare const __VLS_component: DefineComponent<import("vue").ExtractPropTypes<{
|
|
14
|
+
tag: {
|
|
15
|
+
type: (StringConstructor | BooleanConstructor)[];
|
|
16
|
+
default: string;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Raw markdown string or parsed markdown object from `parseMarkdown`
|
|
20
|
+
*/
|
|
21
|
+
value: {
|
|
22
|
+
type: (StringConstructor | ObjectConstructor)[];
|
|
23
|
+
required: true;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Render only the excerpt
|
|
27
|
+
*/
|
|
28
|
+
excerpt: {
|
|
29
|
+
type: BooleanConstructor;
|
|
30
|
+
default: boolean;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Options for `parseMarkdown`
|
|
34
|
+
*/
|
|
35
|
+
parserOptions: {
|
|
36
|
+
type: PropType<MDCParseOptions>;
|
|
37
|
+
default: () => {};
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Class to be applied to the root element
|
|
41
|
+
*/
|
|
42
|
+
class: {
|
|
43
|
+
type: (StringConstructor | ObjectConstructor | ArrayConstructor)[];
|
|
44
|
+
default: string;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Tags to unwrap separated by spaces
|
|
48
|
+
* Example: 'ul li'
|
|
49
|
+
*/
|
|
50
|
+
unwrap: {
|
|
51
|
+
type: (StringConstructor | BooleanConstructor)[];
|
|
52
|
+
default: boolean;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Async Data Unique Key
|
|
56
|
+
* @default `hash(props.value)`
|
|
57
|
+
*/
|
|
58
|
+
cacheKey: {
|
|
59
|
+
type: StringConstructor;
|
|
60
|
+
default: undefined;
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Partial parsing (if partial is `true`, title and toc generation will not be generated)
|
|
64
|
+
*/
|
|
65
|
+
partial: {
|
|
66
|
+
type: BooleanConstructor;
|
|
67
|
+
default: boolean;
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* The map of custom components to use for rendering.
|
|
71
|
+
*/
|
|
72
|
+
components: {
|
|
73
|
+
type: PropType<Record<string, string | DefineComponent<any, any, any>>>;
|
|
74
|
+
default: () => {};
|
|
75
|
+
};
|
|
76
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
77
|
+
tag: {
|
|
78
|
+
type: (StringConstructor | BooleanConstructor)[];
|
|
79
|
+
default: string;
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* Raw markdown string or parsed markdown object from `parseMarkdown`
|
|
83
|
+
*/
|
|
84
|
+
value: {
|
|
85
|
+
type: (StringConstructor | ObjectConstructor)[];
|
|
86
|
+
required: true;
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* Render only the excerpt
|
|
90
|
+
*/
|
|
91
|
+
excerpt: {
|
|
92
|
+
type: BooleanConstructor;
|
|
93
|
+
default: boolean;
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* Options for `parseMarkdown`
|
|
97
|
+
*/
|
|
98
|
+
parserOptions: {
|
|
99
|
+
type: PropType<MDCParseOptions>;
|
|
100
|
+
default: () => {};
|
|
101
|
+
};
|
|
102
|
+
/**
|
|
103
|
+
* Class to be applied to the root element
|
|
104
|
+
*/
|
|
105
|
+
class: {
|
|
106
|
+
type: (StringConstructor | ObjectConstructor | ArrayConstructor)[];
|
|
107
|
+
default: string;
|
|
108
|
+
};
|
|
109
|
+
/**
|
|
110
|
+
* Tags to unwrap separated by spaces
|
|
111
|
+
* Example: 'ul li'
|
|
112
|
+
*/
|
|
113
|
+
unwrap: {
|
|
114
|
+
type: (StringConstructor | BooleanConstructor)[];
|
|
115
|
+
default: boolean;
|
|
116
|
+
};
|
|
117
|
+
/**
|
|
118
|
+
* Async Data Unique Key
|
|
119
|
+
* @default `hash(props.value)`
|
|
120
|
+
*/
|
|
121
|
+
cacheKey: {
|
|
122
|
+
type: StringConstructor;
|
|
123
|
+
default: undefined;
|
|
124
|
+
};
|
|
125
|
+
/**
|
|
126
|
+
* Partial parsing (if partial is `true`, title and toc generation will not be generated)
|
|
127
|
+
*/
|
|
128
|
+
partial: {
|
|
129
|
+
type: BooleanConstructor;
|
|
130
|
+
default: boolean;
|
|
131
|
+
};
|
|
132
|
+
/**
|
|
133
|
+
* The map of custom components to use for rendering.
|
|
134
|
+
*/
|
|
135
|
+
components: {
|
|
136
|
+
type: PropType<Record<string, string | DefineComponent<any, any, any>>>;
|
|
137
|
+
default: () => {};
|
|
138
|
+
};
|
|
139
|
+
}>> & Readonly<{}>, {
|
|
140
|
+
tag: string | boolean;
|
|
141
|
+
excerpt: boolean;
|
|
142
|
+
parserOptions: MDCParseOptions;
|
|
143
|
+
class: string | unknown[] | Record<string, any>;
|
|
144
|
+
unwrap: string | boolean;
|
|
145
|
+
cacheKey: string;
|
|
146
|
+
partial: boolean;
|
|
147
|
+
components: Record<string, string | DefineComponent<any, any, any>>;
|
|
148
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
149
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
150
|
+
export default _default;
|
|
151
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
152
|
+
new (): {
|
|
153
|
+
$slots: S;
|
|
154
|
+
};
|
|
155
|
+
};
|
|
@@ -72,12 +72,12 @@ export default defineComponent({
|
|
|
72
72
|
const $nuxt = app?.$nuxt;
|
|
73
73
|
const route = $nuxt?.$route || $nuxt?._route;
|
|
74
74
|
const { mdc } = $nuxt?.$config?.public || {};
|
|
75
|
-
const tags = {
|
|
75
|
+
const tags = computed(() => ({
|
|
76
76
|
...mdc?.components?.prose && props.prose !== false ? proseComponentMap : {},
|
|
77
77
|
...mdc?.components?.map || {},
|
|
78
78
|
...toRaw(props.data?.mdc?.components || {}),
|
|
79
79
|
...props.components
|
|
80
|
-
};
|
|
80
|
+
}));
|
|
81
81
|
const contentKey = computed(() => {
|
|
82
82
|
const components = (props.body?.children || []).map((n) => n.tag || n.type).filter((t) => !htmlTags.includes(t));
|
|
83
83
|
return Array.from(new Set(components)).sort().join(".");
|
|
@@ -88,7 +88,7 @@ export default defineComponent({
|
|
|
88
88
|
watch(() => props.data, (newData) => {
|
|
89
89
|
Object.assign(runtimeData, newData);
|
|
90
90
|
});
|
|
91
|
-
await resolveContentComponents(props.body, { tags });
|
|
91
|
+
await resolveContentComponents(props.body, { tags: tags.value });
|
|
92
92
|
function updateRuntimeData(code, value) {
|
|
93
93
|
const lastIndex = code.split(".").length - 1;
|
|
94
94
|
return code.split(".").reduce((o, k, i) => {
|
|
@@ -124,7 +124,7 @@ export default defineComponent({
|
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
126
|
});
|
|
127
|
-
function _renderNode(node, h2, options) {
|
|
127
|
+
function _renderNode(node, h2, options, keyInParent) {
|
|
128
128
|
const { documentMeta, parentScope, resolveComponent } = options;
|
|
129
129
|
if (node.type === "text") {
|
|
130
130
|
return h2(Text, node.value);
|
|
@@ -150,6 +150,9 @@ function _renderNode(node, h2, options) {
|
|
|
150
150
|
component.tag = originalTag;
|
|
151
151
|
}
|
|
152
152
|
const props = propsToData(node, documentMeta);
|
|
153
|
+
if (keyInParent) {
|
|
154
|
+
props.key = keyInParent;
|
|
155
|
+
}
|
|
153
156
|
return h2(
|
|
154
157
|
component,
|
|
155
158
|
props,
|
|
@@ -188,15 +191,18 @@ function _renderSlots(node, h2, options) {
|
|
|
188
191
|
}
|
|
189
192
|
slots2[name] = (data = {}) => {
|
|
190
193
|
const scopedProps = pick(data, Object.keys(props || {}));
|
|
191
|
-
let vNodes = children2.map((child) =>
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
194
|
+
let vNodes = children2.map((child, index) => {
|
|
195
|
+
return _renderNode(
|
|
196
|
+
child,
|
|
197
|
+
h2,
|
|
198
|
+
{
|
|
199
|
+
documentMeta,
|
|
200
|
+
parentScope: { ...parentScope, ...scopedProps },
|
|
201
|
+
resolveComponent
|
|
202
|
+
},
|
|
203
|
+
String(child.props?.key || index)
|
|
204
|
+
);
|
|
205
|
+
});
|
|
200
206
|
if (props?.unwrap) {
|
|
201
207
|
vNodes = flatUnwrap(vNodes, props.unwrap);
|
|
202
208
|
}
|
|
@@ -19,14 +19,14 @@ declare const _default: DefineComponent<import("vue").ExtractPropTypes<{
|
|
|
19
19
|
* Class(es) to bind to the component
|
|
20
20
|
*/
|
|
21
21
|
class: {
|
|
22
|
-
type: (
|
|
22
|
+
type: (StringConstructor | ObjectConstructor)[];
|
|
23
23
|
default: undefined;
|
|
24
24
|
};
|
|
25
25
|
/**
|
|
26
26
|
* Root tag to use for rendering
|
|
27
27
|
*/
|
|
28
28
|
tag: {
|
|
29
|
-
type: (
|
|
29
|
+
type: (StringConstructor | BooleanConstructor)[];
|
|
30
30
|
default: undefined;
|
|
31
31
|
};
|
|
32
32
|
/**
|
|
@@ -48,11 +48,11 @@ declare const _default: DefineComponent<import("vue").ExtractPropTypes<{
|
|
|
48
48
|
* Example: 'ul li'
|
|
49
49
|
*/
|
|
50
50
|
unwrap: {
|
|
51
|
-
type: (
|
|
51
|
+
type: (StringConstructor | BooleanConstructor)[];
|
|
52
52
|
default: boolean;
|
|
53
53
|
};
|
|
54
54
|
}>, {
|
|
55
|
-
tags: any
|
|
55
|
+
tags: import("vue").ComputedRef<any>;
|
|
56
56
|
contentKey: import("vue").ComputedRef<string>;
|
|
57
57
|
route: any;
|
|
58
58
|
runtimeData: {
|
|
@@ -80,14 +80,14 @@ declare const _default: DefineComponent<import("vue").ExtractPropTypes<{
|
|
|
80
80
|
* Class(es) to bind to the component
|
|
81
81
|
*/
|
|
82
82
|
class: {
|
|
83
|
-
type: (
|
|
83
|
+
type: (StringConstructor | ObjectConstructor)[];
|
|
84
84
|
default: undefined;
|
|
85
85
|
};
|
|
86
86
|
/**
|
|
87
87
|
* Root tag to use for rendering
|
|
88
88
|
*/
|
|
89
89
|
tag: {
|
|
90
|
-
type: (
|
|
90
|
+
type: (StringConstructor | BooleanConstructor)[];
|
|
91
91
|
default: undefined;
|
|
92
92
|
};
|
|
93
93
|
/**
|
|
@@ -109,127 +109,15 @@ declare const _default: DefineComponent<import("vue").ExtractPropTypes<{
|
|
|
109
109
|
* Example: 'ul li'
|
|
110
110
|
*/
|
|
111
111
|
unwrap: {
|
|
112
|
-
type: (
|
|
112
|
+
type: (StringConstructor | BooleanConstructor)[];
|
|
113
113
|
default: boolean;
|
|
114
114
|
};
|
|
115
115
|
}>> & Readonly<{}>, {
|
|
116
|
-
data: Record<string, any>;
|
|
117
|
-
class: string | Record<string, any>;
|
|
118
116
|
tag: string | boolean;
|
|
119
|
-
|
|
120
|
-
components: Record<string, string | DefineComponent<any, any, any>>;
|
|
117
|
+
class: string | Record<string, any>;
|
|
121
118
|
unwrap: string | boolean;
|
|
119
|
+
data: Record<string, any>;
|
|
120
|
+
components: Record<string, string | DefineComponent<any, any, any>>;
|
|
121
|
+
prose: boolean;
|
|
122
122
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
123
123
|
export default _default;
|
|
124
|
-
declare global {
|
|
125
|
-
const __VLS_intrinsicElements: __VLS_IntrinsicElements;
|
|
126
|
-
const __VLS_directiveBindingRestFields: {
|
|
127
|
-
instance: null;
|
|
128
|
-
oldValue: null;
|
|
129
|
-
modifiers: any;
|
|
130
|
-
dir: any;
|
|
131
|
-
};
|
|
132
|
-
const __VLS_unref: typeof import('vue').unref;
|
|
133
|
-
const __VLS_placeholder: any;
|
|
134
|
-
type __VLS_NativeElements = __VLS_SpreadMerge<SVGElementTagNameMap, HTMLElementTagNameMap>;
|
|
135
|
-
type __VLS_IntrinsicElements = import('vue/jsx-runtime').JSX.IntrinsicElements;
|
|
136
|
-
type __VLS_Element = import('vue/jsx-runtime').JSX.Element;
|
|
137
|
-
type __VLS_GlobalComponents = import('vue').GlobalComponents;
|
|
138
|
-
type __VLS_GlobalDirectives = import('vue').GlobalDirectives;
|
|
139
|
-
type __VLS_IsAny<T> = 0 extends 1 & T ? true : false;
|
|
140
|
-
type __VLS_PickNotAny<A, B> = __VLS_IsAny<A> extends true ? B : A;
|
|
141
|
-
type __VLS_SpreadMerge<A, B> = Omit<A, keyof B> & B;
|
|
142
|
-
type __VLS_WithComponent<N0 extends string, LocalComponents, Self, N1 extends string, N2 extends string, N3 extends string> = N1 extends keyof LocalComponents ? N1 extends N0 ? Pick<LocalComponents, N0 extends keyof LocalComponents ? N0 : never> : {
|
|
143
|
-
[K in N0]: LocalComponents[N1];
|
|
144
|
-
} : N2 extends keyof LocalComponents ? N2 extends N0 ? Pick<LocalComponents, N0 extends keyof LocalComponents ? N0 : never> : {
|
|
145
|
-
[K in N0]: LocalComponents[N2];
|
|
146
|
-
} : N3 extends keyof LocalComponents ? N3 extends N0 ? Pick<LocalComponents, N0 extends keyof LocalComponents ? N0 : never> : {
|
|
147
|
-
[K in N0]: LocalComponents[N3];
|
|
148
|
-
} : Self extends object ? {
|
|
149
|
-
[K in N0]: Self;
|
|
150
|
-
} : N1 extends keyof __VLS_GlobalComponents ? N1 extends N0 ? Pick<__VLS_GlobalComponents, N0 extends keyof __VLS_GlobalComponents ? N0 : never> : {
|
|
151
|
-
[K in N0]: __VLS_GlobalComponents[N1];
|
|
152
|
-
} : N2 extends keyof __VLS_GlobalComponents ? N2 extends N0 ? Pick<__VLS_GlobalComponents, N0 extends keyof __VLS_GlobalComponents ? N0 : never> : {
|
|
153
|
-
[K in N0]: __VLS_GlobalComponents[N2];
|
|
154
|
-
} : N3 extends keyof __VLS_GlobalComponents ? N3 extends N0 ? Pick<__VLS_GlobalComponents, N0 extends keyof __VLS_GlobalComponents ? N0 : never> : {
|
|
155
|
-
[K in N0]: __VLS_GlobalComponents[N3];
|
|
156
|
-
} : {
|
|
157
|
-
[K in N0]: unknown;
|
|
158
|
-
};
|
|
159
|
-
type __VLS_FunctionalComponentProps<T, K> = '__ctx' extends keyof __VLS_PickNotAny<K, {}> ? K extends {
|
|
160
|
-
__ctx?: {
|
|
161
|
-
props?: infer P;
|
|
162
|
-
};
|
|
163
|
-
} ? NonNullable<P> : never : T extends (props: infer P, ...args: any) => any ? P : {};
|
|
164
|
-
type __VLS_IsFunction<T, K> = K extends keyof T ? __VLS_IsAny<T[K]> extends false ? unknown extends T[K] ? false : true : false : false;
|
|
165
|
-
type __VLS_NormalizeComponentEvent<Props, Events, onEvent extends keyof Props, Event extends keyof Events, CamelizedEvent extends keyof Events> = (__VLS_IsFunction<Props, onEvent> extends true ? Props : __VLS_IsFunction<Events, Event> extends true ? {
|
|
166
|
-
[K in onEvent]?: Events[Event];
|
|
167
|
-
} : __VLS_IsFunction<Events, CamelizedEvent> extends true ? {
|
|
168
|
-
[K in onEvent]?: Events[CamelizedEvent];
|
|
169
|
-
} : Props) & Record<string, unknown>;
|
|
170
|
-
type __VLS_UnionToIntersection<U> = (U extends unknown ? (arg: U) => unknown : never) extends ((arg: infer P) => unknown) ? P : never;
|
|
171
|
-
type __VLS_OverloadUnionInner<T, U = unknown> = U & T extends (...args: infer A) => infer R ? U extends T ? never : __VLS_OverloadUnionInner<T, Pick<T, keyof T> & U & ((...args: A) => R)> | ((...args: A) => R) : never;
|
|
172
|
-
type __VLS_OverloadUnion<T> = Exclude<__VLS_OverloadUnionInner<(() => never) & T>, T extends () => never ? never : () => never>;
|
|
173
|
-
type __VLS_ConstructorOverloads<T> = __VLS_OverloadUnion<T> extends infer F ? F extends (event: infer E, ...args: infer A) => any ? {
|
|
174
|
-
[K in E & string]: (...args: A) => void;
|
|
175
|
-
} : never : never;
|
|
176
|
-
type __VLS_NormalizeEmits<T> = __VLS_PrettifyGlobal<__VLS_UnionToIntersection<__VLS_ConstructorOverloads<T> & {
|
|
177
|
-
[K in keyof T]: T[K] extends any[] ? {
|
|
178
|
-
(...args: T[K]): void;
|
|
179
|
-
} : never;
|
|
180
|
-
}>>;
|
|
181
|
-
type __VLS_PrettifyGlobal<T> = {
|
|
182
|
-
[K in keyof T]: T[K];
|
|
183
|
-
} & {};
|
|
184
|
-
type __VLS_PickFunctionalComponentCtx<T, K> = NonNullable<__VLS_PickNotAny<'__ctx' extends keyof __VLS_PickNotAny<K, {}> ? K extends {
|
|
185
|
-
__ctx?: infer Ctx;
|
|
186
|
-
} ? Ctx : never : any, T extends (props: any, ctx: infer Ctx) => any ? Ctx : any>>;
|
|
187
|
-
type __VLS_OmitStringIndex<T> = {
|
|
188
|
-
[K in keyof T as string extends K ? never : K]: T[K];
|
|
189
|
-
};
|
|
190
|
-
type __VLS_UseTemplateRef<T> = Readonly<import('vue').ShallowRef<T | null>>;
|
|
191
|
-
function __VLS_getVForSourceType<T extends number | string | any[] | Iterable<any>>(source: T): [
|
|
192
|
-
item: T extends number ? number : T extends string ? string : T extends any[] ? T[number] : T extends Iterable<infer T1> ? T1 : any,
|
|
193
|
-
index: number
|
|
194
|
-
][];
|
|
195
|
-
function __VLS_getVForSourceType<T>(source: T): [
|
|
196
|
-
item: T[keyof T],
|
|
197
|
-
key: keyof T,
|
|
198
|
-
index: number
|
|
199
|
-
][];
|
|
200
|
-
function __VLS_getSlotParams<T>(slot: T): Parameters<__VLS_PickNotAny<NonNullable<T>, (...args: any[]) => any>>;
|
|
201
|
-
function __VLS_getSlotParam<T>(slot: T): Parameters<__VLS_PickNotAny<NonNullable<T>, (...args: any[]) => any>>[0];
|
|
202
|
-
function __VLS_asFunctionalDirective<T>(dir: T): T extends import('vue').ObjectDirective ? NonNullable<T['created' | 'beforeMount' | 'mounted' | 'beforeUpdate' | 'updated' | 'beforeUnmount' | 'unmounted']> : T extends (...args: any) => any ? T : (arg1: unknown, arg2: unknown, arg3: unknown, arg4: unknown) => void;
|
|
203
|
-
function __VLS_makeOptional<T>(t: T): {
|
|
204
|
-
[K in keyof T]?: T[K];
|
|
205
|
-
};
|
|
206
|
-
function __VLS_asFunctionalComponent<T, K = T extends new (...args: any) => any ? InstanceType<T> : unknown>(t: T, instance?: K): T extends new (...args: any) => any ? (props: (K extends {
|
|
207
|
-
$props: infer Props;
|
|
208
|
-
} ? Props : any) & Record<string, unknown>, ctx?: any) => __VLS_Element & {
|
|
209
|
-
__ctx?: {
|
|
210
|
-
attrs?: any;
|
|
211
|
-
slots?: K extends {
|
|
212
|
-
$slots: infer Slots;
|
|
213
|
-
} ? Slots : any;
|
|
214
|
-
emit?: K extends {
|
|
215
|
-
$emit: infer Emit;
|
|
216
|
-
} ? Emit : any;
|
|
217
|
-
expose?(exposed: K): void;
|
|
218
|
-
props?: (K extends {
|
|
219
|
-
$props: infer Props;
|
|
220
|
-
} ? Props : any) & Record<string, unknown>;
|
|
221
|
-
};
|
|
222
|
-
} : T extends () => any ? (props: {}, ctx?: any) => ReturnType<T> : T extends (...args: any) => any ? T : (_: {} & Record<string, unknown>, ctx?: any) => {
|
|
223
|
-
__ctx?: {
|
|
224
|
-
attrs?: any;
|
|
225
|
-
expose?: any;
|
|
226
|
-
slots?: any;
|
|
227
|
-
emit?: any;
|
|
228
|
-
props?: {} & Record<string, unknown>;
|
|
229
|
-
};
|
|
230
|
-
};
|
|
231
|
-
function __VLS_functionalComponentArgsRest<T extends (...args: any) => any>(t: T): 2 extends Parameters<T>['length'] ? [any] : [];
|
|
232
|
-
function __VLS_asFunctionalElement<T>(tag: T, endTag?: T): (attrs: T & Record<string, unknown>) => void;
|
|
233
|
-
function __VLS_asFunctionalSlot<S>(slot: S): (props: NonNullable<S> extends (props: infer P) => any ? P : {}) => void;
|
|
234
|
-
function __VLS_tryAsConstant<const T>(t: T): T;
|
|
235
|
-
}
|
|
@@ -12,7 +12,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
12
12
|
* Example: 'ul li'
|
|
13
13
|
*/
|
|
14
14
|
unwrap: {
|
|
15
|
-
type: (
|
|
15
|
+
type: (StringConstructor | BooleanConstructor)[];
|
|
16
16
|
default: boolean;
|
|
17
17
|
};
|
|
18
18
|
/**
|
|
@@ -37,7 +37,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
37
37
|
* Example: 'ul li'
|
|
38
38
|
*/
|
|
39
39
|
unwrap: {
|
|
40
|
-
type: (
|
|
40
|
+
type: (StringConstructor | BooleanConstructor)[];
|
|
41
41
|
default: boolean;
|
|
42
42
|
};
|
|
43
43
|
/**
|
|
@@ -7,18 +7,16 @@
|
|
|
7
7
|
</NuxtLink>
|
|
8
8
|
</template>
|
|
9
9
|
|
|
10
|
-
<script setup
|
|
11
|
-
import type { PropType } from 'vue'
|
|
12
|
-
|
|
10
|
+
<script setup>
|
|
13
11
|
const props = defineProps({
|
|
14
12
|
href: {
|
|
15
13
|
type: String,
|
|
16
|
-
default:
|
|
14
|
+
default: ""
|
|
17
15
|
},
|
|
18
16
|
target: {
|
|
19
|
-
type: String
|
|
20
|
-
default:
|
|
17
|
+
type: String,
|
|
18
|
+
default: void 0,
|
|
21
19
|
required: false
|
|
22
20
|
}
|
|
23
|
-
})
|
|
21
|
+
});
|
|
24
22
|
</script>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { PropType } from 'vue';
|
|
2
|
+
declare var __VLS_7: {};
|
|
3
|
+
type __VLS_Slots = {} & {
|
|
4
|
+
default?: (props: typeof __VLS_7) => any;
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_component: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
7
|
+
href: {
|
|
8
|
+
type: StringConstructor;
|
|
9
|
+
default: string;
|
|
10
|
+
};
|
|
11
|
+
target: {
|
|
12
|
+
type: PropType<"_blank" | "_parent" | "_self" | "_top" | (string & object) | null | undefined>;
|
|
13
|
+
default: undefined;
|
|
14
|
+
required: false;
|
|
15
|
+
};
|
|
16
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
17
|
+
href: {
|
|
18
|
+
type: StringConstructor;
|
|
19
|
+
default: string;
|
|
20
|
+
};
|
|
21
|
+
target: {
|
|
22
|
+
type: PropType<"_blank" | "_parent" | "_self" | "_top" | (string & object) | null | undefined>;
|
|
23
|
+
default: undefined;
|
|
24
|
+
required: false;
|
|
25
|
+
};
|
|
26
|
+
}>> & Readonly<{}>, {
|
|
27
|
+
href: string;
|
|
28
|
+
target: "_blank" | "_parent" | "_self" | "_top" | null | undefined;
|
|
29
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
30
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
31
|
+
export default _default;
|
|
32
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
33
|
+
new (): {
|
|
34
|
+
$slots: S;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare var __VLS_1: {};
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
default?: (props: typeof __VLS_1) => any;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_component: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
7
|
+
export default _default;
|
|
8
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
9
|
+
new (): {
|
|
10
|
+
$slots: S;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare var __VLS_1: {};
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
default?: (props: typeof __VLS_1) => any;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_component: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
7
|
+
export default _default;
|
|
8
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
9
|
+
new (): {
|
|
10
|
+
$slots: S;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare var __VLS_1: {};
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
default?: (props: typeof __VLS_1) => any;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_component: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
7
|
+
export default _default;
|
|
8
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
9
|
+
new (): {
|
|
10
|
+
$slots: S;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
</h1>
|
|
11
11
|
</template>
|
|
12
12
|
|
|
13
|
-
<script setup
|
|
14
|
-
import { computed, useRuntimeConfig } from
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const { headings } = useRuntimeConfig().public.mdc
|
|
19
|
-
const generate = computed(() => props.id && (
|
|
13
|
+
<script setup>
|
|
14
|
+
import { computed, useRuntimeConfig } from "#imports";
|
|
15
|
+
const props = defineProps({
|
|
16
|
+
id: { type: String, required: false }
|
|
17
|
+
});
|
|
18
|
+
const { headings } = useRuntimeConfig().public.mdc;
|
|
19
|
+
const generate = computed(() => props.id && (typeof headings?.anchorLinks === "boolean" && headings?.anchorLinks === true || typeof headings?.anchorLinks === "object" && headings?.anchorLinks?.h1));
|
|
20
20
|
</script>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
id?: string;
|
|
3
|
+
};
|
|
4
|
+
declare var __VLS_1: {}, __VLS_3: {};
|
|
5
|
+
type __VLS_Slots = {} & {
|
|
6
|
+
default?: (props: typeof __VLS_1) => any;
|
|
7
|
+
} & {
|
|
8
|
+
default?: (props: typeof __VLS_3) => any;
|
|
9
|
+
};
|
|
10
|
+
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>;
|
|
11
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
12
|
+
export default _default;
|
|
13
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
14
|
+
new (): {
|
|
15
|
+
$slots: S;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
</h2>
|
|
11
11
|
</template>
|
|
12
12
|
|
|
13
|
-
<script setup
|
|
14
|
-
import { computed, useRuntimeConfig } from
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const { headings } = useRuntimeConfig().public.mdc
|
|
19
|
-
const generate = computed(() => props.id && (
|
|
13
|
+
<script setup>
|
|
14
|
+
import { computed, useRuntimeConfig } from "#imports";
|
|
15
|
+
const props = defineProps({
|
|
16
|
+
id: { type: String, required: false }
|
|
17
|
+
});
|
|
18
|
+
const { headings } = useRuntimeConfig().public.mdc;
|
|
19
|
+
const generate = computed(() => props.id && (typeof headings?.anchorLinks === "boolean" && headings?.anchorLinks === true || typeof headings?.anchorLinks === "object" && headings?.anchorLinks?.h2));
|
|
20
20
|
</script>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
id?: string;
|
|
3
|
+
};
|
|
4
|
+
declare var __VLS_1: {}, __VLS_3: {};
|
|
5
|
+
type __VLS_Slots = {} & {
|
|
6
|
+
default?: (props: typeof __VLS_1) => any;
|
|
7
|
+
} & {
|
|
8
|
+
default?: (props: typeof __VLS_3) => any;
|
|
9
|
+
};
|
|
10
|
+
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>;
|
|
11
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
12
|
+
export default _default;
|
|
13
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
14
|
+
new (): {
|
|
15
|
+
$slots: S;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
</h3>
|
|
11
11
|
</template>
|
|
12
12
|
|
|
13
|
-
<script setup
|
|
14
|
-
import { computed, useRuntimeConfig } from
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const { headings } = useRuntimeConfig().public.mdc
|
|
19
|
-
const generate = computed(() => props.id && (
|
|
13
|
+
<script setup>
|
|
14
|
+
import { computed, useRuntimeConfig } from "#imports";
|
|
15
|
+
const props = defineProps({
|
|
16
|
+
id: { type: String, required: false }
|
|
17
|
+
});
|
|
18
|
+
const { headings } = useRuntimeConfig().public.mdc;
|
|
19
|
+
const generate = computed(() => props.id && (typeof headings?.anchorLinks === "boolean" && headings?.anchorLinks === true || typeof headings?.anchorLinks === "object" && headings?.anchorLinks?.h3));
|
|
20
20
|
</script>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
id?: string;
|
|
3
|
+
};
|
|
4
|
+
declare var __VLS_1: {}, __VLS_3: {};
|
|
5
|
+
type __VLS_Slots = {} & {
|
|
6
|
+
default?: (props: typeof __VLS_1) => any;
|
|
7
|
+
} & {
|
|
8
|
+
default?: (props: typeof __VLS_3) => any;
|
|
9
|
+
};
|
|
10
|
+
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>;
|
|
11
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
12
|
+
export default _default;
|
|
13
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
14
|
+
new (): {
|
|
15
|
+
$slots: S;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
</h4>
|
|
11
11
|
</template>
|
|
12
12
|
|
|
13
|
-
<script setup
|
|
14
|
-
import { computed, useRuntimeConfig } from
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const { headings } = useRuntimeConfig().public.mdc
|
|
19
|
-
const generate = computed(() => props.id && (
|
|
13
|
+
<script setup>
|
|
14
|
+
import { computed, useRuntimeConfig } from "#imports";
|
|
15
|
+
const props = defineProps({
|
|
16
|
+
id: { type: String, required: false }
|
|
17
|
+
});
|
|
18
|
+
const { headings } = useRuntimeConfig().public.mdc;
|
|
19
|
+
const generate = computed(() => props.id && (typeof headings?.anchorLinks === "boolean" && headings?.anchorLinks === true || typeof headings?.anchorLinks === "object" && headings?.anchorLinks?.h4));
|
|
20
20
|
</script>
|