dev-process-kit 0.0.2 → 0.0.3
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 +10 -9
- package/dist/chunks/shared-B2K3LoOU.js +1016 -0
- package/dist/chunks/{shared-D6UXy-Qw.js → shared-BqW3KAJ4.js} +99 -46
- package/dist/chunks/{shared-DZlREPaN.js → shared-Byv6cc0r.js} +480 -238
- package/dist/chunks/{shared-D3EKtSkd.js → shared-CKG_SQh5.js} +1 -1
- package/dist/chunks/{shared-C4Y4jSXa.js → shared-CPAT0Cgk.js} +4 -2
- package/dist/chunks/shared-CwbzACTe.js +1874 -0
- package/dist/chunks/{shared-utv1engQ.js → shared-DBDgdVsd.js} +1 -1
- package/dist/chunks/shared-DMlMTd3c.js +1018 -0
- package/dist/chunks/shared-DaoPCw6-.js +556 -0
- package/dist/chunks/shared-DqB_TR20.js +1599 -0
- package/dist/chunks/shared-DsVxrO_3.js +609 -0
- package/dist/chunks/shared-iQIywbRc.js +676 -0
- package/dist/chunks/shared-xrCdgpNS.js +1 -0
- package/dist/components.js +1 -1
- package/dist/index.js +1 -1
- package/dist/templates/event-storming.js +1 -1
- package/dist/templates/example-mapping.js +1 -1
- package/dist/templates/grill.js +1 -1
- package/dist/templates/plain.js +1 -1
- package/dist/templates/prototype.js +1 -1
- package/dist/templates/slides.js +1 -1
- package/dist/templates/task-board.js +1 -0
- package/dist/templates/usm.js +1 -1
- package/package.json +3 -2
- package/dist/chunks/shared-BFAVBf4I.js +0 -1
- package/dist/chunks/shared-BXV4Dm_n.js +0 -522
- package/dist/chunks/shared-CQlssGTf.js +0 -692
- package/dist/chunks/shared-CcD4vDCE.js +0 -1461
- package/dist/chunks/shared-D2QreyJq.js +0 -926
- package/dist/chunks/shared-OdGbSUTa.js +0 -574
- package/dist/chunks/shared-TjJWiz7W.js +0 -546
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a5 as Wt,a6 as Gt,A as Yt,a7 as Kt,a8 as Xt,a9 as V,aa as E,ab as f,ac as z,ad as p,ae as U,af as $,ag as S,ah as Q,ai as Zt,aj as Ee,ak as De,al as ge,am as fe,an as be,ao as Jt,ap as ze,m as Te,aq as Qt,ar as es,as as ts,r as ss,s as ns}from"./shared-CcD4vDCE.js";import{i as as}from"./shared-D3EKtSkd.js";import{P as is,p as rs,r as os,c as ds}from"./shared-C4Y4jSXa.js";import{c as de}from"./shared-ml5h7U5L.js";const ls='script[type="application/json"]',Ae=(n,e)=>{const t=n.querySelector(ls);if(!t)return null;const s=t.textContent??"";if(s.trim()==="")return{ok:!1,error:"JSON block is empty"};try{return{ok:!0,value:e(JSON.parse(s))}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}},cs=(n,e,t)=>{const s=Ae(n,e);if(s)return t(s),()=>{};const a=new MutationObserver(()=>{const r=Ae(n,e);r&&(a.disconnect(),t(r))});return a.observe(n,{childList:!0,subtree:!0}),()=>a.disconnect()},Le={nodeSpacing:34,layerSpacing:84,padding:28,sweeps:4,coordinatePasses:6},le=n=>{const e=[...n].sort((s,a)=>s-a);if(e.length===0)return 0;const t=Math.floor(e.length/2);return e.length%2===1?e[t]??0:((e[t-1]??0)+(e[t]??0))/2},ps=(n,e)=>{const t=new Map;for(const i of n)t.set(i.id,[]);for(const i of e)t.get(i.from)?.push(i);const s=new Map,a=new Set,r=i=>{s.set(i,"open");for(const o of t.get(i)??[]){const d=s.get(o.to)??"new";d==="open"?a.add(o.id):d==="new"&&r(o.to)}s.set(i,"done")};for(const i of n)(s.get(i.id)??"new")==="new"&&r(i.id);return{reversed:a,forward:e.filter(i=>!a.has(i.id))}},hs=(n,e)=>{const t=new Map,s=new Map;for(const o of n)t.set(o.id,[]),s.set(o.id,[]);for(const o of e)s.get(o.from)?.push(o),t.get(o.to)?.push(o);const a=new Map(n.map(o=>[o.id,0])),r=new Map(n.map(o=>[o.id,(t.get(o.id)??[]).length])),i=n.filter(o=>(r.get(o.id)??0)===0).map(o=>o.id);for(const o of i)for(const d of s.get(o)??[]){const l=a.get(d.to)??0;a.set(d.to,Math.max(l,(a.get(o)??0)+1));const m=(r.get(d.to)??0)-1;r.set(d.to,m),m===0&&i.push(d.to)}return a},us=(n,e,t,s)=>{const a=[...n.keys()].sort((r,i)=>r-i);for(let r=0;r<s;r++){const i=r%2===0;for(const o of i?a:[...a].reverse()){const d=n.get(o)??[],l=new Map(d.map((c,h)=>[c,h])),m=c=>{const h=l.get(c);return h===void 0?null:h},b=d.map(c=>{const h=(e.get(c)??[]).filter(M=>(t.get(M)??o)===o+(i?-1:1)).map(m).filter(M=>M!==null);return{id:c,want:h.length>0?le(h):l.get(c)??0}});b.sort((c,h)=>c.want-h.want||(l.get(c.id)??0)-(l.get(h.id)??0)),n.set(o,b.map(c=>c.id))}}},Oe=(n,e,t,s)=>{const a=n.map((i,o)=>({id:i,want:t.get(i)??o*100,index:o}));a.sort((i,o)=>i.want-o.want||i.index-o.index);let r=0;for(const i of a){const o=e.get(i.id);o&&(o.y=r,r+=o.spec.height+s)}return{height:Math.max(0,r-s)}},ms=(n,e,t,s,a)=>{const r=[...n.keys()].sort((l,m)=>l-m),i=new Map;for(const l of r)i.set(l,Oe(n.get(l)??[],e,new Map,a.nodeSpacing).height);const o=Math.max(0,...i.values());for(const l of r){const m=(o-(i.get(l)??0))/2;for(const b of n.get(l)??[]){const c=e.get(b);c&&(c.y+=m)}}const d=(l,m)=>{const b=(t.get(l)??[]).filter(c=>s.get(c)===m).flatMap(c=>{const h=e.get(c);return h?[h.y+h.spec.height/2]:[]});return b.length>0?le(b):null};for(let l=0;l<a.coordinatePasses;l++){const m=l%2===0;for(const b of m?r:[...r].reverse()){const c=n.get(b)??[],h=new Map;for(const C of c){const T=d(C,b+(m?-1:1)),O=e.get(C);O!==void 0&&h.set(C,T===null?O.y+O.spec.height/2:T)}const M=c.map(C=>e.get(C)?.y??0);Oe(c,e,h,a.nodeSpacing);const v=c.map(C=>e.get(C)?.y??0),k=le(M)-le(v);for(const C of c){const T=e.get(C);T&&(T.y+=k)}}}},Re=(n,e,t)=>{const s=e===void 0?void 0:n.spec.ports?.[e];return s?{x:n.x+s.x,y:n.y+s.y}:t==="out"?{x:n.x+n.spec.width,y:n.y+n.spec.height/2}:{x:n.x,y:n.y+n.spec.height/2}},Ie=(n,e,t)=>{let s=0;const a=[];for(const r of n){const i=t.byId.get(r.from),o=t.byId.get(r.to);if(!i||!o)continue;const d=Re(i,r.fromPort,"out"),l=Re(o,r.toPort,"in");if(r.from===r.to){const M=i.x+i.spec.width,v=i.y+i.spec.height,k=Math.max(t.padding/2,v+18);a.push({id:r.id,points:[d,{x:M+20,y:d.y},{x:M+20,y:k},{x:i.x-20,y:k},{x:i.x-20,y:l.y},l]});continue}if(!e.has(r.id)&&(i.layer<o.layer||i.layer===o.layer&&l.x>d.x+12)){if(Math.abs(d.y-l.y)<.5){a.push({id:r.id,points:[d,l]});continue}const v=i.layer<o.layer?Math.max(d.x+14,o.x-Math.max(12,t.layerSpacing/2)):(d.x+l.x)/2;a.push({id:r.id,points:[d,{x:v,y:d.y},{x:v,y:l.y},l]});continue}const m=r.fromPort===void 0?{x:i.x+i.spec.width/2,y:i.y+i.spec.height}:d,b=r.toPort===void 0?{x:o.x+o.spec.width/2,y:o.y+o.spec.height}:l,c=Math.max(m.y,b.y)+18+s*14;s+=1;const h=[d,m,{x:m.x,y:c},{x:b.x,y:c},b,l].filter((M,v,k)=>v===0||M.x!==k[v-1]?.x||M.y!==k[v-1]?.y);a.push({id:r.id,points:h})}return a},Pe=(n,e,t)=>{const s=e.flatMap(c=>[...c.points]),a=[...n.map(c=>c.x),...n.map(c=>c.x+c.spec.width),...s.map(c=>c.x)],r=[...n.map(c=>c.y),...n.map(c=>c.y+c.spec.height),...s.map(c=>c.y)],i=Math.min(0,...a),o=Math.min(0,...r),d=Math.max(0,...a),l=Math.max(0,...r),m=t-i,b=t-o;return{width:d-i+t*2,height:l-o+t*2,nodes:n.map(c=>({id:c.spec.id,x:c.x+m,y:c.y+b,width:c.spec.width,height:c.spec.height,layer:c.layer,order:c.order})),routes:e.map(c=>({id:c.id,points:c.points.map(h=>({x:h.x+m,y:h.y+b}))}))}},je=(n,e)=>{const t=new Map(n.map(s=>[s.id,[]]));for(const s of e)s.from!==s.to&&(t.get(s.from)?.push(s.to),t.get(s.to)?.push(s.from));return t},Fe=(n,e,t,s)=>n.map(a=>({spec:a,layer:e.get(a.id)??0,order:t.get(a.id)??0,...s(a)})),gs=(n,e)=>{const t=new Map;for(const s of n){const a=e.get(s.id)??0,r=t.get(a);r?r.push(s.id):t.set(a,[s.id])}return t},fs=(n,e,t={})=>{const s={...Le,...t};if(n.length===0)return{width:0,height:0,nodes:[],routes:[]};const a=new Set(n.map(v=>v.id)),r=e.filter(v=>a.has(v.from)&&a.has(v.to)),{forward:i,reversed:o}=ps(n,r),d=hs(n,i),l=gs(n,d);us(l,je(n,r),d,s.sweeps);const m=new Map;for(const v of l.values())v.forEach((k,C)=>m.set(k,C));const b=Fe(n,d,m,()=>({x:0,y:0})),c=new Map(b.map(v=>[v.spec.id,v]));ms(l,c,je(n,r),d,s);const h=[...l.keys()].sort((v,k)=>v-k);let M=0;for(const v of h){const k=Math.max(...(l.get(v)??[]).map(C=>c.get(C)?.spec.width??0));for(const C of l.get(v)??[]){const T=c.get(C);T&&(T.x=M)}M+=k+s.layerSpacing}return Pe(b,Ie(r,o,{byId:c,layerSpacing:s.layerSpacing,padding:s.padding}),s.padding)},bs=(n,e,t={})=>{const s={...Le,...t};if(n.length===0)return{width:0,height:0,nodes:[],routes:[]};const a=new Set(n.map(d=>d.id)),r=e.filter(d=>a.has(d.from)&&a.has(d.to)),i=Fe(n,new Map,new Map,d=>d.position??{x:0,y:0}),o=new Map(i.map(d=>[d.spec.id,d]));return Pe(i,Ie(r,new Set,{byId:o,layerSpacing:s.layerSpacing,padding:s.padding}),s.padding)},ks=N({en:{tagFilter:"Filter by tag",tagMatch:"Tag matching",clearTags:"Clear",zoomOut:"Zoom out",fit:"Fit to view",zoomIn:"Zoom in",sendFailed:"Could not send. Please try again.",commentOn:n=>`Comment on ${n}`,noMatches:"No matching elements.",maximize:"Maximize",restore:"Restore size",canvas:"Diagram. Arrow keys pan, plus and minus zoom, 0 fits the view.",dataError:"Could not load the diagram data.",nodes:"elements",edges:"relations",change:(n,e)=>`\u201C${n}\u201D \u2192 \u201C${e}\u201D`},ja:{tagFilter:"\u30BF\u30B0\u306E\u7D5E\u308A\u8FBC\u307F",tagMatch:"\u30BF\u30B0\u306E\u4E00\u81F4\u6761\u4EF6",clearTags:"\u89E3\u9664",zoomOut:"\u7E2E\u5C0F",fit:"\u5168\u4F53\u3092\u8868\u793A",zoomIn:"\u62E1\u5927",sendFailed:"\u9001\u4FE1\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u3082\u3046\u4E00\u5EA6\u304A\u8A66\u3057\u304F\u3060\u3055\u3044\u3002",commentOn:n=>`${n}\u306B\u30B3\u30E1\u30F3\u30C8`,noMatches:"\u8A72\u5F53\u3059\u308B\u8981\u7D20\u306F\u3042\u308A\u307E\u305B\u3093\u3002",maximize:"\u6700\u5927\u5316",restore:"\u5143\u306E\u30B5\u30A4\u30BA\u306B\u623B\u3059",canvas:"\u56F3\u3002\u77E2\u5370\u30AD\u30FC\u3067\u30D1\u30F3\u3001\u30D7\u30E9\u30B9\u30FB\u30DE\u30A4\u30CA\u30B9\u3067\u30BA\u30FC\u30E0\u30010\u3067\u5168\u4F53\u8868\u793A\u3002",dataError:"\u56F3\u306E\u30C7\u30FC\u30BF\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F\u3002",nodes:"\u8981\u7D20",edges:"\u95A2\u9023",change:(n,e)=>`\u300C${n}\u300D\u2192\u300C${e}\u300D`}}),xs={active:[],match:"single"},K=(n,e)=>e.active.length===0?!0:e.match==="all"?e.active.every(t=>n.includes(t)):e.active.some(t=>n.includes(t)),vs=(n,e)=>n.active.includes(e)?{...n,active:n.active.filter(t=>t!==e)}:n.match==="single"?{...n,active:[e]}:{...n,active:[...n.active,e]},ys=(n,e)=>({match:e,active:e==="single"&&n.active.length>1?n.active.slice(-1):n.active}),ws=n=>({...n,active:[]}),$s=n=>{const e=new Map;for(const t of n)for(const s of new Set(t))e.set(s,(e.get(s)??0)+1);return[...e].map(([t,s])=>({tag:t,count:s}))},B={nodes:new Map,edges:new Set},j=(n,e,t,s)=>{const a=new Map,r=new Set,i=[{id:e,depth:0}],o=new Set([e]);for(const d of i)if(!(!s&&d.depth>=1))for(const l of n){const m=t==="outgoing"?l.from:l.to,b=t==="outgoing"?l.to:l.from;m===d.id&&(r.add(l.id),!o.has(b)&&(o.add(b),a.set(b,d.depth+1),i.push({id:b,depth:d.depth+1})))}return{nodes:a,edges:r}},Ss=(n,e)=>{const t=new Map(n.map(r=>[r,j(e,r,"outgoing",!0).nodes])),s=new Set,a=[];for(const r of n){if(s.has(r))continue;const i=n.filter(o=>o===r||t.get(r)?.has(o)===!0&&t.get(o)?.has(r)===!0);for(const o of i)s.add(o);(i.length>1||e.some(o=>o.from===r&&o.to===r))&&a.push(i)}return a},ke=n=>new Map(n.flatMap((e,t)=>e.map(s=>[s,t]))),He=(n,e)=>e.get(n.from)===e.get(n.to)&&e.has(n.from),Ue=n=>{try{return n.split("/").map(e=>decodeURIComponent(e))}catch{return null}},Be=(n,e,t,s)=>{const a=e!==null&&e.kind===t&&e.id===n,r=t==="node"?s.nodes.has(n):s.edges.has(n),i=t==="node"?s.nodes.get(n)??null:null;return{selected:a,related:r&&!a,dimmed:e!==null&&!a&&!r,depth:i}},X=(...n)=>n.filter(e=>typeof e=="string"&&e!=="").join(" "),Ms=n=>{const e=n[0]??{x:0,y:0},t=n.at(-1)??e;if(n.length<=2)return{x:(e.x+t.x)/2,y:(e.y+t.y)/2};if(n.length===4){const r=n[1]??e,i=n[2]??t;return{x:r.x,y:(r.y+i.y)/2}}const s=n[2]??e,a=n[3]??t;return{x:(s.x+a.x)/2,y:s.y}},Cs=(n,e)=>$s(n).map(t=>({tag:t.tag,count:t.count,selected:e.active.includes(t.tag)})),qs=(n,e,t)=>`${n} ${t.node} \xB7 ${e} ${t.edge}`,W=[Nt,_t,Vt,_`
|
|
1
|
+
import{_ as N,Z as Nt,k as _t,$ as Yt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a5 as Vt,a6 as Wt,A as Gt,a7 as Kt,a8 as Xt,a9 as Y,aa as E,ab as f,ac as z,ad as p,ae as U,af as $,ag as S,ah as Q,ai as Zt,aj as Ee,ak as De,al as ge,am as fe,an as be,ao as Jt,ap as ze,m as Te,aq as Qt,ar as es,as as ts,r as ss,s as as}from"./shared-CwbzACTe.js";import{i as rs}from"./shared-CKG_SQh5.js";import{P as ns,p as is,r as os,c as ds}from"./shared-CPAT0Cgk.js";import{c as de}from"./shared-ml5h7U5L.js";const ls='script[type="application/json"]',Ae=(a,e)=>{const t=a.querySelector(ls);if(!t)return null;const s=t.textContent??"";if(s.trim()==="")return{ok:!1,error:"JSON block is empty"};try{return{ok:!0,value:e(JSON.parse(s))}}catch(r){return{ok:!1,error:r instanceof Error?r.message:String(r)}}},cs=(a,e,t)=>{const s=Ae(a,e);if(s)return t(s),()=>{};const r=new MutationObserver(()=>{const i=Ae(a,e);i&&(r.disconnect(),t(i))});return r.observe(a,{childList:!0,subtree:!0}),()=>r.disconnect()},Le={nodeSpacing:34,layerSpacing:84,padding:28,sweeps:4,coordinatePasses:6},le=a=>{const e=[...a].sort((s,r)=>s-r);if(e.length===0)return 0;const t=Math.floor(e.length/2);return e.length%2===1?e[t]??0:((e[t-1]??0)+(e[t]??0))/2},ps=(a,e)=>{const t=new Map;for(const n of a)t.set(n.id,[]);for(const n of e)t.get(n.from)?.push(n);const s=new Map,r=new Set,i=n=>{s.set(n,"open");for(const o of t.get(n)??[]){const d=s.get(o.to)??"new";d==="open"?r.add(o.id):d==="new"&&i(o.to)}s.set(n,"done")};for(const n of a)(s.get(n.id)??"new")==="new"&&i(n.id);return{reversed:r,forward:e.filter(n=>!r.has(n.id))}},hs=(a,e)=>{const t=new Map,s=new Map;for(const o of a)t.set(o.id,[]),s.set(o.id,[]);for(const o of e)s.get(o.from)?.push(o),t.get(o.to)?.push(o);const r=new Map(a.map(o=>[o.id,0])),i=new Map(a.map(o=>[o.id,(t.get(o.id)??[]).length])),n=a.filter(o=>(i.get(o.id)??0)===0).map(o=>o.id);for(const o of n)for(const d of s.get(o)??[]){const l=r.get(d.to)??0;r.set(d.to,Math.max(l,(r.get(o)??0)+1));const m=(i.get(d.to)??0)-1;i.set(d.to,m),m===0&&n.push(d.to)}return r},us=(a,e,t,s)=>{const r=[...a.keys()].sort((i,n)=>i-n);for(let i=0;i<s;i++){const n=i%2===0;for(const o of n?r:[...r].reverse()){const d=a.get(o)??[],l=new Map(d.map((c,h)=>[c,h])),m=c=>{const h=l.get(c);return h===void 0?null:h},b=d.map(c=>{const h=(e.get(c)??[]).filter(M=>(t.get(M)??o)===o+(n?-1:1)).map(m).filter(M=>M!==null);return{id:c,want:h.length>0?le(h):l.get(c)??0}});b.sort((c,h)=>c.want-h.want||(l.get(c.id)??0)-(l.get(h.id)??0)),a.set(o,b.map(c=>c.id))}}},Oe=(a,e,t,s)=>{const r=a.map((n,o)=>({id:n,want:t.get(n)??o*100,index:o}));r.sort((n,o)=>n.want-o.want||n.index-o.index);let i=0;for(const n of r){const o=e.get(n.id);o&&(o.y=i,i+=o.spec.height+s)}return{height:Math.max(0,i-s)}},ms=(a,e,t,s,r)=>{const i=[...a.keys()].sort((l,m)=>l-m),n=new Map;for(const l of i)n.set(l,Oe(a.get(l)??[],e,new Map,r.nodeSpacing).height);const o=Math.max(0,...n.values());for(const l of i){const m=(o-(n.get(l)??0))/2;for(const b of a.get(l)??[]){const c=e.get(b);c&&(c.y+=m)}}const d=(l,m)=>{const b=(t.get(l)??[]).filter(c=>s.get(c)===m).flatMap(c=>{const h=e.get(c);return h?[h.y+h.spec.height/2]:[]});return b.length>0?le(b):null};for(let l=0;l<r.coordinatePasses;l++){const m=l%2===0;for(const b of m?i:[...i].reverse()){const c=a.get(b)??[],h=new Map;for(const C of c){const T=d(C,b+(m?-1:1)),O=e.get(C);O!==void 0&&h.set(C,T===null?O.y+O.spec.height/2:T)}const M=c.map(C=>e.get(C)?.y??0);Oe(c,e,h,r.nodeSpacing);const v=c.map(C=>e.get(C)?.y??0),k=le(M)-le(v);for(const C of c){const T=e.get(C);T&&(T.y+=k)}}}},Re=(a,e,t)=>{const s=e===void 0?void 0:a.spec.ports?.[e];return s?{x:a.x+s.x,y:a.y+s.y}:t==="out"?{x:a.x+a.spec.width,y:a.y+a.spec.height/2}:{x:a.x,y:a.y+a.spec.height/2}},Ie=(a,e,t)=>{let s=0;const r=[];for(const i of a){const n=t.byId.get(i.from),o=t.byId.get(i.to);if(!n||!o)continue;const d=Re(n,i.fromPort,"out"),l=Re(o,i.toPort,"in");if(i.from===i.to){const M=n.x+n.spec.width,v=n.y+n.spec.height,k=Math.max(t.padding/2,v+18);r.push({id:i.id,points:[d,{x:M+20,y:d.y},{x:M+20,y:k},{x:n.x-20,y:k},{x:n.x-20,y:l.y},l]});continue}if(!e.has(i.id)&&(n.layer<o.layer||n.layer===o.layer&&l.x>d.x+12)){if(Math.abs(d.y-l.y)<.5){r.push({id:i.id,points:[d,l]});continue}const v=n.layer<o.layer?Math.max(d.x+14,o.x-Math.max(12,t.layerSpacing/2)):(d.x+l.x)/2;r.push({id:i.id,points:[d,{x:v,y:d.y},{x:v,y:l.y},l]});continue}const m=i.fromPort===void 0?{x:n.x+n.spec.width/2,y:n.y+n.spec.height}:d,b=i.toPort===void 0?{x:o.x+o.spec.width/2,y:o.y+o.spec.height}:l,c=Math.max(m.y,b.y)+18+s*14;s+=1;const h=[d,m,{x:m.x,y:c},{x:b.x,y:c},b,l].filter((M,v,k)=>v===0||M.x!==k[v-1]?.x||M.y!==k[v-1]?.y);r.push({id:i.id,points:h})}return r},Pe=(a,e,t)=>{const s=e.flatMap(c=>[...c.points]),r=[...a.map(c=>c.x),...a.map(c=>c.x+c.spec.width),...s.map(c=>c.x)],i=[...a.map(c=>c.y),...a.map(c=>c.y+c.spec.height),...s.map(c=>c.y)],n=Math.min(0,...r),o=Math.min(0,...i),d=Math.max(0,...r),l=Math.max(0,...i),m=t-n,b=t-o;return{width:d-n+t*2,height:l-o+t*2,nodes:a.map(c=>({id:c.spec.id,x:c.x+m,y:c.y+b,width:c.spec.width,height:c.spec.height,layer:c.layer,order:c.order})),routes:e.map(c=>({id:c.id,points:c.points.map(h=>({x:h.x+m,y:h.y+b}))}))}},je=(a,e)=>{const t=new Map(a.map(s=>[s.id,[]]));for(const s of e)s.from!==s.to&&(t.get(s.from)?.push(s.to),t.get(s.to)?.push(s.from));return t},Fe=(a,e,t,s)=>a.map(r=>({spec:r,layer:e.get(r.id)??0,order:t.get(r.id)??0,...s(r)})),gs=(a,e)=>{const t=new Map;for(const s of a){const r=e.get(s.id)??0,i=t.get(r);i?i.push(s.id):t.set(r,[s.id])}return t},fs=(a,e,t={})=>{const s={...Le,...t};if(a.length===0)return{width:0,height:0,nodes:[],routes:[]};const r=new Set(a.map(v=>v.id)),i=e.filter(v=>r.has(v.from)&&r.has(v.to)),{forward:n,reversed:o}=ps(a,i),d=hs(a,n),l=gs(a,d);us(l,je(a,i),d,s.sweeps);const m=new Map;for(const v of l.values())v.forEach((k,C)=>m.set(k,C));const b=Fe(a,d,m,()=>({x:0,y:0})),c=new Map(b.map(v=>[v.spec.id,v]));ms(l,c,je(a,i),d,s);const h=[...l.keys()].sort((v,k)=>v-k);let M=0;for(const v of h){const k=Math.max(...(l.get(v)??[]).map(C=>c.get(C)?.spec.width??0));for(const C of l.get(v)??[]){const T=c.get(C);T&&(T.x=M)}M+=k+s.layerSpacing}return Pe(b,Ie(i,o,{byId:c,layerSpacing:s.layerSpacing,padding:s.padding}),s.padding)},bs=(a,e,t={})=>{const s={...Le,...t};if(a.length===0)return{width:0,height:0,nodes:[],routes:[]};const r=new Set(a.map(d=>d.id)),i=e.filter(d=>r.has(d.from)&&r.has(d.to)),n=Fe(a,new Map,new Map,d=>d.position??{x:0,y:0}),o=new Map(n.map(d=>[d.spec.id,d]));return Pe(n,Ie(i,new Set,{byId:o,layerSpacing:s.layerSpacing,padding:s.padding}),s.padding)},ks=N({en:{tagFilter:"Filter by tag",tagMatch:"Tag matching",clearTags:"Clear",zoomOut:"Zoom out",fit:"Fit to view",zoomIn:"Zoom in",sendFailed:"Could not send. Please try again.",commentOn:a=>`Comment on ${a}`,noMatches:"No matching elements.",maximize:"Maximize",restore:"Restore size",canvas:"Diagram. Arrow keys pan, plus and minus zoom, 0 fits the view.",dataError:"Could not load the diagram data.",nodes:"elements",edges:"relations",change:(a,e)=>`\u201C${a}\u201D \u2192 \u201C${e}\u201D`},ja:{tagFilter:"\u30BF\u30B0\u306E\u7D5E\u308A\u8FBC\u307F",tagMatch:"\u30BF\u30B0\u306E\u4E00\u81F4\u6761\u4EF6",clearTags:"\u89E3\u9664",zoomOut:"\u7E2E\u5C0F",fit:"\u5168\u4F53\u3092\u8868\u793A",zoomIn:"\u62E1\u5927",sendFailed:"\u9001\u4FE1\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u3082\u3046\u4E00\u5EA6\u304A\u8A66\u3057\u304F\u3060\u3055\u3044\u3002",commentOn:a=>`${a}\u306B\u30B3\u30E1\u30F3\u30C8`,noMatches:"\u8A72\u5F53\u3059\u308B\u8981\u7D20\u306F\u3042\u308A\u307E\u305B\u3093\u3002",maximize:"\u6700\u5927\u5316",restore:"\u5143\u306E\u30B5\u30A4\u30BA\u306B\u623B\u3059",canvas:"\u56F3\u3002\u77E2\u5370\u30AD\u30FC\u3067\u30D1\u30F3\u3001\u30D7\u30E9\u30B9\u30FB\u30DE\u30A4\u30CA\u30B9\u3067\u30BA\u30FC\u30E0\u30010\u3067\u5168\u4F53\u8868\u793A\u3002",dataError:"\u56F3\u306E\u30C7\u30FC\u30BF\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F\u3002",nodes:"\u8981\u7D20",edges:"\u95A2\u9023",change:(a,e)=>`\u300C${a}\u300D\u2192\u300C${e}\u300D`}}),xs={active:[],match:"single"},K=(a,e)=>e.active.length===0?!0:e.match==="all"?e.active.every(t=>a.includes(t)):e.active.some(t=>a.includes(t)),vs=(a,e)=>a.active.includes(e)?{...a,active:a.active.filter(t=>t!==e)}:a.match==="single"?{...a,active:[e]}:{...a,active:[...a.active,e]},ys=(a,e)=>({match:e,active:e==="single"&&a.active.length>1?a.active.slice(-1):a.active}),ws=a=>({...a,active:[]}),$s=a=>{const e=new Map;for(const t of a)for(const s of new Set(t))e.set(s,(e.get(s)??0)+1);return[...e].map(([t,s])=>({tag:t,count:s}))},B={nodes:new Map,edges:new Set},j=(a,e,t,s)=>{const r=new Map,i=new Set,n=[{id:e,depth:0}],o=new Set([e]);for(const d of n)if(!(!s&&d.depth>=1))for(const l of a){const m=t==="outgoing"?l.from:l.to,b=t==="outgoing"?l.to:l.from;m===d.id&&(i.add(l.id),!o.has(b)&&(o.add(b),r.set(b,d.depth+1),n.push({id:b,depth:d.depth+1})))}return{nodes:r,edges:i}},Ss=(a,e)=>{const t=new Map(a.map(i=>[i,j(e,i,"outgoing",!0).nodes])),s=new Set,r=[];for(const i of a){if(s.has(i))continue;const n=a.filter(o=>o===i||t.get(i)?.has(o)===!0&&t.get(o)?.has(i)===!0);for(const o of n)s.add(o);(n.length>1||e.some(o=>o.from===i&&o.to===i))&&r.push(n)}return r},ke=a=>new Map(a.flatMap((e,t)=>e.map(s=>[s,t]))),He=(a,e)=>e.get(a.from)===e.get(a.to)&&e.has(a.from),Ue=a=>{try{return a.split("/").map(e=>decodeURIComponent(e))}catch{return null}},Be=(a,e,t,s)=>{const r=e!==null&&e.kind===t&&e.id===a,i=t==="node"?s.nodes.has(a):s.edges.has(a),n=t==="node"?s.nodes.get(a)??null:null;return{selected:r,related:i&&!r,dimmed:e!==null&&!r&&!i,depth:n}},X=(...a)=>a.filter(e=>typeof e=="string"&&e!=="").join(" "),Ms=a=>{const e=a[0]??{x:0,y:0},t=a.at(-1)??e;if(a.length<=2)return{x:(e.x+t.x)/2,y:(e.y+t.y)/2};if(a.length===4){const i=a[1]??e,n=a[2]??t;return{x:i.x,y:(i.y+n.y)/2}}const s=a[2]??e,r=a[3]??t;return{x:(s.x+r.x)/2,y:s.y}},Cs=(a,e)=>$s(a).map(t=>({tag:t.tag,count:t.count,selected:e.active.includes(t.tag)})),qs=(a,e,t)=>`${a} ${t.node} \xB7 ${e} ${t.edge}`,V=[Nt,_t,Yt,_`
|
|
2
2
|
:host {
|
|
3
3
|
display: block;
|
|
4
4
|
container-type: inline-size;
|
|
@@ -14,6 +14,7 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
14
14
|
border: 1px solid var(--dpk-rule);
|
|
15
15
|
border-radius: var(--dpk-radius-lg);
|
|
16
16
|
background: var(--dpk-paper-raised);
|
|
17
|
+
box-shadow: var(--dpk-bevel), var(--dpk-shadow-sm);
|
|
17
18
|
overflow: hidden;
|
|
18
19
|
resize: vertical;
|
|
19
20
|
}
|
|
@@ -37,6 +38,14 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
37
38
|
border: 0;
|
|
38
39
|
border-radius: 0;
|
|
39
40
|
color: var(--dpk-ink);
|
|
41
|
+
background:
|
|
42
|
+
radial-gradient(
|
|
43
|
+
ellipse 900px 400px at 0% 0%,
|
|
44
|
+
color-mix(in srgb, var(--dpk-accent) 4%, transparent),
|
|
45
|
+
transparent 70%
|
|
46
|
+
),
|
|
47
|
+
var(--dpk-paper-raised);
|
|
48
|
+
box-shadow: none;
|
|
40
49
|
resize: none;
|
|
41
50
|
}
|
|
42
51
|
|
|
@@ -49,17 +58,20 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
49
58
|
align-items: center;
|
|
50
59
|
gap: 10px;
|
|
51
60
|
flex-wrap: wrap;
|
|
52
|
-
min-height:
|
|
53
|
-
padding:
|
|
61
|
+
min-height: 44px;
|
|
62
|
+
padding: 8px 14px;
|
|
54
63
|
border-bottom: 1px solid var(--dpk-rule);
|
|
55
64
|
background: linear-gradient(180deg, var(--dpk-paper-raised), var(--dpk-paper));
|
|
65
|
+
box-shadow: 0 1px 0 var(--dpk-highlight) inset;
|
|
56
66
|
flex-shrink: 0;
|
|
57
67
|
}
|
|
58
68
|
|
|
59
69
|
.diagram-title {
|
|
70
|
+
font-family: var(--dpk-display);
|
|
60
71
|
font-size: 12.5px;
|
|
61
|
-
font-weight:
|
|
62
|
-
letter-spacing: -0.
|
|
72
|
+
font-weight: 660;
|
|
73
|
+
letter-spacing: -0.015em;
|
|
74
|
+
color: var(--dpk-ink);
|
|
63
75
|
}
|
|
64
76
|
|
|
65
77
|
.diagram-subject {
|
|
@@ -72,7 +84,7 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
72
84
|
.diagram-toolbar-actions {
|
|
73
85
|
display: flex;
|
|
74
86
|
align-items: center;
|
|
75
|
-
gap:
|
|
87
|
+
gap: 6px;
|
|
76
88
|
margin-left: auto;
|
|
77
89
|
flex-wrap: wrap;
|
|
78
90
|
}
|
|
@@ -80,6 +92,11 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
80
92
|
.diagram-stats {
|
|
81
93
|
font-family: var(--dpk-mono);
|
|
82
94
|
font-size: 10px;
|
|
95
|
+
font-weight: 550;
|
|
96
|
+
padding: 3px 9px;
|
|
97
|
+
border: 1px solid var(--dpk-rule);
|
|
98
|
+
border-radius: 999px;
|
|
99
|
+
background: var(--dpk-paper-sunken);
|
|
83
100
|
color: var(--dpk-ink-faint);
|
|
84
101
|
font-variant-numeric: tabular-nums;
|
|
85
102
|
white-space: nowrap;
|
|
@@ -88,9 +105,9 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
88
105
|
.diagram-tags {
|
|
89
106
|
display: flex;
|
|
90
107
|
align-items: center;
|
|
91
|
-
gap:
|
|
108
|
+
gap: 5px;
|
|
92
109
|
flex-wrap: wrap;
|
|
93
|
-
padding:
|
|
110
|
+
padding: 7px 12px;
|
|
94
111
|
border-bottom: 1px solid var(--dpk-rule);
|
|
95
112
|
background: var(--dpk-paper);
|
|
96
113
|
flex-shrink: 0;
|
|
@@ -98,40 +115,58 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
98
115
|
|
|
99
116
|
.diagram-match {
|
|
100
117
|
display: flex;
|
|
101
|
-
gap:
|
|
102
|
-
padding:
|
|
103
|
-
margin-right:
|
|
104
|
-
border: 1px solid var(--dpk-rule
|
|
105
|
-
border-radius: var(--dpk-radius-
|
|
118
|
+
gap: 2px;
|
|
119
|
+
padding: 3px;
|
|
120
|
+
margin-right: 6px;
|
|
121
|
+
border: 1px solid var(--dpk-rule);
|
|
122
|
+
border-radius: var(--dpk-radius-sm);
|
|
123
|
+
background: var(--dpk-paper-sunken);
|
|
124
|
+
box-shadow: inset 0 1px 2px var(--dpk-shade-1);
|
|
106
125
|
}
|
|
107
126
|
|
|
108
127
|
.diagram-match button {
|
|
109
128
|
border: 0;
|
|
110
|
-
border-radius:
|
|
111
|
-
padding:
|
|
129
|
+
border-radius: var(--dpk-radius-xs);
|
|
130
|
+
padding: 4px 8px;
|
|
112
131
|
background: transparent;
|
|
113
132
|
color: var(--dpk-ink-faint);
|
|
114
133
|
font-size: 9.5px;
|
|
134
|
+
font-weight: 600;
|
|
135
|
+
letter-spacing: 0.01em;
|
|
115
136
|
cursor: pointer;
|
|
137
|
+
transition:
|
|
138
|
+
background 160ms var(--dpk-ease),
|
|
139
|
+
color 160ms var(--dpk-ease),
|
|
140
|
+
box-shadow 160ms var(--dpk-ease);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.diagram-match button:hover[aria-pressed='false'] {
|
|
144
|
+
color: var(--dpk-ink-soft);
|
|
116
145
|
}
|
|
117
146
|
|
|
118
147
|
.diagram-match button[aria-pressed='true'] {
|
|
119
|
-
background: var(--dpk-
|
|
120
|
-
color: var(--dpk-
|
|
148
|
+
background: var(--dpk-paper-raised);
|
|
149
|
+
color: var(--dpk-ink);
|
|
121
150
|
font-weight: 650;
|
|
151
|
+
box-shadow: var(--dpk-bevel), var(--dpk-shadow-xs);
|
|
122
152
|
}
|
|
123
153
|
|
|
124
154
|
.dpk-tag {
|
|
125
155
|
display: inline-flex;
|
|
126
156
|
align-items: center;
|
|
127
157
|
gap: 5px;
|
|
128
|
-
padding: 4px
|
|
158
|
+
padding: 4px 9px;
|
|
129
159
|
border: 1px solid transparent;
|
|
130
160
|
border-radius: var(--dpk-radius-xs);
|
|
131
161
|
background: var(--dpk-paper-inset);
|
|
132
162
|
color: var(--dpk-ink-soft);
|
|
133
163
|
font-size: 10.5px;
|
|
134
164
|
cursor: pointer;
|
|
165
|
+
transition:
|
|
166
|
+
background 140ms var(--dpk-ease),
|
|
167
|
+
color 140ms var(--dpk-ease),
|
|
168
|
+
border-color 140ms var(--dpk-ease),
|
|
169
|
+
box-shadow 140ms var(--dpk-ease);
|
|
135
170
|
}
|
|
136
171
|
|
|
137
172
|
.dpk-tag:hover {
|
|
@@ -140,10 +175,11 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
140
175
|
}
|
|
141
176
|
|
|
142
177
|
.dpk-tag[aria-pressed='true'] {
|
|
143
|
-
border-color: color-mix(in srgb, var(--dpk-blue)
|
|
178
|
+
border-color: color-mix(in srgb, var(--dpk-blue) 45%, transparent);
|
|
144
179
|
background: var(--dpk-blue-soft);
|
|
145
180
|
color: var(--dpk-blue);
|
|
146
181
|
font-weight: 600;
|
|
182
|
+
box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--dpk-blue) 20%, transparent);
|
|
147
183
|
}
|
|
148
184
|
|
|
149
185
|
.dpk-tag-count {
|
|
@@ -169,9 +205,7 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
169
205
|
overflow: hidden;
|
|
170
206
|
touch-action: none;
|
|
171
207
|
cursor: grab;
|
|
172
|
-
background
|
|
173
|
-
background-image: radial-gradient(var(--dpk-rule-strong) 0.7px, transparent 0.7px);
|
|
174
|
-
background-size: 22px 22px;
|
|
208
|
+
background: var(--dpk-dots), var(--dpk-paper-sunken);
|
|
175
209
|
}
|
|
176
210
|
|
|
177
211
|
.diagram-canvas:focus-visible {
|
|
@@ -204,8 +238,9 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
204
238
|
overflow: hidden;
|
|
205
239
|
border: 1px solid var(--dpk-rule-strong);
|
|
206
240
|
border-radius: var(--dpk-radius-sm);
|
|
207
|
-
background: var(--dpk-
|
|
208
|
-
|
|
241
|
+
background: var(--dpk-glass);
|
|
242
|
+
backdrop-filter: blur(12px);
|
|
243
|
+
box-shadow: var(--dpk-bevel), var(--dpk-shadow-sm);
|
|
209
244
|
}
|
|
210
245
|
|
|
211
246
|
.diagram-zoom button {
|
|
@@ -213,12 +248,26 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
213
248
|
border-radius: 0;
|
|
214
249
|
padding: 6px 9px;
|
|
215
250
|
background: transparent;
|
|
251
|
+
color: var(--dpk-ink-soft);
|
|
216
252
|
font-size: 10.5px;
|
|
217
253
|
cursor: pointer;
|
|
254
|
+
transition:
|
|
255
|
+
background 140ms var(--dpk-ease),
|
|
256
|
+
color 140ms var(--dpk-ease);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
.diagram-zoom button + button {
|
|
260
|
+
border-left: 1px solid var(--dpk-rule);
|
|
218
261
|
}
|
|
219
262
|
|
|
220
263
|
.diagram-zoom button:hover {
|
|
221
|
-
background: var(--dpk-paper-
|
|
264
|
+
background: var(--dpk-paper-inset);
|
|
265
|
+
color: var(--dpk-ink);
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
.diagram-zoom-value {
|
|
269
|
+
font-family: var(--dpk-mono);
|
|
270
|
+
font-variant-numeric: tabular-nums;
|
|
222
271
|
}
|
|
223
272
|
|
|
224
273
|
.diagram-legend {
|
|
@@ -229,9 +278,12 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
229
278
|
gap: 12px;
|
|
230
279
|
flex-wrap: wrap;
|
|
231
280
|
max-width: calc(100% - 150px);
|
|
232
|
-
padding:
|
|
281
|
+
padding: 4px 8px;
|
|
282
|
+
border: 1px solid var(--dpk-rule);
|
|
233
283
|
border-radius: var(--dpk-radius-xs);
|
|
234
|
-
background:
|
|
284
|
+
background: var(--dpk-glass);
|
|
285
|
+
backdrop-filter: blur(10px);
|
|
286
|
+
box-shadow: var(--dpk-shadow-xs);
|
|
235
287
|
font-size: 9.5px;
|
|
236
288
|
color: var(--dpk-ink-faint);
|
|
237
289
|
}
|
|
@@ -254,20 +306,29 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
254
306
|
top: 50%;
|
|
255
307
|
transform: translate(-50%, -50%);
|
|
256
308
|
margin: 0;
|
|
309
|
+
max-width: min(80%, 360px);
|
|
257
310
|
font-size: 12px;
|
|
258
311
|
color: var(--dpk-ink-faint);
|
|
259
312
|
text-align: center;
|
|
260
313
|
pointer-events: none;
|
|
261
314
|
}
|
|
262
315
|
|
|
316
|
+
.diagram-empty {
|
|
317
|
+
padding: 16px 26px;
|
|
318
|
+
border: 1.5px dashed var(--dpk-rule-strong);
|
|
319
|
+
border-radius: var(--dpk-radius);
|
|
320
|
+
background: color-mix(in srgb, var(--dpk-paper-raised) 55%, transparent);
|
|
321
|
+
}
|
|
322
|
+
|
|
263
323
|
.diagram-notice {
|
|
264
324
|
pointer-events: auto;
|
|
265
|
-
padding: 12px 16px;
|
|
266
|
-
border: 1px solid var(--dpk-
|
|
325
|
+
padding: 12px 16px 12px 19px;
|
|
326
|
+
border: 1px solid color-mix(in srgb, var(--dpk-danger) 35%, transparent);
|
|
267
327
|
border-radius: var(--dpk-radius);
|
|
268
|
-
background: var(--dpk-
|
|
269
|
-
box-shadow: var(--dpk-shadow
|
|
328
|
+
background: linear-gradient(90deg, var(--dpk-danger) 0 3px, transparent 3px), var(--dpk-danger-soft);
|
|
329
|
+
box-shadow: var(--dpk-bevel), var(--dpk-shadow);
|
|
270
330
|
color: var(--dpk-ink-soft);
|
|
331
|
+
text-align: left;
|
|
271
332
|
}
|
|
272
333
|
|
|
273
334
|
.diagram-notice p {
|
|
@@ -289,11 +350,17 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
289
350
|
border-radius: var(--dpk-radius-sm);
|
|
290
351
|
background: var(--dpk-paper-raised);
|
|
291
352
|
color: var(--dpk-ink-soft);
|
|
292
|
-
box-shadow: var(--dpk-shadow-xs);
|
|
353
|
+
box-shadow: var(--dpk-bevel), var(--dpk-shadow-xs);
|
|
293
354
|
cursor: pointer;
|
|
294
355
|
opacity: 0;
|
|
295
356
|
pointer-events: none;
|
|
296
|
-
transition:
|
|
357
|
+
transition:
|
|
358
|
+
opacity 120ms ease,
|
|
359
|
+
background 160ms var(--dpk-ease),
|
|
360
|
+
color 160ms var(--dpk-ease),
|
|
361
|
+
border-color 160ms var(--dpk-ease),
|
|
362
|
+
box-shadow 160ms var(--dpk-ease),
|
|
363
|
+
transform 160ms var(--dpk-ease-spring);
|
|
297
364
|
}
|
|
298
365
|
|
|
299
366
|
.diagram-comment-trigger.is-placed {
|
|
@@ -325,6 +392,14 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
325
392
|
.diagram-comment-trigger:focus-visible {
|
|
326
393
|
color: var(--dpk-accent);
|
|
327
394
|
border-color: var(--dpk-accent);
|
|
395
|
+
background: var(--dpk-accent-soft);
|
|
396
|
+
box-shadow: var(--dpk-bevel), var(--dpk-shadow-sm);
|
|
397
|
+
transform: translateY(-1px);
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
.diagram-comment-trigger:focus-visible {
|
|
401
|
+
outline: none;
|
|
402
|
+
box-shadow: var(--dpk-focus);
|
|
328
403
|
}
|
|
329
404
|
|
|
330
405
|
@media (hover: none) {
|
|
@@ -351,8 +426,10 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
351
426
|
cursor: pointer;
|
|
352
427
|
transition:
|
|
353
428
|
opacity 150ms ease,
|
|
354
|
-
border-color
|
|
355
|
-
box-shadow
|
|
429
|
+
border-color 160ms var(--dpk-ease),
|
|
430
|
+
box-shadow 160ms var(--dpk-ease),
|
|
431
|
+
background 160ms var(--dpk-ease),
|
|
432
|
+
transform 160ms var(--dpk-ease);
|
|
356
433
|
}
|
|
357
434
|
|
|
358
435
|
.d-node.is-dimmed,
|
|
@@ -378,12 +455,16 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
378
455
|
stroke: var(--dpk-rule-strong);
|
|
379
456
|
stroke-width: 1.5;
|
|
380
457
|
stroke-linejoin: round;
|
|
458
|
+
stroke-linecap: round;
|
|
459
|
+
transition:
|
|
460
|
+
stroke 160ms var(--dpk-ease),
|
|
461
|
+
stroke-width 160ms var(--dpk-ease);
|
|
381
462
|
}
|
|
382
463
|
|
|
383
464
|
.d-edge.is-selected .d-edge-path,
|
|
384
465
|
.d-edge:focus-visible .d-edge-path {
|
|
385
466
|
stroke: var(--dpk-ink);
|
|
386
|
-
stroke-width: 2.
|
|
467
|
+
stroke-width: 2.6;
|
|
387
468
|
}
|
|
388
469
|
|
|
389
470
|
.d-edge:focus-visible .d-edge-hit {
|
|
@@ -408,9 +489,9 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
408
489
|
display: none;
|
|
409
490
|
}
|
|
410
491
|
}
|
|
411
|
-
`],ee=
|
|
492
|
+
`],ee=a=>a.map((e,t)=>`${t===0?"M":"L"}${e.x} ${e.y}`).join(" "),Ne=a=>I`
|
|
412
493
|
<defs>
|
|
413
|
-
${
|
|
494
|
+
${a.map(e=>I`
|
|
414
495
|
<marker
|
|
415
496
|
id=${e.id}
|
|
416
497
|
viewBox="0 0 10 10"
|
|
@@ -430,40 +511,40 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
430
511
|
</marker>
|
|
431
512
|
`)}
|
|
432
513
|
</defs>
|
|
433
|
-
`,Es=(
|
|
434
|
-
<div class="diagram-tags" role="group" aria-label=${
|
|
435
|
-
<div class="diagram-match" role="group" aria-label=${
|
|
436
|
-
${[["single","Single"],["all","AND"],["any","OR"]].map(([
|
|
514
|
+
`,Es=(a,e,t,s)=>g`
|
|
515
|
+
<div class="diagram-tags" role="group" aria-label=${a.tagFilter}>
|
|
516
|
+
<div class="diagram-match" role="group" aria-label=${a.tagMatch}>
|
|
517
|
+
${[["single","Single"],["all","AND"],["any","OR"]].map(([r,i])=>g`
|
|
437
518
|
<button
|
|
438
519
|
type="button"
|
|
439
|
-
data-match=${
|
|
440
|
-
aria-pressed=${t===
|
|
441
|
-
@click=${()=>s({kind:"match",match:
|
|
520
|
+
data-match=${r}
|
|
521
|
+
aria-pressed=${t===r?"true":"false"}
|
|
522
|
+
@click=${()=>s({kind:"match",match:r})}
|
|
442
523
|
>
|
|
443
|
-
${
|
|
524
|
+
${i}
|
|
444
525
|
</button>
|
|
445
526
|
`)}
|
|
446
527
|
</div>
|
|
447
|
-
${me(e,
|
|
528
|
+
${me(e,r=>r.tag,r=>g`
|
|
448
529
|
<button
|
|
449
530
|
type="button"
|
|
450
531
|
class="dpk-tag"
|
|
451
|
-
data-tag=${
|
|
452
|
-
aria-pressed=${
|
|
453
|
-
@click=${()=>s({kind:"tag",tag:
|
|
532
|
+
data-tag=${r.tag}
|
|
533
|
+
aria-pressed=${r.selected?"true":"false"}
|
|
534
|
+
@click=${()=>s({kind:"tag",tag:r.tag})}
|
|
454
535
|
>
|
|
455
|
-
${
|
|
536
|
+
${r.tag}<span class="dpk-tag-count">${r.count}</span>
|
|
456
537
|
</button>
|
|
457
538
|
`)}
|
|
458
|
-
${e.some(
|
|
459
|
-
${
|
|
539
|
+
${e.some(r=>r.selected)?g`<button type="button" class="dpk-tag-clear" @click=${()=>s({kind:"clear-tags"})}>
|
|
540
|
+
${a.clearTags}
|
|
460
541
|
</button>`:w}
|
|
461
542
|
</div>
|
|
462
|
-
`,Ds=(
|
|
543
|
+
`,Ds=(a,e)=>g`
|
|
463
544
|
<div class="diagram-zoom">
|
|
464
545
|
<button
|
|
465
546
|
type="button"
|
|
466
|
-
aria-label=${
|
|
547
|
+
aria-label=${a.zoomOut}
|
|
467
548
|
@click=${t=>{t.stopPropagation(),e?.({kind:"zoom",factor:1/1.1})}}
|
|
468
549
|
>
|
|
469
550
|
−
|
|
@@ -471,21 +552,21 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
471
552
|
<button
|
|
472
553
|
type="button"
|
|
473
554
|
class="diagram-zoom-value"
|
|
474
|
-
title=${
|
|
475
|
-
aria-label=${
|
|
555
|
+
title=${a.fit}
|
|
556
|
+
aria-label=${a.fit}
|
|
476
557
|
@click=${()=>e?.({kind:"fit"})}
|
|
477
558
|
>
|
|
478
559
|
100%
|
|
479
560
|
</button>
|
|
480
561
|
<button
|
|
481
562
|
type="button"
|
|
482
|
-
aria-label=${
|
|
563
|
+
aria-label=${a.zoomIn}
|
|
483
564
|
@click=${t=>{t.stopPropagation(),e?.({kind:"zoom",factor:1.1})}}
|
|
484
565
|
>
|
|
485
566
|
+
|
|
486
567
|
</button>
|
|
487
568
|
</div>
|
|
488
|
-
`,xe=.08,zs=1.8,Ts=
|
|
569
|
+
`,xe=.08,zs=1.8,Ts=a=>{if(a.length===0)return{x:0,y:0,width:0,height:0};const e=Math.min(...a.map(i=>i.x)),t=Math.min(...a.map(i=>i.y)),s=Math.max(...a.map(i=>i.x+i.width))-e,r=Math.max(...a.map(i=>i.y+i.height))-t;return{x:e-s*.1,y:t-r*.1,width:s*1.2,height:r*1.2}},ve=(a,e)=>a+e/12,ye=16,_e=(a,e,t,s,r="center")=>{if(e.width===0||e.height===0)return{...a,x:0,y:0};const i=(n,o,d,l)=>{const m=d*a.scale;return m<=l?r==="start"?ye-ve(o,d)*a.scale:(l-m)/2-o*a.scale:Math.min(-o*a.scale,Math.max(l-(o+d)*a.scale,n))};return{...a,x:i(a.x,e.x,e.width,t),y:i(a.y,e.y,e.height,s)}},As=(a,e,t,s,r,i,n="center")=>{const o=_e({...a,x:a.x-r,y:a.y-i},e,t,s,n);return Math.abs(i)>Math.abs(r)&&o.y===a.y?null:o},Ye='button,[role="button"],a,input,textarea,select',Ls=a=>{const{canvas:e,world:t,onClearSelection:s,onView:r,align:i="center"}=a;let n={x:0,y:0,width:0,height:0},o={x:0,y:0,scale:1};const d=()=>({width:e.clientWidth||1e3,height:e.clientHeight||560}),l=()=>{const{width:u,height:y}=d();o=_e(o,n,u,y,i),t.style.transform=`translate(${o.x}px, ${o.y}px) scale(${o.scale})`,r?.(o)},m=()=>{const{width:u,height:y}=d(),q=n.width/1.2||1,L=n.height/1.2||1;o={...o,scale:de(Math.min((u-24)/q,(y-40)/L),xe,1)},o={...o,x:(u-n.width*o.scale)/2-n.x*o.scale,y:(y-n.height*o.scale)/2-n.y*o.scale},l()},b=()=>{const{width:u}=d(),y=n.width/1.2||1,q=de((u-24)/y,xe,1);o={scale:q,x:(u-n.width*q)/2-n.x*q,y:16},l()},c=()=>{o={scale:1,x:ye-ve(n.x,n.width),y:ye-ve(n.y,n.height)},l()},h=(u,y=d().width/2,q=d().height/2)=>{const L=o.scale,R=de(L*u,xe,zs);R!==L&&(o={scale:R,x:y-(y-o.x)*R/L,y:q-(q-o.y)*R/L},l())},M=u=>{if(u.target instanceof Element&&u.target.closest(".diagram-zoom"))return;const y=u.deltaMode===1?16:u.deltaMode===2?d().height:1;if(u.ctrlKey||u.metaKey){u.preventDefault();const G=e.getBoundingClientRect();h(Math.exp(-de(u.deltaY*y,-60,60)*.0012),u.clientX-G.left,u.clientY-G.top);return}const{width:q,height:L}=d(),R=As(o,n,q,L,u.deltaX*y,u.deltaY*y,i);R!==null&&(u.preventDefault(),o=R,l())},v=new Map;let k=null,C=!1;const T=()=>{const u=[...v.values()],y=u[0];if(!y)return null;const q=u[1];return q?{x:(y.x+q.x)/2,y:(y.y+q.y)/2,distance:Math.hypot(q.x-y.x,q.y-y.y)}:{...y,distance:0}},O=u=>{v.size===0&&(C=!1);const q=(u.target instanceof Element?u.target:null)?.closest(Ye)??null;u.button!==0||u.pointerType!=="touch"&&q!==null||(v.set(u.pointerId,{x:u.clientX,y:u.clientY}),k=T(),q===null&&e.setPointerCapture(u.pointerId))},P=u=>{if(!v.has(u.pointerId)||k===null)return;v.set(u.pointerId,{x:u.clientX,y:u.clientY});const y=T();if(y===null)return;const q=y.x-k.x,L=y.y-k.y;if((Math.abs(q)+Math.abs(L)>1||Math.abs(y.distance-k.distance)>1)&&(C=!0),y.distance>0&&k.distance>0){const R=e.getBoundingClientRect();h(Math.pow(y.distance/k.distance,.45),k.x-R.left,k.y-R.top)}o={...o,x:o.x+q,y:o.y+L},l(),k=y,e.classList.toggle("is-panning",C)},F=u=>{v.delete(u.pointerId),k=T(),!(v.size>0)&&(e.classList.remove("is-panning"),u.type==="pointercancel"&&(C=!1))},oe=u=>{C&&(u.preventDefault(),u.stopPropagation()),F(u)},x=u=>{if(C){u.preventDefault(),u.stopPropagation(),C=!1;return}const y=u.target instanceof Element?u.target:null;y===null||y.closest(Ye)!==null||s()},D=u=>{if(u.target!==e)return;const y=30;if(u.key==="+"||u.key==="=")h(1.1);else if(u.key==="-")h(1/1.1);else if(u.key==="0")m();else if(u.key==="Escape")s();else if(u.key==="ArrowLeft"||u.key==="ArrowRight"||u.key==="ArrowUp"||u.key==="ArrowDown")o={...o,x:o.x+(u.key==="ArrowLeft"?y:u.key==="ArrowRight"?-y:0),y:o.y+(u.key==="ArrowUp"?y:u.key==="ArrowDown"?-y:0)},l();else return;u.preventDefault()},A=u=>{const y=u.target instanceof HTMLElement?u.target:null;if(y===null||!t.contains(y))return;const q=y.getBoundingClientRect(),L=e.getBoundingClientRect();let R=0,G=0;q.left<L.left+12?R=L.left+12-q.left:q.right>L.right-12&&(R=L.right-12-q.right),q.top<L.top+12?G=L.top+12-q.top:q.bottom>L.bottom-40&&(G=L.bottom-40-q.bottom),!(R===0&&G===0)&&(o={...o,x:o.x+R,y:o.y+G},l())};e.addEventListener("wheel",M,{passive:!1}),e.addEventListener("pointerdown",O),e.addEventListener("pointermove",P),e.addEventListener("pointerup",oe),e.addEventListener("pointercancel",F),e.addEventListener("lostpointercapture",F),e.addEventListener("click",x,!0),e.addEventListener("keydown",D),e.addEventListener("focusin",A);const H=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>l());return H?.observe(e),{setContent(u){n=Ts(u.width===0&&u.height===0?[]:[u]),t.style.width=`${u.width}px`,t.style.height=`${u.height}px`,l()},apply:l,fit:m,fitWidth:b,reset:c,zoom:h,view:()=>({...o}),destroy(){H?.disconnect(),e.removeEventListener("wheel",M),e.removeEventListener("pointerdown",O),e.removeEventListener("pointermove",P),e.removeEventListener("pointerup",oe),e.removeEventListener("pointercancel",F),e.removeEventListener("lostpointercapture",F),e.removeEventListener("click",x,!0),e.removeEventListener("keydown",D),e.removeEventListener("focusin",A)}}};class we extends Vt{static{this.styles=V}static{this.properties={data:{attribute:!1},id:{type:String,reflect:!0},heading:{type:String},subject:{type:String}}}#e=null;#s=null;#a=[];#t=[];#r=null;#n=xs;#i=null;#o=null;#l=null;#p=null;#u=-1;#c="";#d=null;#b=null;#h=new Map;#m=null;#g=new Map;#f=null;#v=new ns(this);#k=new Wt(this,()=>{this.#c=""});constructor(){super(),this.id=this.getAttribute("id")??"",this.data=null,this.heading=null,this.subject=null}connectedCallback(){super.connectedCallback(),this.#c="",this.requestUpdate(),this.#p=cs(this,e=>this.parseData(e),e=>{e.ok?this.#S(e.value):this.#L(e.error)})}disconnectedCallback(){super.disconnectedCallback(),this.#p?.(),this.#p=null,this.#o?.destroy(),this.#o=null,this.#l=null}willUpdate(e){e.has("data")&&this.data!==null&&this.#S(this.data)}updated(){this.#q(),this.#y(),this.#E(),this.#D()}#y(){const e=this.renderRoot.querySelector(".diagram");if(!(this.#f===null||!e||typeof e.showPopover!="function")&&!e.matches(":popover-open"))try{e.showPopover()}catch{}}#q(){const e=JSON.stringify([this.commentTargets,this.#t]);e!==this.#c&&(this.#c=e,this.dispatchEvent(new CustomEvent("dpk-comment-targets-change",{bubbles:!0,composed:!0})))}#E(){this.#l=this.renderRoot.querySelector(".diagram-zoom-value");const e=this.renderRoot.querySelector(".diagram-canvas"),t=this.renderRoot.querySelector(".diagram-world");if(!e||!t)return;this.#o??=Ls({canvas:e,world:t,align:this.viewAlign(),onClearSelection:()=>this.#x(null),onView:i=>{this.#l&&(this.#l.textContent=`${Math.round(i.scale*100)}%`),this.dispatchEvent(new CustomEvent("dpk-diagram-view",{detail:{view:i},bubbles:!0,composed:!0})),this.onViewChange(i)}});const s=this.contentSize();if(s===null){this.#o.apply();return}this.#o.setContent({x:0,y:0,width:s.width,height:s.height});const r=this.layoutVersion();r!==this.#u&&(this.#u=r,this.initialView())}#D(){const e=this.#b!==this.#d;this.#b=this.#d;const t=this.renderRoot.querySelector(".comment-pop"),s=this.#M();!t||!s||(this.#v.open(t,s,{width:300,height:280},{placement:"right-start",trackTransform:!0}),e&&t.querySelector("textarea")?.focus({preventScroll:!0}))}get commentTargets(){if(!this.id||this.#r!==null)return[];const e=`${this.subject??this.heading??this.defaultHeading()} \xB7 ${this.id}`;return this.commentItems().map(t=>({...t,group:e}))}commentItems(){return[]}commentRef(e,...t){return`element:${[this.id,e,...t].map(s=>encodeURIComponent(s)).join("/")}`}requestElementComment(e,...t){const s=this.commentRef(e,...t);this.commentTargets.some(r=>r.value===s)&&this.dispatchEvent(new CustomEvent("dpk-comment-request",{detail:{target:s},bubbles:!0,composed:!0}))}get elementActions(){return this.#a}set elementActions(e){this.#a=e,this.#w()}get elementActionResults(){return this.#t}reduceElementActions(e,t){return{data:e,results:t.map(s=>({id:s.id,title:s.type,stale:"unsupported-action-type"}))}}dispatchElementAction(e,t,s){const r=new CustomEvent("dpk-element-action",{detail:{type:e,target:this.commentRef(...t),payload:s},bubbles:!0,composed:!0,cancelable:!0});return this.dispatchEvent(r),r.defaultPrevented}get selection(){return this.#i}select(e){this.#x(e)}get tagFilter(){return this.#n}set tagFilter(e){this.#n=e,this.requestUpdate()}get dataError(){return this.#r}resetView(){this.fitViewport()}#$(e){if(e===(this.#f!==null))return;const t=this.renderRoot.querySelector(".diagram");this.#f=e?{height:t?.offsetHeight??0}:null,this.#d=null,this.requestUpdate()}#z={handleEvent:e=>e.preventDefault(),passive:!1};#T={handleEvent:e=>{e.key!=="Escape"||this.#i!==null||(e.preventDefault(),this.#$(!1))},capture:!0};get locale(){return this.#k.locale}get chromeMessages(){return ks(this.#k.locale)}renderSelection(){const e=this.#d,t=e===null?void 0:this.#g.get(e);if(e===null||t===void 0)return w;const s=is(this.#h.get(e)??"",[],{label:t,...this.#m===e?{error:this.chromeMessages.sendFailed}:{}});return g`${rs(e,os(ds(this.#k.locale),s,r=>this.#A(e,r)))}`}renderCommentTrigger(e,t,s){if(!this.id)return w;const r=this.commentRef(e.kind,e.id);return this.#g.set(r,t),g`<button
|
|
489
570
|
type="button"
|
|
490
571
|
class=${X("diagram-comment-trigger",s&&"is-placed")}
|
|
491
572
|
style=${s?`left:${s.x}px; top:${s.y}px`:w}
|
|
@@ -494,17 +575,17 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
494
575
|
aria-label=${this.chromeMessages.commentOn(t)}
|
|
495
576
|
title=${this.chromeMessages.commentOn(t)}
|
|
496
577
|
aria-haspopup="dialog"
|
|
497
|
-
aria-expanded=${this.#d===
|
|
498
|
-
@click=${()=>{this.#x(e),this.#d=
|
|
578
|
+
aria-expanded=${this.#d===r?"true":"false"}
|
|
579
|
+
@click=${()=>{this.#x(e),this.#d=r,this.requestUpdate()}}
|
|
499
580
|
>
|
|
500
|
-
${
|
|
501
|
-
</button>`}renderEdgeCommentTrigger(e,t,s){const
|
|
581
|
+
${Gt()}
|
|
582
|
+
</button>`}renderEdgeCommentTrigger(e,t,s){const r=Math.floor((s.length-1)/2),i=s[r],n=s[r+1]??i;return!this.id||!i||!n?w:I`<foreignObject
|
|
502
583
|
class="diagram-edge-comment"
|
|
503
|
-
x=${(
|
|
504
|
-
y=${(
|
|
584
|
+
x=${(i.x+n.x)/2-16}
|
|
585
|
+
y=${(i.y+n.y)/2-16}
|
|
505
586
|
width="32"
|
|
506
587
|
height="32"
|
|
507
|
-
>${this.renderCommentTrigger(e,t)}</foreignObject>`}layoutVersion(){return 0}fitViewport(){this.viewport?.fit()}initialView(){this.viewport?.reset()}viewAlign(){return"center"}questionsOf(e){const t=e.questions?.trim();return t===void 0||t===""?w:t}onViewChange(e){}statsText(){return""}tagItems(){return[]}isEmpty(){return this.contentSize()===null}shellClass(){return""}defaultHeading(){return""}defaultSubject(){return""}emptyMessage(){return this.chromeMessages.noMatches}renderToolbarActions(){return w}renderLegend(){return w}renderAboveCanvas(){return w}get viewport(){return this.#o}items(){return this.#s??this.emptyData()}authoredItems(){return this.#e??this.emptyData()}elementClass(e,...t){return X(...t,e.selected&&"is-selected",e.related&&"is-related",e.dimmed&&"is-dimmed")}#S(e){this.#
|
|
588
|
+
>${this.renderCommentTrigger(e,t)}</foreignObject>`}layoutVersion(){return 0}fitViewport(){this.viewport?.fit()}initialView(){this.viewport?.reset()}viewAlign(){return"center"}questionsOf(e){const t=e.questions?.trim();return t===void 0||t===""?w:t}onViewChange(e){}statsText(){return""}tagItems(){return[]}isEmpty(){return this.contentSize()===null}shellClass(){return""}defaultHeading(){return""}defaultSubject(){return""}emptyMessage(){return this.chromeMessages.noMatches}renderToolbarActions(){return w}renderLegend(){return w}renderAboveCanvas(){return w}get viewport(){return this.#o}items(){return this.#s??this.emptyData()}authoredItems(){return this.#e??this.emptyData()}elementClass(e,...t){return X(...t,e.selected&&"is-selected",e.related&&"is-related",e.dimmed&&"is-dimmed")}#S(e){this.#r=null,this.#e=e,this.#w()}#w(){if(this.#e===null){this.#t=this.#a.map(t=>({id:t.id,title:t.type,stale:"target-missing"})),this.requestUpdate();return}const e=this.reduceElementActions(this.#e,this.#a);this.#s=e.data,this.#t=e.results,this.#i!==null&&(this.hasSelection(this.#i)||(this.#i=null,this.#d=null)),this.requestUpdate()}#M(){const e=this.#i;return e?[...this.renderRoot.querySelectorAll("[data-comment-kind]")].find(t=>t.dataset.commentKind===e.kind&&t.dataset.commentId===e.id)??null:null}#A(e,t){if(t.kind==="input"){this.#h=new Map(this.#h).set(e,t.body),this.#m=null,this.requestUpdate();return}if(t.kind==="comment"){if(!!this.dispatchEvent(new CustomEvent("dpk-comment-submit",{detail:{target:e,body:t.body},bubbles:!0,composed:!0,cancelable:!0}))){this.#m=e,this.requestUpdate();return}const i=new Map(this.#h);i.delete(e),this.#h=i}this.#m=null;const s=this.#M();this.#x(null),s?.focus({preventScroll:!0})}#L(e){this.#r=e,this.#e=null,this.#s=null,this.#w(),console.error("[dev-process-kit] invalid diagram data:",e),this.requestUpdate()}hasSelection(e){return!0}#x(e){(e===null?this.#i===null:this.#i!==null&&this.#i.kind===e.kind&&this.#i.id===e.id)||(this.#i=e,this.#d=null,this.dispatchEvent(new CustomEvent("dpk-diagram-select",{detail:{selection:e},bubbles:!0,composed:!0})),this.requestUpdate())}#C=e=>{switch(e.kind){case"tag":this.#n=vs(this.#n,e.tag),this.requestUpdate();return;case"match":this.#n=ys(this.#n,e.match),this.requestUpdate();return;case"clear-tags":this.#n=ws(this.#n),this.requestUpdate();return;case"select":this.#x(e.selection);return;case"zoom":this.#o?.zoom(e.factor);return;case"fit":this.fitViewport();return;default:return}};refreshContent(){}render(){this.#g=new Map,this.refreshContent();const e=Cs(this.tagItems(),this.#n),t=this.#f,s=this.chromeMessages,r=t===null?s.maximize:s.restore;return g`
|
|
508
589
|
${t===null?w:g`<div class="diagram-placeholder" style="height:${t.height}px"></div>`}
|
|
509
590
|
<div
|
|
510
591
|
class=${X("diagram",this.shellClass(),t!==null&&"is-maximized")}
|
|
@@ -521,8 +602,8 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
521
602
|
<button
|
|
522
603
|
type="button"
|
|
523
604
|
class="dpk-icon-btn diagram-maximize"
|
|
524
|
-
aria-label=${
|
|
525
|
-
title=${
|
|
605
|
+
aria-label=${r}
|
|
606
|
+
title=${r}
|
|
526
607
|
aria-pressed=${t===null?"false":"true"}
|
|
527
608
|
@click=${()=>this.#$(t===null)}
|
|
528
609
|
>
|
|
@@ -530,18 +611,18 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
530
611
|
</button>
|
|
531
612
|
</div>
|
|
532
613
|
</div>
|
|
533
|
-
${Es(s,e,this.#
|
|
614
|
+
${Es(s,e,this.#n.match,this.#C)} ${this.renderAboveCanvas()}
|
|
534
615
|
<div class="diagram-canvas" tabindex="0" aria-label=${s.canvas}>
|
|
535
616
|
<div class="diagram-world">${this.renderCanvas()}</div>
|
|
536
617
|
${this.isEmpty()?g`<p class="diagram-empty">${this.emptyMessage()}</p>`:w}
|
|
537
|
-
${this.#
|
|
618
|
+
${this.#r===null?w:g`<p class="diagram-notice" role="alert">${s.dataError}<br />${this.#r}</p>`}
|
|
538
619
|
${this.renderLegend()} ${Ds(s,this.#C)}
|
|
539
620
|
</div>
|
|
540
621
|
${this.renderSelection()}
|
|
541
622
|
</div>
|
|
542
|
-
`}}class te extends we{#e=null;#s="";#
|
|
623
|
+
`}}class te extends we{#e=null;#s="";#a=0;#t=B;commentItems(){const e=this.items();return[...e.nodes.map(t=>({value:this.commentRef("node",t.id),label:t.id})),...e.edges.map(t=>({value:this.commentRef("edge",t.id),label:`${t.from} \u2192 ${t.to} (${t.id})`}))]}get visible(){const e=this.filtered();return{nodes:e.nodes,edges:e.edges}}get layout(){return this.#e}get layoutMode(){return"layered"}get tagDimension(){return"node"}layoutOptions(){return{}}matchesFilter(e){return!0}layoutSignature(){return""}statsLabels(){return{node:this.chromeMessages.nodes,edge:this.chromeMessages.edges}}statsText(){const e=this.filtered();return qs(e.nodes.length,e.edges.length,this.statsLabels())}tagItems(){const e=this.items();return(this.tagDimension==="edge"?e.edges:e.nodes).map(t=>t.tags)}contentSize(){const e=this.#e;return e===null||e.nodes.length===0?null:{width:e.width,height:e.height}}layoutVersion(){return this.#a}hasSelection(e){const t=this.items();return e.kind==="node"?t.nodes.some(s=>s.id===e.id):t.edges.some(s=>s.id===e.id)}placedNode(e){return this.#e?.nodes.find(t=>t.id===e)}routeOf(e){return this.#e?.routes.find(t=>t.id===e)?.points??[]}nodeState(e){return Be(e,this.selection,"node",this.#t)}edgeState(e){return Be(e,this.selection,"edge",this.#t)}renderEdges(e,t){const s=this.#e?.width??0,r=this.#e?.height??0;return g`<svg class="diagram-edges" width=${s} height=${r}>
|
|
543
624
|
${Ne(t)}${e}
|
|
544
|
-
</svg>`}filtered(){const e=this.items();if(this.tagDimension==="edge"){const
|
|
625
|
+
</svg>`}filtered(){const e=this.items();if(this.tagDimension==="edge"){const r=e.edges.filter(n=>K(n.tags,this.tagFilter)&&this.matchesFilter(n)),i=new Set(r.flatMap(n=>[n.from,n.to]));return{...e,edges:r,nodes:e.nodes.filter(n=>i.has(n.id))}}const t=e.nodes.filter(r=>K(r.tags,this.tagFilter)&&this.matchesFilter(r)),s=new Set(t.map(r=>r.id));return{...e,nodes:t,edges:e.edges.filter(r=>s.has(r.from)&&s.has(r.to))}}refreshContent(){const e=this.filtered(),t=[this.layoutMode,e.nodes.map(s=>`${s.id}:${s.width}x${s.height}`).join(","),e.edges.map(s=>`${s.id}:${s.from}>${s.to}`).join(","),this.layoutSignature()].join("|");t!==this.#s&&(this.#s=t,this.#a+=1,this.#e=this.computePlacement(e)),this.#t=this.relations(this.selection,e)}computePlacement(e){const t=e.nodes.map(i=>({id:i.id,width:i.width,height:i.height,...i.ports===void 0?{}:{ports:i.ports},...i.position===void 0?{}:{position:i.position}})),s=e.edges.map(i=>({id:i.id,from:i.from,to:i.to,...i.fromPort===void 0?{}:{fromPort:i.fromPort},...i.toPort===void 0?{}:{toPort:i.toPort}})),r=this.layoutOptions();return this.layoutMode==="fixed"?bs(t,s,r):fs(t,s,r)}}const ce=N({en:{heading:"State machine",node:"State",edge:"Transition",empty:"No matching transitions.",transitionLabel:(a,e,t)=>`${t} from ${a} to ${e}`},ja:{heading:"\u30B9\u30C6\u30FC\u30C8\u30DE\u30B7\u30F3",node:"\u72B6\u614B",edge:"\u9077\u79FB",empty:"\u8A72\u5F53\u3059\u308B\u9077\u79FB\u306F\u3042\u308A\u307E\u305B\u3093\u3002",transitionLabel:(a,e,t)=>`${a} \u304B\u3089 ${e} \u3078\u306E ${t}`}}),Os=E({x:Q(),y:Q()}),Rs=E({id:$(p(),S(1)),name:$(p(),S(1)),code:f(p()),kind:f(U(["normal","initial","terminal","compensation"]),"normal"),description:f(p()),position:f(Os),questions:f(p())}),Is=E({id:$(p(),S(1)),from:$(p(),S(1)),to:$(p(),S(1)),title:$(p(),S(1)),kind:f(U(["normal","exception"]),"normal"),tags:f(z(p()),[]),guard:f(p()),effect:f(p()),questions:f(p())}),Ve={width:178,height:86},Ps=()=>({nodes:[],edges:[]}),js=E({states:z(Rs),transitions:f(z(Is),[])}),We=a=>{const e=Y(js,a),t=new Set;for(const n of e.states){if(t.has(n.id))throw new Error(`duplicate state id: ${n.id}`);t.add(n.id)}const s=new Set,r=e.transitions.map(n=>{if(s.has(n.id))throw new Error(`duplicate transition id: ${n.id}`);if(s.add(n.id),!t.has(n.from))throw new Error(`unknown transition source: ${n.from}`);if(!t.has(n.to))throw new Error(`unknown transition target: ${n.to}`);return{id:n.id,from:n.from,to:n.to,title:n.title,kind:n.kind,tags:n.tags,guard:n.guard??null,effect:n.effect??null,...n.questions===void 0?{}:{questions:n.questions}}});return{nodes:e.states.map(n=>({id:n.id,name:n.name,code:n.code??null,kind:n.kind,description:n.description??null,width:Ve.width,height:Ve.height,tags:[],...n.position===void 0?{}:{position:n.position},...n.questions===void 0?{}:{questions:n.questions}})),edges:r}},Fs=a=>a.length>0&&a.every(e=>e.position!==void 0),Hs=_`
|
|
545
626
|
.state-node {
|
|
546
627
|
display: flex;
|
|
547
628
|
flex-direction: column;
|
|
@@ -551,13 +632,19 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
551
632
|
border: 1px solid var(--dpk-rule-strong);
|
|
552
633
|
border-radius: var(--dpk-radius);
|
|
553
634
|
background: var(--dpk-paper-raised);
|
|
554
|
-
box-shadow: var(--dpk-shadow-xs);
|
|
635
|
+
box-shadow: var(--dpk-bevel), var(--dpk-shadow-xs);
|
|
555
636
|
text-align: left;
|
|
556
637
|
overflow: hidden;
|
|
638
|
+
transition:
|
|
639
|
+
border-color 160ms var(--dpk-ease),
|
|
640
|
+
box-shadow 160ms var(--dpk-ease),
|
|
641
|
+
transform 160ms var(--dpk-ease);
|
|
557
642
|
}
|
|
558
643
|
|
|
559
644
|
.state-node:hover {
|
|
560
645
|
border-color: var(--dpk-blue);
|
|
646
|
+
box-shadow: var(--dpk-bevel), var(--dpk-shadow-sm);
|
|
647
|
+
transform: translateY(-1px);
|
|
561
648
|
}
|
|
562
649
|
|
|
563
650
|
.state-node.is-initial {
|
|
@@ -575,7 +662,10 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
575
662
|
|
|
576
663
|
.state-node.is-selected {
|
|
577
664
|
border-color: var(--dpk-blue);
|
|
578
|
-
box-shadow:
|
|
665
|
+
box-shadow:
|
|
666
|
+
var(--dpk-bevel),
|
|
667
|
+
var(--dpk-shadow-sm),
|
|
668
|
+
0 0 0 3px var(--dpk-blue-soft);
|
|
579
669
|
}
|
|
580
670
|
|
|
581
671
|
.state-node.is-related {
|
|
@@ -626,11 +716,18 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
626
716
|
overflow: hidden;
|
|
627
717
|
text-overflow: ellipsis;
|
|
628
718
|
cursor: pointer;
|
|
719
|
+
box-shadow: var(--dpk-shadow-xs);
|
|
720
|
+
transition:
|
|
721
|
+
border-color 160ms var(--dpk-ease),
|
|
722
|
+
background 160ms var(--dpk-ease),
|
|
723
|
+
color 160ms var(--dpk-ease),
|
|
724
|
+
box-shadow 160ms var(--dpk-ease);
|
|
629
725
|
}
|
|
630
726
|
|
|
631
727
|
.state-label:hover {
|
|
632
728
|
border-color: color-mix(in srgb, var(--dpk-blue) 40%, transparent);
|
|
633
729
|
color: var(--dpk-blue);
|
|
730
|
+
box-shadow: var(--dpk-shadow-sm);
|
|
634
731
|
}
|
|
635
732
|
|
|
636
733
|
.state-label.is-selected {
|
|
@@ -638,6 +735,9 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
638
735
|
background: var(--dpk-blue-soft);
|
|
639
736
|
color: var(--dpk-blue);
|
|
640
737
|
font-weight: 600;
|
|
738
|
+
box-shadow:
|
|
739
|
+
var(--dpk-shadow-xs),
|
|
740
|
+
inset 0 0 0 1px color-mix(in srgb, var(--dpk-blue) 20%, transparent);
|
|
641
741
|
}
|
|
642
742
|
|
|
643
743
|
.state-label.is-dimmed {
|
|
@@ -680,28 +780,28 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
680
780
|
fill: var(--dpk-amber);
|
|
681
781
|
stroke: var(--dpk-amber);
|
|
682
782
|
}
|
|
683
|
-
`,Us=[{id:"state-arrow"},{id:"state-arrow-active"},{id:"state-arrow-exception"}];class
|
|
783
|
+
`,Us=[{id:"state-arrow"},{id:"state-arrow-active"},{id:"state-arrow-exception"}];class Ge extends te{static{this.styles=[V,Hs]}parseData(e){return We(e)}emptyData(){return Ps()}defaultHeading(){return ce(this.locale).heading}statsLabels(){const e=ce(this.locale);return{node:e.node,edge:e.edge}}emptyMessage(){return ce(this.locale).empty}get tagDimension(){return"edge"}get layoutMode(){return Fs(this.filtered().nodes)?"fixed":"layered"}layoutOptions(){return this.layoutMode==="fixed"?{padding:44}:{nodeSpacing:40,layerSpacing:110,padding:44}}relations(e,t){if(e===null||e.kind!=="node")return B;const s=j(t.edges,e.id,"outgoing",!1),r=j(t.edges,e.id,"incoming",!1);return{nodes:new Map([...s.nodes,...r.nodes]),edges:new Set([...s.edges,...r.edges])}}renderCanvas(){const e=this.visible.nodes,t=e.filter(s=>s.kind==="initial").map(s=>this.#a(s));return g`
|
|
684
784
|
${this.renderEdges([...t,...this.visible.edges.map(s=>this.#t(s))],Us)}
|
|
685
|
-
${e.map(s=>this.#
|
|
785
|
+
${e.map(s=>this.#r(s))} ${this.visible.edges.map(s=>this.#n(s))}
|
|
686
786
|
`}#e(e){return this.filtered().nodes.find(t=>t.id===e)?.name??e}#s(e){return[e.guard,e.effect].filter(t=>t!==null).join(`
|
|
687
|
-
`)||e.title}#
|
|
688
|
-
<g class=${X("state-initial-mark",
|
|
787
|
+
`)||e.title}#a(e){const t=this.placedNode(e.id);if(!t)return w;const s=t.y+t.height/2,r=this.nodeState(e.id);return I`
|
|
788
|
+
<g class=${X("state-initial-mark",r.dimmed&&"is-dimmed")}>
|
|
689
789
|
<circle cx=${t.x-22} cy=${s} r="5"></circle>
|
|
690
790
|
<path
|
|
691
791
|
d=${ee([{x:t.x-17,y:s},{x:t.x-1,y:s}])}
|
|
692
792
|
stroke-width="1.6"
|
|
693
793
|
></path>
|
|
694
794
|
</g>
|
|
695
|
-
`}#t(e){const t=ce(this.locale),s=this.edgeState(e.id),
|
|
795
|
+
`}#t(e){const t=ce(this.locale),s=this.edgeState(e.id),r=this.routeOf(e.id),i=ee(r),o=s.selected||s.related?"state-arrow-active":e.kind==="exception"?"state-arrow-exception":"state-arrow",d=()=>this.select({kind:"edge",id:e.id});return I`
|
|
696
796
|
<g
|
|
697
797
|
class=${this.elementClass(s,"d-edge","state-edge",e.kind==="exception"&&"is-exception")}
|
|
698
798
|
data-transition=${e.id}
|
|
699
799
|
>
|
|
700
800
|
<title>${this.#s(e)}</title>
|
|
701
|
-
<path class="d-edge-path" d=${
|
|
801
|
+
<path class="d-edge-path" d=${i} marker-end=${`url(#${o})`}></path>
|
|
702
802
|
<path
|
|
703
803
|
class="d-edge-hit"
|
|
704
|
-
d=${
|
|
804
|
+
d=${i}
|
|
705
805
|
role="button"
|
|
706
806
|
tabindex="0"
|
|
707
807
|
aria-label=${t.transitionLabel(this.#e(e.from),this.#e(e.to),e.title)}
|
|
@@ -709,7 +809,7 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
709
809
|
@keydown=${l=>{l.key!=="Enter"&&l.key!==" "||(l.preventDefault(),d())}}
|
|
710
810
|
></path>
|
|
711
811
|
</g>
|
|
712
|
-
`}#
|
|
812
|
+
`}#r(e){const t=this.placedNode(e.id);if(!t)return w;const s=this.nodeState(e.id);return g`
|
|
713
813
|
<button
|
|
714
814
|
type="button"
|
|
715
815
|
class=${this.elementClass(s,"d-node","state-node",`is-${e.kind}`)}
|
|
@@ -724,7 +824,7 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
724
824
|
${e.code===null?w:g`<span class="state-code">${e.code}</span>`}
|
|
725
825
|
</button>
|
|
726
826
|
${this.renderCommentTrigger({kind:"node",id:e.id},e.name,{x:t.x+e.width-20,y:t.y-14})}
|
|
727
|
-
`}#
|
|
827
|
+
`}#n(e){const t=this.edgeState(e.id),s=Ms(this.routeOf(e.id));return g`
|
|
728
828
|
<span class="state-label-slot" style="left:${s.x}px; top:${s.y}px">
|
|
729
829
|
<button
|
|
730
830
|
type="button"
|
|
@@ -738,7 +838,7 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
738
838
|
</button>
|
|
739
839
|
${this.renderCommentTrigger({kind:"edge",id:e.id},`${this.#e(e.from)} \u2192 ${this.#e(e.to)} \xB7 ${e.title}`)}
|
|
740
840
|
</span>
|
|
741
|
-
`}}const Ke=()=>{customElements.get("dpk-component-state-diagram")||customElements.define("dpk-component-state-diagram",
|
|
841
|
+
`}}const Ke=()=>{customElements.get("dpk-component-state-diagram")||customElements.define("dpk-component-state-diagram",Ge)},Xe=(a,e)=>e?{request:"Process / guarantee",response:"Response / guarantee",async:"Async / guarantee"}[a]:{request:"\u51E6\u7406 / \u4FDD\u8A3C",response:"\u5FDC\u7B54 / \u4FDD\u8A3C",async:"\u975E\u540C\u671F\u51E6\u7406 / \u4FDD\u8A3C"}[a],se=N({en:{heading:"Sequence",empty:"No matching messages.",participants:"Participants",stats:(a,e)=>`${a} / ${e} messages`,detailLabel:a=>Xe(a,!0),selectMessage:a=>`Select ${a}`,frameHeaderLabel:(a,e,t)=>`${a} \xB7 ${t?`Expand ${e}`:`Collapse ${e}`}`,frameCount:a=>`${a} message${a===1?"":"s"}`},ja:{heading:"\u30B7\u30FC\u30B1\u30F3\u30B9\u56F3",empty:"\u8A72\u5F53\u3059\u308B\u30E1\u30C3\u30BB\u30FC\u30B8\u306F\u3042\u308A\u307E\u305B\u3093\u3002",participants:"\u53C2\u52A0\u8005",stats:(a,e)=>`${a} / ${e} \u30E1\u30C3\u30BB\u30FC\u30B8`,detailLabel:a=>Xe(a,!1),selectMessage:a=>`${a}\u3092\u9078\u629E`,frameHeaderLabel:(a,e,t)=>`${a} \xB7 ${e}\u3092${t?"\u5C55\u958B":"\u6298\u308A\u305F\u305F\u3080"}`,frameCount:a=>`${a} \u30E1\u30C3\u30BB\u30FC\u30B8`}}),Bs=E({kind:De("message"),id:$(p(),S(1)),from:$(p(),S(1)),to:$(p(),S(1)),title:$(p(),S(1)),style:f(U(["request","response","async"]),"request"),tags:f(z(p()),[]),guard:f(p()),detail:f(p()),questions:f(p())}),Ns=E({label:$(p(),S(1)),items:z(Ee())}),_s=E({kind:De("fragment"),id:$(p(),S(1)),operator:U(["alt","opt","loop","par"]),title:$(p(),S(1)),collapsed:f(ge(),!1),branches:$(z(Ns),S(1))}),Ys=Zt("kind",[Bs,_s]),Vs=E({id:$(p(),S(1)),name:$(p(),S(1)),role:f(p()),symbol:f(p()),kind:f(U(["internal","external"]),"internal"),description:f(p()),questions:f(p())}),Ws=E({participants:$(z(Vs),S(1)),items:f(z(Ee()),[])}),Ze=240,$e=(a,e,t)=>{if(a.has(e))throw new Error(`duplicate ${t} id: ${e}`);a.add(e)},Je=(a,e,t)=>a.map(s=>{const r=Y(Ys,s);if(r.kind==="message"){if($e(t,r.id,"message"),!e.has(r.from))throw new Error(`unknown sender: ${r.from}`);if(!e.has(r.to))throw new Error(`unknown receiver: ${r.to}`);return{kind:"message",id:r.id,from:r.from,to:r.to,title:r.title,style:r.style,tags:r.tags,guard:r.guard??null,detail:r.detail??null,questions:r.questions??null}}return $e(t,r.id,"fragment"),{kind:"fragment",id:r.id,operator:r.operator,title:r.title,collapsed:r.collapsed,branches:r.branches.map(n=>({label:n.label,items:Je(n.items,e,t)}))}}),Qe=a=>{const e=Y(Ws,a),t=new Set;for(const s of e.participants)$e(t,s.id,"participant");return{participants:e.participants.map(s=>({id:s.id,name:s.name,role:s.role??null,symbol:s.symbol??null,external:s.kind==="external",description:s.description??null,questions:s.questions??null})),items:Je(e.items,t,new Set)}},Gs=()=>({participants:[],items:[]}),et=(a,e)=>{for(const t of a)if(t.kind==="message")e.push(t);else for(const s of t.branches)et(s.items,e)},W=a=>{const e=[];return et(a,e),e},Ks=a=>new Map(W(a.items).map((e,t)=>[e.id,String(t+1).padStart(2,"0")])),Xs=a=>W(a).length,tt=(a,e)=>{const t=[];for(const s of a){if(s.kind==="message"){e(s)&&t.push(s);continue}const r=s.branches.map(i=>({label:i.label,items:tt(i.items,e)})).filter(i=>i.items.length>0);r.length>0&&t.push({...s,branches:r})}return t},Zs=64,Js=86,Qs=31,ea=32,ta=40,sa=(a,e)=>{const t=tt(a.items,e),s=new Set;for(const M of W(t))s.add(M.from),s.add(M.to);const r=a.participants.filter(M=>s.has(M.id)),i=new Map(r.map((M,v)=>[M.id,120+v*Ze])),n=Math.max(360,r.length*Ze),o=[],d=[],l=[],m=[],b=[];let c=25;const h=(M,v)=>{for(const k of M){if(k.kind==="message"){o.push({message:k,y:c+29,depth:v}),c+=k.from===k.to?Js:Zs;continue}const C=22+v*13,T=c,O=n-44-v*26;c+=Qs,k.collapsed?(b.push({fragment:k,x:C,y:c+6}),c+=ta):k.branches.forEach((P,F)=>{F>0&&(m.push({x:C,y:c,width:O}),c+=8),l.push({label:P.label,x:C+12,y:c}),c+=ea,h(P.items,v+1),c+=8}),d.push({fragment:k,x:C,y:T,width:O,height:c-T,count:Xs([k])}),c+=14}};return h(t,0),{width:n,height:c+24,participants:r,rows:o,frames:d,branches:l,dividers:m,folds:b,x:i}},aa=_`
|
|
742
842
|
.sequence .diagram-canvas {
|
|
743
843
|
background-image: none;
|
|
744
844
|
}
|
|
@@ -749,7 +849,7 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
749
849
|
flex-shrink: 0;
|
|
750
850
|
overflow: hidden;
|
|
751
851
|
border-bottom: 1px solid var(--dpk-rule);
|
|
752
|
-
background: var(--dpk-paper);
|
|
852
|
+
background: linear-gradient(180deg, var(--dpk-paper-raised), var(--dpk-paper));
|
|
753
853
|
}
|
|
754
854
|
|
|
755
855
|
.sequence-rail-world {
|
|
@@ -772,18 +872,31 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
772
872
|
border: 1px solid var(--dpk-rule-strong);
|
|
773
873
|
border-radius: var(--dpk-radius-sm);
|
|
774
874
|
background: var(--dpk-paper-raised);
|
|
775
|
-
box-shadow: var(--dpk-shadow-xs);
|
|
875
|
+
box-shadow: var(--dpk-bevel), var(--dpk-shadow-xs);
|
|
776
876
|
text-align: left;
|
|
777
877
|
cursor: pointer;
|
|
878
|
+
transition:
|
|
879
|
+
border-color 160ms var(--dpk-ease),
|
|
880
|
+
box-shadow 160ms var(--dpk-ease),
|
|
881
|
+
transform 160ms var(--dpk-ease);
|
|
778
882
|
}
|
|
779
883
|
|
|
780
884
|
.sequence-participant.is-external {
|
|
781
885
|
border-style: dashed;
|
|
782
886
|
}
|
|
783
887
|
|
|
888
|
+
.sequence-participant:hover {
|
|
889
|
+
border-color: var(--dpk-blue);
|
|
890
|
+
box-shadow: var(--dpk-bevel), var(--dpk-shadow-sm);
|
|
891
|
+
transform: translateY(-1px);
|
|
892
|
+
}
|
|
893
|
+
|
|
784
894
|
.sequence-participant[aria-pressed='true'] {
|
|
785
895
|
border-color: var(--dpk-blue);
|
|
786
|
-
box-shadow:
|
|
896
|
+
box-shadow:
|
|
897
|
+
var(--dpk-bevel),
|
|
898
|
+
var(--dpk-shadow-sm),
|
|
899
|
+
0 0 0 3px var(--dpk-blue-soft);
|
|
787
900
|
}
|
|
788
901
|
|
|
789
902
|
.sequence-participant.is-related {
|
|
@@ -870,6 +983,7 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
870
983
|
border: 1px solid var(--dpk-rule-strong);
|
|
871
984
|
border-radius: var(--dpk-radius-xs);
|
|
872
985
|
background: color-mix(in srgb, var(--dpk-blue-soft) 50%, transparent);
|
|
986
|
+
box-shadow: 0 1px 2px var(--dpk-shade-1);
|
|
873
987
|
pointer-events: none;
|
|
874
988
|
}
|
|
875
989
|
|
|
@@ -887,6 +1001,9 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
887
1001
|
font-size: 10px;
|
|
888
1002
|
text-align: left;
|
|
889
1003
|
cursor: pointer;
|
|
1004
|
+
transition:
|
|
1005
|
+
background 160ms var(--dpk-ease),
|
|
1006
|
+
color 160ms var(--dpk-ease);
|
|
890
1007
|
}
|
|
891
1008
|
|
|
892
1009
|
.sequence-frame-header:hover {
|
|
@@ -934,17 +1051,27 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
934
1051
|
font-size: 10px;
|
|
935
1052
|
text-align: left;
|
|
936
1053
|
cursor: pointer;
|
|
1054
|
+
box-shadow: var(--dpk-shadow-xs);
|
|
1055
|
+
transition:
|
|
1056
|
+
border-color 160ms var(--dpk-ease),
|
|
1057
|
+
background 160ms var(--dpk-ease),
|
|
1058
|
+
color 160ms var(--dpk-ease),
|
|
1059
|
+
box-shadow 160ms var(--dpk-ease);
|
|
937
1060
|
}
|
|
938
1061
|
|
|
939
1062
|
.sequence-label:hover {
|
|
940
1063
|
border-color: color-mix(in srgb, var(--dpk-blue) 40%, transparent);
|
|
941
1064
|
color: var(--dpk-blue);
|
|
1065
|
+
box-shadow: var(--dpk-shadow-sm);
|
|
942
1066
|
}
|
|
943
1067
|
|
|
944
1068
|
.sequence-label.is-selected {
|
|
945
1069
|
border-color: color-mix(in srgb, var(--dpk-blue) 55%, transparent);
|
|
946
1070
|
background: var(--dpk-blue-soft);
|
|
947
1071
|
color: var(--dpk-blue);
|
|
1072
|
+
box-shadow:
|
|
1073
|
+
var(--dpk-shadow-xs),
|
|
1074
|
+
inset 0 0 0 1px color-mix(in srgb, var(--dpk-blue) 20%, transparent);
|
|
948
1075
|
}
|
|
949
1076
|
|
|
950
1077
|
.sequence-number {
|
|
@@ -987,21 +1114,21 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
987
1114
|
fill: var(--dpk-ink);
|
|
988
1115
|
stroke: var(--dpk-ink);
|
|
989
1116
|
}
|
|
990
|
-
`,
|
|
991
|
-
`)||e.title}#l(){const e=this.items(),t=s=>s.map(
|
|
1117
|
+
`,ra=[{id:"seq-request"},{id:"seq-response"},{id:"seq-async"},{id:"seq-related"},{id:"seq-selected"}];class st extends we{static{this.styles=[V,aa]}#e=null;#s=new Map;#a=new Map;#t=new Set;#r=new Set;#n="";#i=0;commentItems(){const e=this.items();return[...e.participants.map(t=>({value:this.commentRef("participant",t.id),label:t.name})),...W(e.items).map(t=>({value:this.commentRef("message",t.id),label:t.title}))]}parseData(e){return this.#a.clear(),Qe(e)}emptyData(){return Gs()}defaultHeading(){return se(this.locale).heading}shellClass(){return"sequence"}emptyMessage(){return se(this.locale).empty}fitViewport(){this.viewport?.fitWidth()}onViewChange(e){const t=this.renderRoot.querySelector(".sequence-rail-world");t&&(t.style.transform=`translateX(${e.x}px) scale(${e.scale})`)}hasSelection(e){const t=this.items();return e.kind==="participant"?t.participants.some(s=>s.id===e.id):W(t.items).some(s=>s.id===e.id)}tagItems(){return W(this.items().items).map(e=>e.tags)}statsText(){const e=this.#e,t=W(this.items().items).length;return e===null?"":se(this.locale).stats(e.rows.length,t)}contentSize(){const e=this.#e;return e===null||e.rows.length===0?null:{width:e.width,height:e.height}}isEmpty(){return this.contentSize()===null}layoutVersion(){return this.#i}refreshContent(){const e=this.#l(),t=this.tagFilter,s=[t.match,[...t.active].join(","),[...this.#a].map(([n,o])=>`${n}:${o}`).join(","),W(e.items).map(n=>n.id).join(",")].join("|");s!==this.#n&&(this.#n=s,this.#i+=1,this.#s=Ks(this.items()),this.#e=sa(e,n=>K(n.tags,t))),this.#t=new Set,this.#r=new Set;const r=this.selection,i=this.#e;if(r!==null&&i!==null)if(r.kind==="message"){const n=i.rows.find(o=>o.message.id===r.id);this.#t.add(r.id),n&&(this.#r.add(n.message.from),this.#r.add(n.message.to))}else for(const n of i.rows)n.message.from!==r.id&&n.message.to!==r.id||this.#t.add(n.message.id)}#o(e,t){const s=e.detail===null?null:`${t.detailLabel(e.style)}: ${e.detail}`;return[e.guard,s].filter(r=>r!==null).join(`
|
|
1118
|
+
`)||e.title}#l(){const e=this.items(),t=s=>s.map(r=>r.kind==="message"?r:{...r,collapsed:this.#a.get(r.id)??r.collapsed,branches:r.branches.map(i=>({label:i.label,items:t(i.items)}))});return{participants:e.participants,items:t(e.items)}}#p(e){return this.#e?.frames.find(t=>t.fragment.id===e.id)?.fragment.collapsed??e.collapsed}#u(e){this.#a.set(e.id,!this.#p(e)),this.requestUpdate()}#c(e){const t=this.selection?.kind==="message"&&this.selection.id===e,s=!t&&this.#t.has(e);return{selected:t,related:s,dimmed:this.selection!==null&&!t&&!s,depth:null}}#d(e){const t=this.selection?.kind==="participant"&&this.selection.id===e,s=!t&&this.#r.has(e);return{selected:t,related:s,dimmed:this.selection!==null&&!t&&!s,depth:null}}renderAboveCanvas(){const e=this.#e;if(e===null)return w;const t=se(this.locale);return g`
|
|
992
1119
|
<div class="sequence-rail" role="group" aria-label=${t.participants}>
|
|
993
1120
|
<div class="sequence-rail-world">
|
|
994
1121
|
${e.participants.map(s=>this.#b(s,e))}
|
|
995
1122
|
</div>
|
|
996
1123
|
</div>
|
|
997
|
-
`}#b(e,t){const s=t.x.get(e.id)??0,
|
|
1124
|
+
`}#b(e,t){const s=t.x.get(e.id)??0,r=this.#d(e.id);return g`
|
|
998
1125
|
<button
|
|
999
1126
|
type="button"
|
|
1000
|
-
class=${this.elementClass(
|
|
1127
|
+
class=${this.elementClass(r,"sequence-participant",e.external&&"is-external")}
|
|
1001
1128
|
data-participant=${e.id}
|
|
1002
1129
|
data-grill-questions=${this.questionsOf(e)}
|
|
1003
1130
|
style="left:${s-95}px"
|
|
1004
|
-
aria-pressed=${
|
|
1131
|
+
aria-pressed=${r.selected?"true":"false"}
|
|
1005
1132
|
title=${e.description??e.name}
|
|
1006
1133
|
@click=${()=>this.select({kind:"participant",id:e.id})}
|
|
1007
1134
|
>
|
|
@@ -1023,78 +1150,86 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
1023
1150
|
>[${s.label}]</span
|
|
1024
1151
|
>`)}
|
|
1025
1152
|
${e.folds.map(s=>g`<span class="sequence-fold" style="left:${s.x}px; top:${s.y}px"
|
|
1026
|
-
>${s.fragment.branches.map(
|
|
1153
|
+
>${s.fragment.branches.map(r=>`[${r.label}]`).join(" / ")}</span
|
|
1027
1154
|
>`)}
|
|
1028
1155
|
${e.rows.map(s=>this.#g(s.y,s.message,e,t))}
|
|
1029
|
-
`}#h(e,t){const s=e.participants.map(
|
|
1156
|
+
`}#h(e,t){const s=e.participants.map(n=>I`<path
|
|
1030
1157
|
class="sequence-lifeline"
|
|
1031
|
-
d=${`M${e.x.get(
|
|
1032
|
-
></path>`),
|
|
1158
|
+
d=${`M${e.x.get(n.id)??0} 0 V${e.height}`}
|
|
1159
|
+
></path>`),r=e.dividers.map(n=>I`<path class="sequence-divider" d=${`M${n.x} ${n.y} h${n.width}`}></path>`),i=e.rows.map(n=>{const o=e.x.get(n.message.from)??0,d=e.x.get(n.message.to)??0,l=o===d?`M${o} ${n.y} h42 v25 H${o}`:`M${o} ${n.y} H${d}`,m=this.#c(n.message.id),b=m.selected?"seq-selected":m.related?"seq-related":n.message.style==="async"?"seq-async":n.message.style==="response"?"seq-response":"seq-request",c=()=>this.select({kind:"message",id:n.message.id});return I`
|
|
1033
1160
|
<g
|
|
1034
|
-
class=${this.elementClass(m,"sequence-message-row","d-edge",`is-${
|
|
1035
|
-
data-message=${
|
|
1161
|
+
class=${this.elementClass(m,"sequence-message-row","d-edge",`is-${n.message.style}`)}
|
|
1162
|
+
data-message=${n.message.id}
|
|
1036
1163
|
>
|
|
1037
|
-
<title>${this.#o(
|
|
1164
|
+
<title>${this.#o(n.message,t)}</title>
|
|
1038
1165
|
<path class="d-edge-hit" d=${l} role="button" tabindex="0"
|
|
1039
|
-
aria-label=${t.selectMessage(
|
|
1166
|
+
aria-label=${t.selectMessage(n.message.title)}
|
|
1040
1167
|
@click=${c}
|
|
1041
1168
|
@keydown=${h=>{h.key!=="Enter"&&h.key!==" "||(h.preventDefault(),c())}}></path>
|
|
1042
|
-
<path class="sequence-message is-${
|
|
1169
|
+
<path class="sequence-message is-${n.message.style}" d=${l} marker-end=${`url(#${b})`}></path>
|
|
1043
1170
|
</g>
|
|
1044
1171
|
`});return g`<svg class="diagram-edges" width=${e.width} height=${e.height}>
|
|
1045
|
-
${Ne(
|
|
1046
|
-
</svg>`}#m(e,t,s,
|
|
1172
|
+
${Ne(ra)} ${s} ${r} ${i}
|
|
1173
|
+
</svg>`}#m(e,t,s,r,i,n){const o=this.#p(e);return g`
|
|
1047
1174
|
<button
|
|
1048
1175
|
type="button"
|
|
1049
1176
|
class="sequence-frame-header"
|
|
1050
1177
|
data-fragment=${e.id}
|
|
1051
|
-
style="left:${t}px; top:${s}px; width:${
|
|
1178
|
+
style="left:${t}px; top:${s}px; width:${r}px"
|
|
1052
1179
|
aria-expanded=${o?"false":"true"}
|
|
1053
|
-
aria-label=${
|
|
1180
|
+
aria-label=${n.frameHeaderLabel(e.operator,e.title,o)}
|
|
1054
1181
|
@click=${()=>this.#u(e)}
|
|
1055
1182
|
>
|
|
1056
1183
|
<span aria-hidden="true">${o?"\u25B8":"\u25BE"}</span>
|
|
1057
1184
|
<span class="sequence-operator">${e.operator}</span>
|
|
1058
1185
|
<span class="sequence-text">${e.title}</span>
|
|
1059
|
-
<span class="sequence-frame-count">${
|
|
1186
|
+
<span class="sequence-frame-count">${n.frameCount(i)}</span>
|
|
1060
1187
|
</button>
|
|
1061
|
-
`}#g(e,t,s,
|
|
1188
|
+
`}#g(e,t,s,r){const i=s.x.get(t.from)??0,n=s.x.get(t.to)??0,o=i===n,d=this.#c(t.id),l=o?i+12:Math.min(i,n)+14,m=o?175:Math.abs(n-i)-28;return g`
|
|
1062
1189
|
<button
|
|
1063
1190
|
type="button"
|
|
1064
1191
|
class=${this.elementClass(d,"sequence-label")}
|
|
1065
1192
|
data-message-label=${t.id}
|
|
1066
1193
|
data-grill-questions=${this.questionsOf(t)}
|
|
1067
1194
|
style="left:${l}px; top:${e-28}px; width:${m}px"
|
|
1068
|
-
title=${this.#o(t,
|
|
1195
|
+
title=${this.#o(t,r)}
|
|
1069
1196
|
@click=${()=>this.select({kind:"message",id:t.id})}
|
|
1070
1197
|
>
|
|
1071
1198
|
<span class="sequence-number">${this.#s.get(t.id)??""}</span>
|
|
1072
1199
|
<span class="sequence-text">${t.title}</span>
|
|
1073
1200
|
</button>
|
|
1074
1201
|
${this.renderCommentTrigger({kind:"message",id:t.id},`${this.#s.get(t.id)??""} ${t.title}`.trim(),{x:l+m-30,y:e-31})}
|
|
1075
|
-
`}}const
|
|
1202
|
+
`}}const at=()=>{customElements.get("dpk-component-sequence-diagram")||customElements.define("dpk-component-sequence-diagram",st)},Z=N({en:{heading:"Dependencies",node:"Module",edge:"Dependency",emptyCycles:"No matching cycles.",emptyModules:"No matching modules.",directionGroup:"Direction to follow from the selected module",directionOutgoing:"Depends on",directionIncoming:"Depended on by",directionBoth:"Both",transitive:"Include indirect",cyclesToggleLabel:a=>`Show only ${a} cycle group(s)`,cyclesCount:a=>`Cycles ${a}`,legendOutgoing:"Depends on",legendIncoming:"Depended on by",legendCycle:"Cycle",edgeLabel:(a,e)=>`${a} depends on ${e}`,cyclicSuffix:a=>`${a}, part of a cycle`,cycleBadge:"Cycle"},ja:{heading:"\u4F9D\u5B58\u95A2\u4FC2\u30B0\u30E9\u30D5",node:"\u30E2\u30B8\u30E5\u30FC\u30EB",edge:"\u4F9D\u5B58",emptyCycles:"\u8A72\u5F53\u3059\u308B\u5FAA\u74B0\u4F9D\u5B58\u306F\u3042\u308A\u307E\u305B\u3093\u3002",emptyModules:"\u8A72\u5F53\u3059\u308B\u30E2\u30B8\u30E5\u30FC\u30EB\u306F\u3042\u308A\u307E\u305B\u3093\u3002",directionGroup:"\u9078\u629E\u3057\u305F\u30E2\u30B8\u30E5\u30FC\u30EB\u304B\u3089\u8FFD\u3046\u65B9\u5411",directionOutgoing:"\u4F9D\u5B58\u5148",directionIncoming:"\u4F9D\u5B58\u5143",directionBoth:"\u4E21\u65B9",transitive:"\u9593\u63A5\u3082\u542B\u3080",cyclesToggleLabel:a=>`\u5FAA\u74B0\u4F9D\u5B58 ${a} \u30B0\u30EB\u30FC\u30D7\u3060\u3051\u8868\u793A`,cyclesCount:a=>`\u5FAA\u74B0 ${a}`,legendOutgoing:"\u4F9D\u5B58\u5148",legendIncoming:"\u4F9D\u5B58\u5143",legendCycle:"\u5FAA\u74B0",edgeLabel:(a,e)=>`${a} \u304C ${e} \u306B\u4F9D\u5B58`,cyclicSuffix:a=>`${a}\u30FB\u5FAA\u74B0\u4F9D\u5B58\u3042\u308A`,cycleBadge:"\u5FAA\u74B0"}}),rt={width:176,height:84},na=E({id:$(p(),S(1)),name:$(p(),S(1)),path:f(p()),layer:f(p()),tags:f(z(p()),[]),description:f(p()),questions:f(p())}),ia=E({id:$(p(),S(1)),from:$(p(),S(1)),to:$(p(),S(1)),contract:f(p()),description:f(p()),questions:f(p())}),oa=E({modules:z(na),dependencies:f(z(ia),[])}),da=()=>({nodes:[],edges:[]}),la=a=>{const e=Y(oa,a),t=new Set;for(const n of e.modules){if(t.has(n.id))throw new Error(`duplicate module id: ${n.id}`);t.add(n.id)}const s=new Set,r=e.dependencies.map(n=>{if(s.has(n.id))throw new Error(`duplicate dependency id: ${n.id}`);if(s.add(n.id),!t.has(n.from))throw new Error(`unknown dependency source: ${n.from}`);if(!t.has(n.to))throw new Error(`unknown dependency target: ${n.to}`);return{id:n.id,from:n.from,to:n.to,tags:[],contract:n.contract??null,description:n.description??null}});return{nodes:e.modules.map(n=>({id:n.id,name:n.name,path:n.path??null,layer:n.layer??null,description:n.description??null,tags:n.tags,width:rt.width,height:rt.height,...n.questions===void 0?{}:{questions:n.questions}})),edges:r}},ca=_`
|
|
1076
1203
|
.dep-direction {
|
|
1077
1204
|
display: flex;
|
|
1078
|
-
gap:
|
|
1079
|
-
padding:
|
|
1080
|
-
border: 1px solid var(--dpk-rule
|
|
1081
|
-
border-radius: var(--dpk-radius-
|
|
1205
|
+
gap: 2px;
|
|
1206
|
+
padding: 3px;
|
|
1207
|
+
border: 1px solid var(--dpk-rule);
|
|
1208
|
+
border-radius: var(--dpk-radius-sm);
|
|
1209
|
+
background: var(--dpk-paper-sunken);
|
|
1210
|
+
box-shadow: inset 0 1px 2px var(--dpk-shade-1);
|
|
1082
1211
|
}
|
|
1083
1212
|
|
|
1084
1213
|
.dep-direction button {
|
|
1085
1214
|
border: 0;
|
|
1086
|
-
border-radius:
|
|
1087
|
-
padding:
|
|
1215
|
+
border-radius: var(--dpk-radius-xs);
|
|
1216
|
+
padding: 4px 8px;
|
|
1088
1217
|
background: transparent;
|
|
1089
1218
|
color: var(--dpk-ink-faint);
|
|
1090
1219
|
font-size: 9.5px;
|
|
1220
|
+
font-weight: 600;
|
|
1091
1221
|
cursor: pointer;
|
|
1222
|
+
transition:
|
|
1223
|
+
background 160ms var(--dpk-ease),
|
|
1224
|
+
color 160ms var(--dpk-ease),
|
|
1225
|
+
box-shadow 160ms var(--dpk-ease);
|
|
1092
1226
|
}
|
|
1093
1227
|
|
|
1094
1228
|
.dep-direction button[aria-pressed='true'] {
|
|
1095
|
-
background: var(--dpk-
|
|
1096
|
-
color: var(--dpk-
|
|
1229
|
+
background: var(--dpk-paper-raised);
|
|
1230
|
+
color: var(--dpk-ink);
|
|
1097
1231
|
font-weight: 650;
|
|
1232
|
+
box-shadow: var(--dpk-bevel), var(--dpk-shadow-xs);
|
|
1098
1233
|
}
|
|
1099
1234
|
|
|
1100
1235
|
.dep-toggle {
|
|
@@ -1117,13 +1252,19 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
1117
1252
|
border: 1px solid var(--dpk-rule-strong);
|
|
1118
1253
|
border-radius: var(--dpk-radius-sm);
|
|
1119
1254
|
background: var(--dpk-paper-raised);
|
|
1120
|
-
box-shadow: var(--dpk-shadow-xs);
|
|
1255
|
+
box-shadow: var(--dpk-bevel), var(--dpk-shadow-xs);
|
|
1121
1256
|
text-align: left;
|
|
1122
1257
|
overflow: hidden;
|
|
1258
|
+
transition:
|
|
1259
|
+
border-color 160ms var(--dpk-ease),
|
|
1260
|
+
box-shadow 160ms var(--dpk-ease),
|
|
1261
|
+
transform 160ms var(--dpk-ease);
|
|
1123
1262
|
}
|
|
1124
1263
|
|
|
1125
1264
|
.dep-module:hover {
|
|
1126
1265
|
border-color: var(--dpk-blue);
|
|
1266
|
+
box-shadow: var(--dpk-bevel), var(--dpk-shadow-sm);
|
|
1267
|
+
transform: translateY(-1px);
|
|
1127
1268
|
}
|
|
1128
1269
|
|
|
1129
1270
|
.dep-module.is-cyclic:not(.is-selected) {
|
|
@@ -1133,7 +1274,10 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
1133
1274
|
.dep-module.is-selected {
|
|
1134
1275
|
border-color: var(--dpk-blue);
|
|
1135
1276
|
background: var(--dpk-blue-soft);
|
|
1136
|
-
box-shadow:
|
|
1277
|
+
box-shadow:
|
|
1278
|
+
var(--dpk-bevel),
|
|
1279
|
+
var(--dpk-shadow-sm),
|
|
1280
|
+
0 0 0 3px var(--dpk-blue-soft);
|
|
1137
1281
|
}
|
|
1138
1282
|
|
|
1139
1283
|
.dep-module.is-related {
|
|
@@ -1249,16 +1393,16 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
1249
1393
|
fill: var(--dpk-blue);
|
|
1250
1394
|
stroke: var(--dpk-blue);
|
|
1251
1395
|
}
|
|
1252
|
-
`,
|
|
1396
|
+
`,pa=[{id:"dep-neutral"},{id:"dep-outgoing"},{id:"dep-incoming"},{id:"dep-cycle"},{id:"dep-selected"}];class nt extends te{static{this.styles=[V,ca]}#e="both";#s=!1;#a=!1;#t=[];#r=B;#n=B;parseData(e){return la(e)}emptyData(){return da()}defaultHeading(){return Z(this.locale).heading}statsLabels(){const e=Z(this.locale);return{node:e.node,edge:e.edge}}emptyMessage(){const e=Z(this.locale);return this.#a?e.emptyCycles:e.emptyModules}layoutOptions(){return{nodeSpacing:40,layerSpacing:96,padding:32}}relations(e,t){return e===null||e.kind!=="node"?B:{nodes:new Map([...this.#r.nodes,...this.#n.nodes]),edges:new Set([...this.#r.edges,...this.#n.edges])}}refreshContent(){const e=this.items(),t=this.tagFilter,s=e.nodes.filter(o=>K(o.tags,t)),r=new Set(s.map(o=>o.id)),i=e.edges.filter(o=>r.has(o.from)&&r.has(o.to));this.#t=Ss(s.map(o=>o.id),i);const n=this.selection;this.#r=n!==null&&n.kind==="node"&&this.#e!=="incoming"?j(i,n.id,"outgoing",this.#s):B,this.#n=n!==null&&n.kind==="node"&&this.#e!=="outgoing"?j(i,n.id,"incoming",this.#s):B,super.refreshContent()}matchesFilter(e){return this.#a?ke(this.#t).has(e.id):!0}filtered(){const e=super.filtered();if(!this.#a)return e;const t=ke(this.#t),s=e.edges.filter(i=>He(i,t)),r=new Set(s.flatMap(i=>[i.from,i.to]));return{nodes:e.nodes.filter(i=>r.has(i.id)),edges:s}}renderToolbarActions(){const e=Z(this.locale),t=this.#t.length;return g`
|
|
1253
1397
|
<div class="dep-direction" role="group" aria-label=${e.directionGroup}>
|
|
1254
|
-
${[["outgoing",e.directionOutgoing],["incoming",e.directionIncoming],["both",e.directionBoth]].map(([s,
|
|
1398
|
+
${[["outgoing",e.directionOutgoing],["incoming",e.directionIncoming],["both",e.directionBoth]].map(([s,r])=>g`
|
|
1255
1399
|
<button
|
|
1256
1400
|
type="button"
|
|
1257
1401
|
data-direction=${s}
|
|
1258
1402
|
aria-pressed=${this.#e===s?"true":"false"}
|
|
1259
|
-
@click=${()=>this.#
|
|
1403
|
+
@click=${()=>this.#i(s)}
|
|
1260
1404
|
>
|
|
1261
|
-
${
|
|
1405
|
+
${r}
|
|
1262
1406
|
</button>
|
|
1263
1407
|
`)}
|
|
1264
1408
|
</div>
|
|
@@ -1275,10 +1419,10 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
1275
1419
|
type="button"
|
|
1276
1420
|
class="dpk-btn dpk-btn--ghost dep-toggle"
|
|
1277
1421
|
data-toggle="cycles"
|
|
1278
|
-
aria-pressed=${this.#
|
|
1422
|
+
aria-pressed=${this.#a?"true":"false"}
|
|
1279
1423
|
aria-label=${e.cyclesToggleLabel(t)}
|
|
1280
|
-
?disabled=${!this.#
|
|
1281
|
-
@click=${()=>{this.#
|
|
1424
|
+
?disabled=${!this.#a&&t===0}
|
|
1425
|
+
@click=${()=>{this.#a=!this.#a,this.requestUpdate()}}
|
|
1282
1426
|
>
|
|
1283
1427
|
${e.cyclesCount(t)}
|
|
1284
1428
|
</button>
|
|
@@ -1286,7 +1430,7 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
1286
1430
|
<span><i class="dep-swatch-outgoing"></i>${e.legendOutgoing}</span>
|
|
1287
1431
|
<span><i class="dep-swatch-incoming"></i>${e.legendIncoming}</span>
|
|
1288
1432
|
<span><i class="dep-swatch-cycle"></i>${e.legendCycle}</span>
|
|
1289
|
-
</div>`}#
|
|
1433
|
+
</div>`}#i(e){this.#e=e,this.requestUpdate()}#o(e,t){const s=this.selection;return s!==null&&s.kind==="edge"&&s.id===e.id?"dep-selected":He(e,t)?"dep-cycle":this.#r.edges.has(e.id)?"dep-outgoing":this.#n.edges.has(e.id)?"dep-incoming":"dep-neutral"}renderCanvas(){const e=Z(this.locale),t=this.visible,s=ke(this.#t),r=o=>t.nodes.find(d=>d.id===o)?.name??o,i=t.edges.map(o=>{const d=this.edgeState(o.id),l=this.routeOf(o.id),m=ee(l),b=()=>this.select({kind:"edge",id:o.id});return I`
|
|
1290
1434
|
<g class=${this.elementClass(d,"d-edge","dep-edge")} data-dependency=${o.id}>
|
|
1291
1435
|
<title>${[o.contract,o.description].filter(c=>c!==null).join(`
|
|
1292
1436
|
`)||o.id}</title>
|
|
@@ -1296,13 +1440,13 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
1296
1440
|
d=${m}
|
|
1297
1441
|
role="button"
|
|
1298
1442
|
tabindex="0"
|
|
1299
|
-
aria-label=${e.edgeLabel(
|
|
1443
|
+
aria-label=${e.edgeLabel(r(o.from),r(o.to))}
|
|
1300
1444
|
@click=${b}
|
|
1301
1445
|
@keydown=${c=>{c.key!=="Enter"&&c.key!==" "||(c.preventDefault(),b())}}
|
|
1302
1446
|
></path>
|
|
1303
|
-
${this.renderEdgeCommentTrigger({kind:"edge",id:o.id},`${
|
|
1447
|
+
${this.renderEdgeCommentTrigger({kind:"edge",id:o.id},`${r(o.from)} \u2192 ${r(o.to)}`,l)}
|
|
1304
1448
|
</g>
|
|
1305
|
-
`}),
|
|
1449
|
+
`}),n=t.nodes.map(o=>{const d=this.placedNode(o.id);if(!d)return w;const l=this.nodeState(o.id),m=s.has(o.id),b=this.#r.nodes.has(o.id),c=this.#n.nodes.has(o.id);return g`
|
|
1306
1450
|
<button
|
|
1307
1451
|
type="button"
|
|
1308
1452
|
class=${this.elementClass(l,"d-node","dep-module",m&&"is-cyclic",b&&"is-dependency",c&&"is-dependent")}
|
|
@@ -1323,7 +1467,7 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
1323
1467
|
<span class="dep-path">${o.path??""}</span>
|
|
1324
1468
|
</button>
|
|
1325
1469
|
${this.renderCommentTrigger({kind:"node",id:o.id},o.name,{x:d.x+o.width-20,y:d.y-14})}
|
|
1326
|
-
`});return g`${this.renderEdges(
|
|
1470
|
+
`});return g`${this.renderEdges(i,pa)}${n}`}}const it=()=>{customElements.get("dpk-component-dependency-graph")||customElements.define("dpk-component-dependency-graph",nt)},ot=(a,e)=>e?{same:"Unchanged",added:"Added",removed:"Removed",changed:"Changed"}[a]:{same:"\u5909\u66F4\u306A\u3057",added:"\u8FFD\u52A0",removed:"\u524A\u9664",changed:"\u5909\u66F4"}[a],J=N({en:{heading:"ERD",node:"Table",edge:"Relation",empty:"No matching tables.",search:"Search",legendAdded:"Added",legendRemoved:"Removed",legendChanged:"Changed",statusLabel:a=>ot(a,!0),edgeLabel:(a,e)=>`${a} and ${e}, related`,nullable:"nullable"},ja:{heading:"ER\u56F3",node:"\u30C6\u30FC\u30D6\u30EB",edge:"\u95A2\u9023",empty:"\u8A72\u5F53\u3059\u308B\u30C6\u30FC\u30D6\u30EB\u306F\u3042\u308A\u307E\u305B\u3093\u3002",search:"\u691C\u7D22",legendAdded:"\u8FFD\u52A0",legendRemoved:"\u524A\u9664",legendChanged:"\u5909\u66F4",statusLabel:a=>ot(a,!1),edgeLabel:(a,e)=>`${a} \u3068 ${e} \u306E\u95A2\u9023`,nullable:"null\u53EF"}}),dt=276,Se=74,ha=28,ua=44,ma=E({id:$(p(),S(1)),type:$(p(),S(1)),key:f(U(["PK","FK","UQ"])),ref:f(p()),nullable:f(ge(),!1),questions:f(p())}),ga=E({id:$(p(),S(1)),name:$(p(),S(1)),tags:f(z(p()),[]),fields:z(ma),questions:f(p())}),lt=E({tables:z(ga)}),fa=E({before:f(lt),after:lt}),ba=()=>({nodes:[],edges:[]}),ct=a=>({id:a.id,type:a.type,key:a.key??null,ref:a.ref??null,nullable:a.nullable,questions:a.questions??null}),pt=(a,e)=>a.type===e.type&&a.key===e.key&&a.ref===e.ref&&a.nullable===e.nullable,pe=a=>a.status==="changed"?ua:ha,ht=a=>Se+a.reduce((e,t)=>e+pe(t),0),ut=(a,e)=>{let t=Se;for(const s of a){if(s.id===e)return t+pe(s)/2;t+=pe(s)}return Se/2},mt=a=>a.flatMap(e=>e.fields.flatMap(t=>{if(t.ref===void 0)return[];const[s,r]=t.ref.split(".");if(s===void 0||r===void 0)throw new Error(`invalid ref "${t.ref}" on ${e.id}.${t.id}; expected table.field`);return[{id:`${s}:${r}>${e.id}:${t.id}`,from:s,to:e.id,sourceField:r,targetField:t.id}]})),ka=(a,e)=>[...new Set([...a,...e].map(s=>s.id))].flatMap(s=>{const r=a.find(l=>l.id===s),i=e.find(l=>l.id===s),n=i??r;if(!n)return[];const o=ct(n);if(!r)return[{...o,status:"added",before:null}];if(!i)return[{...o,status:"removed",before:null}];const d=ct(r);return[{...o,status:pt(d,o)?"same":"changed",before:pt(d,o)?null:d}]}),xa=a=>{const e=Y(fa,a),t=e.before?.tables??e.after.tables,s=e.after.tables,r=[...new Set([...t,...s].map(h=>h.id))],i=new Map;for(const h of[...t,...s])i.set(h.id,h.tags);const n=r.flatMap(h=>{const M=t.find(O=>O.id===h),v=s.find(O=>O.id===h),k=v??M;if(!k)return[];const C=ka(M?.fields??[],v?.fields??[]),T=M?v?C.some(O=>O.status!=="same")?"changed":"same":"removed":"added";return[{id:h,name:k.name,status:T,fields:C,tags:i.get(h)??[],width:dt,height:ht(C),...k.questions===void 0?{}:{questions:k.questions}}]}),o=new Map(n.map(h=>[h.id,h])),d=mt(t),l=mt(s),b=[...new Set([...d,...l].map(h=>h.id))].flatMap(h=>{const M=d.find(P=>P.id===h),v=l.find(P=>P.id===h),k=v??M;if(!k)return[];const C=o.get(k.from),T=o.get(k.to);if(!C||!T)return[];const O=M?v?"same":"removed":"added";return[{id:h,from:k.from,to:k.to,sourceField:k.sourceField,targetField:k.targetField,status:O,tags:[],fromPort:`${h}:out`,toPort:`${h}:in`}]}),c=h=>{const M={},v={};for(const k of b)k.from===h.id&&(M[`${k.id}:out`]={x:dt,y:ut(h.fields,k.sourceField)}),k.to===h.id&&(v[`${k.id}:in`]={x:0,y:ut(h.fields,k.targetField)});return{out:M,in:v}};return{nodes:n.map(h=>{const M=c(h);return{...h,ports:{...M.out,...M.in}}}),edges:b}},va=_`
|
|
1327
1471
|
.er-search {
|
|
1328
1472
|
display: flex;
|
|
1329
1473
|
align-items: center;
|
|
@@ -1342,9 +1486,18 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
1342
1486
|
border: 1px solid var(--dpk-rule-strong);
|
|
1343
1487
|
border-radius: var(--dpk-radius-sm);
|
|
1344
1488
|
background: var(--dpk-paper-raised);
|
|
1345
|
-
box-shadow: var(--dpk-shadow-xs);
|
|
1489
|
+
box-shadow: var(--dpk-bevel), var(--dpk-shadow-xs);
|
|
1346
1490
|
overflow: hidden;
|
|
1347
1491
|
cursor: default;
|
|
1492
|
+
transition:
|
|
1493
|
+
border-color 160ms var(--dpk-ease),
|
|
1494
|
+
box-shadow 160ms var(--dpk-ease),
|
|
1495
|
+
transform 160ms var(--dpk-ease);
|
|
1496
|
+
}
|
|
1497
|
+
|
|
1498
|
+
.er-table:hover {
|
|
1499
|
+
box-shadow: var(--dpk-bevel), var(--dpk-shadow-sm);
|
|
1500
|
+
transform: translateY(-1px);
|
|
1348
1501
|
}
|
|
1349
1502
|
|
|
1350
1503
|
.er-table.is-added {
|
|
@@ -1361,7 +1514,10 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
1361
1514
|
|
|
1362
1515
|
.er-table.is-selected {
|
|
1363
1516
|
border-color: var(--dpk-blue);
|
|
1364
|
-
box-shadow:
|
|
1517
|
+
box-shadow:
|
|
1518
|
+
var(--dpk-bevel),
|
|
1519
|
+
var(--dpk-shadow-sm),
|
|
1520
|
+
0 0 0 3px var(--dpk-blue-soft);
|
|
1365
1521
|
}
|
|
1366
1522
|
|
|
1367
1523
|
.er-table.is-related {
|
|
@@ -1480,17 +1636,20 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
1480
1636
|
}
|
|
1481
1637
|
|
|
1482
1638
|
.er-field.is-added {
|
|
1483
|
-
background: color-mix(in srgb, var(--dpk-green)
|
|
1639
|
+
background: color-mix(in srgb, var(--dpk-green) 10%, transparent);
|
|
1640
|
+
box-shadow: inset 2px 0 0 var(--dpk-green);
|
|
1484
1641
|
}
|
|
1485
1642
|
|
|
1486
1643
|
.er-field.is-removed {
|
|
1487
|
-
background: color-mix(in srgb, var(--dpk-accent)
|
|
1644
|
+
background: color-mix(in srgb, var(--dpk-accent) 10%, transparent);
|
|
1645
|
+
box-shadow: inset 2px 0 0 var(--dpk-accent);
|
|
1488
1646
|
text-decoration: line-through;
|
|
1489
1647
|
color: var(--dpk-ink-faint);
|
|
1490
1648
|
}
|
|
1491
1649
|
|
|
1492
1650
|
.er-field.is-changed {
|
|
1493
|
-
background: color-mix(in srgb, var(--dpk-amber)
|
|
1651
|
+
background: color-mix(in srgb, var(--dpk-amber) 10%, transparent);
|
|
1652
|
+
box-shadow: inset 2px 0 0 var(--dpk-amber);
|
|
1494
1653
|
}
|
|
1495
1654
|
|
|
1496
1655
|
.er-field.is-match {
|
|
@@ -1628,7 +1787,7 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
1628
1787
|
fill: var(--dpk-blue);
|
|
1629
1788
|
stroke: var(--dpk-blue);
|
|
1630
1789
|
}
|
|
1631
|
-
`,
|
|
1790
|
+
`,ya=[{id:"er-neutral"},{id:"er-added"},{id:"er-removed"},{id:"er-selected"}],gt={same:"",added:"+",removed:"\u2212",changed:"~"};class ft extends te{static{this.styles=[V,va]}#e="";parseData(e){return xa(e)}emptyData(){return ba()}defaultHeading(){return J(this.locale).heading}statsLabels(){const e=J(this.locale);return{node:e.node,edge:e.edge}}emptyMessage(){return J(this.locale).empty}layoutOptions(){return{nodeSpacing:38,layerSpacing:96,padding:32}}matchesFilter(e){return this.#e===""?!0:[e.id,e.name,...e.fields.map(t=>t.id)].some(t=>t.toLowerCase().includes(this.#e))}relations(e,t){if(e===null||e.kind!=="node")return B;const s=j(t.edges,e.id,"outgoing",!1),r=j(t.edges,e.id,"incoming",!1);return{nodes:new Map([...s.nodes,...r.nodes]),edges:new Set([...s.edges,...r.edges])}}renderToolbarActions(){const e=J(this.locale);return g`
|
|
1632
1791
|
<label class="er-search">
|
|
1633
1792
|
<span class="dpk-label">${e.search}</span>
|
|
1634
1793
|
<input
|
|
@@ -1643,28 +1802,28 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
1643
1802
|
<span><i class="er-swatch-added"></i>${e.legendAdded}</span>
|
|
1644
1803
|
<span><i class="er-swatch-removed"></i>${e.legendRemoved}</span>
|
|
1645
1804
|
<span><i class="er-swatch-changed"></i>${e.legendChanged}</span>
|
|
1646
|
-
</div>`}#s(e){const t=this.selection;return t!==null&&t.kind==="edge"?"er-selected":e==="added"?"er-added":e==="removed"?"er-removed":"er-neutral"}renderCanvas(){const e=J(this.locale),t=this.visible,s=t.edges.map(
|
|
1647
|
-
<g class=${this.elementClass(
|
|
1648
|
-
<title>${`${
|
|
1649
|
-
<path class="d-edge-path" d=${o} marker-end=${`url(#${this.#s(
|
|
1805
|
+
</div>`}#s(e){const t=this.selection;return t!==null&&t.kind==="edge"?"er-selected":e==="added"?"er-added":e==="removed"?"er-removed":"er-neutral"}renderCanvas(){const e=J(this.locale),t=this.visible,s=t.edges.map(r=>{const i=this.edgeState(r.id),n=this.routeOf(r.id),o=ee(n),d=()=>this.select({kind:"edge",id:r.id});return I`
|
|
1806
|
+
<g class=${this.elementClass(i,"d-edge","er-edge",`is-${r.status}`)} data-relation=${r.id}>
|
|
1807
|
+
<title>${`${r.from}.${r.sourceField} \u2192 ${r.to}.${r.targetField}`}</title>
|
|
1808
|
+
<path class="d-edge-path" d=${o} marker-end=${`url(#${this.#s(r.status)})`}></path>
|
|
1650
1809
|
<path
|
|
1651
1810
|
class="d-edge-hit"
|
|
1652
1811
|
d=${o}
|
|
1653
1812
|
role="button"
|
|
1654
1813
|
tabindex="0"
|
|
1655
|
-
aria-label=${e.edgeLabel(
|
|
1814
|
+
aria-label=${e.edgeLabel(r.from,r.to)}
|
|
1656
1815
|
@click=${d}
|
|
1657
1816
|
@keydown=${l=>{l.key!=="Enter"&&l.key!==" "||(l.preventDefault(),d())}}
|
|
1658
1817
|
></path>
|
|
1659
|
-
${
|
|
1660
|
-
${this.renderEdgeCommentTrigger({kind:"edge",id:
|
|
1818
|
+
${n.length>0?this.#a(n,r.status):w}
|
|
1819
|
+
${this.renderEdgeCommentTrigger({kind:"edge",id:r.id},`${r.from}.${r.sourceField} \u2192 ${r.to}.${r.targetField}`,n)}
|
|
1661
1820
|
</g>
|
|
1662
|
-
`});return g`${this.renderEdges(s,
|
|
1821
|
+
`});return g`${this.renderEdges(s,ya)}${t.nodes.map(r=>this.#t(r,e))}`}#a(e,t){const s=e[0],r=e.at(-1);return!s||!r?g``:I`
|
|
1663
1822
|
<text class="er-cardinality is-${t}" x=${s.x+9} y=${s.y-5}>1</text>
|
|
1664
|
-
<text class="er-cardinality is-${t}" x=${
|
|
1665
|
-
`}#t(e,t){const s=this.placedNode(e.id);if(!s)return w;const
|
|
1823
|
+
<text class="er-cardinality is-${t}" x=${r.x-13} y=${r.y-5}>N</text>
|
|
1824
|
+
`}#t(e,t){const s=this.placedNode(e.id);if(!s)return w;const r=this.nodeState(e.id);return g`
|
|
1666
1825
|
<div
|
|
1667
|
-
class=${this.elementClass(
|
|
1826
|
+
class=${this.elementClass(r,"d-node","er-table",`is-${e.status}`)}
|
|
1668
1827
|
data-er-table=${e.id}
|
|
1669
1828
|
data-grill-questions=${this.questionsOf(e)}
|
|
1670
1829
|
style="left:${s.x}px; top:${s.y}px; width:${e.width}px; height:${ht(e.fields)}px"
|
|
@@ -1673,7 +1832,7 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
1673
1832
|
type="button"
|
|
1674
1833
|
class="er-head"
|
|
1675
1834
|
data-table=${e.id}
|
|
1676
|
-
aria-pressed=${
|
|
1835
|
+
aria-pressed=${r.selected?"true":"false"}
|
|
1677
1836
|
title=${`${e.id} / ${e.name}`}
|
|
1678
1837
|
@click=${()=>this.select({kind:"node",id:e.id})}
|
|
1679
1838
|
>
|
|
@@ -1683,11 +1842,11 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
1683
1842
|
<span class="dpk-label er-status">${t.statusLabel(e.status)}</span>
|
|
1684
1843
|
</button>
|
|
1685
1844
|
${this.renderCommentTrigger({kind:"node",id:e.id},`${e.id} \xB7 ${e.name}`)}
|
|
1686
|
-
<div class="er-fields">${e.fields.map(
|
|
1845
|
+
<div class="er-fields">${e.fields.map(i=>this.#r(i,t))}</div>
|
|
1687
1846
|
</div>
|
|
1688
|
-
`}#
|
|
1847
|
+
`}#r(e,t){const s=i=>[i.type,i.key??"\u2014",i.ref??null,i.nullable?t.nullable:null].filter(Boolean).join(" \xB7 "),r=this.#e!==""&&e.id.toLowerCase().includes(this.#e);return g`
|
|
1689
1848
|
<div
|
|
1690
|
-
class="er-field is-${e.status} ${
|
|
1849
|
+
class="er-field is-${e.status} ${r?"is-match":""}"
|
|
1691
1850
|
style="height:${pe(e)}px"
|
|
1692
1851
|
data-grill-questions=${this.questionsOf(e)}
|
|
1693
1852
|
title=${[t.statusLabel(e.status),e.id,s(e)].filter(Boolean).join(" / ")}
|
|
@@ -1700,7 +1859,7 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
1700
1859
|
<ins>+ ${s(e)}</ins>
|
|
1701
1860
|
</span>`:g`<span class="er-field-type">${s(e)}</span>`}
|
|
1702
1861
|
</div>
|
|
1703
|
-
`}}const bt=()=>{customElements.get("dpk-component-er-diagram")||customElements.define("dpk-component-er-diagram",ft)},
|
|
1862
|
+
`}}const bt=()=>{customElements.get("dpk-component-er-diagram")||customElements.define("dpk-component-er-diagram",ft)},ae=N({en:{heading:"Architecture",node:"Service",edge:"Connection",empty:"No matching services.",boundaries:"Boundaries",edgeLabel:(a,e)=>`Connection from ${a} to ${e}`,artworkCredit:a=>`Icon credit: ${a}`},ja:{heading:"\u30A2\u30FC\u30AD\u30C6\u30AF\u30C1\u30E3\u56F3",node:"\u30B5\u30FC\u30D3\u30B9",edge:"\u63A5\u7D9A",empty:"\u8A72\u5F53\u3059\u308B\u30B5\u30FC\u30D3\u30B9\u306F\u3042\u308A\u307E\u305B\u3093\u3002",boundaries:"\u5883\u754C",edgeLabel:(a,e)=>`${a} \u304B\u3089 ${e} \u3078\u306E\u63A5\u7D9A`,artworkCredit:a=>`\u30A2\u30A4\u30B3\u30F3\u51FA\u5178: ${a}`}}),kt={width:220,height:112},he=26,wa=E({src:$(p(),S(1)),alt:$(p(),S(1)),license:f(p())}),$a=E({id:$(p(),S(1)),name:$(p(),S(1)),description:f(p()),boundary:f(p()),symbol:f(p()),tags:f(z(p()),[]),artwork:f(wa),position:E({x:Q(),y:Q()}),questions:f(p())}),Sa=E({id:$(p(),S(1)),label:$(p(),S(1)),kind:f(U(["internal","external"]),"internal")}),Ma=E({id:$(p(),S(1)),from:$(p(),S(1)),to:$(p(),S(1)),label:f(p())}),Ca=E({boundaries:f(z(Sa),[]),services:z($a),links:f(z(Ma),[])}),qa=()=>({nodes:[],edges:[],boundaries:[]}),Ea=a=>{const e=Y(Ca,a),t=new Set;for(const o of e.boundaries){if(t.has(o.id))throw new Error(`duplicate boundary id: ${o.id}`);t.add(o.id)}const s=new Set,r=e.services.map(o=>{if(s.has(o.id))throw new Error(`duplicate service id: ${o.id}`);if(s.add(o.id),o.boundary!==void 0&&!t.has(o.boundary))throw new Error(`unknown boundary: ${o.boundary}`);return{id:o.id,name:o.name,description:o.description??null,boundary:o.boundary??null,symbol:o.symbol??null,artwork:o.artwork?{src:o.artwork.src,alt:o.artwork.alt,license:o.artwork.license??null}:null,tags:o.tags,width:kt.width,height:kt.height,position:o.position,...o.questions===void 0?{}:{questions:o.questions}}}),i=new Set,n=e.links.map(o=>{if(i.has(o.id))throw new Error(`duplicate link id: ${o.id}`);if(i.add(o.id),!s.has(o.from))throw new Error(`unknown link source: ${o.from}`);if(!s.has(o.to))throw new Error(`unknown link target: ${o.to}`);return{id:o.id,from:o.from,to:o.to,label:o.label??null,tags:[]}});return{nodes:r,edges:n,boundaries:e.boundaries.map(o=>({id:o.id,label:o.label,kind:o.kind}))}},Me={left:he,top:he*1.6,right:he,bottom:he},Da={left:0,top:0,right:0,bottom:0},za=12,xt=a=>({left:Math.min(...a.map(e=>e.position?.x??0)),top:Math.min(...a.map(e=>e.position?.y??0)),right:Math.max(...a.map(e=>(e.position?.x??0)+e.width)),bottom:Math.max(...a.map(e=>(e.position?.y??0)+e.height))}),Ta=(a,e,t,s)=>{const r=a.left-e.left<t.right+s.right&&t.left-s.left<a.right+e.right,i=a.top-e.top<t.bottom+s.bottom&&t.top-s.top<a.bottom+e.bottom;if(!r||!i)return e;const n=Math.max(t.left-a.right,a.left-t.right),o=Math.max(t.top-a.bottom,a.top-t.bottom);if(n<0&&o<0)return e;const d=(l,m,b)=>l===0?0:Math.max(0,b-za)*l/(l+m);return n>=o?t.left>=a.right?{...e,right:Math.min(e.right,d(e.right,s.left,n))}:{...e,left:Math.min(e.left,d(e.left,s.right,n))}:t.top>=a.bottom?{...e,bottom:Math.min(e.bottom,d(e.bottom,s.top,o))}:{...e,top:Math.min(e.top,d(e.top,s.bottom,o))}},Aa=(a,e)=>{const t=e.flatMap(r=>{const i=a.filter(n=>n.boundary===r.id);return i.length===0?[]:[{boundary:r,bounds:xt(i)}]}),s=[...t.map(r=>({id:r.boundary.id,bounds:r.bounds,padding:Me})),...a.filter(r=>r.boundary===null||!t.some(i=>i.boundary.id===r.boundary)).map(r=>({id:null,bounds:xt([r]),padding:Da}))];return t.map(({boundary:r,bounds:i})=>{const n=s.filter(l=>l.id!==r.id).map(l=>Ta(i,Me,l.bounds,l.padding)).reduce((l,m)=>({left:Math.min(l.left,m.left),top:Math.min(l.top,m.top),right:Math.min(l.right,m.right),bottom:Math.min(l.bottom,m.bottom)}),Me),o=i.left-n.left,d=i.top-n.top;return{boundary:r,x:o,y:d,width:i.right+n.right-o,height:i.bottom+n.bottom-d}})},La=(a,e)=>{const t=i=>i.y+i.height/2,s=i=>i.x+i.width/2,r=(i,n,o)=>{if(o?i.y===n.y:i.x===n.x)return[i,n];if(o){const l=(i.x+n.x)/2;return[i,{x:l,y:i.y},{x:l,y:n.y},n]}const d=(i.y+n.y)/2;return[i,{x:i.x,y:d},{x:n.x,y:d},n]};return e.x>=a.x+a.width?r({x:a.x+a.width,y:t(a)},{x:e.x,y:t(e)},!0):a.x>=e.x+e.width?r({x:a.x,y:t(a)},{x:e.x+e.width,y:t(e)},!0):e.y>=a.y+a.height?r({x:s(a),y:a.y+a.height},{x:s(e),y:e.y},!1):a.y>=e.y+e.height?r({x:s(a),y:a.y},{x:s(e),y:e.y+e.height},!1):null},Oa=(a,e)=>{const t=new Map(a.nodes.map(r=>[r.id,r])),s=a.routes.map(r=>{const i=e.find(l=>l.id===r.id),n=i?t.get(i.from):void 0,o=i?t.get(i.to):void 0,d=n&&o&&n!==o?La(n,o):null;return d===null?r:{id:r.id,points:d}});return{...a,routes:s}},Ra=_`
|
|
1704
1863
|
.arch-toggle {
|
|
1705
1864
|
min-height: 26px;
|
|
1706
1865
|
padding: 0 9px;
|
|
@@ -1715,7 +1874,7 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
1715
1874
|
|
|
1716
1875
|
.arch-boundary {
|
|
1717
1876
|
position: absolute;
|
|
1718
|
-
border:
|
|
1877
|
+
border: 1.5px dashed var(--dpk-rule-strong);
|
|
1719
1878
|
border-radius: var(--dpk-radius-lg);
|
|
1720
1879
|
background: color-mix(in srgb, var(--dpk-blue) 3%, transparent);
|
|
1721
1880
|
pointer-events: none;
|
|
@@ -1730,6 +1889,10 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
1730
1889
|
position: absolute;
|
|
1731
1890
|
top: 9px;
|
|
1732
1891
|
left: 14px;
|
|
1892
|
+
padding: 2px 7px;
|
|
1893
|
+
border-radius: 999px;
|
|
1894
|
+
background: var(--dpk-glass);
|
|
1895
|
+
backdrop-filter: blur(8px);
|
|
1733
1896
|
font-family: var(--dpk-mono);
|
|
1734
1897
|
font-size: 9px;
|
|
1735
1898
|
letter-spacing: 0.1em;
|
|
@@ -1746,18 +1909,27 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
1746
1909
|
border: 1px solid var(--dpk-rule-strong);
|
|
1747
1910
|
border-radius: var(--dpk-radius-sm);
|
|
1748
1911
|
background: var(--dpk-paper-raised);
|
|
1749
|
-
box-shadow: var(--dpk-shadow-xs);
|
|
1912
|
+
box-shadow: var(--dpk-bevel), var(--dpk-shadow-xs);
|
|
1750
1913
|
text-align: left;
|
|
1751
1914
|
overflow: hidden;
|
|
1915
|
+
transition:
|
|
1916
|
+
border-color 160ms var(--dpk-ease),
|
|
1917
|
+
box-shadow 160ms var(--dpk-ease),
|
|
1918
|
+
transform 160ms var(--dpk-ease);
|
|
1752
1919
|
}
|
|
1753
1920
|
|
|
1754
1921
|
.arch-service:hover {
|
|
1755
1922
|
border-color: var(--dpk-blue);
|
|
1923
|
+
box-shadow: var(--dpk-bevel), var(--dpk-shadow-sm);
|
|
1924
|
+
transform: translateY(-1px);
|
|
1756
1925
|
}
|
|
1757
1926
|
|
|
1758
1927
|
.arch-service.is-selected {
|
|
1759
1928
|
border-color: var(--dpk-blue);
|
|
1760
|
-
box-shadow:
|
|
1929
|
+
box-shadow:
|
|
1930
|
+
var(--dpk-bevel),
|
|
1931
|
+
var(--dpk-shadow-sm),
|
|
1932
|
+
0 0 0 3px var(--dpk-blue-soft);
|
|
1761
1933
|
}
|
|
1762
1934
|
|
|
1763
1935
|
.arch-service.is-related {
|
|
@@ -1781,6 +1953,7 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
1781
1953
|
color: var(--dpk-ink-faint);
|
|
1782
1954
|
font-family: var(--dpk-mono);
|
|
1783
1955
|
font-size: 12px;
|
|
1956
|
+
box-shadow: inset 0 1px 2px var(--dpk-shade-1);
|
|
1784
1957
|
}
|
|
1785
1958
|
|
|
1786
1959
|
.arch-body {
|
|
@@ -1842,7 +2015,7 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
1842
2015
|
fill: var(--dpk-blue);
|
|
1843
2016
|
stroke: var(--dpk-blue);
|
|
1844
2017
|
}
|
|
1845
|
-
`,
|
|
2018
|
+
`,Ia=[{id:"arch-neutral"},{id:"arch-selected"}];class vt extends te{static{this.styles=[V,Ra]}#e=!0;parseData(e){return Ea(e)}emptyData(){return qa()}defaultHeading(){return ae(this.locale).heading}statsLabels(){const e=ae(this.locale);return{node:e.node,edge:e.edge}}emptyMessage(){return ae(this.locale).empty}get layoutMode(){return"fixed"}layoutOptions(){return{padding:40}}computePlacement(e){return Oa(super.computePlacement(e),e.edges)}isEmpty(){return this.visible.nodes.length===0}contentSize(){const e=super.contentSize();if(e===null)return null;const t=this.#s();return t.length===0?e:{width:Math.max(e.width,...t.map(s=>s.x+s.width)),height:Math.max(e.height,...t.map(s=>s.y+s.height))}}relations(e,t){if(e===null||e.kind!=="node")return B;const s=j(t.edges,e.id,"outgoing",!1),r=j(t.edges,e.id,"incoming",!1);return{nodes:new Map([...s.nodes,...r.nodes]),edges:new Set([...s.edges,...r.edges])}}renderToolbarActions(){const e=ae(this.locale);return g`
|
|
1846
2019
|
<button
|
|
1847
2020
|
type="button"
|
|
1848
2021
|
class="dpk-btn dpk-btn--ghost arch-toggle"
|
|
@@ -1852,43 +2025,43 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
1852
2025
|
>
|
|
1853
2026
|
${e.boundaries}
|
|
1854
2027
|
</button>
|
|
1855
|
-
`}#s(){const e=this.visible.nodes.flatMap(t=>{const s=this.placedNode(t.id);return s?[{...t,position:{x:s.x,y:s.y}}]:[]});return
|
|
1856
|
-
<g class=${this.elementClass(
|
|
1857
|
-
<title>${
|
|
2028
|
+
`}#s(){const e=this.visible.nodes.flatMap(t=>{const s=this.placedNode(t.id);return s?[{...t,position:{x:s.x,y:s.y}}]:[]});return Aa(e,this.items().boundaries)}renderCanvas(){const e=ae(this.locale),t=this.visible,s=i=>t.nodes.find(n=>n.id===i)?.name??i,r=t.edges.map(i=>{const n=this.edgeState(i.id),o=this.routeOf(i.id),d=ee(o),l=()=>this.select({kind:"edge",id:i.id});return I`
|
|
2029
|
+
<g class=${this.elementClass(n,"d-edge","arch-link")} data-link=${i.id}>
|
|
2030
|
+
<title>${i.label??i.id}</title>
|
|
1858
2031
|
<path
|
|
1859
2032
|
class="d-edge-path"
|
|
1860
2033
|
d=${d}
|
|
1861
|
-
marker-end=${`url(#${
|
|
2034
|
+
marker-end=${`url(#${n.selected?"arch-selected":"arch-neutral"})`}
|
|
1862
2035
|
></path>
|
|
1863
2036
|
<path
|
|
1864
2037
|
class="d-edge-hit"
|
|
1865
2038
|
d=${d}
|
|
1866
2039
|
role="button"
|
|
1867
2040
|
tabindex="0"
|
|
1868
|
-
aria-label=${e.edgeLabel(s(
|
|
2041
|
+
aria-label=${e.edgeLabel(s(i.from),s(i.to))}
|
|
1869
2042
|
@click=${l}
|
|
1870
2043
|
@keydown=${m=>{m.key!=="Enter"&&m.key!==" "||(m.preventDefault(),l())}}
|
|
1871
2044
|
></path>
|
|
1872
|
-
${
|
|
1873
|
-
${this.renderEdgeCommentTrigger({kind:"edge",id:
|
|
2045
|
+
${i.label===null||o.length===0?w:this.#a(i.label,o)}
|
|
2046
|
+
${this.renderEdgeCommentTrigger({kind:"edge",id:i.id},`${s(i.from)} \u2192 ${s(i.to)}${i.label===null?"":` \xB7 ${i.label}`}`,o)}
|
|
1874
2047
|
</g>
|
|
1875
2048
|
`});return g`
|
|
1876
|
-
${this.#e?this.#s().map(
|
|
1877
|
-
class=${`arch-boundary ${
|
|
1878
|
-
data-boundary=${
|
|
1879
|
-
style="left:${
|
|
2049
|
+
${this.#e?this.#s().map(i=>g`<div
|
|
2050
|
+
class=${`arch-boundary ${i.boundary.kind==="external"?"is-external":""}`}
|
|
2051
|
+
data-boundary=${i.boundary.id}
|
|
2052
|
+
style="left:${i.x}px; top:${i.y}px; width:${i.width}px; height:${i.height}px"
|
|
1880
2053
|
>
|
|
1881
|
-
<span>${
|
|
2054
|
+
<span>${i.boundary.label}</span>
|
|
1882
2055
|
</div>`):w}
|
|
1883
|
-
${this.renderEdges(
|
|
1884
|
-
`}#
|
|
2056
|
+
${this.renderEdges(r,Ia)} ${t.nodes.map(i=>this.#t(i,e))}
|
|
2057
|
+
`}#a(e,t){const s=t[Math.floor(t.length/2)]??t[0];return s?I`<text class="arch-link-label" x=${s.x} y=${s.y-6}>${e}</text>`:g``}#t(e,t){const s=this.placedNode(e.id);if(!s)return w;const r=this.nodeState(e.id);return g`
|
|
1885
2058
|
<button
|
|
1886
2059
|
type="button"
|
|
1887
|
-
class=${this.elementClass(
|
|
2060
|
+
class=${this.elementClass(r,"d-node","arch-service")}
|
|
1888
2061
|
data-service=${e.id}
|
|
1889
2062
|
data-grill-questions=${this.questionsOf(e)}
|
|
1890
2063
|
style="left:${s.x}px; top:${s.y}px; width:${e.width}px; height:${e.height}px"
|
|
1891
|
-
aria-pressed=${
|
|
2064
|
+
aria-pressed=${r.selected?"true":"false"}
|
|
1892
2065
|
title=${e.description??e.name}
|
|
1893
2066
|
@click=${()=>this.select({kind:"node",id:e.id})}
|
|
1894
2067
|
>
|
|
@@ -1904,7 +2077,7 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
1904
2077
|
</span>
|
|
1905
2078
|
</button>
|
|
1906
2079
|
${this.renderCommentTrigger({kind:"node",id:e.id},e.name,{x:s.x+e.width-20,y:s.y-14})}
|
|
1907
|
-
`}}const yt=()=>{customElements.get("dpk-component-architecture-map")||customElements.define("dpk-component-architecture-map",vt)},wt=[72,52,40],$t=[0,22,10,8],
|
|
2080
|
+
`}}const yt=()=>{customElements.get("dpk-component-architecture-map")||customElements.define("dpk-component-architecture-map",vt)},wt=[72,52,40],$t=[0,22,10,8],Pa=a=>wt[Math.min(a,wt.length-1)]??40,St=a=>$t[Math.min(a,$t.length-1)]??8,ja=(a,e={})=>{const t=e.padding??40,s=a.nodes.find(x=>x.parent===null);if(s===void 0)return{width:0,height:0,nodes:[],routes:[]};const r=new Map(a.nodes.map(x=>[x.id,x])),i=x=>x.children.flatMap(D=>{const A=r.get(D);return A===void 0?[]:[A]}),n=new Map,o=x=>x.reduce((D,A,H)=>D+d(A)+(H===0?0:St(A.depth)),0),d=x=>{const D=n.get(x.id);if(D!==void 0)return D;const A=Math.max(x.height,o(i(x)));return n.set(x.id,A),A},l=[],m=(x,D,A)=>{if(D.length===0)return;const H=Pa(x.node.depth);let u=x.y+x.node.height/2-o(D)/2;for(const y of D){const q=d(y),R={x:A==="right"?x.x+x.node.width+H:x.x-H-y.width,y:u+q/2-y.height/2,node:y};l.push(R),m(R,i(y),A),u+=q+St(y.depth)}},b={x:-s.width/2,y:-s.height/2,node:s};l.push(b);const c=i(s);m(b,c.filter(x=>x.side!=="left"),"right"),m(b,c.filter(x=>x.side==="left"),"left");const h=Math.min(...l.map(x=>x.x)),M=Math.min(...l.map(x=>x.y)),v=Math.max(...l.map(x=>x.x+x.node.width)),k=Math.max(...l.map(x=>x.y+x.node.height)),C=t-h,T=t-M,O=new Map,P=l.map(x=>{const D=O.get(x.node.depth)??0;return O.set(x.node.depth,D+1),{id:x.node.id,x:x.x+C,y:x.y+T,width:x.node.width,height:x.node.height,layer:x.node.depth,order:D}}),F=new Map(P.map(x=>[x.id,x])),oe=a.edges.flatMap(x=>{const D=F.get(x.from),A=F.get(x.to),H=r.get(x.to);if(D===void 0||A===void 0||H===void 0)return[];const u=H.side==="left",y={x:u?D.x:D.x+D.width,y:D.y+D.height/2},q={x:u?A.x+A.width:A.x,y:A.y+A.height/2};return[{id:x.id,points:[y,q]}]});return{width:v-h+t*2,height:k-M+t*2,nodes:P,routes:oe}},Fa=a=>{const e=a[0],t=a.at(-1);if(e===void 0||t===void 0)return"";const s=(t.x-e.x)/2;return`M${e.x} ${e.y} C${e.x+s} ${e.y} ${t.x-s} ${t.y} ${t.x} ${t.y}`},re=N({en:{heading:"Mind map",empty:"No matching topics.",topics:"Topic",toggleOpen:(a,e)=>`Open ${e} subtopics of ${a}`,toggleClose:a=>`Collapse subtopics of ${a}`,addSubtopicButton:"+ Subtopic",commentButton:"Comment",addSubtopicAriaLabel:a=>`Subtopic of ${a}`,addSubtopicPlaceholder:"Subtopic title (Enter to add)",notRecorded:"Could not record it. Place this inside a dpk-template-* element.",addTopicTitle:"Add topic",addSummary:(a,e)=>`${a} \u203A ${e}`},ja:{heading:"\u30DE\u30A4\u30F3\u30C9\u30DE\u30C3\u30D7",empty:"\u8A72\u5F53\u3059\u308B\u30C8\u30D4\u30C3\u30AF\u306F\u3042\u308A\u307E\u305B\u3093\u3002",topics:"\u30C8\u30D4\u30C3\u30AF",toggleOpen:(a,e)=>`${a} \u306E\u30B5\u30D6\u30C8\u30D4\u30C3\u30AF ${e} \u4EF6\u3092\u3072\u3089\u304F`,toggleClose:a=>`${a} \u306E\u30B5\u30D6\u30C8\u30D4\u30C3\u30AF\u3092\u305F\u305F\u3080`,addSubtopicButton:"\uFF0B \u30B5\u30D6\u30C8\u30D4\u30C3\u30AF",commentButton:"\u30B3\u30E1\u30F3\u30C8",addSubtopicAriaLabel:a=>`${a} \u306E\u30B5\u30D6\u30C8\u30D4\u30C3\u30AF`,addSubtopicPlaceholder:"\u30B5\u30D6\u30C8\u30D4\u30C3\u30AF\u540D\uFF08Enter \u3067\u8FFD\u52A0\uFF09",notRecorded:"\u8A18\u9332\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\uFF08dpk-template-* \u8981\u7D20\u306E\u4E2D\u306B\u7F6E\u3044\u3066\u304F\u3060\u3055\u3044\uFF09\u3002",addTopicTitle:"\u30C8\u30D4\u30C3\u30AF\u3092\u8FFD\u52A0",addSummary:(a,e)=>`${a} \u203A ${e}`}}),Mt=Jt(()=>E({id:$(p(),S(1)),label:$(p(),S(1)),description:f(p()),tags:f(z(p())),questions:f(p()),collapsed:f(ge()),side:f(U(["left","right"])),children:f(z(Mt))})),Ha=E({root:Mt}),Ct=()=>({root:null,nodes:[],edges:[]}),qt=[{fontSize:16,padding:22,height:48,min:120,max:280},{fontSize:13.5,padding:15,height:34,min:80,max:240},{fontSize:12.5,padding:12,height:28,min:56,max:220}],Ua=a=>qt[Math.min(a,qt.length-1)]??{fontSize:12.5,padding:12,height:28,min:56,max:220},Ba=(a,e)=>{let t=0;for(const s of a)t+=(s.codePointAt(0)??0)>=11904?e:e*.62;return t},Na=(a,e)=>{const t=Ua(e),s=Math.ceil(Ba(a,t.fontSize)+t.padding*2+4);return{width:Math.min(t.max,Math.max(t.min,s)),height:t.height}},Ce=a=>a.children===void 0||a.children.length===0?1:a.children.reduce((e,t)=>e+Ce(t),0),Et=a=>{const e={left:0,right:0};for(const t of a)t.side!==void 0&&(e[t.side]+=Ce(t));return a.map(t=>{if(t.side!==void 0)return t.side;const s=e.right<=e.left?"right":"left";return e[s]+=Ce(t),s})},Dt=a=>zt(Y(Ha,a).root),zt=(a,e=new Set)=>{const t=[],s=[],r=new Set,i=(n,o,d,l,m)=>{if(r.has(n.id))throw new Error(`duplicate topic id: ${n.id}`);if(r.add(n.id),n.side!==void 0&&d!==1)throw new Error(`side is only allowed on a main topic (a child of the root): ${n.id}`);const b=n.children??[];t.push({id:n.id,label:n.label,description:n.description??null,parent:o,depth:d,branch:l,side:m,children:b.map(h=>h.id),collapsed:n.collapsed??!1,added:e.has(n.id),tags:n.tags??[],...Na(n.label,d),...n.questions===void 0?{}:{questions:n.questions}}),o!==null&&s.push({id:n.id,from:o,to:n.id,tags:[]});const c=d===0?Et(b):[];b.forEach((h,M)=>i(h,n.id,d+1,d===0?M:l,d===0?c[M]??"right":m))};return i(a,null,0,-1,null),{root:a,nodes:t,edges:s}},Tt="ADD_TOPIC",_a=be({id:$(p(),S(1)),label:$(p(),ze(),S(1))}),Ya=a=>{const e=Ue(a);return e?.length===3&&e[1]==="node"?e[2]??null:null},At=(a,e,t)=>a.id===e?{...a,children:[...a.children??[],t]}:a.children===void 0?a:{...a,children:a.children.map(s=>At(s,e,t))},Va=a=>{if(a.children===void 0)return a;const e=Et(a.children);return{...a,children:a.children.map((t,s)=>({...t,side:e[s]??"right"}))}},Wa=(a,e,t)=>{const s=a.addTopicTitle,r=new Map(e.nodes.map(d=>[d.id,d.label])),i=new Set,n=[];let o=e.root===null?null:Va(e.root);for(const d of t){if(d.type!==Tt){n.push({id:d.id,title:d.type,stale:"unsupported-action-type"});continue}const l=Ya(d.target.id),m=l===null?void 0:r.get(l),b=fe(_a,d.payload);if(o===null||l===null||m===void 0){n.push({id:d.id,title:s,stale:"target-missing"});continue}if(!b.success||r.has(b.output.id)){n.push({id:d.id,title:s,stale:"constraint-violated"});continue}const{id:c,label:h}=b.output;o=At(o,l,{id:c,label:h}),r.set(c,h),i.add(c),n.push({id:d.id,title:s,summary:a.addSummary(m,h),tone:"create"})}return{data:o===null||i.size===0?e:zt(o,i),results:n}},qe=(a,e)=>{const t=new Map(a.nodes.map(i=>[i.id,i])),s=[];let r=t.get(e)?.parent??null;for(;r!==null&&!s.includes(r);)s.push(r),r=t.get(r)?.parent??null;return s},Ga=(a,e)=>{const t=new Map(a.nodes.map(i=>[i.id,i]));let s=0;const r=[...t.get(e)?.children??[]];for(let i=r.pop();i!==void 0;i=r.pop())s+=1,r.push(...t.get(i)?.children??[]);return s},Ka=(a,e,t)=>{let s=null;if(e!==null){const n=a.nodes.filter(e);if(n.length===0)return Ct();const o=new Map(a.nodes.map(l=>[l.id,l])),d=new Set;for(const l of n){d.add(l.id);for(const b of qe(a,l.id))d.add(b);const m=[...l.children];for(let b=m.pop();b!==void 0;b=m.pop())d.add(b),m.push(...o.get(b)?.children??[])}s=d}const r=a.nodes.filter(n=>(s===null||s.has(n.id))&&!qe(a,n.id).some(o=>t.has(o))),i=new Set(r.map(n=>n.id));return{...a,nodes:r,edges:a.edges.filter(n=>i.has(n.from)&&i.has(n.to))}},Xa=_`
|
|
1908
2081
|
.branch-root {
|
|
1909
2082
|
--mind-color: var(--dpk-ink);
|
|
1910
2083
|
--mind-soft: var(--dpk-paper-sunken);
|
|
@@ -1942,7 +2115,11 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
1942
2115
|
font-family: var(--dpk-body);
|
|
1943
2116
|
font-size: 12.5px;
|
|
1944
2117
|
line-height: 1.3;
|
|
1945
|
-
box-shadow: var(--dpk-shadow-xs);
|
|
2118
|
+
box-shadow: var(--dpk-bevel), var(--dpk-shadow-xs);
|
|
2119
|
+
transition:
|
|
2120
|
+
border-color 160ms var(--dpk-ease),
|
|
2121
|
+
box-shadow 160ms var(--dpk-ease),
|
|
2122
|
+
transform 160ms var(--dpk-ease);
|
|
1946
2123
|
}
|
|
1947
2124
|
|
|
1948
2125
|
.mind-label {
|
|
@@ -1955,12 +2132,14 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
1955
2132
|
.mind-topic.depth-0 {
|
|
1956
2133
|
padding: 0 22px;
|
|
1957
2134
|
border: 0;
|
|
1958
|
-
background: var(--dpk-ink);
|
|
2135
|
+
background: linear-gradient(155deg, color-mix(in srgb, var(--dpk-ink) 88%, transparent), var(--dpk-ink));
|
|
1959
2136
|
color: var(--dpk-paper-raised);
|
|
1960
2137
|
font-size: 16px;
|
|
1961
2138
|
font-weight: 680;
|
|
1962
2139
|
letter-spacing: -0.01em;
|
|
1963
|
-
box-shadow:
|
|
2140
|
+
box-shadow:
|
|
2141
|
+
inset 0 1px 0 var(--dpk-highlight),
|
|
2142
|
+
var(--dpk-shadow-sm);
|
|
1964
2143
|
}
|
|
1965
2144
|
|
|
1966
2145
|
.mind-topic.depth-1 {
|
|
@@ -1978,15 +2157,23 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
1978
2157
|
|
|
1979
2158
|
.mind-topic:hover {
|
|
1980
2159
|
border-color: var(--mind-color);
|
|
2160
|
+
box-shadow: var(--dpk-bevel), var(--dpk-shadow-sm);
|
|
2161
|
+
transform: translateY(-1px);
|
|
1981
2162
|
}
|
|
1982
2163
|
|
|
1983
2164
|
.mind-topic.is-selected {
|
|
1984
2165
|
border-color: var(--mind-color);
|
|
1985
|
-
box-shadow:
|
|
2166
|
+
box-shadow:
|
|
2167
|
+
var(--dpk-bevel),
|
|
2168
|
+
var(--dpk-shadow-sm),
|
|
2169
|
+
0 0 0 3px color-mix(in srgb, var(--mind-color) 22%, transparent);
|
|
1986
2170
|
}
|
|
1987
2171
|
|
|
1988
2172
|
.mind-topic.depth-0.is-selected {
|
|
1989
|
-
box-shadow:
|
|
2173
|
+
box-shadow:
|
|
2174
|
+
inset 0 1px 0 var(--dpk-highlight),
|
|
2175
|
+
var(--dpk-shadow-sm),
|
|
2176
|
+
0 0 0 3px var(--dpk-blue-soft);
|
|
1990
2177
|
}
|
|
1991
2178
|
|
|
1992
2179
|
.mind-topic.is-related {
|
|
@@ -2070,7 +2257,15 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
2070
2257
|
line-height: 1;
|
|
2071
2258
|
cursor: pointer;
|
|
2072
2259
|
opacity: 0;
|
|
2073
|
-
|
|
2260
|
+
box-shadow: var(--dpk-bevel), var(--dpk-shadow-xs);
|
|
2261
|
+
transition:
|
|
2262
|
+
opacity 120ms ease,
|
|
2263
|
+
box-shadow 160ms var(--dpk-ease);
|
|
2264
|
+
}
|
|
2265
|
+
|
|
2266
|
+
.mind-toggle:hover,
|
|
2267
|
+
.mind-toggle:focus-visible {
|
|
2268
|
+
box-shadow: var(--dpk-bevel), var(--dpk-shadow-sm);
|
|
2074
2269
|
}
|
|
2075
2270
|
|
|
2076
2271
|
/* Expanded toggles appear with their topic; folded ones always show the count. */
|
|
@@ -2099,33 +2294,33 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
2099
2294
|
opacity: 1;
|
|
2100
2295
|
}
|
|
2101
2296
|
}
|
|
2102
|
-
`,
|
|
2103
|
-
${this.renderEdges(e.edges.map(s=>this.#
|
|
2104
|
-
${e.nodes.map(s=>this.#
|
|
2105
|
-
`}#
|
|
2297
|
+
`,Za=5;class Lt extends te{static{this.styles=[V,Xa]}#e=new Set;#s=null;#a=!1;#t=null;toggle(e,t){const s=this.items().nodes.find(i=>i.id===e);if(s===void 0||s.children.length===0)return;const r=t??!this.#e.has(e);if(r!==this.#e.has(e)){if(r){this.#e.add(e);const i=this.selection;i!==null&&qe(this.items(),i.id).includes(e)&&this.select(null)}else this.#e.delete(e);this.requestUpdate()}}get collapsed(){return[...this.#e]}parseData(e){return Dt(e)}emptyData(){return Ct()}reduceElementActions(e,t){return Wa(re(this.locale),e,t)}defaultHeading(){return re(this.locale).heading}emptyMessage(){return re(this.locale).empty}statsText(){const e=re(this.locale),t=this.items().nodes.length,s=this.filtered().nodes.length;return s===t?`${t} ${e.topics}`:`${s} / ${t} ${e.topics}`}filtered(){const e=this.tagFilter,t=e.active.length===0?null:s=>K(s.tags,e);return Ka(this.items(),t,this.#e)}layoutSignature(){return this.filtered().nodes.map(e=>`${e.id}<${e.parent??""}:${e.side??""}`).join(",")}computePlacement(e){return ja(e)}refreshContent(){const e=this.authoredItems();e!==this.#s&&(this.#s=e,this.#e=new Set(e.nodes.filter(t=>t.collapsed).map(t=>t.id)),this.#a=!1,this.#t=null),super.refreshContent()}initialView(){if(this.#a){this.viewport?.apply();return}this.#a=!0,this.viewport?.fit()}commentItems(){return this.items().nodes.map(e=>({value:this.commentRef("node",e.id),label:e.label}))}hasSelection(e){return e.kind==="node"&&this.items().nodes.some(t=>t.id===e.id)}relations(e,t){if(e===null||e.kind!=="node")return{nodes:new Map,edges:new Set};const s=j(t.edges,e.id,"outgoing",!0),r=j(t.edges,e.id,"incoming",!0);return{nodes:new Map([...s.nodes,...r.nodes]),edges:new Set([...s.edges,...r.edges])}}renderSelection(){return w}renderCanvas(){const e=this.filtered(),t=re(this.locale);return g`
|
|
2298
|
+
${this.renderEdges(e.edges.map(s=>this.#n(s)),[])}
|
|
2299
|
+
${e.nodes.map(s=>this.#i(s,t))} ${this.#l(t)}
|
|
2300
|
+
`}#r(e){return e===void 0||e.branch<0?"branch-root":`branch-${e.branch%Za}`}#n(e){const t=this.items().nodes.find(r=>r.id===e.to),s=this.edgeState(e.id);return I`
|
|
2106
2301
|
<path
|
|
2107
|
-
class=${this.elementClass(s,"d-edge","mind-branch",this.#
|
|
2302
|
+
class=${this.elementClass(s,"d-edge","mind-branch",this.#r(t),`depth-${Math.min(t?.depth??1,3)}`)}
|
|
2108
2303
|
data-branch=${e.id}
|
|
2109
|
-
d=${
|
|
2304
|
+
d=${Fa(this.routeOf(e.id))}
|
|
2110
2305
|
></path>
|
|
2111
|
-
`}#
|
|
2306
|
+
`}#i(e,t){const s=this.placedNode(e.id);if(!s)return w;const r=this.nodeState(e.id),i=this.#e.has(e.id),n=`depth-${Math.min(e.depth,3)}`;return g`
|
|
2112
2307
|
<button
|
|
2113
2308
|
type="button"
|
|
2114
|
-
class=${this.elementClass(
|
|
2309
|
+
class=${this.elementClass(r,"d-node","mind-topic",n,this.#r(e),i&&"is-folded",e.added&&"is-added")}
|
|
2115
2310
|
data-topic=${e.id}
|
|
2116
2311
|
data-grill-questions=${this.questionsOf(e)}
|
|
2117
2312
|
style="left:${s.x}px; top:${s.y}px; width:${s.width}px; height:${s.height}px"
|
|
2118
|
-
aria-pressed=${
|
|
2313
|
+
aria-pressed=${r.selected?"true":"false"}
|
|
2119
2314
|
title=${e.description??e.label}
|
|
2120
2315
|
@click=${()=>this.select({kind:"node",id:e.id})}
|
|
2121
2316
|
>
|
|
2122
2317
|
<span class="mind-label">${e.label}</span>
|
|
2123
2318
|
</button>
|
|
2124
|
-
${e.depth===0||e.children.length===0?w:this.#o(e,s,r
|
|
2125
|
-
`}#o(e,t,s,
|
|
2319
|
+
${e.depth===0||e.children.length===0?w:this.#o(e,s,i,r.dimmed,t)}
|
|
2320
|
+
`}#o(e,t,s,r,i){const n=s?Ga(this.items(),e.id):0,o=e.side==="left"?t.x:t.x+t.width,d=s?i.toggleOpen(e.label,n):i.toggleClose(e.label);return g`
|
|
2126
2321
|
<button
|
|
2127
2322
|
type="button"
|
|
2128
|
-
class=${this.elementClass({selected:!1,related:!1,dimmed:
|
|
2323
|
+
class=${this.elementClass({selected:!1,related:!1,dimmed:r,depth:null},"mind-toggle",this.#r(e),s&&"is-folded")}
|
|
2129
2324
|
data-toggle=${e.id}
|
|
2130
2325
|
style="left:${o}px; top:${t.y+t.height/2}px"
|
|
2131
2326
|
aria-expanded=${s?"false":"true"}
|
|
@@ -2133,16 +2328,16 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
2133
2328
|
title=${d}
|
|
2134
2329
|
@click=${l=>{l.stopPropagation(),this.toggle(e.id)}}
|
|
2135
2330
|
>
|
|
2136
|
-
${s?
|
|
2331
|
+
${s?n:"\u2212"}
|
|
2137
2332
|
</button>
|
|
2138
|
-
`}#l(e){const t=this.selection;if(t===null||t.kind!=="node")return w;const s=this.items().nodes.find(
|
|
2333
|
+
`}#l(e){const t=this.selection;if(t===null||t.kind!=="node")return w;const s=this.items().nodes.find(n=>n.id===t.id),r=this.placedNode(t.id);if(s===void 0||r===void 0)return w;const i=this.#t?.parent===s.id?this.#t:null;return g`
|
|
2139
2334
|
<div
|
|
2140
2335
|
class="mind-actions"
|
|
2141
2336
|
data-for=${s.id}
|
|
2142
|
-
style="left:${this.#p(s,
|
|
2143
|
-
@click=${
|
|
2337
|
+
style="left:${this.#p(s,r)}px; top:${r.y+r.height+8}px"
|
|
2338
|
+
@click=${n=>n.stopPropagation()}
|
|
2144
2339
|
>
|
|
2145
|
-
${
|
|
2340
|
+
${i===null?g`
|
|
2146
2341
|
<button type="button" class="dpk-btn" data-action="add" @click=${()=>this.#u(s.id)}>
|
|
2147
2342
|
${e.addSubtopicButton}
|
|
2148
2343
|
</button>
|
|
@@ -2159,14 +2354,14 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
2159
2354
|
class="dpk-input"
|
|
2160
2355
|
aria-label="${e.addSubtopicAriaLabel(s.label)}"
|
|
2161
2356
|
placeholder="${e.addSubtopicPlaceholder}"
|
|
2162
|
-
.value=${
|
|
2163
|
-
@input=${
|
|
2164
|
-
@keydown=${
|
|
2357
|
+
.value=${i.label}
|
|
2358
|
+
@input=${n=>{const o=n.currentTarget;o instanceof HTMLInputElement&&(this.#t={...i,label:o.value,failed:!1})}}
|
|
2359
|
+
@keydown=${n=>this.#c(n,s.id)}
|
|
2165
2360
|
/>
|
|
2166
|
-
${
|
|
2361
|
+
${i.failed?g`<span class="mind-actions-error" role="alert">${e.notRecorded}</span>`:w}
|
|
2167
2362
|
`}
|
|
2168
2363
|
</div>
|
|
2169
|
-
`}#p(e,t){return e.side==="left"?t.x+t.width-220:t.x}#u(e){this.#t={parent:e,label:"",failed:!1},this.requestUpdate(),this.updateComplete.then(()=>this.renderRoot.querySelector(".mind-actions input")?.focus())}#c(e,t){if(e.isComposing)return;if(e.key==="Escape"){e.preventDefault(),this.#t=null,this.requestUpdate();return}if(e.key!=="Enter")return;e.preventDefault();const s=this.#t?.label.trim()??"";if(s.length===0)return;const
|
|
2364
|
+
`}#p(e,t){return e.side==="left"?t.x+t.width-220:t.x}#u(e){this.#t={parent:e,label:"",failed:!1},this.requestUpdate(),this.updateComplete.then(()=>this.renderRoot.querySelector(".mind-actions input")?.focus())}#c(e,t){if(e.isComposing)return;if(e.key==="Escape"){e.preventDefault(),this.#t=null,this.requestUpdate();return}if(e.key!=="Enter")return;e.preventDefault();const s=this.#t?.label.trim()??"";if(s.length===0)return;const r=Te(`topic ${s}`,this.items().nodes.map(n=>n.id));if(!this.dispatchElementAction(Tt,["node",t],{id:r,label:s})){this.#t={parent:t,label:s,failed:!0},this.requestUpdate();return}this.#t=null,this.#e.delete(t),this.select({kind:"node",id:r}),this.requestUpdate()}}const Ot=()=>{customElements.get("dpk-component-mind-map")||customElements.define("dpk-component-mind-map",Lt)},ne=N({en:{heading:"Kanban",empty:"No columns.",cards:"Card",notRecorded:"Could not record it. Place this inside a dpk-template-* element.",wipLimit:a=>`WIP limit ${a}`,addCardButton:"+ Card",addCardAriaLabel:a=>`Card to add to ${a}`,addCardPlaceholder:"Card title (Enter to add)",addCardTitle:"Add card",moveCardTitle:"Move card",addSummary:(a,e)=>`${a} \u203A ${e}`,moveSummarySame:(a,e)=>`${a}: reorder within ${e}`,moveSummaryAcross:(a,e,t)=>`${a}: ${e} \u2192 ${t}`},ja:{heading:"\u30AB\u30F3\u30D0\u30F3",empty:"\u5217\u304C\u3042\u308A\u307E\u305B\u3093\u3002",cards:"\u30AB\u30FC\u30C9",notRecorded:"\u8A18\u9332\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\uFF08dpk-template-* \u8981\u7D20\u306E\u4E2D\u306B\u7F6E\u3044\u3066\u304F\u3060\u3055\u3044\uFF09\u3002",wipLimit:a=>`WIP \u4E0A\u9650 ${a}`,addCardButton:"\uFF0B \u30AB\u30FC\u30C9",addCardAriaLabel:a=>`${a} \u306B\u8FFD\u52A0\u3059\u308B\u30AB\u30FC\u30C9`,addCardPlaceholder:"\u30AB\u30FC\u30C9\u540D\uFF08Enter \u3067\u8FFD\u52A0\uFF09",addCardTitle:"\u30AB\u30FC\u30C9\u3092\u8FFD\u52A0",moveCardTitle:"\u30AB\u30FC\u30C9\u3092\u79FB\u52D5",addSummary:(a,e)=>`${a} \u203A ${e}`,moveSummarySame:(a,e)=>`${a}: ${e} \u5185\u3067\u4E26\u3079\u66FF\u3048`,moveSummaryAcross:(a,e,t)=>`${a}: ${e} \u2192 ${t}`}}),Ja=E({id:$(p(),S(1)),title:$(p(),S(1)),description:f(p()),tags:f(z(p())),assignee:f(p()),questions:f(p())}),Qa=["gray","blue","green","amber","violet","red"],er=E({id:$(p(),S(1)),label:$(p(),S(1)),description:f(p()),color:f(U(Qa)),limit:f($(Q(),es(),Qt(1))),cards:f(z(Ja))}),tr=E({columns:z(er)}),sr=()=>({columns:[]}),Rt=a=>{const e=Y(tr,a),t=new Set,s=new Set;return{columns:e.columns.map(i=>{if(t.has(i.id))throw new Error(`duplicate column id: ${i.id}`);return t.add(i.id),{id:i.id,label:i.label,description:i.description??null,color:i.color??null,limit:i.limit??null,cards:(i.cards??[]).map(n=>{if(s.has(n.id))throw new Error(`duplicate card id: ${n.id}`);return s.add(n.id),{id:n.id,title:n.title,description:n.description??null,tags:n.tags??[],assignee:n.assignee??null,...n.questions===void 0?{}:{questions:n.questions},column:i.id,change:null}})}})}},ue=(a,e)=>a.columns.flatMap(t=>t.cards).find(t=>t.id===e),ie=a=>a.columns.flatMap(e=>e.cards),ar=(a,e)=>e===null?a:{columns:a.columns.map(t=>({...t,cards:t.cards.filter(e)}))},rr=(a,e,t,s)=>{const r=ue(a,e);if(r===void 0||r.column!==t)return!1;if(s===e)return!0;const i=a.columns.find(o=>o.id===t)?.cards??[],n=i.findIndex(o=>o.id===e);return(i[n+1]?.id??null)===s},It="ADD_CARD",Pt="MOVE_CARD",nr=be({id:$(p(),S(1)),title:$(p(),ze(),S(1))}),ir=be({column:$(p(),S(1)),before:ts($(p(),S(1)))}),jt=(a,e)=>{const t=Ue(a);return t?.length===3&&t[1]===e?t[2]??null:null},or=(a,e)=>({columns:a.columns.map(t=>t.cards.some(s=>s.id===e)?{...t,cards:t.cards.filter(s=>s.id!==e)}:t)}),Ft=(a,e,t)=>({columns:a.columns.map(s=>{if(s.id!==t.column)return s;const r={...e,column:s.id},i=t.before===null?-1:s.cards.findIndex(n=>n.id===t.before);return{...s,cards:i<0?[...s.cards,r]:[...s.cards.slice(0,i),r,...s.cards.slice(i)]}})}),dr=(a,e,t)=>{const s=a.addCardTitle,r=jt(t.target.id,"column"),i=e.columns.find(d=>d.id===r);if(i===void 0)return{data:e,result:{id:t.id,title:s,stale:"target-missing"}};const n=fe(nr,t.payload);if(!n.success||ue(e,n.output.id)!==void 0)return{data:e,result:{id:t.id,title:s,stale:"constraint-violated"}};const o={id:n.output.id,title:n.output.title,description:null,tags:[],assignee:null,column:i.id,change:"added"};return{data:Ft(e,o,{column:i.id,before:null}),result:{id:t.id,title:s,summary:a.addSummary(i.label,o.title),tone:"create"}}},lr=(a,e,t)=>{const s=a.moveCardTitle,r=jt(t.target.id,"card"),i=r===null?void 0:ue(e,r);if(i===void 0)return{data:e,result:{id:t.id,title:s,stale:"target-missing"}};const n=fe(ir,t.payload),o=e.columns.find(h=>h.id===i.column),d=n.success?e.columns.find(h=>h.id===n.output.column):void 0,l=n.success?n.output.before:null,m=l===null||l!==i.id&&d?.cards.some(h=>h.id===l)===!0;if(!n.success||o===void 0||d===void 0||!m)return{data:e,result:{id:t.id,title:s,stale:"constraint-violated"}};const b={...i,change:i.change??"moved"},c=o.id===d.id?a.moveSummarySame(i.title,d.label):a.moveSummaryAcross(i.title,o.label,d.label);return{data:Ft(or(e,i.id),b,{column:d.id,before:l}),result:{id:t.id,title:s,summary:c,tone:"move"}}},cr=(a,e,t)=>{let s=e;const r=[];for(const i of t){const n=i.type===It?dr(a,s,i):i.type===Pt?lr(a,s,i):{data:s,result:{id:i.id,title:i.type,stale:"unsupported-action-type"}};s=n.data,r.push(n.result)}return{data:s,results:r}},pr=_`
|
|
2170
2365
|
.kanban-board {
|
|
2171
2366
|
display: flex;
|
|
2172
2367
|
align-items: flex-start;
|
|
@@ -2182,21 +2377,28 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
2182
2377
|
width: 264px;
|
|
2183
2378
|
padding: 10px;
|
|
2184
2379
|
border: 1px solid var(--dpk-rule);
|
|
2185
|
-
border-radius: var(--dpk-radius);
|
|
2380
|
+
border-radius: var(--dpk-radius-lg);
|
|
2186
2381
|
background: var(--dpk-paper-sunken);
|
|
2382
|
+
box-shadow: inset 0 1px 3px var(--dpk-shade-1);
|
|
2187
2383
|
cursor: default;
|
|
2188
2384
|
transition:
|
|
2189
|
-
border-color 150ms ease,
|
|
2190
|
-
box-shadow 150ms ease;
|
|
2385
|
+
border-color 150ms var(--dpk-ease),
|
|
2386
|
+
box-shadow 150ms var(--dpk-ease);
|
|
2191
2387
|
}
|
|
2192
2388
|
|
|
2193
2389
|
.kanban-column.is-selected {
|
|
2194
|
-
border-color: var(--dpk-
|
|
2195
|
-
box-shadow:
|
|
2390
|
+
border-color: color-mix(in srgb, var(--dpk-blue) 55%, transparent);
|
|
2391
|
+
box-shadow:
|
|
2392
|
+
inset 0 1px 3px var(--dpk-shade-1),
|
|
2393
|
+
inset 0 0 0 2px color-mix(in srgb, var(--dpk-blue) 40%, transparent);
|
|
2196
2394
|
}
|
|
2197
2395
|
|
|
2198
2396
|
.kanban-column.is-drop-target {
|
|
2199
2397
|
border-color: var(--dpk-blue);
|
|
2398
|
+
background: color-mix(in srgb, var(--dpk-blue-soft) 60%, var(--dpk-paper-sunken));
|
|
2399
|
+
box-shadow:
|
|
2400
|
+
inset 0 1px 3px var(--dpk-shade-1),
|
|
2401
|
+
inset 0 0 0 2px color-mix(in srgb, var(--dpk-blue) 30%, transparent);
|
|
2200
2402
|
}
|
|
2201
2403
|
|
|
2202
2404
|
.kanban-column-head {
|
|
@@ -2219,6 +2421,7 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
2219
2421
|
font-family: var(--dpk-body);
|
|
2220
2422
|
font-size: 13px;
|
|
2221
2423
|
font-weight: 650;
|
|
2424
|
+
letter-spacing: -0.01em;
|
|
2222
2425
|
text-align: left;
|
|
2223
2426
|
cursor: pointer;
|
|
2224
2427
|
}
|
|
@@ -2276,6 +2479,8 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
2276
2479
|
font-family: var(--dpk-mono);
|
|
2277
2480
|
font-size: 11px;
|
|
2278
2481
|
font-weight: 600;
|
|
2482
|
+
font-variant-numeric: tabular-nums;
|
|
2483
|
+
box-shadow: var(--dpk-bevel), var(--dpk-shadow-xs);
|
|
2279
2484
|
}
|
|
2280
2485
|
|
|
2281
2486
|
/* Over its WIP limit: the column asks for attention, not the cards. */
|
|
@@ -2323,21 +2528,27 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
2323
2528
|
background: var(--dpk-paper-raised);
|
|
2324
2529
|
color: var(--dpk-ink);
|
|
2325
2530
|
font-family: var(--dpk-body);
|
|
2326
|
-
box-shadow: var(--dpk-shadow-xs);
|
|
2531
|
+
box-shadow: var(--dpk-bevel), var(--dpk-shadow-xs);
|
|
2327
2532
|
cursor: grab;
|
|
2328
2533
|
transition:
|
|
2329
|
-
border-color 150ms ease,
|
|
2330
|
-
box-shadow 150ms ease,
|
|
2331
|
-
opacity 150ms ease
|
|
2534
|
+
border-color 150ms var(--dpk-ease),
|
|
2535
|
+
box-shadow 150ms var(--dpk-ease),
|
|
2536
|
+
opacity 150ms var(--dpk-ease),
|
|
2537
|
+
transform 150ms var(--dpk-ease);
|
|
2332
2538
|
}
|
|
2333
2539
|
|
|
2334
2540
|
.kanban-card:hover {
|
|
2335
|
-
border-color: var(--dpk-rule-
|
|
2541
|
+
border-color: var(--dpk-rule-hover);
|
|
2542
|
+
box-shadow: var(--dpk-bevel), var(--dpk-shadow-sm);
|
|
2543
|
+
transform: translateY(-1px);
|
|
2336
2544
|
}
|
|
2337
2545
|
|
|
2338
2546
|
.kanban-card.is-selected {
|
|
2339
|
-
border-color: var(--dpk-
|
|
2340
|
-
box-shadow:
|
|
2547
|
+
border-color: color-mix(in srgb, var(--dpk-blue) 55%, transparent);
|
|
2548
|
+
box-shadow:
|
|
2549
|
+
var(--dpk-bevel),
|
|
2550
|
+
inset 0 0 0 2px color-mix(in srgb, var(--dpk-blue) 45%, transparent),
|
|
2551
|
+
var(--dpk-shadow-xs);
|
|
2341
2552
|
}
|
|
2342
2553
|
|
|
2343
2554
|
.kanban-card:focus-visible {
|
|
@@ -2346,22 +2557,27 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
2346
2557
|
}
|
|
2347
2558
|
|
|
2348
2559
|
.kanban-card.is-dragging {
|
|
2349
|
-
opacity: 0.
|
|
2560
|
+
opacity: 0.45;
|
|
2561
|
+
transform: rotate(-1.5deg) scale(0.98);
|
|
2562
|
+
box-shadow: var(--dpk-shadow-sm);
|
|
2350
2563
|
}
|
|
2351
2564
|
|
|
2352
2565
|
/* Changed on this page by a draft action: not authored yet. */
|
|
2353
2566
|
.kanban-card.is-added {
|
|
2354
2567
|
border-style: dashed;
|
|
2355
2568
|
border-color: var(--dpk-green);
|
|
2569
|
+
background: linear-gradient(90deg, var(--dpk-green-soft), transparent 60%), var(--dpk-paper-raised);
|
|
2356
2570
|
}
|
|
2357
2571
|
|
|
2358
2572
|
.kanban-card.is-moved {
|
|
2359
2573
|
border-left: 3px solid var(--dpk-blue);
|
|
2574
|
+
background: linear-gradient(90deg, var(--dpk-blue-soft), transparent 60%), var(--dpk-paper-raised);
|
|
2360
2575
|
}
|
|
2361
2576
|
|
|
2362
2577
|
.kanban-card-title {
|
|
2363
2578
|
font-size: 13px;
|
|
2364
|
-
font-weight:
|
|
2579
|
+
font-weight: 600;
|
|
2580
|
+
letter-spacing: -0.005em;
|
|
2365
2581
|
line-height: 1.45;
|
|
2366
2582
|
overflow-wrap: anywhere;
|
|
2367
2583
|
}
|
|
@@ -2386,8 +2602,9 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
2386
2602
|
}
|
|
2387
2603
|
|
|
2388
2604
|
.kanban-tag {
|
|
2389
|
-
padding: 1px
|
|
2390
|
-
border
|
|
2605
|
+
padding: 1px 7px;
|
|
2606
|
+
border: 1px solid var(--dpk-rule);
|
|
2607
|
+
border-radius: 999px;
|
|
2391
2608
|
background: var(--dpk-paper-sunken);
|
|
2392
2609
|
color: var(--dpk-ink-soft);
|
|
2393
2610
|
font-size: 10.5px;
|
|
@@ -2399,6 +2616,17 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
2399
2616
|
font-size: 11px;
|
|
2400
2617
|
}
|
|
2401
2618
|
|
|
2619
|
+
.kanban-assignee::before {
|
|
2620
|
+
content: '';
|
|
2621
|
+
display: inline-block;
|
|
2622
|
+
width: 5px;
|
|
2623
|
+
height: 5px;
|
|
2624
|
+
margin-right: 4px;
|
|
2625
|
+
border-radius: 999px;
|
|
2626
|
+
background: var(--dpk-ink-faint);
|
|
2627
|
+
vertical-align: middle;
|
|
2628
|
+
}
|
|
2629
|
+
|
|
2402
2630
|
.kanban-card-slot > .diagram-comment-trigger {
|
|
2403
2631
|
position: absolute;
|
|
2404
2632
|
top: 5px;
|
|
@@ -2408,9 +2636,9 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
2408
2636
|
|
|
2409
2637
|
.kanban-error {
|
|
2410
2638
|
margin: 6px 0 0;
|
|
2411
|
-
padding: 4px
|
|
2639
|
+
padding: 4px 7px;
|
|
2412
2640
|
border-radius: var(--dpk-radius-xs);
|
|
2413
|
-
background: var(--dpk-
|
|
2641
|
+
background: var(--dpk-accent-soft);
|
|
2414
2642
|
color: var(--dpk-accent);
|
|
2415
2643
|
font-size: 11.5px;
|
|
2416
2644
|
line-height: 1.4;
|
|
@@ -2422,6 +2650,15 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
2422
2650
|
margin: -5.5px 0;
|
|
2423
2651
|
border-radius: 2px;
|
|
2424
2652
|
background: var(--dpk-blue);
|
|
2653
|
+
box-shadow: 0 0 0 3px color-mix(in srgb, var(--dpk-blue) 22%, transparent);
|
|
2654
|
+
animation: dpk-drop-in 140ms var(--dpk-ease-spring) backwards;
|
|
2655
|
+
}
|
|
2656
|
+
|
|
2657
|
+
@keyframes dpk-drop-in {
|
|
2658
|
+
from {
|
|
2659
|
+
opacity: 0;
|
|
2660
|
+
transform: scaleX(0.4);
|
|
2661
|
+
}
|
|
2425
2662
|
}
|
|
2426
2663
|
|
|
2427
2664
|
.kanban-add {
|
|
@@ -2440,11 +2677,16 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
2440
2677
|
font-size: 12px;
|
|
2441
2678
|
text-align: left;
|
|
2442
2679
|
cursor: pointer;
|
|
2680
|
+
transition:
|
|
2681
|
+
border-color 140ms var(--dpk-ease),
|
|
2682
|
+
background 140ms var(--dpk-ease),
|
|
2683
|
+
color 140ms var(--dpk-ease);
|
|
2443
2684
|
}
|
|
2444
2685
|
|
|
2445
2686
|
.kanban-add-button:hover,
|
|
2446
2687
|
.kanban-add-button:focus-visible {
|
|
2447
|
-
border-color: var(--dpk-
|
|
2688
|
+
border-color: color-mix(in srgb, var(--dpk-blue) 45%, var(--dpk-rule-strong));
|
|
2689
|
+
background: var(--dpk-paper-raised);
|
|
2448
2690
|
color: var(--dpk-ink);
|
|
2449
2691
|
outline: none;
|
|
2450
2692
|
}
|
|
@@ -2453,11 +2695,11 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
2453
2695
|
width: 100%;
|
|
2454
2696
|
font-size: 12.5px;
|
|
2455
2697
|
}
|
|
2456
|
-
`;class Ht extends we{static{this.styles=[
|
|
2698
|
+
`;class Ht extends we{static{this.styles=[V,pr]}#e=null;#s=null;#a=null;#t=null;#r=null;parseData(e){return Rt(e)}emptyData(){return sr()}reduceElementActions(e,t){return cr(ne(this.locale),e,t)}defaultHeading(){return ne(this.locale).heading}shellClass(){return"kanban"}emptyMessage(){return ne(this.locale).empty}commentItems(){const e=this.items();return[...e.columns.map(t=>({value:this.commentRef("column",t.id),label:t.label})),...ie(e).map(t=>({value:this.commentRef("card",t.id),label:t.title}))]}hasSelection(e){const t=this.items();return e.kind==="column"?t.columns.some(s=>s.id===e.id):ue(t,e.id)!==void 0}tagItems(){return ie(this.items()).map(e=>e.tags)}statsText(){const e=ne(this.locale),t=ie(this.items()).length,s=ie(this.#n()).length;return s===t?`${t} ${e.cards}`:`${s} / ${t} ${e.cards}`}isEmpty(){return this.items().columns.length===0}viewAlign(){return"start"}contentSize(){if(this.isEmpty())return null;const e=this.renderRoot.querySelector(".kanban-board");return{width:e?.offsetWidth??0,height:e?.offsetHeight??0}}refreshContent(){const e=this.authoredItems();e!==this.#e&&(this.#e=e,this.#s=null,this.#a=null)}renderCanvas(){const e=this.#n(),t=new Map(this.items().columns.map(s=>[s.id,s.cards.length]));return g`<div class="kanban-board">
|
|
2457
2699
|
${me(e.columns,s=>s.id,s=>this.#o(s,t.get(s.id)??0))}
|
|
2458
|
-
</div>`}#
|
|
2700
|
+
</div>`}#n(){const e=this.tagFilter;return ar(this.items(),e.active.length===0?null:t=>K(t.tags,e))}#i(e,t){const s=this.selection;return s!==null&&s.kind===e&&s.id===t}#o(e,t){const s=ne(this.locale),r=e.limit!==null&&t>e.limit,i=this.#r?.column===e.id?this.#r:null;return g`
|
|
2459
2701
|
<section
|
|
2460
|
-
class=${X("kanban-column",
|
|
2702
|
+
class=${X("kanban-column",r&&"is-over",this.#i("column",e.id)&&"is-selected",i!==null&&"is-drop-target")}
|
|
2461
2703
|
data-column=${e.id}
|
|
2462
2704
|
data-color=${e.color??w}
|
|
2463
2705
|
aria-label=${e.label}
|
|
@@ -2466,7 +2708,7 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
2466
2708
|
<button
|
|
2467
2709
|
type="button"
|
|
2468
2710
|
class="kanban-column-title"
|
|
2469
|
-
aria-pressed=${this.#
|
|
2711
|
+
aria-pressed=${this.#i("column",e.id)?"true":"false"}
|
|
2470
2712
|
title=${e.description??e.label}
|
|
2471
2713
|
@click=${()=>this.select({kind:"column",id:e.id})}
|
|
2472
2714
|
>
|
|
@@ -2480,16 +2722,16 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
2480
2722
|
${e.description===null?w:g`<p class="kanban-column-description">${e.description}</p>`}
|
|
2481
2723
|
<div
|
|
2482
2724
|
class="kanban-cards"
|
|
2483
|
-
@dragover=${
|
|
2484
|
-
@dragleave=${
|
|
2485
|
-
@drop=${
|
|
2725
|
+
@dragover=${n=>this.#h(n,e.id)}
|
|
2726
|
+
@dragleave=${n=>this.#m(n)}
|
|
2727
|
+
@drop=${n=>this.#g(n,e.id)}
|
|
2486
2728
|
>
|
|
2487
|
-
${me(e.cards,
|
|
2488
|
-
${
|
|
2729
|
+
${me(e.cards,n=>n.id,n=>g`${i?.before===n.id?this.#l():w}${this.#p(n,s)}`)}
|
|
2730
|
+
${i!==null&&i.before===null?this.#l():w}
|
|
2489
2731
|
</div>
|
|
2490
2732
|
${this.#u(e,s)}
|
|
2491
2733
|
</section>
|
|
2492
|
-
`}#l(){return g`<div class="kanban-drop-marker" aria-hidden="true"></div>`}#p(e,t){const s=this.#
|
|
2734
|
+
`}#l(){return g`<div class="kanban-drop-marker" aria-hidden="true"></div>`}#p(e,t){const s=this.#i("card",e.id);return g`
|
|
2493
2735
|
<div class="kanban-card-slot">
|
|
2494
2736
|
<div
|
|
2495
2737
|
role="button"
|
|
@@ -2501,19 +2743,19 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
2501
2743
|
title=${e.description??e.title}
|
|
2502
2744
|
aria-pressed=${s?"true":"false"}
|
|
2503
2745
|
@click=${()=>this.select({kind:"card",id:e.id})}
|
|
2504
|
-
@keydown=${
|
|
2505
|
-
@dragstart=${
|
|
2746
|
+
@keydown=${r=>this.#c(r,e.id)}
|
|
2747
|
+
@dragstart=${r=>this.#b(r,e.id)}
|
|
2506
2748
|
@dragend=${()=>this.#f()}
|
|
2507
2749
|
>
|
|
2508
2750
|
<span class="kanban-card-title">${e.title}</span>
|
|
2509
2751
|
${e.description===null?w:g`<span class="kanban-card-description">${e.description}</span>`}
|
|
2510
2752
|
${e.tags.length===0&&e.assignee===null?w:g`<span class="kanban-card-meta">
|
|
2511
|
-
${e.tags.map(
|
|
2753
|
+
${e.tags.map(r=>g`<span class="kanban-tag">${r}</span>`)}
|
|
2512
2754
|
${e.assignee===null?w:g`<span class="kanban-assignee">${e.assignee}</span>`}
|
|
2513
2755
|
</span>`}
|
|
2514
2756
|
</div>
|
|
2515
2757
|
${this.renderCommentTrigger({kind:"card",id:e.id},e.title)}
|
|
2516
|
-
${this.#
|
|
2758
|
+
${this.#a===e.id?g`<p class="kanban-error" role="alert">${t.notRecorded}</p>`:w}
|
|
2517
2759
|
</div>
|
|
2518
2760
|
`}#u(e,t){const s=this.#s?.column===e.id?this.#s:null;return g`<div class="kanban-add">
|
|
2519
2761
|
${s===null?g`<button
|
|
@@ -2529,9 +2771,9 @@ import{_ as N,Z as Nt,k as _t,$ as Vt,a0 as _,a1 as w,a2 as g,a3 as me,a4 as I,a
|
|
|
2529
2771
|
aria-label="${t.addCardAriaLabel(e.label)}"
|
|
2530
2772
|
placeholder="${t.addCardPlaceholder}"
|
|
2531
2773
|
.value=${s.title}
|
|
2532
|
-
@input=${
|
|
2533
|
-
@keydown=${
|
|
2774
|
+
@input=${r=>{const i=r.currentTarget;i instanceof HTMLInputElement&&(this.#s={...s,title:i.value,failed:!1})}}
|
|
2775
|
+
@keydown=${r=>this.#y(r,e.id)}
|
|
2534
2776
|
/>
|
|
2535
2777
|
${s.failed?g`<span class="kanban-error" role="alert">${t.notRecorded}</span>`:w}
|
|
2536
2778
|
`}
|
|
2537
|
-
</div>`}#c(e,t){e.target!==e.currentTarget||e.key!=="Enter"&&e.key!==" "||(e.preventDefault(),this.select({kind:"card",id:t}))}#d(e,t){const s=this.dispatchElementAction(Pt,["card",e],{column:t.column,before:t.before});this.#
|
|
2779
|
+
</div>`}#c(e,t){e.target!==e.currentTarget||e.key!=="Enter"&&e.key!==" "||(e.preventDefault(),this.select({kind:"card",id:t}))}#d(e,t){const s=this.dispatchElementAction(Pt,["card",e],{column:t.column,before:t.before});this.#a=s?null:e,this.select({kind:"card",id:e}),this.requestUpdate()}#b(e,t){this.#t=t,e.dataTransfer&&(e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",t)),this.requestUpdate()}#h(e,t){if(this.#t===null)return;e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="move");const s=this.#v(e,t);this.#r?.column===s.column&&this.#r.before===s.before||(this.#r=s,this.requestUpdate())}#m(e){const t=e.currentTarget;!(t instanceof HTMLElement)||e.relatedTarget instanceof Node&&t.contains(e.relatedTarget)||(this.#r=null,this.requestUpdate())}#g(e,t){const s=this.#t;if(s===null)return;e.preventDefault();const r=this.#v(e,t);this.#f(),rr(this.items(),s,r.column,r.before)||this.#d(s,r)}#f(){this.#t===null&&this.#r===null||(this.#t=null,this.#r=null,this.requestUpdate())}#v(e,t){const s=e.currentTarget,i=(s instanceof HTMLElement?[...s.querySelectorAll("[data-card]")]:[]).find(n=>{if(n.dataset.card===this.#t)return!1;const o=n.getBoundingClientRect();return o.top+o.height/2>e.clientY});return{column:t,before:i?.dataset.card??null}}#k(e){this.#s={column:e,title:"",failed:!1},this.requestUpdate(),this.updateComplete.then(()=>this.renderRoot.querySelector(`[data-column="${CSS.escape(e)}"] .kanban-add input`)?.focus({preventScroll:!0}))}#y(e,t){if(e.isComposing)return;if(e.key==="Escape"){e.preventDefault(),this.#s=null,this.requestUpdate();return}if(e.key!=="Enter")return;e.preventDefault();const s=this.#s?.title.trim()??"";if(s.length===0)return;const r=[...this.items().columns.map(n=>n.id),...ie(this.items()).map(n=>n.id)],i=Te(`card ${s}`,r);if(!this.dispatchElementAction(It,["column",t],{id:i,title:s})){this.#s={column:t,title:s,failed:!0},this.requestUpdate();return}this.#s=null,this.select({kind:"card",id:i}),this.requestUpdate()}}const Ut=()=>{customElements.get("dpk-component-kanban")||customElements.define("dpk-component-kanban",Ht)},Bt=()=>{Ke(),at(),it(),bt(),yt(),Ot(),Ut()},hr=()=>{ss(),as(),Bt()};export{vt as D,nt as a,ft as b,Ht as c,Lt as d,st as e,Ge as f,yt as g,it as h,bt as i,Ut as j,Ot as k,at as l,Ke as m,Dt as n,Qe as o,Rt as p,We as q,hr as r,Bt as s};
|