@seed-hypermedia/client 0.0.109 → 0.0.111

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 (48) hide show
  1. package/dist/auto-link.mjs +4 -3
  2. package/dist/blocks-to-markdown.mjs +3 -2
  3. package/dist/capability.d.ts +9 -3
  4. package/dist/capability.mjs +3 -2
  5. package/dist/{chunk-BHESE4LH.mjs → chunk-3IDYHD26.mjs} +3 -3
  6. package/dist/{chunk-VN7F33SS.mjs → chunk-65UV5O57.mjs} +38 -0
  7. package/dist/{chunk-7IISPGNN.mjs → chunk-75QI2URL.mjs} +32 -13
  8. package/dist/chunk-AHQWDCHV.mjs +56 -0
  9. package/dist/{chunk-52RP7HHW.mjs → chunk-AUKAVTTK.mjs} +1 -1
  10. package/dist/{chunk-HLTKEZ7W.mjs → chunk-D2NNAW4D.mjs} +1 -1
  11. package/dist/{chunk-GWV7ETLU.mjs → chunk-G4B7P2DG.mjs} +2 -2
  12. package/dist/{chunk-IAS2V6ON.mjs → chunk-H4OOJ6F7.mjs} +1 -1
  13. package/dist/{chunk-KOQHARP5.mjs → chunk-HH7AOMKN.mjs} +1 -1
  14. package/dist/{chunk-SQFGEPOQ.mjs → chunk-IQ5HNMUK.mjs} +10 -5
  15. package/dist/{chunk-Y5XKORRF.mjs → chunk-MLR4UDOJ.mjs} +3 -3
  16. package/dist/{chunk-KNA3PBET.mjs → chunk-MN2JRQM5.mjs} +1 -1
  17. package/dist/{chunk-2NM2JP5H.mjs → chunk-O62L5AUF.mjs} +3 -3
  18. package/dist/{chunk-Z3J6R5DN.mjs → chunk-QSSNEIPO.mjs} +1 -1
  19. package/dist/{chunk-ICFYYWGD.mjs → chunk-QU42JTHS.mjs} +1 -1
  20. package/dist/{chunk-5MVCUZBD.mjs → chunk-SFDJ4SQ4.mjs} +6 -1
  21. package/dist/{chunk-34OBOF5O.mjs → chunk-U5MHHDOD.mjs} +1 -1
  22. package/dist/{chunk-G7CFO5W3.mjs → chunk-YMOCTVFW.mjs} +1 -1
  23. package/dist/client.d.ts +1 -1
  24. package/dist/client.mjs +3 -2
  25. package/dist/comment.mjs +3 -2
  26. package/dist/document-state.mjs +3 -2
  27. package/dist/editorblock-to-hmblock.mjs +3 -2
  28. package/dist/file-to-ipfs.d.ts +19 -0
  29. package/dist/file-to-ipfs.mjs +5 -1
  30. package/dist/hm-resolver.mjs +3 -2
  31. package/dist/hm-types.d.ts +8326 -77112
  32. package/dist/hm-types.mjs +2 -1
  33. package/dist/hmblock-to-editorblock.mjs +3 -2
  34. package/dist/index.d.ts +2 -2
  35. package/dist/index.mjs +19 -14
  36. package/dist/page-input.d.ts +13 -0
  37. package/dist/page-input.mjs +15 -0
  38. package/dist/pdf-to-blocks.mjs +4 -3
  39. package/dist/resource-read.mjs +5 -4
  40. package/dist/schema-engine.mjs +2 -2
  41. package/dist/schema-registry.generated.mjs +1 -1
  42. package/dist/schema-resolve.mjs +5 -4
  43. package/dist/schema-subtypes.mjs +5 -4
  44. package/dist/schema-types.generated.d.ts +24 -0
  45. package/dist/signed-blob.mjs +2 -2
  46. package/dist/tei-to-blocks.mjs +3 -2
  47. package/dist/unicode.mjs +2 -1
  48. package/package.json +1 -1
package/dist/hm-types.mjs CHANGED
@@ -216,7 +216,8 @@ import {
216
216
  toNumber,
217
217
  unpackHmId,
218
218
  unpackedHmIdSchema
219
- } from "./chunk-7IISPGNN.mjs";
219
+ } from "./chunk-75QI2URL.mjs";
220
+ import "./chunk-AHQWDCHV.mjs";
220
221
  import "./chunk-7P6ASYW6.mjs";
