@seed-hypermedia/client 0.0.81 → 0.0.83
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/auto-link.d.ts +3 -4
- package/dist/auto-link.mjs +3 -3
- package/dist/block-diff.mjs +1 -1
- package/dist/blocks-to-markdown.d.ts +16 -11
- package/dist/blocks-to-markdown.mjs +2 -2
- package/dist/capability.mjs +2 -2
- package/dist/{chunk-MZENVC36.mjs → chunk-2GOQZ3DV.mjs} +1 -1
- package/dist/{chunk-OZKQOI2X.mjs → chunk-3KLY2B27.mjs} +51 -4
- package/dist/{chunk-D2LTD2KZ.mjs → chunk-4VD46ULS.mjs} +1 -1
- package/dist/{chunk-C42YWLL2.mjs → chunk-CRMBYTZY.mjs} +1 -1
- package/dist/{chunk-2OMSCQ56.mjs → chunk-E4PGX55A.mjs} +1 -1
- package/dist/{chunk-YH52VFVR.mjs → chunk-E6YSFT63.mjs} +304 -185
- package/dist/{chunk-IREIRKVP.mjs → chunk-IOXGTLKJ.mjs} +1 -1
- package/dist/{chunk-MZUGCZJ6.mjs → chunk-KMQYEO46.mjs} +38 -11
- package/dist/{chunk-LCKCG574.mjs → chunk-NVWWEHIS.mjs} +1 -1
- package/dist/{chunk-RCVLNXG6.mjs → chunk-QBYF2PVS.mjs} +1 -1
- package/dist/{chunk-55OXHA27.mjs → chunk-SIYJHDMJ.mjs} +4 -2
- package/dist/{chunk-WGOIXGRU.mjs → chunk-TUSTJXWH.mjs} +3 -3
- package/dist/{chunk-BO2QSSIU.mjs → chunk-V2UNLCDS.mjs} +1 -1
- package/dist/{chunk-AIQJ6BI3.mjs → chunk-WJRXPYFE.mjs} +1 -1
- package/dist/chunk-XB6E7EVC.mjs +872 -0
- package/dist/client.mjs +2 -2
- package/dist/comment.mjs +2 -2
- package/dist/document-state.mjs +2 -2
- package/dist/editorblock-to-hmblock.mjs +2 -2
- package/dist/hm-resolver.mjs +2 -2
- package/dist/hm-types.d.ts +216 -114
- package/dist/hm-types.mjs +5 -1
- package/dist/hmblock-to-editorblock.mjs +2 -2
- package/dist/index.mjs +15 -15
- package/dist/markdown-to-blocks.d.ts +27 -32
- package/dist/markdown-to-blocks.mjs +3 -1
- package/dist/pdf-to-blocks.mjs +3 -3
- package/dist/resource-read.mjs +4 -4
- package/dist/tei-to-blocks.mjs +2 -2
- package/dist/unicode.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-H7L4TI6X.mjs +0 -705
package/dist/hm-types.mjs
CHANGED
|
@@ -177,6 +177,8 @@ import {
|
|
|
177
177
|
isKnownBlockType,
|
|
178
178
|
isSurrogate,
|
|
179
179
|
knownBlockTypes,
|
|
180
|
+
normalizeQuerySort,
|
|
181
|
+
normalizeQuerySortEntry,
|
|
180
182
|
packBaseId,
|
|
181
183
|
packHmId,
|
|
182
184
|
parseCustomURL,
|
|
@@ -186,7 +188,7 @@ import {
|
|
|
186
188
|
toNumber,
|
|
187
189
|
unpackHmId,
|
|
188
190
|
unpackedHmIdSchema
|
|
189
|
-
} from "./chunk-
|
|
191
|
+
} from "./chunk-KMQYEO46.mjs";
|
|
190
192
|
import "./chunk-7P6ASYW6.mjs";
|
|
191
193
|
export {
|
|
192
194
|
BUILTIN_METADATA_KEYS,
|
|
@@ -367,6 +369,8 @@ export {
|
|
|
367
369
|
isKnownBlockType,
|
|
368
370
|
isSurrogate,
|
|
369
371
|
knownBlockTypes,
|
|
372
|
+
normalizeQuerySort,
|
|
373
|
+
normalizeQuerySortEntry,
|
|
370
374
|
packBaseId,
|
|
371
375
|
packHmId,
|
|
372
376
|
parseCustomURL,
|
|
@@ -2,8 +2,8 @@ import {
|
|
|
2
2
|
annotationContains,
|
|
3
3
|
hmBlockToEditorBlock,
|
|
4
4
|
hmBlocksToEditorContent
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-WJRXPYFE.mjs";
|
|
6
|
+
import "./chunk-KMQYEO46.mjs";
|
|
7
7
|
import "./chunk-7P6ASYW6.mjs";
|
|
8
8
|
export {
|
|
9
9
|
annotationContains,
|
package/dist/index.mjs
CHANGED
|
@@ -7,19 +7,19 @@ import {
|
|
|
7
7
|
parseFrontmatter,
|
|
8
8
|
parseInlineFormatting,
|
|
9
9
|
parseMarkdown
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-XB6E7EVC.mjs";
|
|
11
11
|
import {
|
|
12
12
|
pdfToBlocks
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-NVWWEHIS.mjs";
|
|
14
14
|
import {
|
|
15
15
|
teiToBlocks
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-2GOQZ3DV.mjs";
|
|
17
17
|
import {
|
|
18
18
|
embeddedPdfToBlocks
|
|
19
19
|
} from "./chunk-52P3E6H6.mjs";
|
|
20
20
|
import {
|
|
21
21
|
resolveIdWithClient
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-TUSTJXWH.mjs";
|
|
23
23
|
import {
|
|
24
24
|
fileToIpfsBlobs,
|
|
25
25
|
filesToIpfsBlobs,
|
|
@@ -34,15 +34,15 @@ import {
|
|
|
34
34
|
import {
|
|
35
35
|
resolveHypermediaUrl,
|
|
36
36
|
resolveId
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-4VD46ULS.mjs";
|
|
38
38
|
import {
|
|
39
39
|
annotationContains,
|
|
40
40
|
hmBlockToEditorBlock,
|
|
41
41
|
hmBlocksToEditorContent
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-WJRXPYFE.mjs";
|
|
43
43
|
import {
|
|
44
44
|
createSeedClient
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-QBYF2PVS.mjs";
|
|
46
46
|
import {
|
|
47
47
|
SeedClientError,
|
|
48
48
|
SeedNetworkError,
|
|
@@ -54,7 +54,7 @@ import {
|
|
|
54
54
|
deleteComment,
|
|
55
55
|
trimTrailingEmptyBlocks,
|
|
56
56
|
updateComment
|
|
57
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-IOXGTLKJ.mjs";
|
|
58
58
|
import {
|
|
59
59
|
contactRecordIdFromBlob,
|
|
60
60
|
createContact,
|
|
@@ -64,7 +64,7 @@ import {
|
|
|
64
64
|
import {
|
|
65
65
|
editorBlockToHMBlock,
|
|
66
66
|
editorBlocksToHMBlockNodes
|
|
67
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-E4PGX55A.mjs";
|
|
68
68
|
import {
|
|
69
69
|
AnnotationSet,
|
|
70
70
|
addSpanToAnnotation,
|
|
@@ -79,7 +79,7 @@ import {
|
|
|
79
79
|
documentContainsLinkToChild,
|
|
80
80
|
documentHasSelfQuery,
|
|
81
81
|
shouldAutoLinkParent
|
|
82
|
-
} from "./chunk-
|
|
82
|
+
} from "./chunk-SIYJHDMJ.mjs";
|
|
83
83
|
import {
|
|
84
84
|
createChange,
|
|
85
85
|
createChangeOps,
|
|
@@ -100,7 +100,7 @@ import {
|
|
|
100
100
|
followToDocument,
|
|
101
101
|
resolveDocumentState,
|
|
102
102
|
resolveEditableDocument
|
|
103
|
-
} from "./chunk-
|
|
103
|
+
} from "./chunk-CRMBYTZY.mjs";
|
|
104
104
|
import "./chunk-2MD3FXKB.mjs";
|
|
105
105
|
import {
|
|
106
106
|
computeReplaceOps,
|
|
@@ -109,7 +109,7 @@ import {
|
|
|
109
109
|
matchBlockIds,
|
|
110
110
|
rebindTableIdentities,
|
|
111
111
|
toAPIBlockNode
|
|
112
|
-
} from "./chunk-
|
|
112
|
+
} from "./chunk-3KLY2B27.mjs";
|
|
113
113
|
import {
|
|
114
114
|
blocksToMarkdown,
|
|
115
115
|
commentToResolvedMarkdown,
|
|
@@ -119,11 +119,11 @@ import {
|
|
|
119
119
|
emitFrontmatter,
|
|
120
120
|
parseDraftFilename,
|
|
121
121
|
slugify
|
|
122
|
-
} from "./chunk-
|
|
122
|
+
} from "./chunk-E6YSFT63.mjs";
|
|
123
123
|
import {
|
|
124
124
|
createCapability,
|
|
125
125
|
resolveCapability
|
|
126
|
-
} from "./chunk-
|
|
126
|
+
} from "./chunk-V2UNLCDS.mjs";
|
|
127
127
|
import "./chunk-LVAHHQIK.mjs";
|
|
128
128
|
import "./chunk-NBCHK76Q.mjs";
|
|
129
129
|
import {
|
|
@@ -143,7 +143,7 @@ import {
|
|
|
143
143
|
parseFragment,
|
|
144
144
|
serializeBlockRange,
|
|
145
145
|
unpackHmId
|
|
146
|
-
} from "./chunk-
|
|
146
|
+
} from "./chunk-KMQYEO46.mjs";
|
|
147
147
|
import "./chunk-3TPCJCVO.mjs";
|
|
148
148
|
import "./chunk-7P6ASYW6.mjs";
|
|
149
149
|
export {
|
|
@@ -1,25 +1,11 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Markdown → Seed block tree parser.
|
|
3
|
-
*
|
|
4
|
-
* Converts markdown content into a tree of Seed Hypermedia blocks
|
|
5
|
-
* with proper hierarchy: headings contain their content as children,
|
|
6
|
-
* lists use childrenType attributes, and inline formatting becomes
|
|
7
|
-
* annotations.
|
|
8
|
-
*
|
|
9
|
-
* Supports:
|
|
10
|
-
* - YAML frontmatter (--- delimited) for metadata extraction
|
|
11
|
-
* -  image syntax for Image blocks
|
|
12
|
-
* - $$ delimited math blocks
|
|
13
|
-
* - Block ID preservation via <!-- id:XXXXXXXX --> HTML comments
|
|
14
|
-
* - `title:` as backward-compatible alias for `name:` in frontmatter
|
|
15
|
-
*/
|
|
16
|
-
import type { HMBlockNode, HMMetadata } from './hm-types';
|
|
17
1
|
import type { DocumentOperation } from './change';
|
|
2
|
+
import type { HMBlockNode, HMMetadata } from './hm-types';
|
|
18
3
|
export type Annotation = {
|
|
19
4
|
type: string;
|
|
20
5
|
starts: number[];
|
|
21
6
|
ends: number[];
|
|
22
7
|
link?: string;
|
|
8
|
+
attributes?: Record<string, unknown>;
|
|
23
9
|
};
|
|
24
10
|
export type SeedBlock = {
|
|
25
11
|
type: string;
|
|
@@ -47,17 +33,33 @@ type InlineParseResult = {
|
|
|
47
33
|
};
|
|
48
34
|
/**
|
|
49
35
|
* Parses inline markdown formatting into plain text + annotation spans.
|
|
50
|
-
*
|
|
36
|
+
*
|
|
37
|
+
* Supports `**bold**`, `_italic_` / `*italic*`, `~~strike~~`, `` `code` ``,
|
|
38
|
+
* `<u>`, `<mark>`, `<span style="…">`, `<br>`, `[text](url)`, `<url>`
|
|
39
|
+
* autolinks (hm:// → Embed, else Link) and backslash escapes. Markers are
|
|
40
|
+
* matched with a stack, so well-nested output from the emitter parses
|
|
41
|
+
* exactly; mis-nested hand-written input degrades gracefully.
|
|
51
42
|
*/
|
|
52
43
|
export declare function parseInlineFormatting(raw: string): InlineParseResult;
|
|
44
|
+
/**
|
|
45
|
+
* Merge annotations of the same kind whose ranges touch or overlap into one
|
|
46
|
+
* contiguous range, and order the result deterministically. The emitter
|
|
47
|
+
* splits annotations at every boundary to keep markers well nested, so this
|
|
48
|
+
* is what makes `parse(emit(doc))` equal `doc`.
|
|
49
|
+
*/
|
|
50
|
+
export declare function mergeAdjacentAnnotations(annotations: Annotation[]): Annotation[];
|
|
51
|
+
export type BlockComment = {
|
|
52
|
+
id: string;
|
|
53
|
+
type?: string;
|
|
54
|
+
attrs?: Record<string, unknown>;
|
|
55
|
+
};
|
|
53
56
|
/**
|
|
54
57
|
* Strip YAML frontmatter (--- delimited) from markdown content.
|
|
55
|
-
* Returns the remaining content and
|
|
58
|
+
* Returns the remaining content and the parsed metadata.
|
|
56
59
|
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
* Also accepts `title:` as a backward-compatible alias for `name:`.
|
|
60
|
+
* Every frontmatter key maps 1:1 to a metadata key, including nested values
|
|
61
|
+
* and keys this client does not know (schema-typed documents carry their
|
|
62
|
+
* own). `title:` is accepted as a backward-compatible alias for `name:`.
|
|
61
63
|
*/
|
|
62
64
|
export declare function parseFrontmatter(markdown: string): {
|
|
63
65
|
content: string;
|
|
@@ -66,16 +68,9 @@ export declare function parseFrontmatter(markdown: string): {
|
|
|
66
68
|
/**
|
|
67
69
|
* Builds a hierarchical block tree from markdown.
|
|
68
70
|
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
* - Content before the first heading goes to root level
|
|
73
|
-
*
|
|
74
|
-
* YAML frontmatter (--- delimited) is parsed for document metadata
|
|
75
|
-
* (all HMMetadata fields) and stripped from the content before tokenizing.
|
|
76
|
-
*
|
|
77
|
-
* Block IDs from `<!-- id:XXXXXXXX -->` HTML comments are preserved.
|
|
78
|
-
* When no ID is present, random 8-char IDs are generated.
|
|
71
|
+
* See the module header for the dialect. Frontmatter is parsed for document
|
|
72
|
+
* metadata and stripped from the content before tokenizing. Block IDs from
|
|
73
|
+
* `<!-- id:… -->` comments are preserved; absent ids are generated.
|
|
79
74
|
*/
|
|
80
75
|
export declare function parseMarkdown(markdown: string): {
|
|
81
76
|
tree: BlockNode[];
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
flattenToOperations,
|
|
3
3
|
markdownBlockNodesToHMBlockNodes,
|
|
4
|
+
mergeAdjacentAnnotations,
|
|
4
5
|
parseFrontmatter,
|
|
5
6
|
parseInlineFormatting,
|
|
6
7
|
parseMarkdown
|
|
7
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-XB6E7EVC.mjs";
|
|
8
9
|
import "./chunk-7P6ASYW6.mjs";
|
|
9
10
|
export {
|
|
10
11
|
flattenToOperations,
|
|
11
12
|
markdownBlockNodesToHMBlockNodes,
|
|
13
|
+
mergeAdjacentAnnotations,
|
|
12
14
|
parseFrontmatter,
|
|
13
15
|
parseInlineFormatting,
|
|
14
16
|
parseMarkdown
|
package/dist/pdf-to-blocks.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
pdfToBlocks
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-NVWWEHIS.mjs";
|
|
4
|
+
import "./chunk-2GOQZ3DV.mjs";
|
|
5
5
|
import "./chunk-52P3E6H6.mjs";
|
|
6
6
|
import "./chunk-PPAY4WZX.mjs";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-KMQYEO46.mjs";
|
|
8
8
|
import "./chunk-7P6ASYW6.mjs";
|
|
9
9
|
export {
|
|
10
10
|
pdfToBlocks
|
package/dist/resource-read.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveIdWithClient
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-TUSTJXWH.mjs";
|
|
4
|
+
import "./chunk-4VD46ULS.mjs";
|
|
5
|
+
import "./chunk-QBYF2PVS.mjs";
|
|
6
6
|
import "./chunk-CBELM7KX.mjs";
|
|
7
7
|
import "./chunk-JT57MV7Y.mjs";
|
|
8
8
|
import "./chunk-PJ2RFT5A.mjs";
|
|
9
9
|
import "./chunk-LVAHHQIK.mjs";
|
|
10
10
|
import "./chunk-DR3HJ6BV.mjs";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-KMQYEO46.mjs";
|
|
12
12
|
import "./chunk-7P6ASYW6.mjs";
|
|
13
13
|
export {
|
|
14
14
|
resolveIdWithClient
|
package/dist/tei-to-blocks.mjs
CHANGED
package/dist/unicode.mjs
CHANGED