create-markdown 0.2.2 → 0.4.0
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/index.cjs +19 -1727
- package/dist/index.d.ts +6 -33
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1725
- package/dist/preview.cjs +40 -0
- package/dist/preview.d.ts +8 -0
- package/dist/preview.d.ts.map +1 -0
- package/dist/preview.js +2 -0
- package/dist/react.cjs +40 -0
- package/dist/react.d.ts +8 -0
- package/dist/react.d.ts.map +1 -0
- package/dist/react.js +2 -0
- package/package.json +36 -18
- package/LICENSE +0 -21
- package/README.md +0 -294
- package/dist/core/blocks.d.ts +0 -136
- package/dist/core/blocks.d.ts.map +0 -1
- package/dist/core/document.d.ts +0 -135
- package/dist/core/document.d.ts.map +0 -1
- package/dist/core/utils.d.ts +0 -80
- package/dist/core/utils.d.ts.map +0 -1
- package/dist/parsers/inline.d.ts +0 -14
- package/dist/parsers/inline.d.ts.map +0 -1
- package/dist/parsers/markdown.d.ts +0 -19
- package/dist/parsers/markdown.d.ts.map +0 -1
- package/dist/parsers/tokenizer.d.ts +0 -38
- package/dist/parsers/tokenizer.d.ts.map +0 -1
- package/dist/react/block-renderer.d.ts +0 -70
- package/dist/react/block-renderer.d.ts.map +0 -1
- package/dist/react/hooks.d.ts +0 -142
- package/dist/react/hooks.d.ts.map +0 -1
- package/dist/react/index.cjs +0 -1814
- package/dist/react/index.d.ts +0 -11
- package/dist/react/index.d.ts.map +0 -1
- package/dist/react/index.js +0 -1782
- package/dist/serializers/markdown.d.ts +0 -30
- package/dist/serializers/markdown.d.ts.map +0 -1
- package/dist/types/index.d.ts +0 -199
- package/dist/types/index.d.ts.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,41 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* create-markdown
|
|
3
3
|
* Complete block-based markdown notes package
|
|
4
|
-
* Zero dependencies, full TypeScript support
|
|
5
|
-
*/
|
|
6
|
-
export type { BlockType, Block, ParagraphBlock, HeadingBlock, BulletListBlock, NumberedListBlock, CheckListBlock, CodeBlockBlock, BlockquoteBlock, TableBlock, ImageBlock, DividerBlock, CalloutBlock, CalloutType, BlockProps, BlockPropsMap, HeadingProps, CodeBlockProps, CheckListProps, ImageProps, CalloutProps, TableProps, EmptyProps, InlineStyle, TextSpan, LinkData, Document, DocumentMeta, DocumentOptions, MarkdownSerializeOptions, MarkdownParseOptions, } from './types';
|
|
7
|
-
export { generateId, deepClone, deepCloneBlocks, normalizeLineEndings, convertLineEndings, escapeMarkdown, unescapeMarkdown, escapeCodeBlock, trimTrailingWhitespace, trimBlankLines, indent, spansToPlainText, plainSpan, plainContent, hasContent, hasChildren, isValidHeadingLevel, isValidBlockType, } from './core/utils';
|
|
8
|
-
export { createBlock, text, bold, italic, code, strikethrough, underline, highlight, link, styled, spans, paragraph, heading, h1, h2, h3, h4, h5, h6, bulletList, numberedList, checkListItem, checkList, codeBlock, blockquote, divider, image, callout, infoCallout, warningCallout, tipCallout, dangerCallout, noteCallout, table, appendContent, prependContent, setContent, addChildren, updateProps, } from './core/blocks';
|
|
9
|
-
export { DOCUMENT_VERSION, createDocument, emptyDocument, cloneDocument, insertBlock, appendBlock, prependBlock, insertBlocks, removeBlock, removeBlocks, updateBlock, replaceBlock, moveBlock, swapBlocks, findBlock, getBlockIndex, getBlockAt, getFirstBlock, getLastBlock, findBlocksByType, hasBlock, getBlockCount, isEmpty, setBlockContent, appendBlockContent, updateMeta, setMetaField, getMetaField, clearBlocks, setBlocks, filterBlocks, mapBlocks, } from './core/document';
|
|
10
|
-
export { blocksToMarkdown, documentToMarkdown, serializeBlock, serializeInlineContent, serializeSpan, stringify, } from './serializers/markdown';
|
|
11
|
-
export { markdownToBlocks, markdownToDocument, parse, parseInlineContent, } from './parsers/markdown';
|
|
12
|
-
export { tokenize, groupTokens, isListToken, isCodeToken, } from './parsers/tokenizer';
|
|
13
|
-
export type { Token, TokenType, TokenMeta } from './parsers/tokenizer';
|
|
14
|
-
import type { Block } from './types';
|
|
15
|
-
/**
|
|
16
|
-
* Creates a document from markdown string with full block parsing
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* ```ts
|
|
20
|
-
* const doc = fromMarkdown('# Hello\n\nWorld');
|
|
21
|
-
* console.log(doc.blocks); // [HeadingBlock, ParagraphBlock]
|
|
22
|
-
* ```
|
|
23
|
-
*/
|
|
24
|
-
export declare function fromMarkdown(markdown: string): import("./types").Document;
|
|
25
|
-
/**
|
|
26
|
-
* Converts a document or blocks to markdown string
|
|
27
|
-
*
|
|
28
|
-
* @example
|
|
29
|
-
* ```ts
|
|
30
|
-
* import { h1, paragraph, toMarkdown } from 'create-markdown';
|
|
31
4
|
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
5
|
+
* This is a convenience bundle that re-exports all @create-markdown packages.
|
|
6
|
+
* For optimal bundle size, import directly from the scoped packages:
|
|
7
|
+
* - @create-markdown/core
|
|
8
|
+
* - @create-markdown/react
|
|
9
|
+
* - @create-markdown/preview
|
|
35
10
|
*/
|
|
36
|
-
export
|
|
37
|
-
blocks: Block[];
|
|
38
|
-
}): string;
|
|
11
|
+
export * from '@create-markdown/core';
|
|
39
12
|
/**
|
|
40
13
|
* Package version
|
|
41
14
|
*/
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,cAAc,uBAAuB,CAAC;AAEtC;;GAEG;AACH,eAAO,MAAM,OAAO,UAAU,CAAC"}
|