@seed-hypermedia/client 0.0.72 → 0.0.74
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-ALT5YCCW.mjs → chunk-344BPFU7.mjs} +2 -2
- package/dist/{chunk-RL3OEUFZ.mjs → chunk-5GJCMBPK.mjs} +1 -1
- package/dist/{chunk-TXVEL22U.mjs → chunk-AWRI3EMQ.mjs} +3 -3
- package/dist/{chunk-W3FLBRBH.mjs → chunk-BXEZSVNI.mjs} +14 -0
- package/dist/{chunk-GYZGSI4H.mjs → chunk-F5IDLVWW.mjs} +2 -2
- package/dist/{chunk-QYA75XPV.mjs → chunk-MSGTSCBL.mjs} +1 -1
- package/dist/{chunk-NUIZU7KO.mjs → chunk-NDVSBEJ4.mjs} +2 -1
- package/dist/{chunk-4L2LE3JW.mjs → chunk-NPKHESR6.mjs} +2 -1
- package/dist/{chunk-KY6WRGXY.mjs → chunk-PQEZHGRI.mjs} +9 -1
- package/dist/{chunk-FNETXNBK.mjs → chunk-QFZLM6JZ.mjs} +1 -1
- package/dist/{chunk-BZ4AXNSZ.mjs → chunk-RFDFZV7U.mjs} +1 -1
- package/dist/{chunk-H34UYMNW.mjs → chunk-RQRUU25M.mjs} +1 -1
- package/dist/{chunk-FUSG27NF.mjs → chunk-SLA7HDTC.mjs} +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 +5 -2
- package/dist/editorblock-to-hmblock.mjs +2 -2
- package/dist/hm-resolver.mjs +2 -2
- package/dist/hm-types.d.ts +2911 -1
- package/dist/hm-types.mjs +3 -1
- package/dist/hmblock-to-editorblock.d.ts +0 -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/tei-to-blocks.mjs +2 -2
- package/dist/unicode.mjs +1 -1
- package/package.json +1 -1
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-F5IDLVWW.mjs";
|
|
8
8
|
import "./chunk-JT57MV7Y.mjs";
|
|
9
9
|
import "./chunk-PJ2RFT5A.mjs";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-RFDFZV7U.mjs";
|
|
11
11
|
import "./chunk-LVAHHQIK.mjs";
|
|
12
12
|
import "./chunk-DR3HJ6BV.mjs";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-BXEZSVNI.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-344BPFU7.mjs";
|
|
11
|
+
import "./chunk-BXEZSVNI.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-5GJCMBPK.mjs";
|
|
5
5
|
import "./chunk-LVAHHQIK.mjs";
|
|
6
6
|
import "./chunk-IT5LLTMP.mjs";
|
|
7
7
|
import "./chunk-DR3HJ6BV.mjs";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-BXEZSVNI.mjs";
|
|
9
9
|
import "./chunk-3TPCJCVO.mjs";
|
|
10
10
|
import "./chunk-7P6ASYW6.mjs";
|
|
11
11
|
export {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
unpackHmId
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-BXEZSVNI.mjs";
|
|
4
4
|
|
|
5
5
|
// src/blocks-to-markdown.ts
|
|
6
6
|
var FM_STRING_KEYS = [
|
|
@@ -77,7 +77,7 @@ function blockNodeToMarkdown(node, depth, opts) {
|
|
|
77
77
|
return tableToMarkdown(node, depth, (text, annotations) => applyAnnotations(text, annotations));
|
|
78
78
|
}
|
|
79
79
|
const childrenType = (_a = block.attributes) == null ? void 0 : _a.childrenType;
|
|
80
|
-
const isListContainer = block.type === "Paragraph" && !block.text && (childrenType === "Ordered" || childrenType === "Unordered" || childrenType === "Blockquote");
|
|
80
|
+
const isListContainer = (block.type === "Paragraph" || block.type === "Slot") && !block.text && (childrenType === "Ordered" || childrenType === "Unordered" || childrenType === "Blockquote");
|
|
81
81
|
let result;
|
|
82
82
|
if (isListContainer) {
|
|
83
83
|
result = idComment(block.id);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveId
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-MSGTSCBL.mjs";
|
|
4
4
|
import {
|
|
5
5
|
createSeedClient
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-SLA7HDTC.mjs";
|
|
7
7
|
import {
|
|
8
8
|
unpackHmId
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-BXEZSVNI.mjs";
|
|
10
10
|
|
|
11
11
|
// src/resource-read.ts
|
|
12
12
|
async function resolveIdWithClient(rawId, options = {}) {
|
|
@@ -267,6 +267,12 @@ var HMDocumentMetadataSchema = z.object({
|
|
|
267
267
|
// DEPRECATED
|
|
268
268
|
cover: z.string().optional(),
|
|
269
269
|
siteUrl: z.string().optional(),
|
|
270
|
+
/**
|
|
271
|
+
* Agents server a space advertises for its readers (an http(s) origin). Clients viewing the
|
|
272
|
+
* space's documents connect to it alongside their own configured servers, so a site can host
|
|
273
|
+
* agents for its audience — on the gateway, each site brings its own agents backend.
|
|
274
|
+
*/
|
|
275
|
+
agentServerUrl: z.string().optional(),
|
|
270
276
|
layout: z.union([z.literal("Seed/Experimental/Newspaper"), z.literal("")]).optional(),
|
|
271
277
|
displayPublishTime: z.string().optional(),
|
|
272
278
|
displayAuthor: z.string().optional(),
|
|
@@ -300,6 +306,7 @@ var DOCUMENT_ATTRIBUTE_DESCRIPTIONS = {
|
|
|
300
306
|
thumbnail: "Deprecated image field kept for older documents.",
|
|
301
307
|
cover: "Wide cover image shown in headers and cards.",
|
|
302
308
|
siteUrl: "Published website URL for a space.",
|
|
309
|
+
agentServerUrl: "Agents server readers of this space connect to.",
|
|
303
310
|
layout: "Legacy site header layout setting.",
|
|
304
311
|
displayPublishTime: "Publication date shown to readers.",
|
|
305
312
|
displayAuthor: "Author byline shown to readers.",
|
|
@@ -505,6 +512,11 @@ var HMBlockGroupSchema = z.object({
|
|
|
505
512
|
type: z.literal("Group"),
|
|
506
513
|
id: z.string()
|
|
507
514
|
});
|
|
515
|
+
var HMBlockSlotSchema = z.object({
|
|
516
|
+
type: z.literal("Slot"),
|
|
517
|
+
...blockBaseProperties,
|
|
518
|
+
attributes: z.object(parentBlockAttributes).optional().default({})
|
|
519
|
+
}).strict();
|
|
508
520
|
var HMBlockLinkSchema = z.object({
|
|
509
521
|
type: z.literal("Link"),
|
|
510
522
|
id: z.string(),
|
|
@@ -528,6 +540,7 @@ var HMBlockKnownSchema = z.discriminatedUnion("type", [
|
|
|
528
540
|
HMBlockTableColumnSchema,
|
|
529
541
|
HMBlockQuerySchema,
|
|
530
542
|
HMBlockGroupSchema,
|
|
543
|
+
HMBlockSlotSchema,
|
|
531
544
|
HMBlockLinkSchema
|
|
532
545
|
]);
|
|
533
546
|
var HMBlockUnknownSchema = z.object({
|
|
@@ -1456,6 +1469,7 @@ export {
|
|
|
1456
1469
|
HMBlockTableColumnSchema,
|
|
1457
1470
|
HMBlockQuerySchema,
|
|
1458
1471
|
HMBlockGroupSchema,
|
|
1472
|
+
HMBlockSlotSchema,
|
|
1459
1473
|
HMBlockLinkSchema,
|
|
1460
1474
|
HMBlockKnownSchema,
|
|
1461
1475
|
HMBlockUnknownSchema,
|
|
@@ -7,12 +7,12 @@ import {
|
|
|
7
7
|
} from "./chunk-PJ2RFT5A.mjs";
|
|
8
8
|
import {
|
|
9
9
|
resolveDocumentState
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-RFDFZV7U.mjs";
|
|
11
11
|
import {
|
|
12
12
|
entityQueryPathToHmIdPath,
|
|
13
13
|
packHmId,
|
|
14
14
|
unpackHmId
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-BXEZSVNI.mjs";
|
|
16
16
|
|
|
17
17
|
// src/auto-link.ts
|
|
18
18
|
import { CID } from "multiformats/cid";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isSurrogate
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-BXEZSVNI.mjs";
|
|
4
4
|
|
|
5
5
|
// src/hmblock-to-editorblock.ts
|
|
6
6
|
function toEditorBlockType(hmBlockType) {
|
|
@@ -18,6 +18,7 @@ function toEditorBlockType(hmBlockType) {
|
|
|
18
18
|
if (hmBlockType === "Table") return "table";
|
|
19
19
|
if (hmBlockType === "TableRow") return "tableRow";
|
|
20
20
|
if (hmBlockType === "TableColumn") return "tableColumn";
|
|
21
|
+
if (hmBlockType === "Slot") return "slot";
|
|
21
22
|
return "unknown";
|
|
22
23
|
}
|
|
23
24
|
function hmBlocksToEditorContent(blocks, opts = { level: 1 }) {
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
HMBlockSchema,
|
|
7
7
|
codePointLength,
|
|
8
8
|
toNumber
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-BXEZSVNI.mjs";
|
|
10
10
|
|
|
11
11
|
// src/editorblock-to-hmblock.ts
|
|
12
12
|
function toHMBlockType(editorBlockType) {
|
|
@@ -24,6 +24,7 @@ function toHMBlockType(editorBlockType) {
|
|
|
24
24
|
if (editorBlockType === "table") return "Table";
|
|
25
25
|
if (editorBlockType === "tableRow") return "TableRow";
|
|
26
26
|
if (editorBlockType === "tableColumn") return "TableColumn";
|
|
27
|
+
if (editorBlockType === "slot") return "Slot";
|
|
27
28
|
return void 0;
|
|
28
29
|
}
|
|
29
30
|
function toImageWidthNumber(width) {
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
import {
|
|
10
10
|
hmIdPathToEntityQueryPath,
|
|
11
11
|
packHmId
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-BXEZSVNI.mjs";
|
|
13
13
|
|
|
14
14
|
// src/comment.ts
|
|
15
15
|
import { decode as cborDecode, encode as cborEncode } from "@ipld/dag-cbor";
|
|
@@ -174,6 +174,14 @@ function blockToPublishable(blockNode) {
|
|
|
174
174
|
children: blocksToPublishable(blockNode.children || [])
|
|
175
175
|
};
|
|
176
176
|
}
|
|
177
|
+
if (block.type === "Slot") {
|
|
178
|
+
return {
|
|
179
|
+
id: block.id,
|
|
180
|
+
type: "Slot",
|
|
181
|
+
...block.attributes,
|
|
182
|
+
children: blocksToPublishable(blockNode.children || [])
|
|
183
|
+
};
|
|
184
|
+
}
|
|
177
185
|
throw new Error(`Unsupported block type: ${block.type}`);
|
|
178
186
|
}
|
|
179
187
|
function blocksToPublishable(blockNodes) {
|
package/dist/client.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createSeedClient,
|
|
3
3
|
deserializeQueryString
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-SLA7HDTC.mjs";
|
|
5
5
|
import "./chunk-CBELM7KX.mjs";
|
|
6
6
|
import "./chunk-JT57MV7Y.mjs";
|
|
7
7
|
import "./chunk-PJ2RFT5A.mjs";
|
|
8
8
|
import "./chunk-LVAHHQIK.mjs";
|
|
9
9
|
import "./chunk-DR3HJ6BV.mjs";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-BXEZSVNI.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-
|
|
7
|
+
} from "./chunk-PQEZHGRI.mjs";
|
|
8
8
|
import "./chunk-N3P7S5YZ.mjs";
|
|
9
9
|
import "./chunk-LVAHHQIK.mjs";
|
|
10
10
|
import "./chunk-DR3HJ6BV.mjs";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-BXEZSVNI.mjs";
|
|
12
12
|
import "./chunk-7P6ASYW6.mjs";
|
|
13
13
|
export {
|
|
14
14
|
commentRecordIdFromBlob,
|
package/dist/document-state.mjs
CHANGED
|
@@ -4,8 +4,8 @@ import {
|
|
|
4
4
|
followToDocument,
|
|
5
5
|
resolveDocumentState,
|
|
6
6
|
resolveEditableDocument
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-RFDFZV7U.mjs";
|
|
8
|
+
import "./chunk-BXEZSVNI.mjs";
|
|
9
9
|
import "./chunk-7P6ASYW6.mjs";
|
|
10
10
|
export {
|
|
11
11
|
describeRedirect,
|
package/dist/editor-types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { HMBlockChildrenType } from './hm-types';
|
|
2
|
-
export type EditorBlock = EditorParagraphBlock | EditorHeadingBlock | EditorCodeBlock | EditorImageBlock | EditorVideoBlock | EditorFileBlock | EditorButtonBlock | EditorEmbedBlock | EditorWebEmbedBlock | EditorMathBlock | EditorNostrBlock | EditorQueryBlock | EditorTableBlock | EditorTableRowBlock | EditorTableColumnBlock | EditorUnknownBlock;
|
|
2
|
+
export type EditorBlock = EditorParagraphBlock | EditorHeadingBlock | EditorCodeBlock | EditorImageBlock | EditorVideoBlock | EditorFileBlock | EditorButtonBlock | EditorEmbedBlock | EditorWebEmbedBlock | EditorMathBlock | EditorNostrBlock | EditorQueryBlock | EditorTableBlock | EditorTableRowBlock | EditorTableColumnBlock | EditorSlotBlock | EditorUnknownBlock;
|
|
3
3
|
export type HMInlineContent = EditorText | EditorInlineEmbed | EditorLink;
|
|
4
4
|
export interface EditorBaseBlock {
|
|
5
5
|
id: string;
|
|
@@ -9,7 +9,6 @@ export interface EditorBaseBlock {
|
|
|
9
9
|
export interface EditorBlockProps {
|
|
10
10
|
childrenType?: HMBlockChildrenType;
|
|
11
11
|
columnCount?: string;
|
|
12
|
-
listLevel?: string;
|
|
13
12
|
level?: number | string;
|
|
14
13
|
ref?: string;
|
|
15
14
|
revision?: string;
|
|
@@ -135,6 +134,10 @@ export interface EditorTableColumnBlock extends EditorBaseBlock {
|
|
|
135
134
|
};
|
|
136
135
|
content: Array<HMInlineContent>;
|
|
137
136
|
}
|
|
137
|
+
export interface EditorSlotBlock extends EditorBaseBlock {
|
|
138
|
+
type: 'slot';
|
|
139
|
+
content: Array<HMInlineContent>;
|
|
140
|
+
}
|
|
138
141
|
export type EditorUnknownBlock = EditorBaseBlock & {
|
|
139
142
|
type: 'unknown';
|
|
140
143
|
props: EditorBlockProps & {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
editorBlockToHMBlock,
|
|
3
3
|
editorBlocksToHMBlockNodes
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-NPKHESR6.mjs";
|
|
5
5
|
import "./chunk-N3P7S5YZ.mjs";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-BXEZSVNI.mjs";
|
|
7
7
|
import "./chunk-7P6ASYW6.mjs";
|
|
8
8
|
export {
|
|
9
9
|
editorBlockToHMBlock,
|
package/dist/hm-resolver.mjs
CHANGED