221
222
  export {
222
223
  BUILTIN_METADATA_KEYS,
@@ -2,8 +2,9 @@ import {
2
2
  annotationContains,
3
3
  hmBlockToEditorBlock,
4
4
  hmBlocksToEditorContent
5
- } from "./chunk-G7CFO5W3.mjs";
6
- import "./chunk-7IISPGNN.mjs";
5
+ } from "./chunk-YMOCTVFW.mjs";
6
+ import "./chunk-75QI2URL.mjs";
7
+ import "./chunk-AHQWDCHV.mjs";
7
8
  import "./chunk-7P6ASYW6.mjs";
8
9
  export {
9
10
  annotationContains,
package/dist/index.d.ts CHANGED
@@ -29,8 +29,8 @@ export { resolveHypermediaUrl, resolveId } from './hm-resolver';
29
29
  export type { DomainResolverFn, DomainIdChangedCallback, ResolveOptions, ResolvedUrl } from './hm-resolver';
30
30
  export { resolveIdWithClient } from './resource-read';
31
31
  export type { ResolveIdWithClientOptions, ResolvedIdWithClient } from './resource-read';
32
- export { fileToIpfsBlobs, filesToIpfsBlobs, resolveFileLinksInBlocks, hasFileLinks } from './file-to-ipfs';
33
- export type { CollectedBlob } from './file-to-ipfs';
32
+ export { fileToIpfsBlobs, filesToIpfsBlobs, directoryToIpfsBlobs, normalizeDirectoryFilePath, resolveFileLinksInBlocks, hasFileLinks, } from './file-to-ipfs';
33
+ export type { CollectedBlob, IpfsDirectoryFile } from './file-to-ipfs';
34
34
  export { parseMarkdown, flattenToOperations, parseInlineFormatting, parseFrontmatter, markdownBlockNodesToHMBlockNodes, hmAccountMentionUid, MarkdownFrontmatterError, } from './markdown-to-blocks';
35
35
  export type { BlockNode, SeedBlock, Annotation, ParseMarkdownOptions } from './markdown-to-blocks';
36
36
  export { collectMermaidBlocks, validateMermaidBlocks, assertValidMermaid, InvalidMermaidError, } from './mermaid-validation';
package/dist/index.mjs CHANGED
@@ -1,20 +1,20 @@
1
1
  import {
2
2
  pdfToBlocks
3
- } from "./chunk-34OBOF5O.mjs";
3
+ } from "./chunk-U5MHHDOD.mjs";
4
4
  import {
5
5
  teiToBlocks
6
- } from "./chunk-KOQHARP5.mjs";
6
+ } from "./chunk-HH7AOMKN.mjs";
7
7
  import {
8
8
  embeddedPdfToBlocks
9
9
  } from "./chunk-2FJBS3V7.mjs";
10
10
  import {
11
11
  resolveIdWithClient
12
- } from "./chunk-2NM2JP5H.mjs";
12
+ } from "./chunk-O62L5AUF.mjs";
13
13
  import {
14
14
  annotationContains,
15
15
  hmBlockToEditorBlock,
16
16
  hmBlocksToEditorContent
17
- } from "./chunk-G7CFO5W3.mjs";
17
+ } from "./chunk-YMOCTVFW.mjs";
18
18
  import {
19
19
  keyfile_exports
20
20
  } from "./chunk-EY6RQVAP.mjs";
@@ -36,16 +36,18 @@ import {
36
36
  import {
37
37
  editorBlockToHMBlock,
38
38
  editorBlocksToHMBlockNodes
39
- } from "./chunk-KNA3PBET.mjs";
39
+ } from "./chunk-MN2JRQM5.mjs";
40
40
  import {
41
41
  encryption_exports
42
42
  } from "./chunk-UOL3F6XQ.mjs";
