@hywax/mdc-tiptap 0.0.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/LICENSE +21 -0
- package/README.md +59 -0
- package/dist/index.cjs +12311 -0
- package/dist/index.d.cts +30 -0
- package/dist/index.d.mts +30 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.mjs +12297 -0
- package/package.json +62 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { JSONContent } from '@tiptap/vue-3';
|
|
2
|
+
import { MDCRoot, MDCNode, MDCElement } from '@nuxtjs/mdc';
|
|
3
|
+
|
|
4
|
+
declare function tiptapToMarkdown(node: JSONContent): Promise<string | null>;
|
|
5
|
+
declare function markdownToTiptap(markdown: string): Promise<JSONContent>;
|
|
6
|
+
|
|
7
|
+
declare function mdcToTiptap(body: MDCRoot, frontmatter: Record<string, unknown>): JSONContent;
|
|
8
|
+
declare function mdcNodeToTiptap(node: MDCRoot | MDCNode, parent?: MDCNode): JSONContent;
|
|
9
|
+
declare function createMark(node: MDCNode, mark: string, accumulatedMarks?: {
|
|
10
|
+
type: string;
|
|
11
|
+
attrs?: object;
|
|
12
|
+
}[]): JSONContent[];
|
|
13
|
+
|
|
14
|
+
interface SyntaxHighlightTheme {
|
|
15
|
+
default: string;
|
|
16
|
+
dark?: string;
|
|
17
|
+
light?: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
interface TiptapToMDCOptions {
|
|
21
|
+
highlightTheme?: SyntaxHighlightTheme;
|
|
22
|
+
}
|
|
23
|
+
declare function tiptapToMdc(node: JSONContent, options?: TiptapToMDCOptions): Promise<{
|
|
24
|
+
body: MDCRoot;
|
|
25
|
+
data: Record<string, unknown>;
|
|
26
|
+
}>;
|
|
27
|
+
declare function tiptapNodeToMDC(node: JSONContent): MDCRoot | MDCNode | MDCNode[];
|
|
28
|
+
declare function createParagraphElement(node: JSONContent, propsArray: string[][], rest?: object): MDCElement;
|
|
29
|
+
|
|
30
|
+
export { createMark, createParagraphElement, markdownToTiptap, mdcNodeToTiptap, mdcToTiptap, tiptapNodeToMDC, tiptapToMarkdown, tiptapToMdc };
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { JSONContent } from '@tiptap/vue-3';
|
|
2
|
+
import { MDCRoot, MDCNode, MDCElement } from '@nuxtjs/mdc';
|
|
3
|
+
|
|
4
|
+
declare function tiptapToMarkdown(node: JSONContent): Promise<string | null>;
|
|
5
|
+
declare function markdownToTiptap(markdown: string): Promise<JSONContent>;
|
|
6
|
+
|
|
7
|
+
declare function mdcToTiptap(body: MDCRoot, frontmatter: Record<string, unknown>): JSONContent;
|
|
8
|
+
declare function mdcNodeToTiptap(node: MDCRoot | MDCNode, parent?: MDCNode): JSONContent;
|
|
9
|
+
declare function createMark(node: MDCNode, mark: string, accumulatedMarks?: {
|
|
10
|
+
type: string;
|
|
11
|
+
attrs?: object;
|
|
12
|
+
}[]): JSONContent[];
|
|
13
|
+
|
|
14
|
+
interface SyntaxHighlightTheme {
|
|
15
|
+
default: string;
|
|
16
|
+
dark?: string;
|
|
17
|
+
light?: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
interface TiptapToMDCOptions {
|
|
21
|
+
highlightTheme?: SyntaxHighlightTheme;
|
|
22
|
+
}
|
|
23
|
+
declare function tiptapToMdc(node: JSONContent, options?: TiptapToMDCOptions): Promise<{
|
|
24
|
+
body: MDCRoot;
|
|
25
|
+
data: Record<string, unknown>;
|
|
26
|
+
}>;
|
|
27
|
+
declare function tiptapNodeToMDC(node: JSONContent): MDCRoot | MDCNode | MDCNode[];
|
|
28
|
+
declare function createParagraphElement(node: JSONContent, propsArray: string[][], rest?: object): MDCElement;
|
|
29
|
+
|
|
30
|
+
export { createMark, createParagraphElement, markdownToTiptap, mdcNodeToTiptap, mdcToTiptap, tiptapNodeToMDC, tiptapToMarkdown, tiptapToMdc };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { JSONContent } from '@tiptap/vue-3';
|
|
2
|
+
import { MDCRoot, MDCNode, MDCElement } from '@nuxtjs/mdc';
|
|
3
|
+
|
|
4
|
+
declare function tiptapToMarkdown(node: JSONContent): Promise<string | null>;
|
|
5
|
+
declare function markdownToTiptap(markdown: string): Promise<JSONContent>;
|
|
6
|
+
|
|
7
|
+
declare function mdcToTiptap(body: MDCRoot, frontmatter: Record<string, unknown>): JSONContent;
|
|
8
|
+
declare function mdcNodeToTiptap(node: MDCRoot | MDCNode, parent?: MDCNode): JSONContent;
|
|
9
|
+
declare function createMark(node: MDCNode, mark: string, accumulatedMarks?: {
|
|
10
|
+
type: string;
|
|
11
|
+
attrs?: object;
|
|
12
|
+
}[]): JSONContent[];
|
|
13
|
+
|
|
14
|
+
interface SyntaxHighlightTheme {
|
|
15
|
+
default: string;
|
|
16
|
+
dark?: string;
|
|
17
|
+
light?: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
interface TiptapToMDCOptions {
|
|
21
|
+
highlightTheme?: SyntaxHighlightTheme;
|
|
22
|
+
}
|
|
23
|
+
declare function tiptapToMdc(node: JSONContent, options?: TiptapToMDCOptions): Promise<{
|
|
24
|
+
body: MDCRoot;
|
|
25
|
+
data: Record<string, unknown>;
|
|
26
|
+
}>;
|
|
27
|
+
declare function tiptapNodeToMDC(node: JSONContent): MDCRoot | MDCNode | MDCNode[];
|
|
28
|
+
declare function createParagraphElement(node: JSONContent, propsArray: string[][], rest?: object): MDCElement;
|
|
29
|
+
|
|
30
|
+
export { createMark, createParagraphElement, markdownToTiptap, mdcNodeToTiptap, mdcToTiptap, tiptapNodeToMDC, tiptapToMarkdown, tiptapToMdc };
|