1 line
12 KiB
JavaScript
1 line
12 KiB
JavaScript
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,54879,e=>{"use strict";let t=(0,e.i(78445).default)("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);e.s(["Save",()=>t],54879)},4915,e=>{"use strict";let t=(0,e.i(78445).default)("pen-line",[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]]);e.s(["Edit3",()=>t],4915)},62200,e=>{"use strict";let t=(0,e.i(78445).default)("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);e.s(["Clock",()=>t],62200)},89250,e=>{"use strict";var t=e.i(30064),s=e.i(59760),l=e.i(22508),r=e.i(59111),a=e.i(78445);let i=(0,a.default)("grip-vertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]),o=(0,a.default)("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]),c=(0,a.default)("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);var d=e.i(62200),n=e.i(36268);let x=(0,a.default)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);var u=e.i(4917),b=e.i(4915),m=e.i(54879);let p={plot:{label:"Intrigue",color:"bg-rose-100 text-rose-800 border-rose-200",icon:n.Lightbulb},character:{label:"Personnage",color:"bg-blue-100 text-blue-800 border-blue-200",icon:x},research:{label:"Recherche",color:"bg-amber-100 text-amber-800 border-amber-200",icon:x},todo:{label:"À faire",color:"bg-slate-100 text-slate-800 border-slate-200",icon:o}},h={todo:"Idées / À faire",progress:"En cours",done:"Terminé / Validé"},g=({ideas:e,onUpdate:a})=>{let[x,g]=(0,s.useState)(""),[f,j]=(0,s.useState)("plot"),[v,y]=(0,s.useState)(null),[N,k]=(0,s.useState)(null),w=t=>{confirm("Supprimer cette carte ?")&&(a(e.filter(e=>e.id!==t)),N?.id===t&&k(null))},C=e=>{k({title:"",description:"",category:"plot",status:e})},z=e=>{k({...e})},D=e=>{e.preventDefault(),e.dataTransfer.dropEffect="move"},S=({title:s,status:r,icon:o})=>{let c=e.filter(e=>e.status===r);return(0,t.jsxs)("div",{className:"flex-1 bg-[#eef2ff] rounded-xl border border-indigo-100 flex flex-col h-full overflow-hidden transition-colors hover:border-blue-200",onDragOver:D,onDrop:t=>{t.preventDefault(),v&&(a(e.map(e=>e.id===v?{...e,status:r}:e)),y(null))},onDoubleClick:()=>C(r),title:"Double-cliquez dans le vide pour ajouter une carte ici",children:[(0,t.jsxs)("div",{className:`p-4 border-b border-indigo-200 flex justify-between items-center ${"todo"===r?"bg-[#eef2ff]":"progress"===r?"bg-indigo-50":"bg-green-50"}`,children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 font-bold text-slate-700",children:[(0,t.jsx)(o,{size:18}),s]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("button",{onClick:e=>{e.stopPropagation(),C(r)},className:"p-1 hover:bg-white rounded-full text-slate-400 hover:text-blue-600 transition-colors",children:(0,t.jsx)(l.Plus,{size:16})}),(0,t.jsx)("span",{className:"text-xs font-semibold bg-white px-2 py-1 rounded-full border border-indigo-100 text-slate-500",children:c.length})]})]}),(0,t.jsxs)("div",{className:"flex-1 overflow-y-auto p-3 space-y-3 custom-scrollbar",children:[c.map(e=>{let s=e.description.length>300?e.description.substring(0,300)+"...":e.description;return(0,t.jsxs)("div",{draggable:!0,onDragStart:t=>{y(e.id),t.dataTransfer.effectAllowed="move"},onDoubleClick:t=>{t.stopPropagation(),z(e)},className:"bg-white p-3 rounded-lg shadow-sm border border-slate-200 cursor-grab active:cursor-grabbing hover:shadow-md hover:border-blue-300 transition-all group relative animate-in zoom-in-95 duration-200",children:[(0,t.jsxs)("div",{className:"flex justify-between items-start mb-2",children:[(0,t.jsx)("span",{className:`text-[10px] uppercase font-bold px-2 py-0.5 rounded-full flex items-center gap-1 ${p[e.category].color}`,children:p[e.category].label}),(0,t.jsxs)("div",{className:"flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[(0,t.jsx)("button",{onClick:t=>{t.stopPropagation(),z(e)},className:"text-slate-300 hover:text-blue-500",children:(0,t.jsx)(b.Edit3,{size:14})}),(0,t.jsx)("button",{onClick:t=>{t.stopPropagation(),w(e.id)},className:"text-slate-300 hover:text-red-500",children:(0,t.jsx)(u.Trash2,{size:14})})]})]}),(0,t.jsxs)("div",{className:"mb-2",children:[(0,t.jsx)("h4",{className:"font-bold text-slate-800 text-sm mb-1 leading-tight",children:e.title}),e.description&&(0,t.jsx)("p",{className:"text-xs text-slate-500 line-clamp-3 leading-relaxed",title:e.description.length>300?"Description tronquée (voir détail)":void 0,children:s})]}),(0,t.jsxs)("div",{className:"flex justify-between items-center text-xs text-slate-400 border-t border-slate-50 pt-2 mt-2",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)(d.Clock,{size:10})," ",new Date(e.createdAt).toLocaleDateString()]}),(0,t.jsx)(i,{size:14,className:"opacity-20"})]})]},e.id)}),0===c.length&&(0,t.jsxs)("div",{className:"h-full flex flex-col items-center justify-center text-slate-300 text-sm italic border-2 border-dashed border-indigo-200 rounded-lg m-1",children:[(0,t.jsx)("span",{className:"mb-2",children:"Vide"}),(0,t.jsx)("span",{className:"text-xs opacity-70",children:"Double-cliquez pour ajouter"})]})]})]})};return(0,t.jsxs)("div",{className:"flex flex-col h-full bg-white p-6 gap-6 relative",children:[(0,t.jsxs)("div",{className:"flex flex-col md:flex-row justify-between items-start md:items-center gap-4 bg-white p-4 rounded-xl border border-slate-200 shadow-sm shrink-0",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("h2",{className:"text-2xl font-bold text-slate-800 flex items-center gap-2",children:[(0,t.jsx)(n.Lightbulb,{className:"text-yellow-500"})," Boîte à Idées"]}),(0,t.jsx)("p",{className:"text-slate-500 text-sm",children:"Organisez vos tâches, idées de scènes et recherches."})]}),(0,t.jsxs)("form",{onSubmit:t=>{t.preventDefault(),x.trim()&&(a([...e,{id:`idea-${Date.now()}`,title:x,description:"",category:f,status:"todo",createdAt:Date.now()}]),g(""))},className:"flex-1 w-full md:w-auto max-w-2xl flex gap-2",children:[(0,t.jsx)("select",{value:f,onChange:e=>j(e.target.value),className:"bg-[#eef2ff] border border-indigo-200 text-slate-700 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 p-2.5 outline-none",children:Object.entries(p).map(([e,s])=>(0,t.jsx)("option",{value:e,children:s.label},e))}),(0,t.jsx)("input",{type:"text",value:x,onChange:e=>g(e.target.value),placeholder:"Titre de la nouvelle idée...",className:"flex-1 bg-[#eef2ff] border border-indigo-200 text-slate-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 p-2.5 outline-none font-medium"}),(0,t.jsx)("button",{type:"submit",disabled:!x.trim(),className:"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 disabled:opacity-50 transition-colors flex items-center gap-2",children:(0,t.jsx)(l.Plus,{size:18})})]})]}),(0,t.jsxs)("div",{className:"flex-1 grid grid-cols-1 md:grid-cols-3 gap-6 min-h-0",children:[(0,t.jsx)(S,{title:"Idées / À faire",status:"todo",icon:c}),(0,t.jsx)(S,{title:"En cours",status:"progress",icon:d.Clock}),(0,t.jsx)(S,{title:"Terminé",status:"done",icon:o})]}),N&&(0,t.jsx)("div",{className:"absolute inset-0 z-50 flex items-center justify-center bg-black/40 backdrop-blur-sm p-4 animate-in fade-in duration-200",children:(0,t.jsxs)("div",{className:"bg-white rounded-xl shadow-2xl w-full max-w-lg overflow-hidden flex flex-col max-h-[90%]",children:[(0,t.jsxs)("div",{className:"bg-[#eef2ff] border-b border-indigo-100 p-4 flex justify-between items-center",children:[(0,t.jsxs)("h3",{className:"font-bold text-slate-700 flex items-center gap-2",children:[N.id?(0,t.jsx)(b.Edit3,{size:18}):(0,t.jsx)(l.Plus,{size:18}),N.id?"Éditer la carte":"Ajouter une carte"]}),(0,t.jsx)("button",{onClick:()=>k(null),className:"text-slate-400 hover:text-slate-600",children:(0,t.jsx)(r.X,{size:20})})]}),(0,t.jsxs)("div",{className:"p-6 space-y-4 overflow-y-auto",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-xs font-bold text-slate-500 uppercase mb-1",children:"Titre"}),(0,t.jsx)("input",{type:"text",value:N.title,onChange:e=>k({...N,title:e.target.value}),className:"w-full p-3 border border-slate-300 rounded-lg focus:ring-2 focus:ring-blue-500 outline-none font-bold text-slate-800",placeholder:"Titre de la tâche ou de l'idée...",autoFocus:!0})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-xs font-bold text-slate-500 uppercase mb-1",children:"Description"}),(0,t.jsx)("textarea",{value:N.description,onChange:e=>k({...N,description:e.target.value}),maxLength:500,className:"w-full p-3 border border-slate-300 rounded-lg focus:ring-2 focus:ring-blue-500 outline-none min-h-[120px] text-sm text-slate-600 leading-relaxed resize-none",placeholder:"Détails, notes, liens..."}),(0,t.jsxs)("div",{className:`text-right text-xs mt-1 transition-colors ${(N.description?.length||0)>=500?"text-red-500 font-bold":(N.description?.length||0)>450?"text-orange-500":"text-slate-400"}`,children:[N.description?.length||0," / ",500," caractères"]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-xs font-bold text-slate-500 uppercase mb-1",children:"Catégorie"}),(0,t.jsx)("select",{value:N.category,onChange:e=>k({...N,category:e.target.value}),className:"w-full p-2 bg-white border border-slate-300 rounded-lg text-sm outline-none focus:border-blue-500",children:Object.entries(p).map(([e,s])=>(0,t.jsx)("option",{value:e,children:s.label},e))})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-xs font-bold text-slate-500 uppercase mb-1",children:"Statut"}),(0,t.jsx)("select",{value:N.status,onChange:e=>k({...N,status:e.target.value}),className:"w-full p-2 bg-white border border-slate-300 rounded-lg text-sm outline-none focus:border-blue-500",children:Object.entries(h).map(([e,s])=>(0,t.jsx)("option",{value:e,children:s},e))})]})]})]}),(0,t.jsxs)("div",{className:"p-4 border-t border-slate-200 bg-[#eef2ff] flex justify-end gap-2 shrink-0",children:[N.id&&(0,t.jsx)("button",{onClick:()=>w(N.id),className:"mr-auto text-red-500 hover:text-red-700 text-sm font-medium px-3 py-2",children:"Supprimer"}),(0,t.jsx)("button",{onClick:()=>k(null),className:"px-4 py-2 text-slate-600 hover:bg-slate-200 rounded-lg text-sm font-medium",children:"Annuler"}),(0,t.jsxs)("button",{onClick:()=>{N&&N.title?.trim()&&(N.id?a(e.map(e=>e.id===N.id?{...e,...N}:e)):a([...e,{id:`idea-${Date.now()}`,title:N.title||"",description:N.description||"",category:N.category||"plot",status:N.status||"todo",createdAt:Date.now()}]),k(null))},disabled:!N.title?.trim(),className:"px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-lg text-sm font-medium shadow-sm disabled:opacity-50 flex items-center gap-2",children:[(0,t.jsx)(m.Save,{size:16})," Enregistrer"]})]})]})})]})};var f=e.i(24224);function j(){let{project:e,updateProject:s}=(0,f.useProjectContext)();return(0,t.jsx)(g,{ideas:e.ideas||[],onUpdate:e=>s({ideas:e})})}e.s(["default",()=>j],89250)}]); |