mulmocast 2.1.28 → 2.1.29

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.
@@ -182,6 +182,7 @@ export declare const mediaSourceMermaidSchema: z.ZodDiscriminatedUnion<[z.ZodObj
182
182
  export declare const mulmoMarkdownMediaSchema: z.ZodObject<{
183
183
  type: z.ZodLiteral<"markdown">;
184
184
  markdown: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
185
+ style: z.ZodOptional<z.ZodString>;
185
186
  }, z.core.$strict>;
186
187
  export declare const mulmoImageMediaSchema: z.ZodObject<{
187
188
  type: z.ZodLiteral<"image">;
@@ -271,6 +272,7 @@ export declare const mulmoVisionMediaSchema: z.ZodObject<{
271
272
  export declare const mulmoImageAssetSchema: z.ZodUnion<readonly [z.ZodObject<{
272
273
  type: z.ZodLiteral<"markdown">;
273
274
  markdown: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
275
+ style: z.ZodOptional<z.ZodString>;
274
276
  }, z.core.$strict>, z.ZodObject<{
275
277
  type: z.ZodLiteral<"web">;
276
278
  url: z.ZodURL;
@@ -797,6 +799,7 @@ export declare const mulmoBeatSchema: z.ZodObject<{
797
799
  image: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
798
800
  type: z.ZodLiteral<"markdown">;
799
801
  markdown: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
802
+ style: z.ZodOptional<z.ZodString>;
800
803
  }, z.core.$strict>, z.ZodObject<{
801
804
  type: z.ZodLiteral<"web">;
802
805
  url: z.ZodURL;
@@ -1981,6 +1984,7 @@ export declare const mulmoScriptSchema: z.ZodObject<{
1981
1984
  image: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
1982
1985
  type: z.ZodLiteral<"markdown">;
1983
1986
  markdown: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
1987
+ style: z.ZodOptional<z.ZodString>;
1984
1988
  }, z.core.$strict>, z.ZodObject<{
1985
1989
  type: z.ZodLiteral<"web">;
1986
1990
  url: z.ZodURL;
@@ -2869,6 +2873,7 @@ export declare const mulmoStudioSchema: z.ZodObject<{
2869
2873
  image: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
2870
2874
  type: z.ZodLiteral<"markdown">;
2871
2875
  markdown: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
2876
+ style: z.ZodOptional<z.ZodString>;
2872
2877
  }, z.core.$strict>, z.ZodObject<{
2873
2878
  type: z.ZodLiteral<"web">;
2874
2879
  url: z.ZodURL;
@@ -79,6 +79,7 @@ export const mulmoMarkdownMediaSchema = z
79
79
  .object({
80
80
  type: z.literal("markdown"),
81
81
  markdown: stringOrStringArray,
82
+ style: z.string().optional(),
82
83
  })
83
84
  .strict();
84
85
  const mulmoWebMediaSchema = z
@@ -275,6 +275,7 @@ export declare const createStudioData: (_mulmoScript: MulmoScript, fileName: str
275
275
  } | {
276
276
  type: "markdown";
277
277
  markdown: string | string[];
278
+ style?: string | undefined;
278
279
  } | {
279
280
  type: "web";
280
281
  url: string;
@@ -931,6 +932,7 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
931
932
  } | {
932
933
  type: "markdown";
933
934
  markdown: string | string[];
935
+ style?: string | undefined;
934
936
  } | {
935
937
  type: "web";
936
938
  url: string;
@@ -11,8 +11,8 @@ export const renderHTMLToImage = async (html, outputPath, width, height, isMerma
11
11
  await page.setContent(html);
12
12
  // Adjust page settings if needed (like width, height, etc.)
13
13
  await page.setViewport({ width, height });
14
- // height:100% ensures background fills viewport; background:white prevents transparent areas
15
- await page.addStyleTag({ content: "html,body{height:100%;margin:0;padding:0;overflow:hidden;background:white}" });
14
+ // height:100% ensures background fills viewport; only reset html, let body styles come from custom CSS
15
+ await page.addStyleTag({ content: "html{height:100%;margin:0;padding:0;overflow:hidden}" });
16
16
  if (isMermaid) {
17
17
  await page.waitForFunction(() => {
18
18
  const element = document.querySelector(".mermaid");
@@ -1,5 +1,6 @@
1
1
  import { renderMarkdownToImage } from "../html_render.js";
2
2
  import { parrotingImagePath } from "./utils.js";
3
+ import { getMarkdownStyle } from "../../data/markdownStyles.js";
3
4
  import { marked } from "marked";
4
5
  export const imageType = "markdown";
5
6
  const processMarkdown = async (params) => {
@@ -7,7 +8,11 @@ const processMarkdown = async (params) => {
7
8
  if (!beat.image || beat.image.type !== imageType)
8
9
  return;
9
10
  const markdown = dumpMarkdown(params) ?? "";
10
- await renderMarkdownToImage(markdown, textSlideStyle, imagePath, canvasSize.width, canvasSize.height);
11
+ // Use custom style if specified, otherwise use default textSlideStyle
12
+ const styleName = beat.image.style;
13
+ const customStyle = styleName ? getMarkdownStyle(styleName) : undefined;
14
+ const style = customStyle ? customStyle.css : textSlideStyle;
15
+ await renderMarkdownToImage(markdown, style, imagePath, canvasSize.width, canvasSize.height);
11
16
  return imagePath;
12
17
  };
13
18
  const dumpMarkdown = (params) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mulmocast",
3
- "version": "2.1.28",
3
+ "version": "2.1.29",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "lib/index.node.js",