@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.
- package/dist/config.d.mts +1 -3
- package/dist/config.d.ts +1 -3
- package/dist/config.mjs +5 -7
- package/dist/module.d.mts +14 -77
- package/dist/module.d.ts +14 -77
- package/dist/module.json +2 -2
- package/dist/module.mjs +2 -4
- package/dist/runtime/components/MDC.vue +1 -1
- package/dist/runtime/components/MDCRenderer.vue.d.ts +309 -6
- package/dist/runtime/components/MDCSlot.vue +1 -1
- package/dist/runtime/components/MDCSlot.vue.d.ts +6 -6
- package/dist/runtime/components/prose/ProseA.vue +3 -3
- package/dist/runtime/components/prose/ProseH1.vue +2 -2
- package/dist/runtime/components/prose/ProseH2.vue +3 -3
- package/dist/runtime/components/prose/ProseH3.vue +3 -3
- package/dist/runtime/components/prose/ProseH4.vue +3 -3
- package/dist/runtime/components/prose/ProseH5.vue +3 -3
- package/dist/runtime/components/prose/ProseH6.vue +3 -3
- package/dist/runtime/components/prose/ProseImg.vue +3 -3
- package/dist/runtime/highlighter/shiki.js +36 -20
- package/dist/runtime/index.d.ts +1 -1
- package/dist/runtime/parser/handlers/code.d.ts +1 -1
- package/dist/runtime/parser/handlers/containerComponent.d.ts +1 -1
- package/dist/runtime/parser/handlers/emphasis.d.ts +1 -1
- package/dist/runtime/parser/handlers/html.d.ts +1 -1
- package/dist/runtime/parser/handlers/image.d.ts +1 -1
- package/dist/runtime/parser/handlers/inlineCode.d.ts +1 -1
- package/dist/runtime/parser/handlers/link.d.ts +1 -1
- package/dist/runtime/parser/handlers/list.d.ts +1 -1
- package/dist/runtime/parser/handlers/paragraph.d.ts +1 -1
- package/dist/runtime/parser/handlers/strong.d.ts +1 -1
- package/dist/runtime/parser/index.d.ts +1 -1
- package/dist/runtime/parser/utils/plugins.d.ts +2 -1
- package/dist/runtime/utils/slot.d.ts +1 -1
- package/dist/shared/mdc.4762b8bc.d.mts +66 -0
- package/dist/shared/mdc.4762b8bc.d.ts +66 -0
- package/dist/types.d.mts +1 -17
- package/dist/types.d.ts +1 -17
- package/package.json +23 -23
package/dist/config.d.mts
CHANGED
package/dist/config.d.ts
CHANGED
package/dist/config.mjs
CHANGED
package/dist/module.d.mts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import * as _nuxt_schema from '@nuxt/schema';
|
|
2
|
-
import {
|
|
2
|
+
import { BundledLanguage, LanguageRegistration, BundledTheme, ThemeRegistrationAny } from 'shiki';
|
|
3
3
|
import { Options } from 'remark-rehype';
|
|
4
|
-
import {
|
|
5
|
-
|
|
4
|
+
import { R as RehypeHighlightOption, M as MdcConfig, a as MdcThemeOptions } from './shared/mdc.4762b8bc.mjs';
|
|
5
|
+
export { A as Awaitable, b as HighlightResult, c as Highlighter, H as HighlighterOptions, d as defineConfig } from './shared/mdc.4762b8bc.mjs';
|
|
6
|
+
import 'unified';
|
|
7
|
+
import 'hast';
|
|
6
8
|
|
|
7
9
|
type MDCText = {
|
|
8
10
|
type: 'text';
|
|
@@ -28,65 +30,6 @@ interface MDCData extends Record<string, any> {
|
|
|
28
30
|
description: string;
|
|
29
31
|
}
|
|
30
32
|
|
|
31
|
-
type MdcThemeOptions = BuiltinTheme | string | Record<string, BuiltinTheme | string>;
|
|
32
|
-
interface HighlighterOptions {
|
|
33
|
-
highlights?: number[];
|
|
34
|
-
meta?: string;
|
|
35
|
-
}
|
|
36
|
-
interface HighlightResult {
|
|
37
|
-
tree: ElementContent$1[];
|
|
38
|
-
className?: string;
|
|
39
|
-
style?: string;
|
|
40
|
-
inlineStyle?: string;
|
|
41
|
-
}
|
|
42
|
-
type Highlighter = (code: string, lang: string, theme: MdcThemeOptions, options: Partial<HighlighterOptions>) => Promise<HighlightResult>;
|
|
43
|
-
interface RehypeHighlightOption {
|
|
44
|
-
theme?: MdcThemeOptions;
|
|
45
|
-
highlighter?: Highlighter;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
type Awaitable<T> = T | Promise<T>;
|
|
49
|
-
interface MdcConfig {
|
|
50
|
-
/**
|
|
51
|
-
* Hooks for the unified markdown pipeline
|
|
52
|
-
*/
|
|
53
|
-
unified?: {
|
|
54
|
-
/**
|
|
55
|
-
* Custom setup for unified processor before other plugins
|
|
56
|
-
*/
|
|
57
|
-
pre?: (processor: Processor) => Awaitable<void | Processor>;
|
|
58
|
-
/**
|
|
59
|
-
* Custom setup for unified processor after remark but before rehype
|
|
60
|
-
*/
|
|
61
|
-
remark?: (processor: Processor) => Awaitable<void | Processor>;
|
|
62
|
-
/**
|
|
63
|
-
* Custom setup for unified processor after rehype
|
|
64
|
-
*/
|
|
65
|
-
rehype?: (processor: Processor) => Awaitable<void | Processor>;
|
|
66
|
-
/**
|
|
67
|
-
* Custom setup for unified processor after all plugins
|
|
68
|
-
*/
|
|
69
|
-
post?: (processor: Processor) => Awaitable<void | Processor>;
|
|
70
|
-
};
|
|
71
|
-
/**
|
|
72
|
-
* Custom hightlighter, available when `highlighter` is set to `custom`
|
|
73
|
-
*/
|
|
74
|
-
highlighter?: Highlighter$1;
|
|
75
|
-
/**
|
|
76
|
-
* Hooks for shiki
|
|
77
|
-
*/
|
|
78
|
-
shiki?: {
|
|
79
|
-
/**
|
|
80
|
-
* Get transformers for shiki
|
|
81
|
-
*/
|
|
82
|
-
transformers?: ShikiTransformer[] | ((code: string, lang: string, theme: MdcThemeOptions, options: Partial<HighlighterOptions>) => Awaitable<ShikiTransformer[]>);
|
|
83
|
-
/**
|
|
84
|
-
* Custom setup for shiki instance, only called once on server or client
|
|
85
|
-
*/
|
|
86
|
-
setup?: (highlighter: HighlighterCore) => Awaitable<void>;
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
|
|
90
33
|
interface TocLink {
|
|
91
34
|
id: string;
|
|
92
35
|
text: string;
|
|
@@ -224,6 +167,7 @@ interface ModuleOptions {
|
|
|
224
167
|
* ```
|
|
225
168
|
*/
|
|
226
169
|
interface Data$1 {
|
|
170
|
+
[key: string]: unknown;
|
|
227
171
|
}
|
|
228
172
|
/**
|
|
229
173
|
* One place in a source file.
|
|
@@ -330,8 +274,7 @@ interface Parent$1 extends Node$1 {
|
|
|
330
274
|
* }
|
|
331
275
|
* ```
|
|
332
276
|
*/
|
|
333
|
-
|
|
334
|
-
}
|
|
277
|
+
type Data = Data$1;
|
|
335
278
|
/**
|
|
336
279
|
* Info associated with an element.
|
|
337
280
|
*/
|
|
@@ -467,8 +410,7 @@ interface Comment extends Literal {
|
|
|
467
410
|
/**
|
|
468
411
|
* Info associated with hast comments by the ecosystem.
|
|
469
412
|
*/
|
|
470
|
-
|
|
471
|
-
}
|
|
413
|
+
type CommentData = Data;
|
|
472
414
|
/**
|
|
473
415
|
* HTML document type.
|
|
474
416
|
*/
|
|
@@ -485,8 +427,7 @@ interface Doctype extends Node$1 {
|
|
|
485
427
|
/**
|
|
486
428
|
* Info associated with hast doctypes by the ecosystem.
|
|
487
429
|
*/
|
|
488
|
-
|
|
489
|
-
}
|
|
430
|
+
type DoctypeData = Data;
|
|
490
431
|
/**
|
|
491
432
|
* HTML element.
|
|
492
433
|
*/
|
|
@@ -520,8 +461,7 @@ interface Element extends Parent {
|
|
|
520
461
|
/**
|
|
521
462
|
* Info associated with hast elements by the ecosystem.
|
|
522
463
|
*/
|
|
523
|
-
|
|
524
|
-
}
|
|
464
|
+
type ElementData = Data;
|
|
525
465
|
/**
|
|
526
466
|
* Document fragment or a whole document.
|
|
527
467
|
*
|
|
@@ -546,8 +486,7 @@ interface Root extends Parent {
|
|
|
546
486
|
/**
|
|
547
487
|
* Info associated with hast root nodes by the ecosystem.
|
|
548
488
|
*/
|
|
549
|
-
|
|
550
|
-
}
|
|
489
|
+
type RootData = Data;
|
|
551
490
|
/**
|
|
552
491
|
* HTML character data (plain text).
|
|
553
492
|
*/
|
|
@@ -564,12 +503,10 @@ interface Text extends Literal {
|
|
|
564
503
|
/**
|
|
565
504
|
* Info associated with hast texts by the ecosystem.
|
|
566
505
|
*/
|
|
567
|
-
|
|
568
|
-
}
|
|
506
|
+
type TextData = Data;
|
|
569
507
|
|
|
570
|
-
declare function defineConfig(config: MdcConfig): MdcConfig;
|
|
571
508
|
declare const DefaultHighlightLangs: BundledLanguage[];
|
|
572
|
-
declare const _default: _nuxt_schema.NuxtModule<ModuleOptions>;
|
|
509
|
+
declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
|
|
573
510
|
|
|
574
511
|
declare module '@nuxt/schema' {
|
|
575
512
|
interface NuxtHooks {
|
|
@@ -600,4 +537,4 @@ declare module '@nuxt/schema' {
|
|
|
600
537
|
}
|
|
601
538
|
}
|
|
602
539
|
|
|
603
|
-
export { type
|
|
540
|
+
export { type Comment, type CommentData, type Content, type Data, DefaultHighlightLangs, type Doctype, type DoctypeData, type Element, type ElementContent, type ElementContentMap, type ElementData, type Literal, type Literals, type MDCComment, type MDCData, type MDCElement, type MDCNode, type MDCParseOptions, type MDCParserResult, type MDCRoot, type MDCText, MdcConfig, MdcThemeOptions, type ModuleOptions, type Node, type Nodes, type Parent, type Parents, type Properties, RehypeHighlightOption, type RehypePlugin, type RemarkPlugin, type Root, type RootContent, type RootContentMap, type RootData, type Text, type TextData, type Toc, type TocLink, type UnistPlugin, _default as default };
|
package/dist/module.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import * as _nuxt_schema from '@nuxt/schema';
|
|
2
|
-
import {
|
|
2
|
+
import { BundledLanguage, LanguageRegistration, BundledTheme, ThemeRegistrationAny } from 'shiki';
|
|
3
3
|
import { Options } from 'remark-rehype';
|
|
4
|
-
import {
|
|
5
|
-
|
|
4
|
+
import { R as RehypeHighlightOption, M as MdcConfig, a as MdcThemeOptions } from './shared/mdc.4762b8bc.js';
|
|
5
|
+
export { A as Awaitable, b as HighlightResult, c as Highlighter, H as HighlighterOptions, d as defineConfig } from './shared/mdc.4762b8bc.js';
|
|
6
|
+
import 'unified';
|
|
7
|
+
import 'hast';
|
|
6
8
|
|
|
7
9
|
type MDCText = {
|
|
8
10
|
type: 'text';
|
|
@@ -28,65 +30,6 @@ interface MDCData extends Record<string, any> {
|
|
|
28
30
|
description: string;
|
|
29
31
|
}
|
|
30
32
|
|
|
31
|
-
type MdcThemeOptions = BuiltinTheme | string | Record<string, BuiltinTheme | string>;
|
|
32
|
-
interface HighlighterOptions {
|
|
33
|
-
highlights?: number[];
|
|
34
|
-
meta?: string;
|
|
35
|
-
}
|
|
36
|
-
interface HighlightResult {
|
|
37
|
-
tree: ElementContent$1[];
|
|
38
|
-
className?: string;
|
|
39
|
-
style?: string;
|
|
40
|
-
inlineStyle?: string;
|
|
41
|
-
}
|
|
42
|
-
type Highlighter = (code: string, lang: string, theme: MdcThemeOptions, options: Partial<HighlighterOptions>) => Promise<HighlightResult>;
|
|
43
|
-
interface RehypeHighlightOption {
|
|
44
|
-
theme?: MdcThemeOptions;
|
|
45
|
-
highlighter?: Highlighter;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
type Awaitable<T> = T | Promise<T>;
|
|
49
|
-
interface MdcConfig {
|
|
50
|
-
/**
|
|
51
|
-
* Hooks for the unified markdown pipeline
|
|
52
|
-
*/
|
|
53
|
-
unified?: {
|
|
54
|
-
/**
|
|
55
|
-
* Custom setup for unified processor before other plugins
|
|
56
|
-
*/
|
|
57
|
-
pre?: (processor: Processor) => Awaitable<void | Processor>;
|
|
58
|
-
/**
|
|
59
|
-
* Custom setup for unified processor after remark but before rehype
|
|
60
|
-
*/
|
|
61
|
-
remark?: (processor: Processor) => Awaitable<void | Processor>;
|
|
62
|
-
/**
|
|
63
|
-
* Custom setup for unified processor after rehype
|
|
64
|
-
*/
|
|
65
|
-
rehype?: (processor: Processor) => Awaitable<void | Processor>;
|
|
66
|
-
/**
|
|
67
|
-
* Custom setup for unified processor after all plugins
|
|
68
|
-
*/
|
|
69
|
-
post?: (processor: Processor) => Awaitable<void | Processor>;
|
|
70
|
-
};
|
|
71
|
-
/**
|
|
72
|
-
* Custom hightlighter, available when `highlighter` is set to `custom`
|
|
73
|
-
*/
|
|
74
|
-
highlighter?: Highlighter$1;
|
|
75
|
-
/**
|
|
76
|
-
* Hooks for shiki
|
|
77
|
-
*/
|
|
78
|
-
shiki?: {
|
|
79
|
-
/**
|
|
80
|
-
* Get transformers for shiki
|
|
81
|
-
*/
|
|
82
|
-
transformers?: ShikiTransformer[] | ((code: string, lang: string, theme: MdcThemeOptions, options: Partial<HighlighterOptions>) => Awaitable<ShikiTransformer[]>);
|
|
83
|
-
/**
|
|
84
|
-
* Custom setup for shiki instance, only called once on server or client
|
|
85
|
-
*/
|
|
86
|
-
setup?: (highlighter: HighlighterCore) => Awaitable<void>;
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
|
|
90
33
|
interface TocLink {
|
|
91
34
|
id: string;
|
|
92
35
|
text: string;
|
|
@@ -224,6 +167,7 @@ interface ModuleOptions {
|
|
|
224
167
|
* ```
|
|
225
168
|
*/
|
|
226
169
|
interface Data$1 {
|
|
170
|
+
[key: string]: unknown;
|
|
227
171
|
}
|
|
228
172
|
/**
|
|
229
173
|
* One place in a source file.
|
|
@@ -330,8 +274,7 @@ interface Parent$1 extends Node$1 {
|
|
|
330
274
|
* }
|
|
331
275
|
* ```
|
|
332
276
|
*/
|
|
333
|
-
|
|
334
|
-
}
|
|
277
|
+
type Data = Data$1;
|
|
335
278
|
/**
|
|
336
279
|
* Info associated with an element.
|
|
337
280
|
*/
|
|
@@ -467,8 +410,7 @@ interface Comment extends Literal {
|
|
|
467
410
|
/**
|
|
468
411
|
* Info associated with hast comments by the ecosystem.
|
|
469
412
|
*/
|
|
470
|
-
|
|
471
|
-
}
|
|
413
|
+
type CommentData = Data;
|
|
472
414
|
/**
|
|
473
415
|
* HTML document type.
|
|
474
416
|
*/
|
|
@@ -485,8 +427,7 @@ interface Doctype extends Node$1 {
|
|
|
485
427
|
/**
|
|
486
428
|
* Info associated with hast doctypes by the ecosystem.
|
|
487
429
|
*/
|
|
488
|
-
|
|
489
|
-
}
|
|
430
|
+
type DoctypeData = Data;
|
|
490
431
|
/**
|
|
491
432
|
* HTML element.
|
|
492
433
|
*/
|
|
@@ -520,8 +461,7 @@ interface Element extends Parent {
|
|
|
520
461
|
/**
|
|
521
462
|
* Info associated with hast elements by the ecosystem.
|
|
522
463
|
*/
|
|
523
|
-
|
|
524
|
-
}
|
|
464
|
+
type ElementData = Data;
|
|
525
465
|
/**
|
|
526
466
|
* Document fragment or a whole document.
|
|
527
467
|
*
|
|
@@ -546,8 +486,7 @@ interface Root extends Parent {
|
|
|
546
486
|
/**
|
|
547
487
|
* Info associated with hast root nodes by the ecosystem.
|
|
548
488
|
*/
|
|
549
|
-
|
|
550
|
-
}
|
|
489
|
+
type RootData = Data;
|
|
551
490
|
/**
|
|
552
491
|
* HTML character data (plain text).
|
|
553
492
|
*/
|
|
@@ -564,12 +503,10 @@ interface Text extends Literal {
|
|
|
564
503
|
/**
|
|
565
504
|
* Info associated with hast texts by the ecosystem.
|
|
566
505
|
*/
|
|
567
|
-
|
|
568
|
-
}
|
|
506
|
+
type TextData = Data;
|
|
569
507
|
|
|
570
|
-
declare function defineConfig(config: MdcConfig): MdcConfig;
|
|
571
508
|
declare const DefaultHighlightLangs: BundledLanguage[];
|
|
572
|
-
declare const _default: _nuxt_schema.NuxtModule<ModuleOptions>;
|
|
509
|
+
declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
|
|
573
510
|
|
|
574
511
|
declare module '@nuxt/schema' {
|
|
575
512
|
interface NuxtHooks {
|
|
@@ -600,4 +537,4 @@ declare module '@nuxt/schema' {
|
|
|
600
537
|
}
|
|
601
538
|
}
|
|
602
539
|
|
|
603
|
-
export { type
|
|
540
|
+
export { type Comment, type CommentData, type Content, type Data, DefaultHighlightLangs, type Doctype, type DoctypeData, type Element, type ElementContent, type ElementContentMap, type ElementData, type Literal, type Literals, type MDCComment, type MDCData, type MDCElement, type MDCNode, type MDCParseOptions, type MDCParserResult, type MDCRoot, type MDCText, MdcConfig, MdcThemeOptions, type ModuleOptions, type Node, type Nodes, type Parent, type Parents, type Properties, RehypeHighlightOption, type RehypePlugin, type RemarkPlugin, type Root, type RootContent, type RootContentMap, type RootData, type Text, type TextData, type Toc, type TocLink, type UnistPlugin, _default as default };
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -4,6 +4,7 @@ import { defu } from 'defu';
|
|
|
4
4
|
import { resolve } from 'pathe';
|
|
5
5
|
import fs from 'node:fs/promises';
|
|
6
6
|
import { pascalCase } from 'scule';
|
|
7
|
+
export { defineConfig } from './config.mjs';
|
|
7
8
|
|
|
8
9
|
const registerMDCSlotTransformer = (resolver) => {
|
|
9
10
|
extendViteConfig((config) => {
|
|
@@ -195,9 +196,6 @@ function addWasmSupport(nuxt) {
|
|
|
195
196
|
});
|
|
196
197
|
}
|
|
197
198
|
|
|
198
|
-
function defineConfig(config) {
|
|
199
|
-
return config;
|
|
200
|
-
}
|
|
201
199
|
const DefaultHighlightLangs = [
|
|
202
200
|
"js",
|
|
203
201
|
"jsx",
|
|
@@ -402,4 +400,4 @@ function resolveOptions(options) {
|
|
|
402
400
|
}
|
|
403
401
|
}
|
|
404
402
|
|
|
405
|
-
export { DefaultHighlightLangs, module as default
|
|
403
|
+
export { DefaultHighlightLangs, module as default };
|