@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/hm-types.mjs CHANGED
@@ -156,7 +156,7 @@ import {
156
156
  toNumber,
157
157
  unpackHmId,
158
158
  unpackedHmIdSchema
159
- } from "./chunk-PPK3SKPV.mjs";
159
+ } from "./chunk-YIND2WNJ.mjs";
160
160
  export {
161
161
  BlockRangeSchema,
162
162
  BoldAnnotationSchema,
@@ -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';