@memoarchitect/architect 0.4.4 → 0.4.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.
- package/README.md +17 -6
- package/dist/assets/{AskPanel-BpFRMop9.js → AskPanel-D9_AKyYt.js} +1 -1
- package/dist/assets/{ComplianceWizard-DCcV-q6X.js → ComplianceWizard-BNvT_ic6.js} +1 -1
- package/dist/assets/{DSMView-OMMwi76e.js → DSMView-B4IEz19F.js} +1 -1
- package/dist/assets/{Dashboard-Dl5KU656.js → Dashboard-DNRzU1Hk.js} +1 -1
- package/dist/assets/{DhfDashboard-agI5JdAZ.js → DhfDashboard-DguH-rDT.js} +1 -1
- package/dist/assets/{DhfSettingsPanel-CKvGmNGe.js → DhfSettingsPanel-C89T0dv7.js} +1 -1
- package/dist/assets/{DhfWorkbench-BD_buvXh.js → DhfWorkbench-4gHayn-l.js} +3 -3
- package/dist/assets/{DiagramCanvas-CUYbaLjV.js → DiagramCanvas-BgfO0AtP.js} +1 -1
- package/dist/assets/{DiagramEditor-DZAocSs_.js → DiagramEditor-CEr6iqBf.js} +1 -1
- package/dist/assets/{DiagramSurface-BIK9fV8R.js → DiagramSurface-B_lfUNzV.js} +2 -2
- package/dist/assets/{ElementDetailView-R_Nob9E0.js → ElementDetailView-AclSjurg.js} +1 -1
- package/dist/assets/{ImportView-yxS8JfX4.js → ImportView-t1dIoZF5.js} +1 -1
- package/dist/assets/{LayerGrid-DdEtHyAu.js → LayerGrid-fSGvqSEj.js} +1 -1
- package/dist/assets/{LayerTable-dOCvwCEb.js → LayerTable-D8QCFY1b.js} +1 -1
- package/dist/assets/{MaxGraphCanvas-CDdlW8h_.js → MaxGraphCanvas-DYs6MPuP.js} +1 -1
- package/dist/assets/{ModelDiff-BbdzLhXe.js → ModelDiff-CLFqnELG.js} +1 -1
- package/dist/assets/{OntologyDecompositionDiagram-BW07CXuV.js → OntologyDecompositionDiagram-cpmTTMRH.js} +1 -1
- package/dist/assets/{OntologyViewer-DaRXEQoq.js → OntologyViewer-72jTw72H.js} +2 -2
- package/dist/assets/{ReviewDashboard-CipgA5-r.js → ReviewDashboard-BVOe2I5w.js} +1 -1
- package/dist/assets/{ScenarioEditor-BfewgrrJ.js → ScenarioEditor-CvOkiRC6.js} +1 -1
- package/dist/assets/{StatisticsDashboard-CLww46qL.js → StatisticsDashboard-Dn6lsnKe.js} +1 -1
- package/dist/assets/{SysmlGenerator-DnsaN-ey.js → SysmlGenerator-CfBQWovl.js} +1 -1
- package/dist/assets/{TabularView-Bp-yKFPV.js → TabularView-B99xy3H3.js} +1 -1
- package/dist/assets/{TraceabilityMatrix-B-dn_i5a.js → TraceabilityMatrix-BAJb0X7G.js} +1 -1
- package/dist/assets/{WorkflowWizard-C6p5e2IT.js → WorkflowWizard-C38DZKOe.js} +1 -1
- package/dist/assets/{index-c27kHB43.js → index-CgRwea72.js} +12 -12
- package/dist/assets/{index-BZhRuk7M.css → index-CnFhl4_e.css} +1 -1
- package/dist/assets/{layout-selection-DvOsyJH9.js → layout-selection-BQ2WuAEB.js} +1 -1
- package/dist/index.html +2 -2
- package/lib/bin/memo-architect.js +0 -0
- package/package.json +34 -33
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./reactflow-WKyu73tD.js";import{a as A}from"./zustand-qbFpP9Up.js";import{u as b,L as y,d as u,c as f}from"./index-
|
|
1
|
+
import{j as e}from"./reactflow-WKyu73tD.js";import{a as A}from"./zustand-qbFpP9Up.js";import{u as b,L as y,d as u,c as f}from"./index-CgRwea72.js";function w(a){var F;const c=Object.values(a.elements),n=c.length,t=a.relationships.length,i=((F=a.diagrams)==null?void 0:F.length)??0,d=new Map;for(const s of c){const o=d.get(s.layer)||{count:0,kinds:new Map};o.count++,o.kinds.set(s.kind,(o.kinds.get(s.kind)||0)+1),d.set(s.layer,o)}const m=y.filter(s=>d.has(s)).map(s=>({layer:s,label:f[s]||s,color:u[s]||"#95A5A6",count:d.get(s).count,kinds:d.get(s).kinds}));for(const[s,o]of d)y.includes(s)||m.push({layer:s,label:f[s]||s,color:u[s]||"#95A5A6",count:o.count,kinds:o.kinds});const l=new Map;for(const s of c){const o=l.get(s.kind)||{count:0,layer:s.layer};o.count++,l.set(s.kind,o)}const r=[...l.entries()].map(([s,{count:o,layer:C}])=>({kind:s,count:o,layer:C})).sort((s,o)=>o.count-s.count).slice(0,15),x=new Map;for(const s of a.relationships)x.set(s.type,(x.get(s.type)||0)+1);const j=[...x.entries()].map(([s,o])=>({type:s,count:o})).sort((s,o)=>o.count-s.count),p=new Set;for(const s of a.relationships)p.add(s.sourceId),p.add(s.targetId);const N=c.filter(s=>!p.has(s.id)).length;Math.max(...m.map(s=>s.count),1);const v=m.map(s=>({layer:s.layer,label:s.label,color:s.color,percent:Math.round(s.count/n*100)})),E=n>0?t/n:0,k=n>0?t/n:0;return{totalElements:n,totalRelationships:t,totalDiagrams:i,layers:m,topKinds:r,relTypes:j,avgRelsPerElement:Math.round(k*10)/10,orphanCount:N,coverage:v,density:Math.round(E*100)/100}}function B(){var d,m;const a=b(l=>l.model),c=b(l=>l.validation),n=b(l=>l.completeness),t=A.useMemo(()=>a?w(a):null,[a]);if(!t)return e.jsx("div",{className:"flex-1 flex items-center justify-center",style:{background:"#F7F7F5",color:"#9CA3AF"},children:e.jsx("div",{className:"text-sm",children:"No model data"})});const i=((d=c==null?void 0:c.violations)==null?void 0:d.length)??0;return e.jsx("div",{className:"flex-1 overflow-y-auto p-6",style:{background:"#F7F7F5"},children:e.jsxs("div",{className:"max-w-5xl mx-auto",children:[e.jsx("h2",{className:"text-lg font-semibold mb-1",style:{color:"#374151"},children:"Model Statistics"}),e.jsx("p",{className:"text-xs mb-6",style:{color:"#9CA3AF"},children:"Quick health check for your model"}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3 mb-6",children:[e.jsx(h,{label:"Elements",value:t.totalElements,color:"#1B3A4B"}),e.jsx(h,{label:"Relationships",value:t.totalRelationships,color:"#4A90D9"}),e.jsx(h,{label:"Diagrams",value:t.totalDiagrams,color:"#7B68EE"}),e.jsx(h,{label:"Violations",value:i,color:i>0?"#E74C3C":"#2ECC71"})]}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3 mb-6",children:[e.jsx(g,{label:"Rel. Density",value:`${t.avgRelsPerElement}`,unit:"per element",status:t.avgRelsPerElement>=1.5?"good":t.avgRelsPerElement>=.5?"ok":"low"}),e.jsx(g,{label:"Orphans",value:`${t.orphanCount}`,unit:"unlinked",status:t.orphanCount===0?"good":t.orphanCount<=5?"ok":"low"}),e.jsx(g,{label:"Layers Used",value:`${t.layers.length}`,unit:`of ${y.length}`,status:t.layers.length>=6?"good":t.layers.length>=3?"ok":"low"}),e.jsx(g,{label:"Kinds Used",value:`${t.topKinds.length}`,unit:"types",status:t.topKinds.length>=8?"good":t.topKinds.length>=4?"ok":"low"})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"p-4 rounded-lg",style:{background:"#FFFFFF",border:"1px solid #E5E5E0"},children:[e.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wider mb-3",style:{color:"#6B7280"},children:"Elements by Layer"}),e.jsx("div",{className:"space-y-2",children:t.layers.map((l,r)=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"w-20 text-xs truncate",style:{color:"#374151"},children:l.label}),e.jsx("div",{className:"flex-1 h-4 rounded-full overflow-hidden",style:{background:"#F3F4F6"},children:e.jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${Math.max(l.count/t.totalElements*100,2)}%`,background:l.color,opacity:.8}})}),e.jsx("span",{className:"w-8 text-right text-xs font-medium",style:{color:"#374151"},children:l.count})]},`${l.layer}-${r}`))})]}),e.jsxs("div",{className:"p-4 rounded-lg",style:{background:"#FFFFFF",border:"1px solid #E5E5E0"},children:[e.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wider mb-3",style:{color:"#6B7280"},children:"Layer Coverage"}),e.jsx("div",{className:"grid grid-cols-3 gap-2",children:y.map(l=>{const r=t.coverage.find(p=>p.layer===l),x=(r==null?void 0:r.percent)??0,j=x>0?Math.max(.15,x/100):.05;return e.jsxs("div",{className:"p-2 rounded-lg text-center",style:{background:`${u[l]||"#95A5A6"}${Math.round(j*255).toString(16).padStart(2,"0")}`,border:`1px solid ${u[l]||"#95A5A6"}30`},children:[e.jsx("div",{className:"text-xs font-medium truncate",style:{color:"#374151"},children:f[l]||l}),e.jsxs("div",{className:"text-lg font-bold",style:{color:u[l]||"#95A5A6"},children:[x,"%"]})]},l)})})]}),e.jsxs("div",{className:"p-4 rounded-lg",style:{background:"#FFFFFF",border:"1px solid #E5E5E0"},children:[e.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wider mb-3",style:{color:"#6B7280"},children:"Top Element Types"}),e.jsx("div",{className:"space-y-1",children:t.topKinds.map((l,r)=>e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx("span",{className:"w-2 h-2 rounded-full",style:{background:u[l.layer]||"#95A5A6"}}),e.jsx("span",{className:"flex-1 truncate",style:{color:"#374151"},children:l.kind}),e.jsx("span",{className:"font-medium",style:{color:"#6B7280"},children:l.count})]},`${l.kind}-${r}`))})]}),e.jsxs("div",{className:"p-4 rounded-lg",style:{background:"#FFFFFF",border:"1px solid #E5E5E0"},children:[e.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wider mb-3",style:{color:"#6B7280"},children:"Relationship Types"}),e.jsxs("div",{className:"space-y-1",children:[t.relTypes.map((l,r)=>e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx("span",{className:"w-2 h-2 rounded-full",style:{background:"#4A90D9"}}),e.jsx("span",{className:"flex-1 truncate",style:{color:"#374151"},children:l.type}),e.jsx("span",{className:"font-medium",style:{color:"#6B7280"},children:l.count})]},`${l.type}-${r}`)),t.relTypes.length===0&&e.jsx("div",{className:"text-xs",style:{color:"#9CA3AF"},children:"No relationships"})]})]})]}),n&&e.jsxs("div",{className:"mt-4 p-4 rounded-lg",style:{background:"#FFFFFF",border:"1px solid #E5E5E0"},children:[e.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wider mb-3",style:{color:"#6B7280"},children:"Completeness by Layer"}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2",children:(m=n.layers)==null?void 0:m.map((l,r)=>e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx("span",{className:"w-2 h-2 rounded-full",style:{background:u[l.layer]||"#95A5A6"}}),e.jsx("span",{className:"flex-1 truncate",style:{color:"#374151"},children:l.layer}),e.jsxs("span",{className:"font-medium",style:{color:l.completeness>=80?"#2ECC71":l.completeness>=50?"#F39C12":"#E74C3C"},children:[Math.round(l.completeness),"%"]})]},`${l.layer}-${r}`))})]})]})})}function h({label:a,value:c,color:n}){return e.jsxs("div",{className:"p-4 rounded-lg",style:{background:"#FFFFFF",border:"1px solid #E5E5E0"},children:[e.jsx("div",{className:"text-2xl font-bold",style:{color:n},children:c.toLocaleString()}),e.jsx("div",{className:"text-xs mt-0.5",style:{color:"#9CA3AF"},children:a})]})}function g({label:a,value:c,unit:n,status:t}){const i=t==="good"?"#2ECC71":t==="ok"?"#F39C12":"#E74C3C";return e.jsxs("div",{className:"p-4 rounded-lg",style:{background:"#FFFFFF",border:`1px solid ${i}30`},children:[e.jsxs("div",{className:"flex items-baseline gap-1",children:[e.jsx("span",{className:"text-lg font-bold",style:{color:i},children:c}),e.jsx("span",{className:"text-xs",style:{color:"#9CA3AF"},children:n})]}),e.jsx("div",{className:"text-xs mt-0.5",style:{color:"#6B7280"},children:a})]})}export{B as StatisticsDashboard};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./reactflow-WKyu73tD.js";import{a as s}from"./zustand-qbFpP9Up.js";import{u as a,k as C}from"./index-
|
|
1
|
+
import{j as e}from"./reactflow-WKyu73tD.js";import{a as s}from"./zustand-qbFpP9Up.js";import{u as a,k as C}from"./index-CgRwea72.js";const A=["Add a PressureSensor component with a USB interface and a power port.","Create a hazard: AlarmFailure that causes patient harm in ICU setting.","Define a software item InfusionController with a requirement for dose limit checking.","Add a RiskControl that mitigates OverInfusion by adding a flow rate sensor."];function F(){const r=a(o=>o.llmAvailable),v=a(o=>o.llmProvider),S=a(o=>o.llmModel),f=a(o=>o.registerLlmRequest),[l,p]=s.useState(""),[n,g]=s.useState(!1),[t,c]=s.useState(null),[u,m]=s.useState(null),[y,x]=s.useState(!1),h=s.useCallback(async o=>{if(!o.trim()||n)return;g(!0),c(null),m(null),x(!1);const i=`gen-${Date.now()}-${Math.random().toString(36).slice(2)}`;try{const d=await new Promise((E,b)=>{f(i,E,b),C(i,o.trim()),setTimeout(()=>b(new Error("Request timed out after 60 seconds.")),6e4)});c(d)}catch(d){m((d==null?void 0:d.message)??"Unknown error")}finally{g(!1)}},[n,f]),j=()=>{t!=null&&t.sysml&&navigator.clipboard.writeText(t.sysml).then(()=>{x(!0),setTimeout(()=>x(!1),2e3)})};return e.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%",background:"#F7F7F5",overflow:"hidden"},children:[e.jsx("div",{style:{padding:"14px 20px 10px",borderBottom:"1px solid #E5E5E0",background:"#fff",flexShrink:0},children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px"},children:[e.jsx("span",{style:{fontSize:"16px"},children:"⟨/⟩"}),e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:"14px",fontWeight:700,color:"#1B3A4B"},children:"SysML Generator"}),e.jsx("div",{style:{fontSize:"11px",color:r?"#059669":"#dc2626",marginTop:"1px"},children:r?`${v??"LLM"} · ${S??"unknown model"} · natural language → SysML v2`:"No LLM provider — set ANTHROPIC_API_KEY or OPENAI_API_KEY"})]})]})}),e.jsxs("div",{style:{flex:1,overflowY:"auto",padding:"20px"},children:[e.jsxs("div",{style:{marginBottom:"16px"},children:[e.jsx("label",{style:{fontSize:"12px",fontWeight:600,color:"#374151",display:"block",marginBottom:"6px"},children:"Describe what to generate"}),e.jsx("textarea",{value:l,onChange:o=>p(o.target.value),disabled:!r||n,rows:4,placeholder:"Describe the element(s) to generate in plain English…",style:{width:"100%",padding:"10px 12px",border:"1px solid #E5E5E0",borderRadius:"8px",fontSize:"13px",resize:"vertical",fontFamily:"inherit",outline:"none",background:"#fff",color:"#1B3A4B",lineHeight:"1.5",boxSizing:"border-box",opacity:r?1:.5},onFocus:o=>{o.target.style.borderColor="#2DD4A8"},onBlur:o=>{o.target.style.borderColor="#E5E5E0"},onKeyDown:o=>{o.key==="Enter"&&(o.metaKey||o.ctrlKey)&&(o.preventDefault(),h(l))}}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginTop:"8px"},children:[e.jsx("span",{style:{fontSize:"11px",color:"#9CA3AF"},children:"Cmd+Enter to generate"}),e.jsx("button",{onClick:()=>h(l),disabled:!r||n||!l.trim(),style:{padding:"6px 16px",borderRadius:"8px",border:"none",background:"#1B3A4B",color:"#fff",fontSize:"12px",fontWeight:600,cursor:"pointer",opacity:!r||!l.trim()?.4:1},children:n?"Generating…":"Generate SysML"})]})]}),!t&&!n&&e.jsxs("div",{style:{marginBottom:"16px"},children:[e.jsx("div",{style:{fontSize:"11px",fontWeight:600,color:"#9CA3AF",textTransform:"uppercase",letterSpacing:"0.06em",marginBottom:"8px"},children:"Examples"}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"5px"},children:A.map(o=>e.jsx("button",{onClick:()=>{p(o)},disabled:!r,style:{textAlign:"left",padding:"7px 11px",borderRadius:"6px",background:"#fff",border:"1px solid #E5E5E0",fontSize:"12px",color:"#374151",cursor:"pointer",opacity:r?1:.5},onMouseEnter:i=>{r&&(i.currentTarget.style.borderColor="#2DD4A8")},onMouseLeave:i=>{i.currentTarget.style.borderColor="#E5E5E0"},children:o},o))})]}),n&&e.jsxs("div",{style:{background:"#fff",border:"1px solid #E5E5E0",borderRadius:"10px",padding:"20px",textAlign:"center",color:"#9CA3AF",fontSize:"13px"},children:[e.jsx("div",{style:{marginBottom:"8px",fontSize:"20px"},children:"⟨/⟩"}),"Generating SysML v2…"]}),u&&e.jsxs("div",{style:{background:"#fef2f2",border:"1px solid #fecaca",borderRadius:"8px",padding:"12px",color:"#dc2626",fontSize:"13px"},children:[e.jsx("strong",{children:"Error:"})," ",u]}),t&&!n&&e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:[e.jsxs("div",{style:{background:"#F0FDF9",border:"1px solid #A7F3D0",borderRadius:"8px",padding:"12px"},children:[e.jsx("div",{style:{fontSize:"11px",fontWeight:600,color:"#065F46",marginBottom:"4px",textTransform:"uppercase",letterSpacing:"0.06em"},children:"Explanation"}),e.jsx("p",{style:{fontSize:"13px",color:"#1B3A4B",margin:0,lineHeight:"1.6"},children:t.explanation}),t.suggestedFile&&e.jsxs("div",{style:{marginTop:"8px",fontSize:"11px",color:"#6B7280"},children:["Suggested file: ",e.jsx("code",{style:{background:"#D1FAE5",padding:"1px 5px",borderRadius:"3px"},children:t.suggestedFile})]})]}),e.jsxs("div",{style:{background:"#1e293b",borderRadius:"10px",overflow:"hidden"},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"8px 14px",borderBottom:"1px solid #334155"},children:[e.jsx("span",{style:{fontSize:"11px",color:"#94a3b8",fontWeight:600},children:"SysML v2"}),e.jsx("button",{onClick:j,style:{padding:"3px 10px",borderRadius:"4px",border:"none",background:y?"#059669":"#334155",color:"#fff",fontSize:"11px",cursor:"pointer",fontWeight:500},children:y?"Copied!":"Copy"})]}),e.jsx("pre",{style:{margin:0,padding:"14px 16px",fontSize:"12px",lineHeight:"1.6",color:"#e2e8f0",overflowX:"auto",fontFamily:"'SF Mono', 'Fira Code', 'Consolas', monospace"},children:e.jsx("code",{children:t.sysml})})]}),e.jsxs("div",{style:{fontSize:"11px",color:"#9CA3AF",padding:"4px 0"},children:["Review the generated SysML before saving. Copy it into your project's ",e.jsx("code",{children:".sysml"})," files. The dev server will pick up the changes automatically."]}),e.jsx("button",{onClick:()=>{c(null),p("")},style:{padding:"6px 14px",borderRadius:"6px",border:"1px solid #E5E5E0",background:"#fff",color:"#374151",fontSize:"12px",cursor:"pointer",alignSelf:"flex-start"},children:"Generate another"})]})]})]})}export{F as SysmlGenerator};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t}from"./reactflow-WKyu73tD.js";import{a as u}from"./zustand-qbFpP9Up.js";import{u as w,F as j,c as D,d as T}from"./index-
|
|
1
|
+
import{j as t}from"./reactflow-WKyu73tD.js";import{a as u}from"./zustand-qbFpP9Up.js";import{u as w,F as j,c as D,d as T}from"./index-CgRwea72.js";function R({element:r}){var f;const i=!!((f=r.doc)!=null&&f.trim()),d=Object.keys(r.attributes).length,S=i&&d>=1,v=i||d>=1,p=S?"#2DD4A8":v?"#F39C12":"#E5E5E0",A=S?"Complete":v?"Partial":"Empty";return t.jsx("span",{className:"inline-block rounded-full flex-shrink-0",style:{width:8,height:8,backgroundColor:p,cursor:"default"},title:A})}function Y({col:r,sortKey:i,sortDir:d}){return r!==i?t.jsx("span",{style:{color:"#D1D5DB",fontSize:"10px",marginLeft:3},children:"⇅"}):t.jsx("span",{style:{color:"#1B3A4B",fontSize:"10px",marginLeft:3},children:d==="asc"?"↑":"↓"})}function P(){const r=w(e=>e.model),i=w(e=>e.activeView),d=w(e=>e.selectedViewpointId),S=w(e=>e.selectElement),v=w(e=>e.selectedElementId),[p,A]=u.useState("name"),[f,C]=u.useState("asc"),[E,B]=u.useState(""),[g,I]=u.useState(""),[b,M]=u.useState(""),h=u.useMemo(()=>{var o,s,n,c,l;if(!r)return[];const e=Object.values(r.elements);if(i.type==="tabular"&&i.diagramId){const a=(o=r.diagrams)==null?void 0:o.find(x=>x.id===i.diagramId);if((s=a==null?void 0:a.elementIds)!=null&&s.length){const x=new Set(a.elementIds);return e.filter(m=>x.has(m.id))}}if(d){const a=(n=r.viewpoints)==null?void 0:n.find(x=>x.id===d);if(a){const x=(c=a.visibleLayers)!=null&&c.length?new Set(a.visibleLayers):null,m=(l=a.visibleKinds)!=null&&l.length?new Set(a.visibleKinds):null;return e.filter(F=>(!x||x.has(F.layer))&&(!m||m.has(F.kind)))}}return e},[r,i,d]),k=u.useMemo(()=>{const e=new Map;for(const s of h)for(const n of Object.keys(s.attributes))e.set(n,(e.get(n)??0)+1);const o=Math.max(1,h.length*.1);return[...e.entries()].filter(([,s])=>s>=o).sort((s,n)=>n[1]-s[1]).slice(0,4).map(([s])=>s)},[h]),O=u.useMemo(()=>[...new Set(h.map(e=>e.layer))].sort(),[h]),V=u.useMemo(()=>[...new Set(h.map(e=>e.kind))].sort(),[h]),N=u.useMemo(()=>{const e=E.toLowerCase();let o=h.filter(s=>!(e&&!s.name.toLowerCase().includes(e)&&!s.kind.toLowerCase().includes(e)||g&&s.layer!==g||b&&s.kind!==b));return o.sort((s,n)=>{let c="",l="";if(p==="name")c=s.name,l=n.name;else if(p==="kind")c=s.kind,l=n.kind;else if(p==="layer")c=s.layer,l=n.layer;else if(p==="status"){const x=m=>{var L;const F=!!((L=m.doc)!=null&&L.trim()),z=Object.keys(m.attributes).length>=1;return F&&z?2:F||z?1:0};c=String(x(s)),l=String(x(n))}else c=s.attributes[p]??"",l=n.attributes[p]??"";const a=c.localeCompare(l,void 0,{numeric:!0});return f==="asc"?a:-a}),o},[h,E,g,b,p,f]);function K(e){p===e?C(o=>o==="asc"?"desc":"asc"):(A(e),C("asc"))}const W=u.useMemo(()=>{var e,o;if(!r)return"";if(i.type==="tabular"&&i.diagramId){const s=(e=r.diagrams)==null?void 0:e.find(n=>n.id===i.diagramId);return s?`Diagram: ${s.name}`:"Diagram"}if(d){const s=(o=r.viewpoints)==null?void 0:o.find(n=>n.id===d);return s?`Viewpoint: ${s.label}`:"Viewpoint"}return"All Elements"},[r,i,d]),y=({col:e,label:o,width:s})=>t.jsxs("th",{onClick:()=>K(e),className:"px-3 py-2 text-left cursor-pointer select-none",style:{fontSize:"11px",fontWeight:600,color:"#374151",background:"#F7F7F5",borderBottom:"1px solid #E5E5E0",whiteSpace:"nowrap",width:s,position:"sticky",top:0,zIndex:1},children:[o,t.jsx(Y,{col:e,sortKey:p,sortDir:f})]});return t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",style:{background:"#FFFFFF"},children:[t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 flex-shrink-0",style:{borderBottom:"1px solid #E5E5E0",background:"#FAFAF8"},children:[t.jsxs("div",{children:[t.jsx("div",{style:{fontSize:"13px",fontWeight:700,color:"#1B3A4B"},children:"Tabular View"}),t.jsx("div",{style:{fontSize:"11px",color:"#9CA3AF"},children:W})]}),t.jsx("div",{className:"flex-1"}),t.jsx("input",{type:"text",placeholder:"Search elements…",value:E,onChange:e=>B(e.target.value),className:"px-3 py-1.5 rounded-lg focus:outline-none",style:{width:220,fontSize:j.xs,color:"#1a1a1a",border:"1px solid #E5E5E0",background:"#FFFFFF"}}),t.jsxs("select",{value:g,onChange:e=>I(e.target.value),className:"px-2 py-1.5 rounded-lg focus:outline-none",style:{fontSize:j.xs,color:"#374151",border:"1px solid #E5E5E0",background:"#FFFFFF",cursor:"pointer"},children:[t.jsx("option",{value:"",children:"All layers"}),O.map(e=>t.jsx("option",{value:e,children:D[e]??e},e))]}),t.jsxs("select",{value:b,onChange:e=>M(e.target.value),className:"px-2 py-1.5 rounded-lg focus:outline-none",style:{fontSize:j.xs,color:"#374151",border:"1px solid #E5E5E0",background:"#FFFFFF",cursor:"pointer"},children:[t.jsx("option",{value:"",children:"All kinds"}),V.map(e=>t.jsx("option",{value:e,children:e},e))]}),t.jsxs("div",{style:{fontSize:"11px",color:"#9CA3AF",whiteSpace:"nowrap"},children:[N.length," / ",h.length," elements"]})]}),t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsxs("table",{className:"w-full border-collapse",style:{tableLayout:"fixed"},children:[t.jsxs("colgroup",{children:[t.jsx("col",{style:{width:28}}),t.jsx("col",{style:{width:"30%"}}),t.jsx("col",{style:{width:"13%"}}),t.jsx("col",{style:{width:"13%"}}),t.jsx("col",{style:{width:40}}),t.jsx("col",{style:{width:"20%"}}),k.map(e=>t.jsx("col",{style:{width:"10%"}},e))]}),t.jsx("thead",{children:t.jsxs("tr",{children:[t.jsx("th",{style:{background:"#F7F7F5",borderBottom:"1px solid #E5E5E0",position:"sticky",top:0,zIndex:1}}),t.jsx(y,{col:"name",label:"Name"}),t.jsx(y,{col:"kind",label:"Kind"}),t.jsx(y,{col:"layer",label:"Layer"}),t.jsx(y,{col:"status",label:"",width:40}),t.jsx(y,{col:"doc",label:"Description"}),k.map(e=>t.jsx(y,{col:e,label:e},e))]})}),t.jsxs("tbody",{children:[N.length===0&&t.jsx("tr",{children:t.jsx("td",{colSpan:6+k.length,className:"py-16 text-center",style:{fontSize:"13px",color:"#9CA3AF"},children:E||g||b?"No elements match the current filters":"No elements in scope"})}),N.map(e=>{var c;const o=e.id===v,s=T[e.layer]??"#9CA3AF",n=((c=e.doc)==null?void 0:c.trim().slice(0,100))??"";return t.jsxs("tr",{onClick:()=>S(e.id),className:"cursor-pointer",style:{background:o?"#2DD4A812":"transparent",borderBottom:"1px solid #F0F0ED"},onMouseEnter:l=>{o||(l.currentTarget.style.background="#F7F7F5")},onMouseLeave:l=>{o||(l.currentTarget.style.background="transparent")},children:[t.jsx("td",{className:"px-2",children:o&&t.jsx("span",{style:{color:"#2DD4A8",fontSize:"10px"},children:"▶"})}),t.jsxs("td",{className:"px-3 py-2",children:[t.jsx("div",{style:{fontSize:j.xs,fontWeight:500,color:"#1B3A4B",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.name}),e.shortId&&t.jsx("div",{style:{fontSize:"10px",color:"#9CA3AF",fontFamily:"monospace"},children:e.shortId})]}),t.jsx("td",{className:"px-3 py-2",children:t.jsx("span",{style:{fontSize:"10px",fontWeight:600,color:"#374151"},children:e.kind})}),t.jsx("td",{className:"px-3 py-2",children:t.jsx("span",{className:"px-1.5 py-0.5 rounded",style:{fontSize:"10px",fontWeight:600,background:s+"1A",color:s,whiteSpace:"nowrap"},children:D[e.layer]??e.layer})}),t.jsx("td",{className:"px-3 py-2 text-center",children:t.jsx(R,{element:e})}),t.jsx("td",{className:"px-3 py-2",children:t.jsx("span",{style:{fontSize:j.xs,color:"#6B7280",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},children:n})}),k.map(l=>t.jsx("td",{className:"px-3 py-2",children:t.jsx("span",{style:{fontSize:j.xs,color:"#374151",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",display:"block"},children:e.attributes[l]??""})},l))]},e.id)})]})]})})]})}export{P as TabularView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s}from"./reactflow-WKyu73tD.js";import{a as p}from"./zustand-qbFpP9Up.js";import{u as j,d as w}from"./index-
|
|
1
|
+
import{j as s}from"./reactflow-WKyu73tD.js";import{a as p}from"./zustand-qbFpP9Up.js";import{u as j,d as w}from"./index-CgRwea72.js";const F=[{id:"risk-control",label:"ISO 14971: Risk → Control",description:"Hazards and hazardous situations traced to risk controls",rowKinds:["Hazard","HazardousSituation"],colKinds:["RiskControl","SafetyGoal"],relationshipTypes:["mitigates","traceTo","causes","leadsTo"]},{id:"req-test",label:"IEC 62304: Requirement → Test",description:"Software requirements traced to verification tests",rowKinds:["Requirement","Requirement","Requirement"],colKinds:["Test"],relationshipTypes:["verify","satisfy","traceTo"]},{id:"req-function",label:"Requirement → Function",description:"Requirements traced to system/component functions",rowKinds:["Requirement","Requirement","Requirement"],colKinds:["Function","Function"],relationshipTypes:["satisfy","traceTo","allocateTo"]},{id:"function-component",label:"Function → Component",description:"Functions allocated to logical/physical components",rowKinds:["Function","Function"],colKinds:["System","Subsystem","Component","LogicalComponent","SoftwareComponent","PhysicalComponent"],relationshipTypes:["allocateTo","traceTo","composedOf"]},{id:"all",label:"All Elements",description:"Full N×N matrix of all elements and relationships",rowKinds:[],colKinds:[],relationshipTypes:[]}];function N({cell:n,onClick:m}){if(!n||n.rels.length===0)return s.jsx("td",{className:"border",style:{borderColor:"#E5E5E0",width:"28px",height:"28px"}});const u=[...new Set(n.rels.map(f=>f.type))],h=n.rels.length>1?"#2DD4A830":"#2DD4A818";return s.jsx("td",{className:"border text-center cursor-pointer",style:{borderColor:"#E5E5E0",background:h,width:"28px",height:"28px"},title:u.join(", "),onClick:m,children:s.jsx("span",{className:"text-xs font-semibold",style:{color:"#1B3A4B",fontSize:"10px"},children:n.rels.length})})}function K(){const n=j(e=>e.model),m=j(e=>e.selectElement),[u,h]=p.useState("risk-control"),[f,g]=p.useState(null),[v,E]=p.useState(null),d=F.find(e=>e.id===u)||F[0],{rows:c,cols:x,matrix:y}=p.useMemo(()=>{if(!n)return{rows:[],cols:[],matrix:new Map};const e=Object.values(n.elements);let i,r;if(d.rowKinds.length===0&&d.colKinds.length===0)i=e,r=e;else{const t=new Set(d.rowKinds),o=new Set(d.colKinds);i=e.filter(l=>t.has(l.kind)),r=e.filter(l=>o.has(l.kind))}i.sort((t,o)=>t.kind.localeCompare(o.kind)||t.name.localeCompare(o.name)),r.sort((t,o)=>t.kind.localeCompare(o.kind)||t.name.localeCompare(o.name));const a=new Map,k=d.relationshipTypes.length>0?new Set(d.relationshipTypes):null,C=new Set(i.map(t=>t.id)),S=new Set(r.map(t=>t.id));for(const t of n.relationships)if(!(k&&!k.has(t.type))){if(C.has(t.sourceId)&&S.has(t.targetId)){const o=`${t.sourceId}:${t.targetId}`,l=a.get(o);l?l.rels.push(t):a.set(o,{rels:[t]})}if(C.has(t.targetId)&&S.has(t.sourceId)){const o=`${t.targetId}:${t.sourceId}`,l=a.get(o);l?l.rels.push(t):a.set(o,{rels:[t]})}}return{rows:i,cols:r,matrix:a}},[n,d]),b=p.useMemo(()=>{const e=new Set;for(const[i]of y){const r=i.split(":")[0];e.add(r)}return e.size},[y]);return n?s.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",style:{background:"#FAFAF8"},children:[s.jsxs("div",{className:"flex items-center gap-2 px-4 py-2",style:{borderBottom:"1px solid #E5E5E0",background:"#FFFFFF"},children:[s.jsx("span",{className:"text-xs font-medium",style:{color:"#6B7280"},children:"Preset:"}),F.map(e=>s.jsx("button",{onClick:()=>h(e.id),className:"px-2 py-1 text-xs rounded-md transition-colors",style:u===e.id?{background:"#2DD4A818",color:"#1B3A4B",fontWeight:600}:{color:"#6B7280"},title:e.description,children:e.label},e.id)),s.jsx("div",{className:"flex-1"}),s.jsxs("span",{className:"text-xs",style:{color:"#9CA3AF"},children:[c.length," rows × ",x.length," cols · ",b,"/",c.length," traced (",c.length>0?Math.round(b/c.length*100):0,"%)"]})]}),s.jsx("div",{className:"flex-1 overflow-auto p-4",children:c.length===0||x.length===0?s.jsx("div",{className:"flex items-center justify-center h-full text-xs",style:{color:"#9CA3AF"},children:"No elements match the selected preset. Try a different preset or add more model elements."}):s.jsxs("table",{className:"border-collapse text-xs",style:{borderColor:"#E5E5E0"},children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{className:"border px-2 py-1 sticky left-0 z-10",style:{borderColor:"#E5E5E0",background:"#FFFFFF",minWidth:"140px"}}),x.map(e=>(w[e.layer],s.jsx("th",{className:"border px-1 py-1",style:{borderColor:"#E5E5E0",background:v===e.id?"#F0F0ED":"#FFFFFF",writingMode:"vertical-rl",textOrientation:"mixed",maxWidth:"28px",fontSize:"10px",color:"#374151",cursor:"pointer"},onMouseEnter:()=>E(e.id),onMouseLeave:()=>E(null),onClick:()=>m(e.id),title:`${e.name} (${e.kind})`,children:s.jsx("span",{className:"truncate",style:{maxHeight:"100px",display:"block",overflow:"hidden"},children:e.name})},e.id)))]})}),s.jsx("tbody",{children:c.map(e=>{const i=w[e.layer]||"#6B7280";return s.jsxs("tr",{children:[s.jsx("td",{className:"border px-2 py-1 sticky left-0 z-10 cursor-pointer truncate",style:{borderColor:"#E5E5E0",background:f===e.id?"#F0F0ED":"#FFFFFF",maxWidth:"180px",fontSize:"11px",color:"#374151",borderLeft:`3px solid ${i}`},onMouseEnter:()=>g(e.id),onMouseLeave:()=>g(null),onClick:()=>m(e.id),title:`${e.name} (${e.kind})`,children:e.name}),x.map(r=>{const a=y.get(`${e.id}:${r.id}`)||null;return s.jsx(N,{cell:a,onClick:a?()=>m(e.id):void 0},r.id)})]},e.id)})})]})})]}):s.jsx("div",{className:"flex-1 flex items-center justify-center text-xs",style:{color:"#9CA3AF"},children:"No model loaded"})}export{K as TraceabilityMatrix};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t}from"./reactflow-WKyu73tD.js";import{a as x}from"./zustand-qbFpP9Up.js";import{u as p}from"./index-
|
|
1
|
+
import{j as t}from"./reactflow-WKyu73tD.js";import{a as x}from"./zustand-qbFpP9Up.js";import{u as p}from"./index-CgRwea72.js";const l=[{id:"setup",icon:"🎯",title:"Set Up Your Device",description:"Define who your device is for, what it does, and who uses it. Start with actors and intended use.",standard:"IEC 62366 · ISO 14971 §4",getCount:e=>Object.values(e.elements).filter(s=>["actor","stakeholder","usecase","goal"].includes(s.kind.toLowerCase())).length,getTarget:()=>3,actionLabel:"Browse Model",actionView:"model",getDetails:e=>{const s=Object.values(e.elements).filter(n=>n.kind.toLowerCase()==="actor").length,i=Object.values(e.elements).filter(n=>n.kind.toLowerCase()==="usecase").length;return`${s} actor(s) · ${i} use case(s)`}},{id:"requirements",icon:"📋",title:"Define Requirements",description:"Capture user needs and system requirements. These form the basis of your V&V plan.",standard:"IEC 62304 §5.2 · 21 CFR 820.30(c)",getCount:e=>Object.values(e.elements).filter(s=>["systemrequirement","requirement","userneed"].includes(s.kind.toLowerCase())).length,getTarget:()=>5,actionLabel:"View Catalog",actionView:"catalog",getDetails:e=>{const s=Object.values(e.elements).filter(n=>n.kind.toLowerCase()==="userneed").length,i=Object.values(e.elements).filter(n=>["systemrequirement","requirement"].includes(n.kind.toLowerCase())).length;return`${s} user need(s) · ${i} system requirement(s)`}},{id:"hazards",icon:"⚠️",title:"Identify Hazards",description:"List all hazards your device could cause. Add hazardous situations and potential harms.",standard:"ISO 14971 §5–6",getCount:e=>Object.values(e.elements).filter(s=>["hazard","hazardoussituation","harm"].includes(s.kind.toLowerCase())).length,getTarget:()=>3,actionLabel:"Browse Risk Layer",actionView:"model",getDetails:e=>{const s=Object.values(e.elements).filter(n=>n.kind.toLowerCase()==="hazard").length,i=Object.values(e.elements).filter(n=>n.kind.toLowerCase()==="harm").length;return`${s} hazard(s) · ${i} harm(s)`}},{id:"risk-controls",icon:"🔗",title:"Connect Risk Chain",description:"Add risk controls and connect them to hazards with Mitigates relationships. Verify the ISO 14971 chain.",standard:"ISO 14971 §7–8",getCount:e=>e.relationships.filter(s=>s.type.toLowerCase()==="mitigates").length,getTarget:()=>2,actionLabel:"Traceability Matrix",actionView:"traceability",getDetails:e=>{const s=Object.values(e.elements).filter(n=>n.kind.toLowerCase()==="riskcontrol").length,i=e.relationships.filter(n=>n.type.toLowerCase()==="mitigates").length;return`${s} risk control(s) · ${i} mitigates link(s)`}},{id:"architecture",icon:"🏗️",title:"Define Architecture",description:"Add system and subsystem elements. This grounds requirements to real components.",standard:"IEC 62304 §5.3 · ISO 14971 §9",getCount:e=>Object.values(e.elements).filter(s=>["system","subsystem","logicalcomponent","softwarecomponent"].includes(s.kind.toLowerCase())).length,getTarget:()=>3,actionLabel:"Browse Model",actionView:"model",getDetails:e=>{const s=Object.values(e.elements).filter(n=>["system","subsystem"].includes(n.kind.toLowerCase())).length,i=Object.values(e.elements).filter(n=>n.kind.toLowerCase()==="softwarecomponent").length;return`${s} system/subsystem · ${i} software component(s)`}},{id:"verification",icon:"🧪",title:"Link Verification",description:"Add tests and link them to requirements. This closes the V&V loop and prepares your design review package.",standard:"IEC 62304 §5.7–5.8 · 21 CFR 820.30(g)",getCount:e=>Object.values(e.elements).filter(s=>s.kind.toLowerCase()==="test").length,getTarget:()=>3,actionLabel:"Traceability Matrix",actionView:"traceability",getDetails:e=>{const s=Object.values(e.elements).filter(n=>n.kind.toLowerCase()==="test").length,i=e.relationships.filter(n=>["satisfies","refines","traces","verifies"].includes(n.type.toLowerCase())).length;return`${s} test(s) · ${i} traceability link(s)`}}];function m({step:e,index:s,isActive:i,model:n,onSelect:d,onAction:c}){const r=e.getCount(n),o=e.getTarget(),a=r>=o,u=Math.min(100,Math.round(r/o*100)),h=e.getDetails(n),g=a?"#2ECC71":r>0?"#F39C12":"#E5E5E0";return t.jsxs("button",{onClick:d,style:{textAlign:"left",background:i?"#FFFFFF":"transparent",border:`1px solid ${i?"#1B3A4B20":"transparent"}`,borderRadius:"10px",padding:"14px 16px",cursor:"pointer",width:"100%",transition:"all 0.15s",boxShadow:i?"0 2px 8px rgba(0,0,0,0.06)":"none"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px"},children:[t.jsx("div",{style:{width:"28px",height:"28px",borderRadius:"50%",flexShrink:0,background:a?"#2ECC71":i?"#1B3A4B":"#F3F4F6",color:a||i?"#FFFFFF":"#6B7280",display:"flex",alignItems:"center",justifyContent:"center",fontSize:a?"14px":"12px",fontWeight:700},children:a?"✓":s+1}),t.jsxs("div",{style:{flex:1,minWidth:0},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[t.jsxs("span",{style:{fontSize:"13px",fontWeight:700,color:i?"#1B3A4B":"#374151"},children:[e.icon," ",e.title]}),r>0&&t.jsx("span",{style:{fontSize:"10px",fontWeight:600,padding:"1px 6px",borderRadius:"999px",background:g+"20",color:g},children:r})]}),h&&t.jsx("div",{style:{fontSize:"11px",color:"#9CA3AF",marginTop:"2px"},children:h})]}),t.jsxs("div",{style:{width:"40px",textAlign:"right",fontSize:"10px",color:"#9CA3AF",flexShrink:0},children:[u,"%"]})]}),t.jsx("div",{style:{marginTop:"8px",height:"3px",background:"#F3F4F6",borderRadius:"2px",marginLeft:"38px"},children:t.jsx("div",{style:{height:"100%",borderRadius:"2px",background:g,width:`${u}%`,transition:"width 0.4s ease"}})})]})}function f({step:e,model:s,onAction:i}){const n=e.getCount(s),d=e.getTarget(),c=n>=d;return t.jsxs("div",{style:{background:"#FFFFFF",border:"1px solid #E5E5E0",borderRadius:"12px",padding:"24px"},children:[t.jsx("div",{style:{fontSize:"32px",marginBottom:"12px"},children:e.icon}),t.jsx("h2",{style:{fontSize:"18px",fontWeight:800,color:"#1B3A4B",margin:"0 0 6px 0"},children:e.title}),t.jsx("div",{style:{fontSize:"11px",fontWeight:600,color:"#9CA3AF",marginBottom:"12px",fontFamily:"monospace"},children:e.standard}),t.jsx("p",{style:{fontSize:"13px",color:"#4B6E80",lineHeight:"1.7",margin:"0 0 20px 0"},children:e.description}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",padding:"14px 16px",borderRadius:"8px",background:c?"#2ECC7110":n>0?"#F39C1210":"#F3F4F6",marginBottom:"20px"},children:[t.jsx("div",{style:{fontSize:"24px",fontWeight:800,color:c?"#2ECC71":n>0?"#F39C12":"#9CA3AF"},children:n}),t.jsxs("div",{children:[t.jsx("div",{style:{fontSize:"13px",fontWeight:600,color:"#374151"},children:c?`✓ Target reached (${d}+ recommended)`:`${d-n} more recommended`}),t.jsx("div",{style:{fontSize:"11px",color:"#9CA3AF"},children:e.getDetails(s)})]})]}),t.jsxs("button",{onClick:()=>i(e.actionView),style:{width:"100%",padding:"12px",borderRadius:"8px",background:"#1B3A4B",color:"#FFFFFF",border:"none",fontSize:"13px",fontWeight:600,cursor:"pointer",transition:"background 0.15s"},onMouseEnter:r=>r.currentTarget.style.background="#244D63",onMouseLeave:r=>r.currentTarget.style.background="#1B3A4B",children:[e.actionLabel," →"]})]})}function y({model:e}){const s=l.filter(n=>n.getCount(e)>=n.getTarget()).length,i=Math.round(s/l.length*100);return t.jsxs("div",{style:{padding:"16px 20px",background:"#FFFFFF",borderRadius:"12px",border:"1px solid #E5E5E0",marginBottom:"16px"},children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"8px"},children:[t.jsx("span",{style:{fontSize:"13px",fontWeight:700,color:"#1B3A4B"},children:"Golden Path Progress"}),t.jsxs("span",{style:{fontSize:"13px",fontWeight:700,color:"#1B3A4B"},children:[s,"/",l.length," steps"]})]}),t.jsx("div",{style:{height:"6px",background:"#F3F4F6",borderRadius:"3px"},children:t.jsx("div",{style:{height:"100%",borderRadius:"3px",background:i>=100?"#2ECC71":"#2DD4A8",width:`${i}%`,transition:"width 0.4s ease"}})})]})}function j(){const e=p(o=>o.model),s=p(o=>o.setActiveView),i=p(o=>o.setExplorerTab),n=x.useMemo(()=>{if(!e)return 0;for(let o=0;o<l.length;o++)if(l[o].getCount(e)<l[o].getTarget())return o;return l.length-1},[e]),[d,c]=x.useState(n);if(!e)return t.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",background:"#F7F7F5"},children:t.jsx("div",{style:{fontSize:"13px",color:"#9CA3AF"},children:"No model data"})});function r(o){switch(o){case"model":i("model"),s({type:"dashboard"});break;case"traceability":s({type:"traceability"});break;case"statistics":s({type:"statistics"});break;case"catalog":i("model"),s({type:"dashboard"});break}}return t.jsx("div",{style:{flex:1,overflowY:"auto",background:"#F7F7F5",padding:"28px 40px"},children:t.jsxs("div",{style:{maxWidth:"960px",margin:"0 auto"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",marginBottom:"20px"},children:[t.jsxs("div",{children:[t.jsx("h1",{style:{fontSize:"20px",fontWeight:800,color:"#1B3A4B",margin:"0 0 4px 0"},children:"Workflow Wizard"}),t.jsx("p",{style:{fontSize:"12px",color:"#6B7280",margin:0},children:"Follow the golden path to a complete, review-ready device model"})]}),t.jsx("button",{onClick:()=>s({type:"dashboard"}),style:{fontSize:"12px",color:"#6B7280",background:"#F3F4F6",border:"1px solid #E5E5E0",borderRadius:"6px",padding:"6px 12px",cursor:"pointer",fontWeight:500},children:"← Back to Dashboard"})]}),t.jsx(y,{model:e}),t.jsxs("div",{style:{display:"grid",gridTemplateColumns:"380px 1fr",gap:"16px"},children:[t.jsx("div",{style:{background:"#F9FAFB",border:"1px solid #E5E5E0",borderRadius:"12px",padding:"8px",display:"flex",flexDirection:"column",gap:"2px"},children:l.map((o,a)=>t.jsx(m,{step:o,index:a,isActive:a===d,model:e,onSelect:()=>c(a),onAction:r},o.id))}),t.jsx(f,{step:l[d],model:e,onAction:r})]})]})})}export{j as WorkflowWizard};
|