@seed-hypermedia/client 0.0.16 → 0.0.18
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.
|
@@ -153,7 +153,10 @@ var HMBlockVideoSchema = z.object({
|
|
|
153
153
|
attributes: z.object({
|
|
154
154
|
...parentBlockAttributes,
|
|
155
155
|
width: z.number().optional(),
|
|
156
|
-
name: z.string().optional()
|
|
156
|
+
name: z.string().optional(),
|
|
157
|
+
autoplay: z.boolean().optional(),
|
|
158
|
+
loop: z.boolean().optional(),
|
|
159
|
+
muted: z.boolean().optional()
|
|
157
160
|
}).optional().default({}),
|
|
158
161
|
link: z.string()
|
|
159
162
|
}).strict();
|
|
@@ -596,7 +599,8 @@ var HMDraftContentSchema = z.object({
|
|
|
596
599
|
content: z.array(z.any()),
|
|
597
600
|
// EditorBlock validation is handled elsewhere
|
|
598
601
|
deps: z.array(z.string().min(1)).default([]),
|
|
599
|
-
navigation: z.array(HMNavigationItemSchema).optional()
|
|
602
|
+
navigation: z.array(HMNavigationItemSchema).optional(),
|
|
603
|
+
cursorPosition: z.number().optional()
|
|
600
604
|
});
|
|
601
605
|
var HMDraftMetaBaseSchema = z.object({
|
|
602
606
|
id: z.string(),
|
package/dist/editor-types.d.ts
CHANGED
|
@@ -53,9 +53,14 @@ export interface EditorImageBlock extends EditorBaseBlock {
|
|
|
53
53
|
props: MediaBlockProps;
|
|
54
54
|
content: Array<HMInlineContent>;
|
|
55
55
|
}
|
|
56
|
+
export interface VideoBlockProps extends MediaBlockProps {
|
|
57
|
+
autoplay?: string;
|
|
58
|
+
loop?: string;
|
|
59
|
+
muted?: string;
|
|
60
|
+
}
|
|
56
61
|
export interface EditorVideoBlock extends EditorBaseBlock {
|
|
57
62
|
type: 'video';
|
|
58
|
-
props:
|
|
63
|
+
props: VideoBlockProps;
|
|
59
64
|
content: Array<HMInlineContent>;
|
|
60
65
|
}
|
|
61
66
|
export interface EditorFileBlock extends EditorBaseBlock {
|
package/dist/hm-types.d.ts
CHANGED
|
@@ -1472,6 +1472,9 @@ export declare const HMBlockVideoSchema: z.ZodObject<{
|
|
|
1472
1472
|
attributes: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
1473
1473
|
width: z.ZodOptional<z.ZodNumber>;
|
|
1474
1474
|
name: z.ZodOptional<z.ZodString>;
|
|
1475
|
+
autoplay: z.ZodOptional<z.ZodBoolean>;
|
|
1476
|
+
loop: z.ZodOptional<z.ZodBoolean>;
|
|
1477
|
+
muted: z.ZodOptional<z.ZodBoolean>;
|
|
1475
1478
|
childrenType: z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodLiteral<"Group">, z.ZodLiteral<"Ordered">, z.ZodLiteral<"Unordered">, z.ZodLiteral<"Blockquote">, z.ZodLiteral<"Grid">]>>>;
|
|
1476
1479
|
columnCount: z.ZodOptional<z.ZodNumber>;
|
|
1477
1480
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -1479,11 +1482,17 @@ export declare const HMBlockVideoSchema: z.ZodObject<{
|
|
|
1479
1482
|
childrenType?: "Group" | "Ordered" | "Unordered" | "Blockquote" | "Grid" | null | undefined;
|
|
1480
1483
|
columnCount?: number | undefined;
|
|
1481
1484
|
width?: number | undefined;
|
|
1485
|
+
autoplay?: boolean | undefined;
|
|
1486
|
+
loop?: boolean | undefined;
|
|
1487
|
+
muted?: boolean | undefined;
|
|
1482
1488
|
}, {
|
|
1483
1489
|
name?: string | undefined;
|
|
1484
1490
|
childrenType?: "Group" | "Ordered" | "Unordered" | "Blockquote" | "Grid" | null | undefined;
|
|
1485
1491
|
columnCount?: number | undefined;
|
|
1486
1492
|
width?: number | undefined;
|
|
1493
|
+
autoplay?: boolean | undefined;
|
|
1494
|
+
loop?: boolean | undefined;
|
|
1495
|
+
muted?: boolean | undefined;
|
|
1487
1496
|
}>>>;
|
|
1488
1497
|
link: z.ZodString;
|
|
1489
1498
|
id: z.ZodString;
|
|
@@ -1500,6 +1509,9 @@ export declare const HMBlockVideoSchema: z.ZodObject<{
|
|
|
1500
1509
|
childrenType?: "Group" | "Ordered" | "Unordered" | "Blockquote" | "Grid" | null | undefined;
|
|
1501
1510
|
columnCount?: number | undefined;
|
|
1502
1511
|
width?: number | undefined;
|
|
1512
|
+
autoplay?: boolean | undefined;
|
|
1513
|
+
loop?: boolean | undefined;
|
|
1514
|
+
muted?: boolean | undefined;
|
|
1503
1515
|
};
|
|
1504
1516
|
text?: "" | undefined;
|
|
1505
1517
|
annotations?: never[] | undefined;
|
|
@@ -1513,6 +1525,9 @@ export declare const HMBlockVideoSchema: z.ZodObject<{
|
|
|
1513
1525
|
childrenType?: "Group" | "Ordered" | "Unordered" | "Blockquote" | "Grid" | null | undefined;
|
|
1514
1526
|
columnCount?: number | undefined;
|
|
1515
1527
|
width?: number | undefined;
|
|
1528
|
+
autoplay?: boolean | undefined;
|
|
1529
|
+
loop?: boolean | undefined;
|
|
1530
|
+
muted?: boolean | undefined;
|
|
1516
1531
|
} | undefined;
|
|
1517
1532
|
text?: "" | undefined;
|
|
1518
1533
|
annotations?: never[] | undefined;
|
|
@@ -5820,6 +5835,9 @@ export declare const HMBlockKnownSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
5820
5835
|
attributes: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
5821
5836
|
width: z.ZodOptional<z.ZodNumber>;
|
|
5822
5837
|
name: z.ZodOptional<z.ZodString>;
|
|
5838
|
+
autoplay: z.ZodOptional<z.ZodBoolean>;
|
|
5839
|
+
loop: z.ZodOptional<z.ZodBoolean>;
|
|
5840
|
+
muted: z.ZodOptional<z.ZodBoolean>;
|
|
5823
5841
|
childrenType: z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodLiteral<"Group">, z.ZodLiteral<"Ordered">, z.ZodLiteral<"Unordered">, z.ZodLiteral<"Blockquote">, z.ZodLiteral<"Grid">]>>>;
|
|
5824
5842
|
columnCount: z.ZodOptional<z.ZodNumber>;
|
|
5825
5843
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -5827,11 +5845,17 @@ export declare const HMBlockKnownSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
5827
5845
|
childrenType?: "Group" | "Ordered" | "Unordered" | "Blockquote" | "Grid" | null | undefined;
|
|
5828
5846
|
columnCount?: number | undefined;
|
|
5829
5847
|
width?: number | undefined;
|
|
5848
|
+
autoplay?: boolean | undefined;
|
|
5849
|
+
loop?: boolean | undefined;
|
|
5850
|
+
muted?: boolean | undefined;
|
|
5830
5851
|
}, {
|
|
5831
5852
|
name?: string | undefined;
|
|
5832
5853
|
childrenType?: "Group" | "Ordered" | "Unordered" | "Blockquote" | "Grid" | null | undefined;
|
|
5833
5854
|
columnCount?: number | undefined;
|
|
5834
5855
|
width?: number | undefined;
|
|
5856
|
+
autoplay?: boolean | undefined;
|
|
5857
|
+
loop?: boolean | undefined;
|
|
5858
|
+
muted?: boolean | undefined;
|
|
5835
5859
|
}>>>;
|
|
5836
5860
|
link: z.ZodString;
|
|
5837
5861
|
id: z.ZodString;
|
|
@@ -5848,6 +5872,9 @@ export declare const HMBlockKnownSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
5848
5872
|
childrenType?: "Group" | "Ordered" | "Unordered" | "Blockquote" | "Grid" | null | undefined;
|
|
5849
5873
|
columnCount?: number | undefined;
|
|
5850
5874
|
width?: number | undefined;
|
|
5875
|
+
autoplay?: boolean | undefined;
|
|
5876
|
+
loop?: boolean | undefined;
|
|
5877
|
+
muted?: boolean | undefined;
|
|
5851
5878
|
};
|
|
5852
5879
|
text?: "" | undefined;
|
|
5853
5880
|
annotations?: never[] | undefined;
|
|
@@ -5861,6 +5888,9 @@ export declare const HMBlockKnownSchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
5861
5888
|
childrenType?: "Group" | "Ordered" | "Unordered" | "Blockquote" | "Grid" | null | undefined;
|
|
5862
5889
|
columnCount?: number | undefined;
|
|
5863
5890
|
width?: number | undefined;
|
|
5891
|
+
autoplay?: boolean | undefined;
|
|
5892
|
+
loop?: boolean | undefined;
|
|
5893
|
+
muted?: boolean | undefined;
|
|
5864
5894
|
} | undefined;
|
|
5865
5895
|
text?: "" | undefined;
|
|
5866
5896
|
annotations?: never[] | undefined;
|
|
@@ -7184,6 +7214,9 @@ export declare const HMBlockSchema: z.ZodUnion<[z.ZodDiscriminatedUnion<"type",
|
|
|
7184
7214
|
attributes: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
7185
7215
|
width: z.ZodOptional<z.ZodNumber>;
|
|
7186
7216
|
name: z.ZodOptional<z.ZodString>;
|
|
7217
|
+
autoplay: z.ZodOptional<z.ZodBoolean>;
|
|
7218
|
+
loop: z.ZodOptional<z.ZodBoolean>;
|
|
7219
|
+
muted: z.ZodOptional<z.ZodBoolean>;
|
|
7187
7220
|
childrenType: z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodLiteral<"Group">, z.ZodLiteral<"Ordered">, z.ZodLiteral<"Unordered">, z.ZodLiteral<"Blockquote">, z.ZodLiteral<"Grid">]>>>;
|
|
7188
7221
|
columnCount: z.ZodOptional<z.ZodNumber>;
|
|
7189
7222
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -7191,11 +7224,17 @@ export declare const HMBlockSchema: z.ZodUnion<[z.ZodDiscriminatedUnion<"type",
|
|
|
7191
7224
|
childrenType?: "Group" | "Ordered" | "Unordered" | "Blockquote" | "Grid" | null | undefined;
|
|
7192
7225
|
columnCount?: number | undefined;
|
|
7193
7226
|
width?: number | undefined;
|
|
7227
|
+
autoplay?: boolean | undefined;
|
|
7228
|
+
loop?: boolean | undefined;
|
|
7229
|
+
muted?: boolean | undefined;
|
|
7194
7230
|
}, {
|
|
7195
7231
|
name?: string | undefined;
|
|
7196
7232
|
childrenType?: "Group" | "Ordered" | "Unordered" | "Blockquote" | "Grid" | null | undefined;
|
|
7197
7233
|
columnCount?: number | undefined;
|
|
7198
7234
|
width?: number | undefined;
|
|
7235
|
+
autoplay?: boolean | undefined;
|
|
7236
|
+
loop?: boolean | undefined;
|
|
7237
|
+
muted?: boolean | undefined;
|
|
7199
7238
|
}>>>;
|
|
7200
7239
|
link: z.ZodString;
|
|
7201
7240
|
id: z.ZodString;
|
|
@@ -7212,6 +7251,9 @@ export declare const HMBlockSchema: z.ZodUnion<[z.ZodDiscriminatedUnion<"type",
|
|
|
7212
7251
|
childrenType?: "Group" | "Ordered" | "Unordered" | "Blockquote" | "Grid" | null | undefined;
|
|
7213
7252
|
columnCount?: number | undefined;
|
|
7214
7253
|
width?: number | undefined;
|
|
7254
|
+
autoplay?: boolean | undefined;
|
|
7255
|
+
loop?: boolean | undefined;
|
|
7256
|
+
muted?: boolean | undefined;
|
|
7215
7257
|
};
|
|
7216
7258
|
text?: "" | undefined;
|
|
7217
7259
|
annotations?: never[] | undefined;
|
|
@@ -7225,6 +7267,9 @@ export declare const HMBlockSchema: z.ZodUnion<[z.ZodDiscriminatedUnion<"type",
|
|
|
7225
7267
|
childrenType?: "Group" | "Ordered" | "Unordered" | "Blockquote" | "Grid" | null | undefined;
|
|
7226
7268
|
columnCount?: number | undefined;
|
|
7227
7269
|
width?: number | undefined;
|
|
7270
|
+
autoplay?: boolean | undefined;
|
|
7271
|
+
loop?: boolean | undefined;
|
|
7272
|
+
muted?: boolean | undefined;
|
|
7228
7273
|
} | undefined;
|
|
7229
7274
|
text?: "" | undefined;
|
|
7230
7275
|
annotations?: never[] | undefined;
|
|
@@ -12250,6 +12295,7 @@ export declare const HMDraftContentSchema: z.ZodObject<{
|
|
|
12250
12295
|
id: string;
|
|
12251
12296
|
text: string;
|
|
12252
12297
|
}>, "many">>;
|
|
12298
|
+
cursorPosition: z.ZodOptional<z.ZodNumber>;
|
|
12253
12299
|
}, "strip", z.ZodTypeAny, {
|
|
12254
12300
|
content: any[];
|
|
12255
12301
|
deps: string[];
|
|
@@ -12259,6 +12305,7 @@ export declare const HMDraftContentSchema: z.ZodObject<{
|
|
|
12259
12305
|
id: string;
|
|
12260
12306
|
text: string;
|
|
12261
12307
|
}[] | undefined;
|
|
12308
|
+
cursorPosition?: number | undefined;
|
|
12262
12309
|
}, {
|
|
12263
12310
|
content: any[];
|
|
12264
12311
|
deps?: string[] | undefined;
|
|
@@ -12268,6 +12315,7 @@ export declare const HMDraftContentSchema: z.ZodObject<{
|
|
|
12268
12315
|
id: string;
|
|
12269
12316
|
text: string;
|
|
12270
12317
|
}[] | undefined;
|
|
12318
|
+
cursorPosition?: number | undefined;
|
|
12271
12319
|
}>;
|
|
12272
12320
|
export type HMDraftContent = z.infer<typeof HMDraftContentSchema>;
|
|
12273
12321
|
export declare const HMDraftMetaSchema: z.ZodEffects<z.ZodObject<{
|
package/dist/hm-types.mjs
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
serializeBlockRange,
|
|
17
17
|
toNumber,
|
|
18
18
|
unpackHmId
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-E7GQKNCO.mjs";
|
|
20
20
|
|
|
21
21
|
// src/capability.ts
|
|
22
22
|
import { encode as cborEncode2 } from "@ipld/dag-cbor";
|
|
@@ -3541,6 +3541,15 @@ function editorBlockToHMBlock(editorBlock) {
|
|
|
3541
3541
|
if (editorBlock.props.name) {
|
|
3542
3542
|
blockVideo.attributes.name = editorBlock.props.name;
|
|
3543
3543
|
}
|
|
3544
|
+
if (editorBlock.props.autoplay === "true") {
|
|
3545
|
+
blockVideo.attributes.autoplay = true;
|
|
3546
|
+
}
|
|
3547
|
+
if (editorBlock.props.loop === "true") {
|
|
3548
|
+
blockVideo.attributes.loop = true;
|
|
3549
|
+
}
|
|
3550
|
+
if (editorBlock.props.muted === "true") {
|
|
3551
|
+
blockVideo.attributes.muted = true;
|
|
3552
|
+
}
|
|
3544
3553
|
}
|
|
3545
3554
|
const blockFile = block.type === "File" ? block : void 0;
|
|
3546
3555
|
if (blockFile && editorBlock.type == "file") {
|
|
@@ -3655,7 +3664,6 @@ function toEditorBlockType(hmBlockType) {
|
|
|
3655
3664
|
if (hmBlockType === "Button") return "button";
|
|
3656
3665
|
if (hmBlockType === "Embed") return "embed";
|
|
3657
3666
|
if (hmBlockType === "WebEmbed") return "web-embed";
|
|
3658
|
-
if (hmBlockType === "Nostr") return "nostr";
|
|
3659
3667
|
if (hmBlockType === "Query") return "query";
|
|
3660
3668
|
return "unknown";
|
|
3661
3669
|
}
|
|
@@ -3730,6 +3738,9 @@ function hmBlockToEditorBlock(block) {
|
|
|
3730
3738
|
;
|
|
3731
3739
|
out.props[key] = String(value);
|
|
3732
3740
|
}
|
|
3741
|
+
} else if (typeof value == "boolean") {
|
|
3742
|
+
;
|
|
3743
|
+
out.props[key] = String(value);
|
|
3733
3744
|
} else {
|
|
3734
3745
|
;
|
|
3735
3746
|
out.props[key] = value;
|