@memoarchitect/architect 0.6.2 → 0.6.4
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 +2 -2
- package/dist/assets/ChatPanel-DSjWi7UI.js +3 -0
- package/dist/assets/{ComplianceWizard-Bi9PLmJH.js → ComplianceWizard-CVidRUY4.js} +1 -1
- package/dist/assets/{DSMView-DbC_fUKT.js → DSMView-DdcRG9Te.js} +1 -1
- package/dist/assets/{Dashboard-6Dgma4kY.js → Dashboard-DxOueCqW.js} +1 -1
- package/dist/assets/DhfDashboard-CpDAP41S.js +1 -0
- package/dist/assets/{DhfSettingsPanel-jQ5mh_50.js → DhfSettingsPanel-C2vyewXY.js} +1 -1
- package/dist/assets/{DhfWorkbench-CgFdQIts.js → DhfWorkbench-BGaEk0Qi.js} +3 -3
- package/dist/assets/DiagramCanvas-DybZNdxw.js +1 -0
- package/dist/assets/DiagramEditor-v6VJ5o2f.js +4 -0
- package/dist/assets/ElementDetailView-9EkxZAaF.js +2 -0
- package/dist/assets/{ImportView-HCDzL9Xx.js → ImportView-C8lcbof7.js} +1 -1
- package/dist/assets/{LayerGrid-DSxAFwPk.js → LayerGrid-BB30kAyl.js} +1 -1
- package/dist/assets/{LayerTable-C5VBpm6T.js → LayerTable-BN9IZPbM.js} +1 -1
- package/dist/assets/{MaxGraphCanvas-B7tAFvDf.js → MaxGraphCanvas-CfoIuwsi.js} +3 -3
- package/dist/assets/{ModelDiff-MM5NKKXK.js → ModelDiff-D6IR9kzb.js} +1 -1
- package/dist/assets/OntologyDecompositionDiagram-DjhvdWh5.js +1 -0
- package/dist/assets/{OntologyViewer-C5ik2Kmi.js → OntologyViewer-cI3zi95S.js} +2 -2
- package/dist/assets/{RelationshipOverlay-DSzjs5U7.js → RelationshipOverlay-B9bqt4zl.js} +1 -1
- package/dist/assets/{RelationshipsSection-2CEoiF6o.js → RelationshipsSection-DttMvF2i.js} +1 -1
- package/dist/assets/{ReviewDashboard-DwlsAVBa.js → ReviewDashboard-BTqze9-C.js} +1 -1
- package/dist/assets/ScenarioEditor-BL835I2V.js +3 -0
- package/dist/assets/{StatisticsDashboard-C67W4pb0.js → StatisticsDashboard-BC1JkdTl.js} +1 -1
- package/dist/assets/{SysmlCodeEditor-CGOcUFE7.js → SysmlCodeEditor-Die2RUsz.js} +1 -1
- package/dist/assets/{SysmlGenerator-BwRhtec-.js → SysmlGenerator-B_Me_xGE.js} +1 -1
- package/dist/assets/{TabularView-CTQgMG25.js → TabularView-Bn_WEMpm.js} +1 -1
- package/dist/assets/{TraceabilityMatrix-Bw5ej-So.js → TraceabilityMatrix-BEEPlOQq.js} +1 -1
- package/dist/assets/{WorkflowWizard-BwGWzMkE.js → WorkflowWizard-CFx5KVUH.js} +1 -1
- package/dist/assets/elk-6l8mIQnQ.js +26 -0
- package/dist/assets/index-BMgENwvO.js +3280 -0
- package/dist/assets/index-XtCtnAfF.css +1 -0
- package/dist/assets/layout-providers-Dr743WlP.js +1 -0
- package/dist/assets/layout-selection-ClQts3bC.js +1 -0
- package/dist/assets/{reactflow-CX-HDacK.js → reactflow-CsCqNKB-.js} +1 -1
- package/dist/assets/{zustand-qbFpP9Up.js → zustand-CrhqMOHB.js} +1 -1
- package/dist/index.html +4 -4
- package/lib/bin/memo-architect.js +20 -2
- package/lib/bin/memo-architect.js.map +1 -1
- package/lib/commands/example.d.ts +4 -0
- package/lib/commands/example.d.ts.map +1 -1
- package/lib/commands/example.js +14 -7
- package/lib/commands/example.js.map +1 -1
- package/package.json +7 -5
- package/dist/assets/AskPanel-Dqc6aaqg.js +0 -1
- package/dist/assets/DhfDashboard-BPXIYJnw.js +0 -1
- package/dist/assets/DiagramCanvas-CIfN1ybl.js +0 -1
- package/dist/assets/DiagramEditor-Y4sSx9nO.js +0 -4
- package/dist/assets/ElementDetailView-B946aM3p.js +0 -2
- package/dist/assets/OntologyDecompositionDiagram-CAzu3z_q.js +0 -1
- package/dist/assets/ScenarioEditor-BRWvcD2f.js +0 -3
- package/dist/assets/elk-B75IRfCd.js +0 -1
- package/dist/assets/index-D0i9ua6F.js +0 -3277
- package/dist/assets/index-DPzXL4uF.css +0 -1
- package/dist/assets/layout-providers-BFnfta4Z.js +0 -26
- package/dist/assets/layout-selection-BTId1JyG.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e,H as C,P as k,R as D,a as S,i as O,f as R,g as T}from"./reactflow-CX-HDacK.js";import{a as p}from"./zustand-qbFpP9Up.js";/* empty css */import{r as I}from"./layout-providers-BFnfta4Z.js";import{f as L,u as h,w as P,x as M,y as z}from"./index-D0i9ua6F.js";import"./elk-B75IRfCd.js";import"web-worker";const A={ontology:{bg:"#EFF6FF",fg:"#2563EB",border:"#BFDBFE"},profile:{bg:"#F0FDF4",fg:"#16A34A",border:"#BBF7D0"},extension:{bg:"#FFF7ED",fg:"#EA580C",border:"#FED7AA"}};function H({data:i}){const s=i,l=A[s.type]??A.ontology;return e.jsxs("div",{"data-testid":`ontology-package-node-${s.name}`,onClick:s.onClick,onDoubleClick:s.onDoubleClick,onContextMenu:s.onContextMenu,style:{background:"#FFFFFF",border:s.selected?"2px solid #2563EB":"1px solid #E5E5E0",borderRadius:"12px",padding:"16px",minWidth:"240px",maxWidth:"300px",cursor:"pointer",boxShadow:"0 1px 3px rgba(0,0,0,0.06)",transition:"box-shadow 200ms ease, transform 200ms ease"},children:[e.jsx(C,{type:"target",position:k.Top,id:"top",style:w}),e.jsx(C,{type:"source",position:k.Bottom,id:"bottom",style:w}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px",marginBottom:"8px"},children:[e.jsx("span",{style:{padding:"1px 8px",fontSize:"10px",borderRadius:"9999px",fontWeight:600,background:l.bg,color:l.fg,border:`1px solid ${l.border}`},children:s.type}),e.jsxs("span",{style:{fontSize:"10px",color:"#9CA3AF"},children:["v",s.version]})]}),e.jsx("div",{style:{fontSize:"13px",fontWeight:600,color:"#1a1a1a",marginBottom:"4px"},children:s.name}),s.description&&e.jsx("div",{style:{fontSize:"11px",color:"#9CA3AF",marginBottom:"10px",lineHeight:"1.4"},children:s.description.length>80?s.description.slice(0,80)+"…":s.description}),e.jsx("div",{style:{display:"flex",gap:"2px",marginBottom:"8px",height:"6px",borderRadius:"3px",overflow:"hidden"},children:s.layers.slice(0,12).map(d=>{const n=L[d.id]??d.color??"#6B7280";return e.jsx("div",{style:{flex:Math.max(d.kindCount,1),background:n,borderRadius:"1px"},title:`${d.label}: ${d.kindCount} kinds`},d.id)})}),e.jsxs("div",{style:{display:"flex",gap:"12px",fontSize:"11px",color:"#6B7280"},children:[e.jsxs("span",{children:[e.jsx("strong",{style:{color:"#1B3A4B"},children:s.kindCount})," kinds"]}),e.jsxs("span",{children:[e.jsx("strong",{style:{color:"#1B3A4B"},children:s.layerCount})," layers"]})]})]})}const w={width:"8px",height:"8px",background:"#2563EB",border:"2px solid #FFFFFF",opacity:0},W=p.memo(H);function $({onClose:i}){const s=h(o=>o.availableOntologies),l=h(o=>o.ontologyInstallStatus),d=h(o=>o.setOntologyInstallStatus),[n,c]=p.useState(""),[r,g]=p.useState(null);function t(){n.trim()&&(d({installing:!0}),P(n.trim()),c(""))}function x(o){M(o),g(null)}return e.jsx("div",{className:"fixed inset-0 flex items-center justify-center z-50",style:{background:"rgba(0,0,0,0.4)"},onClick:i,children:e.jsxs("div",{className:"rounded-xl shadow-2xl overflow-hidden",style:{background:"#FFFFFF",width:"520px",maxHeight:"600px",border:"1px solid #E5E5E0"},onClick:o=>o.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between px-5 py-4",style:{borderBottom:"1px solid #E5E5E0"},children:[e.jsx("h2",{className:"text-sm font-semibold",style:{color:"#1a1a1a"},children:"Manage Ontology Library"}),e.jsx("button",{onClick:i,className:"text-sm px-2 py-0.5 rounded hover:bg-gray-100",style:{color:"#9CA3AF"},children:"x"})]}),e.jsxs("div",{className:"p-5 space-y-5 overflow-y-auto",style:{maxHeight:"480px"},children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-xs font-medium block mb-1.5",style:{color:"#374151"},children:"Add Ontology"}),e.jsx("p",{className:"text-xs mb-2",style:{color:"#9CA3AF"},children:"Enter a git URL (https://...git), npm package name (@memoarchitect/...), or local path."}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{type:"text",placeholder:"https://gitlab.com/org/my-ontology.git",value:n,onChange:o=>c(o.target.value),onKeyDown:o=>o.key==="Enter"&&t(),className:"flex-1 px-3 py-2 text-xs rounded-lg",style:{border:"1px solid #E5E7EB",background:"#F9FAFB",color:"#374151",outline:"none"},onFocus:o=>o.currentTarget.style.borderColor="#2563EB",onBlur:o=>o.currentTarget.style.borderColor="#E5E7EB",disabled:l.installing}),e.jsx("button",{onClick:t,disabled:!n.trim()||l.installing,className:"px-4 py-2 text-xs rounded-lg font-medium",style:{background:l.installing?"#9CA3AF":"#1B3A4B",color:"#FFFFFF",opacity:!n.trim()||l.installing?.5:1,cursor:!n.trim()||l.installing?"not-allowed":"pointer"},children:l.installing?"Installing...":"Install"})]}),l.error&&e.jsx("div",{className:"mt-2 px-3 py-2 rounded-lg text-xs",style:{background:"#FEF2F2",color:"#DC2626",border:"1px solid #FECACA"},children:l.error}),l.lastInstalled&&!l.error&&e.jsxs("div",{className:"mt-2 px-3 py-2 rounded-lg text-xs",style:{background:"#F0FDF4",color:"#16A34A",border:"1px solid #BBF7D0"},children:["Installed ",l.lastInstalled]})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"text-xs font-medium block mb-2",style:{color:"#374151"},children:["Installed Packages (",s.length,")"]}),e.jsxs("div",{className:"space-y-1.5",children:[s.map(o=>e.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5 rounded-lg",style:{border:"1px solid #E5E5E0",background:"#FAFAF8"},children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-xs font-medium truncate",style:{color:"#1a1a1a"},children:o.name}),e.jsx("span",{className:"px-1.5 py-0.5 text-xs rounded",style:{background:o.type==="ontology"?"#EFF6FF":o.type==="profile"?"#F0FDF4":"#FFF7ED",color:o.type==="ontology"?"#2563EB":o.type==="profile"?"#16A34A":"#EA580C",fontSize:"10px"},children:o.type})]}),e.jsxs("div",{className:"text-xs mt-0.5",style:{color:"#9CA3AF"},children:["v",o.version," · ",o.kindCount," kinds · ",o.layers.length," layers"]})]}),r===o.name?e.jsxs("div",{className:"flex gap-1",children:[e.jsx("button",{onClick:()=>x(o.name),className:"px-2 py-1 text-xs rounded",style:{background:"#DC2626",color:"#FFFFFF"},children:"Confirm"}),e.jsx("button",{onClick:()=>g(null),className:"px-2 py-1 text-xs rounded",style:{background:"#F3F4F6",color:"#374151"},children:"Cancel"})]}):e.jsx("button",{onClick:()=>g(o.name),className:"text-xs px-2 py-1 rounded hover:bg-red-50",style:{color:"#DC2626",border:"1px solid #FECACA"},children:"Remove"})]},o.name)),s.length===0&&e.jsx("div",{className:"text-center py-6 text-xs",style:{color:"#9CA3AF"},children:"No ontology packages installed"})]})]})]})]})})}const _={ontologyPackage:W},Y=260,V=180;async function K(i){const s=new Map(i.map(t=>[t.name,t])),l={id:"root",layoutOptions:{"elk.algorithm":"layered","elk.direction":"RIGHT","elk.layered.nodePlacement.strategy":"BRANDES_KOEPF","elk.layered.spacing.nodeNodeBetweenLayers":"100","elk.spacing.nodeNode":"32","elk.layered.crossingMinimization.strategy":"LAYER_SWEEP","elk.padding":"[top=24, left=24, bottom=24, right=24]"},children:i.map(t=>({id:t.name,width:Y,height:V})),edges:i.filter(t=>t.extends&&s.has(t.extends)).map((t,x)=>({id:`e-${x}`,sources:[t.extends],targets:[t.name]}))},d=await I(l),n=new Map;for(const t of d.children??[])n.set(t.id,{x:t.x??0,y:t.y??0});const c={ontology:"#3B82F6",profile:"#10B981",extension:"#F59E0B"},r=i.map(t=>({id:t.name,type:"ontologyPackage",position:n.get(t.name)??{x:0,y:0},data:{name:t.name,type:t.type,version:t.version,description:t.description,kindCount:t.kindCount,layerCount:t.layers.length,layers:t.layers.map(x=>({id:x.id,label:x.label,color:x.color,kindCount:x.kindCount})),selected:t.selected,onClick:()=>{}}})),g=[];for(const t of i)if(t.extends&&s.has(t.extends)){const x=c[t.type]??"#94A3B8";g.push({id:`${t.extends}->${t.name}`,source:t.extends,target:t.name,type:"smoothstep",data:{edgeType:"extends"},style:{stroke:x,strokeWidth:2,strokeDasharray:"6 3"},animated:!1,label:"extends",labelStyle:{fontSize:9,fill:x,fontWeight:500},labelBgStyle:{fill:"#F7F7F5",fillOpacity:.9},labelBgPadding:[4,2],markerEnd:{type:"arrowclosed",color:x,width:14,height:14}})}return{nodes:r,edges:g}}function G(i,s){const l=new Map;for(const c of s)c.extends&&(l.has(c.extends)||l.set(c.extends,[]),l.get(c.extends).push(c.name));const d=new Set([i]),n=[i];for(;n.length;){const c=n.shift();for(const r of l.get(c)??[])d.has(r)||(d.add(r),n.push(r))}return d}function U(){const i=h(a=>a.availableOntologies),s=h(a=>a.setActiveView),l=h(a=>a.hiddenEdgeTypes),d=h(a=>a.toggleHiddenEdgeType),[n,c]=p.useState(!1),[r,g]=p.useState({nodes:[],edges:[]}),[t,x]=p.useState(null),{fitView:o}=S();p.useEffect(()=>{let a=!1;return K(i).then(u=>{a||g(u)}).catch(u=>{console.error("[OntologyDiagram] ELK layout failed:",u)}),()=>{a=!0}},[i]);const F=p.useCallback(a=>{s({type:"ontology-detail",packageName:a})},[s]),E=p.useCallback(a=>{const u=G(a,i),m=r.nodes.filter(y=>u.has(y.id));m.length!==0&&o({nodes:m.map(y=>({id:y.id})),duration:400,padding:.2})},[i,r.nodes,o]),v=p.useCallback((a,u)=>{a.preventDefault(),x({x:a.clientX,y:a.clientY,packageName:u})},[]);p.useEffect(()=>{const a=u=>{if(u.key==="Escape"){if(t){x(null);return}o({padding:.1,duration:300})}};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[t,o]);const{nodes:N,edges:B}=p.useMemo(()=>{const a=r.nodes.map(m=>({...m,data:{...m.data,onClick:()=>E(m.id),onDoubleClick:()=>F(m.id),onContextMenu:y=>v(y,m.id)}})),u=r.edges.filter(m=>{var j;const y=(j=m.data)==null?void 0:j.edgeType;return!y||!l.has(y)});return{nodes:a,edges:u}},[r,E,F,v,l]),f=p.useRef(null);p.useEffect(()=>{if(!t)return;const a=u=>{f.current&&!f.current.contains(u.target)&&x(null)};return window.addEventListener("mousedown",a),()=>window.removeEventListener("mousedown",a)},[t]);const b=l.has("extends");return i.length===0?e.jsx("div",{className:"flex-1 flex items-center justify-center",style:{background:"#F7F7F5"},children:e.jsxs("div",{className:"text-center",style:{color:"#9CA3AF"},children:[e.jsx("div",{className:"text-3xl mb-3",children:"◉"}),e.jsx("div",{className:"text-sm font-medium mb-1",style:{color:"#374151"},children:"No ontology packages found"}),e.jsx("div",{className:"text-xs",children:"Start the dev server to load ontology packages"})]})}):e.jsxs("div",{className:"flex-1",style:{background:"#F7F7F5"},children:[e.jsxs("div",{className:"flex items-start justify-between px-6 pt-5 pb-3",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-base font-semibold",style:{color:"#1a1a1a"},children:"Ontology Library"}),e.jsxs("p",{className:"text-xs mt-1",style:{color:"#9CA3AF"},children:[i.length," package",i.length!==1?"s":""," available. Click to zoom, double-click to open, right-click for source."]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{"data-testid":"toggle-tracing",onClick:()=>d("extends"),title:b?"Show extends tracing edges":"Hide extends tracing edges",className:"px-3 py-1.5 text-xs rounded-lg font-medium",style:b?{background:"#F0F0ED",color:"#6B7280",border:"1px solid #E5E5E0"}:{background:"#1B3A4B",color:"#2DD4A8",border:"1px solid transparent"},children:b?"Show Tracing":"Hide Tracing"}),e.jsx("button",{onClick:()=>c(!0),className:"px-3 py-1.5 text-xs rounded-lg font-medium",style:{background:"#1B3A4B",color:"#2DD4A8"},children:"+ Add Ontology"})]})]}),n&&e.jsx($,{onClose:()=>c(!1)}),e.jsx("div",{style:{flex:1,height:"calc(100% - 72px)"},children:e.jsxs(O,{nodes:N,edges:B,nodeTypes:_,fitView:!0,fitViewOptions:{padding:.1},nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,panOnScroll:!0,zoomOnDoubleClick:!1,minZoom:.2,maxZoom:2.5,proOptions:{hideAttribution:!0},children:[e.jsx(R,{color:"#E5E5E0",gap:24,size:1}),e.jsx(T,{showInteractive:!1})]})}),t&&e.jsx(Z,{menuRef:f,state:t,onClose:()=>x(null),packages:i})]})}const Z=({state:i,onClose:s,packages:l,menuRef:d})=>{const n=l.find(r=>r.name===i.packageName);function c(){if(!n)return;const r=n.rootDir?`${n.rootDir}/memo.package.yaml`:"";r?z(r):window.open(`vscode://file/${encodeURIComponent(n.name)}`),s()}return e.jsxs("div",{ref:d,style:{position:"fixed",top:i.y,left:i.x,zIndex:1e3,background:"#FFFFFF",border:"1px solid #E5E5E0",borderRadius:"8px",boxShadow:"0 6px 16px rgba(0,0,0,0.12)",padding:"4px",minWidth:"180px",fontSize:"12px"},children:[e.jsx("div",{style:{padding:"6px 10px",color:"#9CA3AF",fontSize:"10px",textTransform:"uppercase",letterSpacing:"0.4px"},children:i.packageName}),e.jsx("button",{onClick:c,disabled:!(n!=null&&n.rootDir),style:{display:"block",width:"100%",textAlign:"left",padding:"6px 10px",border:"none",background:"transparent",cursor:n!=null&&n.rootDir?"pointer":"not-allowed",color:n!=null&&n.rootDir?"#1a1a1a":"#9CA3AF",borderRadius:"4px"},onMouseEnter:r=>{n!=null&&n.rootDir&&(r.currentTarget.style.background="#F0F0ED")},onMouseLeave:r=>{r.currentTarget.style.background="transparent"},children:"Open source"})]})};function ne(){return e.jsx(D,{children:e.jsx(U,{})})}export{ne as OntologyDecompositionDiagram,ne as default};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{j as e}from"./reactflow-CX-HDacK.js";import{a as d}from"./zustand-qbFpP9Up.js";import{u as k,h as Z,i as ee,f as w}from"./index-D0i9ua6F.js";function G(a){return a?a.split(`
|
|
2
|
-
`).filter(m=>m.trim()).map((m,y)=>{const C=m.match(/^\d+\.\s*(.*)/);return{index:y,text:C?C[1]:m}}):[]}function se(a){return a.map((E,m)=>`${m+1}. ${E.text}`).join(`
|
|
3
|
-
`)}function oe(){const a=k(s=>s.model),E=k(s=>s.createRelationship),m=k(s=>s.selectElement),y=k(s=>s.selectedElementId),C=k(s=>s.setActiveMode),V=k(s=>s.setActiveView),[F,W]=d.useState(""),[r,p]=d.useState(null),[A,L]=d.useState(""),[I,M]=d.useState(null),[S,T]=d.useState(""),B=d.useMemo(()=>{if(!a)return[];const s=Object.values(a.elements),l=a.elements,t=n=>a.relationships.filter(b=>b.type===n),u=s.filter(n=>n.kind.endsWith("UseCase")),x=n=>!F||n.name.toLowerCase().includes(F.toLowerCase())||n.kind.toLowerCase().includes(F.toLowerCase());return u.map(n=>{const b=t("supportsUseCase").filter(o=>o.targetId===n.id).map(o=>l[o.sourceId]).filter(o=>!!o),v=t("scenarioRealizesUseCase").filter(o=>o.targetId===n.id).map(o=>l[o.sourceId]).filter(o=>!!o).map(o=>{const j=t("scenarioComprisesActivity").filter(i=>i.sourceId===o.id).map(i=>l[i.targetId]).filter(i=>!!i),f=t("functionalRealizesOperative").filter(i=>i.targetId===o.id).map(i=>l[i.sourceId]).filter(i=>!!i),D=f.flatMap(i=>t("uIRealizesFunctional").filter(g=>g.targetId===i.id).map(g=>l[g.sourceId]).filter(g=>!!g)),N=(a.diagrams??[]).filter(i=>{var g,U;return((g=i.elementIds)==null?void 0:g.includes(o.id))||((U=i.elementIds)==null?void 0:U.some(Q=>j.some(X=>X.id===Q)))||i.name.toLowerCase().includes(o.name.toLowerCase())});return{scenario:o,activities:j,functionalScenarios:f,uiScenarios:D,views:N}});return{useCase:n,workflows:b,scenarios:v}}).filter(n=>x(n.useCase)||n.workflows.some(x)||n.scenarios.some(({scenario:b,activities:v,functionalScenarios:o,uiScenarios:j})=>x(b)||v.some(x)||o.some(x)||j.some(x)))},[a,F]),c=y&&a?a.elements[y]:null,R=d.useMemo(()=>Z(a,y||""),[a,y]),h=d.useMemo(()=>r||(c?G(c.doc||""):[]),[c,r]),K=d.useCallback(()=>{c&&p(G(c.doc||""))},[c]),_=d.useCallback(()=>{if(!c||!r)return;const s=se(r);ee({...c,doc:s}),p(null)},[c,r]),z=d.useCallback(()=>{if(!A.trim())return;const s=[...r||h,{index:h.length,text:A.trim()}];p(s),L("")},[A,r,h]),$=d.useCallback(s=>{const l=(r||h).filter((t,u)=>u!==s);p(l)},[r,h]),O=d.useCallback((s,l)=>{const t=[...r||h],u=s+l;u<0||u>=t.length||([t[s],t[u]]=[t[u],t[s]],p(t))},[r,h]),Y=d.useCallback((s,l)=>{const t=[...r||h];t[s]={...t[s],text:l},p(t)},[r,h]),q=d.useMemo(()=>{if(!a||!S)return[];const s=S.toLowerCase();return Object.values(a.elements).filter(l=>l.id!==y&&l.name.toLowerCase().includes(s)).slice(0,10)},[a,S,y]),[H,J]=d.useState(new Set),P=s=>{J(l=>{const t=new Set(l);return t.has(s)?t.delete(s):t.add(s),t})};return e.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[e.jsxs("div",{className:"w-72 flex flex-col overflow-hidden",style:{background:"#FFFFFF",borderRight:"1px solid #E5E5E0"},children:[e.jsx("div",{className:"px-3 py-2",style:{borderBottom:"1px solid #E5E5E0"},children:e.jsx("input",{type:"text",placeholder:"Search "+B.length+" use cases...",value:F,onChange:s=>W(s.target.value),className:"w-full px-3 py-2 text-sm rounded-lg focus:outline-none",style:{background:"#F7F7F5",border:"1px solid #E5E5E0",color:"#1a1a1a"}})}),e.jsxs("div",{className:"flex-1 overflow-y-auto text-xs py-1",children:[B.map(({useCase:s,workflows:l,scenarios:t})=>{const u="use-case:"+s.id,x=H.has(u);return e.jsxs("div",{className:"mb-0.5",children:[e.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 cursor-pointer",style:{borderRadius:"6px",margin:"0 4px"},onMouseEnter:n=>n.currentTarget.style.background="#F0F0ED",onMouseLeave:n=>n.currentTarget.style.background="transparent",onClick:()=>{m(s.id),p(null),P(u)},children:[e.jsx("span",{className:"w-2.5 h-2.5 rounded flex-shrink-0",style:{backgroundColor:w.functional,borderRadius:"3px"}}),e.jsx("span",{className:"font-medium flex-1",style:{color:"#374151"},children:s.name}),e.jsx("span",{style:{color:"#9CA3AF"},children:"Use case"}),e.jsx("span",{style:{color:"#D1D5DB"},children:x?"▸":"▾"})]}),!x&&e.jsxs("div",{className:"ml-5 border-l pl-2",style:{borderColor:"#E5E5E0"},children:[e.jsx("div",{className:"px-2 py-1 font-semibold uppercase tracking-wider",style:{color:"#6B7280",fontSize:"10px"},children:"Workflows"}),l.map(n=>e.jsx("button",{onClick:()=>{m(n.id),p(null)},className:"block w-full px-2 py-1 text-left truncate rounded",style:{color:"#374151"},children:n.name},n.id)),e.jsx("div",{className:"px-2 pt-2 py-1 font-semibold uppercase tracking-wider",style:{color:"#6B7280",fontSize:"10px"},children:"Scenarios"}),t.map(({scenario:n,activities:b,functionalScenarios:v,uiScenarios:o,views:j})=>e.jsxs("div",{className:"mb-1",children:[e.jsx("button",{onClick:()=>{m(n.id),p(null)},className:"block w-full px-2 py-1 text-left truncate rounded",style:{color:"#1B3A4B",fontWeight:500},children:n.name}),e.jsxs("div",{className:"ml-3 border-l pl-2",style:{borderColor:"#E5E5E0"},children:[[["Operational",b],["Functional",v],["UI",o]].filter(([,f])=>f.length>0).map(([f,D])=>e.jsxs("div",{children:[e.jsx("div",{className:"pt-1",style:{color:"#6B7280",fontSize:"10px"},children:f}),D.map(N=>e.jsx("button",{onClick:()=>{m(N.id),p(null)},className:"block w-full px-1 py-0.5 text-left truncate rounded",style:{color:"#4B5563"},children:N.name},N.id))]},f)),j.length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"pt-1",style:{color:"#6B7280",fontSize:"10px"},children:"Views"}),j.map(f=>e.jsx("button",{onClick:()=>{C("diagram"),V({type:"diagram",diagramId:f.id})},className:"block w-full px-1 py-0.5 text-left truncate rounded",style:{color:"#2563EB"},children:f.name},f.id))]})]})]},n.id))]})]},s.id)}),B.length===0&&e.jsx("div",{className:"px-4 py-8 text-center",style:{color:"#9CA3AF"},children:"No use-case scenario chains found."})]})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-6",style:{background:"#F7F7F5"},children:[!c&&e.jsx("div",{className:"flex items-center justify-center h-full",style:{color:"#9CA3AF"},children:e.jsxs("div",{className:"text-center",children:[e.jsx("div",{style:{fontSize:"32px",marginBottom:"8px",opacity:.5},children:"▶"}),e.jsx("div",{className:"text-sm",children:"Select a scenario to edit steps and link elements"})]})}),c&&e.jsxs("div",{className:"max-w-2xl",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsx("h2",{className:"text-lg font-semibold",style:{color:"#1a1a1a"},children:c.name}),e.jsx("span",{className:"px-2 py-0.5 text-xs rounded-md font-medium",style:{background:"#E67E2218",color:"#E67E22"},children:c.kind})]}),e.jsxs("div",{className:"mb-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wider",style:{color:"#6B7280"},children:"Steps"}),!r&&e.jsx("button",{onClick:K,className:"px-2 py-0.5 text-xs rounded",style:{background:"#2DD4A815",color:"#1B3A4B",border:"1px solid #2DD4A840"},children:"Edit"}),r&&e.jsxs("div",{className:"flex gap-1",children:[e.jsx("button",{onClick:_,className:"px-2 py-0.5 text-xs rounded font-medium",style:{background:"#2DD4A8",color:"#FFFFFF"},children:"Save"}),e.jsx("button",{onClick:()=>p(null),className:"px-2 py-0.5 text-xs rounded",style:{background:"#F3F4F6",color:"#6B7280"},children:"Cancel"})]})]}),e.jsx("div",{className:"space-y-1",children:h.map((s,l)=>e.jsxs("div",{className:"flex items-start gap-2 p-2 rounded-lg",style:{background:"#FFFFFF",border:"1px solid #E5E5E0"},children:[e.jsx("span",{className:"flex-shrink-0 w-6 h-6 rounded-full flex items-center justify-center text-xs font-medium",style:{background:"#2DD4A815",color:"#1B3A4B"},children:l+1}),r?e.jsx("input",{type:"text",value:s.text,onChange:t=>Y(l,t.target.value),className:"flex-1 text-sm px-2 py-1 rounded focus:outline-none",style:{border:"1px solid #E5E5E0",color:"#374151"}}):e.jsx("span",{className:"flex-1 text-sm",style:{color:"#374151"},children:s.text}),r&&e.jsxs("div",{className:"flex gap-0.5",children:[e.jsx("button",{onClick:()=>O(l,-1),className:"px-1 text-xs",style:{color:"#9CA3AF"},title:"Move up",children:"▲"}),e.jsx("button",{onClick:()=>O(l,1),className:"px-1 text-xs",style:{color:"#9CA3AF"},title:"Move down",children:"▼"}),e.jsx("button",{onClick:()=>$(l),className:"px-1 text-xs",style:{color:"#E74C3C"},title:"Remove",children:"✕"})]})]},l))}),r&&e.jsxs("div",{className:"flex gap-2 mt-2",children:[e.jsx("input",{type:"text",value:A,onChange:s=>L(s.target.value),onKeyDown:s=>s.key==="Enter"&&z(),placeholder:"Add a step...",className:"flex-1 text-sm px-3 py-2 rounded-lg focus:outline-none",style:{background:"#FFFFFF",border:"1px solid #E5E5E0",color:"#374151"}}),e.jsx("button",{onClick:z,className:"px-3 py-2 text-xs rounded-lg font-medium",style:{background:"#2DD4A815",color:"#1B3A4B",border:"1px solid #2DD4A840"},children:"+ Add"})]}),h.length===0&&!r&&e.jsx("div",{className:"text-xs p-3 rounded-lg",style:{background:"#F3F4F6",color:"#9CA3AF"},children:"No steps defined. Click Edit to add scenario steps."})]}),e.jsxs("div",{className:"mb-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsxs("h3",{className:"text-xs font-semibold uppercase tracking-wider",style:{color:"#6B7280"},children:["Linked Elements (",R.length,")"]}),e.jsx("button",{onClick:()=>M(I===null?0:null),className:"px-2 py-0.5 text-xs rounded",style:{background:"#4A90D915",color:"#4A90D9",border:"1px solid #4A90D940"},children:I!==null?"Done":"+ Link"})]}),I!==null&&e.jsxs("div",{className:"mb-2 p-2 rounded-lg",style:{background:"#FFFFFF",border:"1px solid #4A90D940"},children:[e.jsx("input",{type:"text",value:S,onChange:s=>T(s.target.value),placeholder:"Search elements to link...",className:"w-full text-sm px-2 py-1 rounded focus:outline-none mb-1",style:{border:"1px solid #E5E5E0",color:"#374151"}}),q.map(s=>e.jsxs("div",{className:"flex items-center gap-2 px-2 py-1 text-xs rounded cursor-pointer",onMouseEnter:l=>l.currentTarget.style.background="#F0F0ED",onMouseLeave:l=>l.currentTarget.style.background="transparent",onClick:()=>{E({type:"traceTo",sourceId:c.id,targetId:s.id,direction:"outgoing",selectedElementId:c.id}),T(""),M(null)},children:[e.jsx("span",{className:"w-2 h-2 rounded-full",style:{background:w[s.layer]||"#95A5A6"}}),e.jsx("span",{style:{color:"#374151"},children:s.name}),e.jsx("span",{style:{color:"#9CA3AF"},children:s.kind})]},s.id))]}),e.jsx("div",{className:"space-y-1",children:R.map(s=>{const l=s.sourceId===c.id?s.targetId:s.sourceId,t=a.elements[l],u=s.sourceId===c.id?"→":"←";return e.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 text-xs rounded-lg cursor-pointer",style:{background:"#FFFFFF",border:"1px solid #E5E5E0"},onMouseEnter:x=>x.currentTarget.style.background="#F0F0ED",onMouseLeave:x=>x.currentTarget.style.background="#FFFFFF",onClick:()=>m(l),children:[e.jsx("span",{style:{color:"#9CA3AF"},children:u}),e.jsx("span",{className:"font-medium",style:{color:"#2563EB"},children:s.type}),e.jsx("span",{style:{color:"#374151"},children:(t==null?void 0:t.name)||l}),t&&e.jsx("span",{className:"ml-auto px-1.5 py-0.5 rounded text-xs",style:{background:(w[t.layer]||"#95A5A6")+"18",color:w[t.layer]||"#95A5A6"},children:t.kind})]},s.id)})})]}),e.jsx("div",{className:"text-xs",style:{color:"#D1D5DB"},children:c.file})]})]})]})}export{oe as ScenarioEditor};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"web-worker";function e(o){throw new Error('Could not dynamically require "'+o+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}export{e as c};
|