@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.
Files changed (42) hide show
  1. package/dist/auto-link.mjs +3 -3
  2. package/dist/blocks-to-markdown.mjs +2 -2
  3. package/dist/capability.mjs +2 -2
  4. package/dist/{chunk-WNLWE5P5.mjs → chunk-2NM2JP5H.mjs} +3 -3
  5. package/dist/{chunk-SG22LWXW.mjs → chunk-34OBOF5O.mjs} +1 -1
  6. package/dist/{chunk-FFH7G6KW.mjs → chunk-52RP7HHW.mjs} +1 -1
  7. package/dist/{chunk-6IW7VKZY.mjs → chunk-5MVCUZBD.mjs} +1 -1
  8. package/dist/{chunk-OSSRQKDG.mjs → chunk-7IISPGNN.mjs} +11 -2
  9. package/dist/{chunk-M7BEYZZV.mjs → chunk-BHESE4LH.mjs} +3 -3
  10. package/dist/{chunk-WHQC63KZ.mjs → chunk-G7CFO5W3.mjs} +7 -2
  11. package/dist/{chunk-3AJ2YACM.mjs → chunk-GWV7ETLU.mjs} +2 -2
  12. package/dist/{chunk-O4PVMTYN.mjs → chunk-HLTKEZ7W.mjs} +1 -1
  13. package/dist/{chunk-C2SV4WDE.mjs → chunk-IAS2V6ON.mjs} +1 -1
  14. package/dist/{chunk-FJSBNU57.mjs → chunk-ICFYYWGD.mjs} +1 -1
  15. package/dist/{chunk-7UR6YTQD.mjs → chunk-KNA3PBET.mjs} +5 -1
  16. package/dist/{chunk-4D6BGGEM.mjs → chunk-KOQHARP5.mjs} +1 -1
  17. package/dist/{chunk-YB5PU37B.mjs → chunk-SQFGEPOQ.mjs} +1 -1
  18. package/dist/chunk-Y5XKORRF.mjs +10 -0
  19. package/dist/{chunk-FXK6WCQS.mjs → chunk-Z3J6R5DN.mjs} +1 -1
  20. package/dist/client.d.ts +1 -1
  21. package/dist/client.mjs +2 -2
  22. package/dist/comment.mjs +2 -2
  23. package/dist/document-state.mjs +2 -2
  24. package/dist/editor-types.d.ts +2 -1
  25. package/dist/editorblock-to-hmblock.mjs +2 -2
  26. package/dist/hm-resolver.mjs +2 -2
  27. package/dist/hm-types.d.ts +2631 -2417
  28. package/dist/hm-types.mjs +3 -1
  29. package/dist/hmblock-to-editorblock.mjs +2 -2
  30. package/dist/index.mjs +13 -13
  31. package/dist/pdf-to-blocks.mjs +3 -3
  32. package/dist/resource-read.mjs +4 -4
  33. package/dist/schema-engine.mjs +2 -2
  34. package/dist/schema-registry.generated.mjs +1 -1
  35. package/dist/schema-resolve.mjs +4 -4
  36. package/dist/schema-subtypes.mjs +4 -4
  37. package/dist/schema-types.generated.d.ts +33 -0
  38. package/dist/signed-blob.mjs +2 -2
  39. package/dist/tei-to-blocks.mjs +2 -2
  40. package/dist/unicode.mjs +1 -1
  41. package/package.json +3 -3
  42. package/dist/chunk-ZWKMAGDU.mjs +0 -10
@@ -4,13 +4,13 @@ import {
4
4
  documentContainsLinkToChild,
5
5
  documentHasSelfQuery,
6
6
  shouldAutoLinkParent
7
- } from "./chunk-3AJ2YACM.mjs";
7
+ } from "./chunk-GWV7ETLU.mjs";
8
8
  import "./chunk-O5MHN2EO.mjs";
9
9
  import "./chunk-PJ2RFT5A.mjs";
10
- import "./chunk-FJSBNU57.mjs";
10
+ import "./chunk-ICFYYWGD.mjs";
11
11
  import "./chunk-LVAHHQIK.mjs";
12
12
  import "./chunk-DR3HJ6BV.mjs";
13
- import "./chunk-OSSRQKDG.mjs";
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-O4PVMTYN.mjs";
11
- import "./chunk-OSSRQKDG.mjs";
10
+ } from "./chunk-HLTKEZ7W.mjs";
11
+ import "./chunk-7IISPGNN.mjs";
12
12
  import "./chunk-7P6ASYW6.mjs";
