@seed-hypermedia/client 0.0.96 → 0.0.98

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 (37) 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-3NYKSLJ4.mjs → chunk-2KOZBPIM.mjs} +1 -1
  5. package/dist/{chunk-F6A7GGKJ.mjs → chunk-6YBRBK6F.mjs} +16 -7
  6. package/dist/{chunk-OHN5ILTT.mjs → chunk-6YGIRB3K.mjs} +1 -1
  7. package/dist/{chunk-JUXVJ5TO.mjs → chunk-AUY42GMB.mjs} +1 -1
  8. package/dist/{chunk-LFY2IN4N.mjs → chunk-BGXPPECP.mjs} +1 -1
  9. package/dist/{chunk-X3WUOOPH.mjs → chunk-CTJU7XIA.mjs} +1 -1
  10. package/dist/{chunk-X3636TQF.mjs → chunk-CVHEDNGU.mjs} +1 -1
  11. package/dist/{chunk-JSA5TYHQ.mjs → chunk-F72LNF4Q.mjs} +1 -1
  12. package/dist/{chunk-MO524BCL.mjs → chunk-FLUWADFC.mjs} +1 -1
  13. package/dist/{chunk-6JS7R6XP.mjs → chunk-GRBJUKWS.mjs} +3 -3
  14. package/dist/{chunk-2JLNS6YU.mjs → chunk-HJ4ACOMW.mjs} +1 -1
  15. package/dist/{chunk-Y4P6H3KD.mjs → chunk-JKXO3OWO.mjs} +1 -1
  16. package/dist/{chunk-QVRJGK77.mjs → chunk-K5NYTWBJ.mjs} +30 -1
  17. package/dist/{chunk-32JNJI2C.mjs → chunk-KD3ZIXZV.mjs} +2 -2
  18. package/dist/{chunk-5YWGB4XU.mjs → chunk-XHF4IQ4R.mjs} +1 -1
  19. package/dist/client.mjs +2 -2
  20. package/dist/comment.mjs +2 -2
  21. package/dist/document-state.mjs +2 -2
  22. package/dist/editorblock-to-hmblock.mjs +2 -2
  23. package/dist/hm-resolver.mjs +2 -2
  24. package/dist/hm-types.d.ts +32 -29
  25. package/dist/hm-types.mjs +1 -1
  26. package/dist/hmblock-to-editorblock.mjs +2 -2
  27. package/dist/index.d.ts +1 -1
  28. package/dist/index.mjs +16 -14
  29. package/dist/markdown-to-blocks.d.ts +10 -0
  30. package/dist/markdown-to-blocks.mjs +3 -1
  31. package/dist/pdf-to-blocks.mjs +3 -3
  32. package/dist/resource-read.mjs +4 -4
  33. package/dist/schema-resolve.mjs +2 -2
  34. package/dist/schema-subtypes.mjs +2 -2
  35. package/dist/tei-to-blocks.mjs +2 -2
  36. package/dist/unicode.mjs +1 -1
  37. package/package.json +1 -1
@@ -4,13 +4,13 @@ import {
4
4
  documentContainsLinkToChild,
5
5
  documentHasSelfQuery,
6
6
  shouldAutoLinkParent
7
- } from "./chunk-32JNJI2C.mjs";
7
+ } from "./chunk-KD3ZIXZV.mjs";
8
8
  import "./chunk-O5MHN2EO.mjs";
9
9
  import "./chunk-PJ2RFT5A.mjs";
10
- import "./chunk-X3WUOOPH.mjs";
10
+ import "./chunk-CTJU7XIA.mjs";
11
11
  import "./chunk-LVAHHQIK.mjs";
12
12
  import "./chunk-DR3HJ6BV.mjs";
13
- import "./chunk-3NYKSLJ4.mjs";
13
+ import "./chunk-2KOZBPIM.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-LFY2IN4N.mjs";
11
- import "./chunk-3NYKSLJ4.mjs";
10
+ } from "./chunk-BGXPPECP.mjs";
11
+ import "./chunk-2KOZBPIM.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-Y4P6H3KD.mjs";
4
+ } from "./chunk-JKXO3OWO.mjs";
5
5
  import "./chunk-LVAHHQIK.mjs";
6
6
  import "./chunk-NBCHK76Q.mjs";
7
7
  import "./chunk-DR3HJ6BV.mjs";
8
- import "./chunk-3NYKSLJ4.mjs";
8
+ import "./chunk-2KOZBPIM.mjs";
9
9
  import "./chunk-3TPCJCVO.mjs";
10
10
  import "./chunk-7P6ASYW6.mjs";
