@seed-hypermedia/client 0.0.107 → 0.0.109
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.mjs +3 -3
- package/dist/blocks-to-markdown.mjs +2 -2
- package/dist/capability.mjs +2 -2
- package/dist/{chunk-WNLWE5P5.mjs → chunk-2NM2JP5H.mjs} +3 -3
- package/dist/{chunk-SG22LWXW.mjs → chunk-34OBOF5O.mjs} +1 -1
- package/dist/{chunk-FFH7G6KW.mjs → chunk-52RP7HHW.mjs} +1 -1
- package/dist/{chunk-6IW7VKZY.mjs → chunk-5MVCUZBD.mjs} +1 -1
- package/dist/{chunk-OSSRQKDG.mjs → chunk-7IISPGNN.mjs} +11 -2
- package/dist/{chunk-M7BEYZZV.mjs → chunk-BHESE4LH.mjs} +3 -3
- package/dist/{chunk-WHQC63KZ.mjs → chunk-G7CFO5W3.mjs} +7 -2
- package/dist/{chunk-3AJ2YACM.mjs → chunk-GWV7ETLU.mjs} +2 -2
- package/dist/{chunk-O4PVMTYN.mjs → chunk-HLTKEZ7W.mjs} +1 -1
- package/dist/{chunk-C2SV4WDE.mjs → chunk-IAS2V6ON.mjs} +1 -1
- package/dist/{chunk-FJSBNU57.mjs → chunk-ICFYYWGD.mjs} +1 -1
- package/dist/{chunk-7UR6YTQD.mjs → chunk-KNA3PBET.mjs} +5 -1
- package/dist/{chunk-4D6BGGEM.mjs → chunk-KOQHARP5.mjs} +1 -1
- package/dist/{chunk-YB5PU37B.mjs → chunk-SQFGEPOQ.mjs} +1 -1
- package/dist/chunk-Y5XKORRF.mjs +10 -0
- package/dist/{chunk-FXK6WCQS.mjs → chunk-Z3J6R5DN.mjs} +1 -1
- package/dist/client.d.ts +1 -1
- package/dist/client.mjs +2 -2
- package/dist/comment.mjs +2 -2
- package/dist/document-state.mjs +2 -2
- package/dist/editor-types.d.ts +2 -1
- package/dist/editorblock-to-hmblock.mjs +2 -2
- package/dist/hm-resolver.mjs +2 -2
- package/dist/hm-types.d.ts +2631 -2417
- package/dist/hm-types.mjs +3 -1
- package/dist/hmblock-to-editorblock.mjs +2 -2
- package/dist/index.mjs +13 -13
- package/dist/pdf-to-blocks.mjs +3 -3
- package/dist/resource-read.mjs +4 -4
- package/dist/schema-engine.mjs +2 -2
- package/dist/schema-registry.generated.mjs +1 -1
- package/dist/schema-resolve.mjs +4 -4
- package/dist/schema-subtypes.mjs +4 -4
- package/dist/schema-types.generated.d.ts +33 -0
- package/dist/signed-blob.mjs +2 -2
- package/dist/tei-to-blocks.mjs +2 -2
- package/dist/unicode.mjs +1 -1
- package/package.json +3 -3
- package/dist/chunk-ZWKMAGDU.mjs +0 -10
package/dist/auto-link.mjs
CHANGED
|
@@ -4,13 +4,13 @@ import {
|
|
|
4
4
|
documentContainsLinkToChild,
|
|
5
5
|
documentHasSelfQuery,
|
|
6
6
|
shouldAutoLinkParent
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-GWV7ETLU.mjs";
|
|
8
8
|
import "./chunk-O5MHN2EO.mjs";
|
|
9
9
|
import "./chunk-PJ2RFT5A.mjs";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-ICFYYWGD.mjs";
|
|
11
11
|
import "./chunk-LVAHHQIK.mjs";
|
|
12
12
|
import "./chunk-DR3HJ6BV.mjs";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-7IISPGNN.mjs";
|
|
14
14
|
import "./chunk-7P6ASYW6.mjs";
|
|
15
15
|
export {
|
|
16
16
|
autoLinkChildToParent,
|
|
@@ -7,8 +7,8 @@ import {
|
|
|
7
7
|
emitFrontmatter,
|
|
8
8
|
parseDraftFilename,
|
|
9
9
|
slugify
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
10
|
+
} from "./chunk-HLTKEZ7W.mjs";
|
|
11
|
+
import "./chunk-7IISPGNN.mjs";
|
|
12
12
|
import "./chunk-7P6ASYW6.mjs";
|
|
13
13
|
export {
|
|
14
14
|
blocksToMarkdown,
|
package/dist/capability.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createCapability,
|
|
3
3
|
resolveCapability
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-SQFGEPOQ.mjs";
|
|
5
5
|
import "./chunk-LVAHHQIK.mjs";
|
|
6
6
|
import "./chunk-NBCHK76Q.mjs";
|
|
7
7
|
import "./chunk-DR3HJ6BV.mjs";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-7IISPGNN.mjs";
|
|
9
9
|
import "./chunk-3TPCJCVO.mjs";
|
|
10
10
|
import "./chunk-7P6ASYW6.mjs";
|
|
11
11
|
export {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveId
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-5MVCUZBD.mjs";
|
|
4
4
|
import {
|
|
5
5
|
createSeedClient
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-IAS2V6ON.mjs";
|
|
7
7
|
import {
|
|
8
8
|
unpackHmId
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-7IISPGNN.mjs";
|
|
10
10
|
|
|
11
11
|
// src/resource-read.ts
|
|
12
12
|
async function resolveIdWithClient(rawId, options = {}) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/hm-types.ts
|
|
2
|
-
import * as z from "zod";
|
|
2
|
+
import * as z from "zod/v3";
|
|
3
3
|
var BlockRangeSchema = z.object({
|
|
4
4
|
// a block range should either have start+end
|
|
5
5
|
start: z.number().optional(),
|
|
@@ -22,6 +22,12 @@ var unpackedHmIdSchema = z.object({
|
|
|
22
22
|
targetDocPath: z.array(z.string()).nullable().optional()
|
|
23
23
|
});
|
|
24
24
|
var HMBlockChildrenTypeSchema = z.union([z.literal("Group"), z.literal("Ordered"), z.literal("Unordered"), z.literal("Blockquote"), z.literal("Grid")]).nullable();
|
|
25
|
+
var HMBlockTextAlignmentSchema = z.union([
|
|
26
|
+
z.literal("left"),
|
|
27
|
+
z.literal("center"),
|
|
28
|
+
z.literal("right"),
|
|
29
|
+
z.literal("justify")
|
|
30
|
+
]);
|
|
25
31
|
var HMEmbedViewSchema = z.union([
|
|
26
32
|
z.literal("Content"),
|
|
27
33
|
z.literal("Card"),
|
|
@@ -138,7 +144,9 @@ var textBlockProperties = {
|
|
|
138
144
|
};
|
|
139
145
|
var parentBlockAttributes = {
|
|
140
146
|
childrenType: HMBlockChildrenTypeSchema.optional(),
|
|
141
|
-
columnCount: z.number().optional()
|
|
147
|
+
columnCount: z.number().optional(),
|
|
148
|
+
// An unknown value is dropped rather than failing the block, which would turn it into an unknown block.
|
|
149
|
+
textAlignment: HMBlockTextAlignmentSchema.optional().catch(void 0)
|
|
142
150
|
};
|
|
143
151
|
var HMBlockParagraphSchema = z.object({
|
|
144
152
|
type: z.literal("Paragraph"),
|
|
@@ -1716,6 +1724,7 @@ export {
|
|
|
1716
1724
|
BlockRangeSchema,
|
|
1717
1725
|
unpackedHmIdSchema,
|
|
1718
1726
|
HMBlockChildrenTypeSchema,
|
|
1727
|
+
HMBlockTextAlignmentSchema,
|
|
1719
1728
|
HMEmbedViewSchema,
|
|
1720
1729
|
HMQueryStyleSchema,
|
|
1721
1730
|
BoldAnnotationSchema,
|
|
@@ -10,17 +10,17 @@ import {
|
|
|
10
10
|
schemaForCid,
|
|
11
11
|
structFields,
|
|
12
12
|
validate
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-52RP7HHW.mjs";
|
|
14
14
|
import {
|
|
15
15
|
HM_SCHEMAS
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-Y5XKORRF.mjs";
|
|
17
17
|
import {
|
|
18
18
|
parseCidString
|
|
19
19
|
} from "./chunk-VWSAFDOL.mjs";
|
|
20
20
|
import {
|
|
21
21
|
packHmId,
|
|
22
22
|
unpackHmId
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-7IISPGNN.mjs";
|
|
24
24
|
|
|
25
25
|
// src/schema-resolve.ts
|
|
26
26
|
var DAG_CBOR_CODE = 113;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getSupportedHMQueryFilters,
|
|
3
3
|
isSurrogate
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-7IISPGNN.mjs";
|
|
5
5
|
|
|
6
6
|
// src/hmblock-to-editorblock.ts
|
|
7
7
|
function toEditorBlockType(hmBlockType) {
|
|
@@ -104,6 +104,11 @@ function hmBlockToEditorBlock(block) {
|
|
|
104
104
|
out.props.columnCount = String(attributes.columnCount);
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
|
+
const textAlignment = attributes.textAlignment;
|
|
108
|
+
if (textAlignment === "center" || textAlignment === "right" || textAlignment === "justify") {
|
|
109
|
+
;
|
|
110
|
+
out.props.textAlignment = textAlignment;
|
|
111
|
+
}
|
|
107
112
|
if (["code-block", "video", "image", "file", "button", "embed", "web-embed", "math", "nostr"].includes(blockType)) {
|
|
108
113
|
if (block.link) {
|
|
109
114
|
;
|
|
@@ -114,7 +119,7 @@ function hmBlockToEditorBlock(block) {
|
|
|
114
119
|
}
|
|
115
120
|
if (block.attributes) {
|
|
116
121
|
Object.entries(block.attributes).forEach(([key, value]) => {
|
|
117
|
-
if (value !== void 0) {
|
|
122
|
+
if (value !== void 0 && key !== "textAlignment") {
|
|
118
123
|
if (key == "width" || key == "size") {
|
|
119
124
|
if (typeof value == "number") {
|
|
120
125
|
;
|
|
@@ -7,12 +7,12 @@ import {
|
|
|
7
7
|
} from "./chunk-PJ2RFT5A.mjs";
|
|
8
8
|
import {
|
|
9
9
|
resolveDocumentState
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-ICFYYWGD.mjs";
|
|
11
11
|
import {
|
|
12
12
|
entityQueryPathToHmIdPath,
|
|
13
13
|
packHmId,
|
|
14
14
|
unpackHmId
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-7IISPGNN.mjs";
|
|
16
16
|
|
|
17
17
|
// src/auto-link.ts
|
|
18
18
|
import { CID } from "multiformats/cid";
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
codePointLength,
|
|
8
8
|
parseHMQueryFiltersJSON,
|
|
9
9
|
toNumber
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-7IISPGNN.mjs";
|
|
11
11
|
|
|
12
12
|
// src/editorblock-to-hmblock.ts
|
|
13
13
|
function toHMBlockType(editorBlockType) {
|
|
@@ -84,6 +84,10 @@ function editorBlockToHMBlock(editorBlock) {
|
|
|
84
84
|
block.attributes.columnCount = Number(editorBlock.props.columnCount);
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
|
+
const textAlignment = editorBlock.props.textAlignment;
|
|
88
|
+
if (textAlignment && textAlignment !== "left") {
|
|
89
|
+
block.attributes.textAlignment = textAlignment;
|
|
90
|
+
}
|
|
87
91
|
const annotations = new AnnotationSet();
|
|
88
92
|
let pos = 0;
|
|
89
93
|
for (let leaf of leaves) {
|