mirror of
https://github.com/OpenCut-app/OpenCut.git
synced 2026-07-13 21:52:53 +02:00
Major features and improvements: * **Clip Effects**: * Added UI in Properties Panel to manage effects on video/image clips (add, remove, toggle, reorder). * Implemented dynamic parameter fields for effects. * Added support for keyframing effect parameters. * **Assets Panel**: * Added sorting options: Name, Type, Duration, and File Size. * Persisted view preferences (grid/list mode, sort order) to local storage. * Refactored media item rendering and drag interactions. * **Timeline & Interaction**: * **Keyframe Dragging**: Added ability to drag keyframes directly on the timeline element. * **Resizing**: Improved resize logic to respect neighboring clips (prevents overlaps). * **Visuals**: Implemented tiled background rendering for video/image clips on the timeline. * **Shortcuts**: Added "Deselect All" action bound to the `Escape` key. * **Fixes**: Corrected drag-and-drop coordinate calculations when the timeline track area is scrolled. * **Text Elements**: * Refactored text background storage to use an explicit `enabled` flag. * Added `V8toV9` storage migration to update existing projects. * **Architecture**: * Moved export state management to `ProjectManager` for better lifecycle handling. * Refactored `PropertiesPanel` sections to be more composable (custom headers, borders).
107 lines
2.4 KiB
TypeScript
107 lines
2.4 KiB
TypeScript
import type { ReactNode } from "react";
|
|
import Link from "next/link";
|
|
import { cn } from "@/utils/ui";
|
|
import { getSectionTitle, groupAndOrderChanges } from "../utils";
|
|
import type { Release } from "../utils";
|
|
|
|
export function ReleaseArticle({
|
|
variant,
|
|
isLatest,
|
|
children,
|
|
}: {
|
|
variant: "list" | "detail";
|
|
isLatest?: boolean;
|
|
children: ReactNode;
|
|
}) {
|
|
if (variant === "list") {
|
|
return (
|
|
<article className="relative sm:pl-10">
|
|
<div aria-hidden className="absolute left-0 top-[3px] hidden sm:block">
|
|
<div
|
|
className={cn(
|
|
"size-[11px] rounded-full border-[1.5px]",
|
|
isLatest
|
|
? "border-foreground bg-foreground"
|
|
: "border-muted-foreground/30 bg-background",
|
|
)}
|
|
/>
|
|
</div>
|
|
<div className="flex flex-col gap-5">{children}</div>
|
|
</article>
|
|
);
|
|
}
|
|
|
|
return <article className="flex flex-col gap-8">{children}</article>;
|
|
}
|
|
|
|
export function ReleaseMeta({ release }: { release: Release }) {
|
|
return (
|
|
<span className="text-sm font-medium tracking-widest text-muted-foreground">
|
|
{release.version} — {release.date}
|
|
</span>
|
|
);
|
|
}
|
|
|
|
const titleSizes: Record<"h1" | "h2", string> = {
|
|
h1: "text-4xl",
|
|
h2: "text-2xl",
|
|
};
|
|
|
|
export function ReleaseTitle({
|
|
as: As,
|
|
href,
|
|
children,
|
|
}: {
|
|
as: "h1" | "h2";
|
|
href?: string;
|
|
children: ReactNode;
|
|
}) {
|
|
return (
|
|
<As className={cn("font-bold tracking-tight", titleSizes[As])}>
|
|
{href ? (
|
|
<Link href={href} className="hover:underline underline-offset-4">
|
|
{children}
|
|
</Link>
|
|
) : (
|
|
children
|
|
)}
|
|
</As>
|
|
);
|
|
}
|
|
|
|
export function ReleaseDescription({ children }: { children: ReactNode }) {
|
|
return (
|
|
<p className="text-base text-foreground leading-relaxed max-w-xl">
|
|
{children}
|
|
</p>
|
|
);
|
|
}
|
|
|
|
export function ReleaseChanges({ release }: { release: Release }) {
|
|
const { grouped, orderedTypes } = groupAndOrderChanges({
|
|
changes: release.changes,
|
|
});
|
|
|
|
return (
|
|
<div className="flex flex-col gap-4">
|
|
{orderedTypes.map((type) => (
|
|
<div key={type} className="flex flex-col gap-1.5">
|
|
<h3 className="text-base font-semibold text-foreground">
|
|
{getSectionTitle(type)}:
|
|
</h3>
|
|
<ul className="list-disc pl-5 space-y-1.5">
|
|
{grouped[type].map((change) => (
|
|
<li
|
|
key={change.text}
|
|
className="text-base text-foreground leading-relaxed"
|
|
>
|
|
{change.text}
|
|
</li>
|
|
))}
|
|
</ul>
|
|
</div>
|
|
))}
|
|
</div>
|
|
);
|
|
}
|