@seed-hypermedia/client 0.0.106 → 0.0.108

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 (41) 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-P2FJTNNQ.mjs → chunk-4HFV2ZKM.mjs} +2 -2
  5. package/dist/{chunk-S4XBFD3S.mjs → chunk-4QESBHYW.mjs} +3 -3
  6. package/dist/{chunk-FFH7G6KW.mjs → chunk-52RP7HHW.mjs} +1 -1
  7. package/dist/{chunk-R6OYID6M.mjs → chunk-7HNJXR32.mjs} +1 -1
  8. package/dist/{chunk-KDI4WJKM.mjs → chunk-AADKT7A3.mjs} +1 -1
  9. package/dist/{chunk-GIKXPGFZ.mjs → chunk-E7LRAYKJ.mjs} +1 -1
  10. package/dist/{chunk-SKIKB2TP.mjs → chunk-HNCJHTB7.mjs} +20 -3
  11. package/dist/{chunk-4MZHSZFQ.mjs → chunk-IXF3MTOE.mjs} +7 -2
  12. package/dist/{chunk-UPYQNWW5.mjs → chunk-JS5GYEQ6.mjs} +1 -1
  13. package/dist/{chunk-NSNLRZ3X.mjs → chunk-RKCXRUMM.mjs} +1 -1
  14. package/dist/{chunk-MHICVQJI.mjs → chunk-UUPZ2NLC.mjs} +3 -3
  15. package/dist/{chunk-EZ5DM5TI.mjs → chunk-UWH2FAVV.mjs} +1 -1
  16. package/dist/{chunk-V5XCZMPG.mjs → chunk-VTRLILIX.mjs} +1 -1
  17. package/dist/{chunk-G6AYTCLG.mjs → chunk-WZEW53BF.mjs} +1 -1
  18. package/dist/chunk-Y5XKORRF.mjs +10 -0
  19. package/dist/{chunk-DQR4RPYC.mjs → chunk-ZS5HGCE2.mjs} +5 -1
  20. package/dist/client.mjs +2 -2
  21. package/dist/comment.mjs +2 -2
  22. package/dist/document-state.mjs +2 -2
  23. package/dist/editor-types.d.ts +2 -1
  24. package/dist/editorblock-to-hmblock.mjs +2 -2
  25. package/dist/hm-resolver.mjs +2 -2
  26. package/dist/hm-types.d.ts +283 -12
  27. package/dist/hm-types.mjs +3 -1
  28. package/dist/hmblock-to-editorblock.mjs +2 -2
  29. package/dist/index.mjs +13 -13
  30. package/dist/pdf-to-blocks.mjs +3 -3
  31. package/dist/resource-read.mjs +4 -4
  32. package/dist/schema-engine.mjs +2 -2
  33. package/dist/schema-registry.generated.mjs +1 -1
  34. package/dist/schema-resolve.mjs +4 -4
  35. package/dist/schema-subtypes.mjs +4 -4
  36. package/dist/schema-types.generated.d.ts +33 -0
  37. package/dist/signed-blob.mjs +2 -2
  38. package/dist/tei-to-blocks.mjs +2 -2
  39. package/dist/unicode.mjs +1 -1
  40. package/package.json +1 -1
  41. package/dist/chunk-ZWKMAGDU.mjs +0 -10
@@ -4,13 +4,13 @@ import {
4
4
  documentContainsLinkToChild,
5
5
  documentHasSelfQuery,
6
6
  shouldAutoLinkParent
7
- } from "./chunk-P2FJTNNQ.mjs";
7
+ } from "./chunk-4HFV2ZKM.mjs";
8
8
  import "./chunk-O5MHN2EO.mjs";
9
9
  import "./chunk-PJ2RFT5A.mjs";
10
- import "./chunk-R6OYID6M.mjs";
10
+ import "./chunk-7HNJXR32.mjs";
11
11
  import "./chunk-LVAHHQIK.mjs";
12
12
  import "./chunk-DR3HJ6BV.mjs";
