mirror of
https://github.com/OpenCut-app/OpenCut.git
synced 2026-07-13 21:52:53 +02:00
uhh
This commit is contained in:
+237
-133
@@ -319,106 +319,26 @@ use-element-selection.ts
|
|||||||
|
|
||||||
## apps/web/src/lib
|
## apps/web/src/lib
|
||||||
|
|
||||||
audio-utils.ts
|
browser-utils.ts
|
||||||
export type CollectedAudioElement = Omit<␍
|
export function isTypableDOMElement({␍
|
||||||
AudioElement,␍
|
element,␍
|
||||||
"type" | "mediaId" | "volume" | "id" | "name" | "sourceType" | "sourceU...
|
|
||||||
export function createAudioContext(): AudioContext
|
|
||||||
export interface DecodedAudio {
|
|
||||||
samples: Float32Array
|
|
||||||
sampleRate: number
|
|
||||||
}
|
|
||||||
export function decodeAudioToFloat32({␍
|
|
||||||
audioBlob,␍
|
|
||||||
}: {␍
|
}: {␍
|
||||||
audioBlob: Blob;␍
|
element: HTMLElement;␍
|
||||||
}): Promise<DecodedAudio>
|
|
||||||
export function collectAudioElements({␍
|
|
||||||
tracks,␍
|
|
||||||
mediaAssets,␍
|
|
||||||
audioContext,␍
|
|
||||||
}: {␍
|
|
||||||
tracks: TimelineTrack[];␍
|
|
||||||
mediaAssets: MediaAsset[];␍
|
|
||||||
audioContext: AudioContext;␍
|
|
||||||
}): Promise<CollectedAudioElement[]>
|
|
||||||
export function collectAudioMixSources({␍
|
|
||||||
tracks,␍
|
|
||||||
mediaAssets,␍
|
|
||||||
}: {␍
|
|
||||||
tracks: TimelineTrack[];␍
|
|
||||||
mediaAssets: MediaAsset[];␍
|
|
||||||
}): Promise<AudioMixSource[]>
|
|
||||||
export function createTimelineAudioBuffer({␍
|
|
||||||
tracks,␍
|
|
||||||
mediaAssets,␍
|
|
||||||
duration,␍
|
|
||||||
sampleRate = 44100,␍
|
|
||||||
}: {␍
|
|
||||||
tracks: TimelineTrack[];␍
|
|
||||||
mediaAssets: MediaAsset[];␍
|
|
||||||
duration: number;␍
|
|
||||||
sampleRate?: number;␍
|
|
||||||
}): Promise<AudioBuffer | null>
|
|
||||||
|
|
||||||
blog-query.ts
|
|
||||||
export function getPosts()
|
|
||||||
export function getTags()
|
|
||||||
export function getSinglePost({ slug }: { slug: string })
|
|
||||||
export function getCategories()
|
|
||||||
export function getAuthors()
|
|
||||||
export function processHtmlContent({ html }: { html: string }): Promise<string>
|
|
||||||
|
|
||||||
caption-utils.ts
|
|
||||||
export function buildCaptionChunks({␍
|
|
||||||
segments,␍
|
|
||||||
wordsPerChunk = DEFAULT_WORDS_PER_CAPTION,␍
|
|
||||||
minDuration = MIN_CAPTION_DURATION_SECONDS,␍
|
|
||||||
}: {␍
|
|
||||||
segments: TranscriptionSegment[];␍
|
|
||||||
wordsPerChunk?: number;␍
|
|
||||||
minDuration?: number;␍
|
|
||||||
}): CaptionChunk[]
|
|
||||||
|
|
||||||
drag-data.ts
|
|
||||||
export function setDragData({
|
|
||||||
dataTransfer,
|
|
||||||
dragData,
|
|
||||||
}: {
|
|
||||||
dataTransfer: DataTransfer;
|
|
||||||
dragData: TimelineDragData;
|
|
||||||
}): void
|
|
||||||
export function getDragData({
|
|
||||||
dataTransfer,
|
|
||||||
}: {
|
|
||||||
dataTransfer: DataTransfer;
|
|
||||||
}): TimelineDragData | null
|
|
||||||
export function hasDragData({
|
|
||||||
dataTransfer,
|
|
||||||
}: {
|
|
||||||
dataTransfer: DataTransfer;
|
|
||||||
}): boolean
|
}): boolean
|
||||||
export function clearDragData(): void
|
|
||||||
|
|
||||||
editor-utils.ts
|
date-utils.ts
|
||||||
export function dimensionToAspectRatio({
|
export function formatDate({ date }: { date: Date }): string
|
||||||
width,
|
|
||||||
height,
|
|
||||||
}: {
|
|
||||||
width: number;
|
|
||||||
height: number;
|
|
||||||
}): string
|
|
||||||
|
|
||||||
export.ts
|
export.ts
|
||||||
export function getExportMimeType({
|
export function getExportMimeType({
|
||||||
format,
|
format,
|
||||||
}: {
|
}: {
|
||||||
format: "mp4" | "webm";
|
format: ExportFormat;
|
||||||
}): string
|
}): string
|
||||||
export function getExportFileExtension({
|
export function getExportFileExtension({
|
||||||
format,
|
format,
|
||||||
}: {
|
}: {
|
||||||
format: "mp4" | "webm";
|
format: ExportFormat;
|
||||||
}): string
|
}): string
|
||||||
|
|
||||||
iconify-api.ts
|
iconify-api.ts
|
||||||
@@ -493,22 +413,21 @@ iconify-api.ts
|
|||||||
collections: Record<string, IconSet>␍
|
collections: Record<string, IconSet>␍
|
||||||
): string[]
|
): string[]
|
||||||
|
|
||||||
keyboard-utils.ts
|
math-utils.ts
|
||||||
|
export function clamp({␍
|
||||||
|
value,␍
|
||||||
|
min,␍
|
||||||
|
max,␍
|
||||||
|
}: {␍
|
||||||
|
value: number;␍
|
||||||
|
min: number;␍
|
||||||
|
max: number;␍
|
||||||
|
}): number
|
||||||
|
|
||||||
|
platform-utils.ts
|
||||||
export function getPlatformSpecialKey(): string
|
export function getPlatformSpecialKey(): string
|
||||||
export function getPlatformAlternateKey(): string
|
export function getPlatformAlternateKey(): string
|
||||||
|
export function isAppleDevice(): boolean
|
||||||
media-utils.ts
|
|
||||||
export const SUPPORTS_AUDIO: readonly MediaType[]
|
|
||||||
export function mediaSupportsAudio({␍
|
|
||||||
media,␍
|
|
||||||
}: {␍
|
|
||||||
media: MediaAsset | null | undefined;␍
|
|
||||||
}): boolean
|
|
||||||
export const getMediaTypeFromFile = ({ file }: { file: File }): MediaType | null => ...
|
|
||||||
|
|
||||||
rate-limit.ts
|
|
||||||
export const baseRateLimit
|
|
||||||
export function checkRateLimit({ request }: { request: Request })
|
|
||||||
|
|
||||||
scene-utils.ts
|
scene-utils.ts
|
||||||
export function getMainScene({ scenes }: { scenes: TScene[] }): TScene | null
|
export function getMainScene({ scenes }: { scenes: TScene[] }): TScene | null
|
||||||
@@ -550,6 +469,10 @@ scene-utils.ts
|
|||||||
updates: Partial<TScene>;␍
|
updates: Partial<TScene>;␍
|
||||||
}): TScene[]
|
}): TScene[]
|
||||||
|
|
||||||
|
string-utils.ts
|
||||||
|
export function capitalizeFirstLetter({ string }: { string: string })
|
||||||
|
export function uppercase({ string }: { string: string })
|
||||||
|
|
||||||
time-utils.ts
|
time-utils.ts
|
||||||
export function roundToFrame({␍
|
export function roundToFrame({␍
|
||||||
time,␍
|
time,␍
|
||||||
@@ -612,28 +535,6 @@ time-utils.ts
|
|||||||
fps: number;␍
|
fps: number;␍
|
||||||
}): number
|
}): number
|
||||||
|
|
||||||
utils.ts
|
|
||||||
export function cn(...inputs: ClassValue[]): string
|
|
||||||
export function formatDate({ date }: { date: Date }): string
|
|
||||||
export function capitalizeFirstLetter({ string }: { string: string })
|
|
||||||
export function uppercase({ string }: { string: string })
|
|
||||||
export function generateUUID(): string
|
|
||||||
export function isTypableDOMElement({␍
|
|
||||||
element,␍
|
|
||||||
}: {␍
|
|
||||||
element: HTMLElement;␍
|
|
||||||
}): boolean
|
|
||||||
export function isAppleDevice(): boolean
|
|
||||||
export function clamp({␍
|
|
||||||
value,␍
|
|
||||||
min,␍
|
|
||||||
max,␍
|
|
||||||
}: {␍
|
|
||||||
value: number;␍
|
|
||||||
min: number;␍
|
|
||||||
max: number;␍
|
|
||||||
}): number
|
|
||||||
|
|
||||||
## apps/web/src/lib/actions
|
## apps/web/src/lib/actions
|
||||||
|
|
||||||
definitions.ts
|
definitions.ts
|
||||||
@@ -698,6 +599,16 @@ server.ts
|
|||||||
export const auth
|
export const auth
|
||||||
export type Auth = typeof auth
|
export type Auth = typeof auth
|
||||||
|
|
||||||
|
## apps/web/src/lib/blog
|
||||||
|
|
||||||
|
query.ts
|
||||||
|
export function getPosts()
|
||||||
|
export function getTags()
|
||||||
|
export function getSinglePost({ slug }: { slug: string })
|
||||||
|
export function getCategories()
|
||||||
|
export function getAuthors()
|
||||||
|
export function processHtmlContent({ html }: { html: string }): Promise<string>
|
||||||
|
|
||||||
## apps/web/src/lib/db
|
## apps/web/src/lib/db
|
||||||
|
|
||||||
index.ts
|
index.ts
|
||||||
@@ -739,6 +650,15 @@ parser.ts
|
|||||||
|
|
||||||
## apps/web/src/lib/media
|
## apps/web/src/lib/media
|
||||||
|
|
||||||
|
media-utils.ts
|
||||||
|
export const SUPPORTS_AUDIO: readonly MediaType[]
|
||||||
|
export function mediaSupportsAudio({␍
|
||||||
|
media,␍
|
||||||
|
}: {␍
|
||||||
|
media: MediaAsset | null | undefined;␍
|
||||||
|
}): boolean
|
||||||
|
export const getMediaTypeFromFile = ({ file }: { file: File }): MediaType | null => ...
|
||||||
|
|
||||||
mediabunny.ts
|
mediabunny.ts
|
||||||
export const initFFmpeg = (): Promise<FFmpeg> => ...
|
export const initFFmpeg = (): Promise<FFmpeg> => ...
|
||||||
export function getVideoInfo({
|
export function getVideoInfo({
|
||||||
@@ -1006,6 +926,161 @@ zoom-utils.ts
|
|||||||
containerWidth: number | null | undefined;␍
|
containerWidth: number | null | undefined;␍
|
||||||
}): number
|
}): number
|
||||||
|
|
||||||
|
## apps/web/src/lib/utils
|
||||||
|
|
||||||
|
audio.ts
|
||||||
|
export type CollectedAudioElement = Omit<␍
|
||||||
|
AudioElement,␍
|
||||||
|
"type" | "mediaId" | "volume" | "id" | "name" | "sourceType" | "sourceU...
|
||||||
|
export function createAudioContext(): AudioContext
|
||||||
|
export interface DecodedAudio {
|
||||||
|
samples: Float32Array
|
||||||
|
sampleRate: number
|
||||||
|
}
|
||||||
|
export function decodeAudioToFloat32({␍
|
||||||
|
audioBlob,␍
|
||||||
|
}: {␍
|
||||||
|
audioBlob: Blob;␍
|
||||||
|
}): Promise<DecodedAudio>
|
||||||
|
export function collectAudioElements({␍
|
||||||
|
tracks,␍
|
||||||
|
mediaAssets,␍
|
||||||
|
audioContext,␍
|
||||||
|
}: {␍
|
||||||
|
tracks: TimelineTrack[];␍
|
||||||
|
mediaAssets: MediaAsset[];␍
|
||||||
|
audioContext: AudioContext;␍
|
||||||
|
}): Promise<CollectedAudioElement[]>
|
||||||
|
export function collectAudioMixSources({␍
|
||||||
|
tracks,␍
|
||||||
|
mediaAssets,␍
|
||||||
|
}: {␍
|
||||||
|
tracks: TimelineTrack[];␍
|
||||||
|
mediaAssets: MediaAsset[];␍
|
||||||
|
}): Promise<AudioMixSource[]>
|
||||||
|
export function createTimelineAudioBuffer({␍
|
||||||
|
tracks,␍
|
||||||
|
mediaAssets,␍
|
||||||
|
duration,␍
|
||||||
|
sampleRate = 44100,␍
|
||||||
|
}: {␍
|
||||||
|
tracks: TimelineTrack[];␍
|
||||||
|
mediaAssets: MediaAsset[];␍
|
||||||
|
duration: number;␍
|
||||||
|
sampleRate?: number;␍
|
||||||
|
}): Promise<AudioBuffer | null>
|
||||||
|
|
||||||
|
blog-query.ts
|
||||||
|
export function getPosts()
|
||||||
|
export function getTags()
|
||||||
|
export function getSinglePost({ slug }: { slug: string })
|
||||||
|
export function getCategories()
|
||||||
|
export function getAuthors()
|
||||||
|
export function processHtmlContent({ html }: { html: string }): Promise<string>
|
||||||
|
|
||||||
|
browser.ts
|
||||||
|
export function isTypableDOMElement({␍
|
||||||
|
element,␍
|
||||||
|
}: {␍
|
||||||
|
element: HTMLElement;␍
|
||||||
|
}): boolean
|
||||||
|
|
||||||
|
date.ts
|
||||||
|
export function formatDate({ date }: { date: Date }): string
|
||||||
|
|
||||||
|
editor.ts
|
||||||
|
export function dimensionToAspectRatio({
|
||||||
|
width,
|
||||||
|
height,
|
||||||
|
}: {
|
||||||
|
width: number;
|
||||||
|
height: number;
|
||||||
|
}): string
|
||||||
|
|
||||||
|
id.ts
|
||||||
|
export function generateUUID(): string
|
||||||
|
|
||||||
|
math.ts
|
||||||
|
export function clamp({␍
|
||||||
|
value,␍
|
||||||
|
min,␍
|
||||||
|
max,␍
|
||||||
|
}: {␍
|
||||||
|
value: number;␍
|
||||||
|
min: number;␍
|
||||||
|
max: number;␍
|
||||||
|
}): number
|
||||||
|
|
||||||
|
platform.ts
|
||||||
|
export function getPlatformSpecialKey(): string
|
||||||
|
export function getPlatformAlternateKey(): string
|
||||||
|
export function isAppleDevice(): boolean
|
||||||
|
|
||||||
|
time.ts
|
||||||
|
export function roundToFrame({␍
|
||||||
|
time,␍
|
||||||
|
fps,␍
|
||||||
|
}: {␍
|
||||||
|
time: number;␍
|
||||||
|
fps: number;␍
|
||||||
|
}): number
|
||||||
|
export function formatTimeCode({␍
|
||||||
|
timeInSeconds,␍
|
||||||
|
format = "HH:MM:SS:CS",␍
|
||||||
|
fps,␍
|
||||||
|
}: {␍
|
||||||
|
timeInSeconds: number;␍
|
||||||
|
format?: TTimeCode;␍
|
||||||
|
fps?: number;␍
|
||||||
|
}): string
|
||||||
|
export function parseTimeCode({␍
|
||||||
|
timeCode,␍
|
||||||
|
format = "HH:MM:SS:CS",␍
|
||||||
|
fps,␍
|
||||||
|
}: {␍
|
||||||
|
timeCode: string;␍
|
||||||
|
format?: TTimeCode;␍
|
||||||
|
fps: number;␍
|
||||||
|
}): number | null
|
||||||
|
export function guessTimeCodeFormat({␍
|
||||||
|
timeCode,␍
|
||||||
|
}: {␍
|
||||||
|
timeCode: string;␍
|
||||||
|
}): TTimeCode | null
|
||||||
|
export function timeToFrame({␍
|
||||||
|
time,␍
|
||||||
|
fps,␍
|
||||||
|
}: {␍
|
||||||
|
time: number;␍
|
||||||
|
fps: number;␍
|
||||||
|
}): number
|
||||||
|
export function frameToTime({␍
|
||||||
|
frame,␍
|
||||||
|
fps,␍
|
||||||
|
}: {␍
|
||||||
|
frame: number;␍
|
||||||
|
fps: number;␍
|
||||||
|
}): number
|
||||||
|
export function snapTimeToFrame({␍
|
||||||
|
time,␍
|
||||||
|
fps,␍
|
||||||
|
}: {␍
|
||||||
|
time: number;␍
|
||||||
|
fps: number;␍
|
||||||
|
}): number
|
||||||
|
export function getSnappedSeekTime({␍
|
||||||
|
rawTime,␍
|
||||||
|
duration,␍
|
||||||
|
fps,␍
|
||||||
|
}: {␍
|
||||||
|
rawTime: number;␍
|
||||||
|
duration: number;␍
|
||||||
|
fps: number;␍
|
||||||
|
}): number
|
||||||
|
|
||||||
|
ui.ts
|
||||||
|
export function cn(...inputs: ClassValue[]): string
|
||||||
|
|
||||||
## apps/web/src/services/media
|
## apps/web/src/services/media
|
||||||
|
|
||||||
video-cache.ts
|
video-cache.ts
|
||||||
@@ -1584,20 +1659,19 @@ transcription.ts
|
|||||||
segments: TranscriptionSegment[]
|
segments: TranscriptionSegment[]
|
||||||
language: string
|
language: string
|
||||||
}
|
}
|
||||||
export type TranscriptionStatus = | "idle"␍
|
export type TranscriptionStatus = | "idle"
|
||||||
| "loading-model"␍
|
| "loading-model"
|
||||||
| "ready"␍
|
| "transcribing"
|
||||||
| "transcribing"␍
|
| "complete"
|
||||||
| "complete"␍
|
| "error"
|
||||||
| "er...
|
|
||||||
export interface TranscriptionProgress {
|
export interface TranscriptionProgress {
|
||||||
status: TranscriptionStatus
|
status: TranscriptionStatus
|
||||||
progress: number
|
progress: number
|
||||||
message?: string
|
message?: string
|
||||||
}
|
}
|
||||||
export type TranscriptionModelId = | "whisper-tiny"␍
|
export type TranscriptionModelId = | "whisper-tiny"
|
||||||
| "whisper-small"␍
|
| "whisper-small"
|
||||||
| "whisper-medium"␍
|
| "whisper-medium"
|
||||||
| "whisper-large-v3-turbo"
|
| "whisper-large-v3-turbo"
|
||||||
export interface TranscriptionModel {
|
export interface TranscriptionModel {
|
||||||
id: TranscriptionModelId
|
id: TranscriptionModelId
|
||||||
@@ -1611,6 +1685,36 @@ transcription.ts
|
|||||||
duration: number
|
duration: number
|
||||||
}
|
}
|
||||||
|
|
||||||
|
## apps/web/src/utils
|
||||||
|
|
||||||
|
geometry.ts
|
||||||
|
export function dimensionToAspectRatio({␍
|
||||||
|
width,␍
|
||||||
|
height,␍
|
||||||
|
}: {␍
|
||||||
|
width: number;␍
|
||||||
|
height: number;␍
|
||||||
|
}): string
|
||||||
|
|
||||||
|
math.ts
|
||||||
|
export function clamp({␍
|
||||||
|
value,␍
|
||||||
|
min,␍
|
||||||
|
max,␍
|
||||||
|
}: {␍
|
||||||
|
value: number;␍
|
||||||
|
min: number;␍
|
||||||
|
max: number;␍
|
||||||
|
}): number
|
||||||
|
|
||||||
|
platform.ts
|
||||||
|
export function getPlatformSpecialKey(): string
|
||||||
|
export function getPlatformAlternateKey(): string
|
||||||
|
export function isAppleDevice(): boolean
|
||||||
|
|
||||||
|
ui.ts
|
||||||
|
export function cn(...inputs: ClassValue[]): string
|
||||||
|
|
||||||
## packages/ui/src/icons
|
## packages/ui/src/icons
|
||||||
|
|
||||||
index.tsx
|
index.tsx
|
||||||
|
|||||||
@@ -93,14 +93,14 @@ function buildSortParameter({ query, sort }: { query?: string; sort: string }) {
|
|||||||
return sort === "score" ? "score" : `${sort}_desc`;
|
return sort === "score" ? "score" : `${sort}_desc`;
|
||||||
}
|
}
|
||||||
|
|
||||||
function applyEffectsFilters({
|
function applyEffectsFilters({
|
||||||
params,
|
params,
|
||||||
min_rating,
|
min_rating,
|
||||||
commercial_only
|
commercial_only
|
||||||
}: {
|
}: {
|
||||||
params: URLSearchParams;
|
params: URLSearchParams;
|
||||||
min_rating: number;
|
min_rating: number;
|
||||||
commercial_only: boolean;
|
commercial_only: boolean;
|
||||||
}) {
|
}) {
|
||||||
params.append("filter", "duration:[* TO 30.0]");
|
params.append("filter", "duration:[* TO 30.0]");
|
||||||
params.append("filter", `avg_rating:[${min_rating} TO *]`);
|
params.append("filter", `avg_rating:[${min_rating} TO *]`);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Header } from "@/components/header";
|
import { Header } from "@/components/header";
|
||||||
import { Footer } from "@/components/footer";
|
import { Footer } from "@/components/footer";
|
||||||
import { cn } from "@/lib/utils";
|
import { cn } from "@/utils/ui";
|
||||||
|
|
||||||
interface BasePageProps {
|
interface BasePageProps {
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { BasePage } from "@/app/base-page";
|
import { BasePage } from "@/app/base-page";
|
||||||
import Prose from "@/components/ui/prose";
|
import Prose from "@/components/ui/prose";
|
||||||
import { Separator } from "@/components/ui/separator";
|
import { Separator } from "@/components/ui/separator";
|
||||||
import { getPosts, getSinglePost, processHtmlContent } from "@/lib/blog-query";
|
import { getPosts, getSinglePost, processHtmlContent } from "@/lib/blog/query";
|
||||||
import { Post, Author } from "@/types/blog";
|
import { Post, Author } from "@/types/blog";
|
||||||
import { Metadata } from "next";
|
import { Metadata } from "next";
|
||||||
import Image from "next/image";
|
import Image from "next/image";
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { Metadata } from "next";
|
|||||||
import { BasePage } from "@/app/base-page";
|
import { BasePage } from "@/app/base-page";
|
||||||
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
|
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { getPosts } from "@/lib/blog-query";
|
import { getPosts } from "@/lib/blog/query";
|
||||||
import { Post, Author } from "@/types/blog";
|
import { Post, Author } from "@/types/blog";
|
||||||
import { Separator } from "@/components/ui/separator";
|
import { Separator } from "@/components/ui/separator";
|
||||||
|
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ import { MigrationDialog } from "@/components/editor/migration-dialog";
|
|||||||
import type { TProjectMetadata } from "@/types/project";
|
import type { TProjectMetadata } from "@/types/project";
|
||||||
import { toast } from "sonner";
|
import { toast } from "sonner";
|
||||||
import { useEditor } from "@/hooks/use-editor";
|
import { useEditor } from "@/hooks/use-editor";
|
||||||
import { formatDate } from "@/lib/utils";
|
import { formatDate } from "@/utils/date";
|
||||||
|
|
||||||
export default function ProjectsPage() {
|
export default function ProjectsPage() {
|
||||||
const [isSelectionMode, setIsSelectionMode] = useState(false);
|
const [isSelectionMode, setIsSelectionMode] = useState(false);
|
||||||
@@ -419,14 +419,12 @@ function ProjectCard({
|
|||||||
|
|
||||||
const cardContent = (
|
const cardContent = (
|
||||||
<Card
|
<Card
|
||||||
className={`bg-background overflow-hidden border-none p-0 transition-all ${
|
className={`bg-background overflow-hidden border-none p-0 transition-all ${isSelectionMode && isSelected ? "ring-primary ring-2" : ""
|
||||||
isSelectionMode && isSelected ? "ring-primary ring-2" : ""
|
}`}
|
||||||
}`}
|
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
className={`bg-muted relative aspect-square transition-opacity ${
|
className={`bg-muted relative aspect-square transition-opacity ${isDropdownOpen ? "opacity-65" : "opacity-100 group-hover:opacity-65"
|
||||||
isDropdownOpen ? "opacity-65" : "opacity-100 group-hover:opacity-65"
|
}`}
|
||||||
}`}
|
|
||||||
>
|
>
|
||||||
{isSelectionMode && (
|
{isSelectionMode && (
|
||||||
<div className="absolute left-3 top-3 z-10">
|
<div className="absolute left-3 top-3 z-10">
|
||||||
@@ -477,11 +475,10 @@ function ProjectCard({
|
|||||||
aria-label="project options"
|
aria-label="project options"
|
||||||
variant="text"
|
variant="text"
|
||||||
size="sm"
|
size="sm"
|
||||||
className={`ml-2 size-6 shrink-0 p-0 transition-all ${
|
className={`ml-2 size-6 shrink-0 p-0 transition-all ${isDropdownOpen
|
||||||
isDropdownOpen
|
? "opacity-100"
|
||||||
? "opacity-100"
|
: "opacity-0 group-hover:opacity-100"
|
||||||
: "opacity-0 group-hover:opacity-100"
|
}`}
|
||||||
}`}
|
|
||||||
onClick={(event) => event.preventDefault()}
|
onClick={(event) => event.preventDefault()}
|
||||||
>
|
>
|
||||||
<MoreHorizontal aria-hidden="true" />
|
<MoreHorizontal aria-hidden="true" />
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Metadata } from "next";
|
import { Metadata } from "next";
|
||||||
import { Badge } from "@/components/ui/badge";
|
import { Badge } from "@/components/ui/badge";
|
||||||
import { ReactMarkdownWrapper } from "@/components/ui/react-markdown-wrapper";
|
import { ReactMarkdownWrapper } from "@/components/ui/react-markdown-wrapper";
|
||||||
import { cn } from "@/lib/utils";
|
import { cn } from "@/utils/ui";
|
||||||
import { BasePage } from "@/app/base-page";
|
import { BasePage } from "@/app/base-page";
|
||||||
import { GitHubContributeSection } from "@/components/gitHub-contribute-section";
|
import { GitHubContributeSection } from "@/components/gitHub-contribute-section";
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Feed } from "feed";
|
import { Feed } from "feed";
|
||||||
import { getPosts } from "@/lib/blog-query";
|
import { getPosts } from "@/lib/blog/query";
|
||||||
import { SITE_INFO, SITE_URL } from "@/constants/site-constants";
|
import { SITE_INFO, SITE_URL } from "@/constants/site-constants";
|
||||||
|
|
||||||
export async function GET() {
|
export async function GET() {
|
||||||
@@ -14,9 +14,8 @@ export async function GET() {
|
|||||||
language: "en",
|
language: "en",
|
||||||
image: `${SITE_INFO.openGraphImage}`,
|
image: `${SITE_INFO.openGraphImage}`,
|
||||||
favicon: `${SITE_INFO.favicon}`,
|
favicon: `${SITE_INFO.favicon}`,
|
||||||
copyright: `All rights reserved ${new Date().getFullYear()}, ${
|
copyright: `All rights reserved ${new Date().getFullYear()}, ${SITE_INFO.title
|
||||||
SITE_INFO.title
|
}`,
|
||||||
}`,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
for (const post of posts) {
|
for (const post of posts) {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { SITE_URL } from "@/constants/site-constants";
|
import { SITE_URL } from "@/constants/site-constants";
|
||||||
import { getPosts } from "@/lib/blog-query";
|
import { getPosts } from "@/lib/blog/query";
|
||||||
import type { MetadataRoute } from "next";
|
import type { MetadataRoute } from "next";
|
||||||
|
|
||||||
export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
|
export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { cn } from "@/lib/utils";
|
import { cn } from "@/utils/ui";
|
||||||
import {
|
import {
|
||||||
TAB_KEYS,
|
TAB_KEYS,
|
||||||
tabs,
|
tabs,
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ import { LANGUAGES } from "@/constants/captions-constants";
|
|||||||
import { Loader2 } from "lucide-react";
|
import { Loader2 } from "lucide-react";
|
||||||
import type { TranscriptionProgress } from "@/types/transcription";
|
import type { TranscriptionProgress } from "@/types/transcription";
|
||||||
import { transcriptionService } from "@/services/transcription";
|
import { transcriptionService } from "@/services/transcription";
|
||||||
import { decodeAudioToFloat32 } from "@/lib/audio-utils";
|
import { decodeAudioToFloat32 } from "@/lib/media/audio";
|
||||||
import { buildCaptionChunks } from "@/lib/caption-utils";
|
import { buildCaptionChunks } from "@/lib/utils/caption-utils";
|
||||||
|
|
||||||
export function Captions() {
|
export function Captions() {
|
||||||
const [selectedLanguage, setSelectedLanguage] = useState("auto");
|
const [selectedLanguage, setSelectedLanguage] = useState("auto");
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import { useEditor } from "@/hooks/use-editor";
|
|||||||
import { useFileUpload } from "@/hooks/use-file-upload";
|
import { useFileUpload } from "@/hooks/use-file-upload";
|
||||||
import { useRevealItem } from "@/hooks/use-reveal-item";
|
import { useRevealItem } from "@/hooks/use-reveal-item";
|
||||||
import { processMediaAssets } from "@/lib/media/processing";
|
import { processMediaAssets } from "@/lib/media/processing";
|
||||||
import { cn } from "@/lib/utils";
|
import { cn } from "@/utils/ui";
|
||||||
import { TIMELINE_CONSTANTS } from "@/constants/timeline-constants";
|
import { TIMELINE_CONSTANTS } from "@/constants/timeline-constants";
|
||||||
import type { MediaAsset } from "@/types/assets";
|
import type { MediaAsset } from "@/types/assets";
|
||||||
import type { CreateTimelineElement } from "@/types/timeline";
|
import type { CreateTimelineElement } from "@/types/timeline";
|
||||||
|
|||||||
@@ -21,9 +21,9 @@ import {
|
|||||||
DEFAULT_COLOR,
|
DEFAULT_COLOR,
|
||||||
} from "@/constants/project-constants";
|
} from "@/constants/project-constants";
|
||||||
import { useEditorStore } from "@/stores/editor-store";
|
import { useEditorStore } from "@/stores/editor-store";
|
||||||
import { dimensionToAspectRatio } from "@/lib/editor-utils";
|
import { dimensionToAspectRatio } from "@/utils/geometry";
|
||||||
import Image from "next/image";
|
import Image from "next/image";
|
||||||
import { cn } from "@/lib/utils";
|
import { cn } from "@/utils/ui";
|
||||||
import { colors } from "@/data/colors/solid";
|
import { colors } from "@/data/colors/solid";
|
||||||
import { patternCraftGradients } from "@/data/colors/pattern-craft";
|
import { patternCraftGradients } from "@/data/colors/pattern-craft";
|
||||||
import { PipetteIcon } from "lucide-react";
|
import { PipetteIcon } from "lucide-react";
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ import {
|
|||||||
DialogTitle,
|
DialogTitle,
|
||||||
DialogTrigger,
|
DialogTrigger,
|
||||||
} from "@/components/ui/dialog";
|
} from "@/components/ui/dialog";
|
||||||
import { cn } from "@/lib/utils";
|
import { cn } from "@/utils/ui";
|
||||||
import { useInfiniteScroll } from "@/hooks/use-infinite-scroll";
|
import { useInfiniteScroll } from "@/hooks/use-infinite-scroll";
|
||||||
|
|
||||||
export function SoundsView() {
|
export function SoundsView() {
|
||||||
@@ -547,11 +547,10 @@ function AudioItem({
|
|||||||
<Button
|
<Button
|
||||||
variant="text"
|
variant="text"
|
||||||
size="icon"
|
size="icon"
|
||||||
className={`hover:text-foreground !opacity-100 w-auto ${
|
className={`hover:text-foreground !opacity-100 w-auto ${isSaved
|
||||||
isSaved
|
? "text-red-500 hover:text-red-600"
|
||||||
? "text-red-500 hover:text-red-600"
|
: "text-muted-foreground"
|
||||||
: "text-muted-foreground"
|
}`}
|
||||||
}`}
|
|
||||||
onClick={handleSaveClick}
|
onClick={handleSaveClick}
|
||||||
title={isSaved ? "Remove from saved" : "Save sound"}
|
title={isSaved ? "Remove from saved" : "Save sound"}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ import {
|
|||||||
ICONIFY_HOSTS,
|
ICONIFY_HOSTS,
|
||||||
POPULAR_COLLECTIONS,
|
POPULAR_COLLECTIONS,
|
||||||
} from "@/lib/iconify-api";
|
} from "@/lib/iconify-api";
|
||||||
import { cn } from "@/lib/utils";
|
import { cn } from "@/utils/ui";
|
||||||
import Image from "next/image";
|
import Image from "next/image";
|
||||||
import { DraggableItem } from "@/components/ui/draggable-item";
|
import { DraggableItem } from "@/components/ui/draggable-item";
|
||||||
import { InputWithBack } from "@/components/ui/input-with-back";
|
import { InputWithBack } from "@/components/ui/input-with-back";
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ import { Label } from "../ui/label";
|
|||||||
import { RadioGroup, RadioGroupItem } from "../ui/radio-group";
|
import { RadioGroup, RadioGroupItem } from "../ui/radio-group";
|
||||||
import { Progress } from "../ui/progress";
|
import { Progress } from "../ui/progress";
|
||||||
import { Checkbox } from "../ui/checkbox";
|
import { Checkbox } from "../ui/checkbox";
|
||||||
import { cn } from "@/lib/utils";
|
import { cn } from "@/utils/ui";
|
||||||
import { getExportMimeType, getExportFileExtension } from "@/lib/export";
|
import { getExportMimeType, getExportFileExtension } from "@/utils/export";
|
||||||
import { Check, Copy, Download, RotateCcw, X } from "lucide-react";
|
import { Check, Copy, Download, RotateCcw, X } from "lucide-react";
|
||||||
import {
|
import {
|
||||||
EXPORT_FORMAT_VALUES,
|
EXPORT_FORMAT_VALUES,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { ScrollArea } from "@/components/ui/scroll-area";
|
import { ScrollArea } from "@/components/ui/scroll-area";
|
||||||
import { Separator } from "@/components/ui/separator";
|
import { Separator } from "@/components/ui/separator";
|
||||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
||||||
import { cn } from "@/lib/utils";
|
import { cn } from "@/utils/ui";
|
||||||
|
|
||||||
interface PanelBaseViewProps {
|
interface PanelBaseViewProps {
|
||||||
children?: React.ReactNode;
|
children?: React.ReactNode;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { cn } from "@/lib/utils";
|
import { cn } from "@/utils/ui";
|
||||||
import { ChevronDown } from "lucide-react";
|
import { ChevronDown } from "lucide-react";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,9 @@ import {
|
|||||||
PropertyItemValue,
|
PropertyItemValue,
|
||||||
} from "./property-item";
|
} from "./property-item";
|
||||||
import { ColorPicker } from "@/components/ui/color-picker";
|
import { ColorPicker } from "@/components/ui/color-picker";
|
||||||
import { cn, capitalizeFirstLetter, clamp, uppercase } from "@/lib/utils";
|
import { cn } from "@/utils/ui";
|
||||||
|
import { capitalizeFirstLetter, uppercase } from "@/utils/string-utils";
|
||||||
|
import { clamp } from "@/utils/math";
|
||||||
import { Grid2x2 } from "lucide-react";
|
import { Grid2x2 } from "lucide-react";
|
||||||
import {
|
import {
|
||||||
Tooltip,
|
Tooltip,
|
||||||
@@ -296,8 +298,9 @@ export function TextProperties({
|
|||||||
<PropertyItemLabel>Color</PropertyItemLabel>
|
<PropertyItemLabel>Color</PropertyItemLabel>
|
||||||
<PropertyItemValue>
|
<PropertyItemValue>
|
||||||
<ColorPicker
|
<ColorPicker
|
||||||
value={uppercase({ string:
|
value={uppercase({
|
||||||
(element.color || "FFFFFF").replace("#", "")
|
string:
|
||||||
|
(element.color || "FFFFFF").replace("#", "")
|
||||||
})}
|
})}
|
||||||
onChange={(color) => {
|
onChange={(color) => {
|
||||||
editor.timeline.updateTextElement({
|
editor.timeline.updateTextElement({
|
||||||
@@ -351,9 +354,9 @@ export function TextProperties({
|
|||||||
element.backgroundColor === "transparent"
|
element.backgroundColor === "transparent"
|
||||||
? lastSelectedColor.current.replace("#", "")
|
? lastSelectedColor.current.replace("#", "")
|
||||||
: (element.backgroundColor).replace(
|
: (element.backgroundColor).replace(
|
||||||
"#",
|
"#",
|
||||||
"",
|
"",
|
||||||
),
|
),
|
||||||
})}
|
})}
|
||||||
onChange={(color) => handleColorChange({ color: `#${color}` })}
|
onChange={(color) => handleColorChange({ color: `#${color}` })}
|
||||||
containerRef={containerRef}
|
containerRef={containerRef}
|
||||||
@@ -380,7 +383,7 @@ export function TextProperties({
|
|||||||
className={cn(
|
className={cn(
|
||||||
"text-foreground",
|
"text-foreground",
|
||||||
element.backgroundColor === "transparent" &&
|
element.backgroundColor === "transparent" &&
|
||||||
"text-primary",
|
"text-primary",
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import {
|
|||||||
} from "@/components/ui/sheet";
|
} from "@/components/ui/sheet";
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
import { Check, ListCheck, Trash2 } from "lucide-react";
|
import { Check, ListCheck, Trash2 } from "lucide-react";
|
||||||
import { cn } from "@/lib/utils";
|
import { cn } from "@/utils/ui";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import {
|
import {
|
||||||
Dialog,
|
Dialog,
|
||||||
@@ -21,7 +21,7 @@ import {
|
|||||||
DialogFooter,
|
DialogFooter,
|
||||||
DialogTrigger,
|
DialogTrigger,
|
||||||
} from "@/components/ui/dialog";
|
} from "@/components/ui/dialog";
|
||||||
import { canDeleteScene, getMainScene } from "@/lib/scene-utils";
|
import { canDeleteScene, getMainScene } from "@/lib/scenes";
|
||||||
import { toast } from "sonner";
|
import { toast } from "sonner";
|
||||||
import { useEditor } from "@/hooks/use-editor";
|
import { useEditor } from "@/hooks/use-editor";
|
||||||
|
|
||||||
@@ -147,11 +147,11 @@ export function ScenesView({ children }: { children: React.ReactNode }) {
|
|||||||
className={cn(
|
className={cn(
|
||||||
"w-full justify-between font-normal",
|
"w-full justify-between font-normal",
|
||||||
currentScene?.id === scene.id &&
|
currentScene?.id === scene.id &&
|
||||||
!isSelectMode &&
|
!isSelectMode &&
|
||||||
"border-primary !text-primary",
|
"border-primary !text-primary",
|
||||||
isSelectMode &&
|
isSelectMode &&
|
||||||
selectedScenes.has(scene.id) &&
|
selectedScenes.has(scene.id) &&
|
||||||
"bg-accent border-foreground/30",
|
"bg-accent border-foreground/30",
|
||||||
)}
|
)}
|
||||||
onClick={() => handleSceneSwitch(scene.id)}
|
onClick={() => handleSceneSwitch(scene.id)}
|
||||||
>
|
>
|
||||||
@@ -159,8 +159,8 @@ export function ScenesView({ children }: { children: React.ReactNode }) {
|
|||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center gap-2">
|
||||||
{((isSelectMode && selectedScenes.has(scene.id)) ||
|
{((isSelectMode && selectedScenes.has(scene.id)) ||
|
||||||
(!isSelectMode && currentScene?.id === scene.id)) && (
|
(!isSelectMode && currentScene?.id === scene.id)) && (
|
||||||
<Check className="h-4 w-4" />
|
<Check className="h-4 w-4" />
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</Button>
|
</Button>
|
||||||
))}
|
))}
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ import type {
|
|||||||
ElementDragState,
|
ElementDragState,
|
||||||
} from "@/types/timeline";
|
} from "@/types/timeline";
|
||||||
import { MediaAsset } from "@/types/assets";
|
import { MediaAsset } from "@/types/assets";
|
||||||
import { mediaSupportsAudio } from "@/lib/media-utils";
|
import { mediaSupportsAudio } from "@/lib/media/media-utils";
|
||||||
import { type TAction, invokeAction } from "@/lib/actions";
|
import { type TAction, invokeAction } from "@/lib/actions";
|
||||||
import { useElementSelection } from "@/hooks/timeline/element/use-element-selection";
|
import { useElementSelection } from "@/hooks/timeline/element/use-element-selection";
|
||||||
|
|
||||||
|
|||||||
@@ -31,12 +31,12 @@ import {
|
|||||||
SplitButtonSeparator,
|
SplitButtonSeparator,
|
||||||
} from "@/components/ui/split-button";
|
} from "@/components/ui/split-button";
|
||||||
import { Slider } from "@/components/ui/slider";
|
import { Slider } from "@/components/ui/slider";
|
||||||
import { formatTimeCode } from "@/lib/time-utils";
|
import { formatTimeCode } from "@/lib/time";
|
||||||
import { TIMELINE_CONSTANTS } from "@/constants/timeline-constants";
|
import { TIMELINE_CONSTANTS } from "@/constants/timeline-constants";
|
||||||
import { EditableTimecode } from "@/components/ui/editable-timecode";
|
import { EditableTimecode } from "@/components/ui/editable-timecode";
|
||||||
import { ScenesView } from "../scenes-view";
|
import { ScenesView } from "../scenes-view";
|
||||||
import { type TAction, invokeAction } from "@/lib/actions";
|
import { type TAction, invokeAction } from "@/lib/actions";
|
||||||
import { cn } from "@/lib/utils";
|
import { cn } from "@/utils/ui";
|
||||||
import { useTimelineStore } from "@/stores/timeline-store";
|
import { useTimelineStore } from "@/stores/timeline-store";
|
||||||
|
|
||||||
export function TimelineToolbar({
|
export function TimelineToolbar({
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import { TIMELINE_CONSTANTS } from "@/constants/timeline-constants";
|
|||||||
import { useEdgeAutoScroll } from "@/hooks/timeline/use-edge-auto-scroll";
|
import { useEdgeAutoScroll } from "@/hooks/timeline/use-edge-auto-scroll";
|
||||||
import { ElementDragState } from "@/types/timeline";
|
import { ElementDragState } from "@/types/timeline";
|
||||||
import { useEditor } from "@/hooks/use-editor";
|
import { useEditor } from "@/hooks/use-editor";
|
||||||
import { cn } from "@/lib/utils";
|
import { cn } from "@/utils/ui";
|
||||||
|
|
||||||
interface TimelineTrackContentProps {
|
interface TimelineTrackContentProps {
|
||||||
track: TimelineTrack;
|
track: TimelineTrack;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { RiDiscordFill, RiTwitterXLine } from "react-icons/ri";
|
|||||||
import { FaGithub } from "react-icons/fa6";
|
import { FaGithub } from "react-icons/fa6";
|
||||||
import Image from "next/image";
|
import Image from "next/image";
|
||||||
import { DEFAULT_LOGO_URL, SOCIAL_LINKS } from "@/constants/site-constants";
|
import { DEFAULT_LOGO_URL, SOCIAL_LINKS } from "@/constants/site-constants";
|
||||||
import { capitalizeFirstLetter } from "@/lib/utils";
|
import { capitalizeFirstLetter } from "@/utils/string-utils";
|
||||||
|
|
||||||
type Category = "resources" | "company";
|
type Category = "resources" | "company";
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import { ArrowRight } from "lucide-react";
|
|||||||
import Image from "next/image";
|
import Image from "next/image";
|
||||||
import { ThemeToggle } from "./theme-toggle";
|
import { ThemeToggle } from "./theme-toggle";
|
||||||
import { GithubIcon, MenuIcon } from "@opencut/ui/icons";
|
import { GithubIcon, MenuIcon } from "@opencut/ui/icons";
|
||||||
import { cn } from "@/lib/utils";
|
import { cn } from "@/utils/ui";
|
||||||
import { DEFAULT_LOGO_URL, SOCIAL_LINKS } from "@/constants/site-constants";
|
import { DEFAULT_LOGO_URL, SOCIAL_LINKS } from "@/constants/site-constants";
|
||||||
|
|
||||||
export function Header() {
|
export function Header() {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { useState, useRef, useEffect } from "react";
|
import { useState, useRef, useEffect } from "react";
|
||||||
import { ChevronDown, Globe } from "lucide-react";
|
import { ChevronDown, Globe } from "lucide-react";
|
||||||
import { cn } from "@/lib/utils";
|
import { cn } from "@/utils/ui";
|
||||||
import { motion } from "motion/react";
|
import { motion } from "motion/react";
|
||||||
import ReactCountryFlag from "react-country-flag";
|
import ReactCountryFlag from "react-country-flag";
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
import { Button } from "./ui/button";
|
import { Button } from "./ui/button";
|
||||||
import { Sun } from "lucide-react";
|
import { Sun } from "lucide-react";
|
||||||
import { useTheme } from "next-themes";
|
import { useTheme } from "next-themes";
|
||||||
import { cn } from "@/lib/utils";
|
import { cn } from "@/utils/ui";
|
||||||
|
|
||||||
interface ThemeToggleProps {
|
interface ThemeToggleProps {
|
||||||
className?: string;
|
className?: string;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import * as React from "react";
|
|||||||
import { Accordion as AccordionPrimitive } from "radix-ui";
|
import { Accordion as AccordionPrimitive } from "radix-ui";
|
||||||
import { ChevronDown } from "lucide-react";
|
import { ChevronDown } from "lucide-react";
|
||||||
|
|
||||||
import { cn } from "../../lib/utils";
|
import { cn } from "@/utils/ui";
|
||||||
|
|
||||||
const Accordion = AccordionPrimitive.Root;
|
const Accordion = AccordionPrimitive.Root;
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { AlertDialog as AlertDialogPrimitive } from "radix-ui";
|
import { AlertDialog as AlertDialogPrimitive } from "radix-ui";
|
||||||
|
|
||||||
import { cn } from "../../lib/utils";
|
import { cn } from "@/utils/ui";
|
||||||
import { buttonVariants } from "./button";
|
import { buttonVariants } from "./button";
|
||||||
|
|
||||||
const AlertDialog = AlertDialogPrimitive.Root;
|
const AlertDialog = AlertDialogPrimitive.Root;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { cva, type VariantProps } from "class-variance-authority";
|
import { cva, type VariantProps } from "class-variance-authority";
|
||||||
|
|
||||||
import { cn } from "../../lib/utils";
|
import { cn } from "@/utils/ui";
|
||||||
|
|
||||||
const alertVariants = cva(
|
const alertVariants = cva(
|
||||||
"relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",
|
"relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { Avatar as AvatarPrimitive } from "radix-ui";
|
import { Avatar as AvatarPrimitive } from "radix-ui";
|
||||||
|
|
||||||
import { cn } from "../../lib/utils";
|
import { cn } from "@/utils/ui";
|
||||||
|
|
||||||
const Avatar = React.forwardRef<
|
const Avatar = React.forwardRef<
|
||||||
React.ElementRef<typeof AvatarPrimitive.Root>,
|
React.ElementRef<typeof AvatarPrimitive.Root>,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { cva, type VariantProps } from "class-variance-authority";
|
import { cva, type VariantProps } from "class-variance-authority";
|
||||||
|
|
||||||
import { cn } from "../../lib/utils";
|
import { cn } from "@/utils/ui";
|
||||||
|
|
||||||
const badgeVariants = cva(
|
const badgeVariants = cva(
|
||||||
"inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
"inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
||||||
@@ -25,7 +25,7 @@ const badgeVariants = cva(
|
|||||||
|
|
||||||
export interface BadgeProps
|
export interface BadgeProps
|
||||||
extends React.HTMLAttributes<HTMLDivElement>,
|
extends React.HTMLAttributes<HTMLDivElement>,
|
||||||
VariantProps<typeof badgeVariants> {}
|
VariantProps<typeof badgeVariants> { }
|
||||||
|
|
||||||
function Badge({ className, variant, ...props }: BadgeProps) {
|
function Badge({ className, variant, ...props }: BadgeProps) {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import * as React from "react";
|
|||||||
import { Slot as SlotPrimitive } from "radix-ui";
|
import { Slot as SlotPrimitive } from "radix-ui";
|
||||||
import { ChevronRight, MoreHorizontal } from "lucide-react";
|
import { ChevronRight, MoreHorizontal } from "lucide-react";
|
||||||
|
|
||||||
import { cn } from "../../lib/utils";
|
import { cn } from "@/utils/ui";
|
||||||
|
|
||||||
const Breadcrumb = React.forwardRef<
|
const Breadcrumb = React.forwardRef<
|
||||||
HTMLElement,
|
HTMLElement,
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import * as React from "react";
|
|||||||
import { Slot as SlotPrimitive } from "radix-ui";
|
import { Slot as SlotPrimitive } from "radix-ui";
|
||||||
import { cva, type VariantProps } from "class-variance-authority";
|
import { cva, type VariantProps } from "class-variance-authority";
|
||||||
|
|
||||||
import { cn } from "../../lib/utils";
|
import { cn } from "@/utils/ui";
|
||||||
|
|
||||||
const buttonVariants = cva(
|
const buttonVariants = cva(
|
||||||
"inline-flex items-center cursor-pointer justify-center gap-2 whitespace-nowrap rounded-full text-sm font-medium transition-colors focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
"inline-flex items-center cursor-pointer justify-center gap-2 whitespace-nowrap rounded-full text-sm font-medium transition-colors focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
||||||
@@ -42,7 +42,7 @@ const buttonVariants = cva(
|
|||||||
|
|
||||||
export interface ButtonProps
|
export interface ButtonProps
|
||||||
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
|
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
|
||||||
VariantProps<typeof buttonVariants> {
|
VariantProps<typeof buttonVariants> {
|
||||||
asChild?: boolean;
|
asChild?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import * as React from "react";
|
|||||||
import { ChevronLeft, ChevronRight } from "lucide-react";
|
import { ChevronLeft, ChevronRight } from "lucide-react";
|
||||||
import { DayPicker } from "react-day-picker";
|
import { DayPicker } from "react-day-picker";
|
||||||
|
|
||||||
import { cn } from "../../lib/utils";
|
import { cn } from "@/utils/ui";
|
||||||
import { buttonVariants } from "./button";
|
import { buttonVariants } from "./button";
|
||||||
|
|
||||||
export type CalendarProps = React.ComponentProps<typeof DayPicker>;
|
export type CalendarProps = React.ComponentProps<typeof DayPicker>;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
|
|
||||||
import { cn } from "../../lib/utils";
|
import { cn } from "@/utils/ui";
|
||||||
|
|
||||||
const Card = React.forwardRef<
|
const Card = React.forwardRef<
|
||||||
HTMLDivElement,
|
HTMLDivElement,
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import useEmblaCarousel, {
|
|||||||
} from "embla-carousel-react";
|
} from "embla-carousel-react";
|
||||||
import { ArrowLeft, ArrowRight } from "lucide-react";
|
import { ArrowLeft, ArrowRight } from "lucide-react";
|
||||||
|
|
||||||
import { cn } from "../../lib/utils";
|
import { cn } from "@/utils/ui";
|
||||||
import { Button } from "./button";
|
import { Button } from "./button";
|
||||||
|
|
||||||
type CarouselApi = UseEmblaCarouselType[1];
|
type CarouselApi = UseEmblaCarouselType[1];
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import {
|
|||||||
ValueType,
|
ValueType,
|
||||||
} from "recharts/types/component/DefaultTooltipContent";
|
} from "recharts/types/component/DefaultTooltipContent";
|
||||||
|
|
||||||
import { cn } from "../../lib/utils";
|
import { cn } from "@/utils/ui";
|
||||||
|
|
||||||
// Format: { THEME_NAME: CSS_SELECTOR }
|
// Format: { THEME_NAME: CSS_SELECTOR }
|
||||||
const THEMES = { light: "", dark: ".dark" } as const;
|
const THEMES = { light: "", dark: ".dark" } as const;
|
||||||
@@ -89,13 +89,13 @@ const ChartStyle = ({ id, config }: { id: string; config: ChartConfig }) => {
|
|||||||
([theme, prefix]) => `
|
([theme, prefix]) => `
|
||||||
${prefix} [data-chart=${id}] {
|
${prefix} [data-chart=${id}] {
|
||||||
${colorConfig
|
${colorConfig
|
||||||
.map(([key, itemConfig]) => {
|
.map(([key, itemConfig]) => {
|
||||||
const color =
|
const color =
|
||||||
itemConfig.theme?.[theme as keyof typeof itemConfig.theme] ||
|
itemConfig.theme?.[theme as keyof typeof itemConfig.theme] ||
|
||||||
itemConfig.color;
|
itemConfig.color;
|
||||||
return color ? ` --color-${key}: ${color};` : null;
|
return color ? ` --color-${key}: ${color};` : null;
|
||||||
})
|
})
|
||||||
.join("\n")}
|
.join("\n")}
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
)
|
)
|
||||||
@@ -110,13 +110,13 @@ const ChartTooltip = RechartsPrimitive.Tooltip;
|
|||||||
const ChartTooltipContent = React.forwardRef<
|
const ChartTooltipContent = React.forwardRef<
|
||||||
HTMLDivElement,
|
HTMLDivElement,
|
||||||
React.ComponentProps<typeof RechartsPrimitive.Tooltip> &
|
React.ComponentProps<typeof RechartsPrimitive.Tooltip> &
|
||||||
React.ComponentProps<"div"> & {
|
React.ComponentProps<"div"> & {
|
||||||
hideLabel?: boolean;
|
hideLabel?: boolean;
|
||||||
hideIndicator?: boolean;
|
hideIndicator?: boolean;
|
||||||
indicator?: "line" | "dot" | "dashed";
|
indicator?: "line" | "dot" | "dashed";
|
||||||
nameKey?: string;
|
nameKey?: string;
|
||||||
labelKey?: string;
|
labelKey?: string;
|
||||||
}
|
}
|
||||||
>(
|
>(
|
||||||
(
|
(
|
||||||
{
|
{
|
||||||
@@ -266,10 +266,10 @@ const ChartLegend = RechartsPrimitive.Legend;
|
|||||||
const ChartLegendContent = React.forwardRef<
|
const ChartLegendContent = React.forwardRef<
|
||||||
HTMLDivElement,
|
HTMLDivElement,
|
||||||
React.ComponentProps<"div"> &
|
React.ComponentProps<"div"> &
|
||||||
Pick<RechartsPrimitive.LegendProps, "payload" | "verticalAlign"> & {
|
Pick<RechartsPrimitive.LegendProps, "payload" | "verticalAlign"> & {
|
||||||
hideIcon?: boolean;
|
hideIcon?: boolean;
|
||||||
nameKey?: string;
|
nameKey?: string;
|
||||||
}
|
}
|
||||||
>(
|
>(
|
||||||
(
|
(
|
||||||
{ className, hideIcon = false, payload, verticalAlign = "bottom", nameKey },
|
{ className, hideIcon = false, payload, verticalAlign = "bottom", nameKey },
|
||||||
@@ -333,8 +333,8 @@ function getPayloadConfigFromPayload(
|
|||||||
|
|
||||||
const payloadPayload =
|
const payloadPayload =
|
||||||
"payload" in payload &&
|
"payload" in payload &&
|
||||||
typeof payload.payload === "object" &&
|
typeof payload.payload === "object" &&
|
||||||
payload.payload !== null
|
payload.payload !== null
|
||||||
? payload.payload
|
? payload.payload
|
||||||
: undefined;
|
: undefined;
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import * as React from "react";
|
|||||||
import { Checkbox as CheckboxPrimitive } from "radix-ui";
|
import { Checkbox as CheckboxPrimitive } from "radix-ui";
|
||||||
import { Check } from "lucide-react";
|
import { Check } from "lucide-react";
|
||||||
|
|
||||||
import { cn } from "../../lib/utils";
|
import { cn } from "@/utils/ui";
|
||||||
|
|
||||||
const Checkbox = React.forwardRef<
|
const Checkbox = React.forwardRef<
|
||||||
React.ElementRef<typeof CheckboxPrimitive.Root>,
|
React.ElementRef<typeof CheckboxPrimitive.Root>,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { createPortal } from "react-dom";
|
import { createPortal } from "react-dom";
|
||||||
import { cn } from "../../lib/utils";
|
import { cn } from "@/utils/ui";
|
||||||
import { Input } from "./input";
|
import { Input } from "./input";
|
||||||
|
|
||||||
interface ColorPickerProps {
|
interface ColorPickerProps {
|
||||||
@@ -321,9 +321,8 @@ const ColorCircle = ({
|
|||||||
color: string;
|
color: string;
|
||||||
}) => (
|
}) => (
|
||||||
<div
|
<div
|
||||||
className={`absolute border-3 border-white rounded-full shadow-lg pointer-events-none ${
|
className={`absolute border-3 border-white rounded-full shadow-lg pointer-events-none ${size === "sm" ? "size-3" : "size-4"
|
||||||
size === "sm" ? "size-3" : "size-4"
|
}`}
|
||||||
}`}
|
|
||||||
style={{
|
style={{
|
||||||
left: position.left,
|
left: position.left,
|
||||||
top: position.top,
|
top: position.top,
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import * as React from "react";
|
|||||||
import { DialogProps } from "@radix-ui/react-dialog";
|
import { DialogProps } from "@radix-ui/react-dialog";
|
||||||
import { Command as CommandPrimitive } from "cmdk";
|
import { Command as CommandPrimitive } from "cmdk";
|
||||||
import { Search } from "lucide-react";
|
import { Search } from "lucide-react";
|
||||||
import { cn } from "../../lib/utils";
|
import { cn } from "@/utils/ui";
|
||||||
import { Dialog, DialogContent } from "./dialog";
|
import { Dialog, DialogContent } from "./dialog";
|
||||||
|
|
||||||
const Command = React.forwardRef<
|
const Command = React.forwardRef<
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { ContextMenu as ContextMenuPrimitive } from "radix-ui";
|
|||||||
import { Check, ChevronRight, Circle } from "lucide-react";
|
import { Check, ChevronRight, Circle } from "lucide-react";
|
||||||
import { cva, type VariantProps } from "class-variance-authority";
|
import { cva, type VariantProps } from "class-variance-authority";
|
||||||
|
|
||||||
import { cn } from "../../lib/utils";
|
import { cn } from "@/utils/ui";
|
||||||
|
|
||||||
const ContextMenu = ContextMenuPrimitive.Root;
|
const ContextMenu = ContextMenuPrimitive.Root;
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import * as React from "react";
|
|||||||
import { Dialog as DialogPrimitive } from "radix-ui";
|
import { Dialog as DialogPrimitive } from "radix-ui";
|
||||||
import { X } from "lucide-react";
|
import { X } from "lucide-react";
|
||||||
|
|
||||||
import { cn } from "../../lib/utils";
|
import { cn } from "@/utils/ui";
|
||||||
import { ScrollArea } from "./scroll-area";
|
import { ScrollArea } from "./scroll-area";
|
||||||
|
|
||||||
const Dialog = DialogPrimitive.Root;
|
const Dialog = DialogPrimitive.Root;
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import {
|
|||||||
import { ReactNode, useState, useRef, useEffect } from "react";
|
import { ReactNode, useState, useRef, useEffect } from "react";
|
||||||
import { createPortal } from "react-dom";
|
import { createPortal } from "react-dom";
|
||||||
import { Plus } from "lucide-react";
|
import { Plus } from "lucide-react";
|
||||||
import { cn } from "@/lib/utils";
|
import { cn } from "@/utils/ui";
|
||||||
import { useEditor } from "@/hooks/use-editor";
|
import { useEditor } from "@/hooks/use-editor";
|
||||||
import { clearDragData, setDragData } from "@/lib/drag-data";
|
import { clearDragData, setDragData } from "@/lib/drag-data";
|
||||||
import type { TimelineDragData } from "@/types/drag";
|
import type { TimelineDragData } from "@/types/drag";
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { Drawer as DrawerPrimitive } from "vaul";
|
import { Drawer as DrawerPrimitive } from "vaul";
|
||||||
|
|
||||||
import { cn } from "../../lib/utils";
|
import { cn } from "@/utils/ui";
|
||||||
|
|
||||||
const Drawer = ({
|
const Drawer = ({
|
||||||
shouldScaleBackground = true,
|
shouldScaleBackground = true,
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { DropdownMenu as DropdownMenuPrimitive } from "radix-ui";
|
|||||||
import { Check, ChevronRight, Circle } from "lucide-react";
|
import { Check, ChevronRight, Circle } from "lucide-react";
|
||||||
import { cva, type VariantProps } from "class-variance-authority";
|
import { cva, type VariantProps } from "class-variance-authority";
|
||||||
|
|
||||||
import { cn } from "../../lib/utils";
|
import { cn } from "@/utils/ui";
|
||||||
|
|
||||||
const DropdownMenu = DropdownMenuPrimitive.Root;
|
const DropdownMenu = DropdownMenuPrimitive.Root;
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { useState, useRef, useEffect } from "react";
|
import { useState, useRef, useEffect } from "react";
|
||||||
import { cn } from "@/lib/utils";
|
import { cn } from "@/utils/ui";
|
||||||
import { TTimeCode } from "@/types/time";
|
import { TTimeCode } from "@/types/time";
|
||||||
import { formatTimeCode, parseTimeCode } from "@/lib/time-utils";
|
import { formatTimeCode, parseTimeCode } from "@/lib/time";
|
||||||
|
|
||||||
interface EditableTimecodeProps {
|
interface EditableTimecodeProps {
|
||||||
time: number;
|
time: number;
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import {
|
|||||||
useFormContext,
|
useFormContext,
|
||||||
} from "react-hook-form";
|
} from "react-hook-form";
|
||||||
|
|
||||||
import { cn } from "../../lib/utils";
|
import { cn } from "@/utils/ui";
|
||||||
import { Label } from "./label";
|
import { Label } from "./label";
|
||||||
|
|
||||||
const Form = FormProvider;
|
const Form = FormProvider;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { HoverCard as HoverCardPrimitive } from "radix-ui";
|
import { HoverCard as HoverCardPrimitive } from "radix-ui";
|
||||||
|
|
||||||
import { cn } from "../../lib/utils";
|
import { cn } from "@/utils/ui";
|
||||||
|
|
||||||
const HoverCard = HoverCardPrimitive.Root;
|
const HoverCard = HoverCardPrimitive.Root;
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import * as React from "react";
|
|||||||
import { OTPInput, OTPInputContext } from "input-otp";
|
import { OTPInput, OTPInputContext } from "input-otp";
|
||||||
import { Minus } from "lucide-react";
|
import { Minus } from "lucide-react";
|
||||||
|
|
||||||
import { cn } from "../../lib/utils";
|
import { cn } from "@/utils/ui";
|
||||||
|
|
||||||
const InputOTP = React.forwardRef<
|
const InputOTP = React.forwardRef<
|
||||||
React.ElementRef<typeof OTPInput>,
|
React.ElementRef<typeof OTPInput>,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { Eye, EyeOff, X } from "lucide-react";
|
import { Eye, EyeOff, X } from "lucide-react";
|
||||||
import { cn } from "../../lib/utils";
|
import { cn } from "@/utils/ui";
|
||||||
import { Button } from "./button";
|
import { Button } from "./button";
|
||||||
import { forwardRef, ComponentProps } from "react";
|
import { forwardRef, ComponentProps } from "react";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import * as React from "react";
|
|||||||
import { Label as LabelPrimitive } from "radix-ui";
|
import { Label as LabelPrimitive } from "radix-ui";
|
||||||
import { cva, type VariantProps } from "class-variance-authority";
|
import { cva, type VariantProps } from "class-variance-authority";
|
||||||
|
|
||||||
import { cn } from "../../lib/utils";
|
import { cn } from "@/utils/ui";
|
||||||
|
|
||||||
const labelVariants = cva(
|
const labelVariants = cva(
|
||||||
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
|
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
|
||||||
@@ -13,7 +13,7 @@ const labelVariants = cva(
|
|||||||
const Label = React.forwardRef<
|
const Label = React.forwardRef<
|
||||||
React.ElementRef<typeof LabelPrimitive.Root>,
|
React.ElementRef<typeof LabelPrimitive.Root>,
|
||||||
React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &
|
React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &
|
||||||
VariantProps<typeof labelVariants>
|
VariantProps<typeof labelVariants>
|
||||||
>(({ className, ...props }, ref) => (
|
>(({ className, ...props }, ref) => (
|
||||||
<LabelPrimitive.Root
|
<LabelPrimitive.Root
|
||||||
ref={ref}
|
ref={ref}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import * as React from "react";
|
|||||||
import { Menubar as MenubarPrimitive } from "radix-ui";
|
import { Menubar as MenubarPrimitive } from "radix-ui";
|
||||||
import { Check, ChevronRight, Circle } from "lucide-react";
|
import { Check, ChevronRight, Circle } from "lucide-react";
|
||||||
|
|
||||||
import { cn } from "../../lib/utils";
|
import { cn } from "@/utils/ui";
|
||||||
|
|
||||||
const MenubarMenu = MenubarPrimitive.Menu;
|
const MenubarMenu = MenubarPrimitive.Menu;
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { NavigationMenu as NavigationMenuPrimitive } from "radix-ui";
|
|||||||
import { cva } from "class-variance-authority";
|
import { cva } from "class-variance-authority";
|
||||||
import { ChevronDown } from "lucide-react";
|
import { ChevronDown } from "lucide-react";
|
||||||
|
|
||||||
import { cn } from "../../lib/utils";
|
import { cn } from "@/utils/ui";
|
||||||
|
|
||||||
const NavigationMenu = React.forwardRef<
|
const NavigationMenu = React.forwardRef<
|
||||||
React.ElementRef<typeof NavigationMenuPrimitive.Root>,
|
React.ElementRef<typeof NavigationMenuPrimitive.Root>,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { ChevronLeft, ChevronRight, MoreHorizontal } from "lucide-react";
|
import { ChevronLeft, ChevronRight, MoreHorizontal } from "lucide-react";
|
||||||
|
|
||||||
import { cn } from "../../lib/utils";
|
import { cn } from "@/utils/ui";
|
||||||
import { ButtonProps, buttonVariants } from "./button";
|
import { ButtonProps, buttonVariants } from "./button";
|
||||||
|
|
||||||
const Pagination = ({ className, ...props }: React.ComponentProps<"nav">) => (
|
const Pagination = ({ className, ...props }: React.ComponentProps<"nav">) => (
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import {
|
|||||||
import { Input } from "./input";
|
import { Input } from "./input";
|
||||||
import { Popover, PopoverContent, PopoverTrigger } from "./popover";
|
import { Popover, PopoverContent, PopoverTrigger } from "./popover";
|
||||||
import { ScrollArea } from "./scroll-area";
|
import { ScrollArea } from "./scroll-area";
|
||||||
import { cn } from "../../lib/utils";
|
import { cn } from "@/utils/ui";
|
||||||
|
|
||||||
type PhoneInputProps = Omit<
|
type PhoneInputProps = Omit<
|
||||||
React.ComponentProps<"input">,
|
React.ComponentProps<"input">,
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { Popover as PopoverPrimitive } from "radix-ui";
|
import { Popover as PopoverPrimitive } from "radix-ui";
|
||||||
|
|
||||||
import { cn } from "../../lib/utils";
|
import { cn } from "@/utils/ui";
|
||||||
|
|
||||||
const Popover = PopoverPrimitive.Root;
|
const Popover = PopoverPrimitive.Root;
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { Progress as ProgressPrimitive } from "radix-ui";
|
import { Progress as ProgressPrimitive } from "radix-ui";
|
||||||
|
|
||||||
import { cn } from "../../lib/utils";
|
import { cn } from "@/utils/ui";
|
||||||
|
|
||||||
const Progress = React.forwardRef<
|
const Progress = React.forwardRef<
|
||||||
React.ElementRef<typeof ProgressPrimitive.Root>,
|
React.ElementRef<typeof ProgressPrimitive.Root>,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { cn } from "@/lib/utils";
|
import { cn } from "@/utils/ui";
|
||||||
import type React from "react";
|
import type React from "react";
|
||||||
|
|
||||||
type ProseProps = React.HTMLAttributes<HTMLElement> & {
|
type ProseProps = React.HTMLAttributes<HTMLElement> & {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import * as React from "react";
|
|||||||
import { RadioGroup as RadioGroupPrimitive } from "radix-ui";
|
import { RadioGroup as RadioGroupPrimitive } from "radix-ui";
|
||||||
import { Circle } from "lucide-react";
|
import { Circle } from "lucide-react";
|
||||||
|
|
||||||
import { cn } from "../../lib/utils";
|
import { cn } from "@/utils/ui";
|
||||||
|
|
||||||
const RadioGroup = React.forwardRef<
|
const RadioGroup = React.forwardRef<
|
||||||
React.ElementRef<typeof RadioGroupPrimitive.Root>,
|
React.ElementRef<typeof RadioGroupPrimitive.Root>,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import ReactMarkdown from "react-markdown";
|
import ReactMarkdown from "react-markdown";
|
||||||
import { cn } from "@/lib/utils";
|
import { cn } from "@/utils/ui";
|
||||||
|
|
||||||
export function ReactMarkdownWrapper({ children }: { children: string }) {
|
export function ReactMarkdownWrapper({ children }: { children: string }) {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
import * as ResizablePrimitive from "react-resizable-panels";
|
import * as ResizablePrimitive from "react-resizable-panels";
|
||||||
|
|
||||||
import { cn } from "../../lib/utils";
|
import { cn } from "@/utils/ui";
|
||||||
|
|
||||||
const ResizablePanelGroup = ({
|
const ResizablePanelGroup = ({
|
||||||
className,
|
className,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { cn } from "@/lib/utils";
|
import { cn } from "@/utils/ui";
|
||||||
|
|
||||||
const ScrollArea = React.forwardRef<
|
const ScrollArea = React.forwardRef<
|
||||||
HTMLDivElement,
|
HTMLDivElement,
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { Select as SelectPrimitive } from "radix-ui";
|
|||||||
import { Check, ChevronDown, ChevronUp } from "lucide-react";
|
import { Check, ChevronDown, ChevronUp } from "lucide-react";
|
||||||
import { cva, type VariantProps } from "class-variance-authority";
|
import { cva, type VariantProps } from "class-variance-authority";
|
||||||
|
|
||||||
import { cn } from "../../lib/utils";
|
import { cn } from "@/utils/ui";
|
||||||
|
|
||||||
const Select = SelectPrimitive.Root;
|
const Select = SelectPrimitive.Root;
|
||||||
|
|
||||||
@@ -93,7 +93,7 @@ const SelectContent = React.forwardRef<
|
|||||||
className={cn(
|
className={cn(
|
||||||
"relative z-50 max-h-96 min-w-32 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
"relative z-50 max-h-96 min-w-32 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
||||||
position === "popper" &&
|
position === "popper" &&
|
||||||
"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
||||||
className
|
className
|
||||||
)}
|
)}
|
||||||
position={position}
|
position={position}
|
||||||
@@ -108,7 +108,7 @@ const SelectContent = React.forwardRef<
|
|||||||
className={cn(
|
className={cn(
|
||||||
"p-1",
|
"p-1",
|
||||||
position === "popper" &&
|
position === "popper" &&
|
||||||
"h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width)"
|
"h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width)"
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
||||||
|
|
||||||
import { cn } from "@/lib/utils";
|
import { cn } from "@/utils/ui";
|
||||||
|
|
||||||
const Separator = React.forwardRef<
|
const Separator = React.forwardRef<
|
||||||
React.ElementRef<typeof SeparatorPrimitive.Root>,
|
React.ElementRef<typeof SeparatorPrimitive.Root>,
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { Dialog as SheetPrimitive } from "radix-ui";
|
|||||||
import { cva, type VariantProps } from "class-variance-authority";
|
import { cva, type VariantProps } from "class-variance-authority";
|
||||||
import { X } from "lucide-react";
|
import { X } from "lucide-react";
|
||||||
|
|
||||||
import { cn } from "../../lib/utils";
|
import { cn } from "@/utils/ui";
|
||||||
|
|
||||||
const Sheet = SheetPrimitive.Root;
|
const Sheet = SheetPrimitive.Root;
|
||||||
|
|
||||||
@@ -51,7 +51,7 @@ const sheetVariants = cva(
|
|||||||
|
|
||||||
interface SheetContentProps
|
interface SheetContentProps
|
||||||
extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>,
|
extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>,
|
||||||
VariantProps<typeof sheetVariants> {}
|
VariantProps<typeof sheetVariants> { }
|
||||||
|
|
||||||
const SheetContent = React.forwardRef<
|
const SheetContent = React.forwardRef<
|
||||||
React.ElementRef<typeof SheetPrimitive.Content>,
|
React.ElementRef<typeof SheetPrimitive.Content>,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { cn } from "../../lib/utils";
|
import { cn } from "@/utils/ui";
|
||||||
|
|
||||||
function Skeleton({
|
function Skeleton({
|
||||||
className,
|
className,
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { Slider as SliderPrimitive } from "radix-ui";
|
import { Slider as SliderPrimitive } from "radix-ui";
|
||||||
|
|
||||||
import { cn } from "../../lib/utils";
|
import { cn } from "@/utils/ui";
|
||||||
|
|
||||||
const Slider = React.forwardRef<
|
const Slider = React.forwardRef<
|
||||||
React.ElementRef<typeof SliderPrimitive.Root>,
|
React.ElementRef<typeof SliderPrimitive.Root>,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Button, ButtonProps } from "@/components/ui/button";
|
import { Button, ButtonProps } from "@/components/ui/button";
|
||||||
import { Separator } from "@/components/ui/separator";
|
import { Separator } from "@/components/ui/separator";
|
||||||
import { ReactNode, forwardRef } from "react";
|
import { ReactNode, forwardRef } from "react";
|
||||||
import { cn } from "@/lib/utils";
|
import { cn } from "@/utils/ui";
|
||||||
|
|
||||||
interface SplitButtonProps {
|
interface SplitButtonProps {
|
||||||
children: ReactNode;
|
children: ReactNode;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { Switch as SwitchPrimitives } from "radix-ui";
|
import { Switch as SwitchPrimitives } from "radix-ui";
|
||||||
|
|
||||||
import { cn } from "../../lib/utils";
|
import { cn } from "@/utils/ui";
|
||||||
|
|
||||||
const Switch = React.forwardRef<
|
const Switch = React.forwardRef<
|
||||||
React.ElementRef<typeof SwitchPrimitives.Root>,
|
React.ElementRef<typeof SwitchPrimitives.Root>,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
|
|
||||||
import { cn } from "../../lib/utils";
|
import { cn } from "@/utils/ui";
|
||||||
|
|
||||||
const Table = React.forwardRef<
|
const Table = React.forwardRef<
|
||||||
HTMLTableElement,
|
HTMLTableElement,
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { Tabs as TabsPrimitive } from "radix-ui";
|
import { Tabs as TabsPrimitive } from "radix-ui";
|
||||||
|
|
||||||
import { cn } from "../../lib/utils";
|
import { cn } from "@/utils/ui";
|
||||||
|
|
||||||
const Tabs = TabsPrimitive.Root;
|
const Tabs = TabsPrimitive.Root;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
|
|
||||||
import { cn } from "../../lib/utils";
|
import { cn } from "@/utils/ui";
|
||||||
|
|
||||||
const Textarea = React.forwardRef<
|
const Textarea = React.forwardRef<
|
||||||
HTMLTextAreaElement,
|
HTMLTextAreaElement,
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { Toast as ToastPrimitives } from "radix-ui";
|
|||||||
import { cva, type VariantProps } from "class-variance-authority";
|
import { cva, type VariantProps } from "class-variance-authority";
|
||||||
import { X } from "lucide-react";
|
import { X } from "lucide-react";
|
||||||
|
|
||||||
import { cn } from "../../lib/utils";
|
import { cn } from "@/utils/ui";
|
||||||
|
|
||||||
const ToastProvider = ToastPrimitives.Provider;
|
const ToastProvider = ToastPrimitives.Provider;
|
||||||
|
|
||||||
@@ -43,7 +43,7 @@ const toastVariants = cva(
|
|||||||
const Toast = React.forwardRef<
|
const Toast = React.forwardRef<
|
||||||
React.ElementRef<typeof ToastPrimitives.Root>,
|
React.ElementRef<typeof ToastPrimitives.Root>,
|
||||||
React.ComponentPropsWithoutRef<typeof ToastPrimitives.Root> &
|
React.ComponentPropsWithoutRef<typeof ToastPrimitives.Root> &
|
||||||
VariantProps<typeof toastVariants>
|
VariantProps<typeof toastVariants>
|
||||||
>(({ className, variant, ...props }, ref) => {
|
>(({ className, variant, ...props }, ref) => {
|
||||||
return (
|
return (
|
||||||
<ToastPrimitives.Root
|
<ToastPrimitives.Root
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import * as React from "react";
|
|||||||
import { ToggleGroup as ToggleGroupPrimitive } from "radix-ui";
|
import { ToggleGroup as ToggleGroupPrimitive } from "radix-ui";
|
||||||
import { type VariantProps } from "class-variance-authority";
|
import { type VariantProps } from "class-variance-authority";
|
||||||
|
|
||||||
import { cn } from "../../lib/utils";
|
import { cn } from "@/utils/ui";
|
||||||
import { toggleVariants } from "./toggle";
|
import { toggleVariants } from "./toggle";
|
||||||
|
|
||||||
const ToggleGroupContext = React.createContext<
|
const ToggleGroupContext = React.createContext<
|
||||||
@@ -17,7 +17,7 @@ const ToggleGroupContext = React.createContext<
|
|||||||
const ToggleGroup = React.forwardRef<
|
const ToggleGroup = React.forwardRef<
|
||||||
React.ElementRef<typeof ToggleGroupPrimitive.Root>,
|
React.ElementRef<typeof ToggleGroupPrimitive.Root>,
|
||||||
React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Root> &
|
React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Root> &
|
||||||
VariantProps<typeof toggleVariants>
|
VariantProps<typeof toggleVariants>
|
||||||
>(({ className, variant, size, children, ...props }, ref) => (
|
>(({ className, variant, size, children, ...props }, ref) => (
|
||||||
<ToggleGroupPrimitive.Root
|
<ToggleGroupPrimitive.Root
|
||||||
ref={ref}
|
ref={ref}
|
||||||
@@ -35,7 +35,7 @@ ToggleGroup.displayName = ToggleGroupPrimitive.Root.displayName;
|
|||||||
const ToggleGroupItem = React.forwardRef<
|
const ToggleGroupItem = React.forwardRef<
|
||||||
React.ElementRef<typeof ToggleGroupPrimitive.Item>,
|
React.ElementRef<typeof ToggleGroupPrimitive.Item>,
|
||||||
React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Item> &
|
React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Item> &
|
||||||
VariantProps<typeof toggleVariants>
|
VariantProps<typeof toggleVariants>
|
||||||
>(({ className, children, variant, size, ...props }, ref) => {
|
>(({ className, children, variant, size, ...props }, ref) => {
|
||||||
const context = React.useContext(ToggleGroupContext);
|
const context = React.useContext(ToggleGroupContext);
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import * as React from "react";
|
|||||||
import { Toggle as TogglePrimitive } from "radix-ui";
|
import { Toggle as TogglePrimitive } from "radix-ui";
|
||||||
import { cva, type VariantProps } from "class-variance-authority";
|
import { cva, type VariantProps } from "class-variance-authority";
|
||||||
|
|
||||||
import { cn } from "../../lib/utils";
|
import { cn } from "@/utils/ui";
|
||||||
|
|
||||||
const toggleVariants = cva(
|
const toggleVariants = cva(
|
||||||
"inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
"inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
||||||
@@ -31,7 +31,7 @@ const toggleVariants = cva(
|
|||||||
const Toggle = React.forwardRef<
|
const Toggle = React.forwardRef<
|
||||||
React.ElementRef<typeof TogglePrimitive.Root>,
|
React.ElementRef<typeof TogglePrimitive.Root>,
|
||||||
React.ComponentPropsWithoutRef<typeof TogglePrimitive.Root> &
|
React.ComponentPropsWithoutRef<typeof TogglePrimitive.Root> &
|
||||||
VariantProps<typeof toggleVariants>
|
VariantProps<typeof toggleVariants>
|
||||||
>(({ className, variant, size, ...props }, ref) => (
|
>(({ className, variant, size, ...props }, ref) => (
|
||||||
<TogglePrimitive.Root
|
<TogglePrimitive.Root
|
||||||
ref={ref}
|
ref={ref}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { cva, type VariantProps } from 'class-variance-authority';
|
|||||||
import { Tooltip as TooltipPrimitive } from 'radix-ui';
|
import { Tooltip as TooltipPrimitive } from 'radix-ui';
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
|
|
||||||
import { cn } from '@/lib/utils';
|
import { cn } from '@/utils/ui';
|
||||||
|
|
||||||
const TooltipProvider = TooltipPrimitive.Provider;
|
const TooltipProvider = TooltipPrimitive.Provider;
|
||||||
|
|
||||||
@@ -15,7 +15,7 @@ const tooltipVariants = cva(
|
|||||||
{
|
{
|
||||||
variants: {
|
variants: {
|
||||||
variant: {
|
variant: {
|
||||||
default: 'bg-popover text-popover-foreground border px-3 py-1.5',
|
default: 'bg-popover text-popover-foreground border px-3 py-1.5',
|
||||||
destructive:
|
destructive:
|
||||||
'bg-destructive/10 text-destructive dark:bg-destructive/20 border-destructive [border-width:0.5px]',
|
'bg-destructive/10 text-destructive dark:bg-destructive/20 border-destructive [border-width:0.5px]',
|
||||||
outline: 'border-border',
|
outline: 'border-border',
|
||||||
@@ -40,7 +40,7 @@ const tooltipVariants = cva(
|
|||||||
|
|
||||||
interface TooltipContentProps
|
interface TooltipContentProps
|
||||||
extends React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>,
|
extends React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>,
|
||||||
VariantProps<typeof tooltipVariants> {}
|
VariantProps<typeof tooltipVariants> { }
|
||||||
|
|
||||||
const TooltipContent = React.forwardRef<
|
const TooltipContent = React.forwardRef<
|
||||||
React.ElementRef<typeof TooltipPrimitive.Content>,
|
React.ElementRef<typeof TooltipPrimitive.Content>,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import type { EditorCore } from "@/core";
|
import type { EditorCore } from "@/core";
|
||||||
import type { MediaAsset } from "@/types/assets";
|
import type { MediaAsset } from "@/types/assets";
|
||||||
import { storageService } from "@/services/storage/storage-service";
|
import { storageService } from "@/services/storage/storage-service";
|
||||||
import { generateUUID } from "@/lib/utils";
|
import { generateUUID } from "@/utils/id";
|
||||||
import { videoCache } from "@/services/media/video-cache";
|
import { videoCache } from "@/services/media/video-cache";
|
||||||
import { hasMediaId } from "@/lib/timeline/element-utils";
|
import { hasMediaId } from "@/lib/timeline/element-utils";
|
||||||
|
|
||||||
|
|||||||
@@ -8,14 +8,14 @@ import type { ExportOptions, ExportResult } from "@/types/export";
|
|||||||
import type { TimelineElement } from "@/types/timeline";
|
import type { TimelineElement } from "@/types/timeline";
|
||||||
import { storageService } from "@/services/storage/storage-service";
|
import { storageService } from "@/services/storage/storage-service";
|
||||||
import { toast } from "sonner";
|
import { toast } from "sonner";
|
||||||
import { generateUUID } from "@/lib/utils";
|
import { generateUUID } from "@/utils/id";
|
||||||
import { UpdateProjectSettingsCommand } from "@/lib/commands/project";
|
import { UpdateProjectSettingsCommand } from "@/lib/commands/project";
|
||||||
import {
|
import {
|
||||||
DEFAULT_FPS,
|
DEFAULT_FPS,
|
||||||
DEFAULT_CANVAS_SIZE,
|
DEFAULT_CANVAS_SIZE,
|
||||||
DEFAULT_COLOR,
|
DEFAULT_COLOR,
|
||||||
} from "@/constants/project-constants";
|
} from "@/constants/project-constants";
|
||||||
import { buildDefaultScene } from "@/lib/scene-utils";
|
import { buildDefaultScene } from "@/lib/scenes";
|
||||||
import { generateThumbnail } from "@/lib/media/processing";
|
import { generateThumbnail } from "@/lib/media/processing";
|
||||||
import {
|
import {
|
||||||
CURRENT_STORAGE_VERSION,
|
CURRENT_STORAGE_VERSION,
|
||||||
|
|||||||
@@ -3,13 +3,13 @@ import type { RootNode } from "@/services/renderer/nodes/root-node";
|
|||||||
import type { ExportOptions, ExportResult } from "@/types/export";
|
import type { ExportOptions, ExportResult } from "@/types/export";
|
||||||
import { SceneExporter } from "@/services/renderer/scene-exporter";
|
import { SceneExporter } from "@/services/renderer/scene-exporter";
|
||||||
import { buildScene } from "@/services/renderer/scene-builder";
|
import { buildScene } from "@/services/renderer/scene-builder";
|
||||||
import { createTimelineAudioBuffer } from "@/lib/audio-utils";
|
import { createTimelineAudioBuffer } from "@/lib/media/audio";
|
||||||
|
|
||||||
export class RendererManager {
|
export class RendererManager {
|
||||||
private renderTree: RootNode | null = null;
|
private renderTree: RootNode | null = null;
|
||||||
private listeners = new Set<() => void>();
|
private listeners = new Set<() => void>();
|
||||||
|
|
||||||
constructor(private editor: EditorCore) {}
|
constructor(private editor: EditorCore) { }
|
||||||
|
|
||||||
setRenderTree({ renderTree }: { renderTree: RootNode | null }): void {
|
setRenderTree({ renderTree }: { renderTree: RootNode | null }): void {
|
||||||
this.renderTree = renderTree;
|
this.renderTree = renderTree;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import {
|
|||||||
ensureMainScene,
|
ensureMainScene,
|
||||||
canDeleteScene,
|
canDeleteScene,
|
||||||
findCurrentScene,
|
findCurrentScene,
|
||||||
} from "@/lib/scene-utils";
|
} from "@/lib/scenes";
|
||||||
import {
|
import {
|
||||||
getFrameTime,
|
getFrameTime,
|
||||||
isBookmarkAtTime,
|
isBookmarkAtTime,
|
||||||
|
|||||||
@@ -9,9 +9,9 @@ import {
|
|||||||
import { useEditor } from "@/hooks/use-editor";
|
import { useEditor } from "@/hooks/use-editor";
|
||||||
import { useElementSelection } from "@/hooks/timeline/element/use-element-selection";
|
import { useElementSelection } from "@/hooks/timeline/element/use-element-selection";
|
||||||
import { TIMELINE_CONSTANTS } from "@/constants/timeline-constants";
|
import { TIMELINE_CONSTANTS } from "@/constants/timeline-constants";
|
||||||
import { snapTimeToFrame } from "@/lib/time-utils";
|
import { snapTimeToFrame } from "@/lib/time";
|
||||||
import { computeDropTarget } from "@/lib/timeline/drop-utils";
|
import { computeDropTarget } from "@/lib/timeline/drop-utils";
|
||||||
import { generateUUID } from "@/lib/utils";
|
import { generateUUID } from "@/utils/id";
|
||||||
import { useTimelineSnapping } from "@/hooks/timeline/use-timeline-snapping";
|
import { useTimelineSnapping } from "@/hooks/timeline/use-timeline-snapping";
|
||||||
import type {
|
import type {
|
||||||
DropTarget,
|
DropTarget,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { useState, useEffect, useRef } from "react";
|
import { useState, useEffect, useRef } from "react";
|
||||||
import { TimelineElement, TimelineTrack } from "@/types/timeline";
|
import { TimelineElement, TimelineTrack } from "@/types/timeline";
|
||||||
import { snapTimeToFrame } from "@/lib/time-utils";
|
import { snapTimeToFrame } from "@/lib/time";
|
||||||
import { EditorCore } from "@/core";
|
import { EditorCore } from "@/core";
|
||||||
import {
|
import {
|
||||||
useTimelineSnapping,
|
useTimelineSnapping,
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { useEditor } from "@/hooks/use-editor";
|
|||||||
import { processMediaAssets } from "@/lib/media/processing";
|
import { processMediaAssets } from "@/lib/media/processing";
|
||||||
import { toast } from "sonner";
|
import { toast } from "sonner";
|
||||||
import { TIMELINE_CONSTANTS } from "@/constants/timeline-constants";
|
import { TIMELINE_CONSTANTS } from "@/constants/timeline-constants";
|
||||||
import { snapTimeToFrame } from "@/lib/time-utils";
|
import { snapTimeToFrame } from "@/lib/time";
|
||||||
import {
|
import {
|
||||||
buildTextElement,
|
buildTextElement,
|
||||||
buildStickerElement,
|
buildStickerElement,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { useCallback, useRef } from "react";
|
import { useCallback, useRef } from "react";
|
||||||
import type { MutableRefObject, RefObject } from "react";
|
import type { MutableRefObject, RefObject } from "react";
|
||||||
import { TIMELINE_CONSTANTS } from "@/constants/timeline-constants";
|
import { TIMELINE_CONSTANTS } from "@/constants/timeline-constants";
|
||||||
import { getSnappedSeekTime } from "@/lib/time-utils";
|
import { getSnappedSeekTime } from "@/lib/time";
|
||||||
import { useEditor } from "../use-editor";
|
import { useEditor } from "../use-editor";
|
||||||
|
|
||||||
interface UseTimelineInteractionsProps {
|
interface UseTimelineInteractionsProps {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { getSnappedSeekTime } from "@/lib/time-utils";
|
import { getSnappedSeekTime } from "@/lib/time";
|
||||||
import { useState, useEffect, useCallback, useRef } from "react";
|
import { useState, useEffect, useCallback, useRef } from "react";
|
||||||
import { useEdgeAutoScroll } from "@/hooks/timeline/use-edge-auto-scroll";
|
import { useEdgeAutoScroll } from "@/hooks/timeline/use-edge-auto-scroll";
|
||||||
import { useEditor } from "../use-editor";
|
import { useEditor } from "../use-editor";
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { ACTIONS, type TAction } from "@/lib/actions";
|
|||||||
import {
|
import {
|
||||||
getPlatformAlternateKey,
|
getPlatformAlternateKey,
|
||||||
getPlatformSpecialKey,
|
getPlatformSpecialKey,
|
||||||
} from "@/lib/keyboard-utils";
|
} from "@/utils/platform";
|
||||||
|
|
||||||
export interface KeyboardShortcut {
|
export interface KeyboardShortcut {
|
||||||
id: string;
|
id: string;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Command } from "@/lib/commands/base-command";
|
import { Command } from "@/lib/commands/base-command";
|
||||||
import { EditorCore } from "@/core";
|
import { EditorCore } from "@/core";
|
||||||
import type { MediaAsset } from "@/types/assets";
|
import type { MediaAsset } from "@/types/assets";
|
||||||
import { generateUUID } from "@/lib/utils";
|
import { generateUUID } from "@/utils/id";
|
||||||
import { storageService } from "@/services/storage/storage-service";
|
import { storageService } from "@/services/storage/storage-service";
|
||||||
|
|
||||||
export class AddMediaAssetCommand extends Command {
|
export class AddMediaAssetCommand extends Command {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Command } from "@/lib/commands/base-command";
|
import { Command } from "@/lib/commands/base-command";
|
||||||
import { EditorCore } from "@/core";
|
import { EditorCore } from "@/core";
|
||||||
import type { TScene } from "@/types/timeline";
|
import type { TScene } from "@/types/timeline";
|
||||||
import { buildDefaultScene } from "@/lib/scene-utils";
|
import { buildDefaultScene } from "@/lib/scenes";
|
||||||
|
|
||||||
export class CreateSceneCommand extends Command {
|
export class CreateSceneCommand extends Command {
|
||||||
private savedScenes: TScene[] | null = null;
|
private savedScenes: TScene[] | null = null;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Command } from "@/lib/commands/base-command";
|
import { Command } from "@/lib/commands/base-command";
|
||||||
import { EditorCore } from "@/core";
|
import { EditorCore } from "@/core";
|
||||||
import type { TScene } from "@/types/timeline";
|
import type { TScene } from "@/types/timeline";
|
||||||
import { canDeleteScene, getFallbackSceneAfterDelete } from "@/lib/scene-utils";
|
import { canDeleteScene, getFallbackSceneAfterDelete } from "@/lib/scenes";
|
||||||
|
|
||||||
export class DeleteSceneCommand extends Command {
|
export class DeleteSceneCommand extends Command {
|
||||||
private savedScenes: TScene[] | null = null;
|
private savedScenes: TScene[] | null = null;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Command } from "@/lib/commands/base-command";
|
import { Command } from "@/lib/commands/base-command";
|
||||||
import { EditorCore } from "@/core";
|
import { EditorCore } from "@/core";
|
||||||
import type { TScene } from "@/types/timeline";
|
import type { TScene } from "@/types/timeline";
|
||||||
import { updateSceneInArray } from "@/lib/scene-utils";
|
import { updateSceneInArray } from "@/lib/scenes";
|
||||||
import {
|
import {
|
||||||
getFrameTime,
|
getFrameTime,
|
||||||
removeBookmarkFromArray,
|
removeBookmarkFromArray,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Command } from "@/lib/commands/base-command";
|
import { Command } from "@/lib/commands/base-command";
|
||||||
import { EditorCore } from "@/core";
|
import { EditorCore } from "@/core";
|
||||||
import type { TScene } from "@/types/timeline";
|
import type { TScene } from "@/types/timeline";
|
||||||
import { updateSceneInArray } from "@/lib/scene-utils";
|
import { updateSceneInArray } from "@/lib/scenes";
|
||||||
|
|
||||||
export class RenameSceneCommand extends Command {
|
export class RenameSceneCommand extends Command {
|
||||||
private savedScenes: TScene[] | null = null;
|
private savedScenes: TScene[] | null = null;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Command } from "@/lib/commands/base-command";
|
import { Command } from "@/lib/commands/base-command";
|
||||||
import { EditorCore } from "@/core";
|
import { EditorCore } from "@/core";
|
||||||
import type { TScene } from "@/types/timeline";
|
import type { TScene } from "@/types/timeline";
|
||||||
import { updateSceneInArray } from "@/lib/scene-utils";
|
import { updateSceneInArray } from "@/lib/scenes";
|
||||||
import {
|
import {
|
||||||
getFrameTime,
|
getFrameTime,
|
||||||
toggleBookmarkInArray,
|
toggleBookmarkInArray,
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import type {
|
|||||||
TimelineElement,
|
TimelineElement,
|
||||||
ClipboardItem,
|
ClipboardItem,
|
||||||
} from "@/types/timeline";
|
} from "@/types/timeline";
|
||||||
import { generateUUID } from "@/lib/utils";
|
import { generateUUID } from "@/utils/id";
|
||||||
import { wouldElementOverlap } from "@/lib/timeline/element-utils";
|
import { wouldElementOverlap } from "@/lib/timeline/element-utils";
|
||||||
import {
|
import {
|
||||||
buildEmptyTrack,
|
buildEmptyTrack,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Command } from "@/lib/commands/base-command";
|
import { Command } from "@/lib/commands/base-command";
|
||||||
import type { TimelineElement, TimelineTrack } from "@/types/timeline";
|
import type { TimelineElement, TimelineTrack } from "@/types/timeline";
|
||||||
import { generateUUID } from "@/lib/utils";
|
import { generateUUID } from "@/utils/id";
|
||||||
import { EditorCore } from "@/core";
|
import { EditorCore } from "@/core";
|
||||||
import {
|
import {
|
||||||
buildEmptyTrack,
|
buildEmptyTrack,
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import type {
|
|||||||
TrackType,
|
TrackType,
|
||||||
ElementType,
|
ElementType,
|
||||||
} from "@/types/timeline";
|
} from "@/types/timeline";
|
||||||
import { generateUUID } from "@/lib/utils";
|
import { generateUUID } from "@/utils/id";
|
||||||
import {
|
import {
|
||||||
requiresMediaId,
|
requiresMediaId,
|
||||||
wouldElementOverlap,
|
wouldElementOverlap,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Command } from "@/lib/commands/base-command";
|
import { Command } from "@/lib/commands/base-command";
|
||||||
import type { TimelineTrack } from "@/types/timeline";
|
import type { TimelineTrack } from "@/types/timeline";
|
||||||
import { generateUUID } from "@/lib/utils";
|
import { generateUUID } from "@/utils/id";
|
||||||
import { EditorCore } from "@/core";
|
import { EditorCore } from "@/core";
|
||||||
|
|
||||||
export class SplitElementsCommand extends Command {
|
export class SplitElementsCommand extends Command {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Command } from "@/lib/commands/base-command";
|
import { Command } from "@/lib/commands/base-command";
|
||||||
import type { TrackType, TimelineTrack } from "@/types/timeline";
|
import type { TrackType, TimelineTrack } from "@/types/timeline";
|
||||||
import { generateUUID } from "@/lib/utils";
|
import { generateUUID } from "@/utils/id";
|
||||||
import { EditorCore } from "@/core";
|
import { EditorCore } from "@/core";
|
||||||
import {
|
import {
|
||||||
buildEmptyTrack,
|
buildEmptyTrack,
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
export function dimensionToAspectRatio({
|
|
||||||
width,
|
|
||||||
height,
|
|
||||||
}: {
|
|
||||||
width: number;
|
|
||||||
height: number;
|
|
||||||
}): string {
|
|
||||||
const gcd = (a: number, b: number): number => (b === 0 ? a : gcd(b, a % b));
|
|
||||||
const divisor = gcd(width, height);
|
|
||||||
return `${width / divisor}:${height / divisor}`;
|
|
||||||
}
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user