@tinacms/mdx 1.7.0 → 1.8.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.
@@ -4,4 +4,5 @@ import type * as Plate from '../../parse/plate';
4
4
  import type { RootElement } from '../../parse/plate';
5
5
  export declare const preProcess: (tree: RootElement, field: RichTextField, imageCallback: (url: string) => string) => Md.Root;
6
6
  export declare const rootElement: (content: Plate.RootElement, field: RichTextField, imageCallback: (url: string) => string) => Md.Root;
7
+ export declare const codeLinesToString: (children: any[]) => any[];
7
8
  export declare const blockElement: (content: Plate.BlockElement, field: RichTextField, imageCallback: (url: string) => string) => Md.Content | null;
@@ -17,14 +17,17 @@ export type BlockquoteElement = {
17
17
  type: 'blockquote';
18
18
  children: InlineElement[];
19
19
  };
20
- /**
21
- * @group BlockElement
22
- */
20
+ export type CodeLineElement = {
21
+ type: 'code_line';
22
+ children: {
23
+ text: string;
24
+ }[];
25
+ };
23
26
  export type CodeBlockElement = {
24
27
  type: 'code_block';
25
28
  lang?: string;
26
- value: string;
27
- children: [EmptyTextElement];
29
+ value?: string;
30
+ children: CodeLineElement[];
28
31
  };
29
32
  /**
30
33
  * @group BlockElement
@@ -140,18 +143,10 @@ export type TableElement = {
140
143
  children: TableRowElement[];
141
144
  props: Record<string, unknown>;
142
145
  };
143
- /**
144
- * @group MermaidElement
145
- */
146
- export type MermaidElement = {
147
- type: 'mermaid';
148
- value: string;
149
- children: [EmptyTextElement];
150
- };
151
146
  /**
152
147
  * @group BlockElement
153
148
  */
154
- export type BlockElement = BlockquoteElement | CodeBlockElement | HeadingElement | HrElement | HTMLElement | ImageElement | InvalidMarkdownElement | ListItemElement | MdxBlockElement | ParagraphElement | MermaidElement | OrderedListElement | UnorderedListElement | TableCellElement | TableRowElement | TableElement;
149
+ export type BlockElement = BlockquoteElement | CodeBlockElement | HeadingElement | HrElement | HTMLElement | ImageElement | InvalidMarkdownElement | ListItemElement | MdxBlockElement | ParagraphElement | OrderedListElement | UnorderedListElement | TableCellElement | TableRowElement | TableElement;
155
150
  /**
156
151
  * @group InlineElement
157
152
  */
@@ -26,6 +26,7 @@ export type Pattern = {
26
26
  };
27
27
  export declare const toTinaMarkdown: (tree: Md.Root, field: RichTextType) => string;
28
28
  export declare const rootElement: (content: Plate.RootElement, field: RichTextType, imageCallback: (url: string) => string) => Md.Root;
29
+ export declare function codeLinesToString(content: Plate.CodeBlockElement): string;
29
30
  export declare const blockElement: (content: Plate.BlockElement, field: RichTextType, imageCallback: (url: string) => string) => Md.Content | null;
30
31
  export type Marks = 'strong' | 'emphasis' | 'inlineCode' | 'delete';
31
32
  export declare const getMarks: (content: Plate.InlineElement) => Marks[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tinacms/mdx",
3
- "version": "1.7.0",
3
+ "version": "1.8.1",
4
4
  "typings": "dist/index.d.ts",
5
5
  "main": "dist/index.js",
6
6
  "browser": "dist/index.browser.mjs",
@@ -56,7 +56,7 @@
56
56
  "unist-util-visit": "4.1.2",
57
57
  "uvu": "0.5.6",
58
58
  "vfile-message": "3.1.4",
59
- "@tinacms/schema-tools": "1.8.0"
59
+ "@tinacms/schema-tools": "1.9.1"
60
60
  },
61
61
  "publishConfig": {
62
62
  "registry": "https://registry.npmjs.org"
@@ -80,7 +80,7 @@
80
80
  "typescript": "^5.7.3",
81
81
  "vite": "^4.5.9",
82
82
  "vitest": "^0.32.4",
83
- "@tinacms/scripts": "1.3.5"
83
+ "@tinacms/scripts": "1.4.0"
84
84
  },
85
85
  "scripts": {
86
86
  "types": "tsc",