13
- import "./chunk-SKIKB2TP.mjs";
13
+ import "./chunk-HNCJHTB7.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-UPYQNWW5.mjs";
11
- import "./chunk-SKIKB2TP.mjs";
10
+ } from "./chunk-JS5GYEQ6.mjs";
11
+ import "./chunk-HNCJHTB7.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-KDI4WJKM.mjs";
4
+ } from "./chunk-AADKT7A3.mjs";
5
5
  import "./chunk-LVAHHQIK.mjs";
6
6
  import "./chunk-NBCHK76Q.mjs";
7
7
  import "./chunk-DR3HJ6BV.mjs";
8
- import "./chunk-SKIKB2TP.mjs";
8
+ import "./chunk-HNCJHTB7.mjs";
9
9
  import "./chunk-3TPCJCVO.mjs";
10
10
  import "./chunk-7P6ASYW6.mjs";
11
11
  export {
@@ -7,12 +7,12 @@ import {
7
7
  } from "./chunk-PJ2RFT5A.mjs";
8
8
  import {
9
9
  resolveDocumentState
10
- } from "./chunk-R6OYID6M.mjs";
10
+ } from "./chunk-7HNJXR32.mjs";
11
11
  import {
12
12
  entityQueryPathToHmIdPath,
13
13
  packHmId,
14
14
  unpackHmId
15
- } from "./chunk-SKIKB2TP.mjs";
15
+ } from "./chunk-HNCJHTB7.mjs";
16
16
 
17
17
  // src/auto-link.ts
18
18
  import { CID } from "multiformats/cid";
@@ -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-SKIKB2TP.mjs";
23
+ } from "./chunk-HNCJHTB7.mjs";
24
24
 
25
25
  // src/schema-resolve.ts
26
26
  var DAG_CBOR_CODE = 113;
@@ -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";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  packHmId,
3
3
  unpackHmId
4
- } from "./chunk-SKIKB2TP.mjs";
4
+ } from "./chunk-HNCJHTB7.mjs";
5
5
 
6
6
  // src/document-state.ts
7
7
  async function resolveDocumentState(client, targetId) {
@@ -7,7 +7,7 @@ import {
7
7
  import {
8
8
  entityQueryPathToHmIdPath,
9
9
  packBaseId
10
- } from "./chunk-SKIKB2TP.mjs";
10
+ } from "./chunk-HNCJHTB7.mjs";
11
11
 
12
12
  // src/capability.ts
13
13
  import { base58btc } from "multiformats/bases/base58";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  codePointLength
3
- } from "./chunk-SKIKB2TP.mjs";
3
+ } from "./chunk-HNCJHTB7.mjs";
4
4
 
5
5
  // src/tei-to-blocks.ts
