mulmocast 2.6.18 → 2.6.20

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.
Files changed (32) hide show
  1. package/lib/methods/mulmo_presentation_style.d.ts +18 -0
  2. package/lib/methods/mulmo_presentation_style.js +23 -0
  3. package/lib/types/schema.d.ts +468 -0
  4. package/lib/utils/context.d.ts +52 -0
  5. package/lib/utils/image_plugins/slide.js +7 -4
  6. package/package.json +5 -5
  7. package/scripts/test/cinematic_showcase.json +0 -1356
  8. package/scripts/test/golden_age_of_discovery.json +0 -270
  9. package/scripts/test/image-2.png +0 -0
  10. package/scripts/test/img_detector.png +0 -0
  11. package/scripts/test/img_higgs.png +0 -0
  12. package/scripts/test/img_lhc.png +0 -0
  13. package/scripts/test/macoro_anime_proto.json +0 -120
  14. package/scripts/test/minimum_beats_completed.json +0 -45
  15. package/scripts/test/test_all_elevenlabs_tts_model.json +0 -111
  16. package/scripts/test/test_all_gemini_tts_model.json +0 -433
  17. package/scripts/test/test_all_image.json +0 -49
  18. package/scripts/test/test_all_movie.json +0 -33
  19. package/scripts/test/test_captions_2.json +0 -31
  20. package/scripts/test/test_genai2.json +0 -25
  21. package/scripts/test/test_lipsync5.json +0 -66
  22. package/scripts/test/test_reference.json +0 -0
  23. package/scripts/test/test_slide_image_ref_gemini_en.json +0 -289
  24. package/scripts/test/test_slide_showcase_corporate.json +0 -497
  25. package/scripts/test/test_slide_showcase_creative.json +0 -545
  26. package/scripts/test/test_slide_showcase_minimal.json +0 -501
  27. package/scripts/test/test_slide_showcase_pop.json +0 -547
  28. package/scripts/test/test_slide_showcase_warm.json +0 -486
  29. package/scripts/test/test_wipe_simple.json +0 -37
  30. package/scripts/test/zenn_combined_example.json +0 -39
  31. package/scripts/test/zenn_layout_samples.json +0 -92
  32. package/scripts/test/zenn_markdown_demo.json +0 -79
@@ -3,11 +3,29 @@
3
3
  * (No Node.js built-ins like fs, path, dotenv, etc.)
4
4
  * Works in both Node.js and modern browsers.
5
5
  */
6
+ import type { SlideTheme } from "@mulmocast/deck";
6
7
  import { MulmoCanvasDimension, MulmoBeat, Text2SpeechProvider, Text2ImageAgentInfo, Text2HtmlAgentInfo, BeatMediaType, MulmoPresentationStyle, SpeakerData, Text2ImageProvider, MulmoStudioContext, MulmoTransition } from "../types/index.js";
7
8
  export declare const MulmoPresentationStyleMethods: {
8
9
  getCanvasSize(presentationStyle: MulmoPresentationStyle): MulmoCanvasDimension;
9
10
  getAllSpeechProviders(presentationStyle: MulmoPresentationStyle): Set<Text2SpeechProvider>;
10
11
  getTextSlideStyle(presentationStyle: MulmoPresentationStyle, beat: MulmoBeat): string;
12
+ /**
13
+ * Resolve the effective theme for a slide-typed beat.
14
+ * Priority (high → low):
15
+ * 1. `beat.image.theme` — per-beat override
16
+ * 2. `presentationStyle.slideParams.theme` — deck-level default
17
+ * 3. `slideThemes.corporate` — built-in fallback
18
+ *
19
+ * Returns the corporate fallback (without throwing) when called on a
20
+ * non-slide beat, so callers driving the deck preview from a mixed
21
+ * script can hand any beat in without a special-case check.
22
+ *
23
+ * Exposed as a method so the editor (`@mulmocast/deck-web`) can
24
+ * import it via `mulmocast/browser` and surface the same priority
25
+ * its render-time slide.ts already enforces — closing the editor
26
+ * vs. PDF/movie theme mismatch reported on mulmoclaude#1622.
27
+ */
28
+ getResolvedSlideTheme(presentationStyle: MulmoPresentationStyle, beat: MulmoBeat): SlideTheme;
11
29
  getDefaultSpeaker(presentationStyle: MulmoPresentationStyle): string;
12
30
  getSpeaker(context: MulmoStudioContext, beat: MulmoBeat, targetLang: string | undefined): SpeakerData;
13
31
  getMovieTransition(context: MulmoStudioContext, beat: MulmoBeat): MulmoTransition | null;
@@ -5,6 +5,7 @@
5
5
  */
6
6
  import { isNull } from "graphai";
7
7
  import { userAssert } from "../utils/utils.js";
8
+ import { slideThemes } from "../data/slideThemes.js";
8
9
  import { text2ImageProviderSchema, text2HtmlImageProviderSchema, text2MovieProviderSchema, text2SpeechProviderSchema, mulmoCanvasDimensionSchema, mulmoTransitionSchema, } from "../types/schema.js";
9
10
  import { provider2ImageAgent, provider2MovieAgent, provider2LLMAgent, provider2TTSAgent, provider2SoundEffectAgent, provider2LipSyncAgent, defaultProviders, } from "../types/provider2agent.js";
10
11
  const defaultTextSlideStyles = [
@@ -40,6 +41,28 @@ export const MulmoPresentationStyleMethods = {
40
41
  // This code allows us to support both string and array of strings for cssStyles
41
42
  return [...defaultTextSlideStyles, ...[styles], ...[extraStyles]].flat().join("\n");
42
43
  },
44
+ /**
45
+ * Resolve the effective theme for a slide-typed beat.
46
+ * Priority (high → low):
47
+ * 1. `beat.image.theme` — per-beat override
48
+ * 2. `presentationStyle.slideParams.theme` — deck-level default
49
+ * 3. `slideThemes.corporate` — built-in fallback
50
+ *
51
+ * Returns the corporate fallback (without throwing) when called on a
52
+ * non-slide beat, so callers driving the deck preview from a mixed
53
+ * script can hand any beat in without a special-case check.
54
+ *
55
+ * Exposed as a method so the editor (`@mulmocast/deck-web`) can
56
+ * import it via `mulmocast/browser` and surface the same priority
57
+ * its render-time slide.ts already enforces — closing the editor
58
+ * vs. PDF/movie theme mismatch reported on mulmoclaude#1622.
59
+ */
60
+ getResolvedSlideTheme(presentationStyle, beat) {
61
+ if (beat.image?.type === "slide" && beat.image.theme) {
62
+ return beat.image.theme;
63
+ }
64
+ return presentationStyle.slideParams?.theme ?? slideThemes.corporate;
65
+ },
43
66
  getDefaultSpeaker(presentationStyle) {
44
67
  const speakers = presentationStyle?.speechParams?.speakers ?? {};
45
68
  const keys = Object.keys(speakers).sort();