11
11
  export {
@@ -879,7 +879,7 @@ var HMSearchResultItemSchema = z.object({
879
879
  parentNames: z.array(z.string()),
880
880
  versionTime: z.string().optional(),
881
881
  searchQuery: z.string(),
882
- type: z.enum(["document", "contact", "comment"])
882
+ type: z.enum(["document", "profile", "contact", "comment"])
883
883
  });
884
884
  var HMSearchPayloadSchema = z.object({
885
885
  entities: z.array(HMSearchResultItemSchema),
@@ -9,7 +9,7 @@ import {
9
9
  import {
10
10
  hmIdPathToEntityQueryPath,
11
11
  packHmId
12
- } from "./chunk-3NYKSLJ4.mjs";
12
+ } from "./chunk-2KOZBPIM.mjs";
13
13
 
14
14
  // src/comment.ts
15
15
  import { decode as cborDecode, encode as cborEncode } from "@ipld/dag-cbor";
@@ -43,7 +43,7 @@ function resolveQuotingTarget(input) {
43
43
  function annotationsToPublishable(annotations) {
44
44
  validateExclusiveAnnotations(annotations);
45
45
  return annotations.map((annotation) => {
46
- var _a, _b, _c, _d;
46
+ var _a, _b, _c, _d, _e;
47
47
  const { type, starts, ends } = annotation;
48
48
  if (type === "Bold") return { type: "Bold", starts, ends };
49
49
  if (type === "Italic") return { type: "Italic", starts, ends };
@@ -51,20 +51,29 @@ function annotationsToPublishable(annotations) {
51
51
  if (type === "Strike") return { type: "Strike", starts, ends };
52
52
  if (type === "Code") return { type: "Code", starts, ends };
53
53
  if (type === "Link") return { type: "Link", starts, ends, link: annotation.link || "" };
54
- if (type === "Embed") return { type: "Embed", starts, ends, link: annotation.link || "" };
54
+ if (type === "Embed") {
55
+ const mentionKind = (_a = annotation.attributes) == null ? void 0 : _a.mentionKind;
56
+ return {
57
+ type: "Embed",
58
+ starts,
59
+ ends,
60
+ link: annotation.link || "",
61
+ ...mentionKind === "account" || mentionKind === "document" ? { attributes: { mentionKind } } : {}
62
+ };
63
+ }
55
64
  if (type === "TextColor")
56
- return { type: "TextColor", starts, ends, attributes: { value: ((_a = annotation.attributes) == null ? void 0 : _a.value) || "" } };
65
+ return { type: "TextColor", starts, ends, attributes: { value: ((_b = annotation.attributes) == null ? void 0 : _b.value) || "" } };
57
66
  if (type === "BackgroundColor")
58
67
  return {
59
68
  type: "BackgroundColor",
60
69
  starts,
61
70
  ends,
62
- attributes: { value: ((_b = annotation.attributes) == null ? void 0 : _b.value) || "" }
71
+ attributes: { value: ((_c = annotation.attributes) == null ? void 0 : _c.value) || "" }
63
72
  };
64
73
  if (type === "TextSize")
65
- return { type: "TextSize", starts, ends, attributes: { value: ((_c = annotation.attributes) == null ? void 0 : _c.value) || "" } };
74
+ return { type: "TextSize", starts, ends, attributes: { value: ((_d = annotation.attributes) == null ? void 0 : _d.value) || "" } };
66
75
  if (type === "TextFamily")
67
- return { type: "TextFamily", starts, ends, attributes: { value: ((_d = annotation.attributes) == null ? void 0 : _d.value) || "" } };
76
+ return { type: "TextFamily", starts, ends, attributes: { value: ((_e = annotation.attributes) == null ? void 0 : _e.value) || "" } };
68
77
  throw new Error(`Unsupported annotation type: ${type}`);
69
78
  });
70
79
  }
@@ -20,7 +20,7 @@ import {
20
20
  import {
21
21
  packHmId,
22
22
  unpackHmId
23
- } from "./chunk-3NYKSLJ4.mjs";
23
+ } from "./chunk-2KOZBPIM.mjs";
24
24
 
25
25
  // src/schema-resolve.ts
26
26
  var DAG_CBOR_CODE = 113;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  teiToBlocks
3
- } from "./chunk-2JLNS6YU.mjs";
3
+ } from "./chunk-HJ4ACOMW.mjs";
4
4
  import {
5
5
  embeddedPdfToBlocks
6
6
  } from "./chunk-2FJBS3V7.mjs";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  normalizeQuerySort,
3
3
  unpackHmId
4
- } from "./chunk-3NYKSLJ4.mjs";
4
+ } from "./chunk-2KOZBPIM.mjs";
5
5
 
6
6
  // src/blocks-to-markdown.ts
7
7
  import { stringify as stringifyYaml } from "yaml";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  packHmId,
3
3
  unpackHmId
4
- } from "./chunk-3NYKSLJ4.mjs";
4
+ } from "./chunk-2KOZBPIM.mjs";
5
5
 
6
6
  // src/document-state.ts
7
7
  async function resolveDocumentState(client, targetId) {
@@ -2,7 +2,7 @@ import {
2
2
  entityQueryPathToHmIdPath,
3
3
  parseFragment,
4
4
  unpackHmId
5
- } from "./chunk-3NYKSLJ4.mjs";
5
+ } from "./chunk-2KOZBPIM.mjs";
6
6
 
7
7
  // src/hm-resolver.ts
8
8
  async function resolveHypermediaUrl(url, opts) {
@@ -6,7 +6,7 @@ import {
6
6
  HMBlockSchema,
7
7
  codePointLength,
8
8
  toNumber
9
- } from "./chunk-3NYKSLJ4.mjs";
9
+ } from "./chunk-2KOZBPIM.mjs";
10
10
 
11
11
  // src/editorblock-to-hmblock.ts
12
12
  function toHMBlockType(editorBlockType) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  isSurrogate
3
- } from "./chunk-3NYKSLJ4.mjs";
3
+ } from "./chunk-2KOZBPIM.mjs";
4
4
 
5
5
  // src/hmblock-to-editorblock.ts
6
6
  function toEditorBlockType(hmBlockType) {
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  resolveId
3
- } from "./chunk-X3636TQF.mjs";
3
+ } from "./chunk-CVHEDNGU.mjs";
4
4
  import {
5
5
  createSeedClient
6
- } from "./chunk-5YWGB4XU.mjs";
6
+ } from "./chunk-XHF4IQ4R.mjs";
7
7
  import {
8
8
  unpackHmId
9
- } from "./chunk-3NYKSLJ4.mjs";
9
+ } from "./chunk-2KOZBPIM.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
  codePointLength
