@nuxtjs/mdc 0.16.0 → 0.16.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/dist/config.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- export { d as defineConfig } from './shared/mdc.4762b8bc.mjs';
1
+ export { d as defineConfig } from './shared/mdc.86c0ccda.mjs';
2
2
  import 'shiki';
3
3
  import 'unified';
4
4
  import 'hast';
package/dist/config.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { d as defineConfig } from './shared/mdc.4762b8bc.js';
1
+ export { d as defineConfig } from './shared/mdc.86c0ccda.js';
2
2
  import 'shiki';
3
3
  import 'unified';
4
4
  import 'hast';
package/dist/module.d.mts CHANGED
@@ -1,9 +1,9 @@
1
1
  import * as _nuxt_schema from '@nuxt/schema';
2
- import { BundledLanguage, LanguageRegistration, BundledTheme, ThemeRegistrationAny } from 'shiki';
3
- import { Options } from 'remark-rehype';
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 { Options as Options$1 } from 'remark-stringify';
2
+ import type { BundledLanguage, BundledTheme, LanguageRegistration, ThemeRegistrationAny } from 'shiki';
3
+ import type { Options } from 'remark-rehype';
4
+ import type { M as MdcConfig, R as RehypeHighlightOption, a as MdcThemeOptions } from './shared/mdc.86c0ccda.mjs';
5
+ export { A as Awaitable, b as HighlightResult, c as Highlighter, H as HighlighterOptions, d as defineConfig } from './shared/mdc.86c0ccda.mjs';
6
+ import type { Options as Options$1 } from 'remark-stringify';
7
7
  import 'unified';
8
8
  import 'hast';
9
9
 
@@ -44,6 +44,14 @@ interface Toc {
44
44
  links: TocLink[];
45
45
  }
46
46
 