13
13
  export {
14
14
  blocksToMarkdown,
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  createCapability,
3
3
  resolveCapability
4
- } from "./chunk-YB5PU37B.mjs";
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-OSSRQKDG.mjs";
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-6IW7VKZY.mjs";
3
+ } from "./chunk-5MVCUZBD.mjs";
4
4
  import {
5
5
  createSeedClient
6
- } from "./chunk-C2SV4WDE.mjs";
6
+ } from "./chunk-IAS2V6ON.mjs";
7
7
  import {
8
8
  unpackHmId
9
- } from "./chunk-OSSRQKDG.mjs";
9
+ } from "./chunk-7IISPGNN.mjs";
10
10
 
11
11
  // src/resource-read.ts
12
12
  async function resolveIdWithClient(rawId, options = {}) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  teiToBlocks
3
- } from "./chunk-4D6BGGEM.mjs";
3
+ } from "./chunk-KOQHARP5.mjs";
4
4
  import {
5
5
  embeddedPdfToBlocks
6
6
  } from "./chunk-2FJBS3V7.mjs";
@@ -2,7 +2,7 @@ import {
2
2
  HM_SCHEMAS,
3
3
  HM_SCHEMA_MANIFEST,
4
4
  HM_SCHEMA_PAGES
5
- } from "./chunk-ZWKMAGDU.mjs";
5
+ } from "./chunk-Y5XKORRF.mjs";
6
6
 
7
7
  // src/schema-engine.ts
8
8
  var LIBRARY_AUTHORITY = "hyper.media";
@@ -2,7 +2,7 @@ import {
2
2
  entityQueryPathToHmIdPath,
3
3
  parseFragment,
4
4
  unpackHmId
5
- } from "./chunk-OSSRQKDG.mjs";
5
+ } from "./chunk-7IISPGNN.mjs";
6
6
 
7
7
  // src/hm-resolver.ts
8
8
  async function resolveHypermediaUrl(url, opts) {
@@ -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-FFH7G6KW.mjs";
13
+ } from "./chunk-52RP7HHW.mjs";
14
14
  import {
15
15
  HM_SCHEMAS
16
- } from "./chunk-ZWKMAGDU.mjs";
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-OSSRQKDG.mjs";
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-OSSRQKDG.mjs";
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-FJSBNU57.mjs";
10
+ } from "./chunk-ICFYYWGD.mjs";
11
11
  import {
12
12
  entityQueryPathToHmIdPath,
13
13
  packHmId,
14
14
  unpackHmId
15
- } from "./chunk-OSSRQKDG.mjs";
15
+ } from "./chunk-7IISPGNN.mjs";
16
16
 
17
17
  // src/auto-link.ts
18
18
  import { CID } from "multiformats/cid";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  normalizeQuerySort,
3
3
  unpackHmId
4
- } from "./chunk-OSSRQKDG.mjs";
4
+ } from "./chunk-7IISPGNN.mjs";
5
5
 
6
6
  // src/blocks-to-markdown.ts
7
7
  import { stringify as stringifyYaml } from "yaml";
@@ -15,7 +15,7 @@ import {
15
15
  HMActionSchema,
16
16
  HMRequestSchema,
17
17
  packHmId
18
- } from "./chunk-OSSRQKDG.mjs";
18
+ } from "./chunk-7IISPGNN.mjs";
19
19
 
20
20
  // src/client.ts
21
21
  import { encode as cborEncode } from "@ipld/dag-cbor";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  packHmId,
3
3
  unpackHmId
4
- } from "./chunk-OSSRQKDG.mjs";
4
+ } from "./chunk-7IISPGNN.mjs";
5
5
 
6
6
  // src/document-state.ts
7
7
  async function resolveDocumentState(client, targetId) {
@@ -7,7 +7,7 @@ import {
7
7
  codePointLength,
8
8
  parseHMQueryFiltersJSON,
9
9
  toNumber
10
- } from "./chunk-OSSRQKDG.mjs";
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) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  codePointLength
3
- } from "./chunk-OSSRQKDG.mjs";
3
+ } from "./chunk-7IISPGNN.mjs";
4
4
 
5
5
  // src/tei-to-blocks.ts
6
6
  function generateBlockId() {
@@ -7,7 +7,7 @@ import {
7
7
  import {
8
8
  entityQueryPathToHmIdPath,
9
9
  packBaseId
10
- } from "./chunk-OSSRQKDG.mjs";
10
+ } from "./chunk-7IISPGNN.mjs";
11
11
 
12
12
  // src/capability.ts
13
13
  import { base58btc } from "multiformats/bases/base58";