@nuxtjs/mdc 0.8.2 → 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 (39) hide show
  1. package/dist/config.d.mts +1 -3
  2. package/dist/config.d.ts +1 -3
  3. package/dist/config.mjs +5 -7
  4. package/dist/module.d.mts +14 -77
  5. package/dist/module.d.ts +14 -77
  6. package/dist/module.json +2 -2
  7. package/dist/module.mjs +2 -4
  8. package/dist/runtime/components/MDC.vue +1 -1
  9. package/dist/runtime/components/MDCRenderer.vue.d.ts +309 -6
  10. package/dist/runtime/components/MDCSlot.vue +1 -1
  11. package/dist/runtime/components/MDCSlot.vue.d.ts +6 -6
  12. package/dist/runtime/components/prose/ProseA.vue +3 -3
  13. package/dist/runtime/components/prose/ProseH1.vue +2 -2
  14. package/dist/runtime/components/prose/ProseH2.vue +3 -3
  15. package/dist/runtime/components/prose/ProseH3.vue +3 -3
  16. package/dist/runtime/components/prose/ProseH4.vue +3 -3
  17. package/dist/runtime/components/prose/ProseH5.vue +3 -3
  18. package/dist/runtime/components/prose/ProseH6.vue +3 -3
  19. package/dist/runtime/components/prose/ProseImg.vue +3 -3
  20. package/dist/runtime/highlighter/shiki.js +36 -20
  21. package/dist/runtime/index.d.ts +1 -1
  22. package/dist/runtime/parser/handlers/code.d.ts +1 -1
  23. package/dist/runtime/parser/handlers/containerComponent.d.ts +1 -1
  24. package/dist/runtime/parser/handlers/emphasis.d.ts +1 -1
  25. package/dist/runtime/parser/handlers/html.d.ts +1 -1
  26. package/dist/runtime/parser/handlers/image.d.ts +1 -1
  27. package/dist/runtime/parser/handlers/inlineCode.d.ts +1 -1
  28. package/dist/runtime/parser/handlers/link.d.ts +1 -1
  29. package/dist/runtime/parser/handlers/list.d.ts +1 -1
  30. package/dist/runtime/parser/handlers/paragraph.d.ts +1 -1
  31. package/dist/runtime/parser/handlers/strong.d.ts +1 -1
  32. package/dist/runtime/parser/index.d.ts +1 -1
  33. package/dist/runtime/parser/utils/plugins.d.ts +2 -1
  34. package/dist/runtime/utils/slot.d.ts +1 -1
  35. package/dist/shared/mdc.4762b8bc.d.mts +66 -0
  36. package/dist/shared/mdc.4762b8bc.d.ts +66 -0
  37. package/dist/types.d.mts +1 -17
  38. package/dist/types.d.ts +1 -17
  39. package/package.json +23 -23
@@ -1,5 +1,6 @@
1
1
  import type { PropType, DefineComponent } from 'vue';
2
- declare const _default: DefineComponent<{
2
+ import type { MDCRoot } from '@nuxtjs/mdc';
3
+ declare const _default: DefineComponent<import("vue").ExtractPropTypes<{
3
4
  /**
4
5
  * Content to render
5
6
  */
@@ -50,11 +51,11 @@ declare const _default: DefineComponent<{
50
51
  type: (BooleanConstructor | StringConstructor)[];
51
52
  default: boolean;
52
53
  };
53
- }, {
54
+ }>, {
54
55
  tags: any;
55
56
  contentKey: import("vue").ComputedRef<string>;
56
- route: {} | undefined;
57
- }, 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<{
58
59
  /**
59
60
  * Content to render
60
61
  */
@@ -105,12 +106,314 @@ declare const _default: DefineComponent<{
105
106
  type: (BooleanConstructor | StringConstructor)[];
106
107
  default: boolean;
107
108
  };
108
- }>>, {
109
+ }>> & Readonly<{}>, {
109
110
  data: Record<string, any>;
110
111
  class: string | Record<string, any>;
111
112
  tag: string | boolean;
112
113
  prose: boolean;
113
114
  components: Record<string, string | DefineComponent<any, any, any>>;
114
115
  unwrap: string | boolean;
115
- }, {}>;
116
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
116
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 { getHighlighterCore, 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,7 +9,9 @@ export function createShikiHighlighter({
16
9
  let shiki;
17
10
  let configs;
18
11
  async function _getShiki() {
19
- const shiki2 = await getHighlighterCore({
12
+ const { createHighlighterCore, addClassToHast, isSpecialLang, isSpecialTheme } = await import("shiki/core");
13
+ const { transformerNotationDiff, transformerNotationErrorLevel, transformerNotationFocus, transformerNotationHighlight } = await import("@shikijs/transformers");
14
+ const shiki2 = await createHighlighterCore({
20
15
  langs,
21
16
  themes,
22
17
  loadWasm: () => import("shiki/wasm")
@@ -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,27 @@ 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();
55
+ const codeToHastOptions = {
56
+ defaultColor: false,
57
+ meta: {
58
+ __raw: options.meta
59
+ }
60
+ };
61
+ if (lang === "ts-type" || lang === "typescript-type") {
62
+ lang = "typescript";
63
+ codeToHastOptions.grammarContextCode = "let a:";
64
+ } else if (lang === "vue-html" || lang === "vue-template") {
65
+ lang = "vue";
66
+ codeToHastOptions.grammarContextCode = "<template>";
67
+ }
49
68
  const themesObject = typeof theme === "string" ? { default: theme } : theme || {};
50
69
  const loadedThemes = shiki2.getLoadedThemes();
51
70
  const loadedLanguages = shiki2.getLoadedLanguages();
@@ -80,11 +99,8 @@ export function createShikiHighlighter({
80
99
  }
81
100
  const root = shiki2.codeToHast(code.trimEnd(), {
82
101
  lang,
102
+ ...codeToHastOptions,
83
103
  themes: themesObject,
84
- defaultColor: false,
85
- meta: {
86
- __raw: options.meta
87
- },
88
104
  transformers: [
89
105
  ...transformers,
90
106
  {
@@ -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,4 +1,4 @@
1
- import type { MDCParserResult, MDCRoot } from '@nuxtjs/mdc';
1
+ import type { MDCParseOptions, MDCParserResult, MDCRoot } from '@nuxtjs/mdc';
2
2
  export declare const createMarkdownParser: (inlineOptions?: MDCParseOptions) => Promise<(md: string) => Promise<MDCParserResult>>;
3
3
  export declare const parseMarkdown: (md: string, inlineOptions?: MDCParseOptions) => Promise<MDCParserResult>;
4
4
  export declare function contentHeading(body: MDCRoot): {