@nuxtjs/mdc 0.8.3 → 0.9.0

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 (29) hide show
  1. package/dist/module.d.mts +8 -13
  2. package/dist/module.d.ts +8 -13
  3. package/dist/module.json +2 -2
  4. package/dist/runtime/components/MDC.vue +1 -1
  5. package/dist/runtime/components/MDCRenderer.vue.d.ts +308 -6
  6. package/dist/runtime/components/MDCSlot.vue +1 -1
  7. package/dist/runtime/components/MDCSlot.vue.d.ts +6 -6
  8. package/dist/runtime/components/prose/ProseA.vue +3 -3
  9. package/dist/runtime/components/prose/ProseH1.vue +2 -2
  10. package/dist/runtime/components/prose/ProseH2.vue +3 -3
  11. package/dist/runtime/components/prose/ProseH3.vue +3 -3
  12. package/dist/runtime/components/prose/ProseH4.vue +3 -3
  13. package/dist/runtime/components/prose/ProseH5.vue +3 -3
  14. package/dist/runtime/components/prose/ProseH6.vue +3 -3
  15. package/dist/runtime/components/prose/ProseImg.vue +3 -3
  16. package/dist/runtime/highlighter/shiki.js +21 -15
  17. package/dist/runtime/index.d.ts +1 -1
  18. package/dist/runtime/parser/handlers/code.d.ts +1 -1
  19. package/dist/runtime/parser/handlers/containerComponent.d.ts +1 -1
  20. package/dist/runtime/parser/handlers/emphasis.d.ts +1 -1
  21. package/dist/runtime/parser/handlers/html.d.ts +1 -1
  22. package/dist/runtime/parser/handlers/image.d.ts +1 -1
  23. package/dist/runtime/parser/handlers/inlineCode.d.ts +1 -1
  24. package/dist/runtime/parser/handlers/link.d.ts +1 -1
  25. package/dist/runtime/parser/handlers/list.d.ts +1 -1
  26. package/dist/runtime/parser/handlers/paragraph.d.ts +1 -1
  27. package/dist/runtime/parser/handlers/strong.d.ts +1 -1
  28. package/dist/runtime/utils/slot.d.ts +1 -1
  29. package/package.json +21 -21
