openlearn-next 0.2.8 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/dist/assets/AdminDirectoryView-0XV86Ues.js +1 -0
  2. package/dist/assets/BatchPickerModal-of9a5EJz.js +1 -0
  3. package/dist/assets/ClassesView-CefnsjZ8.js +19 -0
  4. package/dist/assets/CloudDriveModal-DgVQLbO5.js +1 -0
  5. package/dist/assets/ComputerLabView-BId0ZarM.js +1 -0
  6. package/dist/assets/CourseManagement-Cxhc784Q.js +1 -0
  7. package/dist/assets/CourseWizardModal-Da6PKhnU.js +3 -0
  8. package/dist/assets/CoursewareHubPanel-LpUgjqbH.js +1 -0
  9. package/dist/assets/{Dashboard-DQ91dQio.js → Dashboard-LWbFbup4.js} +2 -2
  10. package/dist/assets/ExportWeightModal-Cyg1zMEd.js +1 -0
  11. package/dist/assets/HelpTour-CHPIK2ae.js +1 -0
  12. package/dist/assets/{HelpView-DLAKVpwf.js → HelpView-CvpgBpdr.js} +5 -5
  13. package/dist/assets/ImportLessonsModal-CfWIrW1K.js +1 -0
  14. package/dist/assets/ImportModal-BTfia0Ah.js +1 -0
  15. package/dist/assets/InteractiveCoursewareViewer-CS5BqfJZ.js +1 -0
  16. package/dist/assets/InteractiveWhiteboard-U23CsqGo.js +78 -0
  17. package/dist/assets/{LazyCourseware-g7b8EXR_.js → LazyCourseware-DXL9IxZO.js} +1 -1
  18. package/dist/assets/{LazyWhiteboard-B6rDWBFb.js → LazyWhiteboard-CtkzSFtN.js} +2 -2
  19. package/dist/assets/LessonEditorView-Bfxf4VVB.js +1 -0
  20. package/dist/assets/LiveClassroomView-DHzCM4qQ.js +1 -0
  21. package/dist/assets/NotificationDetailModal-BxrpnlWV.js +1 -0
  22. package/dist/assets/{PluginView-DCY4yi2h.js → PluginView-12qYzmnq.js} +3 -3
  23. package/dist/assets/{ProcessLogsModal-B-PY780w.js → ProcessLogsModal-01S7zsw0.js} +1 -1
  24. package/dist/assets/QuizGeneratorModal-DfZI40Ii.js +1 -0
  25. package/dist/assets/StudentAssignmentView-BP6zbHuM.js +1 -0
  26. package/dist/assets/StudentLessonView-DEpMzrH2.js +1 -0
  27. package/dist/assets/StudentPreviewModal-DCmai53s.js +1 -0
  28. package/dist/assets/StudentView-CcGlfW25.js +2 -0
  29. package/dist/assets/SystemResourceLibraryModal-BzHw1edT.js +1 -0
  30. package/dist/assets/TeacherView-Dw6mKwcv.js +2 -0
  31. package/dist/assets/{TimetableView-BMsjwi-s.js → TimetableView-DJgOlGSf.js} +3 -3
  32. package/dist/assets/index-B-YxO39A.css +1 -0
  33. package/dist/assets/index-C8sCKzmN.js +2 -0
  34. package/dist/assets/index-CYzNsYZB.js +193 -0
  35. package/dist/assets/{index.es-DZ6UeYE-.js → index.es-CfxBkm_z.js} +1 -1
  36. package/dist/assets/{vendor-charts-B7ViBL9w.js → vendor-charts-CRXa4AlU.js} +1 -1
  37. package/dist/assets/vendor-content-CYR4BTuT.js +3 -0
  38. package/dist/assets/{vendor-icons-_c3xpwjZ.js → vendor-icons-Dq6MhgH9.js} +1 -1
  39. package/dist/assets/{vendor-pdf-CVyNPGVr.js → vendor-pdf-Cp-cYteE.js} +2 -2
  40. package/dist/assets/{vendor-pptx-B0hlo0eh.js → vendor-pptx-B_NheIKl.js} +5 -5
  41. package/dist/assets/vendor-utils-BEhuP0Zq.js +1 -0
  42. package/dist/index.html +2 -2
  43. package/dist/server.cjs +1079 -699
  44. package/package.json +9 -6
  45. package/dist/assets/AdminDirectoryView-CD7tW4mc.js +0 -1
  46. package/dist/assets/BatchPickerModal-Bt8Qx0Av.js +0 -1
  47. package/dist/assets/ClassesView-B1B3wlkx.js +0 -19
  48. package/dist/assets/CloudDriveModal-BSZaWIex.js +0 -1
  49. package/dist/assets/ComputerLabView-B6-twB0u.js +0 -1
  50. package/dist/assets/CourseManagement-Bnezm9Vv.js +0 -1
  51. package/dist/assets/CourseWizardModal-BvfTvcQT.js +0 -3
  52. package/dist/assets/CoursewareHubPanel-Cb1mAqHS.js +0 -1
  53. package/dist/assets/ExportWeightModal-al1iIVxb.js +0 -1
  54. package/dist/assets/HelpTour-DwM9UBiA.js +0 -1
  55. package/dist/assets/ImportLessonsModal-DwhvqzY_.js +0 -1
  56. package/dist/assets/ImportModal-CmUt1YeX.js +0 -1
  57. package/dist/assets/InteractiveCoursewareViewer-DWnzq20c.js +0 -1
  58. package/dist/assets/InteractiveWhiteboard-CQ-4meYj.js +0 -102
  59. package/dist/assets/LessonEditorView-DixwX1Kw.js +0 -1
  60. package/dist/assets/LiveClassroomView-j93YOxSh.js +0 -1
  61. package/dist/assets/NotificationDetailModal-CQ9PIqkD.js +0 -1
  62. package/dist/assets/QuizGeneratorModal-BvTcmD68.js +0 -1
  63. package/dist/assets/StudentAssignmentView-4R0WxStx.js +0 -1
  64. package/dist/assets/StudentLessonView-DZ0i9-tX.js +0 -1
  65. package/dist/assets/StudentPreviewModal-CfsB1dPY.js +0 -1
  66. package/dist/assets/StudentView-D7GtUiYR.js +0 -2
  67. package/dist/assets/SystemResourceLibraryModal-Ilnthwpw.js +0 -1
  68. package/dist/assets/TeacherView-DjnjsQ_3.js +0 -2
  69. package/dist/assets/index-CATki2cp.css +0 -1
  70. package/dist/assets/index-D8x6bUeG.js +0 -150
  71. package/dist/assets/index-wdWIWwbg.js +0 -1
  72. package/dist/assets/vendor-content-V6uLfjnH.js +0 -3
  73. package/dist/assets/vendor-utils-4FcTwKPj.js +0 -1
