@blocknote/xl-pdf-exporter 0.19.0 → 0.19.2

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.
Files changed (41) hide show
  1. package/dist/webpack-stats.json +1 -1
  2. package/package.json +4 -4
  3. package/types/src/pdf/defaultSchema/index.d.ts +0 -6
  4. package/types/src/Exporter.d.ts +0 -26
  5. package/types/src/context/BlockNoteContext.d.ts +0 -59
  6. package/types/src/context/BlockNoteContext.test.d.ts +0 -1
  7. package/types/src/context/ServerBlockNoteEditor.d.ts +0 -137
  8. package/types/src/context/ServerBlockNoteEditor.test.d.ts +0 -1
  9. package/types/src/context/react/ReactServer.test.d.ts +0 -2
  10. package/types/src/docx/blocks.d.ts +0 -433
  11. package/types/src/docx/defaultSchema/blocks.d.ts +0 -4
  12. package/types/src/docx/defaultSchema/index.d.ts +0 -559
  13. package/types/src/docx/defaultSchema/inlinecontent.d.ts +0 -4
  14. package/types/src/docx/defaultSchema/styles.d.ts +0 -4
  15. package/types/src/docx/docxExporter.d.ts +0 -14
  16. package/types/src/docx/docxExporter.test.d.ts +0 -1
  17. package/types/src/docx/imageUtil.d.ts +0 -4
  18. package/types/src/docx/index.d.ts +0 -2
  19. package/types/src/docx/inlinecontent.d.ts +0 -12
  20. package/types/src/docx/styles.d.ts +0 -55
  21. package/types/src/docx/util/Table.d.ts +0 -4
  22. package/types/src/docxExporter.d.ts +0 -255
  23. package/types/src/docxExporter.test.d.ts +0 -1
  24. package/types/src/mapping.d.ts +0 -29
  25. package/types/src/pdf/blocks.d.ts +0 -434
  26. package/types/src/pdf/inlinecontent.d.ts +0 -13
  27. package/types/src/pdf/styles.d.ts +0 -55
  28. package/types/src/pdf/util/loadFontDataUrl.d.ts +0 -3
  29. package/types/src/pdfExporter.d.ts +0 -256
  30. package/types/src/pdfExporter.test.d.ts +0 -1
  31. package/types/src/react-email/defaultSchema/blocks.d.ts +0 -5
  32. package/types/src/react-email/defaultSchema/index.d.ts +0 -560
  33. package/types/src/react-email/defaultSchema/inlinecontent.d.ts +0 -5
  34. package/types/src/react-email/defaultSchema/styles.d.ts +0 -4
  35. package/types/src/react-email/reactEmailExporter.d.ts +0 -13
  36. package/types/src/react-email/reactEmailExporter.test.d.ts +0 -8
  37. package/types/src/testDocument.d.ts +0 -505
  38. package/types/src/transformer.d.ts +0 -20
  39. package/types/src/util/fileUtil.d.ts +0 -22
  40. package/types/src/util/imageUtil.d.ts +0 -4
  41. package/types/src/yjs/index.d.ts +0 -2
