openlearn-next 0.2.3 → 0.2.6

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 (55) hide show
  1. package/README.md +34 -136
  2. package/dist/assets/AdminDirectoryView-Cai0cQqi.js +1 -0
  3. package/dist/assets/BatchPickerModal-CKQyeY6R.js +1 -0
  4. package/dist/assets/ClassesView-Cxgfcrx1.js +19 -0
  5. package/dist/assets/CloudDriveModal-DgDurUBT.js +1 -0
  6. package/dist/assets/ComputerLabView-CUCO2VIV.js +1 -0
  7. package/dist/assets/CourseManagement-DSCOjuIC.js +1 -0
  8. package/dist/assets/CourseWizardModal-B3QnFxvj.js +3 -0
  9. package/dist/assets/CoursewareHubPanel-CAaf22Qm.js +1 -0
  10. package/dist/assets/Dashboard-Xly67TyD.js +8 -0
  11. package/dist/assets/ExportWeightModal-BlS2auLs.js +1 -0
  12. package/dist/assets/HelpTour-ZgEkRnin.js +1 -0
  13. package/dist/assets/HelpView-DgFLEuso.js +204 -0
  14. package/dist/assets/ImportLessonsModal-BZZRDBRU.js +1 -0
  15. package/dist/assets/ImportModal-mkWuDoAN.js +1 -0
  16. package/dist/assets/InteractiveCoursewareViewer-EIRNulEo.js +1 -0
  17. package/dist/assets/InteractiveWhiteboard-DDOKVrHd.js +102 -0
  18. package/dist/assets/LazyCourseware-qE4CY67E.js +1 -0
  19. package/dist/assets/LazyWhiteboard-C9fzRtzL.js +2 -0
  20. package/dist/assets/LessonEditorView-D1nhlQon.js +1 -0
  21. package/dist/assets/LiveClassroomView-C1lI4lFd.js +1 -0
  22. package/dist/assets/NotificationDetailModal-dndFrE7p.js +1 -0
  23. package/dist/assets/PluginView-5TYIP1ze.js +65 -0
  24. package/dist/assets/ProcessLogsModal-8mVp07ic.js +1 -0
  25. package/dist/assets/QuizGeneratorModal-DpTFYbVJ.js +1 -0
  26. package/dist/assets/StudentAssignmentView-CCGWFVqD.js +1 -0
  27. package/dist/assets/StudentLessonView-yhRHP8e8.js +1 -0
  28. package/dist/assets/StudentPreviewModal-UpNg1yl0.js +1 -0
  29. package/dist/assets/StudentView-C1cc6RuC.js +1 -0
  30. package/dist/assets/SystemResourceLibraryModal-Dnh7F5Vm.js +1 -0
  31. package/dist/assets/TeacherView-CWjbV0x-.js +2 -0
  32. package/dist/assets/TimetableView-zce3okQn.js +6 -0
  33. package/dist/assets/index-B9cwmoaG.js +129 -0
  34. package/dist/assets/index-BrEBeWAQ.js +14 -0
  35. package/dist/assets/index-CATki2cp.css +1 -0
  36. package/dist/assets/index-Cq_aKTfc.js +1 -0
  37. package/dist/assets/{index.es-CF5dm42F.js → index.es-DZ6UeYE-.js} +2 -2
  38. package/dist/assets/vendor-charts-B7ViBL9w.js +71 -0
  39. package/dist/assets/vendor-icons-BvCtGbt1.js +8221 -0
  40. package/dist/assets/vendor-konva-CzxOmTv9.js +49 -0
  41. package/dist/assets/vendor-motion-Dz5URUo4.js +9 -0
  42. package/dist/assets/vendor-pdf-CVyNPGVr.js +191 -0
  43. package/dist/assets/{vendor-pptx-CJ3I-KT0.js → vendor-pptx-B0hlo0eh.js} +1 -1
  44. package/dist/assets/vendor-react-0Lg0vA-4.js +49 -0
  45. package/dist/assets/vendor-utils-4FcTwKPj.js +1 -0
  46. package/dist/index.html +2 -3
  47. package/dist/server.cjs +185 -73
  48. package/package.json +1 -1
  49. package/dist/assets/courseware-Cc-Yy0Ha.js +0 -1
  50. package/dist/assets/index-CsN5CIqI.css +0 -1
  51. package/dist/assets/index-D_zAVH7u.js +0 -682
  52. package/dist/assets/vendor-html2canvas-B0tyYwQk.js +0 -22
  53. package/dist/assets/vendor-konva-GivUq6dt.js +0 -89
  54. package/dist/assets/whiteboard-jgQrAUm7.js +0 -8343
  55. /package/dist/assets/{purify.es-V6uLfjnH.js → vendor-content-V6uLfjnH.js} +0 -0