3
- } from "./chunk-3NYKSLJ4.mjs";
3
+ } from "./chunk-2KOZBPIM.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-3NYKSLJ4.mjs";
10
+ } from "./chunk-2KOZBPIM.mjs";
11
11
 
12
12
  // src/capability.ts
13
13
  import { base58btc } from "multiformats/bases/base58";
@@ -134,8 +134,16 @@ function parseInlineFormatting(raw) {
134
134
  if (/^[a-zA-Z][a-zA-Z0-9+.-]*:\S*$/.test(inner) && !/[\s<>]/.test(inner)) {
135
135
  const start = text.length;
136
136
  if (inner.startsWith("hm://")) {
137
+ if (text.endsWith("@")) text = text.slice(0, -1);
138
+ const mentionStart = text.length;
137
139
  text += "\uFFFC";
138
- annotations.push({ type: "Embed", starts: [start], ends: [text.length], link: inner });
140
+ annotations.push({
141
+ type: "Embed",
142
+ starts: [mentionStart],
143
+ ends: [text.length],
144
+ link: inner,
145
+ ...hmAccountMentionUid(inner) ? { attributes: { mentionKind: "account" } } : {}
146
+ });
139
147
  } else {
140
148
  text += inner;
141
149
  annotations.push({ type: "Link", starts: [start], ends: [text.length], link: inner });
@@ -157,6 +165,19 @@ function parseInlineFormatting(raw) {
157
165
  if (ch === "[") {
158
166
  const link = readLink(raw, i);
159
167
  if (link) {
168
+ if (isMentionLabel(link.label) && /^hm:\/\//.test(link.url.trim())) {
169
+ const start2 = text.length;
170
+ text += "\uFFFC";
171
+ annotations.push({
172
+ type: "Embed",
173
+ starts: [start2],
174
+ ends: [text.length],
175
+ link: link.url.trim(),
176
+ attributes: { mentionKind: hmAccountMentionUid(link.url) ? "account" : "document" }
177
+ });
178
+ i = link.end;
179
+ continue;
180
+ }
160
181
  const parsed = parseInlineFormatting(link.label);
161
182
  const start = text.length;
162
183
  appendParsed(parsed);
@@ -202,6 +223,13 @@ function findBacktickRun(s, from, n) {
202
223
  }
203
224
  return -1;
204
225
  }
226
+ function hmAccountMentionUid(url) {
227
+ const match = /^hm:\/\/([A-Za-z0-9]+)(?:\/(?::profile\/?)?)?$/.exec(url.trim());
228
+ return match ? match[1] : null;
229
+ }
230
+ function isMentionLabel(label) {
231
+ return /^\s*@/.test(label);
232
+ }
205
233
  function readLink(s, open) {
206
234
  let depth = 0;
207
235
  let i = open;
@@ -864,6 +892,7 @@ function flattenToOperations(tree, parentId = "") {
864
892
 
865
893
  export {
866
894
  parseInlineFormatting,
895
+ hmAccountMentionUid,
867
896
  mergeAdjacentAnnotations,
868
897
  parseFrontmatter,
869
898
  parseMarkdown,
@@ -7,12 +7,12 @@ import {
7
7
  } from "./chunk-PJ2RFT5A.mjs";
8
8
  import {
9
9
  resolveDocumentState
10
- } from "./chunk-X3WUOOPH.mjs";
10
+ } from "./chunk-CTJU7XIA.mjs";
11
11
  import {
12
12
  entityQueryPathToHmIdPath,
13
13
  packHmId,
14
14
  unpackHmId
15
- } from "./chunk-3NYKSLJ4.mjs";
15
+ } from "./chunk-2KOZBPIM.mjs";
16
16
 
17
17
  // src/auto-link.ts
18
18
  import { CID } from "multiformats/cid";
@@ -15,7 +15,7 @@ import {
15
15
  HMActionSchema,
16
16
  HMRequestSchema,
17
17
  packHmId
18
- } from "./chunk-3NYKSLJ4.mjs";
18
+ } from "./chunk-2KOZBPIM.mjs";
19
19
 
20
20
  // src/client.ts
21
21
  import { encode as cborEncode } from "@ipld/dag-cbor";
package/dist/client.mjs CHANGED
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  createSeedClient,
3
3
  deserializeQueryString
4
- } from "./chunk-5YWGB4XU.mjs";
4
+ } from "./chunk-XHF4IQ4R.mjs";
5
5
  import "./chunk-CBELM7KX.mjs";
6
6
  import "./chunk-O5MHN2EO.mjs";
7
7
  import "./chunk-PJ2RFT5A.mjs";
8
8
  import "./chunk-LVAHHQIK.mjs";
9
9
  import "./chunk-DR3HJ6BV.mjs";
10
- import "./chunk-3NYKSLJ4.mjs";
10
+ import "./chunk-2KOZBPIM.mjs";
11
11
  import "./chunk-7P6ASYW6.mjs";
12
12
  export {
13
13
  createSeedClient,
package/dist/comment.mjs CHANGED
@@ -4,11 +4,11 @@ import {
4
4
  deleteComment,
5
5
  trimTrailingEmptyBlocks,
6
6
  updateComment
7
- } from "./chunk-F6A7GGKJ.mjs";
7
+ } from "./chunk-6YBRBK6F.mjs";
8
8
  import "./chunk-JKKS35IS.mjs";
9
9
  import "./chunk-LVAHHQIK.mjs";
10
10
  import "./chunk-DR3HJ6BV.mjs";
11
- import "./chunk-3NYKSLJ4.mjs";
11
+ import "./chunk-2KOZBPIM.mjs";
12
12
  import "./chunk-7P6ASYW6.mjs";
13
13
  export {
14
14
  commentRecordIdFromBlob,
@@ -4,8 +4,8 @@ import {
4
4
  followToDocument,
5
5
  resolveDocumentState,
6
6
  resolveEditableDocument
7
- } from "./chunk-X3WUOOPH.mjs";
8
- import "./chunk-3NYKSLJ4.mjs";
7
+ } from "./chunk-CTJU7XIA.mjs";
8
+ import "./chunk-2KOZBPIM.mjs";
9
9
  import "./chunk-7P6ASYW6.mjs";
10
10
  export {
11
11
  describeRedirect,
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  editorBlockToHMBlock,
3
3
  editorBlocksToHMBlockNodes
4
- } from "./chunk-JSA5TYHQ.mjs";
4
+ } from "./chunk-F72LNF4Q.mjs";
5
5
  import "./chunk-JKKS35IS.mjs";
6
- import "./chunk-3NYKSLJ4.mjs";
6
+ import "./chunk-2KOZBPIM.mjs";
7
7
  import "./chunk-7P6ASYW6.mjs";
8
8
  export {
9
9
  editorBlockToHMBlock,
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  resolveHypermediaUrl,
3
3
  resolveId
4
- } from "./chunk-X3636TQF.mjs";
5
- import "./chunk-3NYKSLJ4.mjs";
4
+ } from "./chunk-CVHEDNGU.mjs";
5
+ import "./chunk-2KOZBPIM.mjs";
6
6
  import "./chunk-7P6ASYW6.mjs";
7
7
  export {
8
8
  resolveHypermediaUrl,
@@ -2740,6 +2740,9 @@ export type HMPublishableAnnotation = {
2740
2740
  starts: number[];
2741
2741
  ends: number[];
2742
2742
  link: string;
2743
+ attributes?: {
2744
+ mentionKind?: 'account' | 'document';
2745
+ };
2743
2746
  } | {
2744
2747
  type: 'TextColor' | 'BackgroundColor' | 'TextSize' | 'TextFamily';
2745
2748
  starts: number[];
@@ -21380,9 +21383,9 @@ export declare const HMSearchResultItemSchema: z.ZodObject<{
21380
21383
  parentNames: z.ZodArray<z.ZodString, "many">;
21381
21384
  versionTime: z.ZodOptional<z.ZodString>;
21382
21385
  searchQuery: z.ZodString;
21383
- type: z.ZodEnum<["document", "contact", "comment"]>;
21386
+ type: z.ZodEnum<["document", "profile", "contact", "comment"]>;
21384
21387
  }, "strip", z.ZodTypeAny, {
21385
- type: "document" | "comment" | "contact";
21388
+ type: "document" | "comment" | "profile" | "contact";
21386
21389
  id: {
21387
21390
  path: string[] | null;
21388
21391
  version: string | null;
@@ -21455,7 +21458,7 @@ export declare const HMSearchResultItemSchema: z.ZodObject<{
21455
21458
  commentId?: string | undefined;
21456
21459
  versionTime?: string | undefined;
21457
21460
  }, {
21458
- type: "document" | "comment" | "contact";
21461
+ type: "document" | "comment" | "profile" | "contact";
21459
21462
  id: {
21460
21463
  path: string[] | null;
21461
21464
  version: string | null;
@@ -21735,9 +21738,9 @@ export declare const HMSearchPayloadSchema: z.ZodObject<{
21735
21738
  parentNames: z.ZodArray<z.ZodString, "many">;
21736
21739
  versionTime: z.ZodOptional<z.ZodString>;
21737
21740
  searchQuery: z.ZodString;
21738
- type: z.ZodEnum<["document", "contact", "comment"]>;
21741
+ type: z.ZodEnum<["document", "profile", "contact", "comment"]>;
21739
21742
  }, "strip", z.ZodTypeAny, {
21740
- type: "document" | "comment" | "contact";
21743
+ type: "document" | "comment" | "profile" | "contact";
21741
21744
  id: {
21742
21745
  path: string[] | null;
21743
21746
  version: string | null;
@@ -21810,7 +21813,7 @@ export declare const HMSearchPayloadSchema: z.ZodObject<{
21810
21813
  commentId?: string | undefined;
21811
21814
  versionTime?: string | undefined;
21812
21815
  }, {
21813
- type: "document" | "comment" | "contact";
21816
+ type: "document" | "comment" | "profile" | "contact";
21814
21817
  id: {
21815
21818
  path: string[] | null;
21816
21819
  version: string | null;
@@ -21888,7 +21891,7 @@ export declare const HMSearchPayloadSchema: z.ZodObject<{
21888
21891
  }, "strip", z.ZodTypeAny, {
21889
21892
  searchQuery: string;
21890
21893
  entities: {
21891
- type: "document" | "comment" | "contact";
21894
+ type: "document" | "comment" | "profile" | "contact";
21892
21895
  id: {
21893
21896
  path: string[] | null;
21894
21897
  version: string | null;
@@ -21965,7 +21968,7 @@ export declare const HMSearchPayloadSchema: z.ZodObject<{
21965
21968
  }, {
21966
21969
  searchQuery: string;
21967
21970
  entities: {
21968
- type: "document" | "comment" | "contact";
21971
+ type: "document" | "comment" | "profile" | "contact";
21969
21972
  id: {
21970
21973
  path: string[] | null;
21971
21974
  version: string | null;
@@ -22287,9 +22290,9 @@ export declare const HMSearchRequestSchema: z.ZodObject<{
22287
22290
  parentNames: z.ZodArray<z.ZodString, "many">;
22288
22291
  versionTime: z.ZodOptional<z.ZodString>;
22289
22292
  searchQuery: z.ZodString;
22290
- type: z.ZodEnum<["document", "contact", "comment"]>;
22293
+ type: z.ZodEnum<["document", "profile", "contact", "comment"]>;
22291
22294
  }, "strip", z.ZodTypeAny, {
22292
- type: "document" | "comment" | "contact";
22295
+ type: "document" | "comment" | "profile" | "contact";
22293
22296
  id: {
22294
22297
  path: string[] | null;
22295
22298
  version: string | null;
@@ -22362,7 +22365,7 @@ export declare const HMSearchRequestSchema: z.ZodObject<{
22362
22365
  commentId?: string | undefined;
22363
22366
  versionTime?: string | undefined;
22364
22367
  }, {
22365
- type: "document" | "comment" | "contact";
22368
+ type: "document" | "comment" | "profile" | "contact";
22366
22369
  id: {
22367
22370
  path: string[] | null;
22368
22371
  version: string | null;
@@ -22440,7 +22443,7 @@ export declare const HMSearchRequestSchema: z.ZodObject<{
22440
22443
  }, "strip", z.ZodTypeAny, {
22441
22444
  searchQuery: string;
22442
22445
  entities: {
22443
- type: "document" | "comment" | "contact";
22446
+ type: "document" | "comment" | "profile" | "contact";
22444
22447
  id: {
22445
22448
  path: string[] | null;
22446
22449
  version: string | null;
@@ -22517,7 +22520,7 @@ export declare const HMSearchRequestSchema: z.ZodObject<{
22517
22520
  }, {
22518
22521
  searchQuery: string;
22519
22522
  entities: {
22520
- type: "document" | "comment" | "contact";
22523
+ type: "document" | "comment" | "profile" | "contact";
22521
22524
  id: {
22522
22525
  path: string[] | null;
22523
22526
  version: string | null;
@@ -22610,7 +22613,7 @@ export declare const HMSearchRequestSchema: z.ZodObject<{
22610
22613
  output: {
22611
22614
  searchQuery: string;
22612
22615
  entities: {
22613
- type: "document" | "comment" | "contact";
22616
+ type: "document" | "comment" | "profile" | "contact";
22614
22617
  id: {
22615
22618
  path: string[] | null;
22616
22619
  version: string | null;
@@ -22703,7 +22706,7 @@ export declare const HMSearchRequestSchema: z.ZodObject<{
22703
22706
  output: {
22704
22707
  searchQuery: string;
22705
22708
  entities: {
22706
- type: "document" | "comment" | "contact";
22709
+ type: "document" | "comment" | "profile" | "contact";
22707
22710
  id: {
22708
22711
  path: string[] | null;
22709
22712
  version: string | null;
@@ -48550,9 +48553,9 @@ export declare const HMGetRequestSchema: z.ZodDiscriminatedUnion<"key", [z.ZodOb
48550
48553
  parentNames: z.ZodArray<z.ZodString, "many">;
48551
48554
  versionTime: z.ZodOptional<z.ZodString>;
48552
48555
  searchQuery: z.ZodString;
48553
- type: z.ZodEnum<["document", "contact", "comment"]>;
48556
+ type: z.ZodEnum<["document", "profile", "contact", "comment"]>;
48554
48557
  }, "strip", z.ZodTypeAny, {
48555
- type: "document" | "comment" | "contact";
48558
+ type: "document" | "comment" | "profile" | "contact";
48556
48559
  id: {
48557
48560
  path: string[] | null;
48558
48561
  version: string | null;
@@ -48625,7 +48628,7 @@ export declare const HMGetRequestSchema: z.ZodDiscriminatedUnion<"key", [z.ZodOb
48625
48628
  commentId?: string | undefined;
48626
48629
  versionTime?: string | undefined;
48627
48630
  }, {
48628
- type: "document" | "comment" | "contact";
48631
+ type: "document" | "comment" | "profile" | "contact";
48629
48632
  id: {
48630
48633
  path: string[] | null;
48631
48634
  version: string | null;
@@ -48703,7 +48706,7 @@ export declare const HMGetRequestSchema: z.ZodDiscriminatedUnion<"key", [z.ZodOb
48703
48706
  }, "strip", z.ZodTypeAny, {
48704
48707
  searchQuery: string;
48705
48708
  entities: {
48706
- type: "document" | "comment" | "contact";
48709
+ type: "document" | "comment" | "profile" | "contact";
48707
48710
  id: {
48708
48711
  path: string[] | null;
48709
48712
  version: string | null;
@@ -48780,7 +48783,7 @@ export declare const HMGetRequestSchema: z.ZodDiscriminatedUnion<"key", [z.ZodOb
48780
48783
  }, {
48781
48784
  searchQuery: string;
48782
48785
  entities: {
48783
- type: "document" | "comment" | "contact";
48786
+ type: "document" | "comment" | "profile" | "contact";
48784
48787
  id: {
48785
48788
  path: string[] | null;
48786
48789
  version: string | null;
@@ -48873,7 +48876,7 @@ export declare const HMGetRequestSchema: z.ZodDiscriminatedUnion<"key", [z.ZodOb
48873
48876
  output: {
48874
48877
  searchQuery: string;
48875
48878
  entities: {
48876
- type: "document" | "comment" | "contact";
48879
+ type: "document" | "comment" | "profile" | "contact";
48877
48880
  id: {
48878
48881
  path: string[] | null;
48879
48882
  version: string | null;
@@ -48966,7 +48969,7 @@ export declare const HMGetRequestSchema: z.ZodDiscriminatedUnion<"key", [z.ZodOb
48966
48969
  output: {
48967
48970
  searchQuery: string;
48968
48971
  entities: {
48969
- type: "document" | "comment" | "contact";
48972
+ type: "document" | "comment" | "profile" | "contact";
48970
48973
  id: {
48971
48974
  path: string[] | null;
48972
48975
  version: string | null;
@@ -66651,9 +66654,9 @@ export declare const HMRequestSchema: z.ZodDiscriminatedUnion<"key", [z.ZodObjec
66651
66654
  parentNames: z.ZodArray<z.ZodString, "many">;
66652
66655
  versionTime: z.ZodOptional<z.ZodString>;
66653
66656
  searchQuery: z.ZodString;
66654
- type: z.ZodEnum<["document", "contact", "comment"]>;
66657
+ type: z.ZodEnum<["document", "profile", "contact", "comment"]>;
66655
66658
  }, "strip", z.ZodTypeAny, {
66656
- type: "document" | "comment" | "contact";
66659
+ type: "document" | "comment" | "profile" | "contact";
66657
66660
  id: {
66658
66661
  path: string[] | null;
66659
66662
  version: string | null;
@@ -66726,7 +66729,7 @@ export declare const HMRequestSchema: z.ZodDiscriminatedUnion<"key", [z.ZodObjec
66726
66729
  commentId?: string | undefined;
66727
66730
  versionTime?: string | undefined;
66728
66731
  }, {
66729
- type: "document" | "comment" | "contact";
66732
+ type: "document" | "comment" | "profile" | "contact";
66730
66733
  id: {
66731
66734
  path: string[] | null;
66732
66735
  version: string | null;
@@ -66804,7 +66807,7 @@ export declare const HMRequestSchema: z.ZodDiscriminatedUnion<"key", [z.ZodObjec
66804
66807
  }, "strip", z.ZodTypeAny, {
66805
66808
  searchQuery: string;
66806
66809
  entities: {
66807
- type: "document" | "comment" | "contact";
66810
+ type: "document" | "comment" | "profile" | "contact";
66808
66811
  id: {
66809
66812
  path: string[] | null;
66810
66813
  version: string | null;
@@ -66881,7 +66884,7 @@ export declare const HMRequestSchema: z.ZodDiscriminatedUnion<"key", [z.ZodObjec
66881
66884
  }, {
66882
66885
  searchQuery: string;
66883
66886
  entities: {
66884
- type: "document" | "comment" | "contact";
66887
+ type: "document" | "comment" | "profile" | "contact";
66885
66888
  id: {
66886
66889
  path: string[] | null;
66887
66890
  version: string | null;
@@ -66974,7 +66977,7 @@ export declare const HMRequestSchema: z.ZodDiscriminatedUnion<"key", [z.ZodObjec
66974
66977
  output: {
66975
66978
  searchQuery: string;
66976
66979
  entities: {
66977
- type: "document" | "comment" | "contact";
66980
+ type: "document" | "comment" | "profile" | "contact";
66978
66981
  id: {
66979
66982
  path: string[] | null;
66980
66983
  version: string | null;
@@ -67067,7 +67070,7 @@ export declare const HMRequestSchema: z.ZodDiscriminatedUnion<"key", [z.ZodObjec
67067
67070
  output: {
67068
67071
  searchQuery: string;
67069
67072
  entities: {
67070
- type: "document" | "comment" | "contact";
67073
+ type: "document" | "comment" | "profile" | "contact";
67071
67074
  id: {
67072
67075
  path: string[] | null;
67073
67076
  version: string | null;
package/dist/hm-types.mjs CHANGED
@@ -210,7 +210,7 @@ import {
210
210
  toNumber,
211
211
  unpackHmId,
212
212
  unpackedHmIdSchema
213
- } from "./chunk-3NYKSLJ4.mjs";
213
+ } from "./chunk-2KOZBPIM.mjs";
214
214
  import "./chunk-7P6ASYW6.mjs";
215
215
  export {
216
216
  BUILTIN_METADATA_KEYS,
@@ -2,8 +2,8 @@ import {
2
2
  annotationContains,
3
3
  hmBlockToEditorBlock,
4
4
  hmBlocksToEditorContent
5
- } from "./chunk-MO524BCL.mjs";
6
- import "./chunk-3NYKSLJ4.mjs";
5
+ } from "./chunk-FLUWADFC.mjs";
6
+ import "./chunk-2KOZBPIM.mjs";
7
7
  import "./chunk-7P6ASYW6.mjs";
8
8
  export {
9
9
  annotationContains,
package/dist/index.d.ts CHANGED
@@ -31,7 +31,7 @@ export { resolveIdWithClient } from './resource-read';
31
31
  export type { ResolveIdWithClientOptions, ResolvedIdWithClient } from './resource-read';
32
32
  export { fileToIpfsBlobs, filesToIpfsBlobs, resolveFileLinksInBlocks, hasFileLinks } from './file-to-ipfs';
33
33
  export type { CollectedBlob } from './file-to-ipfs';
34
- export { parseMarkdown, flattenToOperations, parseInlineFormatting, parseFrontmatter, markdownBlockNodesToHMBlockNodes, } from './markdown-to-blocks';
34
+ export { parseMarkdown, flattenToOperations, parseInlineFormatting, parseFrontmatter, markdownBlockNodesToHMBlockNodes, hmAccountMentionUid, } from './markdown-to-blocks';
35
35
  export type { BlockNode, SeedBlock, Annotation } from './markdown-to-blocks';
36
36
  export { blocksToMarkdown, emitFrontmatter, slugify, draftFilename, parseDraftFilename, documentToResolvedMarkdown, commentToResolvedMarkdown, contentToResolvedMarkdown, } from './blocks-to-markdown';
37
37
  export type { ResolvedMarkdownOptions } from './blocks-to-markdown';
package/dist/index.mjs CHANGED
@@ -1,34 +1,35 @@
1
1
  import {
2
2
  resolveIdWithClient
3
- } from "./chunk-6JS7R6XP.mjs";
3
+ } from "./chunk-GRBJUKWS.mjs";
4
4
  import {
5
5
  annotationContains,
6
6
  hmBlockToEditorBlock,
7
7
  hmBlocksToEditorContent
8
- } from "./chunk-MO524BCL.mjs";
8
+ } from "./chunk-FLUWADFC.mjs";
9
9
  import {
10
10
  keyfile_exports
11
11
  } from "./chunk-EY6RQVAP.mjs";
12
12
  import {
13
13
  flattenToOperations,
14
+ hmAccountMentionUid,
14
15
  markdownBlockNodesToHMBlockNodes,
15
16
  parseFrontmatter,
16
17
  parseInlineFormatting,
17
18
  parseMarkdown
18
- } from "./chunk-QVRJGK77.mjs";
19
+ } from "./chunk-K5NYTWBJ.mjs";
19
20
  import {
20
21
  pdfToBlocks
21
- } from "./chunk-JUXVJ5TO.mjs";
22
+ } from "./chunk-AUY42GMB.mjs";
22
23
  import {
23
24
  teiToBlocks
24
- } from "./chunk-2JLNS6YU.mjs";
25
+ } from "./chunk-HJ4ACOMW.mjs";
25
26
  import {
26
27
  embeddedPdfToBlocks
27
28
  } from "./chunk-2FJBS3V7.mjs";
28
29
  import {
29
30
  editorBlockToHMBlock,
30
31
  editorBlocksToHMBlockNodes
31
- } from "./chunk-JSA5TYHQ.mjs";
32
+ } from "./chunk-F72LNF4Q.mjs";
32
33
  import {
33
34
  encryption_exports
34
35
  } from "./chunk-UOL3F6XQ.mjs";
@@ -46,10 +47,10 @@ import {
46
47
  import {
47
48
  resolveHypermediaUrl,
48
49
  resolveId
49
- } from "./chunk-X3636TQF.mjs";
50
+ } from "./chunk-CVHEDNGU.mjs";
50
51
  import {
51
52
  createSeedClient
52
- } from "./chunk-5YWGB4XU.mjs";
53
+ } from "./chunk-XHF4IQ4R.mjs";
53
54
  import {
54
55
  SeedClientError,
55
56
  SeedNetworkError,
@@ -61,7 +62,7 @@ import {
61
62
  deleteComment,
62
63
  trimTrailingEmptyBlocks,
63
64
  updateComment
64
- } from "./chunk-F6A7GGKJ.mjs";
65
+ } from "./chunk-6YBRBK6F.mjs";
65
66
  import {
66
67
  AnnotationSet,
67
68
  addSpanToAnnotation,
@@ -82,7 +83,7 @@ import {
82
83
  documentContainsLinkToChild,
83
84
  documentHasSelfQuery,
84
85
  shouldAutoLinkParent
85
- } from "./chunk-32JNJI2C.mjs";
86
+ } from "./chunk-KD3ZIXZV.mjs";
86
87
  import {
87
88
  createChange,
88
89
  createChangeOps,
@@ -104,7 +105,7 @@ import {
104
105
  followToDocument,
105
106
  resolveDocumentState,
106
107
  resolveEditableDocument
107
- } from "./chunk-X3WUOOPH.mjs";
108
+ } from "./chunk-CTJU7XIA.mjs";
108
109
  import "./chunk-2MD3FXKB.mjs";
109
110
  import {
110
111
  computeReplaceOps,
@@ -123,11 +124,11 @@ import {
123
124
  emitFrontmatter,
124
125
  parseDraftFilename,
125
126
  slugify
126
- } from "./chunk-LFY2IN4N.mjs";
127
+ } from "./chunk-BGXPPECP.mjs";
127
128
  import {
128
129
  createCapability,
129
130
  resolveCapability
130
- } from "./chunk-Y4P6H3KD.mjs";
131
+ } from "./chunk-JKXO3OWO.mjs";
131
132
  import "./chunk-LVAHHQIK.mjs";
132
133
  import "./chunk-NBCHK76Q.mjs";
133
134
  import {
@@ -147,7 +148,7 @@ import {
147
148
  parseFragment,
148
149
  serializeBlockRange,
149
150
  unpackHmId
150
- } from "./chunk-3NYKSLJ4.mjs";
151
+ } from "./chunk-2KOZBPIM.mjs";
151
152
  import "./chunk-3TPCJCVO.mjs";
152
153
  import "./chunk-7P6ASYW6.mjs";
153
154
  export {
@@ -202,6 +203,7 @@ export {
202
203
  followToDocument,
203
204
  getHMQueryString,
204
205
  hasFileLinks,
206
+ hmAccountMentionUid,
205
207
  hmBlockNodeToBlockNode,
206
208
  hmBlockToEditorBlock,
207
209
  hmBlocksToEditorContent,
@@ -41,6 +41,16 @@ type InlineParseResult = {
41
41
  * exactly; mis-nested hand-written input degrades gracefully.
42
42
  */
43
43
  export declare function parseInlineFormatting(raw: string): InlineParseResult;
44
+ /**
45
+ * Read a `[label](url)` starting at `open` (the `[`). Brackets balance,
46
+ * escapes and code spans are skipped, the url may be `<…>`-wrapped.
47
+ */
48
+ /**
49
+ * The account uid an `hm://` URL mentions, when it names an account itself: `hm://UID` (the
50
+ * account root) or `hm://UID/:profile`. A URL with any other path names a document, not a person,
51
+ * and returns null. Query strings and fragments are not accepted on a mention.
52
+ */
53
+ export declare function hmAccountMentionUid(url: string): string | null;
44
54
  /**
45
55
  * Merge annotations of the same kind whose ranges touch or overlap into one
46
56
  * contiguous range, and order the result deterministically. The emitter
@@ -1,14 +1,16 @@
1
1
  import {
2
2
  flattenToOperations,
3
+ hmAccountMentionUid,
3
4
  markdownBlockNodesToHMBlockNodes,
4
5
  mergeAdjacentAnnotations,
5
6
  parseFrontmatter,
6
7
  parseInlineFormatting,
7
8
  parseMarkdown
8
- } from "./chunk-QVRJGK77.mjs";
9
+ } from "./chunk-K5NYTWBJ.mjs";
9
10
  import "./chunk-7P6ASYW6.mjs";
10
11
  export {
11
12
  flattenToOperations,
13
+ hmAccountMentionUid,
12
14
  markdownBlockNodesToHMBlockNodes,
13
15
  mergeAdjacentAnnotations,
14
16
  parseFrontmatter,
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  pdfToBlocks
3
- } from "./chunk-JUXVJ5TO.mjs";
4
- import "./chunk-2JLNS6YU.mjs";
3
+ } from "./chunk-AUY42GMB.mjs";
4
+ import "./chunk-HJ4ACOMW.mjs";
5
5
  import "./chunk-2FJBS3V7.mjs";
6
6
  import "./chunk-PPAY4WZX.mjs";
7
- import "./chunk-3NYKSLJ4.mjs";
7
+ import "./chunk-2KOZBPIM.mjs";
8
8
  import "./chunk-7P6ASYW6.mjs";
9
9
  export {
10
10
  pdfToBlocks
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  resolveIdWithClient
3
- } from "./chunk-6JS7R6XP.mjs";
4
- import "./chunk-X3636TQF.mjs";
5
- import "./chunk-5YWGB4XU.mjs";
3
+ } from "./chunk-GRBJUKWS.mjs";
4
+ import "./chunk-CVHEDNGU.mjs";
5
+ import "./chunk-XHF4IQ4R.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-3NYKSLJ4.mjs";
11
+ import "./chunk-2KOZBPIM.mjs";
12
12
  import "./chunk-7P6ASYW6.mjs";
13
13
  export {
14
14
  resolveIdWithClient
@@ -17,11 +17,11 @@ import {
17
17
  resolveSchemaRef,
18
18
  schemaDefinitionCid,
19
19
  withoutSchemaLink
20
- } from "./chunk-OHN5ILTT.mjs";
20
+ } from "./chunk-6YGIRB3K.mjs";
21
21
  import "./chunk-FFH7G6KW.mjs";
22
22
  import "./chunk-ZWKMAGDU.mjs";
23
23
  import "./chunk-VWSAFDOL.mjs";
24
- import "./chunk-3NYKSLJ4.mjs";
24
+ import "./chunk-2KOZBPIM.mjs";
25
25
  import "./chunk-7P6ASYW6.mjs";
26
26
  export {
27
27
  bareCid,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  classifyRef
3
- } from "./chunk-OHN5ILTT.mjs";
3
+ } from "./chunk-6YGIRB3K.mjs";
4
4
  import {
5
5
  kindOf,
6
6
  nameForCid,
@@ -13,7 +13,7 @@ import {
13
13
  import "./chunk-VWSAFDOL.mjs";
14
14
  import {
15
15
  unpackHmId
16
- } from "./chunk-3NYKSLJ4.mjs";
16
+ } from "./chunk-2KOZBPIM.mjs";
17
17
  import "./chunk-7P6ASYW6.mjs";
18
18
 
19
19
  // src/schema-subtypes.ts
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  teiToBlocks
3
- } from "./chunk-2JLNS6YU.mjs";
4
- import "./chunk-3NYKSLJ4.mjs";
3
+ } from "./chunk-HJ4ACOMW.mjs";
4
+ import "./chunk-2KOZBPIM.mjs";
5
5
  import "./chunk-7P6ASYW6.mjs";
6
6
  export {
7
7
  teiToBlocks
package/dist/unicode.mjs CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  import {
8
8
  codePointLength,
9
9
  isSurrogate
10
- } from "./chunk-3NYKSLJ4.mjs";
10
+ } from "./chunk-2KOZBPIM.mjs";
11
11
  import "./chunk-7P6ASYW6.mjs";
12
12
  export {
13
13
  AnnotationSet,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seed-hypermedia/client",
3
- "version": "0.0.96",
3
+ "version": "0.0.98",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/seed-hypermedia/seed",