@@ -1 +0,0 @@
1
- import{r as a,j as e}from"./vendor-react-0Lg0vA-4.js";import{F as k,X as M,ad as R,ae as V,a4 as q,r as O,g as X,N as B,af as G,h as J,aa as K}from"./vendor-icons-_c3xpwjZ.js";const Q="@courseware-hub/plugin",W=h=>`${Q}.${h}`;function oe({onClose:h,lang:m}){const[p,T]=a.useState([]),[_,b]=a.useState(!1),[u,z]=a.useState(""),[g,P]=a.useState(""),[y,j]=a.useState(!1),[U,f]=a.useState(null),[n,D]=a.useState(null),[N,F]=a.useState([]),[Y,Z]=a.useState(null),[c,v]=a.useState(""),[w,S]=a.useState(60),[d,C]=a.useState(""),[ee,se]=a.useState(null),[te,ae]=a.useState(""),[re,le]=a.useState(60),i=a.useCallback(async(s,r)=>{const l=await fetch("/api/commands",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({commandType:W(s),payload:r??{}})});if(!l.ok){const $=await l.json();throw new Error($.error||"Command failed")}return(await l.json()).result},[]),o=a.useCallback(async()=>{b(!0);try{const s=await i("courseware.query",{status:g||void 0,search:u||void 0,limit:100});T(s?.items??[])}catch(s){console.error("Fetch courseware list failed:",s)}finally{b(!1)}},[i,g,u]);a.useEffect(()=>{o()},[o]);const L=async()=>{if(!(!c.trim()||!d.trim())){j(!0);try{await i("courseware.upload",{title:c.trim(),html_content:d,pass_score:w}),v(""),C(""),S(60),await o()}catch(s){alert(s.message)}finally{j(!1)}}},E=s=>{const r=s.target.files?.[0];if(!r)return;const l=new FileReader;l.onload=x=>C(x.target?.result??""),l.readAsText(r)},H=async(s,r)=>{const l=r==="published"?"draft":"published";try{await i("courseware.publish",{id:s,status:l}),await o()}catch(x){alert(x.message)}},I=async(s,r)=>{if(confirm(m==="zh"?`确认删除课件「${r}」及其所有版本和成绩数据?`:`Delete "${r}" and all versions/scores?`))try{await i("courseware.delete",{id:s}),await o()}catch(l){alert(l.message)}},A=async s=>{try{const r=await i("courseware.get_detail",{id:s}),l=await i("courseware.query_scores",{courseware_id:s});D(r),F(l?.items??[]),f(s)}catch(r){alert(r.message)}},t=(s,r)=>m==="zh"?s:r;return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 backdrop-blur-sm",children:e.jsxs("div",{className:"bg-white rounded-2xl shadow-2xl border border-gray-200 w-[90vw] max-w-5xl h-[85vh] flex flex-col overflow-hidden",children:[e.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-100 shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 bg-indigo-50 text-indigo-600 rounded-xl",children:e.jsx(k,{size:20})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-bold text-gray-800",children:t("课件管理","Courseware Hub")}),e.jsx("p",{className:"text-xs text-gray-400",children:t("上传 HTML 课件 · 成绩采集 · 版本管理","Upload · Score Collection · Versioning")})]})]}),e.jsx("button",{onClick:h,className:"p-2 hover:bg-gray-100 rounded-lg transition-colors",children:e.jsx(M,{size:18,className:"text-gray-400"})})]}),U?e.jsxs("div",{className:"flex-1 overflow-y-auto p-6",children:[e.jsxs("button",{onClick:()=>f(null),className:"text-sm text-indigo-600 hover:underline mb-4 inline-flex items-center gap-1",children:["← ",t("返回列表","Back to list")]}),n&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"bg-gray-50 rounded-xl p-5 border border-gray-100",children:[e.jsx("h3",{className:"font-bold text-gray-800 mb-3",children:n.title}),e.jsxs("div",{className:"grid grid-cols-2 gap-x-8 gap-y-2 text-sm",children:[e.jsxs("div",{children:[e.jsxs("span",{className:"text-gray-400",children:[t("版本","Version"),":"]})," ",e.jsx("span",{className:"font-mono text-gray-700",children:n.version})]}),e.jsxs("div",{children:[e.jsxs("span",{className:"text-gray-400",children:[t("状态","Status"),":"]})," ",e.jsx("span",{className:`font-bold ${n.status==="published"?"text-green-600":"text-amber-600"}`,children:n.status})]}),e.jsxs("div",{children:[e.jsxs("span",{className:"text-gray-400",children:[t("及格线","Pass Score"),":"]})," ",e.jsx("span",{className:"font-mono",children:n.pass_score})]}),e.jsxs("div",{children:[e.jsxs("span",{className:"text-gray-400",children:[t("提交数","Submissions"),":"]})," ",e.jsx("span",{className:"font-mono",children:n.stats?.submissions??0})]}),e.jsxs("div",{children:[e.jsxs("span",{className:"text-gray-400",children:[t("平均分","Avg Score"),":"]})," ",e.jsx("span",{className:"font-mono text-indigo-600 font-bold",children:n.stats?.avg_score??"-"})]}),e.jsxs("div",{children:[e.jsxs("span",{className:"text-gray-400",children:[t("通过率","Pass Rate"),":"]})," ",e.jsxs("span",{className:"font-mono",children:[n.stats?.pass_rate??"-","%"]})]})]})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-bold text-gray-700 mb-3",children:t("成绩列表","Score List")}),N.length===0?e.jsx("p",{className:"text-sm text-gray-400 italic",children:t("暂无成绩记录","No scores yet")}):e.jsx("div",{className:"overflow-x-auto border border-gray-200 rounded-xl",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{className:"bg-gray-50 text-gray-500 text-xs uppercase",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-4 py-2 text-left",children:t("学生","Student")}),e.jsx("th",{className:"px-4 py-2 text-right",children:t("分数","Score")}),e.jsx("th",{className:"px-4 py-2 text-right",children:t("用时(秒)","Time(s)")}),e.jsx("th",{className:"px-4 py-2 text-right",children:t("提交时间","Submitted")})]})}),e.jsx("tbody",{className:"divide-y divide-gray-100",children:N.map(s=>e.jsxs("tr",{className:"hover:bg-gray-50",children:[e.jsx("td",{className:"px-4 py-2 font-medium text-gray-700",children:s.student_name||s.student_id}),e.jsxs("td",{className:`px-4 py-2 text-right font-mono font-bold ${s.score>=(n?.pass_score??60)?"text-green-600":"text-red-500"}`,children:[s.score,"/",s.total]}),e.jsx("td",{className:"px-4 py-2 text-right text-gray-500",children:s.time_spent}),e.jsx("td",{className:"px-4 py-2 text-right text-gray-400 text-xs",children:new Date(s.submitted_at).toLocaleString()})]},s.id))})]})})]})]})]}):e.jsxs("div",{className:"flex-1 flex flex-col min-h-0",children:[e.jsxs("div",{className:"px-6 py-3 border-b border-gray-100 flex items-center gap-3 shrink-0 flex-wrap",children:[e.jsxs("div",{className:"relative flex-1 min-w-[200px]",children:[e.jsx(R,{size:14,className:"absolute left-3 top-2.5 text-gray-400"}),e.jsx("input",{value:u,onChange:s=>z(s.target.value),placeholder:t("搜索课件...","Search courseware..."),className:"w-full pl-9 pr-3 py-2 text-sm border border-gray-200 rounded-lg focus:ring-1 focus:ring-indigo-500 outline-none"})]}),e.jsxs("select",{value:g,onChange:s=>P(s.target.value),className:"text-sm border border-gray-200 rounded-lg px-3 py-2 outline-none focus:ring-1 focus:ring-indigo-500 bg-white",children:[e.jsx("option",{value:"",children:t("全部状态","All Status")}),e.jsx("option",{value:"published",children:t("已发布","Published")}),e.jsx("option",{value:"draft",children:t("草稿","Draft")}),e.jsx("option",{value:"archived",children:t("已归档","Archived")})]}),e.jsx("button",{onClick:o,className:"p-2 hover:bg-gray-100 rounded-lg transition-colors",title:t("刷新","Refresh"),children:e.jsx(V,{size:16,className:"text-gray-400"})})]}),e.jsx("div",{className:"px-6 py-4 border-b border-gray-100 bg-indigo-50/30 shrink-0",children:e.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[e.jsxs("span",{className:"text-sm font-bold text-gray-600 shrink-0",children:[t("上传课件","Upload"),":"]}),e.jsx("input",{value:c,onChange:s=>v(s.target.value),placeholder:t("课件标题","Title"),className:"text-sm border border-gray-200 rounded-lg px-3 py-2 w-40 outline-none focus:ring-1 focus:ring-indigo-500"}),e.jsx("input",{type:"number",value:w,onChange:s=>S(Number(s.target.value)),placeholder:t("及格线","Pass"),className:"text-sm border border-gray-200 rounded-lg px-3 py-2 w-20 outline-none focus:ring-1 focus:ring-indigo-500"}),e.jsxs("label",{className:"text-sm px-3 py-2 border border-dashed border-gray-300 rounded-lg cursor-pointer hover:border-indigo-400 hover:bg-white transition-colors text-gray-500",children:[e.jsx(q,{size:14,className:"inline mr-1"}),d?t("已选择文件","File selected"):t("选择 HTML","Select HTML"),e.jsx("input",{type:"file",accept:".html,.htm",onChange:E,className:"hidden"})]}),e.jsx("button",{onClick:L,disabled:y||!c.trim()||!d.trim(),className:"px-4 py-2 bg-indigo-600 text-white text-sm font-bold rounded-lg hover:bg-indigo-700 disabled:opacity-40 transition-colors",children:y?t("上传中...","Uploading..."):t("上传","Upload")})]})}),e.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:_?e.jsx("div",{className:"text-center py-12 text-gray-400",children:t("加载中...","Loading...")}):p.length===0?e.jsxs("div",{className:"text-center py-12 text-gray-400",children:[e.jsx(k,{size:40,className:"mx-auto mb-3 opacity-30"}),e.jsx("p",{children:t("暂无课件,请上传您的第一个 HTML 课件","No courseware yet. Upload your first HTML courseware.")})]}):e.jsx("div",{className:"grid gap-4",children:p.map(s=>e.jsx("div",{className:"bg-white border border-gray-200 rounded-xl p-4 hover:border-indigo-200 transition-colors shadow-sm",children:e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("h4",{className:"font-bold text-gray-800 truncate",children:s.title}),e.jsx("span",{className:`text-[10px] px-2 py-0.5 rounded-full font-bold ${s.status==="published"?"bg-green-50 text-green-650 border border-green-200":s.status==="archived"?"bg-gray-50 text-gray-500 border border-gray-200":"bg-amber-50 text-amber-650 border border-amber-200"}`,children:s.status==="published"?t("已发布","Published"):s.status==="archived"?t("已归档","Archived"):t("草稿","Draft")}),e.jsxs("span",{className:"text-[10px] text-gray-400 font-mono",children:["v",s.version]})]}),s.description&&e.jsx("p",{className:"text-xs text-gray-400 line-clamp-2 mb-2",children:s.description}),e.jsxs("div",{className:"flex items-center gap-4 text-xs text-gray-400",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(O,{size:12}),t("提交","Subs"),": ",s.stats?.submissions??0]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(X,{size:12}),t("均分","Avg"),": ",s.stats?.avg_score??"-"]}),s.security_warnings?.length>0&&e.jsxs("span",{className:"text-amber-500 flex items-center gap-1",title:s.security_warnings.join(", "),children:["⚠ ",s.security_warnings.length]})]})]}),e.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[e.jsx("button",{onClick:()=>A(s.id),className:"p-1.5 hover:bg-gray-100 rounded-lg transition-colors",title:t("详情","Details"),children:e.jsx(B,{size:15,className:"text-gray-400"})}),e.jsx("button",{onClick:()=>H(s.id,s.status),className:"p-1.5 hover:bg-gray-100 rounded-lg transition-colors",title:s.status==="published"?t("下架","Unpublish"):t("发布","Publish"),children:s.status==="published"?e.jsx(G,{size:15,className:"text-amber-500"}):e.jsx(J,{size:15,className:"text-green-500"})}),e.jsx("button",{onClick:()=>I(s.id,s.title),className:"p-1.5 hover:bg-red-50 rounded-lg transition-colors",title:t("删除","Delete"),children:e.jsx(K,{size:15,className:"text-red-400"})})]})]})},s.id))})})]})]})})}export{oe as CoursewareHubPanel};
@@ -1 +0,0 @@
1
- import{j as e}from"./vendor-react-0Lg0vA-4.js";import{m as z}from"./index-D8x6bUeG.js";import{ab as k,ac as C,R as S,T as $,a5 as q}from"./vendor-icons-_c3xpwjZ.js";import"./vendor-utils-4FcTwKPj.js";import"./vendor-pdf-CVyNPGVr.js";import"./vendor-motion-DjY2czvL.js";import"./vendor-charts-B7ViBL9w.js";function E({isExportWeightModalOpen:p,setIsExportWeightModalOpen:x,lang:s,quizzesWeight:g,setQuizzesWeight:h,assignmentsWeight:m,setAssignmentsWeight:b,handleQuizzesWeightChange:f,handleAssignmentsWeightChange:j,customCategoryOverrides:u,setCustomCategoryOverrides:y,classDashboardMap:i,exportClassId:r,exportClassName:N,csvPreviewData:n,handleExportGrades:v}){return p?e.jsx("div",{className:"fixed inset-0 bg-gray-900/40 backdrop-blur-sm flex items-center justify-center p-6 z-50",children:e.jsxs(z.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},className:"bg-white border text-gray-900 border-gray-200 rounded-2xl shadow-2xl w-full max-w-2xl flex flex-col overflow-hidden max-h-[85vh]",children:[e.jsxs("div",{className:"p-4 border-b border-gray-100 flex items-center justify-between bg-gray-50/80 shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(k,{className:"text-indigo-600 font-sans",size:20}),e.jsx("h2",{className:"font-bold text-gray-800 text-lg font-sans",children:s==="zh"?"导出成绩权重设置":"Grade Export & Weighting Settings"})]}),e.jsx("button",{onClick:()=>x(!1),className:"text-gray-400 hover:text-gray-600 font-bold p-1 hover:bg-gray-200 rounded transition-colors text-lg",children:"×"})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-6",children:[e.jsx("div",{className:"bg-indigo-50 border border-indigo-150 rounded-xl p-4 text-indigo-800 text-xs font-sans leading-relaxed",children:s==="zh"?"您可以自定义测验与作业在期末成绩(平均分)中的计算权重。系统已根据测验名和内容自动对课程内容进行分类,您可以在下方手动微调分类。":"Customize the calculation weight of quizzes and assignments in the calculated average score. The system automatically classifies items, but you can manually override categorized groups below."}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("h3",{className:"font-bold text-sm text-gray-800 flex items-center gap-2 font-sans",children:[e.jsx(C,{size:16,className:"text-indigo-500 font-sans"}),s==="zh"?"定义成绩占比权重":"Define Weighting Percentages"]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 bg-gray-50 p-4 rounded-xl border border-gray-100 font-sans",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-semibold text-gray-700",children:s==="zh"?"测验权重 (Quizzes)":"Quizzes Weight"}),e.jsxs("span",{className:"text-xs font-bold text-indigo-600 bg-indigo-50 px-2 py-0.5 rounded border border-indigo-100",children:[g,"%"]})]}),e.jsx("input",{type:"range",min:"0",max:"100",value:g,onChange:t=>f(Number(t.target.value)),className:"w-full h-1.5 bg-gray-200 rounded-lg appearance-none cursor-pointer accent-indigo-600"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-semibold text-gray-700",children:s==="zh"?"作业权重 (Assignments)":"Assignments Weight"}),e.jsxs("span",{className:"text-xs font-bold text-indigo-600 bg-indigo-50 px-2 py-0.5 rounded border border-indigo-100",children:[m,"%"]})]}),e.jsx("input",{type:"range",min:"0",max:"100",value:m,onChange:t=>j(Number(t.target.value)),className:"w-full h-1.5 bg-gray-200 rounded-lg appearance-none cursor-pointer accent-indigo-600"})]})]}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx("button",{type:"button",onClick:()=>{h(50),b(50)},className:"text-[10px] text-gray-500 hover:text-gray-700 bg-white border border-gray-200 hover:bg-gray-50 font-bold px-2.5 py-1 rounded transition-colors cursor-pointer",children:s==="zh"?"均衡配比 50/50":"Balance 50/50"}),e.jsx("button",{type:"button",onClick:()=>{h(40),b(60)},className:"text-[10px] text-gray-500 hover:text-gray-700 bg-white border border-gray-200 hover:bg-gray-50 font-bold px-2.5 py-1 rounded transition-colors cursor-pointer",children:s==="zh"?"推荐配比 40/60":"Recommend 40/60"})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("h3",{className:"font-bold text-sm text-gray-800 flex items-center justify-between font-sans",children:[e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(S,{size:16,className:"text-indigo-500"}),s==="zh"?"期末考核项目微调":"Item Categorization Overrides"]}),e.jsx("span",{className:"text-[10px] text-gray-400 font-medium font-sans",children:s==="zh"?`共 ${i[r]?.assignments?.length||0} 项`:`${i[r]?.assignments?.length||0} items total`})]}),e.jsxs("div",{className:"border border-gray-150 rounded-xl overflow-hidden divide-y divide-gray-100 max-h-60 overflow-y-auto bg-white shadow-inner",children:[(i[r]?.assignments||[]).map(t=>{const d=t.content&&t.content.startsWith('{"quizType":"mcq_learning_objectives"'),l=t.title&&(t.title.toLowerCase().includes("quiz")||t.title.toLowerCase().includes("test")||t.title.includes("测验")||t.title.includes("测试")),o=d||l?"quiz":"assignment",a=u[t.id]||o;return e.jsxs("div",{className:"p-3 flex items-center justify-between gap-4 font-sans hover:bg-gray-50/50 transition-colors",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"font-semibold text-xs text-gray-800 truncate",title:t.title,children:t.title}),e.jsx("div",{className:"text-[10px] text-gray-400 truncate mt-0.5",children:t.description||(s==="zh"?"无描述信息":"No description provided")})]}),e.jsxs("div",{className:"flex border border-gray-200 rounded-lg p-0.5 bg-gray-50 shrink-0",children:[e.jsx("button",{type:"button",onClick:()=>y(c=>({...c,[t.id]:"quiz"})),className:`px-2.5 py-1 text-[10px] font-bold rounded-md transition-all cursor-pointer ${a==="quiz"?"bg-indigo-600 text-white shadow":"text-gray-500 hover:text-gray-800 hover:bg-gray-100"}`,children:s==="zh"?"测验":"Quiz"}),e.jsx("button",{type:"button",onClick:()=>y(c=>({...c,[t.id]:"assignment"})),className:`px-2.5 py-1 text-[10px] font-bold rounded-md transition-all cursor-pointer ${a==="assignment"?"bg-emerald-600 text-white shadow":"text-gray-500 hover:text-gray-800 hover:bg-gray-100"}`,children:s==="zh"?"作业":"Assignment"})]})]},t.id)}),(!i[r]?.assignments||i[r].assignments.length===0)&&e.jsx("div",{className:"p-8 text-center text-xs text-gray-400 italic",children:s==="zh"?"此班级暂未创建任何考核项目":"No graded items exist in this class."})]})]}),n&&n.rows.length>0&&e.jsxs("div",{className:"space-y-3 pt-2",children:[e.jsxs("h3",{className:"font-bold text-sm text-gray-800 flex items-center justify-between font-sans",children:[e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx($,{size:16,className:"text-emerald-500"}),s==="zh"?"CSV 实时成绩表预览 (前5行数据)":"Live CSV Grade Preview (First 5 Rows)"]}),e.jsx("span",{className:"text-[10px] bg-emerald-50 text-emerald-700 border border-emerald-100 font-bold px-2 py-0.5 rounded shadow-xs font-sans",children:s==="zh"?`展示 5 / ${n.totalStudents} 名学生`:`Showing 5 of ${n.totalStudents} students`})]}),e.jsx("div",{className:"border border-gray-150 rounded-xl overflow-hidden bg-white shadow-xs max-w-full",children:e.jsx("div",{className:"overflow-x-auto max-h-56 overflow-y-auto",children:e.jsxs("table",{className:"w-full border-collapse text-left",children:[e.jsx("thead",{children:e.jsx("tr",{className:"bg-gray-50 border-b border-gray-150 sticky top-0 z-10",children:n.headers.map((t,d)=>{const l=t.includes("Average")||t.includes("Avg")||t.includes("Score"),o=t.includes("Weighted");return e.jsx("th",{className:`p-2.5 text-[10px] font-bold tracking-wider uppercase border-r border-gray-150 whitespace-nowrap font-sans font-semibold ${o?"text-indigo-700 bg-indigo-50/70 border-indigo-150 font-bold":l?"text-emerald-700 bg-emerald-50/70":"text-gray-500"}`,children:t},d)})})}),e.jsx("tbody",{className:"divide-y divide-gray-100",children:n.rows.map((t,d)=>e.jsx("tr",{className:"hover:bg-gray-50/50 transition-colors font-mono text-[10px]",children:t.map((l,o)=>{const a=n.headers[o]||"",c=a.includes("Weighted"),w=a.includes("Average")||a.includes("Avg")||a.includes("Score");return e.jsx("td",{className:`p-2 border-r border-gray-100 font-mono text-[10px] text-gray-700 whitespace-nowrap text-center ${c?"bg-indigo-50/30 font-bold text-indigo-700 border-indigo-100":w?"bg-emerald-50/10 font-semibold text-emerald-800":o<2?"text-left font-sans font-medium":""}`,children:l},o)})},d))})]})})}),e.jsx("p",{className:"text-[10px] text-gray-400 font-sans italic",children:s==="zh"?"* 改变上方权重占比或调整项目分类时,此预览与计算结果会立即实时刷新。":"* Calculations and layout values in this preview refresh dynamically as you tweak sliders and overrides."})]})]}),e.jsxs("div",{className:"p-4 border-t border-gray-100 bg-gray-50/85 flex justify-end gap-2.5 shrink-0",children:[e.jsx("button",{type:"button",onClick:()=>x(!1),className:"px-4 py-2 text-xs font-semibold border border-gray-300 text-gray-700 bg-white rounded-lg hover:bg-gray-100 transition-colors cursor-pointer",children:s==="zh"?"取消":"Cancel"}),e.jsxs("button",{type:"button",disabled:!i[r]?.assignments||i[r].assignments.length===0,onClick:()=>{v(r,N,g,m,u),x(!1)},className:"px-4 py-2 text-xs font-bold bg-indigo-600 text-white border border-indigo-700 rounded-lg hover:bg-indigo-700 hover:shadow shadow-sm transition-all flex items-center gap-1.5 cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",children:[e.jsx(q,{size:14}),s==="zh"?"导出 CSV 成绩表":"Export Grade Sheet"]})]})]})}):null}export{E as ExportWeightModal};
@@ -1 +0,0 @@
1
- import{r,j as e}from"./vendor-react-0Lg0vA-4.js";import{f as b,X as R,o as T,a3 as W,_ as B}from"./vendor-icons-_c3xpwjZ.js";function P({isOpen:x,onClose:l,lang:s,onSeedSuccess:z,onJumpTab:N}){const[n,h]=r.useState(0),[v,w]=r.useState(!1),[F,y]=r.useState(null),[I,S]=r.useState(null),[k,p]=r.useState({display:"none"}),[C,m]=r.useState({display:"none"}),L=r.useRef(null),d=[{targetId:"",title:s==="zh"?"欢迎来到 OpenLearn Next V2 平台!":"Welcome to OpenLearn Next V2!",content:s==="zh"?"本平台为数字课堂提供智能白板与教学插件生态托管。下面我们将通过 4 步带您快速完成初始化并体验一堂数字互动课程。":"Welcome! This platform provides interactive whiteboards and educational plugin hosting. Let's set up your first class in 4 quick steps."},{targetId:"nav_btn_admin_directory",title:s==="zh"?"第 1 步:一键初始化示例课程":"Step 1: Initialize Example Class",content:s==="zh"?"在开始授课前,我们需要一个授课班级。请点击下方的按钮,系统将自动在数据库中为您建立示例班级、添加 5 名演示学生(小明、小红等),并自动排定一节今日的白板创意编程示范课!":"Before teaching, we need a classroom session. Click the button below to seed a demo class, add 5 sample students (Xiao Ming, Xiao Hong, etc.), and schedule today's creative programming class!",actionable:!0},{targetId:"navigation_sidebar",title:s==="zh"?"第 2 步:了解系统导航菜单":"Step 2: Tour System Navigation",content:s==="zh"?"初始化成功后,您可以在「系统导航」的「班级管理」中查看学生名册及座位表,或在「课程管理」中编辑白板教案。在「插件中心」中,您还可以安装/停用丰富的第三方小工具。":'After setup, explore the sidebar! Use "Classes & Students" to manage student profiles, "Courses" to edit whiteboards, and "Plugins" to manage tools.'},{targetId:"nav_btn_live_class",title:s==="zh"?"第 3 步:进入互动课堂开启体验":"Step 3: Launch Live Classroom",content:s==="zh"?"一切就绪!点击下方的「一键开课并进入课堂」,系统将为您自动进入示范课堂并展开互动白板。您可以在白板上下发测验、进行实时统计,学生端也将实时接收广播。":'All set! Click "Launch Classroom" to enter the live room. You can draw on the whiteboard, push quizzes, and view live stats, while student clients auto-sync.'}],_=async()=>{w(!0);try{const i=await fetch("/api/admin/seed-demo",{method:"POST"});if(i.ok){const t=await i.json();t.success&&(S({classId:t.classId,className:"人工智能与创意编程示范班"}),z({classId:t.classId,scheduleId:t.scheduleId,lessonId:t.lessonId}),setTimeout(()=>{h(2)},1500))}else{const t=await i.json().catch(()=>({error:"未知错误"}));y(s==="zh"?`初始化失败:${t.error||"请检查服务器日志"}`:`Failed: ${t.error||"Check server logs"}`)}}catch(i){console.error("Failed to seed demo data:",i),y(s==="zh"?`网络错误:${i.message||"请检查服务器是否运行"}`:`Network error: ${i.message||"Check if server is running"}`)}finally{w(!1)}},E=()=>{localStorage.setItem("edu_os_tour_completed","true"),N("live_class"),l()};if(r.useEffect(()=>{if(!x)return;const i=d[n];if(!i||!i.targetId){p({display:"none"}),m({position:"fixed",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:1e4,width:"420px",maxWidth:"90vw"});return}const t=()=>{const j=document.getElementById(i.targetId);if(!j){p({display:"none"}),m({position:"fixed",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:1e4,width:"420px",maxWidth:"90vw"});return}const o=j.getBoundingClientRect(),c=6;p({display:"block",position:"fixed",top:`${o.top-c}px`,left:`${o.left-c}px`,width:`${o.width+c*2}px`,height:`${o.height+c*2}px`,boxShadow:"0 0 0 9999px rgba(15, 23, 42, 0.65)",border:"2px dashed #6366f1",borderRadius:"12px",zIndex:9999,pointerEvents:"none",transition:"all 0.25s cubic-bezier(0.4, 0, 0.2, 1)"});const u=360;let f=o.left+o.width+16,g=o.top;f+u>window.innerWidth&&(f=Math.max(16,o.left-u-16)),g+240>window.innerHeight&&(g=Math.max(16,window.innerHeight-250)),m({display:"block",position:"fixed",top:`${g}px`,left:`${f}px`,width:`${u}px`,zIndex:1e4,transition:"all 0.25s cubic-bezier(0.4, 0, 0.2, 1)"})};t(),window.addEventListener("resize",t),window.addEventListener("scroll",t,!0);const $=setInterval(t,300);return()=>{window.removeEventListener("resize",t),window.removeEventListener("scroll",t,!0),clearInterval($)}},[x,n]),!x)return null;const a=d[n];return e.jsxs("div",{className:"fixed inset-0 overflow-hidden select-none",style:{zIndex:9998},children:[a&&!a.targetId&&e.jsx("div",{className:"fixed inset-0 bg-slate-900/65 backdrop-blur-2xs transition-opacity",onClick:l}),e.jsx("div",{style:k}),e.jsxs("div",{ref:L,style:C,className:"bg-white rounded-2xl border border-slate-150/60 shadow-2xl p-5 md:p-6 text-gray-900 font-sans flex flex-col justify-between",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between items-start mb-3",children:[e.jsxs("h3",{className:"font-extrabold text-sm md:text-base text-gray-900 flex items-center gap-1.5 leading-tight",children:[e.jsx(b,{size:16,className:"text-indigo-500 animate-pulse shrink-0"}),a.title]}),e.jsx("button",{onClick:l,className:"text-gray-400 hover:text-gray-600 rounded-lg p-0.5 transition-colors cursor-pointer",children:e.jsx(R,{size:16})})]}),e.jsx("p",{className:"text-xs md:text-sm text-gray-600 leading-relaxed font-medium mb-5 whitespace-pre-wrap",children:a.content}),a.actionable&&e.jsx("div",{className:"bg-slate-50 border border-slate-200/80 rounded-xl p-3.5 mb-5 flex flex-col items-center justify-center",children:I?e.jsxs("div",{className:"flex items-center gap-2 text-emerald-600 text-xs font-bold animate-bounce",children:[e.jsx(T,{size:12,className:"fill-emerald-600"}),s==="zh"?"示范课程与学生名册初始化成功!":"Demo classes successfully initialized!"]}):e.jsx("button",{onClick:_,disabled:v,className:"w-full flex items-center justify-center gap-1.5 py-2.5 px-4 bg-indigo-600 hover:bg-indigo-700 text-white font-bold text-xs md:text-sm rounded-lg hover:shadow-md transition-all cursor-pointer disabled:bg-indigo-400",children:v?e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsxs("svg",{className:"animate-spin h-4 w-4 text-white",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),s==="zh"?"正在创建数据库记录...":"Initializing DB records..."]}):e.jsxs(e.Fragment,{children:[e.jsx(b,{size:14,className:"animate-pulse"}),s==="zh"?"一键初始化示范数据":"Initialize Example Data"]})})})]}),e.jsxs("div",{className:"flex items-center justify-between border-t border-slate-100 pt-4 shrink-0",children:[e.jsx("div",{className:"flex items-center gap-1.5",children:d.map((i,t)=>e.jsx("div",{className:`h-1.5 rounded-full transition-all duration-300 ${t===n?"w-4 bg-indigo-600":"w-1.5 bg-slate-200"}`},t))}),e.jsxs("div",{className:"flex items-center gap-2",children:[n>0?e.jsxs("button",{onClick:()=>h(i=>i-1),className:"flex items-center gap-1 px-3 py-1.5 border border-slate-200 rounded-lg text-xs font-semibold text-slate-600 hover:bg-slate-50 transition-colors cursor-pointer",children:[e.jsx(W,{size:12}),s==="zh"?"上一步":"Back"]}):e.jsx("button",{onClick:l,className:"px-3 py-1.5 border border-slate-200 rounded-lg text-xs font-semibold text-slate-500 hover:bg-slate-50 transition-colors cursor-pointer",children:s==="zh"?"跳过向导":"Skip Tour"}),n<d.length-1?e.jsxs("button",{onClick:()=>h(i=>i+1),className:"flex items-center gap-1 px-3 py-1.5 bg-slate-900 text-white rounded-lg text-xs font-semibold hover:bg-slate-800 transition-colors cursor-pointer",children:[s==="zh"?"下一步":"Next",e.jsx(B,{size:12})]}):e.jsxs("button",{onClick:E,className:"flex items-center gap-1 px-4 py-1.5 bg-indigo-600 hover:bg-indigo-700 text-white rounded-lg text-xs font-bold shadow-sm transition-colors cursor-pointer",children:[s==="zh"?"结束引导并开课":"Launch Classroom",e.jsx(b,{size:12})]})]})]})]})]})}export{P as HelpTour};
@@ -1 +0,0 @@
1
- import{j as e}from"./vendor-react-0Lg0vA-4.js";import{m as v}from"./index-D8x6bUeG.js";import{a4 as g,a5 as N,l as w,g as C,y as z}from"./vendor-icons-_c3xpwjZ.js";import"./vendor-utils-4FcTwKPj.js";import"./vendor-pdf-CVyNPGVr.js";import"./vendor-motion-DjY2czvL.js";import"./vendor-charts-B7ViBL9w.js";function L(h){const{isImportLessonsOpen:p,setIsImportLessonsOpen:i,lang:s,importStatus:r,setIsDraggingImport:d,handleCSVFileChange:x,downloadCsvTemplate:b,isDraggingImport:u,previewImportData:a,setPreviewImportData:m,setImportStatus:c,importProgress:l,importProgressTotal:n,importErrorMsg:f,setImportErrorMsg:y,handleCSVImportSubmit:j}=h;return e.jsx(e.Fragment,{children:p&&e.jsx("div",{className:"fixed inset-0 bg-gray-900/50 backdrop-blur-sm flex items-center justify-center p-4 md:p-6 z-50 overflow-y-auto text-gray-850",children:e.jsxs(v.div,{initial:{opacity:0,y:15,scale:.98},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:10,scale:.98},className:"bg-white border text-gray-900 border-gray-250 rounded-2xl shadow-2xl w-full max-w-2xl flex flex-col overflow-hidden max-h-[90vh] font-sans text-left",children:[e.jsxs("div",{className:"p-4 md:p-5 border-b border-gray-100 flex items-center justify-between bg-slate-50 shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 bg-indigo-50 border border-indigo-100 rounded-lg text-indigo-650",children:e.jsx(g,{size:20,className:"animate-pulse"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"font-bold text-gray-850 text-base md:text-lg",children:s==="zh"?"批量导入课程 (CSV)":"Bulk-Import Courses (CSV)"}),e.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:s==="zh"?"上传包含标准表头的 CSV 教案,一键实现秒级批量底库写入。":"Upload a standard CSV file matching our predefined schema to perform instantaneous bulk curriculum imports."})]})]}),e.jsx("button",{onClick:()=>{r!=="importing"&&i(!1)},disabled:r==="importing",className:"text-gray-400 hover:text-gray-650 font-bold p-1 rounded-lg hover:bg-gray-150 transition-all text-xl leading-none disabled:opacity-40",children:"×"})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-5",children:[r==="idle"&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"p-4 bg-indigo-50/50 border border-indigo-100 rounded-xl",children:[e.jsxs("h4",{className:"text-xs font-bold text-indigo-850 uppercase tracking-wide flex items-center gap-1",children:[e.jsx("span",{children:"📌"}),s==="zh"?"预定义数据格式说明":"Predefined Schema Information"]}),e.jsx("p",{className:"text-xs text-indigo-900 mt-1 leading-relaxed",children:s==="zh"?"CSV 文件的首行必须 define 列标题(分大小写且无多余空格),包含以下两项必需内容:":"Your CSV file must include exactly these header columns on the first row (case-insensitive):"}),e.jsxs("ul",{className:"list-disc pl-5 mt-2 text-xs text-indigo-950 space-y-1",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"title"}),": ",s==="zh"?'课程名 (非空,例如 "代数几何")':'Course title (Required, e.g. "Linear Algebra")']}),e.jsxs("li",{children:[e.jsx("strong",{children:"content"}),": ",s==="zh"?"教学大纲 / Markdown 格式的课堂细目":"Syllabus content supporting rich markdown."]})]}),e.jsx("div",{className:"mt-3.5 flex justify-start",children:e.jsxs("button",{onClick:b,className:"flex items-center gap-1 p-2 text-xs font-bold text-indigo-700 bg-white border border-indigo-200 rounded-lg shadow-3xs hover:bg-indigo-50 hover:-translate-y-0.5 hover:shadow-xs transition-all cursor-pointer",children:[e.jsx(N,{size:12}),s==="zh"?"获取标准 CSV 模板":"Download Template CSV"]})})]}),e.jsxs("div",{onDragOver:t=>{t.preventDefault(),d(!0)},onDragLeave:()=>d(!1),onDrop:t=>{t.preventDefault(),d(!1),t.dataTransfer.files&&t.dataTransfer.files[0]&&x(t.dataTransfer.files[0])},onClick:()=>{document.getElementById("import-csv-file-picker")?.click()},className:`border-2 border-dashed rounded-2xl p-8 text-center cursor-pointer transition-all flex flex-col items-center justify-center min-h-[180px] ${u?"border-indigo-500 bg-indigo-50/70 scale-[1.01]":"border-gray-250 bg-gray-50/50 hover:bg-gray-50 hover:border-indigo-400"}`,children:[e.jsx("input",{id:"import-csv-file-picker",type:"file",accept:".csv",className:"hidden",onChange:t=>{t.target.files&&t.target.files[0]&&x(t.target.files[0])}}),e.jsx("div",{className:"p-3 bg-gray-100 border border-gray-200 rounded-full text-indigo-600 mb-3 group-hover:scale-105 transition-all",children:e.jsx(g,{size:24})}),e.jsx("span",{className:"text-sm font-bold text-gray-800",children:s==="zh"?"选择 CSV 文件或拖放至此处":"Click to select or drag and drop CSV file here"}),e.jsx("span",{className:"text-xs text-gray-400 mt-1",children:s==="zh"?"支持标准 CSV 文件,最大不超过 5MB":"Supports standard CSV format up to 5MB"})]})]}),r==="parsing"&&a.length>0&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"text-xs font-bold text-emerald-600 bg-emerald-50 border border-emerald-200 px-2.5 py-1 rounded-full",children:["✓ ",s==="zh"?`解析成功:查找到 ${a.length} 门课程`:`Parsed Successfully: Found ${a.length} records`]}),e.jsx("button",{onClick:()=>{m([]),c("idle")},className:"text-xs text-indigo-600 hover:text-indigo-800 font-semibold",children:s==="zh"?"重新上传":"Upload Different File"})]}),e.jsx("div",{className:"border border-gray-200 rounded-xl overflow-hidden shadow-3xs max-h-[300px] overflow-y-auto",children:e.jsxs("table",{className:"w-full text-left text-xs border-collapse",children:[e.jsx("thead",{className:"bg-gray-50 text-gray-600 border-b border-gray-200 font-bold",children:e.jsxs("tr",{children:[e.jsx("th",{className:"p-3 w-1/4",children:s==="zh"?"课程名称":"Course Title"}),e.jsx("th",{className:"p-3 w-3/4",children:s==="zh"?"大纲简介片段":"Syllabus Preview"})]})}),e.jsx("tbody",{className:"divide-y divide-gray-100 bg-white",children:a.map((t,o)=>e.jsxs("tr",{className:"hover:bg-slate-50/50",children:[e.jsx("td",{className:"p-3 font-semibold text-gray-800 align-top truncate max-w-[150px]",title:t.title,children:t.title}),e.jsx("td",{className:"p-3 text-gray-500 font-mono text-[11px] leading-relaxed break-words col-span-2",children:t.content.length>150?t.content.substring(0,150)+"...":t.content||e.jsx("em",{className:"text-gray-300 italic",children:"None"})})]},o))})]})}),e.jsxs("div",{className:"bg-amber-50 border border-amber-100 text-amber-900 text-xs rounded-xl p-3 flex gap-2.5 items-start",children:[e.jsx("span",{className:"text-base leading-none",children:"⚠️"}),e.jsx("p",{className:"leading-relaxed",children:s==="zh"?'请确认课程名称没有与系统已有的课程同名。确认无误后点击下方"开始导入"写入 SQLite。':"Please ensure column details are accurate. Clicking Import will instantly commit all parsed courses into the server SQLite backend."})]})]}),r==="importing"&&e.jsxs("div",{className:"py-8 flex flex-col items-center justify-center space-y-4",children:[e.jsxs("div",{className:"relative w-20 h-20 flex items-center justify-center",children:[e.jsx(w,{size:36,className:"text-indigo-600 animate-spin"}),e.jsxs("span",{className:"absolute text-[11px] font-extrabold text-indigo-700",children:[Math.round(l/n*100),"%"]})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("h3",{className:"font-bold text-gray-800 text-sm",children:s==="zh"?"正在写入数据库":"Populating Database Records"}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:s==="zh"?`正在导入第 ${l} / ${n} 项...`:`Importing item ${l} of ${n}...`})]}),e.jsx("div",{className:"w-full max-w-sm bg-gray-100 h-2 rounded-full overflow-hidden border border-gray-200",children:e.jsx("div",{className:"bg-indigo-600 h-full transition-all duration-300 rounded-full",style:{width:`${l/n*100}%`}})}),e.jsxs("div",{className:"w-full max-w-md bg-gray-50 rounded-xl p-3 border border-gray-150 font-mono text-[10px] text-gray-400 max-h-[140px] overflow-y-auto",children:[e.jsx("div",{children:"[API] POST /api/lessons -> Request batch transaction..."}),a.slice(0,l).map((t,o)=>e.jsx("div",{className:"text-indigo-600 font-bold mt-1",children:`✓ [${o+1}] "${t.title}" -> status 200 (Success)`},o))]})]}),r==="success"&&e.jsxs("div",{className:"py-8 text-center flex flex-col items-center justify-center space-y-4",children:[e.jsx("div",{className:"w-16 h-16 bg-emerald-50 rounded-full flex items-center justify-center border border-emerald-200 text-emerald-600 animate-bounce",children:e.jsx(C,{size:32})}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-bold text-gray-800 text-base",children:s==="zh"?"🎉 批量导入大功告成":"🎉 Bulk-Import Complete"}),e.jsx("p",{className:"text-xs text-gray-500 mt-1 max-w-md mx-auto",children:s==="zh"?`所有 ${a.length} 门学科教案数据已顺畅写入系统底层 SQLite 数据仓库,现在已可以用于备课。`:`All ${a.length} curriculum lessons records have been successfully saved into security logs and SQLite storage.`})]})]}),r==="error"&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"p-4 bg-rose-50 border border-rose-100 rounded-xl flex gap-3 items-start",children:[e.jsx("span",{className:"text-rose-600 font-bold text-lg leading-none",children:"⚠️"}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs font-bold text-rose-850",children:s==="zh"?"数据导入或解析中断":"Import or Parsing Error"}),e.jsx("p",{className:"text-xs text-rose-900 mt-1 leading-relaxed",children:f||(s==="zh"?"未知异常或文件破损。":"An unknown exception or corrupted CSV formatting occurred.")})]})]}),e.jsxs("div",{className:"flex gap-3 justify-end",children:[e.jsx("button",{onClick:()=>{c("idle"),y("")},className:"px-4 py-2 text-xs font-bold text-gray-700 bg-white border border-gray-250 cursor-pointer hover:bg-gray-50 rounded-lg transition-all",children:s==="zh"?"返回重试":"Go Back & Retry"}),e.jsx("button",{onClick:()=>i(!1),className:"px-4 py-2 text-xs font-bold text-white bg-indigo-600 cursor-pointer hover:bg-indigo-700 rounded-lg transition-all",children:s==="zh"?"关闭窗口":"Close"})]})]})]}),r!=="idle"&&r!=="error"&&e.jsxs("div",{className:"p-4 md:p-5 border-t border-gray-100 flex items-center justify-between bg-slate-50 shrink-0",children:[e.jsx("button",{onClick:()=>{m([]),c("idle")},disabled:r==="importing",className:"px-4 py-2 text-xs font-bold text-gray-650 bg-white border border-gray-200 hover:bg-gray-100 rounded-lg transition-all disabled:opacity-40 cursor-pointer",children:s==="zh"?"重置重选":"Reset & Clear"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:()=>i(!1),disabled:r==="importing",className:"px-4 py-2 text-xs font-bold text-gray-600 hover:text-gray-800 transition-all disabled:opacity-40 cursor-pointer",children:s==="zh"?"取消":"Cancel"}),r==="parsing"&&e.jsxs("button",{onClick:j,className:"px-4 py-2 text-xs font-bold text-white bg-indigo-600 hover:bg-indigo-700 rounded-lg shadow-sm transition-all flex items-center gap-1 cursor-pointer",children:[e.jsx(z,{size:12}),s==="zh"?`开始导入 (${a.length} 类)`:`Proceed and Import (${a.length})`]}),r==="success"&&e.jsx("button",{onClick:()=>i(!1),className:"px-4 py-2 text-xs font-bold text-white bg-indigo-600 hover:bg-indigo-700 rounded-lg shadow-sm transition-all cursor-pointer",children:s==="zh"?"完成":"Done"})]})]})]})})})}export{L as ImportLessonsModal};
@@ -1 +0,0 @@
1
- import{j as e}from"./vendor-react-0Lg0vA-4.js";import{a4 as d,a5 as g,a6 as x,y as p,l as f}from"./vendor-icons-_c3xpwjZ.js";function u({show:c,onClose:r,lang:s,handleImportFile:a,importError:i,importSuccess:n,isImporting:m,downloadCSVTemplate:l}){return c?e.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4 font-sans text-gray-800",children:e.jsxs("div",{className:"bg-white rounded-xl shadow-xl w-full max-w-lg flex flex-col p-6 relative",children:[e.jsx("button",{type:"button",onClick:r,className:"absolute top-4 right-4 text-gray-400 hover:text-gray-600 text-xl font-medium cursor-pointer",children:"×"}),e.jsxs("h3",{className:"text-base font-semibold text-gray-900 mb-1 flex items-center gap-2",children:[e.jsx(d,{size:18,className:"text-indigo-600"}),s==="zh"?"手动批量导入数据":"Manual Bulk Import"]}),e.jsx("p",{className:"text-xs text-gray-500 mb-4 font-sans text-left",children:s==="zh"?"支持导入 CSV 或 JSON 文件。CSV 文件需包含标题行,建议格式如下(支持中英文标题):":"Supports CSV or JSON files. CSV requires a header line with names like:"}),e.jsxs("div",{className:"bg-gray-50 p-3 rounded-lg border border-gray-100 text-[10px] font-mono text-gray-600 mb-4 whitespace-nowrap overflow-x-auto select-all text-left",children:["班级名称, 班级描述, 学生姓名, 学生邮箱",e.jsx("br",{}),"高一A班, 基础英语课程, 李明, liming@example.com",e.jsx("br",{}),"高一A班, 基础英语课程, 王华, wanghua@example.com"]}),e.jsxs("div",{className:"mb-4 flex flex-col gap-2 p-3 bg-indigo-50/50 border border-indigo-100 rounded-lg text-left select-none",children:[e.jsxs("span",{className:"text-xs font-semibold text-indigo-900 flex items-center gap-1",children:[e.jsx(g,{size:13,className:"text-indigo-600"}),s==="zh"?"下载导入数据模板文件:":"Download Import Templates:"]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 mt-1",children:[e.jsxs("button",{type:"button",onClick:()=>l("class"),className:"flex-1 flex items-center justify-center gap-1.5 text-xs px-2.5 py-2 bg-white border border-indigo-200 text-indigo-700 rounded-lg hover:bg-indigo-50 transition-colors shadow-sm font-medium cursor-pointer",children:[e.jsx(x,{size:12,className:"text-emerald-600"}),s==="zh"?"下载班级与学生模板":"Class & Students Template"]}),e.jsxs("button",{type:"button",onClick:()=>l("student"),className:"flex-1 flex items-center justify-center gap-1.5 text-xs px-2.5 py-2 bg-white border border-indigo-200 text-indigo-700 rounded-lg hover:bg-indigo-50 transition-colors shadow-sm font-medium cursor-pointer",children:[e.jsx(x,{size:12,className:"text-emerald-600"}),s==="zh"?"下载独立学生模板":"Independent Students Template"]})]})]}),e.jsxs("div",{onDragOver:t=>t.preventDefault(),onDrop:t=>{t.preventDefault(),!(!t.dataTransfer.files||t.dataTransfer.files.length===0)&&a(t.dataTransfer.files[0])},className:"border-2 border-dashed border-gray-300 rounded-xl p-8 text-center cursor-pointer hover:border-indigo-500 hover:bg-indigo-50/20 transition-all mb-4",onClick:()=>{const t=document.createElement("input");t.type="file",t.accept=".csv,.json",t.onchange=o=>{o.target.files?.[0]&&a(o.target.files[0])},t.click()},children:[e.jsx(d,{className:"mx-auto text-gray-400 mb-2",size:24}),e.jsx("p",{className:"text-xs font-semibold text-gray-700",children:s==="zh"?"点击选择文件 或 拖拽文件到这里":"Click to select file or drag it here"}),e.jsx("p",{className:"text-[10px] text-gray-400 mt-1",children:"CSV or JSON (max 5MB)"})]}),i&&e.jsxs("div",{className:"p-3 bg-red-50 border border-red-100 text-red-700 text-xs rounded-lg mb-4 flex items-start gap-2 max-h-32 overflow-y-auto",children:[e.jsx("span",{className:"font-bold shrink-0",children:"✕"}),e.jsx("span",{className:"font-sans text-left leading-tight break-all",children:i})]}),n&&e.jsxs("div",{className:"p-3 bg-green-50 border border-green-105 text-green-700 text-xs rounded-lg mb-4 flex items-start gap-2",children:[e.jsx(p,{size:14,className:"shrink-0 mt-0.5"}),e.jsx("span",{className:"font-sans text-left leading-tight",children:n})]}),m&&e.jsxs("div",{className:"flex items-center justify-center gap-2 text-indigo-600 text-xs py-2",children:[e.jsx(f,{size:16,className:"animate-spin"}),e.jsx("span",{children:s==="zh"?"正在分析数据并导入系统数据库...":"Validating data and transferring records..."})]}),e.jsx("div",{className:"flex justify-end gap-2 mt-2",children:e.jsx("button",{type:"button",onClick:r,className:"px-4 py-2 text-xs font-medium border border-gray-200 text-gray-700 rounded-lg hover:bg-gray-50 transition-colors cursor-pointer",children:s==="zh"?"关闭":"Close"})})]})}):null}export{u as ImportModal};
@@ -1 +0,0 @@
1
- import{r as t,j as e}from"./vendor-react-0Lg0vA-4.js";import{h as i,x as u,a8 as d,X as m}from"./vendor-icons-_c3xpwjZ.js";function g({coursewareId:l,onClose:n}){const[c,a]=t.useState(!1),r=t.useRef(null);t.useEffect(()=>{const s=()=>{a(!!document.fullscreenElement&&document.fullscreenElement===r.current)};return document.addEventListener("fullscreenchange",s),()=>{document.removeEventListener("fullscreenchange",s)}},[]);const o=()=>{const s=r.current;s&&(document.fullscreenElement?document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen&&document.webkitExitFullscreen():s.requestFullscreen?s.requestFullscreen():s.webkitRequestFullscreen&&s.webkitRequestFullscreen())};return l?e.jsxs("div",{ref:r,className:"flex flex-col h-full bg-white rounded-xl shadow-sm border border-gray-200 overflow-hidden relative",children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-2 bg-gray-100 border-b border-gray-200 shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-2 select-none",children:[e.jsx(i,{size:16,className:"text-indigo-500"}),e.jsx("span",{className:"font-semibold text-sm text-gray-700",children:"Interactive Courseware"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:o,className:"p-1 hover:bg-gray-200 rounded-lg text-gray-500 transition-colors cursor-pointer",title:c?"退出全屏":"全屏播放",children:c?e.jsx(u,{size:16}):e.jsx(d,{size:16})}),n&&e.jsx("button",{onClick:n,className:"p-1 hover:bg-gray-200 rounded-lg text-gray-500 transition-colors cursor-pointer",children:e.jsx(m,{size:16})})]})]}),e.jsx("div",{className:"flex-1 relative bg-white",children:e.jsx("iframe",{src:`/api/courseware/${l}`,sandbox:"allow-scripts allow-forms allow-downloads",allowFullScreen:!0,className:"w-full h-full border-none",title:"Interactive Courseware"})})]}):e.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-gray-400 bg-gray-50 rounded-xl border border-dashed border-gray-300",children:[e.jsx(i,{size:48,className:"mb-4 text-gray-300 opacity-50"}),e.jsx("h3",{className:"text-lg font-medium text-gray-700",children:"No Courseware Selected"}),e.jsx("p",{className:"mt-2 text-sm text-center",children:"Please select a courseware from the list to view it interactively."})]})}export{g as InteractiveCoursewareViewer};