@tinacms/mdx 0.0.0-8eeb2df-20241010045955 → 0.0.0-8f7f815-20250623000754

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,6 +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;
8
- export type Marks = 'strong' | 'emphasis' | 'inlineCode';
9
- export declare const getMarks: (content: Plate.InlineElement) => Marks[];
@@ -0,0 +1,2 @@
1
+ import type { RichTextField } from '@tinacms/schema-tools';
2
+ export declare const field: RichTextField;
@@ -0,0 +1,2 @@
1
+ import type { RichTextField } from '@tinacms/schema-tools';
2
+ export declare const field: RichTextField;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import { RichTextField } from '@tinacms/schema-tools';
2
+ export declare const field: RichTextField;
@@ -0,0 +1 @@
1
+ export {};
@@ -2,3 +2,4 @@ export declare function removePosition(tree: any): any;
2
2
  export declare const print: (tree: object) => string;
3
3
  export declare const nodePath: (dir: string) => string;
4
4
  export declare const mdPath: (dir: string) => string;
5
+ export declare const jsonPath: (dir: string) => string;
@@ -3,9 +3,9 @@
3
3
 
4
4
 
5
5
  */
6
- import { RichTextParseError } from './remarkToPlate';
7
6
  import type { RichTextType } from '@tinacms/schema-tools';
8
7
  import type * as Plate from './plate';
8
+ import { RichTextParseError } from './remarkToPlate';
9
9
  /**
10
10
  * ### Convert the MDXAST into an API-friendly format
11
11
  *
@@ -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
@@ -173,6 +176,7 @@ export type TextElement = {
173
176
  bold?: boolean;
174
177
  italic?: boolean;
175
178
  code?: boolean;
179
+ strikethrough?: boolean;
176
180
  };
177
181
  /**
178
182
  * @remarks
@@ -28,3 +28,4 @@ export declare class RichTextParseError extends Error {
28
28
  position?: Plate.Position;
29
29
  constructor(message: string, position?: Plate.Position);
30
30
  }
31
+ export declare const sanitizeUrl: (url: string | undefined) => string;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,7 +1,7 @@
1
1
  import type { RichTextField } from '@tinacms/schema-tools';
2
+ import type * as Md from 'mdast';
2
3
  import type { MdxJsxAttribute } from 'mdast-util-mdx-jsx';
3
4
  import * as Plate from '../parse/plate';
4
- import type * as Md from 'mdast';
5
5
  export declare const stringifyPropsInline: (element: Plate.MdxInlineElement, field: RichTextField, imageCallback: (url: string) => string) => {
6
6
  attributes: MdxJsxAttribute[];
7
7
  children: Md.PhrasingContent[];
@@ -1,11 +1,6 @@
1
- /**
2
-
3
-
4
-
5
- */
6
- import { MdxJsxTextElement, MdxJsxFlowElement } from 'mdast-util-mdx-jsx';
7
1
  import type { RichTextType } from '@tinacms/schema-tools';
8
2
  import type * as Md from 'mdast';
3
+ import { MdxJsxFlowElement, MdxJsxTextElement } from 'mdast-util-mdx-jsx';
9
4
  import type * as Plate from '../parse/plate';
10
5
  declare module 'mdast' {
11
6
  interface StaticPhrasingContentMap {
@@ -21,7 +16,7 @@ declare module 'mdast' {
21
16
  mdxJsxFlowElement: MdxJsxFlowElement;
22
17
  }
23
18
  }
24
- export declare const stringifyMDX: (value: Plate.RootElement, field: RichTextType, imageCallback: (url: string) => string) => string | undefined;
19
+ export declare const serializeMDX: (value: Plate.RootElement, field: RichTextType, imageCallback: (url: string) => string) => string | Plate.RootElement | undefined;
25
20
  export type Pattern = {
26
21
  start: string;
27
22
  end: string;
@@ -31,6 +26,7 @@ export type Pattern = {
31
26
  };
32
27
  export declare const toTinaMarkdown: (tree: Md.Root, field: RichTextType) => string;
33
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;
34
30
  export declare const blockElement: (content: Plate.BlockElement, field: RichTextType, imageCallback: (url: string) => string) => Md.Content | null;
35
- export type Marks = 'strong' | 'emphasis' | 'inlineCode';
31
+ export type Marks = 'strong' | 'emphasis' | 'inlineCode' | 'delete';
36
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": "0.0.0-8eeb2df-20241010045955",
3
+ "version": "0.0.0-8f7f815-20250623000754",
4
4
  "typings": "dist/index.d.ts",
5
5
  "main": "dist/index.js",
6
6
  "browser": "dist/index.browser.mjs",
@@ -11,9 +11,9 @@
11
11
  ],
12
12
  "exports": {
13
13
  ".": {
14
+ "browser": "./dist/index.browser.mjs",
14
15
  "import": "./dist/index.mjs",
15
- "require": "./dist/index.js",
16
- "browser": "./dist/index.browser.mjs"
16
+ "require": "./dist/index.js"
17
17
  }
18
18
  },
19
19
  "license": "Apache-2.0",
@@ -50,13 +50,13 @@
50
50
  "remark-gfm": "^2.0.0",
51
51
  "remark-mdx": "2.3.0",
52
52
  "stringify-entities": "4.0.3",
53
- "typedoc": "^0.26.7",
53
+ "typedoc": "^0.26.11",
54
54
  "unist-util-source": "4.0.2",
55
55
  "unist-util-stringify-position": "3.0.3",
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.6.5"
59
+ "@tinacms/schema-tools": "0.0.0-8f7f815-20250623000754"
60
60
  },
61
61
  "publishConfig": {
62
62
  "registry": "https://registry.npmjs.org"
@@ -69,7 +69,7 @@
69
69
  "@types/estree": "1.0.0",
70
70
  "@types/lodash.flatten": "^4.4.9",
71
71
  "@types/mdast": "^3.0.15",
72
- "@types/node": "^22.7.4",
72
+ "@types/node": "^22.13.1",
73
73
  "@types/prettier": "^2.7.3",
74
74
  "@types/unist": "^2.0.11",
75
75
  "c8": "^7.14.0",
@@ -77,18 +77,18 @@
77
77
  "jest-file-snapshot": "^0.5.0",
78
78
  "ts-node": "^10.9.2",
79
79
  "typedoc-plugin-markdown": "^3.17.1",
80
- "typescript": "^5.6.2",
81
- "vite": "^4.5.5",
80
+ "typescript": "^5.7.3",
81
+ "vite": "^4.5.9",
82
82
  "vitest": "^0.32.4",
83
- "@tinacms/scripts": "0.0.0-8eeb2df-20241010045955"
83
+ "@tinacms/scripts": "0.0.0-8f7f815-20250623000754"
84
84
  },
85
85
  "scripts": {
86
86
  "types": "tsc",
87
87
  "build": "tinacms-scripts build",
88
88
  "docs": "typedoc --plugin typedoc-plugin-markdown src/parse/plate.ts --theme markdown && concat-md --decrease-title-levels --dir-name-as-title docs > spec.md",
89
89
  "serve": "nodemon dist/server.js",
90
- "test": "vitest",
90
+ "test": "vitest run",
91
91
  "coverage": "vitest run --coverage",
92
- "test-watch": "jest --watch"
92
+ "test-watch": "vitest"
93
93
  }
94
94
  }