43
43
  import {
44
+ directoryToIpfsBlobs,
44
45
  fileToIpfsBlobs,
45
46
  filesToIpfsBlobs,
46
47
  hasFileLinks,
48
+ normalizeDirectoryFilePath,
47
49
  resolveFileLinksInBlocks
48
- } from "./chunk-VN7F33SS.mjs";
50
+ } from "./chunk-65UV5O57.mjs";
49
51
  import {
50
52
  DEFAULT_GROBID_URL,
51
53
  isGrobidAvailable,
@@ -54,10 +56,10 @@ import {
54
56
  import {
55
57
  resolveHypermediaUrl,
56
58
  resolveId
57
- } from "./chunk-5MVCUZBD.mjs";
59
+ } from "./chunk-SFDJ4SQ4.mjs";
58
60
  import {
59
61
  createSeedClient
60
- } from "./chunk-IAS2V6ON.mjs";
62
+ } from "./chunk-H4OOJ6F7.mjs";
61
63
  import {
62
64
  SeedClientError,
63
65
  SeedNetworkError,
@@ -69,7 +71,7 @@ import {
69
71
  deleteComment,
70
72
  trimTrailingEmptyBlocks,
71
73
  updateComment
72
- } from "./chunk-Z3J6R5DN.mjs";
74
+ } from "./chunk-QSSNEIPO.mjs";
73
75
  import {
74
76
  AnnotationSet,
75
77
  addSpanToAnnotation,
@@ -90,7 +92,7 @@ import {
90
92
  documentContainsLinkToChild,
91
93
  documentHasSelfQuery,
92
94
  shouldAutoLinkParent
93
- } from "./chunk-GWV7ETLU.mjs";
95
+ } from "./chunk-G4B7P2DG.mjs";
94
96
  import {
95
97
  createChange,
96
98
  createChangeOps,
@@ -112,7 +114,7 @@ import {
112
114
  followToDocument,
113
115
  resolveDocumentState,
114
116
  resolveEditableDocument
115
- } from "./chunk-ICFYYWGD.mjs";
117
+ } from "./chunk-QU42JTHS.mjs";
116
118
  import "./chunk-2MD3FXKB.mjs";
117
119
  import {
118
120
  computeReplaceOps,
@@ -131,11 +133,11 @@ import {
131
133
  emitFrontmatter,
132
134
  parseDraftFilename,
133
135
  slugify
134
- } from "./chunk-HLTKEZ7W.mjs";
136
+ } from "./chunk-D2NNAW4D.mjs";
135
137
  import {
136
138
  createCapability,
137
139
  resolveCapability
138
- } from "./chunk-SQFGEPOQ.mjs";
140
+ } from "./chunk-IQ5HNMUK.mjs";
139
141
  import "./chunk-LVAHHQIK.mjs";
140
142
  import "./chunk-NBCHK76Q.mjs";
141
143
  import {
@@ -155,7 +157,8 @@ import {
155
157
  parseFragment,
156
158
  serializeBlockRange,
157
159
  unpackHmId
158
- } from "./chunk-7IISPGNN.mjs";
160
+ } from "./chunk-75QI2URL.mjs";
161
+ import "./chunk-AHQWDCHV.mjs";
159
162
  import "./chunk-3TPCJCVO.mjs";
160
163
  import "./chunk-7P6ASYW6.mjs";
