3fc7bf2b97
Build backend images / build content-svc (push) Failing after 3m39s
Build backend images / build file-svc (push) Failing after 52s
Build backend images / build gateway (push) Failing after 58s
Build backend images / build identity-svc (push) Failing after 1m21s
Build backend images / build notification-svc (push) Failing after 1m0s
Build backend images / build render-svc (push) Failing after 58s
Build backend images / build studio-svc (push) Failing after 55s
AI SEO content generator - content-svc: per-tenant OpenAI config (ai_settings) + /v1/ai endpoints (settings GET/PUT, seo-post) with SEO-expert prompt → structured article - admin UI to configure token/base-url/model and generate + save as blog - configurable base URL for restricted networks Full data-driven admin panel - generic /api/admin/resource proxy + reusable AdminResource component - categories/tags/fonts/blogs (CRUD), users (list + ban), plans/slides - AI content section; nav + i18n i18n localization sweep - localized 116 user-facing + studio/editor components to next-intl (fa+en) under the auto.* namespace; merge tooling in scripts/merge-i18n.js Branding + assets - Monoline F logo (LogoMark + favicon) - offline SVG placeholder generator (/api/placeholder), dropped picsum.photos Fixes - JWT issuer mismatch on content/studio (flatrender → flatrender-identity) - missing role claim → [Authorize(Roles="Admin")] now works (RBAC) - Secure cookies broke HTTP sessions → gated behind AUTH_COOKIE_SECURE - Radix RTL via DirectionProvider (right-aligned menus in fa) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
120 lines
3.6 KiB
TypeScript
120 lines
3.6 KiB
TypeScript
"use client";
|
|
|
|
import { useEffect, useState } from "react";
|
|
import { Info } from "lucide-react";
|
|
import { useTranslations } from "next-intl";
|
|
|
|
import { useStudioStore } from "@/lib/studio-store";
|
|
import type { SceneTransition } from "@/lib/studio-types";
|
|
import { cn } from "@/lib/utils";
|
|
|
|
const TRANSITION_OPTIONS = [
|
|
{
|
|
id: "random",
|
|
label: "Random Transition",
|
|
description: "Random",
|
|
gradientFrom: "#3b82f6",
|
|
gradientTo: "#8b5cf6",
|
|
},
|
|
{
|
|
id: "none",
|
|
label: "No Transition",
|
|
description: "None",
|
|
gradientFrom: "#374151",
|
|
gradientTo: "#1f2937",
|
|
},
|
|
] as const;
|
|
|
|
type TransitionOptionId = (typeof TRANSITION_OPTIONS)[number]["id"];
|
|
|
|
function scenesUseTransition(scenes: { transitionType?: SceneTransition }[]): boolean {
|
|
return scenes.some((scene) => (scene.transitionType ?? "none") !== "none");
|
|
}
|
|
|
|
function optionToTransitionType(id: TransitionOptionId): SceneTransition {
|
|
return id === "random" ? "fade" : "none";
|
|
}
|
|
|
|
function TransitionOptionCard({
|
|
option,
|
|
label,
|
|
selected,
|
|
onSelect,
|
|
}: {
|
|
option: (typeof TRANSITION_OPTIONS)[number];
|
|
label: string;
|
|
selected: boolean;
|
|
onSelect: () => void;
|
|
}) {
|
|
return (
|
|
<button
|
|
type="button"
|
|
onClick={onSelect}
|
|
className={cn(
|
|
"w-full cursor-pointer overflow-hidden rounded-lg ring-2 ring-transparent transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500",
|
|
selected && "ring-[#4c6ef5]"
|
|
)}
|
|
>
|
|
<div
|
|
className="flex aspect-[4/3] flex-col items-center justify-center gap-1"
|
|
style={{
|
|
background: `linear-gradient(135deg, ${option.gradientFrom}, ${option.gradientTo})`,
|
|
}}
|
|
>
|
|
<span className="mx-auto h-2 w-3/4 rounded bg-white/30" aria-hidden />
|
|
<span className="mx-auto h-2 w-3/4 rounded bg-white/30" aria-hidden />
|
|
<span className="mx-auto h-2 w-3/4 rounded bg-white/30" aria-hidden />
|
|
</div>
|
|
<p className="bg-gray-100 py-1.5 text-center text-[11px] font-semibold text-gray-700">
|
|
{label}
|
|
</p>
|
|
</button>
|
|
);
|
|
}
|
|
|
|
export function TransitionsSidebarContent() {
|
|
const t = useTranslations("auto.componentsStudioSidebarTransitionsSidebarContent");
|
|
const scenes = useStudioStore((state) => state.scenes);
|
|
const applyTransitionToAllScenes = useStudioStore(
|
|
(state) => state.applyTransitionToAllScenes
|
|
);
|
|
|
|
const [selectedOption, setSelectedOption] = useState<TransitionOptionId>(() =>
|
|
scenesUseTransition(scenes) ? "random" : "none"
|
|
);
|
|
|
|
useEffect(() => {
|
|
setSelectedOption(scenesUseTransition(scenes) ? "random" : "none");
|
|
}, [scenes]);
|
|
|
|
const handleSelect = (id: TransitionOptionId) => {
|
|
setSelectedOption(id);
|
|
applyTransitionToAllScenes(optionToTransitionType(id));
|
|
};
|
|
|
|
return (
|
|
<aside className="flex h-full w-full flex-col overflow-hidden bg-white text-gray-900">
|
|
<h2 className="shrink-0 border-b border-gray-200 px-3 py-3 text-xs font-semibold uppercase tracking-wide text-gray-400">
|
|
{t("heading")}
|
|
</h2>
|
|
|
|
<div className="grid grid-cols-2 gap-2 p-2">
|
|
{TRANSITION_OPTIONS.map((option) => (
|
|
<TransitionOptionCard
|
|
key={option.id}
|
|
option={option}
|
|
label={option.id === "random" ? t("randomTransition") : t("noTransition")}
|
|
selected={selectedOption === option.id}
|
|
onSelect={() => handleSelect(option.id)}
|
|
/>
|
|
))}
|
|
</div>
|
|
|
|
<div className="flex items-start gap-2 px-3 py-2 text-[10px] leading-relaxed text-gray-500">
|
|
<Info className="mt-0.5 h-3 w-3 shrink-0 text-gray-600" aria-hidden />
|
|
<p>{t("exportNote")}</p>
|
|
</div>
|
|
</aside>
|
|
);
|
|
}
|