@@ -1 +1 @@
1
- {"builtAt":1730893826949,"assets":[{"name":"blocknote-xl-pdf-exporter.umd.cjs","size":1899553},{"name":"blocknote-xl-pdf-exporter.umd.cjs.map","size":2075922}],"chunks":[{"id":"097c571","entry":true,"initial":true,"files":["blocknote-xl-pdf-exporter.umd.cjs"],"names":["index"]}],"modules":[{"name":"../../node_modules/react/jsx-runtime.js?commonjs-module","size":31,"chunks":["097c571"]},{"name":"../../node_modules/react/cjs/react-jsx-runtime.production.min.js?commonjs-exports","size":40,"chunks":["097c571"]},{"name":"../../node_modules/react/index.js?commonjs-module","size":26,"chunks":["097c571"]},{"name":"../../node_modules/react/cjs/react.production.min.js?commonjs-exports","size":30,"chunks":["097c571"]},{"name":"../../node_modules/react/cjs/react.production.min.js","size":7647,"chunks":["097c571"]},{"name":"../../node_modules/react/cjs/react.development.js?commonjs-module","size":38,"chunks":["097c571"]},{"name":"../../node_modules/react/cjs/react.development.js","size":92443,"chunks":["097c571"]},{"name":"../../node_modules/react/index.js","size":299,"chunks":["097c571"]},{"name":"../../node_modules/react/cjs/react-jsx-runtime.production.min.js","size":1192,"chunks":["097c571"]},{"name":"../../node_modules/react/cjs/react-jsx-runtime.development.js?commonjs-exports","size":37,"chunks":["097c571"]},{"name":"../../node_modules/react/cjs/react-jsx-runtime.development.js","size":43835,"chunks":["097c571"]},{"name":"../../node_modules/react/jsx-runtime.js","size":225,"chunks":["097c571"]},{"name":"./src/pdf/util/listItem.tsx","size":1722,"chunks":["097c571"]},{"name":"./src/pdf/util/table/Table.tsx","size":1489,"chunks":["097c571"]},{"name":"./src/pdf/defaultSchema/blocks.tsx","size":5714,"chunks":["097c571"]},{"name":"./src/pdf/defaultSchema/inlinecontent.tsx","size":324,"chunks":["097c571"]},{"name":"./src/pdf/defaultSchema/styles.tsx","size":971,"chunks":["097c571"]},{"name":"./src/pdf/defaultSchema/index.ts","size":199,"chunks":["097c571"]},{"name":"../../shared/api/corsProxy.ts","size":139,"chunks":["097c571"]},{"name":"../../shared/util/fileUtil.ts","size":1044,"chunks":["097c571"]},{"name":"./src/pdf/pdfExporter.tsx","size":5404,"chunks":["097c571"]},{"name":"./src/index.ts","size":0,"chunks":["097c571"]},{"name":"../../shared/assets/fonts/inter/Inter_18pt-Regular.ttf","size":456958,"chunks":["097c571"]},{"name":"../../shared/assets/fonts/inter/Inter_18pt-Italic.ttf","size":462025,"chunks":["097c571"]},{"name":"../../shared/assets/fonts/inter/Inter_18pt-Bold.ttf","size":458919,"chunks":["097c571"]},{"name":"../../shared/assets/fonts/inter/Inter_18pt-BoldItalic.ttf","size":464293,"chunks":["097c571"]}]}
1
+ {"builtAt":1732122435389,"assets":[{"name":"blocknote-xl-pdf-exporter.umd.cjs","size":1899553},{"name":"blocknote-xl-pdf-exporter.umd.cjs.map","size":2075922}],"chunks":[{"id":"097c571","entry":true,"initial":true,"files":["blocknote-xl-pdf-exporter.umd.cjs"],"names":["index"]}],"modules":[{"name":"../../node_modules/react/jsx-runtime.js?commonjs-module","size":31,"chunks":["097c571"]},{"name":"../../node_modules/react/cjs/react-jsx-runtime.production.min.js?commonjs-exports","size":40,"chunks":["097c571"]},{"name":"../../node_modules/react/index.js?commonjs-module","size":26,"chunks":["097c571"]},{"name":"../../node_modules/react/cjs/react.production.min.js?commonjs-exports","size":30,"chunks":["097c571"]},{"name":"../../node_modules/react/cjs/react.production.min.js","size":7647,"chunks":["097c571"]},{"name":"../../node_modules/react/cjs/react.development.js?commonjs-module","size":38,"chunks":["097c571"]},{"name":"../../node_modules/react/cjs/react.development.js","size":92443,"chunks":["097c571"]},{"name":"../../node_modules/react/index.js","size":299,"chunks":["097c571"]},{"name":"../../node_modules/react/cjs/react-jsx-runtime.production.min.js","size":1192,"chunks":["097c571"]},{"name":"../../node_modules/react/cjs/react-jsx-runtime.development.js?commonjs-exports","size":37,"chunks":["097c571"]},{"name":"../../node_modules/react/cjs/react-jsx-runtime.development.js","size":43835,"chunks":["097c571"]},{"name":"../../node_modules/react/jsx-runtime.js","size":225,"chunks":["097c571"]},{"name":"./src/pdf/util/listItem.tsx","size":1722,"chunks":["097c571"]},{"name":"./src/pdf/util/table/Table.tsx","size":1489,"chunks":["097c571"]},{"name":"./src/pdf/defaultSchema/blocks.tsx","size":5714,"chunks":["097c571"]},{"name":"./src/pdf/defaultSchema/inlinecontent.tsx","size":324,"chunks":["097c571"]},{"name":"./src/pdf/defaultSchema/styles.tsx","size":971,"chunks":["097c571"]},{"name":"./src/pdf/defaultSchema/index.ts","size":199,"chunks":["097c571"]},{"name":"../../shared/api/corsProxy.ts","size":139,"chunks":["097c571"]},{"name":"../../shared/util/fileUtil.ts","size":1044,"chunks":["097c571"]},{"name":"./src/pdf/pdfExporter.tsx","size":5404,"chunks":["097c571"]},{"name":"./src/index.ts","size":0,"chunks":["097c571"]},{"name":"../../shared/assets/fonts/inter/Inter_18pt-Regular.ttf","size":456958,"chunks":["097c571"]},{"name":"../../shared/assets/fonts/inter/Inter_18pt-Italic.ttf","size":462025,"chunks":["097c571"]},{"name":"../../shared/assets/fonts/inter/Inter_18pt-Bold.ttf","size":458919,"chunks":["097c571"]},{"name":"../../shared/assets/fonts/inter/Inter_18pt-BoldItalic.ttf","size":464293,"chunks":["097c571"]}]}
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "homepage": "https://github.com/TypeCellOS/BlockNote",
4
4
  "private": false,