6
6
  function generateBlockId() {
@@ -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"),
@@ -768,13 +776,15 @@ var HMCitationCommentSourceSchema = z.object({
768
776
  type: z.literal("c"),
769
777
  id: unpackedHmIdSchema,
770
778
  author: z.string().optional(),
771
- time: HMTimestampSchema.optional()
779
+ time: HMTimestampSchema.optional(),
780
+ blockId: z.string().optional()
772
781
  });
773
782
  var HMCitationDocumentSourceSchema = z.object({
774
783
  type: z.literal("d"),
775
784
  id: unpackedHmIdSchema,
776
785
  author: z.string().optional(),
777
- time: HMTimestampSchema.optional()
786
+ time: HMTimestampSchema.optional(),
787
+ blockId: z.string().optional()
778
788
  });
779
789
  var HMCitationSchema = z.object({
780
790
  source: z.discriminatedUnion("type", [HMCitationCommentSourceSchema, HMCitationDocumentSourceSchema]),
@@ -1138,6 +1148,10 @@ var HMListEventsInputSchema = z.object({
1138
1148
  filterAuthors: z.array(z.string()).optional(),
1139
1149
  filterEventType: z.array(z.string()).optional(),
1140
1150
  filterResource: z.string().optional(),
1151
+ // Citations of one block of filterResource, one entry per citing block, read from ListCitations
1152
+ // instead of the feed: the feed keeps one event per publication, so a document that links one
1153
+ // block from many blocks has at most one of them there. Document citations only, a single page.
1154
+ targetBlockId: z.string().optional(),
1141
1155
  currentAccount: z.string().optional(),
1142
1156
  // Feed ordering. 'claimed' (default) orders by the event's claimed/create time; 'observed' orders by
1143
1157
  // when the server locally observed the blob — needed by pollers that must see late-propagating events
@@ -1201,6 +1215,8 @@ var HMRawCitationSchema = z.object({
1201
1215
  targetFragment: z.string().optional(),
1202
1216
  isExactVersion: z.boolean().optional(),
1203
1217
  targetBlockRevision: z.string().optional(),
1218
+ // The link type, `doc/Link`, `doc/Embed`, `comment/Embed`...
1219
+ citationType: z.string().optional(),
1204
1220
  mentionType: z.string().optional(),
1205
1221
  isExact: z.boolean().optional()
1206
1222
  });
@@ -1708,6 +1724,7 @@ export {
1708
1724
  BlockRangeSchema,
1709
1725
  unpackedHmIdSchema,
1710
1726
  HMBlockChildrenTypeSchema,
1727
+ HMBlockTextAlignmentSchema,
1711
1728
  HMEmbedViewSchema,
1712
1729
  HMQueryStyleSchema,
1713
1730
  BoldAnnotationSchema,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  getSupportedHMQueryFilters,
3
3
  isSurrogate
4
- } from "./chunk-SKIKB2TP.mjs";
4
+ } from "./chunk-HNCJHTB7.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
  ;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  normalizeQuerySort,
3
3
  unpackHmId
4
- } from "./chunk-SKIKB2TP.mjs";
4
+ } from "./chunk-HNCJHTB7.mjs";
5
5
 
6
6
  // src/blocks-to-markdown.ts
7
7
  import { stringify as stringifyYaml } from "yaml";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  teiToBlocks
3
- } from "./chunk-GIKXPGFZ.mjs";
3
+ } from "./chunk-E7LRAYKJ.mjs";
4
4
  import {
5
5
  embeddedPdfToBlocks
6
6
  } from "./chunk-2FJBS3V7.mjs";
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  resolveId
3
- } from "./chunk-V5XCZMPG.mjs";
3
+ } from "./chunk-VTRLILIX.mjs";
4
4
  import {
5
5
  createSeedClient
6
- } from "./chunk-G6AYTCLG.mjs";
6
+ } from "./chunk-WZEW53BF.mjs";
7
7
  import {
8
8
  unpackHmId
9
- } from "./chunk-SKIKB2TP.mjs";
9
+ } from "./chunk-HNCJHTB7.mjs";
10
10
 
11
11
  // src/resource-read.ts
12
12
  async function resolveIdWithClient(rawId, options = {}) {
@@ -9,7 +9,7 @@ import {
9
9
  import {
10
10
  hmIdPathToEntityQueryPath,
11
11
  packHmId
12
- } from "./chunk-SKIKB2TP.mjs";
12
+ } from "./chunk-HNCJHTB7.mjs";
13
13
 
14
14
  // src/comment.ts
15
15
  import { decode as cborDecode, encode as cborEncode } from "@ipld/dag-cbor";
@@ -2,7 +2,7 @@ import {
2
2
  entityQueryPathToHmIdPath,
3
3
  parseFragment,
4
4
  unpackHmId
5
- } from "./chunk-SKIKB2TP.mjs";
5
+ } from "./chunk-HNCJHTB7.mjs";
6
6
 
7
7
  // src/hm-resolver.ts
8
8
  async function resolveHypermediaUrl(url, opts) {
@@ -15,7 +15,7 @@ import {
15
15
  HMActionSchema,
16
16
  HMRequestSchema,
17
17
  packHmId
18
- } from "./chunk-SKIKB2TP.mjs";
18
+ } from "./chunk-HNCJHTB7.mjs";
19
19
 
20
20
  // src/client.ts
21
21
  import { encode as cborEncode } from "@ipld/dag-cbor";