161
164
  export {
@@ -198,6 +201,7 @@ export {
198
201
  deleteComment,
199
202
  deleteContact,
200
203
  describeRedirect,
204
+ directoryToIpfsBlobs,
201
205
  documentContainsLinkToChild,
202
206
  documentHasSelfQuery,
203
207
  documentToResolvedMarkdown,
@@ -225,6 +229,7 @@ export {
225
229
  keyfile_exports as keyfile,
226
230
  markdownBlockNodesToHMBlockNodes,
227
231
  matchBlockIds,
232
+ normalizeDirectoryFilePath,
228
233
  packBaseId,
229
234
  packHmId,
230
235
  parseCustomURL,
@@ -0,0 +1,13 @@
1
+ /** Query namespace reserved for a custom HTML page's schema-defined input. */
2
+ export declare const PAGE_INPUT_PREFIX = "p.";
3
+ /** Read page-owned query parameters without mixing in Seed navigation parameters. */
4
+ export declare function pageParamsFromUrl(url: string): Record<string, string> | undefined;
5
+ /** Encode raw JSON parameter values for insertion into an HM or web query string. */
6
+ export declare function pageParamsQuery(params?: Record<string, string>): string;
7
+ /** Decode JSON values from the URL, retaining validation errors for the page to display. */
8
+ export declare function decodePageInput(params?: Record<string, string>): {
9
+ values: Record<string, unknown>;
10
+ errors: string[];
11
+ };
12
+ /** Serialize a complete input state; rejects values that JSON would silently discard or change. */
13
+ export declare function encodePageInput(values: unknown): Record<string, string>;
@@ -0,0 +1,15 @@
1
+ import {
2
+ PAGE_INPUT_PREFIX,
3
+ decodePageInput,
4
+ encodePageInput,
5
+ pageParamsFromUrl,
6
+ pageParamsQuery
7
+ } from "./chunk-AHQWDCHV.mjs";
8
+ import "./chunk-7P6ASYW6.mjs";
9
+ export {
10
+ PAGE_INPUT_PREFIX,
11
+ decodePageInput,
12
+ encodePageInput,
13
+ pageParamsFromUrl,
14
+ pageParamsQuery
15
+ };
@@ -1,10 +1,11 @@
1
1
  import {
2
2
  pdfToBlocks
3
- } from "./chunk-34OBOF5O.mjs";
4
- import "./chunk-KOQHARP5.mjs";
3
+ } from "./chunk-U5MHHDOD.mjs";
4
+ import "./chunk-HH7AOMKN.mjs";
5
5
  import "./chunk-2FJBS3V7.mjs";
6
6
  import "./chunk-PPAY4WZX.mjs";
7
- import "./chunk-7IISPGNN.mjs";
7
+ import "./chunk-75QI2URL.mjs";
8
+ import "./chunk-AHQWDCHV.mjs";
8
9
  import "./chunk-7P6ASYW6.mjs";
9
10
  export {
10
11
  pdfToBlocks
@@ -1,14 +1,15 @@
1
1
  import {
2
2
  resolveIdWithClient
3
- } from "./chunk-2NM2JP5H.mjs";
4
- import "./chunk-5MVCUZBD.mjs";
5
- import "./chunk-IAS2V6ON.mjs";
3
+ } from "./chunk-O62L5AUF.mjs";
4
+ import "./chunk-SFDJ4SQ4.mjs";
5
+ import "./chunk-H4OOJ6F7.mjs";
6
6
  import "./chunk-CBELM7KX.mjs";
7
7
  import "./chunk-O5MHN2EO.mjs";
8
8
  import "./chunk-PJ2RFT5A.mjs";
9
9
  import "./chunk-LVAHHQIK.mjs";
10
10
  import "./chunk-DR3HJ6BV.mjs";
11
- import "./chunk-7IISPGNN.mjs";
11
+ import "./chunk-75QI2URL.mjs";
12
+ import "./chunk-AHQWDCHV.mjs";
12
13
  import "./chunk-7P6ASYW6.mjs";
13
14
  export {
14
15
  resolveIdWithClient
@@ -35,11 +35,11 @@ import {
35
35
  typeOf,
36
36
  validate,
37
37
  validateAdvisory
38
- } from "./chunk-52RP7HHW.mjs";
38
+ } from "./chunk-AUKAVTTK.mjs";
39
39
  import {
40
40
  HM_SCHEMAS,
41
41
  HM_SCHEMA_MANIFEST
42
- } from "./chunk-Y5XKORRF.mjs";
42
+ } from "./chunk-MLR4UDOJ.mjs";
43
43
  import "./chunk-7P6ASYW6.mjs";
44
44
  export {
45
45
  HM_SCHEMAS,
@@ -2,7 +2,7 @@ import {
2
2
  HM_SCHEMAS,
3
3
  HM_SCHEMA_MANIFEST,
4
4
  HM_SCHEMA_PAGES
5
- } from "./chunk-Y5XKORRF.mjs";
5
+ } from "./chunk-MLR4UDOJ.mjs";
6
6
  import "./chunk-7P6ASYW6.mjs";
7
7
  export {
8
8
  HM_SCHEMAS,
@@ -17,11 +17,12 @@ import {
17
17
  resolveSchemaRef,
18
18
  schemaDefinitionCid,
19
19
  withoutSchemaLink
20
- } from "./chunk-BHESE4LH.mjs";
21
- import "./chunk-52RP7HHW.mjs";
22
- import "./chunk-Y5XKORRF.mjs";
20
+ } from "./chunk-3IDYHD26.mjs";
21
+ import "./chunk-AUKAVTTK.mjs";
22
+ import "./chunk-MLR4UDOJ.mjs";
23
23
  import "./chunk-VWSAFDOL.mjs";
24
- import "./chunk-7IISPGNN.mjs";
24
+ import "./chunk-75QI2URL.mjs";
25
+ import "./chunk-AHQWDCHV.mjs";
25
26
  import "./chunk-7P6ASYW6.mjs";
26
27
  export {
27
28
  bareCid,
@@ -1,19 +1,20 @@
1
1
  import {
2
2
  classifyRef
3
- } from "./chunk-BHESE4LH.mjs";
3
+ } from "./chunk-3IDYHD26.mjs";
4
4
  import {
5
5
  kindOf,
6
6
  nameForCid,
7
7
  nameToUrl,
8
8
  schemaCid
9
- } from "./chunk-52RP7HHW.mjs";
9
+ } from "./chunk-AUKAVTTK.mjs";
10
10
  import {
11
11
  HM_SCHEMAS
12
- } from "./chunk-Y5XKORRF.mjs";
12
+ } from "./chunk-MLR4UDOJ.mjs";
13
13
  import "./chunk-VWSAFDOL.mjs";
