mulmocast 2.2.2 → 2.2.3

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.
@@ -42,9 +42,19 @@ export const textBlockSchema = z.object({
42
42
  fontSize: z.number().optional(),
43
43
  color: accentColorKeySchema.optional(),
44
44
  });
45
+ /** Sub-bullet item: plain string or object with text */
46
+ const subBulletItemSchema = z.union([z.string(), z.object({ text: z.string() })]);
47
+ /** Bullet item: plain string or object with text and optional sub-items (2 levels max) */
48
+ export const bulletItemSchema = z.union([
49
+ z.string(),
50
+ z.object({
51
+ text: z.string(),
52
+ items: z.array(subBulletItemSchema).optional(),
53
+ }),
54
+ ]);
45
55
  export const bulletsBlockSchema = z.object({
46
56
  type: z.literal("bullets"),
47
- items: z.array(z.string()),
57
+ items: z.array(bulletItemSchema),
48
58
  ordered: z.boolean().optional(),
49
59
  icon: z.string().optional(),
50
60
  });
@@ -93,7 +103,25 @@ export const mermaidBlockSchema = z.object({
93
103
  code: z.string(),
94
104
  title: z.string().optional(),
95
105
  });
96
- export const contentBlockSchema = z.discriminatedUnion("type", [
106
+ export const tableCellValueSchema = z.union([
107
+ z.string(),
108
+ z.object({
109
+ text: z.string(),
110
+ color: accentColorKeySchema.optional(),
111
+ bold: z.boolean().optional(),
112
+ badge: z.boolean().optional(),
113
+ }),
114
+ ]);
115
+ export const tableBlockSchema = z.object({
116
+ type: z.literal("table"),
117
+ title: z.string().optional(),
118
+ headers: z.array(z.string()).optional(),
119
+ rows: z.array(z.array(tableCellValueSchema)),
120
+ rowHeaders: z.boolean().optional(),
121
+ striped: z.boolean().optional(),
122
+ });
123
+ /** Block schemas shared between contentBlockSchema and nonSectionContentBlockSchema */
124
+ const baseBlockSchemas = [
97
125
  textBlockSchema,
98
126
  bulletsBlockSchema,
99
127
  codeBlockSchema,
@@ -104,7 +132,19 @@ export const contentBlockSchema = z.discriminatedUnion("type", [
104
132
  imageRefBlockSchema,
105
133
  chartBlockSchema,
106
134
  mermaidBlockSchema,
107
- ]);
135
+ tableBlockSchema,
136
+ ];
137
+ /** All content block types except section (used inside section to prevent recursion) */
138
+ const nonSectionContentBlockSchema = z.discriminatedUnion("type", [...baseBlockSchemas]);
139
+ export const sectionBlockSchema = z.object({
140
+ type: z.literal("section"),
141
+ label: z.string(),
142
+ color: accentColorKeySchema.optional(),
143
+ content: z.array(nonSectionContentBlockSchema).optional(),
144
+ text: z.string().optional(),
145
+ sidebar: z.boolean().optional(),
146
+ });
147
+ export const contentBlockSchema = z.discriminatedUnion("type", [...baseBlockSchemas, sectionBlockSchema]);
108
148
  // ═══════════════════════════════════════════════════════════
109
149
  // Shared Components
110
150
  // ═══════════════════════════════════════════════════════════
@@ -244,10 +284,12 @@ export const splitPanelSchema = z.object({
244
284
  title: z.string().optional(),
245
285
  subtitle: z.string().optional(),
246
286
  label: z.string().optional(),
287
+ labelBadge: z.boolean().optional(),
247
288
  accentColor: accentColorKeySchema.optional(),
248
289
  content: z.array(contentBlockSchema).optional(),
249
290
  dark: z.boolean().optional(),
250
291
  ratio: z.number().optional(),
292
+ valign: z.enum(["top", "center", "bottom"]).optional(),
251
293
  });
252
294
  export const splitSlideSchema = z.object({
253
295
  layout: z.literal("split"),
@@ -287,14 +329,6 @@ export const matrixSlideSchema = z.object({
287
329
  cells: z.array(matrixCellSchema),
288
330
  });
289
331
  // ─── table ───
290
- export const tableCellValueSchema = z.union([
291
- z.string(),
292
- z.object({
293
- text: z.string(),
294
- color: accentColorKeySchema.optional(),
295
- bold: z.boolean().optional(),
296
- }),
297
- ]);
298
332
  export const tableSlideSchema = z.object({
299
333
  layout: z.literal("table"),
300
334
  ...slideBaseFields,