package/dist/module.d.mts CHANGED
@@ -167,6 +167,7 @@ interface ModuleOptions {
167
167
  * ```
168
168
  */
169
169
  interface Data$1 {
170
+ [key: string]: unknown;
170
171
  }
171
172
  /**
172
173
  * One place in a source file.
@@ -273,8 +274,7 @@ interface Parent$1 extends Node$1 {
273
274
  * }
274
275
  * ```
275
276
  */
276
- interface Data extends Data$1 {
277
- }
277
+ type Data = Data$1;
278
278
  /**
279
279
  * Info associated with an element.
280
280
  */
@@ -410,8 +410,7 @@ interface Comment extends Literal {
410
410
  /**
411
411
  * Info associated with hast comments by the ecosystem.
412
412
  */
413
- interface CommentData extends Data {
414
- }
413
+ type CommentData = Data;
415
414
  /**
416
415
  * HTML document type.
417
416
  */
@@ -428,8 +427,7 @@ interface Doctype extends Node$1 {
428
427
  /**
429
428
  * Info associated with hast doctypes by the ecosystem.
430
429
  */
431
- interface DoctypeData extends Data {
432
- }
430
+ type DoctypeData = Data;
433
431
  /**
434
432
  * HTML element.
435
433
  */
@@ -463,8 +461,7 @@ interface Element extends Parent {
463
461
  /**
464
462
  * Info associated with hast elements by the ecosystem.
465
463
  */
466
- interface ElementData extends Data {
467
- }
464
+ type ElementData = Data;
468
465
  /**
469
466
  * Document fragment or a whole document.
470
467
  *
@@ -489,8 +486,7 @@ interface Root extends Parent {
489
486
  /**
490
487
  * Info associated with hast root nodes by the ecosystem.
491
488
  */
492
- interface RootData extends Data {
493
- }
489
+ type RootData = Data;
494
490
  /**
495
491
  * HTML character data (plain text).
496
492
  */
@@ -507,11 +503,10 @@ interface Text extends Literal {
507
503
  /**
508
504
  * Info associated with hast texts by the ecosystem.
509
505
  */
510
- interface TextData extends Data {
511
- }
506
+ type TextData = Data;
512
507
 
513
508
  declare const DefaultHighlightLangs: BundledLanguage[];
514
- declare const _default: _nuxt_schema.NuxtModule<ModuleOptions>;
509
+ declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
515
510
 
516
511
  declare module '@nuxt/schema' {
517
512
  interface NuxtHooks {
package/dist/module.d.ts CHANGED
@@ -167,6 +167,7 @@ interface ModuleOptions {
167
167
  * ```
168
168
  */
169
169
  interface Data$1 {
170
+ [key: string]: unknown;
170
171
  }
171
172
  /**
172
173
  * One place in a source file.
@@ -273,8 +274,7 @@ interface Parent$1 extends Node$1 {
273
274
  * }
274
275
  * ```
275
276
  */
276
- interface Data extends Data$1 {
277
- }
277
+ type Data = Data$1;
278
278
  /**
279
279
  * Info associated with an element.
280
280
  */
@@ -410,8 +410,7 @@ interface Comment extends Literal {
410
410
  /**
411
411
  * Info associated with hast comments by the ecosystem.
412
412
  */
413
- interface CommentData extends Data {
414
- }
413
+ type CommentData = Data;
415
414
  /**
416
415
  * HTML document type.
417
416
  */
@@ -428,8 +427,7 @@ interface Doctype extends Node$1 {
428
427
  /**
429
428
  * Info associated with hast doctypes by the ecosystem.
430
429
  */
431
- interface DoctypeData extends Data {
432
- }
430
+ type DoctypeData = Data;
433
431
  /**
434
432
  * HTML element.
435
433
  */
@@ -463,8 +461,7 @@ interface Element extends Parent {
463
461
  /**
464
462
  * Info associated with hast elements by the ecosystem.
465
463
  */
466
- interface ElementData extends Data {
467
- }
464
+ type ElementData = Data;
468
465
  /**
469
466
  * Document fragment or a whole document.
470
467
  *
@@ -489,8 +486,7 @@ interface Root extends Parent {
489
486
  /**
490
487
  * Info associated with hast root nodes by the ecosystem.
491
488
  */
492
- interface RootData extends Data {
493
- }
489
+ type RootData = Data;
494
490
  /**
495
491
  * HTML character data (plain text).
496
492
  */
@@ -507,11 +503,10 @@ interface Text extends Literal {
507
503
  /**
508
504
  * Info associated with hast texts by the ecosystem.
509
505
  */
510
- interface TextData extends Data {
511
- }
506
+ type TextData = Data;
512
507
 
513
508
  declare const DefaultHighlightLangs: BundledLanguage[];
514
- declare const _default: _nuxt_schema.NuxtModule<ModuleOptions>;
509
+ declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
515
510
 
516
511
  declare module '@nuxt/schema' {
517
512
  interface NuxtHooks {
package/dist/module.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@nuxtjs/mdc",
3
3
  "configKey": "mdc",
4
- "version": "0.8.3",
4
+ "version": "0.9.0",
5
5
  "builder": {
6
- "@nuxt/module-builder": "0.8.1",
6
+ "@nuxt/module-builder": "0.8.4",
7
7
  "unbuild": "2.0.0"
8
8
  }
9
9
  }
@@ -8,7 +8,7 @@
8
8
  >
9
9
  <MDCRenderer
10
10
  v-if="body"
11
- :tag="tag"
11
+ :tag="props.tag"
12
12
  :class="props.class"
13
13
  :body="body"
14
14
  :data="data?.data"
@@ -1,6 +1,6 @@
1
1
  import type { PropType, DefineComponent } from 'vue';
2
2
  import type { MDCRoot } from '@nuxtjs/mdc';
3
- declare const _default: DefineComponent<{
3
+ declare const _default: DefineComponent<import("vue").ExtractPropTypes<{
4
4
  /**
5
5
  * Content to render
6
6
  */
@@ -51,11 +51,11 @@ declare const _default: DefineComponent<{
51
51
  type: (BooleanConstructor | StringConstructor)[];
52
52
  default: boolean;
53
53
  };
54
- }, {
54
+ }>, {
55
55
  tags: any;
56
56
  contentKey: import("vue").ComputedRef<string>;
57
- route: {} | undefined;
58
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
57
+ route: any;
58
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
59
59
  /**
60
60
  * Content to render
61
61
  */
@@ -106,12 +106,314 @@ declare const _default: DefineComponent<{
106
106
  type: (BooleanConstructor | StringConstructor)[];
107
107
  default: boolean;
108
108
  };
109
- }>>, {
109
+ }>> & Readonly<{}>, {
110
110
  data: Record<string, any>;
111
111
  class: string | Record<string, any>;
112
112
  tag: string | boolean;
113
113
  prose: boolean;
114
114
  components: Record<string, string | DefineComponent<any, any, any>>;
115
115
  unwrap: string | boolean;
116
- }, {}>;
116
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
117
117
  export default _default;
118
+ declare module 'vue' {
119
+ interface GlobalComponents {
120
+ }
121
+ interface GlobalDirectives {
122
+ }
123
+ }
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_nativeElements: {
134
+ a: HTMLAnchorElement;
135
+ abbr: HTMLElement;
136
+ address: HTMLElement;
137
+ area: HTMLAreaElement;
138
+ article: HTMLElement;
139
+ aside: HTMLElement;
140
+ audio: HTMLAudioElement;
141
+ b: HTMLElement;
142
+ base: HTMLBaseElement;
143
+ bdi: HTMLElement;
144
+ bdo: HTMLElement;
145
+ blockquote: HTMLQuoteElement;
146
+ body: HTMLBodyElement;
147
+ br: HTMLBRElement;
148
+ button: HTMLButtonElement;
149
+ canvas: HTMLCanvasElement;
150
+ caption: HTMLTableCaptionElement;
151
+ cite: HTMLElement;
152
+ code: HTMLElement;
153
+ col: HTMLTableColElement;
154
+ colgroup: HTMLTableColElement;
155
+ data: HTMLDataElement;
156
+ datalist: HTMLDataListElement;
157
+ dd: HTMLElement;
158
+ del: HTMLModElement;
159
+ details: HTMLDetailsElement;
160
+ dfn: HTMLElement;
161
+ dialog: HTMLDialogElement;
162
+ div: HTMLDivElement;
163
+ dl: HTMLDListElement;
164
+ dt: HTMLElement;
165
+ em: HTMLElement;
166
+ embed: HTMLEmbedElement;
167
+ fieldset: HTMLFieldSetElement;
168
+ figcaption: HTMLElement;
169
+ figure: HTMLElement;
170
+ footer: HTMLElement;
171
+ form: HTMLFormElement;
172
+ h1: HTMLHeadingElement;
173
+ h2: HTMLHeadingElement;
174
+ h3: HTMLHeadingElement;
175
+ h4: HTMLHeadingElement;
176
+ h5: HTMLHeadingElement;
177
+ h6: HTMLHeadingElement;
178
+ head: HTMLHeadElement;
179
+ header: HTMLElement;
180
+ hgroup: HTMLElement;
181
+ hr: HTMLHRElement;
182
+ html: HTMLHtmlElement;
183
+ i: HTMLElement;
184
+ iframe: HTMLIFrameElement;
185
+ img: HTMLImageElement;
186
+ input: HTMLInputElement;
187
+ ins: HTMLModElement;
188
+ kbd: HTMLElement;
189
+ label: HTMLLabelElement;
190
+ legend: HTMLLegendElement;
191
+ li: HTMLLIElement;
192
+ link: HTMLLinkElement;
193
+ main: HTMLElement;
194
+ map: HTMLMapElement;
195
+ mark: HTMLElement;
196
+ menu: HTMLMenuElement;
197
+ meta: HTMLMetaElement;
198
+ meter: HTMLMeterElement;
199
+ nav: HTMLElement;
200
+ noscript: HTMLElement;
201
+ object: HTMLObjectElement;
202
+ ol: HTMLOListElement;
203
+ optgroup: HTMLOptGroupElement;
204
+ option: HTMLOptionElement;
205
+ output: HTMLOutputElement;
206
+ p: HTMLParagraphElement;
207
+ picture: HTMLPictureElement;
208
+ pre: HTMLPreElement;
209
+ progress: HTMLProgressElement;
210
+ q: HTMLQuoteElement;
211
+ rp: HTMLElement;
212
+ rt: HTMLElement;
213
+ ruby: HTMLElement;
214
+ s: HTMLElement;
215
+ samp: HTMLElement;
216
+ script: HTMLScriptElement;
217
+ search: HTMLElement;
218
+ section: HTMLElement;
219
+ select: HTMLSelectElement;
220
+ slot: HTMLSlotElement;
221
+ small: HTMLElement;
222
+ source: HTMLSourceElement;
223
+ span: HTMLSpanElement;
224
+ strong: HTMLElement;
225
+ style: HTMLStyleElement;
226
+ sub: HTMLElement;
227
+ summary: HTMLElement;
228
+ sup: HTMLElement;
229
+ table: HTMLTableElement;
230
+ tbody: HTMLTableSectionElement;
231
+ td: HTMLTableCellElement;
232
+ template: HTMLTemplateElement;
233
+ textarea: HTMLTextAreaElement;
234
+ tfoot: HTMLTableSectionElement;
235
+ th: HTMLTableCellElement;
236
+ thead: HTMLTableSectionElement;
237
+ time: HTMLTimeElement;
238
+ title: HTMLTitleElement;
239
+ tr: HTMLTableRowElement;
240
+ track: HTMLTrackElement;
241
+ u: HTMLElement;
242
+ ul: HTMLUListElement;
243
+ var: HTMLElement;
244
+ video: HTMLVideoElement;
245
+ wbr: HTMLElement;
246
+ animate: SVGAnimateElement;
247
+ animateMotion: SVGAnimateMotionElement;
248
+ animateTransform: SVGAnimateTransformElement;
249
+ circle: SVGCircleElement;
250
+ clipPath: SVGClipPathElement;
251
+ defs: SVGDefsElement;
252
+ desc: SVGDescElement;
253
+ ellipse: SVGEllipseElement;
254
+ feBlend: SVGFEBlendElement;
255
+ feColorMatrix: SVGFEColorMatrixElement;
256
+ feComponentTransfer: SVGFEComponentTransferElement;
257
+ feComposite: SVGFECompositeElement;
258
+ feConvolveMatrix: SVGFEConvolveMatrixElement;
259
+ feDiffuseLighting: SVGFEDiffuseLightingElement;
260
+ feDisplacementMap: SVGFEDisplacementMapElement;
261
+ feDistantLight: SVGFEDistantLightElement;
262
+ feDropShadow: SVGFEDropShadowElement;
263
+ feFlood: SVGFEFloodElement;
264
+ feFuncA: SVGFEFuncAElement;
265
+ feFuncB: SVGFEFuncBElement;
266
+ feFuncG: SVGFEFuncGElement;
267
+ feFuncR: SVGFEFuncRElement;
268
+ feGaussianBlur: SVGFEGaussianBlurElement;
269
+ feImage: SVGFEImageElement;
270
+ feMerge: SVGFEMergeElement;
271
+ feMergeNode: SVGFEMergeNodeElement;
272
+ feMorphology: SVGFEMorphologyElement;
273
+ feOffset: SVGFEOffsetElement;
274
+ fePointLight: SVGFEPointLightElement;
275
+ feSpecularLighting: SVGFESpecularLightingElement;
276
+ feSpotLight: SVGFESpotLightElement;
277
+ feTile: SVGFETileElement;
278
+ feTurbulence: SVGFETurbulenceElement;
279
+ filter: SVGFilterElement;
280
+ foreignObject: SVGForeignObjectElement;
281
+ g: SVGGElement;
282
+ image: SVGImageElement;
283
+ line: SVGLineElement;
284
+ linearGradient: SVGLinearGradientElement;
285
+ marker: SVGMarkerElement;
286
+ mask: SVGMaskElement;
287
+ metadata: SVGMetadataElement;
288
+ mpath: SVGMPathElement;
289
+ path: SVGPathElement;
290
+ pattern: SVGPatternElement;
291
+ polygon: SVGPolygonElement;
292
+ polyline: SVGPolylineElement;
293
+ radialGradient: SVGRadialGradientElement;
294
+ rect: SVGRectElement;
295
+ set: SVGSetElement;
296
+ stop: SVGStopElement;
297
+ svg: SVGSVGElement;
298
+ switch: SVGSwitchElement;
299
+ symbol: SVGSymbolElement;
300
+ text: SVGTextElement;
301
+ textPath: SVGTextPathElement;
302
+ tspan: SVGTSpanElement;
303
+ use: SVGUseElement;
304
+ view: SVGViewElement;
305
+ };
306
+ type __VLS_IntrinsicElements = import('vue/jsx-runtime').JSX.IntrinsicElements;
307
+ type __VLS_Element = import('vue/jsx-runtime').JSX.Element;
308
+ type __VLS_GlobalComponents = import('vue').GlobalComponents & Pick<typeof import('vue'), 'Transition' | 'TransitionGroup' | 'KeepAlive' | 'Suspense' | 'Teleport'>;
309
+ type __VLS_GlobalDirectives = import('vue').GlobalDirectives;
310
+ type __VLS_IsAny<T> = 0 extends 1 & T ? true : false;
311
+ type __VLS_PickNotAny<A, B> = __VLS_IsAny<A> extends true ? B : A;
312
+ type __VLS_unknownDirective = (arg1: unknown, arg2: unknown, arg3: unknown, arg4: unknown) => void;
313
+ type __VLS_WithComponent<N0 extends string, LocalComponents, N1 extends string, N2 extends string, N3 extends string> = N1 extends keyof LocalComponents ? N1 extends N0 ? Pick<LocalComponents, N0 extends keyof LocalComponents ? N0 : never> : {
314
+ [K in N0]: LocalComponents[N1];
315
+ } : N2 extends keyof LocalComponents ? N2 extends N0 ? Pick<LocalComponents, N0 extends keyof LocalComponents ? N0 : never> : {
316
+ [K in N0]: LocalComponents[N2];
317
+ } : N3 extends keyof LocalComponents ? N3 extends N0 ? Pick<LocalComponents, N0 extends keyof LocalComponents ? N0 : never> : {
318
+ [K in N0]: LocalComponents[N3];
319
+ } : N1 extends keyof __VLS_GlobalComponents ? N1 extends N0 ? Pick<__VLS_GlobalComponents, N0 extends keyof __VLS_GlobalComponents ? N0 : never> : {
320
+ [K in N0]: __VLS_GlobalComponents[N1];
321
+ } : N2 extends keyof __VLS_GlobalComponents ? N2 extends N0 ? Pick<__VLS_GlobalComponents, N0 extends keyof __VLS_GlobalComponents ? N0 : never> : {
322
+ [K in N0]: __VLS_GlobalComponents[N2];
323
+ } : N3 extends keyof __VLS_GlobalComponents ? N3 extends N0 ? Pick<__VLS_GlobalComponents, N0 extends keyof __VLS_GlobalComponents ? N0 : never> : {
324
+ [K in N0]: __VLS_GlobalComponents[N3];
325
+ } : {
326
+ [K in N0]: unknown;
327
+ };
328
+ type __VLS_FunctionalComponentProps<T, K> = '__ctx' extends keyof __VLS_PickNotAny<K, {}> ? K extends {
329
+ __ctx?: {
330
+ props?: infer P;
331
+ };
332
+ } ? NonNullable<P> : never : T extends (props: infer P, ...args: any) => any ? P : {};
333
+ type __VLS_IsFunction<T, K> = K extends keyof T ? __VLS_IsAny<T[K]> extends false ? unknown extends T[K] ? false : true : false : false;
334
+ type __VLS_UnionToIntersection<U> = (U extends unknown ? (arg: U) => unknown : never) extends ((arg: infer P) => unknown) ? P : never;
335
+ 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;
336
+ type __VLS_OverloadUnion<T> = Exclude<__VLS_OverloadUnionInner<(() => never) & T>, T extends () => never ? never : () => never>;
337
+ type __VLS_ConstructorOverloads<T> = __VLS_OverloadUnion<T> extends infer F ? F extends (event: infer E, ...args: infer A) => any ? {
338
+ [K in E & string]: (...args: A) => void;
339
+ } : never : never;
340
+ type __VLS_NormalizeEmits<T> = __VLS_PrettifyGlobal<__VLS_UnionToIntersection<__VLS_ConstructorOverloads<T> & {
341
+ [K in keyof T]: T[K] extends any[] ? {
342
+ (...args: T[K]): void;
343
+ } : never;
344
+ }>>;
345
+ type __VLS_PrettifyGlobal<T> = {
346
+ [K in keyof T]: T[K];
347
+ } & {};
348
+ function __VLS_getVForSourceType(source: number): [number, number, number][];
349
+ function __VLS_getVForSourceType(source: string): [string, number, number][];
350
+ function __VLS_getVForSourceType<T extends any[]>(source: T): [
351
+ item: T[number],
352
+ key: number,
353
+ index: number
354
+ ][];
355
+ function __VLS_getVForSourceType<T extends {
356
+ [Symbol.iterator](): Iterator<any>;
357
+ }>(source: T): [
358
+ item: T extends {
359
+ [Symbol.iterator](): Iterator<infer T1>;
360
+ } ? T1 : never,
361
+ key: number,
362
+ index: undefined
363
+ ][];
364
+ function __VLS_getVForSourceType<T extends number | {
365
+ [Symbol.iterator](): Iterator<any>;
366
+ }>(source: T): [
367
+ item: number | (Exclude<T, number> extends {
368
+ [Symbol.iterator](): Iterator<infer T1>;
369
+ } ? T1 : never),
370
+ key: number,
371
+ index: undefined
372
+ ][];
373
+ function __VLS_getVForSourceType<T>(source: T): [
374
+ item: T[keyof T],
375
+ key: keyof T,
376
+ index: number
377
+ ][];
378
+ function __VLS_getSlotParams<T>(slot: T): Parameters<__VLS_PickNotAny<NonNullable<T>, (...args: any[]) => any>>;
379
+ function __VLS_getSlotParam<T>(slot: T): Parameters<__VLS_PickNotAny<NonNullable<T>, (...args: any[]) => any>>[0];
380
+ function __VLS_directiveAsFunction<T extends import('vue').Directive>(dir: T): T extends (...args: any) => any ? T | __VLS_unknownDirective : NonNullable<(T & Record<string, __VLS_unknownDirective>)['created' | 'beforeMount' | 'mounted' | 'beforeUpdate' | 'updated' | 'beforeUnmount' | 'unmounted']>;
381
+ function __VLS_withScope<T, K>(ctx: T, scope: K): ctx is T & K;
382
+ function __VLS_makeOptional<T>(t: T): {
383
+ [K in keyof T]?: T[K];
384
+ };
385
+ function __VLS_nonNullable<T>(t: T): T extends null | undefined ? never : T;
386
+ 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 {
387
+ $props: infer Props;
388
+ } ? Props : any) & Record<string, unknown>, ctx?: any) => __VLS_Element & {
389
+ __ctx?: {
390
+ attrs?: any;
391
+ slots?: K extends {
392
+ $slots: infer Slots;
393
+ } ? Slots : any;
394
+ emit?: K extends {
395
+ $emit: infer Emit;
396
+ } ? Emit : any;
397
+ } & {
398
+ props?: (K extends {
399
+ $props: infer Props;
400
+ } ? Props : any) & Record<string, unknown>;
401
+ expose?(exposed: K): void;
402
+ };
403
+ } : T extends () => any ? (props: {}, ctx?: any) => ReturnType<T> : T extends (...args: any) => any ? T : (_: {} & Record<string, unknown>, ctx?: any) => {
404
+ __ctx?: {
405
+ attrs?: any;
406
+ expose?: any;
407
+ slots?: any;
408
+ emit?: any;
409
+ props?: {} & Record<string, unknown>;
410
+ };
411
+ };
412
+ function __VLS_elementAsFunction<T>(tag: T, endTag?: T): (_: T & Record<string, unknown>) => void;
413
+ function __VLS_functionalComponentArgsRest<T extends (...args: any) => any>(t: T): 2 extends Parameters<T>['length'] ? [any] : [];
414
+ function __VLS_pickFunctionalComponentCtx<T, K>(comp: T, compInstance: K): NonNullable<__VLS_PickNotAny<'__ctx' extends keyof __VLS_PickNotAny<K, {}> ? K extends {
415
+ __ctx?: infer Ctx;
416
+ } ? Ctx : never : any, T extends (props: any, ctx: infer Ctx) => any ? Ctx : any>>;
417
+ function __VLS_normalizeSlot<S>(s: S): S extends () => infer R ? (props: {}) => R : S;
418
+ function __VLS_tryAsConstant<const T>(t: T): T;
419
+ }
@@ -52,7 +52,7 @@ export default defineComponent({
52
52
  return fallbackSlot ? fallbackSlot() : h("div");
53
53
  }
54
54
  return unwrap ? flatUnwrap(slot(), tags) : [slot()];
55
- } catch (e) {
55
+ } catch {
56
56
  return h("div");
57
57
  }
58
58
  }
@@ -2,7 +2,7 @@ import type { Slot } from 'vue';
2
2
  /**
3
3
  * MDCSlot component
4
4
  */
5
- declare const _default: import("vue").DefineComponent<{
5
+ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
6
6
  name: {
7
7
  type: StringConstructor;
8
8
  default: string;
@@ -23,11 +23,11 @@ declare const _default: import("vue").DefineComponent<{
23
23
  type: FunctionConstructor;
24
24
  default: undefined;
25
25
  };
26
- }, {
26
+ }>, {
27
27
  fallbackSlot: Slot<any> | undefined;
28
28
  tags: import("vue").ComputedRef<string[]>;
29
29
  parent: import("vue").ComponentInternalInstance | null;
30
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
30
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
31
31
  name: {
32
32
  type: StringConstructor;
33
33
  default: string;
@@ -48,9 +48,9 @@ declare const _default: import("vue").DefineComponent<{
48
48
  type: FunctionConstructor;
49
49
  default: undefined;
50
50
  };
51
- }>>, {
52
- name: string;
51
+ }>> & Readonly<{}>, {
53
52
  unwrap: string | boolean;
53
+ name: string;
54
54
  use: Function;
55
- }, {}>;
55
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
56
56
  export default _default;
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <NuxtLink
3
- :href="href"
4
- :target="target"
3
+ :href="props.href"
4
+ :target="props.target"
5
5
  >
6
6
  <slot />
7
7
  </NuxtLink>
@@ -10,7 +10,7 @@
10
10
  <script setup lang="ts">
11
11
  import type { PropType } from 'vue'
12
12
 
13
- defineProps({
13
+ const props = defineProps({
14
14
  href: {
15
15
  type: String,
16
16
  default: ''
@@ -1,8 +1,8 @@
1
1
  <template>
2
- <h1 :id="id">
2
+ <h1 :id="props.id">
3
3
  <a
4
4
  v-if="generate"
5
- :href="`#${id}`"
5
+ :href="`#${props.id}`"
6
6
  >
7
7
  <slot />
8
8
  </a>
@@ -1,8 +1,8 @@
1
1
  <template>
2
- <h2 :id="id">
2
+ <h2 :id="props.id">
3
3
  <a
4
- v-if="id && generate"
5
- :href="`#${id}`"
4
+ v-if="props.id && generate"
5
+ :href="`#${props.id}`"
6
6
  >
7
7
  <slot />
8
8
  </a>
@@ -1,8 +1,8 @@
1
1
  <template>
2
- <h3 :id="id">
2
+ <h3 :id="props.id">
3
3
  <a
4
- v-if="id && generate"
5
- :href="`#${id}`"
4
+ v-if="props.id && generate"
5
+ :href="`#${props.id}`"
6
6
  >
7
7
  <slot />
8
8
  </a>
@@ -1,8 +1,8 @@
1
1
  <template>
2
- <h4 :id="id">
2
+ <h4 :id="props.id">
3
3
  <a
4
- v-if="id && generate"
5
- :href="`#${id}`"
4
+ v-if="props.id && generate"
5
+ :href="`#${props.id}`"
6
6
  >
7
7
  <slot />
8
8
  </a>
@@ -1,8 +1,8 @@
1
1
  <template>
2
- <h5 :id="id">
2
+ <h5 :id="props.id">
3
3
  <a
4
- v-if="id && generate"
5
- :href="`#${id}`"
4
+ v-if="props.id && generate"
5
+ :href="`#${props.id}`"
6
6
  >
7
7
  <slot />
8
8
  </a>
@@ -1,8 +1,8 @@
1
1
  <template>
2
- <h6 :id="id">
2
+ <h6 :id="props.id">
3
3
  <a
4
- v-if="id && generate"
5
- :href="`#${id}`"
4
+ v-if="props.id && generate"
5
+ :href="`#${props.id}`"
6
6
  >
7
7
  <slot />
8
8
  </a>
@@ -2,9 +2,9 @@
2
2
  <component
3
3
  :is="imgComponent"
4
4
  :src="refinedSrc"
5
- :alt="alt"
6
- :width="width"
7
- :height="height"
5
+ :alt="props.alt"
6
+ :width="props.width"
7
+ :height="props.height"
8
8
  />
9
9
  </template>
10
10
 
@@ -1,10 +1,3 @@
1
- import { createHighlighterCore, addClassToHast, isSpecialLang, isSpecialTheme } from "shiki/core";
2
- import {
3
- transformerNotationDiff,
4
- transformerNotationErrorLevel,
5
- transformerNotationFocus,
6
- transformerNotationHighlight
7
- } from "@shikijs/transformers";
8
1
  export function createShikiHighlighter({
9
2
  langs = [],
10
3
  themes = [],
@@ -16,6 +9,8 @@ export function createShikiHighlighter({
16
9
  let shiki;
17
10
  let configs;
18
11
  async function _getShiki() {
12
+ const { createHighlighterCore, addClassToHast, isSpecialLang, isSpecialTheme } = await import("shiki/core");
13
+ const { transformerNotationDiff, transformerNotationErrorLevel, transformerNotationFocus, transformerNotationHighlight } = await import("@shikijs/transformers");
19
14
  const shiki2 = await createHighlighterCore({
20
15
  langs,
21
16
  themes,
@@ -24,7 +19,18 @@ export function createShikiHighlighter({
24
19
  for await (const config of await getConfigs()) {
25
20
  await config.shiki?.setup?.(shiki2);
26
21
  }
27
- return shiki2;
22
+ return {
23
+ shiki: shiki2,
24
+ addClassToHast,
25
+ isSpecialLang,
26
+ isSpecialTheme,
27
+ transformers: [
28
+ transformerNotationDiff(),
29
+ transformerNotationErrorLevel(),
30
+ transformerNotationFocus(),
31
+ transformerNotationHighlight()
32
+ ]
33
+ };
28
34
  }
29
35
  async function getShiki() {
30
36
  if (!shiki) {
@@ -38,14 +44,14 @@ export function createShikiHighlighter({
38
44
  }
39
45
  return configs;
40
46
  }
41
- const baseTransformers = [
42
- transformerNotationDiff(),
43
- transformerNotationFocus(),
44
- transformerNotationHighlight(),
45
- transformerNotationErrorLevel()
46
- ];
47
47
  const highlighter = async (code, lang, theme, options = {}) => {
48
- const shiki2 = await getShiki();
48
+ const {
49
+ shiki: shiki2,
50
+ addClassToHast,
51
+ isSpecialLang,
52
+ isSpecialTheme,
53
+ transformers: baseTransformers
54
+ } = await getShiki();
49
55
  const codeToHastOptions = {
50
56
  defaultColor: false,
51
57
  meta: {
@@ -1,4 +1,4 @@
1
- export { parseMarkdown, createMarkdownParser } from './parser.js';
1
+ export { parseMarkdown, createMarkdownParser } from './parser/index.js';
2
2
  export { rehypeHighlight } from './highlighter/rehype.js';
3
3
  export { createShikiHighlighter } from './highlighter/shiki.js';
4
4
  export * from './utils/node.js';
@@ -1,4 +1,4 @@
1
- import { type State } from 'mdast-util-to-hast';
1
+ import type { State } from 'mdast-util-to-hast';
2
2
  import type { Element } from 'hast';
3
3
  import type { Code } from 'mdast';
4
4
  declare const _default: (state: State, node: Code) => Element;
@@ -1,4 +1,4 @@
1
- import { type State } from 'mdast-util-to-hast';
1
+ import type { State } from 'mdast-util-to-hast';
2
2
  import type { Element, Properties } from 'hast';
3
3
  import type { Nodes as MdastContent } from 'mdast';
4
4
  type Node = MdastContent & {
@@ -1,4 +1,4 @@
1
- import { type State } from 'mdast-util-to-hast';
1
+ import type { State } from 'mdast-util-to-hast';
2
2
  import type { Element, Properties } from 'hast';
3
3
  import type { Emphasis } from 'mdast';
4
4
  export default function emphasis(state: State, node: Emphasis & {
@@ -1,3 +1,3 @@
1
- import { type State, type Raw } from 'mdast-util-to-hast';
1
+ import type { State, Raw } from 'mdast-util-to-hast';
2
2
  import type { Html } from 'mdast';
3
3
  export default function html(state: State, node: Html): import("hast").Element | Raw | undefined;
@@ -1,4 +1,4 @@
1
- import { type State } from 'mdast-util-to-hast';
1
+ import type { State } from 'mdast-util-to-hast';
2
2
  import type { Element, Properties } from 'hast';
3
3
  import type { Image } from 'mdast';
4
4
  export default function image(state: State, node: Image & {
@@ -1,4 +1,4 @@
1
- import { type State } from 'mdast-util-to-hast';
1
+ import type { State } from 'mdast-util-to-hast';
2
2
  import type { Element, Properties } from 'hast';
3
3
  import type { InlineCode } from 'mdast';
4
4
  export default function inlineCode(state: State, node: InlineCode & {
@@ -1,4 +1,4 @@
1
- import { type State } from 'mdast-util-to-hast';
1
+ import type { State } from 'mdast-util-to-hast';
2
2
  import type { Element, Properties } from 'hast';
3
3
  import type { Link } from 'mdast';
4
4
  export default function link(state: State, node: Link & {
@@ -1,4 +1,4 @@
1
- import { type State } from 'mdast-util-to-hast';
1
+ import type { State } from 'mdast-util-to-hast';
2
2
  import type { Element } from 'hast';
3
3
  import type { List } from 'mdast';
4
4
  export default function list(state: State, node: List): Element;
@@ -1,4 +1,4 @@
1
- import { type State } from 'mdast-util-to-hast';
1
+ import type { State } from 'mdast-util-to-hast';
2
2
  import type { Element } from 'hast';
3
3
  import type { Paragraph } from 'mdast';
4
4
  export default function paragraph(state: State, node: Paragraph): Element | import("hast").ElementContent[];
@@ -1,4 +1,4 @@
1
- import { type State } from 'mdast-util-to-hast';
1
+ import type { State } from 'mdast-util-to-hast';
2
2
  import type { Element, Properties } from 'hast';
3
3
  import type { Strong } from 'mdast';
4
4
  export default function strong(state: State, node: Strong & {
@@ -1,3 +1,3 @@
1
- export declare const renderSlot: (slots: Record<string, any>, name: string, props: any, ...rest: any[]) => import("vue/dist/vue.js").VNode<import("vue/dist/vue.js").RendererNode, import("vue/dist/vue.js").RendererElement, {
1
+ export declare const renderSlot: (slots: Record<string, any>, name: string, props: any, ...rest: any[]) => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
2
2
  [key: string]: any;
3
3
  }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuxtjs/mdc",
3
- "version": "0.8.3",
3
+ "version": "0.9.0",
4
4
  "description": "Nuxt MDC module",
5
5
  "repository": "nuxt-modules/mdc",
6
6
  "license": "MIT",
@@ -71,13 +71,13 @@
71
71
  "test:watch": "vitest watch"
72
72
  },
73
73
  "dependencies": {
74
- "@nuxt/kit": "^3.12.2",
75
- "@shikijs/transformers": "^1.10.0",
74
+ "@nuxt/kit": "^3.13.1",
75
+ "@shikijs/transformers": "^1.17.0",
76
76
  "@types/hast": "^3.0.4",
77
77
  "@types/mdast": "^4.0.4",
78
- "@vue/compiler-core": "^3.4.31",
78
+ "@vue/compiler-core": "^3.5.4",
79
79
  "consola": "^3.2.3",
80
- "debug": "^4.3.5",
80
+ "debug": "^4.3.7",
81
81
  "defu": "^6.1.4",
82
82
  "destr": "^2.0.3",
83
83
  "detab": "^3.0.2",
@@ -94,14 +94,14 @@
94
94
  "rehype-slug": "^6.0.0",
95
95
  "rehype-sort-attribute-values": "^5.0.0",
96
96
  "rehype-sort-attributes": "^5.0.0",
97
- "remark-emoji": "^5.0.0",
97
+ "remark-emoji": "^5.0.1",
98
98
  "remark-gfm": "^4.0.0",
99
99
  "remark-mdc": "^3.2.1",
100
100
  "remark-parse": "^11.0.0",
101
101
  "remark-rehype": "^11.1.0",
102
102
  "scule": "^1.3.0",
103
- "shiki": "^1.10.0",
104
- "ufo": "^1.5.3",
103
+ "shiki": "^1.17.0",
104
+ "ufo": "^1.5.4",
105
105
  "unified": "^11.0.5",
106
106
  "unist-builder": "^4.0.0",
107
107
  "unist-util-visit": "^5.0.0",
@@ -109,23 +109,23 @@
109
109
  },
110
110
  "devDependencies": {
111
111
  "@nuxt/devtools": "latest",
112
- "@nuxt/eslint-config": "^0.3.13",
113
- "@nuxt/module-builder": "^0.8.1",
114
- "@nuxt/schema": "^3.12.2",
115
- "@nuxt/test-utils": "^3.13.1",
116
- "@nuxt/ui": "^2.17.0",
112
+ "@nuxt/eslint-config": "^0.5.7",
113
+ "@nuxt/module-builder": "^0.8.4",
114
+ "@nuxt/schema": "^3.13.1",
115
+ "@nuxt/test-utils": "^3.14.2",
116
+ "@nuxt/ui": "^2.18.4",
117
117
  "@nuxtjs/mdc": "link:.",
118
- "@types/node": "^20.14.9",
118
+ "@types/node": "^22.5.4",
119
119
  "changelogen": "^0.5.5",
120
- "eslint": "^9.6.0",
121
- "nuxt": "^3.12.2",
120
+ "eslint": "^9.10.0",
121
+ "nuxt": "^3.13.1",
122
122
  "rehype": "^13.0.1",
123
- "release-it": "^17.4.0",
124
- "typescript": "^5.5.2",
125
- "vitest": "^1.6.0",
126
- "vue-tsc": "^2.0.24"
123
+ "release-it": "^17.6.0",
124
+ "typescript": "^5.6.2",
125
+ "vitest": "^2.0.5",
126
+ "vue-tsc": "^2.1.6"
127
127
  },
128
- "packageManager": "pnpm@9.4.0",
128
+ "packageManager": "pnpm@9.10.0",
129
129
  "release-it": {
130
130
  "git": {
131
131
  "commitMessage": "chore(release): release v${version}"