14
14
  import {
15
15
  unpackHmId
16
- } from "./chunk-7IISPGNN.mjs";
16
+ } from "./chunk-75QI2URL.mjs";
17
+ import "./chunk-AHQWDCHV.mjs";
17
18
  import "./chunk-7P6ASYW6.mjs";
18
19
 
19
20
  // src/schema-subtypes.ts
@@ -1221,6 +1221,8 @@ export type HMMetadata = {
1221
1221
  importCategories?: string;
1222
1222
  /** Comma-separated tags kept from an external import (e.g. WordPress). */
1223
1223
  importTags?: string;
1224
+ /** Resource type, for example hm://hyper.media/page for a custom HTML page. */
1225
+ type?: HMHmUrl;
1224
1226
  } & {
1225
1227
  [key: string]: HMValue;
1226
1228
  };
@@ -1245,6 +1247,28 @@ export type HMMetadataNavigationItem = {
1245
1247
  * Schema: hm://hyper.media/none
1246
1248
  */
1247
1249
  export type HMNone = never;
1250
+ /**
1251
+ * Custom HTML Page
1252
+ * A resource type for a sandboxed HTML page with schema-defined URL input.
1253
+ * Resource attributes for a custom HTML page, with a sandboxed HTML bundle and a published input contract.
1254
+ * Schema: hm://hyper.media/page
1255
+ */
1256
+ export type HMPage = {
1257
+ type: 'hm://hyper.media/page';
1258
+ /** UnixFS folder containing index.html for this custom HTML page. */
1259
+ html: HMIpfsUrl;
1260
+ /** Published HM struct schema defining this page's URL input fields. */
1261
+ inputSchema: HMUrl;
1262
+ } & {
1263
+ [key: string]: HMValue;
1264
+ };
1265
+ /**
1266
+ * Empty Page Input
1267
+ * The default published input schema for a custom HTML page that accepts no URL state.
1268
+ * The empty input contract for a custom HTML page that accepts no URL parameters.
1269
+ * Schema: hm://hyper.media/page-input
1270
+ */
1271
+ export type HMPageInput = Record<string, never>;
1248
1272
  /**
1249
1273
  * Principal
1250
1274
  * A public key that identifies an account or space, stored in blobs as the raw bytes of a multicodec prefix plus the key and shown to people as a base58 string starting with z6Mk.
@@ -5,8 +5,8 @@ import {
5
5
  literalValue,
6
6
  resolveSchema,
7
7
  structFields
8
- } from "./chunk-52RP7HHW.mjs";
9
- import "./chunk-Y5XKORRF.mjs";
8
+ } from "./chunk-AUKAVTTK.mjs";
9
+ import "./chunk-MLR4UDOJ.mjs";
10
10
  import {
11
11
  dagJsonToIpld,
12
12
  findSeedIndexerCollision
@@ -1,7 +1,8 @@
1
1
  import {
2
2
  teiToBlocks
3
- } from "./chunk-KOQHARP5.mjs";
4
- import "./chunk-7IISPGNN.mjs";
3
+ } from "./chunk-HH7AOMKN.mjs";
4
+ import "./chunk-75QI2URL.mjs";
5
+ import "./chunk-AHQWDCHV.mjs";
5
6
  import "./chunk-7P6ASYW6.mjs";
6
7
  export {
7
8
  teiToBlocks
package/dist/unicode.mjs CHANGED
@@ -7,7 +7,8 @@ import {
7
7
  import {
8
8
  codePointLength,
9
9
  isSurrogate
10
- } from "./chunk-7IISPGNN.mjs";
10
+ } from "./chunk-75QI2URL.mjs";
11
+ import "./chunk-AHQWDCHV.mjs";
11
12
  import "./chunk-7P6ASYW6.mjs";
12
13
  export {
13
14
  AnnotationSet,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seed-hypermedia/client",
3
- "version": "0.0.109",
3
+ "version": "0.0.111",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/seed-hypermedia/seed",