@@ -0,0 +1 @@
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,a3 as q,r as J,g as O,J as X,af as B,h as G,aa as K}from"./vendor-icons-BvCtGbt1.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(J,{size:12}),t("提交","Subs"),": ",s.stats?.submissions??0]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(O,{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(X,{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(B,{size:15,className:"text-amber-500"}):e.jsx(G,{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};
@@ -0,0 +1,8 @@
1
+ import{r as c,j as e}from"./vendor-react-0Lg0vA-4.js";import{A as V,m as $}from"./vendor-motion-Dz5URUo4.js";import{am as X,X as H,O as B,W as J,p as q,an as K,g as Y,U as Q,f as Z,F as ee,l as se,ao as te,a6 as le,a9 as ae,ag as ne,b as U,ap as G,x as re,i as ie}from"./vendor-icons-BvCtGbt1.js";import{E as oe}from"./index-B9cwmoaG.js";import"./vendor-utils-4FcTwKPj.js";import"./vendor-pdf-CVyNPGVr.js";import"./vendor-charts-B7ViBL9w.js";function de({classes:x,lessons:n,lang:g,onScheduleClass:z,onGenerateAssignment:A,onCreateLesson:E}){const[m,v]=c.useState(!1),[r,h]=c.useState("menu"),[y,N]=c.useState(""),[w,p]=c.useState(""),[C,T]=c.useState(""),[k,L]=c.useState(""),[D,F]=c.useState(""),[P,M]=c.useState(""),[S,I]=c.useState(""),[_,f]=c.useState(!1),[O,l]=c.useState(!1),[o,i]=c.useState(null),s={zh:{quickActions:"快捷操作指令",quickDesc:"无需切换页面,在此直接向教育总线或班级下发运行调度命令。",scheduleClass:"排课计划调度",scheduleDesc:"为班级分配课程段并指定授课时间",generateAssignment:"生成 AI 测验任务",generateDesc:"利用代理模型为班级定制专属能力题目",createLesson:"注册教学课件",createDesc:"发布新的富文本 Markdown 教材大纲",back:"返回上级",confirm:"确认并下发指令",classSelect:"选择目标班级",lessonSelect:"选择关联课件",dateSelect:"授课日期选择",assignmentTopic:"测验主题方向 / 核心知识点",assignmentTopicPlaceholder:"例: 一元二次方程,光合作用,牛顿运动定律等...",lessonTitle:"课件名称(大纲标题)",lessonTitlePlaceholder:"例: 量子力学初步 / 物理实验基础",lessonContent:"详细授课内容 (Markdown 支持)",successScheduled:"排课成功!总线已捕获日程数据。",successAssignment:"AI 测验任务成功生成,稍后同步。",successLesson:"新课件发布成功!画板白板可直接拖拽加载。",emptyClasses:"未检测到活跃班级",emptyLessons:"未检测到可用课件",loadingBus:"内核微服务运行中...",genericError:"网络或核指令总线调用失败,请重试"},en:{quickActions:"Quick Actions",quickDesc:"Deploy scheduler and class orchestration bus commands instantly from here.",scheduleClass:"Schedule Lesson Period",scheduleDesc:"Assign a lesson package and scheduled date to an active class",generateAssignment:"Generate AI Assignment",generateDesc:"Deploy agent workflows to design tailored student test cases",createLesson:"Register Lesson Curriculum",createDesc:"Publish new rich Markdown-based whiteboard syllabus",back:"Back",confirm:"Execute Command",classSelect:"Select Class",lessonSelect:"Select Lesson Template",dateSelect:"Choose Scheduled Date",assignmentTopic:"Assignment Topic / Target Knowledge",assignmentTopicPlaceholder:"e.g., Quadratic equations, Photosynthesis, Newtonian gravity...",lessonTitle:"Lesson Curriculum Title",lessonTitlePlaceholder:"e.g., Intro to Quantum Mechanics",lessonContent:"Whiteboard Curriculum Content (Markdown)",successScheduled:"Success! Dynamic class schedule updated.",successAssignment:"Success! AI is compiling custom quiz structures.",successLesson:"Success! Ready to orchestrate inside classroom sandbox.",emptyClasses:"No classes discovered",emptyLessons:"No lessons discovered",loadingBus:"Interfacing core services...",genericError:"System bus execute command failure, please retry"}}[g],a=()=>{N(""),p(""),T(""),L(""),F(""),M(""),I(""),i(null),l(!1),f(!1)},d=()=>{switch(r){case"schedule":return s.successScheduled;case"assignment":return s.successAssignment;case"lesson":return s.successLesson;default:return""}},b=t=>{a(),h(t),x.length>0&&(N(x[0].id),L(x[0].id)),n.length>0&&p(n[0].id),t==="lesson"&&I(`# 新课件名称
2
+
3
+ ## 教学目标
4
+ - 掌握核心考点
5
+ - 熟练完成基础物理实验
6
+
7
+ ## 课堂探究
8
+ 这里写课本的主要讲授要点。`)},j=async t=>{t.preventDefault(),f(!0),i(null);try{let u=!1;if(r==="schedule"){if(!y||!w||!C){i("Please complete all form fields."),f(!1);return}u=await z(y,w,C)}else if(r==="assignment"){if(!k||!D.trim()){i("Please specify target class and a valid topic."),f(!1);return}u=await A(k,D.trim())}else if(r==="lesson"){if(!P.trim()||!S.trim()){i("Title and Content can not be empty."),f(!1);return}u=await E(P.trim(),S.trim())}u?(l(!0),setTimeout(()=>{l(!1),h("menu")},2200)):i(s.genericError)}catch(u){i(u.message||s.genericError)}finally{f(!1)}};return e.jsxs("div",{id:"quick-actions-fab-container",className:"absolute bottom-8 right-8 z-40 flex flex-col items-end",children:[e.jsx(V,{children:m&&e.jsxs($.div,{initial:{opacity:0,y:15,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:15,scale:.95},transition:{duration:.18},className:"mb-4 w-[360px] sm:w-[420px] bg-white border border-gray-200 rounded-2xl shadow-xl overflow-hidden flex flex-col focus:outline-none",id:"quick-actions-popup-card",children:[e.jsxs("div",{className:"bg-indigo-600 px-5 py-4 text-white flex items-center justify-between shadow-inner",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(X,{size:18,className:"animate-pulse"}),e.jsx("h3",{className:"font-bold text-sm tracking-wide",children:s.quickActions})]}),e.jsx("button",{onClick:()=>{v(!1),h("menu")},className:"text-white/80 hover:text-white hover:bg-white/15 p-1 rounded-full transition-all focus:outline-none",title:"Close Portal",children:e.jsx(H,{size:16})})]}),e.jsxs("div",{className:"p-5 max-h-[480px] overflow-y-auto bg-gray-50/50",children:[r==="menu"&&e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-[11px] text-gray-500 leading-relaxed font-medium bg-indigo-50/50 border border-indigo-100 p-2.5 rounded-lg mb-4",children:s.quickDesc}),e.jsxs("div",{onClick:()=>b("schedule"),className:"flex items-start gap-3.5 p-3.5 bg-white border border-gray-200 hover:border-indigo-400 hover:shadow-md rounded-xl cursor-pointer transition-all hover:scale-101 group",id:"action-schedule-class",children:[e.jsx("div",{className:"p-2.5 bg-indigo-50 text-indigo-600 rounded-lg group-hover:bg-indigo-600 group-hover:text-white transition-colors duration-200",children:e.jsx(B,{size:18})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h4",{className:"text-xs font-bold text-gray-800 flex items-center gap-1 group-hover:text-indigo-600 transition-colors uppercase tracking-wider",children:s.scheduleClass}),e.jsx("p",{className:"text-[11px] text-gray-500 mt-1 leading-relaxed",children:s.scheduleDesc})]})]}),e.jsxs("div",{onClick:()=>b("assignment"),className:"flex items-start gap-3.5 p-3.5 bg-white border border-gray-200 hover:border-purple-400 hover:shadow-md rounded-xl cursor-pointer transition-all hover:scale-101 group",id:"action-generate-assignment",children:[e.jsx("div",{className:"p-2.5 bg-purple-50 text-purple-600 rounded-lg group-hover:bg-purple-600 group-hover:text-white transition-colors duration-200",children:e.jsx(J,{size:18})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h4",{className:"text-xs font-bold text-gray-800 flex items-center gap-1 group-hover:text-purple-600 transition-colors uppercase tracking-wider",children:s.generateAssignment}),e.jsx("p",{className:"text-[11px] text-gray-500 mt-1 leading-relaxed",children:s.generateDesc})]})]}),e.jsxs("div",{onClick:()=>b("lesson"),className:"flex items-start gap-3.5 p-3.5 bg-white border border-gray-200 hover:border-emerald-400 hover:shadow-md rounded-xl cursor-pointer transition-all hover:scale-101 group",id:"action-create-lesson",children:[e.jsx("div",{className:"p-2.5 bg-emerald-50 text-emerald-600 rounded-lg group-hover:bg-emerald-600 group-hover:text-white transition-colors duration-200",children:e.jsx(q,{size:18})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h4",{className:"text-xs font-bold text-gray-800 flex items-center gap-1 group-hover:text-emerald-600 transition-colors uppercase tracking-wider",children:s.createLesson}),e.jsx("p",{className:"text-[11px] text-gray-500 mt-1 leading-relaxed",children:s.createDesc})]})]})]}),r!=="menu"&&e.jsxs("div",{className:"relative",children:[e.jsxs("button",{onClick:()=>h("menu"),className:"flex items-center gap-1.5 text-xs text-gray-500 hover:text-indigo-600 font-semibold mb-4 cursor-pointer focus:outline-none",id:"action-back-button",children:[e.jsx(K,{size:14}),e.jsx("span",{children:s.back})]}),O?e.jsxs($.div,{initial:{scale:.95},animate:{scale:1},className:"flex flex-col items-center justify-center py-10 text-center",children:[e.jsx(Y,{size:48,className:"text-green-500 animate-bounce mb-3"}),e.jsx("h4",{className:"font-bold text-green-800 text-sm",children:d()}),e.jsx("p",{className:"text-[11px] text-gray-400 mt-1",children:"Returning to action console..."})]}):e.jsxs("form",{onSubmit:j,className:"space-y-4",children:[o&&e.jsxs("div",{className:"p-3 bg-red-50 border border-red-200 rounded-lg text-red-600 text-xs font-semibold",children:["⚠️ ",o]}),r==="schedule"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs("label",{className:"text-xs font-bold text-gray-600 flex items-center gap-1",children:[e.jsx(Q,{size:12})," ",s.classSelect]}),x.length===0?e.jsx("p",{className:"text-xs italic text-red-500",children:s.emptyClasses}):e.jsx("select",{value:y,onChange:t=>N(t.target.value),className:"w-full bg-white border border-gray-200 rounded-lg p-2.5 text-xs focus:ring-2 focus:ring-indigo-500 text-gray-700 font-medium",children:x.map(t=>e.jsx("option",{value:t.id,children:t.name},t.id))})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs("label",{className:"text-xs font-bold text-gray-600 flex items-center gap-1",children:[e.jsx(q,{size:12})," ",s.lessonSelect]}),n.length===0?e.jsx("p",{className:"text-xs italic text-red-500",children:s.emptyLessons}):e.jsx("select",{value:w,onChange:t=>p(t.target.value),className:"w-full bg-white border border-gray-200 rounded-lg p-2.5 text-xs focus:ring-2 focus:ring-indigo-500 text-gray-700 font-medium",children:n.map(t=>e.jsx("option",{value:t.id,children:t.title},t.id))})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs("label",{className:"text-xs font-bold text-gray-600 flex items-center gap-1",children:[e.jsx(B,{size:12})," ",s.dateSelect]}),e.jsx("input",{type:"date",value:C,onChange:t=>T(t.target.value),className:"w-full bg-white border border-gray-200 rounded-lg p-2.5 text-xs focus:ring-2 focus:ring-indigo-500 text-gray-700 font-medium",required:!0})]})]}),r==="assignment"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs("label",{className:"text-xs font-bold text-gray-600 flex items-center gap-1",children:[e.jsx(Q,{size:12})," ",s.classSelect]}),x.length===0?e.jsx("p",{className:"text-xs italic text-red-500",children:s.emptyClasses}):e.jsx("select",{value:k,onChange:t=>L(t.target.value),className:"w-full bg-white border border-gray-200 rounded-lg p-2.5 text-xs focus:ring-2 focus:ring-indigo-500 text-gray-700 font-medium",children:x.map(t=>e.jsx("option",{value:t.id,children:t.name},t.id))})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs("label",{className:"text-xs font-bold text-gray-600 flex items-center gap-1",children:[e.jsx(Z,{size:12})," ",s.assignmentTopic]}),e.jsx("input",{type:"text",value:D,onChange:t=>F(t.target.value),placeholder:s.assignmentTopicPlaceholder,className:"w-full bg-white border border-gray-200 rounded-lg p-2.5 text-xs focus:ring-2 focus:ring-indigo-500 text-gray-700 font-medium",required:!0})]})]}),r==="lesson"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs("label",{className:"text-xs font-bold text-gray-600 flex items-center gap-1",children:[e.jsx(ee,{size:12})," ",s.lessonTitle]}),e.jsx("input",{type:"text",value:P,onChange:t=>M(t.target.value),placeholder:s.lessonTitlePlaceholder,className:"w-full bg-white border border-gray-200 rounded-lg p-2.5 text-xs focus:ring-2 focus:ring-indigo-500 text-gray-700 font-medium",required:!0})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs("label",{className:"text-xs font-bold text-gray-600 flex items-center gap-1",children:[e.jsx(q,{size:12})," ",s.lessonContent]}),e.jsx("textarea",{value:S,onChange:t=>I(t.target.value),rows:5,className:"w-full bg-white border border-gray-200 rounded-lg p-2.5 text-xs focus:ring-2 focus:ring-indigo-500 font-mono text-gray-700",required:!0})]})]}),e.jsx("button",{type:"submit",disabled:_||r==="schedule"&&(x.length===0||n.length===0)||r==="assignment"&&x.length===0,className:"w-full bg-indigo-600 hover:bg-indigo-700 text-white font-bold text-xs py-2.5 px-4 rounded-xl flex items-center justify-center gap-2 cursor-pointer transition-all shadow-md active:scale-98 disabled:opacity-50",children:_?e.jsxs(e.Fragment,{children:[e.jsx(se,{size:14,className:"animate-spin"}),e.jsx("span",{children:s.loadingBus})]}):e.jsxs(e.Fragment,{children:[e.jsx(te,{size:13}),e.jsx("span",{children:s.confirm})]})})]})]})]})]})}),e.jsxs("button",{onClick:()=>{v(!m),h("menu")},className:"w-14 h-14 bg-indigo-600 hover:bg-indigo-700 text-white rounded-full flex items-center justify-center shadow-lg hover:shadow-indigo-200 hover:shadow-2xl transition-all duration-250 cursor-pointer active:scale-95 focus:outline-none relative group",title:"Trigger Education OS Quick Scheduler Command Panel",id:"quick-actions-fab-button",children:[e.jsx("span",{className:"absolute inline-flex h-full w-full rounded-full bg-purple-400 opacity-20 group-hover:animate-ping"}),e.jsx($.div,{animate:{rotate:m?135:0},transition:{duration:.2},className:"flex items-center justify-center text-white",children:e.jsx(le,{size:24,strokeWidth:2.8})})]})]})}function fe(x){const{lang:n,t:g,lessons:z,classes:A,students:E,todaySchedules:m,approvals:v,processes:r,isApprovalsCollapsed:h,setIsApprovalsCollapsed:y,isProcessesCollapsed:N,setIsProcessesCollapsed:w,scoreOverrides:p,setScoreOverrides:C,handleApprove:T,handleReject:k,showLogs:L,setShowLogs:D,processLogsContent:F,showProcessLogs:P,fetchProcessLogs:M,setShowProcessLogs:S,addToast:I,handleQuickScheduleClass:_,handleQuickGenerateAssignment:f,handleQuickCreateLesson:O}=x;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex-1 flex flex-col gap-6 h-full overflow-y-auto pr-2",children:[(()=>{const l=a=>{if(a.status==="cancelled"||a.status==="holiday")return!1;if(!a.time_slot)return!0;try{const d=a.time_slot.split("-");if(d.length<2)return!0;const b=d[1].trim(),[j,t]=b.split(":").map(Number),u=new Date,R=u.getHours(),W=u.getMinutes();return!(R>j||R===j&&W>=t)}catch{return!0}},o=m.filter(l),i=m.length-o.length;m.filter(a=>a.status==="cancelled"||a.status==="holiday");const s=o[0];return e.jsxs("div",{className:"bg-white border border-slate-200/80 rounded-2xl p-5 text-slate-800 shadow-sm flex flex-col md:flex-row justify-between items-stretch gap-6 transition-all duration-300",children:[e.jsx("div",{className:"flex-1 flex flex-col justify-between bg-slate-50/50 rounded-xl p-4.5 border border-slate-200/60 min-h-[160px]",children:s?e.jsxs("div",{className:"flex-1 flex flex-col justify-between",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"bg-amber-400 text-slate-950 text-[10px] font-extrabold px-2.5 py-0.5 rounded-full uppercase tracking-wider animate-pulse shadow-xs",children:n==="zh"?"下一堂面授课":"NEXT CLASS"}),e.jsx("span",{className:"font-mono text-xs text-indigo-700 font-bold bg-indigo-50 px-2 py-0.5 rounded-md border border-indigo-100/30",children:s.time_slot})]}),e.jsx("h3",{className:"text-lg md:text-xl font-extrabold tracking-tight mt-3 text-slate-800 line-clamp-2",title:s.lesson_title,children:s.lesson_title}),e.jsxs("p",{className:"text-xs text-slate-500 mt-2 font-medium",children:["📍 ",s.class_name," ",s.classroom&&` | 教室: ${s.classroom}`," ",s.teacher_name&&` | 教师: ${s.teacher_name}`]})]}),s.notes&&e.jsxs("div",{className:"mt-3 text-xs italic text-indigo-700 bg-indigo-50/60 p-2 rounded-lg border border-indigo-100/40 truncate",title:s.notes,children:["* ",s.notes]})]}):e.jsxs("div",{className:"flex-1 flex flex-col justify-center items-center text-center py-6 select-none",children:[e.jsx("span",{className:"text-3xl animate-bounce",children:"☕"}),e.jsx("h3",{className:"text-base font-extrabold text-slate-850 mt-2",children:n==="zh"?"今日课程已全部结束":"All Classes Finished"}),e.jsx("p",{className:"text-xs text-slate-455 mt-1 max-w-[280px]",children:n==="zh"?"接下来暂无排定课次,您可以休息调整。":"No remaining schedules today. Take a rest!"})]})}),e.jsxs("div",{className:"w-full md:w-[300px] lg:w-[350px] flex flex-col gap-3",children:[e.jsxs("div",{className:"flex justify-between items-center border-b border-slate-200/80 pb-2",children:[e.jsxs("span",{className:"text-[11px] uppercase font-extrabold tracking-wider text-indigo-600 flex items-center gap-1.5",children:["📅 ",n==="zh"?"今日面授排课流":"TODAY'S SCHEDULES"]}),e.jsx("span",{className:"text-[10px] text-slate-500 font-medium",children:n==="zh"?`共 ${m.length} 节 | 已下课 ${i} 节`:`Total ${m.length} | Done ${i}`})]}),m.length===0?e.jsxs("div",{className:"flex-1 flex items-center justify-center text-xs font-bold text-slate-450 py-6",children:["☕ ",n==="zh"?"今日暂无排定课次":"No schedules configured."]}):e.jsx("div",{className:"space-y-2 max-h-[150px] overflow-y-auto pr-1",children:m.map(a=>{const d=s&&a.id===s.id,b=o.some(u=>u.id===a.id)&&!d,j=a.status==="cancelled"||a.status==="holiday",t=!d&&!b&&!j;return e.jsxs("div",{className:`flex items-center justify-between text-xs py-1 border-b border-slate-100 last:border-b-0 ${t?"opacity-50":j?"opacity-35 line-through":""}`,children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("span",{className:"font-mono text-[10px] text-slate-500 shrink-0",children:a.time_slot}),e.jsx("span",{className:`font-bold truncate max-w-[120px] lg:max-w-[150px] ${d?"text-indigo-650":"text-slate-700"}`,title:a.lesson_title,children:a.lesson_title}),e.jsxs("span",{className:"text-[9px] text-slate-455 truncate max-w-[60px] lg:max-w-[80px]",children:["(",a.class_name,")"]})]}),e.jsxs("div",{className:"shrink-0 ml-2",children:[d&&e.jsx("span",{className:"bg-amber-400 text-slate-950 font-extrabold text-[8px] px-1.5 py-0.5 rounded uppercase scale-90 inline-block animate-pulse shadow-xs",children:"进行"}),t&&e.jsx("span",{className:"bg-slate-100 text-slate-500 text-[8px] px-1.5 py-0.5 rounded font-bold",children:"已完"}),b&&e.jsx("span",{className:"bg-indigo-50 text-indigo-700 text-[8px] px-1.5 py-0.5 rounded font-medium border border-indigo-100/50",children:"待上"}),j&&e.jsx("span",{className:"bg-rose-50 text-rose-600 text-[8px] px-1.5 py-0.5 rounded font-bold border border-rose-100/50",children:"停课"})]})]},a.id)})})]})]})})(),e.jsx(oe,{slot:"teacher.dashboard.widget"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-5",children:[e.jsxs("div",{className:"bg-gradient-to-br from-indigo-50/60 to-indigo-100/10 border border-indigo-100/60 rounded-2xl p-5 shadow-xs flex items-center justify-between hover:shadow-sm hover:-translate-y-0.5 transition-all duration-300",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-xs font-bold text-indigo-655 uppercase tracking-wider",children:n==="zh"?"课程数量":"Total Courses"}),e.jsx("span",{className:"text-3xl font-extrabold text-slate-800 tracking-tight leading-none mt-1",children:z.length})]}),e.jsx("div",{className:"p-3 bg-indigo-500/10 text-indigo-600 rounded-xl",children:e.jsx(q,{size:24})})]}),e.jsxs("div",{className:"bg-gradient-to-br from-pink-50/60 to-pink-100/10 border border-pink-100/60 rounded-2xl p-5 shadow-xs flex items-center justify-between hover:shadow-sm hover:-translate-y-0.5 transition-all duration-300",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-xs font-bold text-pink-600 uppercase tracking-wider",children:n==="zh"?"班级数量":"Total Classes"}),e.jsx("span",{className:"text-3xl font-extrabold text-slate-800 tracking-tight leading-none mt-1",children:A.length})]}),e.jsx("div",{className:"p-3 bg-pink-500/10 text-pink-600 rounded-xl",children:e.jsx(ae,{size:24})})]}),e.jsxs("div",{className:"bg-gradient-to-br from-emerald-50/60 to-emerald-100/10 border border-emerald-100/60 rounded-2xl p-5 shadow-xs flex items-center justify-between hover:shadow-sm hover:-translate-y-0.5 transition-all duration-300",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-xs font-bold text-emerald-650 uppercase tracking-wider",children:n==="zh"?"学生数量":"Total Students"}),e.jsx("span",{className:"text-3xl font-extrabold text-slate-800 tracking-tight leading-none mt-1",children:E.length})]}),e.jsx("div",{className:"p-3 bg-emerald-500/10 text-emerald-600 rounded-xl",children:e.jsx(Q,{size:24})})]})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6 items-start",children:[e.jsxs("div",{className:"bg-white border border-rose-100 rounded-2xl shadow-sm flex flex-col transition-all duration-300",children:[e.jsxs("div",{onClick:()=>y(!h),className:"p-4 border-b border-rose-50 flex items-center justify-between cursor-pointer select-none hover:bg-rose-50/20 rounded-t-2xl transition-colors",children:[e.jsxs("h3",{className:"font-extrabold text-sm md:text-base text-rose-700 flex items-center gap-2",children:[e.jsx(ne,{size:18}),g.approvals,v.length>0&&e.jsx("span",{className:"bg-rose-100 text-rose-700 text-xs px-2 py-0.5 rounded-full font-bold ml-1",children:v.length})]}),e.jsx("div",{className:"text-rose-400 hover:text-rose-600 transition-colors",children:h?e.jsx(U,{size:18}):e.jsx(G,{size:18})})]}),!h&&e.jsx("div",{className:"flex-1 overflow-y-auto p-3 max-h-[350px]",children:v.length===0?e.jsx("div",{className:"text-center p-8 text-xs md:text-sm text-slate-400 font-medium",children:g.noApprovals}):v.map(l=>{let o={};try{o=JSON.parse(l.payload||"{}")}catch{}const i=l.command_type==="ai.apply_grade",s=p[l.id]!==void 0?p[l.id]:o.score||0;return e.jsxs("div",{className:"w-full p-4 rounded-xl text-sm bg-slate-55 border border-slate-100 mb-3 shadow-3xs flex flex-col gap-3 hover:border-rose-150 transition-colors",children:[e.jsxs("div",{children:[e.jsx("div",{className:"font-extrabold text-slate-800 mb-1",children:l.command_type==="ai.apply_grade"?"🎓 Evaluate Submission":l.command_type}),e.jsx("div",{className:"text-xs text-slate-500 font-mono mb-2 line-clamp-2 bg-white border border-slate-100 p-2 rounded-lg",title:l.payload,children:i?`Feedback: ${o.feedback}`:l.payload})]}),i&&e.jsxs("div",{className:"bg-white border border-slate-150 p-2 rounded-xl flex items-center justify-between gap-3",children:[e.jsx("label",{className:"text-xs font-bold text-slate-700",children:"Modify Score:"}),e.jsx("input",{type:"number",className:"w-20 border border-slate-200 rounded-lg px-2 py-1 text-xs focus:ring-2 focus:ring-indigo-500 outline-none transition-all",value:s,onChange:a=>C(d=>({...d,[l.id]:parseInt(a.target.value)||0}))})]}),e.jsxs("div",{className:"flex gap-2 justify-end mt-1",children:[e.jsxs("button",{onClick:()=>T(l.id,i&&p[l.id]!==void 0?{score:p[l.id]}:void 0),className:"p-1.5 px-3.5 bg-rose-600 hover:bg-rose-700 text-white rounded-lg font-bold text-xs flex items-center gap-1.5 shadow-sm transition-all animate-none",children:[e.jsx(re,{size:14})," ",g.approve]}),e.jsxs("button",{onClick:()=>k(l.id),className:"p-1.5 px-3.5 bg-slate-100 hover:bg-slate-200 text-slate-750 rounded-lg font-bold text-xs flex items-center gap-1.5 shadow-3xs transition-all",children:[e.jsx(H,{size:14})," ",g.reject]})]})]},l.id)})})]}),e.jsxs("div",{className:"bg-white border border-slate-200/60 rounded-2xl shadow-sm flex flex-col transition-all duration-300",children:[e.jsxs("div",{onClick:()=>w(!N),className:"p-4 border-b border-slate-100 flex items-center justify-between cursor-pointer select-none hover:bg-slate-50/20 rounded-t-2xl transition-colors",children:[e.jsxs("h3",{className:"font-extrabold text-sm md:text-base text-slate-700 flex items-center gap-2",children:[e.jsx(ie,{size:18,className:"text-indigo-500"}),g.processes,r.length>0&&e.jsx("span",{className:"bg-indigo-50 text-indigo-700 text-xs px-2 py-0.5 rounded-full font-bold ml-1",children:r.length})]}),e.jsx("div",{className:"text-slate-400 hover:text-slate-650 transition-colors",children:N?e.jsx(U,{size:18}):e.jsx(G,{size:18})})]}),!N&&e.jsx("div",{className:"flex-1 overflow-y-auto p-3 max-h-[350px]",children:r.length===0?e.jsx("div",{className:"text-center p-8 text-xs md:text-sm text-slate-400 font-medium",children:g.noProcesses}):r.map(l=>e.jsxs("div",{className:"w-full p-4 rounded-xl text-sm bg-slate-50 border border-slate-100 mb-3 shadow-3xs flex flex-col gap-2.5 hover:border-indigo-150 transition-colors",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsx("span",{className:"font-extrabold text-slate-800 truncate",title:l.name,children:l.name}),e.jsx("span",{className:`text-[10px] uppercase px-2 py-0.5 rounded-full font-bold ${l.status==="running"?"bg-blue-100 text-blue-700":l.status==="completed"?"bg-emerald-100 text-emerald-700":l.status==="failed"?"bg-rose-100 text-rose-700":"bg-slate-200 text-slate-700"}`,children:l.status})]}),e.jsxs("div",{className:"flex justify-between items-center mt-1",children:[e.jsxs("span",{className:"text-[10px] text-slate-400 font-mono",children:["PID: ",l.id]}),e.jsx("button",{onClick:()=>S(l.id),className:"text-xs font-bold text-indigo-650 hover:text-indigo-850 transition-colors",children:g.processLogs})]})]},l.id))})]})]})]}),e.jsx(de,{classes:A,lessons:z,lang:n,onScheduleClass:_,onGenerateAssignment:async(l,o)=>!!await f(l,o,o),onCreateLesson:async(l,o)=>!!await O(l,o)})]})}export{fe as Dashboard};
@@ -0,0 +1 @@
1
+ import{j as e}from"./vendor-react-0Lg0vA-4.js";import{m as z}from"./vendor-motion-Dz5URUo4.js";import{ab as k,ac as C,Q as S,T as $,a4 as q}from"./vendor-icons-BvCtGbt1.js";function Q({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{Q as ExportWeightModal};
@@ -0,0 +1 @@
1
+ import{r,j as e}from"./vendor-react-0Lg0vA-4.js";import{f as b,X as R,o as T,a2 as W,Z as B}from"./vendor-icons-BvCtGbt1.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.'}],E=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)}},_=()=>{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:E,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:_,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};
@@ -0,0 +1,204 @@
1
+ import{r as m,j as e}from"./vendor-react-0Lg0vA-4.js";import{E as D,a as M}from"./index-B9cwmoaG.js";import{g as ge}from"./index-B9cwmoaG.js";import{T as v,aq as W,p as S,U as z,a9 as _,W as R,j as C,ag as $,Z as U,i as H,l as B,y as O,g as J,X as q,aA as I,x as T,F as w,d as G,f as F,a0 as V,h as Q,s as K}from"./vendor-icons-BvCtGbt1.js";import{M as X}from"./index-BrEBeWAQ.js";import"./vendor-utils-4FcTwKPj.js";import"./vendor-pdf-CVyNPGVr.js";import"./vendor-motion-Dz5URUo4.js";import"./vendor-charts-B7ViBL9w.js";const L=r=>r.startsWith("vfs.")?"vfs":r.startsWith("lesson.")||r.startsWith("whiteboard.")?"edu":r.startsWith("class.")||r.startsWith("student.")||r.startsWith("assignment.")||r.startsWith("attendance.")||r.startsWith("schedule.")?"mgmt":r.startsWith("process.")?"proc":r.startsWith("ai.")?"ai":"plugin",P=r=>{if(!r||r.type!=="OBJECT")return"{}";const a={};return r.properties&&Object.keys(r.properties).forEach(t=>{const n=r.properties[t];n.type==="ARRAY"?a[t]=n.items?.type==="STRING"?["选项 A","选项 B","选项 C"]:[]:n.type==="INTEGER"||n.type==="NUMBER"?a[t]=100:n.type==="BOOLEAN"?a[t]=!0:t.toLowerCase().includes("id")?a[t]="auto-id-or-current":t.toLowerCase().includes("name")?a[t]="测试名称":t.toLowerCase().includes("content")?a[t]=`# 初始内容
2
+ 这是一个通过命令创建的组件或段落。`:a[t]=n.description||"示例参数"}),JSON.stringify(a,null,2)},Y=({registeredCommands:r,onRefresh:a})=>{const[t,n]=m.useState(""),[g,h]=m.useState("all"),[b,j]=m.useState(null),[u,y]=m.useState({}),[k,f]=m.useState({}),E=[{id:"all",name:"全部命令",icon:W},{id:"edu",name:"教学与画板",icon:S},{id:"mgmt",name:"班级与学生",icon:z},{id:"vfs",name:"虚拟文件系统",icon:_},{id:"proc",name:"进程控制",icon:v},{id:"ai",name:"AI 规划生成",icon:R},{id:"plugin",name:"第三方插件",icon:C}],A=r.filter(s=>{const l=g==="all"||L(s.commandType)===g,d=t===""||s.commandType.toLowerCase().includes(t.toLowerCase())||s.description&&s.description.toLowerCase().includes(t.toLowerCase())||s.id.toLowerCase().includes(t.toLowerCase());return l&&d}),o=async(s,l)=>{f(d=>({...d,[l]:{success:!1,loading:!0}}));try{const d=u[l]||"{}";let p={};try{p=JSON.parse(d)}catch(c){f(N=>({...N,[l]:{success:!1,error:`JSON 语法解析错误: ${c.message}`,loading:!1}}));return}const i=await fetch("/api/commands/execute",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({commandType:s,payload:p})}),x=await i.json();i.ok&&x.success?(f(c=>({...c,[l]:{success:!0,data:x.result,loading:!1}})),a()):f(c=>({...c,[l]:{success:!1,error:x.error||"执行命令失败",loading:!1}}))}catch(d){f(p=>({...p,[l]:{success:!1,error:d.message,loading:!1}}))}};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"p-4 border-b border-gray-100 bg-gray-50/50 flex flex-col gap-4 shrink-0 col-span-1",children:[e.jsxs("div",{className:"relative",children:[e.jsx(v,{className:"absolute left-3.5 top-1/2 -translate-y-1/2 text-gray-400",size:16}),e.jsx("input",{type:"text",placeholder:"通过命令类型、描述或 Action ID 搜索活跃指令...",value:t,onChange:s=>n(s.target.value),className:"w-full pl-10 pr-4 py-2.5 bg-white border border-gray-200 rounded-xl text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-transparent transition-all shadow-sm"})]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:E.map(s=>{const l=s.icon,d=g===s.id;return e.jsxs("button",{onClick:()=>h(s.id),className:`flex items-center gap-1.5 px-3.5 py-1.5 rounded-full text-xs font-semibold transition-all ${d?"bg-indigo-600 text-white shadow shadow-indigo-200 scale-102 font-bold":"bg-white text-gray-600 hover:text-gray-900 border border-gray-200 hover:border-gray-300"}`,children:[e.jsx(l,{size:13}),e.jsx("span",{children:s.name}),s.id==="all"?e.jsx("span",{className:`ml-1 text-[10px] px-1.5 py-0.2 rounded-full ${d?"bg-indigo-700/80 text-white":"bg-gray-100 text-gray-500"}`,children:r.length}):null]},s.id)})})]}),e.jsx("div",{className:"flex-1 overflow-y-auto p-6 bg-gray-50/30",children:A.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center p-12 text-gray-400",children:[e.jsx($,{size:48,className:"text-gray-300 mb-4 animate-pulse"}),e.jsx("h3",{className:"font-semibold text-gray-700",children:"没有找到匹配的指令"}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"请尝试清空查询条件或检查当前的插件状态"})]}):e.jsx("div",{className:"space-y-4 max-w-5xl mx-auto",children:A.map(s=>{const l=b===s.id,d=L(s.commandType),p=s.isHighRisk;u[s.id]===void 0&&(u[s.id]=P(s.inputSchema));const i=k[s.id];return e.jsxs("div",{className:`bg-white rounded-xl border transition-all duration-200 overflow-hidden shadow-sm hover:shadow ${l?"border-indigo-400 ring-1 ring-indigo-100":p?"border-orange-200 hover:border-orange-300":"border-gray-200 hover:border-indigo-200"}`,children:[e.jsxs("div",{onClick:()=>{j(l?null:s.id)},className:"p-4 flex flex-col sm:flex-row sm:items-center justify-between gap-4 cursor-pointer hover:bg-gray-50/30 transition-colors select-none",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:`p-2 rounded-lg shrink-0 ${p?"bg-orange-50 text-orange-600":"bg-indigo-50 text-indigo-600"}`,children:d==="vfs"?e.jsx(_,{size:18}):d==="edu"?e.jsx(S,{size:18}):d==="mgmt"?e.jsx(z,{size:18}):d==="proc"?e.jsx(v,{size:18}):d==="ai"?e.jsx(R,{size:18}):e.jsx(C,{size:18})}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:"font-mono font-bold text-sm bg-gray-100 text-gray-800 px-2 py-0.5 rounded border border-gray-200",children:s.commandType}),p&&e.jsx("span",{className:"text-[10px] bg-red-100 text-red-700 border border-red-200 rounded font-extrabold px-1.5 py-0.5 uppercase tracking-wide flex items-center gap-0.5",children:"⚠️ 高风险操作"}),e.jsxs("span",{className:"text-xs bg-indigo-50 text-indigo-700 border border-indigo-100 rounded-full px-2 py-0.5",children:["🔒 ",s.capabilityRequired||"无公开权限"]})]}),e.jsx("p",{className:"text-gray-600 text-xs mt-1.5 font-medium line-clamp-1",children:s.description})]})]}),e.jsxs("div",{className:"flex items-center gap-3 self-end sm:self-auto",children:[e.jsxs("span",{className:"text-[10px] text-gray-400 font-mono hidden md:inline",children:["ID: ",s.id]}),e.jsxs("button",{className:`text-xs px-3 py-1 bg-gray-100 text-gray-700 rounded-lg font-semibold border hover:bg-gray-200 transition-all flex items-center gap-1 ${l?"bg-indigo-50 border-indigo-200 text-indigo-700":""}`,children:[l?"折叠面板":"交互调试 Shell",e.jsx(U,{size:12,className:`transform transition-transform ${l?"rotate-90":""}`})]})]})]}),l&&e.jsxs("div",{className:"border-t border-gray-100 bg-gray-50/50 p-5 space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"bg-white rounded-lg border border-gray-200 p-4",children:[e.jsxs("h4",{className:"text-xs font-bold text-gray-700 uppercase tracking-widest mb-3 flex items-center gap-1.5 border-b border-gray-100 pb-2",children:[e.jsx(H,{size:12,className:"text-gray-400"}),"入参规范 (JSON Schema Definition)"]}),s.inputSchema?.properties?e.jsx("div",{className:"space-y-3 font-mono text-[11px]",children:Object.keys(s.inputSchema.properties).map(x=>{const c=s.inputSchema.properties[x],N=s.inputSchema.required?.includes(x);return e.jsxs("div",{className:"flex flex-col gap-1 border-b border-gray-50 last:border-b-0 pb-1.5",children:[e.jsxs("div",{className:"flex items-baseline gap-1.5",children:[e.jsx("span",{className:"text-indigo-600 font-semibold",children:x}),e.jsxs("span",{className:"text-gray-400 text-[10px]",children:["(",c.type,")"]}),N&&e.jsx("span",{className:"text-red-500 text-[9px] font-bold bg-red-50 border border-red-100 rounded px-1",children:"REQUIRED"})]}),c.description&&e.jsx("span",{className:"text-gray-500 font-sans leading-relaxed text-xs",children:c.description})]},x)})}):e.jsx("p",{className:"text-xs text-gray-400 italic",children:"该命令不需要接收任何入参负载 (Payload)。"})]}),e.jsxs("div",{className:"bg-white rounded-lg border border-gray-200 p-4 flex flex-col",children:[e.jsxs("h4",{className:"text-xs font-bold text-gray-700 uppercase tracking-widest mb-3 flex items-center gap-1.5 border-b border-gray-100 pb-2 justify-between",children:[e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(v,{size:12,className:"text-gray-400"}),"Payload 调试区"]}),e.jsx("button",{onClick:()=>{y(x=>({...x,[s.id]:P(s.inputSchema)}))},className:"text-[9px] text-indigo-600 hover:underline hover:text-indigo-800 uppercase tracking-wider",children:"恢复默认模版"})]}),e.jsx("label",{className:"text-[10px] font-semibold text-gray-400 block mb-1",children:"Payload JSON:"}),e.jsx("textarea",{value:u[s.id]||"",onChange:x=>{const c=x.target.value;y(N=>({...N,[s.id]:c}))},rows:6,className:"w-full font-mono text-[11px] p-2.5 bg-gray-900 text-indigo-300 border border-gray-800 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:outline-none resize-none leading-relaxed flex-1 shadow-inner"}),e.jsx("div",{className:"mt-3 flex justify-end",children:e.jsx("button",{onClick:()=>o(s.commandType,s.id),disabled:i?.loading,className:`px-4 py-2 text-xs font-bold font-sans text-white hover:shadow-md active:scale-95 transition-all flex items-center gap-1.5 rounded-lg ${p?"bg-red-600 hover:bg-red-700":"bg-indigo-600 hover:bg-indigo-700 focus:ring-2 focus:ring-indigo-500"} disabled:opacity-50`,children:i?.loading?e.jsxs(e.Fragment,{children:[e.jsx(B,{size:13,className:"animate-spin"}),e.jsx("span",{children:"内核正在调度总线..."})]}):e.jsxs(e.Fragment,{children:[e.jsx(O,{size:13}),e.jsx("span",{children:"提交执行指令 (Deploy Command)"})]})})})]})]}),i&&e.jsxs("div",{className:`p-4 rounded-xl border flex flex-col font-mono text-[11px] leading-relaxed relative ${i.loading?"bg-gray-50 border-gray-200":i.success?"bg-green-50/50 border-green-200 text-green-900":"bg-red-50/50 border-red-200 text-red-900"}`,children:[e.jsx("div",{className:"absolute top-2 right-3 uppercase text-[10px] font-bold text-gray-400",children:"Console Output log"}),e.jsx("div",{className:"font-bold flex items-center gap-1.5 mb-1 bg-transparent border-0 p-0 text-xs text-neutral-800",children:i.loading?e.jsx("span",{className:"text-gray-500",children:"⏳ COMMAND QUEUED..."}):i.success?e.jsxs("span",{className:"text-green-700 flex items-center gap-1",children:[e.jsx(J,{size:14})," STATUS: 200 SUCCESS (Action Completed)"]}):e.jsxs("span",{className:"text-red-700 flex items-center gap-1",children:[e.jsx(q,{size:14})," STATUS: 500 INTERNAL_BUS_ERROR"]})}),!i.loading&&e.jsx("pre",{className:"mt-2 p-3 bg-gray-900/95 text-gray-200 rounded-lg overflow-x-auto border border-gray-800 shadow-inner max-h-56 select-all font-mono",children:i.success?JSON.stringify(i.data,null,2):i.error})]})]})]},s.id)})})})]})},Z=({pluginGuideMd:r,loadingMd:a,copiedId:t,handleCopy:n,pluginBoilerplateCode:g,pluginInteractiveCode:h,pluginExamCode:b})=>e.jsx("div",{className:"flex-1 overflow-y-auto p-6 bg-slate-50/50",children:e.jsxs("div",{className:"max-w-5xl mx-auto space-y-6",children:[a?e.jsxs("div",{className:"flex flex-col items-center justify-center p-12 bg-white rounded-2xl border border-gray-200",children:[e.jsx(B,{size:32,className:"animate-spin text-indigo-600 mb-2"}),e.jsx("span",{className:"text-xs text-gray-500 font-semibold",children:"正在从服务器拉取 SDK 文档..."})]}):r?e.jsx("div",{className:"bg-white rounded-2xl border border-gray-200 p-8 shadow-sm prose prose-slate max-w-none text-xs leading-relaxed",children:e.jsx(X,{children:r})}):null,e.jsxs("div",{className:"bg-white rounded-2xl border border-indigo-100 p-6 shadow-sm flex flex-col md:flex-row gap-5 items-start",children:[e.jsx("div",{className:"p-4 bg-indigo-50 text-indigo-600 rounded-2xl shrink-0",children:e.jsx(C,{size:28})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-base font-bold text-gray-900",children:"Edu-OS 插件开发指南 & API 参考"}),e.jsxs("p",{className:"text-xs text-gray-600 leading-relaxed",children:["Edu-OS 基于 ",e.jsx("span",{className:"font-semibold text-indigo-600",children:"CommandBus(命令总线)"})," + ",e.jsx("span",{className:"font-semibold text-indigo-600",children:"EventBus(事件总线)"})," 微内核架构。 插件通过标准 ESM 模块导出 ",e.jsx("code",{className:"bg-gray-100 text-rose-600 px-1 rounded text-[10px]",children:"activate(ctx)"})," 函数接收 ",e.jsx("span",{className:"font-semibold",children:"PluginContext"}),", 进而访问 7 大内核服务。本页提供完整的 API 参考、参数说明和可运行示例。"]}),e.jsxs("div",{className:"flex flex-wrap gap-2 pt-1",children:[e.jsx("span",{className:"text-[10px] bg-indigo-50 text-indigo-700 border border-indigo-100 px-2 py-0.5 rounded-full font-medium",children:"🔄 DI 依赖注入"}),e.jsx("span",{className:"text-[10px] bg-emerald-50 text-emerald-700 border border-emerald-100 px-2 py-0.5 rounded-full font-medium",children:"🔒 能力安全模型"}),e.jsx("span",{className:"text-[10px] bg-amber-50 text-amber-700 border border-amber-100 px-2 py-0.5 rounded-full font-medium",children:"⚡ 热重载 + Worker 隔离"}),e.jsx("span",{className:"text-[10px] bg-rose-50 text-rose-700 border border-rose-100 px-2 py-0.5 rounded-full font-medium",children:"📦 ESM + CommonJS 双格式"}),e.jsx("span",{className:"text-[10px] bg-sky-50 text-sky-700 border border-sky-100 px-2 py-0.5 rounded-full font-medium",children:"🆔 别名生命周期 (Alias Lifecycle)"}),e.jsx("span",{className:"text-[10px] bg-teal-50 text-teal-700 border border-teal-100 px-2 py-0.5 rounded-full font-medium",children:"🛡️ Worker Storage 安全隔离"})]})]})]}),e.jsxs("div",{className:"bg-white rounded-2xl border border-gray-200 overflow-hidden shadow-sm",children:[e.jsxs("div",{className:"px-5 py-4 bg-gray-50 border-b border-gray-100 flex flex-col sm:flex-row sm:items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("div",{className:"p-1.5 bg-indigo-50 text-indigo-600 rounded",children:e.jsx(I,{size:16})}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs font-bold text-gray-900",children:"示例 1:思维导图插件 — 注册 Action + 处理器 + 发布事件"}),e.jsx("p",{className:"text-[10px] text-gray-500 mt-0.5",children:"演示 ctx.services 解构、Action 注册、createCommand 创建信封、eventBus.publish 发布事件"})]})]}),e.jsxs("button",{onClick:()=>n("tpl1",g),className:`px-3 py-1.5 rounded-lg text-xs font-semibold flex items-center gap-1.5 transition-all shadow-sm shrink-0 ${t==="tpl1"?"bg-emerald-50 text-emerald-700 border border-emerald-250":"bg-white text-indigo-600 border border-indigo-150 hover:bg-indigo-50"}`,children:[t==="tpl1"?e.jsx(T,{size:12}):e.jsx(w,{size:12}),e.jsx("span",{children:t==="tpl1"?"已复制!":"复制代码"})]})]}),e.jsx("pre",{className:"text-xs font-mono p-5 bg-gray-950 text-gray-200 overflow-x-auto leading-relaxed max-h-[360px] shadow-inner select-all",children:g})]}),e.jsxs("div",{className:"bg-white rounded-2xl border border-gray-200 overflow-hidden shadow-sm",children:[e.jsxs("div",{className:"px-5 py-4 bg-gray-50 border-b border-gray-100 flex flex-col sm:flex-row sm:items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("div",{className:"p-1.5 bg-emerald-50 text-emerald-600 rounded",children:e.jsx(I,{size:16})}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs font-bold text-gray-900",children:"示例 2:AI 作业批改插件 — 演示 AI + 事件订阅 + 存储 + DI"}),e.jsx("p",{className:"text-[10px] text-gray-500 mt-0.5",children:"演示 ctx.resolve 获取数据库、services.ai 生成文本、services.storage 持久化、eventBus 订阅"})]})]}),e.jsxs("button",{onClick:()=>n("tpl2",h),className:`px-3 py-1.5 rounded-lg text-xs font-semibold flex items-center gap-1.5 transition-all shadow-sm shrink-0 ${t==="tpl2"?"bg-emerald-50 text-emerald-700 border border-emerald-250":"bg-white text-emerald-600 border border-emerald-150 hover:bg-emerald-50"}`,children:[t==="tpl2"?e.jsx(T,{size:12}):e.jsx(w,{size:12}),e.jsx("span",{children:t==="tpl2"?"已复制!":"复制代码"})]})]}),e.jsx("pre",{className:"text-xs font-mono p-5 bg-gray-950 text-gray-200 overflow-x-auto leading-relaxed max-h-[360px] shadow-inner select-all",children:h})]}),e.jsxs("div",{className:"bg-white rounded-2xl border border-gray-200 overflow-hidden shadow-sm",children:[e.jsxs("div",{className:"px-5 py-4 bg-gray-50 border-b border-gray-100 flex flex-col sm:flex-row sm:items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("div",{className:"p-1.5 bg-amber-50 text-amber-600 rounded",children:e.jsx(I,{size:16})}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs font-bold text-gray-900",children:"示例 3:考试系统插件 — 演示 ctx.db 自建表 + deactivate 清理"}),e.jsx("p",{className:"text-[10px] text-gray-500 mt-0.5",children:"演示 ctx.db.ensureTable 建表、ctx.db.table 获取带前缀表名、deactivate 生命周期"})]})]}),e.jsxs("button",{onClick:()=>n("tpl3",b),className:`px-3 py-1.5 rounded-lg text-xs font-semibold flex items-center gap-1.5 transition-all shadow-sm shrink-0 ${t==="tpl3"?"bg-emerald-50 text-emerald-700 border border-emerald-250":"bg-white text-amber-600 border border-amber-150 hover:bg-amber-50"}`,children:[t==="tpl3"?e.jsx(T,{size:12}):e.jsx(w,{size:12}),e.jsx("span",{children:t==="tpl3"?"已复制!":"复制代码"})]})]}),e.jsx("pre",{className:"text-xs font-mono p-5 bg-gray-950 text-gray-200 overflow-x-auto leading-relaxed max-h-[360px] shadow-inner select-all",children:b})]})]})}),ee=({copiedId:r,handleCopy:a})=>e.jsx("div",{className:"flex-1 overflow-y-auto p-6 bg-slate-50/50",children:e.jsxs("div",{className:"max-w-5xl mx-auto space-y-8",children:[e.jsxs("div",{className:"bg-gradient-to-r from-indigo-900 to-indigo-950 rounded-2xl p-6 text-white shadow-md flex flex-col md:flex-row gap-5 items-start",children:[e.jsx("div",{className:"p-4 bg-indigo-500/20 text-indigo-300 border border-indigo-500/30 rounded-2xl shrink-0",children:e.jsx(S,{size:32})}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("h3",{className:"text-lg font-bold text-white flex items-center gap-2",children:["Edu-OS 核心系统主要特性使用教程",e.jsx("span",{className:"text-[10px] bg-indigo-500/30 text-indigo-200 border border-indigo-500/50 px-2 py-0.5 rounded-full font-normal",children:"v2.1.0 LTS"})]}),e.jsx("p",{className:"text-xs text-indigo-200 leading-relaxed",children:"本指南为教育实验操作系统 (Edu-OS) 的深度使用手册。详细阐述如何使用内核指令管理班级与学生、基于大纲结构化推进课件时间轴、在互动白板中动态注入脑图和测验元素、启动全屏锁定与签到的教学控制流,以及编写并集成支持 AI 成绩回传的 HTML Applet 实验组件。"}),e.jsxs("div",{className:"flex flex-wrap gap-2 pt-1",children:[e.jsx("span",{className:"text-[10px] bg-indigo-800/40 text-indigo-150 border border-indigo-700/50 px-2 py-0.5 rounded-full font-medium",children:"🏫 班级与学生指令集"}),e.jsx("span",{className:"text-[10px] bg-emerald-800/40 text-emerald-150 border border-emerald-700/50 px-2 py-0.5 rounded-full font-medium",children:"📋 课程大纲时间轴同步"}),e.jsx("span",{className:"text-[10px] bg-amber-800/40 text-amber-150 border border-amber-700/50 px-2 py-0.5 rounded-full font-medium",children:"🎨 协作白板指令渲染"}),e.jsx("span",{className:"text-[10px] bg-sky-800/40 text-sky-150 border border-sky-700/50 px-2 py-0.5 rounded-full font-medium",children:"🚀 postMessage 成绩监听"})]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[e.jsxs("div",{className:"bg-white rounded-2xl border border-gray-200 shadow-sm p-6 space-y-4 hover:shadow-md transition-all flex flex-col justify-between",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-3 border-b border-gray-100 pb-3 text-indigo-600 font-bold",children:[e.jsx("div",{className:"p-2 bg-indigo-50 rounded-xl",children:e.jsx(z,{size:20})}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm text-gray-900",children:"1. 使用核心指令管理班级与学生"}),e.jsx("p",{className:"text-[11px] text-gray-400 font-normal mt-0.5",children:"Administrative CLI & Capability Model"})]})]}),e.jsxs("p",{className:"text-xs text-gray-600 leading-relaxed mt-3",children:["Edu-OS 采用权限隔离的",e.jsx("strong",{children:"能力安全模型 (Capability Model)"}),"。任何行政、学籍以及课表排期修改,底层最终都会被封装为非对称的内核指令,经由分布式指令总线进行安全校验与事务落库。"]}),e.jsxs("div",{className:"p-3 bg-indigo-50/50 rounded-xl border border-indigo-100 text-[11px] text-indigo-900 space-y-1.5 mt-3",children:[e.jsx("span",{className:"font-bold block",children:"🔒 核心访问权限声明 (RBAC Capabilities):"}),e.jsxs("ul",{className:"list-disc list-inside space-y-1 text-gray-600 text-[10.5px]",children:[e.jsxs("li",{children:[e.jsx("code",{className:"bg-white/80 px-1 rounded border border-indigo-150",children:"class:write"}),":允许创建/删除行政班级。"]}),e.jsxs("li",{children:[e.jsx("code",{className:"bg-white/80 px-1 rounded border border-indigo-150",children:"student:write"}),":允许注册学生、修改学籍或修改设备锁定状态。"]}),e.jsxs("li",{children:[e.jsx("code",{className:"bg-white/80 px-1 rounded border border-indigo-150",children:"schedule:write"}),":允许编排课程,或临时将某一日期的课程替换为星期几的常规课表。"]})]})]})]}),e.jsxs("div",{className:"space-y-3 font-mono text-[11px] mt-4",children:[e.jsxs("div",{className:"bg-gray-50 rounded-xl p-3 border border-gray-150 relative",children:[e.jsxs("div",{className:"flex justify-between items-center mb-1",children:[e.jsx("span",{className:"text-indigo-600 font-bold",children:"A. 创建班级 (class.create)"}),e.jsx("button",{onClick:()=>a("guide_cmd_class",`{
3
+ "name": "高三一班",
4
+ "description": "物理实验班"
5
+ }`),className:"text-[10px] text-indigo-600 hover:underline hover:text-indigo-800 font-sans",children:r==="guide_cmd_class"?"已复制":"复制参数"})]}),e.jsx("pre",{className:"text-[10px] text-gray-500 overflow-x-auto whitespace-pre-wrap leading-relaxed",children:`{
6
+ "name": "高三一班",
7
+ "description": "2026届物理实验班"
8
+ }`})]}),e.jsxs("div",{className:"bg-gray-50 rounded-xl p-3 border border-gray-150 relative",children:[e.jsxs("div",{className:"flex justify-between items-center mb-1",children:[e.jsx("span",{className:"text-indigo-600 font-bold",children:"B. 注册学生 (student.register)"}),e.jsx("button",{onClick:()=>a("guide_cmd_student",`{
9
+ "name": "李华",
10
+ "email": "lihua@openlearn.org",
11
+ "password": "mypassword123"
12
+ }`),className:"text-[10px] text-indigo-600 hover:underline hover:text-indigo-800 font-sans",children:r==="guide_cmd_student"?"已复制":"复制参数"})]}),e.jsx("pre",{className:"text-[10px] text-gray-500 overflow-x-auto whitespace-pre-wrap leading-relaxed",children:`{
13
+ "name": "李华",
14
+ "email": "lihua@openlearn.org",
15
+ "password": "mypassword123"
16
+ }`})]}),e.jsxs("div",{className:"bg-gray-50 rounded-xl p-3 border border-gray-150 relative",children:[e.jsxs("div",{className:"flex justify-between items-center mb-1",children:[e.jsx("span",{className:"text-indigo-600 font-bold",children:"C. 强制学生屏幕锁定 (student.lock_lesson)"}),e.jsx("button",{onClick:()=>a("guide_cmd_lock",`{
17
+ "studentId": "student-uuid-xxxx",
18
+ "lockedLessonId": "lesson-uuid-yyyy"
19
+ }`),className:"text-[10px] text-indigo-600 hover:underline hover:text-indigo-800 font-sans",children:r==="guide_cmd_lock"?"已复制":"复制参数"})]}),e.jsx("pre",{className:"text-[10px] text-gray-500 overflow-x-auto whitespace-pre-wrap leading-relaxed",children:`{
20
+ "studentId": "student-uuid-xxxx",
21
+ "lockedLessonId": "lesson-uuid-yyyy"
22
+ }`})]})]})]}),e.jsxs("div",{className:"bg-white rounded-2xl border border-gray-200 shadow-sm p-6 space-y-4 hover:shadow-md transition-all flex flex-col justify-between",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-3 border-b border-gray-100 pb-3 text-emerald-600 font-bold",children:[e.jsx("div",{className:"p-2 bg-emerald-50 rounded-xl",children:e.jsx(G,{size:20})}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm text-gray-900",children:"2. 课程编辑与时间轴推进"}),e.jsx("p",{className:"text-[11px] text-gray-400 font-normal mt-0.5",children:"Structure Markdown & Timeline Sync"})]})]}),e.jsxs("div",{className:"space-y-3 mt-3 text-xs text-gray-600 leading-relaxed",children:[e.jsx("p",{children:'在系统"课程管理"中,教师可以使用内置大纲结构化的 Markdown 工具编排课件,或选择数学、计算机科学、文学、物理、历史、艺术模板一键填充结构化实验教案。'}),e.jsxs("div",{className:"p-3 bg-gray-50 rounded-xl border border-gray-150 space-y-1 text-[11px] font-sans",children:[e.jsx("span",{className:"font-bold text-gray-800 block",children:"📝 大纲解析与进度切片规则:"}),e.jsxs("p",{className:"text-gray-500",children:["系统内核采用递归的 AST 语法分析器,提取文档中的一级标题 (",e.jsx("code",{className:"font-mono text-rose-600 font-semibold bg-gray-100 px-0.5 rounded",children:"#"}),") 与二级标题 (",e.jsx("code",{className:"font-mono text-rose-600 font-semibold bg-gray-100 px-0.5 rounded",children:"##"}),") 作为教学",e.jsx("b",{children:"时间轴切片 (Timeline Segments)"}),"。"]})]}),e.jsxs("div",{className:"p-3.5 bg-emerald-50/50 rounded-xl border border-emerald-100 space-y-2 text-[11px] text-emerald-800",children:[e.jsxs("span",{className:"font-bold flex items-center gap-1",children:[e.jsx(F,{size:12})," 时间轴实时推进机制 (Sync Protocol):"]}),e.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-gray-600 leading-relaxed",children:[e.jsxs("li",{children:["当教师在教学控制台选中大纲某个段落时,前端会通过 WebSocket 通信管道发送一个 ",e.jsx("code",{className:"font-mono bg-white text-emerald-700 px-1 rounded border border-emerald-150",children:"sync_timeline"})," 广播包。"]}),e.jsxs("li",{children:["学生终端捕获该消息包,解析出对应的锚点 DOM ID,并自动执行 DOM 的 ",e.jsxs("code",{className:"font-mono bg-white text-emerald-700 px-1 rounded border border-emerald-150",children:[".scrollIntoView(","{ behavior: 'smooth' }",")"]})," 动画平滑定位。"]}),e.jsxs("li",{children:["在此模式下,学生终端的大脑侧边滚轮处于",e.jsx("b",{children:"阻尼锁定状态"}),",禁止自行向上游或下游浏览,以保证全体学生始终与教师保持完全一致的视野。"]})]})]})]})]}),e.jsxs("div",{className:"p-3 bg-gray-50 rounded-xl border border-gray-150 text-[10px] text-gray-500 leading-relaxed",children:["💡 ",e.jsx("span",{className:"font-semibold text-gray-700",children:"常规课表与临时调整:"}),'如果需要将某一天的课程临时调换为星期几的常规安排(如将下周一临时指定为星期五课表),可在"课表看板"或使用 ',e.jsx("code",{className:"bg-gray-100 font-mono text-rose-600 px-1 rounded",children:"schedule.update_date_mapping"})," 指令进行快速热重载,数据库将自动持久化这种临时的映射规则。"]})]}),e.jsxs("div",{className:"bg-white rounded-2xl border border-gray-200 shadow-sm p-6 space-y-4 hover:shadow-md transition-all flex flex-col justify-between",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-3 border-b border-gray-100 pb-3 text-amber-600 font-bold",children:[e.jsx("div",{className:"p-2 bg-amber-50 rounded-xl",children:e.jsx(V,{size:20})}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm text-gray-900",children:"3. 互动协作白板深度原理"}),e.jsx("p",{className:"text-[11px] text-gray-400 font-normal mt-0.5",children:"Whiteboard Drawing API & State Serialization"})]})]}),e.jsx("p",{className:"text-xs text-gray-600 leading-relaxed mt-3",children:"协作白板采用轻量级矢量序列化格式存储。每一笔涂鸦、矩形、圆形、文本或第三方卡片均被抽象为带有全局唯一 ID 的矢量节点模型,实时在 SQLite 数据库中持久化并在前端的 Canvas/SVG 容器中完成合并渲染。"}),e.jsxs("div",{className:"p-3 bg-gray-50 rounded-xl border border-gray-150 text-[10.5px] font-mono text-gray-500 space-y-1 mt-3",children:[e.jsx("span",{className:"font-bold text-gray-700 block font-sans",children:"💾 矢量节点序列化数据示例 (SQLite Schema):"}),e.jsx("pre",{className:"text-[9.5px] overflow-x-auto whitespace-pre-wrap",children:`{
23
+ "id": "elt-90928a",
24
+ "type": "rect",
25
+ "data": "{\\"x\\":120,\\"y\\":80,\\"w\\":150,\\"h\\":60,\\"stroke\\":\\"#6366f1\\",\\"fill\\":\\"#e0e7ff\\"}"
26
+ }`})]}),e.jsxs("div",{className:"p-3 bg-amber-50/50 rounded-xl border border-amber-100 text-[11px] text-amber-900 space-y-2 mt-3",children:[e.jsx("span",{className:"font-bold block",children:"💡 互动绘制指令说明 (whiteboard.draw):"}),e.jsxs("p",{className:"text-gray-600 leading-relaxed",children:["除了在画板上使用画笔绘图外,插件生态亦可通过向总线派发 ",e.jsx("code",{className:"bg-white text-amber-700 border border-amber-150 px-1 rounded font-mono",children:"whiteboard.draw"})," 指令,动态在指定位置绘制结构化的几何内容或思维导图组件。"]})]})]}),e.jsxs("div",{className:"bg-amber-50/50 rounded-xl p-3 border border-amber-100 text-xs text-amber-800 relative mt-4",children:[e.jsxs("div",{className:"flex justify-between items-center mb-1",children:[e.jsx("span",{className:"font-bold",children:"A. 动态绘制思维脑图参数示例"}),e.jsx("button",{onClick:()=>a("guide_cmd_draw_map",`{
27
+ "lessonId": "lesson-101",
28
+ "type": "mindmap",
29
+ "data": "{\\"title\\":\\"光电效应\\",\\"branches\\":[\\"赫兹发现\\",\\"爱因斯坦解释\\"]}"
30
+ }`),className:"text-[10px] text-amber-700 hover:underline font-sans font-bold",children:r==="guide_cmd_draw_map"?"已复制":"复制 Payload"})]}),e.jsx("pre",{className:"font-mono text-[9px] text-amber-900/70 overflow-x-auto",children:`{
31
+ "lessonId": "lesson-101",
32
+ "type": "mindmap",
33
+ "data": "{\\"title\\":\\"光电效应\\",\\"branches\\":[\\"赫兹发现\\",\\"爱因斯坦解释\\"]}"
34
+ }`})]})]}),e.jsxs("div",{className:"bg-white rounded-2xl border border-gray-200 shadow-sm p-6 space-y-4 hover:shadow-md transition-all flex flex-col justify-between",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-3 border-b border-gray-100 pb-3 text-sky-600 font-bold",children:[e.jsx("div",{className:"p-2 bg-sky-50 rounded-xl",children:e.jsx(O,{size:20})}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm text-gray-900",children:"4. 现场教学与课堂控制流程"}),e.jsx("p",{className:"text-[11px] text-gray-400 font-normal mt-0.5",children:"Live Classroom Lifecycle & WS Protocol"})]})]}),e.jsx("p",{className:"text-xs text-gray-600 leading-relaxed mt-3",children:"现场教学是 Edu-OS 实现教师端对全班学生端实时掌控、授课与互动的核心驱动模块。以下是系统推荐的标准课堂控制流:"}),e.jsxs("div",{className:"space-y-3 text-xs mt-3",children:[e.jsxs("div",{className:"flex gap-3 items-start",children:[e.jsx("div",{className:"h-5 w-5 font-mono font-bold bg-sky-100 border border-sky-200 text-sky-700 rounded-lg flex items-center justify-center shrink-0 mt-0.5",children:"1"}),e.jsxs("div",{children:[e.jsx("span",{className:"font-semibold text-gray-800",children:"课堂通道初始化 (WebSocket Connect)"}),e.jsx("p",{className:"text-[11px] text-gray-500 mt-0.5",children:'点击"开始上课"后,服务器将为该班级开辟独立的 Room 广播室。所有在该行政班级内的学生设备自动建立双向心跳长连接。'})]})]}),e.jsxs("div",{className:"flex gap-3 items-start",children:[e.jsx("div",{className:"h-5 w-5 font-mono font-bold bg-sky-100 border border-sky-200 text-sky-700 rounded-lg flex items-center justify-center shrink-0 mt-0.5",children:"2"}),e.jsxs("div",{children:[e.jsx("span",{className:"font-semibold text-gray-800",children:"全屏课件与屏幕强控 (Class Lock)"}),e.jsx("p",{className:"text-[11px] text-gray-500 mt-0.5",children:"教师启动教学视图后,系统会广播 `class_lock` 事件。学生终端界面被迫最小化非教学区,全屏强制渲染指定的课时 Markdown 文档,拦截一切其他的键盘路由跳转。"})]})]}),e.jsxs("div",{className:"flex gap-3 items-start",children:[e.jsx("div",{className:"h-5 w-5 font-mono font-bold bg-sky-100 border border-sky-200 text-sky-700 rounded-lg flex items-center justify-center shrink-0 mt-0.5",children:"3"}),e.jsxs("div",{children:[e.jsx("span",{className:"font-semibold text-gray-800",children:"出勤签到统计 (Roll Call & Attendance)"}),e.jsx("p",{className:"text-[11px] text-gray-500 mt-0.5",children:"教师一键下发签到令牌,学生端界面滑出覆盖式的签到组件。系统利用 WebSocket 增量计数,在教师端看板的考勤环形图中实时计算到课率、迟到率以及旷课名单。"})]})]}),e.jsxs("div",{className:"flex gap-3 items-start",children:[e.jsx("div",{className:"h-5 w-5 font-mono font-bold bg-sky-100 border border-sky-200 text-sky-700 rounded-lg flex items-center justify-center shrink-0 mt-0.5",children:"4"}),e.jsxs("div",{children:[e.jsx("span",{className:"font-semibold text-gray-800",children:"交互过程感知与动态审计 (Activity Auditing)"}),e.jsx("p",{className:"text-[11px] text-gray-500 mt-0.5",children:"学生每一次提交的实验数据、成绩变动、签到时刻等操作,均以结构化日志格式推送并在教师端的动态操作审计终端上显示。"})]})]})]})]}),e.jsxs("div",{className:"p-3 bg-sky-50/50 rounded-xl border border-sky-100 text-[10.5px] text-sky-850 flex items-center gap-2 mt-4",children:[e.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500 animate-ping"}),e.jsxs("span",{children:[e.jsx("strong",{children:"考勤数据存根:"}),"签到动作一经产生,将自动持久化至底层的 ",e.jsx("code",{className:"font-mono text-[10px] bg-white px-1 border border-sky-200 rounded",children:"attendance"})," 表中,随时供导出 PDF 或生成学期报告。"]})]})]})]}),e.jsxs("div",{className:"bg-gradient-to-br from-slate-900 to-slate-950 text-white rounded-2xl p-6 space-y-6 shadow-md",children:[e.jsxs("div",{className:"flex items-center gap-3 border-b border-slate-800 pb-3 text-indigo-400 font-bold",children:[e.jsx("div",{className:"p-2 bg-slate-800 rounded-xl",children:e.jsx(Q,{size:24})}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-base text-white",children:"5. HTML Applet 的打包、分发与 AI 成绩监听注入机制"}),e.jsx("p",{className:"text-[11px] text-slate-400 font-normal mt-0.5",children:"HTML Applet Architecture & parent.postMessage Interface Spec"})]})]}),e.jsx("div",{className:"text-xs text-slate-300 leading-relaxed space-y-3",children:e.jsxs("p",{children:["HTML Applet 是 Edu-OS 系统架构中用以承载高级虚拟物理实验、交互式小游戏、或第三方考试系统的微网页插件。Applet 被封装运行在宿主页面的 ",e.jsx("code",{className:"bg-slate-800 text-indigo-300 px-1 rounded font-mono",children:"iframe"})," 沙箱容器中。"]})})]})]})}),se=()=>e.jsx("div",{className:"flex-1 overflow-y-auto p-6 bg-gray-50/30",children:e.jsx("div",{className:"max-w-5xl mx-auto space-y-6",children:e.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 p-6 shadow-sm",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsx("div",{className:"p-2 bg-indigo-50 rounded-lg text-indigo-600",children:e.jsx(w,{size:20})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-base font-bold text-gray-900",children:"已安装插件的使用文档"}),e.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:"插件开发者可在 manifest.contributes 中声明 help.plugin_docs 贡献项,或通过扩展点注册文档组件。"})]})]}),e.jsx(D,{slot:"help.plugin_docs"})]})})});function xe({registeredCommands:r,onRefresh:a}){M(o=>o.lang);const[t,n]=m.useState("commands"),[g,h]=m.useState(null),[b,j]=m.useState(""),[u,y]=m.useState(!1);m.useEffect(()=>{t==="sdk_guide"&&!b&&(y(!0),fetch("/api/docs/plugin-guide").then(o=>o.json()).then(o=>{o.success?j(o.content):j("加载失败: "+(o.error||"未知错误"))}).catch(o=>{j("加载出错: "+o.message)}).finally(()=>{y(!1)}))},[t,b]);const k=(o,s)=>{navigator.clipboard.writeText(s),h(o),setTimeout(()=>h(null),1500)};return e.jsxs("div",{className:"flex-1 flex flex-col h-full bg-white text-gray-900 border border-gray-200 rounded-2xl shadow-sm overflow-hidden m-1",children:[e.jsxs("div",{className:"px-6 py-5 bg-gradient-to-r from-indigo-50 via-purple-50 to-indigo-50/20 shrink-0 border-b border-gray-150 flex flex-col md:flex-row md:items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-xl font-bold text-gray-900 flex items-center gap-2",children:[e.jsx(K,{className:"text-indigo-600",size:24}),"教育实验操作系统:内核帮助与开发中心 (Edu-OS Reference Hub)"]}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"本页提供 OpenLearn 插件开发的快速入口:脚手架工具、交互式代码范例、完整的 API 参考文档。"})]}),e.jsxs("div",{className:"flex bg-neutral-100 p-0.5 rounded-xl border border-neutral-200 self-start md:self-center shrink-0 shadow-inner",children:[e.jsxs("button",{onClick:()=>n("commands"),className:`px-4 py-1.5 rounded-lg text-xs font-semibold tracking-wide transition-all flex items-center gap-1.5 ${t==="commands"?"bg-white text-indigo-700 shadow-sm font-bold border border-neutral-200/50":"text-gray-500 hover:text-gray-800"}`,children:[e.jsx(v,{size:14}),e.jsx("span",{children:"指令调试 (Command Playground)"})]}),e.jsxs("button",{onClick:()=>n("sdk_guide"),className:`px-4 py-1.5 rounded-lg text-xs font-semibold tracking-wide transition-all flex items-center gap-1.5 ${t==="sdk_guide"?"bg-white text-indigo-700 shadow-sm font-bold border border-neutral-200/50":"text-gray-500 hover:text-gray-800"}`,children:[e.jsx(C,{size:14}),e.jsx("span",{children:"插件开发指南 & API"})]}),e.jsxs("button",{onClick:()=>n("user_guide"),className:`px-4 py-1.5 rounded-lg text-xs font-semibold tracking-wide transition-all flex items-center gap-1.5 ${t==="user_guide"?"bg-white text-indigo-700 shadow-sm font-bold border border-neutral-200/50":"text-gray-500 hover:text-gray-800"}`,children:[e.jsx(S,{size:14}),e.jsx("span",{children:"系统使用教程"})]}),e.jsxs("button",{onClick:()=>n("plugin_docs"),className:`px-4 py-1.5 rounded-lg text-xs font-semibold tracking-wide transition-all flex items-center gap-1.5 ${t==="plugin_docs"?"bg-white text-indigo-700 shadow-sm font-bold border border-neutral-200/50":"text-gray-500 hover:text-gray-800"}`,children:[e.jsx(w,{size:14}),e.jsx("span",{children:"扩展文档"})]})]})]}),t==="commands"&&e.jsx(Y,{registeredCommands:r,onRefresh:a}),t==="sdk_guide"&&e.jsx(Z,{pluginGuideMd:b,loadingMd:u,copiedId:g,handleCopy:k,pluginBoilerplateCode:`# 快速开始:3 分钟创建插件
35
+
36
+ 使用 \`@openlearn/plugin-sdk\` CLI 脚手架,一键生成完整项目:
37
+
38
+ \`\`\`bash
39
+ # 创建插件项目
40
+ npx @openlearn/plugin-sdk init --name hello-world
41
+
42
+ # 进入项目并构建
43
+ cd hello-world
44
+ npm install
45
+ npx @openlearn/plugin-sdk build
46
+
47
+ # 产物:hello-world.zip → 上传到插件中心
48
+ \`\`\`
49
+
50
+ ## 三种模板
51
+
52
+ | 模板 | 说明 | 适用 |
53
+ |------|------|------|
54
+ | \`server-only\` | 纯后端(AI 工具 + 命令) | 数据处理 |
55
+ | \`full-stack\` | 后端 + React 前端 | 完整应用 |
56
+ | \`frontend-only\` | 纯 UI 扩展 | 白板工具 |
57
+
58
+ ## 交互式创建
59
+
60
+ \`\`\`bash
61
+ npx @openlearn/plugin-sdk init
62
+ # CLI 逐步询问:名称 → 描述 → 作者 → 模板
63
+ \`\`\`
64
+
65
+ ## 项目结构
66
+
67
+ \`\`\`
68
+ my-plugin/
69
+ ├── src/index.ts # 服务端入口(export default { manifest, activate })
70
+ ├── src/frontend.tsx # 前端组件(可选)
71
+ └── package.json
72
+ \`\`\`
73
+ `,pluginInteractiveCode:`# 完整插件示例(server-only 模板)
74
+
75
+ \`\`\`typescript
76
+ import type { PluginContext } from '@openlearn/plugin-sdk';
77
+ import {
78
+ ICommandBusServiceToken,
79
+ IActionRegistryServiceToken,
80
+ IEventBusServiceToken,
81
+ IDatabaseToken,
82
+ } from '@openlearn/plugin-sdk';
83
+
84
+ export default {
85
+ manifest: {
86
+ id: '@myorg/hello-plugin',
87
+ name: '问候插件',
88
+ version: '0.1.0',
89
+ requires: [
90
+ '@openlearn/core:ICommandBusService@^1.0.0',
91
+ '@openlearn/core:IActionRegistryService@^1.0.0',
92
+ '@openlearn/core:IEventBusService@^1.0.0',
93
+ '@openlearn/core:IDatabase@^1.0.0',
94
+ ],
95
+ capabilitiesProposed: ['lesson:read'],
96
+ engines: { openlearn: '^0.2.5' },
97
+ },
98
+
99
+ async activate(ctx: PluginContext) {
100
+ const commandBus = ctx.services.commandBus;
101
+ const actionRegistry = ctx.services.actionRegistry;
102
+ const eventBus = ctx.services.eventBus;
103
+
104
+ // 1. 注册 AI 工具
105
+ await actionRegistry.register({
106
+ id: 'hello-greet',
107
+ commandType: 'hello.greet',
108
+ description: '向指定的人打招呼,返回问候语',
109
+ capabilityRequired: 'lesson:read',
110
+ inputSchema: {
111
+ type: 'OBJECT',
112
+ properties: {
113
+ name: { type: 'STRING', description: '姓名' },
114
+ },
115
+ required: ['name'],
116
+ },
117
+ });
118
+
119
+ // 2. 注册命令处理器
120
+ await commandBus.registerHandler('hello.greet', {
121
+ async execute(command) {
122
+ const payload = command.payload as any;
123
+ const message = \`Hello, \${payload.name}!\`;
124
+
125
+ // 3. 发布事件通知
126
+ await eventBus.publish({
127
+ id: crypto.randomUUID(),
128
+ type: 'hello.greeted',
129
+ source: 'plugin.hello',
130
+ payload: { message },
131
+ timestamp: Date.now(),
132
+ correlationId: command.id,
133
+ });
134
+
135
+ return { message };
136
+ },
137
+ });
138
+
139
+ ctx.log.info('问候插件已激活');
140
+ },
141
+ };
142
+ \`\`\`
143
+
144
+ ## 核心概念:Action → Command → Event
145
+
146
+ \`\`\`
147
+ AI Agent 调用 Action → CommandBus 执行 Handler → EventBus 广播事件
148
+ \`\`\`
149
+
150
+ 1. **Action** — 用 \`actionRegistry.register()\` 注册 AI 工具,\`description\` 是 AI 理解的关键
151
+ 2. **Command** — 用 \`commandBus.registerHandler()\` 执行业务逻辑
152
+ 3. **Event** — 用 \`eventBus.publish()\` 通知其他系统
153
+ `,pluginExamCode:`# 构建与发布
154
+
155
+ \`\`\`bash
156
+ # 开发模式(watch 自动重构建)
157
+ npx @openlearn/plugin-sdk build --watch
158
+
159
+ # 生产构建
160
+ npx @openlearn/plugin-sdk build
161
+
162
+ # 产物
163
+ dist/
164
+ ├── index.js # 服务端 bundle
165
+ ├── frontend.js # 前端 bundle(如有)
166
+ └── my-plugin.zip # ★ 可上传到插件中心
167
+ \`\`\`
168
+
169
+ ## 插件数据库
170
+
171
+ 每个插件有独立的命名空间:
172
+
173
+ \`\`\`typescript
174
+ // 创建表
175
+ await ctx.db.ensureTable('polls', \`
176
+ id TEXT PRIMARY KEY,
177
+ question TEXT NOT NULL
178
+ \`);
179
+
180
+ // 获取带命名空间的表名
181
+ const tableName = ctx.db.table('polls');
182
+ // → plugin_@myorg_hello-plugin_polls
183
+
184
+ // 通过 DI 拿到 raw better-sqlite3
185
+ const db = await ctx.resolve(IDatabaseToken);
186
+ db.prepare(\`INSERT INTO \${tableName} ...\`).run(...);
187
+ \`\`\`
188
+
189
+ ## 可用的 9 个 DI Token
190
+
191
+ 通过 \`ctx.services\` 或 \`ctx.resolve(token)\` 访问:
192
+
193
+ | Token | 服务 |
194
+ |-------|------|
195
+ | ICommandBusServiceToken | 命令总线 |
196
+ | IEventBusServiceToken | 事件总线 |
197
+ | IActionRegistryServiceToken | AI 工具注册 |
198
+ | ICapabilityServiceToken | 权限守卫 |
199
+ | IProcessServiceToken | 后台进程 |
200
+ | IStorageServiceToken | K-V 存储 |
201
+ | IAIServiceToken | AI 文本生成 |
202
+ | IDatabaseToken | SQLite 数据库 |
203
+ | IPluginHostToken | 插件主机管理 |
204
+ `}),t==="user_guide"&&e.jsx(ee,{copiedId:g,handleCopy:k}),t==="plugin_docs"&&e.jsx(se,{})]})}export{xe as HelpView,ge as generateTemplateContent};
@@ -0,0 +1 @@
1
+ import{j as e}from"./vendor-react-0Lg0vA-4.js";import{m as v}from"./vendor-motion-Dz5URUo4.js";import{a3 as g,a4 as N,l as w,g as C,x as z}from"./vendor-icons-BvCtGbt1.js";function V(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{V as ImportLessonsModal};
@@ -0,0 +1 @@
1
+ import{j as e}from"./vendor-react-0Lg0vA-4.js";import{a3 as d,a4 as g,a5 as x,x as p,l as f}from"./vendor-icons-BvCtGbt1.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};
@@ -0,0 +1 @@
1
+ import{r as t,j as e}from"./vendor-react-0Lg0vA-4.js";import{h as c,a7 as u,a8 as d,X as m}from"./vendor-icons-BvCtGbt1.js";function g({coursewareId:l,onClose:n}){const[i,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(c,{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:i?"退出全屏":"全屏播放",children:i?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-same-origin allow-downloads allow-forms",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(c,{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};