Add image art direction, Thai date picker on week board, sturdier image download
- Share IMAGE_ART_DIRECTION between editable image prompts and queued post drafts - Use ThaiDateTimePicker for week board planning; a11y, clear action, mobile layout - Show planned day in Thai format in the generation queue - Wait longer for ChatGPT image download and handle the download menu item Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -11,6 +11,7 @@ import { assertImageQuota, generateImage } from "@/lib/ai/image";
|
||||
import { IMAGE_PROMPT_MAX, IMAGE_SIZES, type ImageSizeKey } from "@/lib/ai/image-shared";
|
||||
import { putBlob } from "@/lib/storage/blob";
|
||||
import { logoPalettePrompt } from "@/lib/ai/brand-palette";
|
||||
import { IMAGE_ART_DIRECTION } from "@/lib/ai/prompts";
|
||||
|
||||
export const maxDuration = 360;
|
||||
|
||||
@@ -26,6 +27,7 @@ const SYSTEM = `You write prompts for an AI image generator. The images illustra
|
||||
- No identifiable real people, celebrities or copyrighted characters. If people appear, keep them generic.
|
||||
- No before/after imagery and no exaggerated results (cures, guaranteed outcomes).
|
||||
- Follow "สีและสไตล์ภาพของแบรนด์" exactly when supplied, especially its palette, medium, lighting and exclusions. Match the shop's tone and audience through the visual mood.`;
|
||||
const IMAGE_SYSTEM = `${SYSTEM}\n${IMAGE_ART_DIRECTION}`;
|
||||
|
||||
/**
|
||||
* Two steps, both explicit button presses in the editor:
|
||||
@@ -57,7 +59,7 @@ export async function POST(req: Request) {
|
||||
kind: "image-prompt",
|
||||
pageId,
|
||||
userId: auth.user.id,
|
||||
system: SYSTEM,
|
||||
system: IMAGE_SYSTEM,
|
||||
prompt: `${profilePrompt(page.profile)}\n${logoPalette}\n\nWrite the image prompt for the idea below.\n\n<idea>\n${description}\n</idea>`,
|
||||
schema: ImagePrompt,
|
||||
effort: "low",
|
||||
|
||||
+9
-6
@@ -1302,15 +1302,16 @@
|
||||
.research-actions button { margin-left: 0; }
|
||||
}
|
||||
.thai-picker-trigger { width: 100%; height: 42px; padding: 0 12px 0 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 10px; text-align: start; }
|
||||
.thai-picker-trigger:hover { border-color: var(--ink-3); }
|
||||
.thai-picker-trigger:hover:not(:disabled) { border-color: var(--ink-3); }
|
||||
.thai-picker-trigger:focus-visible { outline: none; border-color: var(--m-blue); box-shadow: 0 0 0 3px var(--m-blue-soft); }
|
||||
.thai-picker-trigger svg { flex: none; color: var(--m-blue); }
|
||||
.thai-picker-trigger:disabled { cursor: not-allowed; color: var(--ink-3); background: var(--board); }
|
||||
.thai-picker-popover { position: absolute; z-index: 40; right: 0; bottom: calc(100% + 8px); width: min(360px, calc(100vw - 40px)); padding: 16px; color: var(--ink); background: var(--paper); border-radius: 16px; box-shadow: var(--shadow-lift); transform-origin: bottom right; animation: thai-picker-in 160ms cubic-bezier(.23,1,.32,1); }
|
||||
.thai-picker-popover { position: absolute; z-index: 40; inset-inline-end: 0; bottom: calc(100% + 8px); width: min(360px, calc(100vw - 40px)); max-height: min(520px, calc(100vh - 32px)); overflow-y: auto; overscroll-behavior: contain; padding: 16px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lift); transform-origin: bottom right; animation: thai-picker-in 160ms ease-out; }
|
||||
.thai-picker-head { height: 40px; display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; margin-bottom: 8px; }
|
||||
.thai-picker-head strong { text-align: center; font-size: 15px; font-weight: 600; }
|
||||
.thai-picker-head button { width: 40px; height: 40px; border-radius: 8px; color: var(--ink-2); font-size: 27px; line-height: 1; }
|
||||
.thai-picker-head button:hover { color: var(--m-blue); background: var(--m-blue-soft); }
|
||||
.thai-picker-head button:focus-visible, .thai-picker-grid button:focus-visible, .thai-picker-foot button:focus-visible { outline: 2px solid var(--m-blue); outline-offset: 2px; }
|
||||
.thai-picker-week, .thai-picker-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
|
||||
.thai-picker-week { margin-bottom: 4px; color: var(--ink-3); font-size: 11px; font-weight: 500; text-align: center; }
|
||||
.thai-picker-week span { display: grid; place-items: center; height: 28px; }
|
||||
@@ -1323,13 +1324,15 @@
|
||||
.thai-picker-time select { height: 32px; padding: 0 7px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 7px; font-variant-numeric: tabular-nums; }
|
||||
.thai-picker-time select:first-of-type { margin-left: auto; }
|
||||
.thai-picker-time select:focus-visible { outline: 2px solid var(--m-blue); outline-offset: 1px; }
|
||||
.thai-picker-foot { display: flex; align-items: center; justify-content: space-between; min-height: 38px; margin-top: 10px; }
|
||||
.thai-picker-foot > button:first-child { min-width: 48px; min-height: 36px; color: var(--m-blue); font-weight: 500; }
|
||||
.thai-picker-foot > button:first-child:hover { text-decoration: underline; text-underline-offset: 3px; }
|
||||
.thai-picker-foot { display: flex; align-items: center; gap: 8px; min-height: 38px; margin-top: 10px; }
|
||||
.thai-picker-foot .thai-picker-text-action { min-height: 36px; padding: 0 6px; color: var(--m-blue); font-weight: 500; }
|
||||
.thai-picker-foot .thai-picker-text-action:hover { text-decoration: underline; text-underline-offset: 3px; }
|
||||
.thai-picker-foot .btn { margin-left: auto; }
|
||||
@keyframes thai-picker-in { from { opacity: 0; transform: translateY(4px) scale(.98); } }
|
||||
@media (max-width: 639px) {
|
||||
.thai-picker-popover { position: fixed; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); width: calc(100vw - 24px); padding: 14px; transform-origin: bottom center; }
|
||||
.thai-picker-popover { position: fixed; inset-inline: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); width: auto; max-height: calc(100dvh - 100px - env(safe-area-inset-bottom)); padding: 14px; transform-origin: bottom center; }
|
||||
.thai-picker-trigger { height: 46px; font-size: 16px; }
|
||||
.thai-picker-grid button, .thai-picker-grid > span { min-height: 40px; aspect-ratio: auto; font-size: 14px; }
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
|
||||
Reference in New Issue
Block a user