@@ -7,14 +7,15 @@ import {
77 type MutableRefObject ,
88 type PointerEvent as ReactPointerEvent ,
99} from "react" ;
10- import { Tooltip } from "./ui" ;
1110import { PropertyPanel } from "./editor/PropertyPanel" ;
1211import { LayersPanel } from "./editor/LayersPanel" ;
1312import { CaptionPropertyPanel } from "../captions/components/CaptionPropertyPanel" ;
1413import { BlockParamsPanel } from "./editor/BlockParamsPanel" ;
1514import { RenderQueue } from "./renders/RenderQueue" ;
1615import { SlideshowPanel } from "./panels/SlideshowPanel" ;
1716import type { SceneInfo } from "./panels/SlideshowPanel" ;
17+ import { VariablesPanel } from "./panels/VariablesPanel" ;
18+ import { PanelTabButton } from "./PanelTabButton" ;
1819import type { RenderJob } from "./renders/useRenderQueue" ;
1920import type { BlockParam } from "@hyperframes/core/registry" ;
2021import type { IframeWindow } from "../player/lib/playbackTypes" ;
@@ -461,64 +462,38 @@ export function StudioRightPanel({
461462 < div className = "flex min-w-0 items-center gap-1 overflow-hidden border-b border-neutral-800 px-3 py-2" >
462463 { STUDIO_INSPECTOR_PANELS_ENABLED && (
463464 < >
464- < Tooltip label = "Element styles and properties" side = "bottom" >
465- < button
466- type = "button"
467- onClick = { ( ) => handleInspectorPaneButtonClick ( "design" ) }
468- aria-pressed = { designPaneOpen }
469- className = { `h-8 rounded-xl px-3 text-[11px] font-medium transition-colors active:scale-[0.98] ${
470- designPaneOpen
471- ? "bg-neutral-800 text-white"
472- : "text-neutral-500 hover:bg-neutral-800/70 hover:text-neutral-200"
473- } `}
474- >
475- Design
476- </ button >
477- </ Tooltip >
478- < Tooltip label = "Composition layer stack" side = "bottom" >
479- < button
480- type = "button"
481- onClick = { ( ) => handleInspectorPaneButtonClick ( "layers" ) }
482- aria-pressed = { layersPaneOpen }
483- className = { `h-8 rounded-xl px-3 text-[11px] font-medium transition-colors active:scale-[0.98] ${
484- layersPaneOpen
485- ? "bg-neutral-800 text-white"
486- : "text-neutral-500 hover:bg-neutral-800/70 hover:text-neutral-200"
487- } `}
488- >
489- Layers
490- </ button >
491- </ Tooltip >
465+ < PanelTabButton
466+ label = "Design"
467+ tooltip = "Element styles and properties"
468+ active = { designPaneOpen }
469+ onClick = { ( ) => handleInspectorPaneButtonClick ( "design" ) }
470+ />
471+ < PanelTabButton
472+ label = "Layers"
473+ tooltip = "Composition layer stack"
474+ active = { layersPaneOpen }
475+ onClick = { ( ) => handleInspectorPaneButtonClick ( "layers" ) }
476+ />
492477 </ >
493478 ) }
494- < Tooltip label = "Render queue and exports" side = "bottom" >
495- < button
496- type = "button"
497- onClick = { ( ) => setRightPanelTab ( "renders" ) }
498- aria-pressed = { rightPanelTab === "renders" }
499- className = { `h-8 rounded-xl px-3 text-[11px] font-medium transition-colors active:scale-[0.98] ${
500- rightPanelTab === "renders"
501- ? "bg-neutral-800 text-white"
502- : "text-neutral-500 hover:bg-neutral-800/70 hover:text-neutral-200"
503- } `}
504- >
505- { renderJobs . length > 0 ? `Renders (${ renderJobs . length } )` : "Renders" }
506- </ button >
507- </ Tooltip >
508- < Tooltip label = "Slideshow branching editor" side = "bottom" >
509- < button
510- type = "button"
511- onClick = { ( ) => setRightPanelTab ( "slideshow" ) }
512- aria-pressed = { rightPanelTab === "slideshow" }
513- className = { `h-8 rounded-xl px-3 text-[11px] font-medium transition-colors active:scale-[0.98] ${
514- rightPanelTab === "slideshow"
515- ? "bg-neutral-800 text-white"
516- : "text-neutral-500 hover:bg-neutral-800/70 hover:text-neutral-200"
517- } `}
518- >
519- Slideshow
520- </ button >
521- </ Tooltip >
479+ < PanelTabButton
480+ label = { renderJobs . length > 0 ? `Renders (${ renderJobs . length } )` : "Renders" }
481+ tooltip = "Render queue and exports"
482+ active = { rightPanelTab === "renders" }
483+ onClick = { ( ) => setRightPanelTab ( "renders" ) }
484+ />
485+ < PanelTabButton
486+ label = "Slideshow"
487+ tooltip = "Slideshow branching editor"
488+ active = { rightPanelTab === "slideshow" }
489+ onClick = { ( ) => setRightPanelTab ( "slideshow" ) }
490+ />
491+ < PanelTabButton
492+ label = "Variables"
493+ tooltip = "Template variables — declare, preview with values"
494+ active = { rightPanelTab === "variables" }
495+ onClick = { ( ) => setRightPanelTab ( "variables" ) }
496+ />
522497 </ div >
523498 < div className = "min-h-0 min-w-0 flex-1 overflow-hidden" >
524499 { rightPanelTab === "block-params" && activeBlockParams ? (
@@ -535,6 +510,13 @@ export function StudioRightPanel({
535510 onPersist = { onPersistSlideshow }
536511 onPersistNotes = { onPersistSlideshowNotes }
537512 />
513+ ) : rightPanelTab === "variables" ? (
514+ < VariablesPanel
515+ sdkSession = { sdkSession }
516+ reloadPreview = { reloadPreview }
517+ domEditSaveTimestampRef = { domEditSaveTimestampRef }
518+ recordEdit = { recordEdit }
519+ />
538520 ) : layersPaneOpen && designPaneOpen ? (
539521 < div ref = { splitContainerRef } className = "flex h-full min-h-0 min-w-0 flex-col" >
540522 < div
0 commit comments