47
+
48
+
49
+
50
+
51
+
52
+
53
+
54
+
47
55
  interface RemarkPlugin {
48
56
  instance?: any;
49
57
  options?: Array<any> | Record<string, any>;
@@ -87,6 +95,8 @@ interface MDCParserResult {
87
95
  toc: Toc | undefined;
88
96
  }
89
97
 
98
+
99
+
90
100
  interface MDCStringifyOptions {
91
101
  plugins?: {
92
102
  remarkStringify?: {
@@ -95,6 +105,15 @@ interface MDCStringifyOptions {
95
105
  };
96
106
  }
97
107
 
108
+
109
+
110
+
111
+
112
+
113
+
114
+
115
+
116
+
98
117
  interface UnistPlugin {
99
118
  src?: string;
100
119
  options?: Record<string, any>;
@@ -281,6 +300,14 @@ interface Parent$1 extends Node$1 {
281
300
  children: Node$1[];
282
301
  }
283
302
 
303
+
304
+
305
+
306
+
307
+
308
+
309
+
310
+
284
311
  /**
285
312
  * Info associated with hast nodes by the ecosystem.
286
313
  *
@@ -530,12 +557,17 @@ interface Text extends Literal {
530
557
  */
531
558
  type TextData = Data;
532
559
 
560
+
561
+
533
562
  interface MDCRenderOptions {
534
563
  documentMeta: MDCData;
535
564
  parentScope: any;
536
565
  resolveComponent: (component: any) => any;
537
566
  }
538
567
 
568
+
569
+
570
+
539
571
  declare const DefaultHighlightLangs: BundledLanguage[];
540
572
  declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
541
573
 
@@ -567,4 +599,5 @@ declare module '@nuxt/schema' {
567
599
  }
568
600
  }
569
601
 
570
- 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 MDCRenderOptions, type MDCRoot, type MDCStringifyOptions, 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 };
602
+ export { DefaultHighlightLangs, _default as default };
603
+ export type { Comment, CommentData, Content, Data, Doctype, DoctypeData, Element, ElementContent, ElementContentMap, ElementData, Literal, Literals, MDCComment, MDCData, MDCElement, MDCNode, MDCParseOptions, MDCParserResult, MDCRenderOptions, MDCRoot, MDCStringifyOptions, MDCText, MdcConfig, MdcThemeOptions, ModuleOptions, Node, Nodes, Parent, Parents, Properties, RehypeHighlightOption, RehypePlugin, RemarkPlugin, Root, RootContent, RootContentMap, RootData, Text, TextData, Toc, TocLink, UnistPlugin };
package/dist/module.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import * as _nuxt_schema from '@nuxt/schema';
2
- import { BundledLanguage, LanguageRegistration, BundledTheme, ThemeRegistrationAny } from 'shiki';
3
- import { Options } from 'remark-rehype';
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 { Options as Options$1 } from 'remark-stringify';
2
+ import type { BundledLanguage, BundledTheme, LanguageRegistration, ThemeRegistrationAny } from 'shiki';
3
+ import type { Options } from 'remark-rehype';
4
+ import type { M as MdcConfig, R as RehypeHighlightOption, a as MdcThemeOptions } from './shared/mdc.86c0ccda.js';
5
+ export { A as Awaitable, b as HighlightResult, c as Highlighter, H as HighlighterOptions, d as defineConfig } from './shared/mdc.86c0ccda.js';
6
+ import type { Options as Options$1 } from 'remark-stringify';
7
7
  import 'unified';
8
8
  import 'hast';
9
9
 
@@ -44,6 +44,14 @@ interface Toc {
44
44
  links: TocLink[];
45
45
  }
46
46
 
47
+
48
+
49
+
50
+
51
+
52
+
53
+
54
+
47
55
  interface RemarkPlugin {
48
56
  instance?: any;
49
57
  options?: Array<any> | Record<string, any>;
@@ -87,6 +95,8 @@ interface MDCParserResult {
87
95
  toc: Toc | undefined;
88
96
  }
89
97
 
98
+
99
+
90
100
  interface MDCStringifyOptions {
91
101
  plugins?: {
92
102
  remarkStringify?: {
@@ -95,6 +105,15 @@ interface MDCStringifyOptions {
95
105
  };
96
106
  }
97
107
 
108
+
109
+
110
+
111
+
112
+
113
+
114
+
115
+
116
+
98
117
  interface UnistPlugin {
99
118
  src?: string;
100
119
  options?: Record<string, any>;
@@ -281,6 +300,14 @@ interface Parent$1 extends Node$1 {
281
300
  children: Node$1[];
282
301
  }
283
302
 
303
+
304
+
305
+
306
+
307
+
308
+
309
+
310
+
284
311
  /**
285
312
  * Info associated with hast nodes by the ecosystem.
286
313
  *
@@ -530,12 +557,17 @@ interface Text extends Literal {
530
557
  */
531
558
  type TextData = Data;
532
559
 
560
+
561
+
533
562
  interface MDCRenderOptions {
534
563
  documentMeta: MDCData;
535
564
  parentScope: any;
536
565
  resolveComponent: (component: any) => any;
537
566
  }
538
567
 
568
+
569
+
570
+
539
571
  declare const DefaultHighlightLangs: BundledLanguage[];
540
572
  declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
541
573
 
@@ -567,4 +599,5 @@ declare module '@nuxt/schema' {
567
599
  }
568
600
  }
569
601
 
570
- 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 MDCRenderOptions, type MDCRoot, type MDCStringifyOptions, 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 };
602
+ export { DefaultHighlightLangs, _default as default };
603
+ export type { Comment, CommentData, Content, Data, Doctype, DoctypeData, Element, ElementContent, ElementContentMap, ElementData, Literal, Literals, MDCComment, MDCData, MDCElement, MDCNode, MDCParseOptions, MDCParserResult, MDCRenderOptions, MDCRoot, MDCStringifyOptions, MDCText, MdcConfig, MdcThemeOptions, ModuleOptions, Node, Nodes, Parent, Parents, Properties, RehypeHighlightOption, RehypePlugin, RemarkPlugin, Root, RootContent, RootContentMap, RootData, Text, TextData, Toc, TocLink, UnistPlugin };
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nuxtjs/mdc",
3
3
  "configKey": "mdc",
4
- "version": "0.16.0",
4
+ "version": "0.16.1",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "0.8.4",
7
7
  "unbuild": "2.0.0"
@@ -145,14 +145,6 @@ const mdcRemarkHandlers = {
145
145
  meta
146
146
  };
147
147
  },
148
- binding: (state, node) => {
149
- return {
150
- type: "textComponent",
151
- name: "binding",
152
- attributes: node.properties,
153
- children: state.toFlow(state.all(node))
154
- };
155
- },
156
148
  span: (state, node) => {
157
149
  const result = {
158
150
  type: "textComponent",
@@ -163,30 +155,12 @@ const mdcRemarkHandlers = {
163
155
  state.patch(node, result);
164
156
  return result;
165
157
  },
166
- video: (state, node) => {
167
- return {
168
- type: "textComponent",
169
- name: "video",
170
- attributes: node.properties,
171
- children: state.toFlow(state.all(node))
172
- };
173
- },
174
- "nuxt-img": (state, node) => {
175
- return {
176
- type: "textComponent",
177
- name: "nuxt-img",
178
- attributes: node.properties,
179
- children: state.toFlow(state.all(node))
180
- };
181
- },
182
- "nuxt-picture": (state, node) => {
183
- return {
184
- type: "textComponent",
185
- name: "nuxt-picture",
186
- attributes: node.properties,
187
- children: state.toFlow(state.all(node))
188
- };
189
- },
158
+ binding: createTextComponent("binding"),
159
+ iframe: createTextComponent("iframe"),
160
+ video: createTextComponent("video"),
161
+ "nuxt-img": createTextComponent("nuxt-img"),
162
+ "nuxt-picture": createTextComponent("nuxt-picture"),
163
+ br: createTextComponent("br"),
190
164
  table: (state, node) => {
191
165
  visit(node, (node2) => {
192
166
  if (node2.type === mdcRemarkElementType) {
@@ -243,12 +217,15 @@ const mdcRemarkHandlers = {
243
217
  };
244
218
  state.patch(node, result);
245
219
  return result;
246
- },
247
- br(state, node) {
220
+ }
221
+ };
222
+ function createTextComponent(name) {
223
+ return (state, node) => {
248
224
  return {
249
225
  type: "textComponent",
250
- name: "br",
251
- attributes: node.properties
226
+ name,
227
+ attributes: node.properties,
228
+ children: node.children ? state.toFlow(state.all(node)) : void 0
252
229
  };
253
- }
254
- };
230
+ };
231
+ }
@@ -1,6 +1,9 @@
1
- import { BuiltinTheme, Highlighter as Highlighter$1, ShikiTransformer, HighlighterCore } from 'shiki';
2
- import { Processor } from 'unified';
3
- import { ElementContent } from 'hast';
1
+ import type { BuiltinTheme, Highlighter as Highlighter$1, HighlighterCore, ShikiTransformer } from 'shiki';
2
+ import type { Processor } from 'unified';
3
+ import type { ElementContent } from 'hast';
4
+
5
+
6
+
4
7
 
5
8
  type MdcThemeOptions = BuiltinTheme | string | Record<string, BuiltinTheme | string>;
6
9
  interface HighlighterOptions {
@@ -19,6 +22,16 @@ interface RehypeHighlightOption {
19
22
  highlighter?: Highlighter;
20
23
  }
21
24
 
25
+
26
+
27
+
28
+
29
+
30
+
31
+
32
+
33
+
34
+
22
35
  type Awaitable<T> = T | Promise<T>;
23
36
  interface MdcConfig {
24
37
  /**
@@ -61,6 +74,9 @@ interface MdcConfig {
61
74
  };
62
75
  }
63
76
 
77
+
78
+
64
79
  declare function defineConfig(config: MdcConfig): MdcConfig;
65
80
 
66
- export { type Awaitable as A, type HighlighterOptions as H, type MdcConfig as M, type RehypeHighlightOption as R, type MdcThemeOptions as a, type HighlightResult as b, type Highlighter as c, defineConfig as d };
81
+ export { defineConfig as d };
82
+ export type { Awaitable as A, HighlighterOptions as H, MdcConfig as M, RehypeHighlightOption as R, MdcThemeOptions as a, HighlightResult as b, Highlighter as c };
@@ -1,6 +1,9 @@
1
- import { BuiltinTheme, Highlighter as Highlighter$1, ShikiTransformer, HighlighterCore } from 'shiki';
2
- import { Processor } from 'unified';
3
- import { ElementContent } from 'hast';
1
+ import type { BuiltinTheme, Highlighter as Highlighter$1, HighlighterCore, ShikiTransformer } from 'shiki';
2
+ import type { Processor } from 'unified';
3
+ import type { ElementContent } from 'hast';
4
+
5
+
6
+
4
7
 
5
8
  type MdcThemeOptions = BuiltinTheme | string | Record<string, BuiltinTheme | string>;
6
9
  interface HighlighterOptions {
@@ -19,6 +22,16 @@ interface RehypeHighlightOption {
19
22
  highlighter?: Highlighter;
20
23
  }
21
24
 
25
+
26
+
27
+
28
+
29
+
30
+
31
+
32
+
33
+
34
+
22
35
  type Awaitable<T> = T | Promise<T>;
23
36
  interface MdcConfig {
24
37
  /**
@@ -61,6 +74,9 @@ interface MdcConfig {
61
74
  };
62
75
  }
63
76
 
77
+
78
+
64
79
  declare function defineConfig(config: MdcConfig): MdcConfig;
65
80
 
66
- export { type Awaitable as A, type HighlighterOptions as H, type MdcConfig as M, type RehypeHighlightOption as R, type MdcThemeOptions as a, type HighlightResult as b, type Highlighter as c, defineConfig as d };
81
+ export { defineConfig as d };
82
+ export type { Awaitable as A, HighlighterOptions as H, MdcConfig as M, RehypeHighlightOption as R, MdcThemeOptions as a, HighlightResult as b, Highlighter as c };
package/dist/types.d.mts CHANGED
@@ -1 +1,7 @@
1
+ import type { NuxtModule } from '@nuxt/schema'
2
+
3
+ import type { default as Module } from './module.js'
4
+
5
+ export type ModuleOptions = typeof Module extends NuxtModule<infer O> ? Partial<O> : Record<string, any>
6
+
1
7
  export { type Awaitable, type HighlightResult, type Highlighter, type HighlighterOptions, type defineConfig } from './module.js'
package/dist/types.d.ts CHANGED
@@ -1 +1,7 @@
1
+ import type { NuxtModule } from '@nuxt/schema'
2
+
3
+ import type { default as Module } from './module'
4
+
5
+ export type ModuleOptions = typeof Module extends NuxtModule<infer O> ? Partial<O> : Record<string, any>
6
+
1
7
  export { type Awaitable, type HighlightResult, type Highlighter, type HighlighterOptions, type defineConfig } from './module'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuxtjs/mdc",
3
- "version": "0.16.0",
3
+ "version": "0.16.1",
4
4
  "description": "Nuxt MDC module",
5
5
  "repository": "nuxt-modules/mdc",
6
6
  "license": "MIT",
@@ -72,7 +72,7 @@
72
72
  "verify": "npm run dev:prepare && npm run lint && npm run test && npm run typecheck"
73
73
  },
74
74
  "dependencies": {
75
- "@nuxt/kit": "^3.16.0",
75
+ "@nuxt/kit": "^3.16.1",
76
76
  "@shikijs/transformers": "^3.2.1",
77
77
  "@types/hast": "^3.0.4",
78
78
  "@types/mdast": "^4.0.4",
@@ -114,16 +114,16 @@
114
114
  "vfile": "^6.0.3"
115
115
  },
116
116
  "devDependencies": {
117
- "@nuxt/devtools": "^2.3.0",
117
+ "@nuxt/devtools": "^2.3.1",
118
118
  "@nuxt/eslint-config": "^1.2.0",
119
119
  "@nuxt/module-builder": "^0.8.4",
120
- "@nuxt/schema": "^3.16.0",
120
+ "@nuxt/schema": "^3.16.1",
121
121
  "@nuxt/test-utils": "^3.17.2",
122
122
  "@nuxt/ui": "^3.0.0",
123
123
  "@nuxtjs/mdc": "link:.",
124
124
  "@types/node": "^22.13.10",
125
125
  "eslint": "^9.22.0",
126
- "nuxt": "^3.16.0",
126
+ "nuxt": "^3.16.1",
127
127
  "rehype": "^13.0.2",
128
128
  "release-it": "^18.1.2",
129
129
  "typescript": "5.8.2",