@seed-hypermedia/client 0.0.2 → 0.0.4
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/blocks-to-markdown.d.ts +27 -0
- package/dist/{chunk-PPK3SKPV.mjs → chunk-YIND2WNJ.mjs} +8 -3
- package/dist/editor-types.d.ts +157 -0
- package/dist/editorblock-to-hmblock.d.ts +12 -0
- package/dist/hm-types.d.ts +421 -163
- package/dist/hm-types.mjs +1 -1
- package/dist/hmblock-to-editorblock.d.ts +23 -0
- package/dist/index.d.ts +7 -2
- package/dist/index.mjs +689 -1
- package/dist/markdown-to-blocks.d.ts +10 -1
- package/dist/unicode.d.ts +35 -0
- package/package.json +1 -1
- package/src/index.ts +41 -2
package/dist/hm-types.mjs
CHANGED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { EditorBlock } from './editor-types';
|
|
2
|
+
import { HMBlock, HMBlockChildrenType, HMBlockNode } from './hm-types';
|
|
3
|
+
import type { SpanAnnotation } from './unicode';
|
|
4
|
+
type ServerToEditorRecursiveOpts = {
|
|
5
|
+
level?: number;
|
|
6
|
+
};
|
|
7
|
+
/** Convert an array of HMBlockNode trees into BlockNote EditorBlock arrays. */
|
|
8
|
+
export declare function hmBlocksToEditorContent(blocks: HMBlockNode[], opts?: ServerToEditorRecursiveOpts & {
|
|
9
|
+
childrenType?: HMBlockChildrenType;
|
|
10
|
+
listLevel?: string;
|
|
11
|
+
start?: string;
|
|
12
|
+
}): Array<EditorBlock>;
|
|
13
|
+
/** Convert a single HMBlock into a BlockNote EditorBlock. */
|
|
14
|
+
export declare function hmBlockToEditorBlock(block: HMBlock): EditorBlock;
|
|
15
|
+
/**
|
|
16
|
+
* Checks if a position expressed in code points is within any span
|
|
17
|
+
* of this annotation.
|
|
18
|
+
*
|
|
19
|
+
* Assumes starts and ends arrays are sorted (binary search).
|
|
20
|
+
* Returns the index of the matching span, or -1.
|
|
21
|
+
*/
|
|
22
|
+
export declare function annotationContains(annotation: SpanAnnotation, pos: number): number;
|
|
23
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -24,9 +24,9 @@ export { codePointLength, entityQueryPathToHmIdPath, getHMQueryString, hmIdPathT
|
|
|
24
24
|
export type { HMRequest, HMSigner, UnpackedHypermediaId } from './hm-types';
|
|
25
25
|
export { fileToIpfsBlobs, filesToIpfsBlobs, resolveFileLinksInBlocks, hasFileLinks } from './file-to-ipfs';
|
|
26
26
|
export type { CollectedBlob } from './file-to-ipfs';
|
|
27
|
-
export { parseMarkdown, flattenToOperations, parseInlineFormatting, parseFrontmatter } from './markdown-to-blocks';
|
|
27
|
+
export { parseMarkdown, flattenToOperations, parseInlineFormatting, parseFrontmatter, markdownBlockNodesToHMBlockNodes, } from './markdown-to-blocks';
|
|
28
28
|
export type { BlockNode, SeedBlock, Annotation } from './markdown-to-blocks';
|
|
29
|
-
export { blocksToMarkdown, emitFrontmatter } from './blocks-to-markdown';
|
|
29
|
+
export { blocksToMarkdown, emitFrontmatter, slugify, draftFilename, parseDraftFilename } from './blocks-to-markdown';
|
|
30
30
|
export type { BlocksToMarkdownOptions } from './blocks-to-markdown';
|
|
31
31
|
export { createBlocksMap, matchBlockIds, computeReplaceOps, hmBlockNodeToBlockNode } from './block-diff';
|
|
32
32
|
export type { APIBlockNode, APIBlock } from './block-diff';
|
|
@@ -34,3 +34,8 @@ export { autoLinkChildToParent, createAutoLinkOps, documentContainsLinkToChild,
|
|
|
34
34
|
export type { AutoLinkChildToParentOptions } from './auto-link';
|
|
35
35
|
export { resolveDocumentState } from './document-state';
|
|
36
36
|
export type { DocumentState } from './document-state';
|
|
37
|
+
export { editorBlockToHMBlock, editorBlocksToHMBlockNodes } from './editorblock-to-hmblock';
|
|
38
|
+
export { hmBlocksToEditorContent, hmBlockToEditorBlock, annotationContains } from './hmblock-to-editorblock';
|
|
39
|
+
export { AnnotationSet, addSpanToAnnotation, pushSpanToAnnotation } from './unicode';
|
|
40
|
+
export type { MutableAnnotation, SpanAnnotation } from './unicode';
|
|
41
|
+
export type { EditorBlock, EditorBaseBlock, EditorBlockProps, EditorBlockType, EditorParagraphBlock, EditorHeadingBlock, EditorCodeBlock, EditorImageBlock, EditorVideoBlock, EditorFileBlock, EditorButtonBlock, EditorEmbedBlock, EditorWebEmbedBlock, EditorMathBlock, EditorNostrBlock, EditorQueryBlock, EditorUnknownBlock, EditorText, EditorLink, EditorInlineEmbed, EditorInlineStyles, EditorAnnotationType, HMInlineContent, MediaBlockProps, DraftMediaRef, SearchResult, } from './editor-types';
|