@lalalic/markcut 3.2.60 → 3.2.61

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 (52) hide show
  1. package/README.md +20 -4
  2. package/bin/markcut +10 -0
  3. package/docs/developer-reference.md +41 -1
  4. package/package.json +8 -2
  5. package/recipes/markcut/map-cinematic-follow.json +17 -0
  6. package/recipes/markcut/map-location-reveal.json +17 -0
  7. package/recipes/markcut/map-route-journey.json +18 -0
  8. package/recipes/markcut/map-streetview-explore.json +17 -0
  9. package/skills/markcut/SKILL.md +5 -1
  10. package/skills/markcut/docs/markdown-descriptive.md +68 -1
  11. package/skills/markcut/docs/recipes.md +45 -0
  12. package/skills/markcut/references/mobile-event-preview-cli.md +9 -5
  13. package/src/descriptive/compiler.ts +38 -2
  14. package/src/descriptive/markdown.ts +30 -0
  15. package/src/descriptive/model3d.test.ts +38 -0
  16. package/src/editor-decision/cli.mjs +21 -0
  17. package/src/editor-decision/editor-decision.schema.json +41 -0
  18. package/src/editor-decision/index.mjs +115 -0
  19. package/src/editor-decision/index.test.mjs +63 -0
  20. package/src/mcp/bridge.mjs +46 -9
  21. package/src/mcp/compile-worker.mjs +2 -2
  22. package/src/mcp/mobile-review-cli.mjs +40 -33
  23. package/src/mcp/preview-mobile.css +21 -8
  24. package/src/mcp/preview.mjs +95 -57
  25. package/src/mcp/remote-assets.mjs +85 -7
  26. package/src/mcp/remotion-app.bundle.js +5013 -1117
  27. package/src/mcp/remotion-app.tsx +117 -10
  28. package/src/mcp/server.mjs +4 -2
  29. package/src/player/browser.tsx +1 -3
  30. package/src/player/bundle/player.js +73054 -17357
  31. package/src/player/components/HeaderBar.tsx +3 -1
  32. package/src/player/components/VariantBar.tsx +20 -21
  33. package/src/player/pipeline.mjs +133 -77
  34. package/src/player/server.mjs +43 -23
  35. package/src/recipes/catalog.mjs +115 -0
  36. package/src/recipes/cli.mjs +87 -0
  37. package/src/render/cli.mjs +38 -1
  38. package/src/schema/index.ts +21 -0
  39. package/src/types/Folder.tsx +2 -0
  40. package/src/types/Model3D.tsx +91 -0
  41. package/src/vision/cli.mjs +63 -50
  42. package/tests/mcp-editor-decisions-mobile.test.ts +35 -0
  43. package/tests/mcp-preview-bridge.test.ts +44 -3
  44. package/tests/mcp-preview-proxy-version.test.mjs +80 -0
  45. package/tests/mcp-preview.test.ts +41 -8
  46. package/tests/mcp-remote-assets.test.ts +17 -0
  47. package/tests/mcp-static-preview.test.ts +1 -1
  48. package/tests/mcp-video-selector.test.ts +55 -0
  49. package/tests/mobile-preview-cli.test.ts +10 -15
  50. package/tests/recipes-catalog.test.ts +141 -0
  51. package/tests/vision-generic-vtt-hooks.test.ts +7 -7
  52. package/tests/vision-normalized-metadata.test.ts +23 -0
@@ -16,9 +16,10 @@ interface HeaderBarProps {
16
16
  sseConnected?: boolean;
17
17
  /** UI locale */
18
18
  locale?: "en" | "zh";
19
+ selector?: React.ReactNode;
19
20
  }
20
21
 
21
- export function HeaderBar({ mode, sceneInfo, sseConnected, locale = "en" }: HeaderBarProps) {
22
+ export function HeaderBar({ mode, sceneInfo, sseConnected, locale = "en", selector }: HeaderBarProps) {
22
23
  const isZh = locale === "zh";
23
24
  const handleClose = React.useCallback(() => {
24
25
  navigator.sendBeacon("/api/shutdown", "{}");
@@ -49,6 +50,7 @@ export function HeaderBar({ mode, sceneInfo, sseConnected, locale = "en" }: Head
49
50
  </span>
50
51
  {/* Right: close button */}
51
52
  <div id="header-actions">
53
+ {selector}
52
54
  <button id="close-btn" title={isZh ? "关闭播放器并返回终端" : "Close player and return to terminal"} onClick={handleClose}>
53
55
  ✕
54
56
  </button>
@@ -1,8 +1,6 @@
1
1
  /**
2
- * VariantBar — variant switcher bar for the markcut player.
3
- *
4
- * Reads available variants from /api/video-info and renders clickable links.
5
- * Highlights the current variant based on window.VARIANT.
2
+ * Native preview video selector. All compiled outputs live under one control:
3
+ * original film, named Markdown variants and the optional Editor Decisions.
6
4
  */
7
5
  import * as React from "react";
8
6
 
@@ -12,28 +10,29 @@ export function VariantBar() {
12
10
 
13
11
  React.useEffect(() => {
14
12
  fetch("/api/video-info")
15
- .then((r) => r.json())
13
+ .then((response) => response.json())
16
14
  .then((info) => {
17
- if (info.variants && info.variants.length > 1) {
18
- setVariants(info.variants);
19
- }
15
+ if (Array.isArray(info.variants) && info.variants.length > 1) setVariants(info.variants);
20
16
  })
21
17
  .catch(() => {});
22
18
  }, []);
23
19
 
24
20
  if (variants.length <= 1) return null;
25
21
 
26
- return (
27
- <div id="variant-bar">
28
- {variants.map((v) => (
29
- <a
30
- key={v}
31
- href={`/${v === "default" ? "" : v}`}
32
- className={"variant-link" + (v === currentVariant ? " active" : "")}
33
- >
34
- {v}
35
- </a>
36
- ))}
37
- </div>
38
- );
22
+ return <select
23
+ id="video-selector"
24
+ aria-label="Video selector"
25
+ title="Select video"
26
+ value={currentVariant}
27
+ onChange={event => {
28
+ const variant=event.currentTarget.value;
29
+ window.location.assign(variant==="default"?"/":"/"+encodeURIComponent(variant));
30
+ }}
31
+ style={{maxWidth:190,minWidth:110,padding:"6px 28px 6px 10px",background:"#20252e",color:"#eee",
32
+ border:"1px solid #414955",borderRadius:8,fontSize:12,cursor:"pointer",textOverflow:"ellipsis"}}
33
+ >
34
+ {variants.map(variant =>
35
+ <option value={variant} key={variant}>{variant==="default"?"Original":variant==="editor-decisions"?"Editor Decisions":variant}</option>
36
+ )}
37
+ </select>;
39
38
  }