5
5
  "license": "AGPL-3.0 OR PROPRIETARY",
6
- "version": "0.19.0",
6
+ "version": "0.19.2",
7
7
  "files": [
8
8
  "dist",
9
9
  "types",
@@ -49,8 +49,8 @@
49
49
  "email": "email dev"
50
50
  },
51
51
  "dependencies": {
52
- "@blocknote/core": "^0.19.0",
53
- "@blocknote/react": "^0.19.0",
52
+ "@blocknote/core": "^0.19.2",
53
+ "@blocknote/react": "^0.19.2",
54
54
  "@react-pdf/renderer": "^4.0.0",
55
55
  "buffer": "^6.0.3",
56
56
  "docx": "^9.0.2"
@@ -84,5 +84,5 @@
84
84
  "access": "public",
85
85
  "registry": "https://registry.npmjs.org/"
86
86
  },
87
- "gitHead": "c48248efc5ceab7962ed6ba39cf8db0cbf3f0d5c"
87
+ "gitHead": "203b0be11ecc5d667bd42e179c5f76dec8b6a19c"
88
88
  }
@@ -212,9 +212,6 @@ export declare const pdfDefaultSchemaMappings: {
212
212
  type: "table";
213
213
  content: "table";
214
214
  propSchema: {
215
- backgroundColor: {
216
- default: "default";
217
- };
218
215
  textColor: {
219
216
  default: "default";
220
217
  };
@@ -224,9 +221,6 @@ export declare const pdfDefaultSchemaMappings: {
224
221
  type: "table";
225
222
  content: "table";
226
223
  propSchema: {
227
- backgroundColor: {
228
- default: "default";
229
- };
230
224
  textColor: {
231
225
  default: "default";
232
226
  };
@@ -1,26 +0,0 @@
1
- import { BlockFromConfig, BlockNoteSchema, BlockSchema, COLORS_DEFAULT, InlineContent, InlineContentSchema, StyleSchema, StyledText, Styles } from "@blocknote/core";
2
- import { BlockMapping, InlineContentMapping, StyleMapping } from "./mapping.js";
3
- export type ExporterOptions = {
4
- resolveFileUrl?: (url: string) => Promise<string | Blob>;
5
- colors: typeof COLORS_DEFAULT;
6
- };
7
- export declare abstract class Exporter<B extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema, RB, RI, RS, TS> {
8
- readonly mappings: {
9
- blockMapping: BlockMapping<B, I, S, RB, RI>;
10
- inlineContentMapping: InlineContentMapping<I, S, RI, TS>;
11
- styleMapping: StyleMapping<S, RS>;
12
- };
13
- readonly options: ExporterOptions;
14
- constructor(_schema: BlockNoteSchema<B, I, S>, // only used for type inference
15
- mappings: {
16
- blockMapping: BlockMapping<B, I, S, RB, RI>;
17
- inlineContentMapping: InlineContentMapping<I, S, RI, TS>;
18
- styleMapping: StyleMapping<S, RS>;
19
- }, options: ExporterOptions);
20
- resolveFile(url: string): Promise<Blob>;
21
- mapStyles(styles: Styles<S>): RS[];
22
- mapInlineContent(inlineContent: InlineContent<I, S>): RI;
23
- transformInlineContent(inlineContentArray: InlineContent<I, S>[]): RI[];
24
- abstract transformStyledText(styledText: StyledText<S>): TS;
25
- mapBlock(block: BlockFromConfig<B[keyof B], I, S>, nestingLevel: number, numberedListIndex: number): Promise<RB>;
26
- }
@@ -1,59 +0,0 @@
1
- import { Block, BlockSchema, BlockSchemaFromSpecs, BlockSpecs, DefaultBlockSchema, DefaultInlineContentSchema, DefaultStyleSchema, InlineContentSchema, InlineContentSchemaFromSpecs, InlineContentSpecs, StyleSchema, StyleSchemaFromSpecs, StyleSpecs, defaultBlockSpecs, defaultInlineContentSpecs, defaultStyleSpecs } from "@blocknote/core";
2
- import { Schema as PMSchema } from "@tiptap/pm/model";
3
- import * as Y from "yjs";
4
- export type BlockNoteEditorOptions<BSpecs extends BlockSpecs, ISpecs extends InlineContentSpecs, SSpecs extends StyleSpecs> = {
5
- blockSpecs: BSpecs;
6
- styleSpecs: SSpecs;
7
- inlineContentSpecs: ISpecs;
8
- };
9
- export declare class BlockNoteContext<BSchema extends BlockSchema = DefaultBlockSchema, ISchema extends InlineContentSchema = DefaultInlineContentSchema, SSchema extends StyleSchema = DefaultStyleSchema> {
10
- readonly blockSchema: BSchema;
11
- readonly inlineContentSchema: ISchema;
12
- readonly styleSchema: SSchema;
13
- readonly blockImplementations: BlockSpecs;
14
- readonly inlineContentImplementations: InlineContentSpecs;
15
- readonly styleImplementations: StyleSpecs;
16
- readonly pmSchema: PMSchema;
17
- static create<BSpecs extends BlockSpecs = typeof defaultBlockSpecs, ISpecs extends InlineContentSpecs = typeof defaultInlineContentSpecs, SSpecs extends StyleSpecs = typeof defaultStyleSpecs>(options?: Partial<BlockNoteEditorOptions<BSpecs, ISpecs, SSpecs>>): BlockNoteContext<BlockSchemaFromSpecs<BSpecs>, InlineContentSchemaFromSpecs<ISpecs>, StyleSchemaFromSpecs<SSpecs>>;
18
- private constructor();
19
- prosemirrorJSONToBlocks(json: any): Block<BSchema, InlineContentSchema, StyleSchema>[];
20
- yDocToBlocks(ydoc: Y.Doc, xmlFragment?: string): Block<BSchema, InlineContentSchema, StyleSchema>[];
21
- yXmlFragmentToBlocks(xmlFragment: Y.XmlFragment): Block<BSchema, InlineContentSchema, StyleSchema>[];
22
- /**
23
- * Serializes blocks into an HTML string. To better conform to HTML standards, children of blocks which aren't list
24
- * items are un-nested in the output HTML.
25
- * @param blocks An array of blocks that should be serialized into HTML.
26
- * @returns The blocks, serialized as an HTML string.
27
- */
28
- blocksToHTMLLossy(blocks: Block<BSchema, ISchema, SSchema>[]): Promise<string>;
29
- /**
30
- * Serializes blocks into an HTML string in the format that it would be rendered by the editor.
31
- *
32
- * Use this method if you want to server-side render HTML (for example, a blog post that has been edited in BlockNote)
33
- * and serve it to users without loading the editor on the client (i.e.: displaying the blog post)
34
- */
35
- blocksToBlockNoteStyleHTML(blocks: Block<BSchema, ISchema, SSchema>[]): Promise<string>;
36
- /**
37
- * Parses blocks from an HTML string. Tries to create `Block` objects out of any HTML block-level elements, and
38
- * `InlineNode` objects from any HTML inline elements, though not all element types are recognized. If BlockNote
39
- * doesn't recognize an HTML element's tag, it will parse it as a paragraph or plain text.
40
- * @param html The HTML string to parse blocks from.
41
- * @returns The blocks parsed from the HTML string.
42
- */
43
- tryParseHTMLToBlocks(html: string): Promise<Block<BSchema, ISchema, SSchema>[]>;
44
- /**
45
- * Serializes blocks into a Markdown string. The output is simplified as Markdown does not support all features of
46
- * BlockNote - children of blocks which aren't list items are un-nested and certain styles are removed.
47
- * @param blocks An array of blocks that should be serialized into Markdown.
48
- * @returns The blocks, serialized as a Markdown string.
49
- */
50
- blocksToMarkdownLossy(blocks: Block<BSchema, ISchema, SSchema>[]): Promise<string>;
51
- /**
52
- * Creates a list of blocks from a Markdown string. Tries to create `Block` and `InlineNode` objects based on
53
- * Markdown syntax, though not all symbols are recognized. If BlockNote doesn't recognize a symbol, it will parse it
54
- * as text.
55
- * @param markdown The Markdown string to parse blocks from.
56
- * @returns The blocks parsed from the Markdown string.
57
- */
58
- tryParseMarkdownToBlocks(markdown: string): Promise<Block<BSchema, ISchema, SSchema>[]>;
59
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,137 +0,0 @@
1
- import { Block, BlockNoteEditor, BlockNoteEditorOptions, BlockSchema, DefaultBlockSchema, DefaultInlineContentSchema, DefaultStyleSchema, InlineContentSchema, PartialBlock, StyleSchema } from "@blocknote/core";
2
- import { Node } from "@tiptap/pm/model";
3
- import * as React from "react";
4
- import type * as Y from "yjs";
5
- /**
6
- * Use the ServerBlockNoteEditor to interact with BlockNote documents in a server (nodejs) environment.
7
- */
8
- export declare class ServerBlockNoteEditor<BSchema extends BlockSchema = DefaultBlockSchema, ISchema extends InlineContentSchema = DefaultInlineContentSchema, SSchema extends StyleSchema = DefaultStyleSchema> {
9
- /**
10
- * Internal BlockNoteEditor (not recommended to use directly, use the methods of this class instead)
11
- */
12
- readonly editor: BlockNoteEditor<BSchema, ISchema, SSchema>;
13
- /**
14
- * We currently use a JSDOM instance to mock document and window methods
15
- *
16
- * A possible improvement could be to make this:
17
- * a) pluggable so other shims can be used as well
18
- * b) obsolete, but for this all blocks should be React based and we need to remove all references to document / window
19
- * from the core / react package. (and even then, it's likely some custom blocks would still use document / window methods)
20
- */
21
- private jsdom;
22
- /**
23
- * Calls a function with mocking window and document using JSDOM
24
- *
25
- * We could make this obsolete by passing in a document / window object to the render / serialize methods of Blocks
26
- */
27
- _withJSDOM<T>(fn: () => Promise<T>): Promise<T>;
28
- static create<BSchema extends BlockSchema = DefaultBlockSchema, ISchema extends InlineContentSchema = DefaultInlineContentSchema, SSchema extends StyleSchema = DefaultStyleSchema>(options?: Partial<BlockNoteEditorOptions<BSchema, ISchema, SSchema>>): ServerBlockNoteEditor<BSchema, ISchema, SSchema>;
29
- protected constructor(options: Partial<BlockNoteEditorOptions<any, any, any>>);
30
- /** PROSEMIRROR / BLOCKNOTE conversions */
31
- /**
32
- * Turn Prosemirror JSON to BlockNote style JSON
33
- * @param json Prosemirror JSON
34
- * @returns BlockNote style JSON
35
- */
36
- _prosemirrorNodeToBlocks(pmNode: Node): Block<BSchema, InlineContentSchema, StyleSchema>[];
37
- /**
38
- * Turn Prosemirror JSON to BlockNote style JSON
39
- * @param json Prosemirror JSON
40
- * @returns BlockNote style JSON
41
- */
42
- _prosemirrorJSONToBlocks(json: any): Block<BSchema, InlineContentSchema, StyleSchema>[];
43
- /**
44
- * Turn BlockNote JSON to Prosemirror node / state
45
- * @param blocks BlockNote blocks
46
- * @returns Prosemirror root node
47
- */
48
- _blocksToProsemirrorNode(blocks: PartialBlock<BSchema, ISchema, SSchema>[]): Node;
49
- /** YJS / BLOCKNOTE conversions */
50
- /**
51
- * Turn a Y.XmlFragment collaborative doc into a BlockNote document (BlockNote style JSON of all blocks)
52
- * @returns BlockNote document (BlockNote style JSON of all blocks)
53
- */
54
- yXmlFragmentToBlocks(xmlFragment: Y.XmlFragment): Block<BSchema, InlineContentSchema, StyleSchema>[];
55
- /**
56
- * Convert blocks to a Y.XmlFragment
57
- *
58
- * This can be used when importing existing content to Y.Doc for the first time,
59
- * note that this should not be used to rehydrate a Y.Doc from a database once
60
- * collaboration has begun as all history will be lost
61
- *
62
- * @param blocks the blocks to convert
63
- * @returns Y.XmlFragment
64
- */
65
- blocksToYXmlFragment(blocks: Block<BSchema, ISchema, SSchema>[], xmlFragment?: Y.XmlFragment): Y.XmlFragment;
66
- /**
67
- * Turn a Y.Doc collaborative doc into a BlockNote document (BlockNote style JSON of all blocks)
68
- * @returns BlockNote document (BlockNote style JSON of all blocks)
69
- */
70
- yDocToBlocks(ydoc: Y.Doc, xmlFragment?: string): Block<BSchema, InlineContentSchema, StyleSchema>[];
71
- /**
72
- * This can be used when importing existing content to Y.Doc for the first time,
73
- * note that this should not be used to rehydrate a Y.Doc from a database once
74
- * collaboration has begun as all history will be lost
75
- *
76
- * @param blocks
77
- */
78
- blocksToYDoc(blocks: PartialBlock<BSchema, ISchema, SSchema>[], xmlFragment?: string): Y.Doc;
79
- /** HTML / BLOCKNOTE conversions */
80
- /**
81
- * Exports blocks into a simplified HTML string. To better conform to HTML standards, children of blocks which aren't list
82
- * items are un-nested in the output HTML.
83
- *
84
- * @param blocks An array of blocks that should be serialized into HTML.
85
- * @returns The blocks, serialized as an HTML string.
86
- */
87
- blocksToHTMLLossy(blocks: PartialBlock<BSchema, ISchema, SSchema>[]): Promise<string>;
88
- /**
89
- * Serializes blocks into an HTML string in the format that would normally be rendered by the editor.
90
- *
91
- * Use this method if you want to server-side render HTML (for example, a blog post that has been edited in BlockNote)
92
- * and serve it to users without loading the editor on the client (i.e.: displaying the blog post)
93
- *
94
- * @param blocks An array of blocks that should be serialized into HTML.
95
- * @returns The blocks, serialized as an HTML string.
96
- */
97
- blocksToFullHTML(blocks: PartialBlock<BSchema, ISchema, SSchema>[]): Promise<string>;
98
- /**
99
- * Parses blocks from an HTML string. Tries to create `Block` objects out of any HTML block-level elements, and
100
- * `InlineNode` objects from any HTML inline elements, though not all element types are recognized. If BlockNote
101
- * doesn't recognize an HTML element's tag, it will parse it as a paragraph or plain text.
102
- * @param html The HTML string to parse blocks from.
103
- * @returns The blocks parsed from the HTML string.
104
- */
105
- tryParseHTMLToBlocks(html: string): Promise<Block<BSchema, ISchema, SSchema>[]>;
106
- /** MARKDOWN / BLOCKNOTE conversions */
107
- /**
108
- * Serializes blocks into a Markdown string. The output is simplified as Markdown does not support all features of
109
- * BlockNote - children of blocks which aren't list items are un-nested and certain styles are removed.
110
- * @param blocks An array of blocks that should be serialized into Markdown.
111
- * @returns The blocks, serialized as a Markdown string.
112
- */
113
- blocksToMarkdownLossy(blocks: PartialBlock<BSchema, ISchema, SSchema>[]): Promise<string>;
114
- /**
115
- * Creates a list of blocks from a Markdown string. Tries to create `Block` and `InlineNode` objects based on
116
- * Markdown syntax, though not all symbols are recognized. If BlockNote doesn't recognize a symbol, it will parse it
117
- * as text.
118
- * @param markdown The Markdown string to parse blocks from.
119
- * @returns The blocks parsed from the Markdown string.
120
- */
121
- tryParseMarkdownToBlocks(markdown: string): Promise<Block<BSchema, ISchema, SSchema>[]>;
122
- /**
123
- * If you're using React Context in your blocks, you can use this method to wrap editor calls for importing / exporting / block manipulation
124
- * with the React Context Provider.
125
- *
126
- * Example:
127
- *
128
- * ```tsx
129
- const html = await editor.withReactContext(
130
- ({ children }) => (
131
- <YourContext.Provider value={true}>{children}</YourContext.Provider>
132
- ),
133
- async () => editor.blocksToFullHTML(blocks)
134
- );
135
- */
136
- withReactContext<T>(comp: React.FC<any>, fn: () => Promise<T>): Promise<T>;
137
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,2 +0,0 @@
1
- /// <reference types="react" />
2
- export declare const TestContext: import("react").Context<true | undefined>;