@seed-hypermedia/client 0.0.50 → 0.0.52
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/{chunk-KJWDRBIN.mjs → chunk-S3TOHNCG.mjs} +1 -10
- package/dist/hm-types.d.ts +0 -29
- package/dist/hm-types.mjs +1 -3
- package/dist/index.mjs +23 -1
- package/package.json +1 -1
|
@@ -627,14 +627,6 @@ var HMCitationSchema = z.object({
|
|
|
627
627
|
targetFragment: ParsedFragmentSchema.nullable(),
|
|
628
628
|
targetId: unpackedHmIdSchema
|
|
629
629
|
});
|
|
630
|
-
var DeviceLinkSessionSchema = z.object({
|
|
631
|
-
accountId: z.string(),
|
|
632
|
-
secretToken: z.string(),
|
|
633
|
-
addrInfo: z.object({
|
|
634
|
-
peerId: z.string(),
|
|
635
|
-
addrs: z.array(z.string())
|
|
636
|
-
})
|
|
637
|
-
});
|
|
638
630
|
var HMNavigationItemSchema = z.object({
|
|
639
631
|
type: z.literal("Link"),
|
|
640
632
|
id: z.string(),
|
|
@@ -1225,7 +1217,7 @@ function parseFragment(input) {
|
|
|
1225
1217
|
return { blockId: input, expanded: false };
|
|
1226
1218
|
}
|
|
1227
1219
|
}
|
|
1228
|
-
var STATIC_HM_PATHS = /* @__PURE__ */ new Set(["download", "connect", "register", "
|
|
1220
|
+
var STATIC_HM_PATHS = /* @__PURE__ */ new Set(["download", "connect", "register", "profile", "contact"]);
|
|
1229
1221
|
function unpackHmId(hypermediaId) {
|
|
1230
1222
|
if (!hypermediaId) return null;
|
|
1231
1223
|
const parsed = parseCustomURL(hypermediaId);
|
|
@@ -1373,7 +1365,6 @@ export {
|
|
|
1373
1365
|
HMPeerConnectionRequestSchema,
|
|
1374
1366
|
ParsedFragmentSchema,
|
|
1375
1367
|
HMCitationSchema,
|
|
1376
|
-
DeviceLinkSessionSchema,
|
|
1377
1368
|
HMNavigationItemSchema,
|
|
1378
1369
|
HMDraftContentSchema,
|
|
1379
1370
|
HMDraftMetaSchema,
|
package/dist/hm-types.d.ts
CHANGED
|
@@ -14312,35 +14312,6 @@ export type AggregatedDiscoveryState = {
|
|
|
14312
14312
|
blobsDownloaded: number;
|
|
14313
14313
|
blobsFailed: number;
|
|
14314
14314
|
};
|
|
14315
|
-
export declare const DeviceLinkSessionSchema: z.ZodObject<{
|
|
14316
|
-
accountId: z.ZodString;
|
|
14317
|
-
secretToken: z.ZodString;
|
|
14318
|
-
addrInfo: z.ZodObject<{
|
|
14319
|
-
peerId: z.ZodString;
|
|
14320
|
-
addrs: z.ZodArray<z.ZodString, "many">;
|
|
14321
|
-
}, "strip", z.ZodTypeAny, {
|
|
14322
|
-
peerId: string;
|
|
14323
|
-
addrs: string[];
|
|
14324
|
-
}, {
|
|
14325
|
-
peerId: string;
|
|
14326
|
-
addrs: string[];
|
|
14327
|
-
}>;
|
|
14328
|
-
}, "strip", z.ZodTypeAny, {
|
|
14329
|
-
accountId: string;
|
|
14330
|
-
secretToken: string;
|
|
14331
|
-
addrInfo: {
|
|
14332
|
-
peerId: string;
|
|
14333
|
-
addrs: string[];
|
|
14334
|
-
};
|
|
14335
|
-
}, {
|
|
14336
|
-
accountId: string;
|
|
14337
|
-
secretToken: string;
|
|
14338
|
-
addrInfo: {
|
|
14339
|
-
peerId: string;
|
|
14340
|
-
addrs: string[];
|
|
14341
|
-
};
|
|
14342
|
-
}>;
|
|
14343
|
-
export type DeviceLinkSession = z.infer<typeof DeviceLinkSessionSchema>;
|
|
14344
14315
|
export declare const HMNavigationItemSchema: z.ZodObject<{
|
|
14345
14316
|
type: z.ZodLiteral<"Link">;
|
|
14346
14317
|
id: z.ZodString;
|
package/dist/hm-types.mjs
CHANGED
|
@@ -3,7 +3,6 @@ import {
|
|
|
3
3
|
BlockRangeSchema,
|
|
4
4
|
BoldAnnotationSchema,
|
|
5
5
|
CodeAnnotationSchema,
|
|
6
|
-
DeviceLinkSessionSchema,
|
|
7
6
|
HMAccountContactsRequestSchema,
|
|
8
7
|
HMAccountNotFoundSchema,
|
|
9
8
|
HMAccountPayloadSchema,
|
|
@@ -177,13 +176,12 @@ import {
|
|
|
177
176
|
toNumber,
|
|
178
177
|
unpackHmId,
|
|
179
178
|
unpackedHmIdSchema
|
|
180
|
-
} from "./chunk-
|
|
179
|
+
} from "./chunk-S3TOHNCG.mjs";
|
|
181
180
|
export {
|
|
182
181
|
BackgroundColorAnnotationSchema,
|
|
183
182
|
BlockRangeSchema,
|
|
184
183
|
BoldAnnotationSchema,
|
|
185
184
|
CodeAnnotationSchema,
|
|
186
|
-
DeviceLinkSessionSchema,
|
|
187
185
|
HMAccountContactsRequestSchema,
|
|
188
186
|
HMAccountNotFoundSchema,
|
|
189
187
|
HMAccountPayloadSchema,
|
package/dist/index.mjs
CHANGED
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
serializeBlockRange,
|
|
18
18
|
toNumber,
|
|
19
19
|
unpackHmId
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-S3TOHNCG.mjs";
|
|
21
21
|
|
|
22
22
|
// src/capability.ts
|
|
23
23
|
import { encode as cborEncode2 } from "@ipld/dag-cbor";
|
|
@@ -4107,8 +4107,30 @@ function toImageWidthNumber(width) {
|
|
|
4107
4107
|
}
|
|
4108
4108
|
return toNumber(width);
|
|
4109
4109
|
}
|
|
4110
|
+
function unknownEditorBlockToHMBlock(editorBlock) {
|
|
4111
|
+
const props = editorBlock.props ?? {};
|
|
4112
|
+
if (props.originalData) {
|
|
4113
|
+
try {
|
|
4114
|
+
const parsed = JSON.parse(props.originalData);
|
|
4115
|
+
if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
|
|
4116
|
+
return { ...parsed, id: editorBlock.id };
|
|
4117
|
+
}
|
|
4118
|
+
} catch {
|
|
4119
|
+
}
|
|
4120
|
+
}
|
|
4121
|
+
return {
|
|
4122
|
+
id: editorBlock.id,
|
|
4123
|
+
type: props.originalType || "unknown",
|
|
4124
|
+
text: "",
|
|
4125
|
+
annotations: [],
|
|
4126
|
+
attributes: {}
|
|
4127
|
+
};
|
|
4128
|
+
}
|
|
4110
4129
|
function editorBlockToHMBlock(editorBlock) {
|
|
4111
4130
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
4131
|
+
if (editorBlock.type === "unknown") {
|
|
4132
|
+
return unknownEditorBlockToHMBlock(editorBlock);
|
|
4133
|
+
}
|
|
4112
4134
|
const blockType = toHMBlockType(editorBlock.type);
|
|
4113
4135
|
if (!blockType) throw new Error("Unsupported block type " + editorBlock.type);
|
|
4114
4136
|
let block = {
|