dev-process-kit 0.0.12 → 0.0.13
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/dist/chunks/{shared-DBJaP5gF.js → shared-0MFKKPnB.js} +144 -92
- package/dist/chunks/{shared-DUq2-pM9.js → shared-B2YRwZ0P.js} +99 -60
- package/dist/chunks/{shared-y3FwoRgh.js → shared-B4Mwapvi.js} +88 -62
- package/dist/chunks/shared-BDUe3aT-.js +1 -0
- package/dist/chunks/{shared-BwaDMwUS.js → shared-C1KQ5iU8.js} +55 -32
- package/dist/chunks/{shared-BvuW5NtY.js → shared-CQG0dnvb.js} +15 -5
- package/dist/chunks/{shared-BC5MlWBY.js → shared-CSC14I4g.js} +248 -87
- package/dist/chunks/{shared-D7CMQLaX.js → shared-Cd8A5TjZ.js} +140 -35
- package/dist/chunks/{shared-CcrRNZCH.js → shared-CirHYajF.js} +1 -1
- package/dist/chunks/shared-D4K7KsfJ.js +1 -0
- package/dist/chunks/{shared-DYe0OZr-.js → shared-D7poXZ0z.js} +15 -7
- package/dist/chunks/shared-DO0pUSjw.js +571 -0
- package/dist/chunks/shared-DdefS1nG.js +1 -0
- package/dist/chunks/{shared-C__W71Hw.js → shared-DjmQsa0n.js} +1 -1
- package/dist/chunks/{shared-CLnfjHCQ.js → shared-DklLt1Sc.js} +1 -1
- package/dist/chunks/{shared-DkkBQzIf.js → shared-DrMSORn-.js} +31 -8
- package/dist/chunks/shared-DxAiavwJ.js +1102 -0
- package/dist/components.js +1 -1
- package/dist/index.js +1 -1
- package/dist/templates/delegation-poker.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 -1
- package/dist/templates/usm.js +1 -1
- package/dist/templates/whiteboard.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/shared-CoDXb-Yj.js +0 -556
- package/dist/chunks/shared-DhwK_dh_.js +0 -1093
- package/dist/chunks/shared-xrCdgpNS.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{ac as ht,ad as q,ae as ne,af as oe,aA as N,ag as v,az as X,ah as F,ai as L,aj as M,p as T,at as S,v as ie,ay as xe,P as mt,e as ut,a0 as ft,V,R as $,a2 as ve,a8 as gt,j as bt,a1 as ke,a9 as xt,a3 as I,aD as vt,a4 as k,A as kt,K as Et,h as yt,aG as wt,a7 as Y,a5 as Ee,aH as $t,T as ye,l as A}from"./shared-BC5MlWBY.js";import{P as we,p as Tt}from"./shared-aDPp8Vry.js";import{c as St,r as It,p as Lt}from"./shared-CcrRNZCH.js";import{c as $e}from"./shared-ml5h7U5L.js";function Mt(t,e){let n=0;for(let o=0;o<t.length;o++)n+=e(t[o],o);return n}const j=["actor","command","aggregate","event","policy","readmodel","external","hotspot"],Nt=q({id:X,name:L(v(),M(1)),description:N(v())}),_t=q({id:X,type:F(j),name:L(v(),M(1)),description:N(v()),contextId:N(v())}),Ct=q({id:X,from:L(v(),M(1)),to:L(v(),M(1)),label:N(v()),kind:N(F(["member","flow"]))}),Te=q({title:N(v()),contexts:ne(oe(Nt),[]),elements:ne(oe(_t),[]),links:ne(oe(Ct),[])}),Se=t=>{const e=ht(Te,t),n=new Set(e.elements.map(i=>i.id)),o=new Set(e.contexts.map(i=>i.id));for(const i of e.elements)if(i.contextId!==void 0&&!o.has(i.contextId))throw new Error(`unknown context "${i.contextId}" for note "${i.id}"`);for(const i of e.links){if(!n.has(i.from))throw new Error(`unknown note "${i.from}" in link "${i.id}"`);if(!n.has(i.to))throw new Error(`unknown note "${i.to}" in link "${i.id}"`)}return e},Ie=()=>({contexts:[],elements:[],links:[]}),P=(t,e)=>{if(e!==void 0)return t.elements.find(n=>n.id===e)},H=(t,e)=>{if(e!==void 0)return t.contexts.find(n=>n.id===e)},se=(t,e)=>{if(e!==void 0)return t.links.find(n=>n.id===e)},W=t=>t.elements.map(e=>e.id),w={SET_ELEMENT_NAME:T("SET_ELEMENT_NAME","element",S({name:L(v(),M(1))})),SET_ELEMENT_DESCRIPTION:T("SET_ELEMENT_DESCRIPTION","element",S({description:v()})),SET_ELEMENT_TYPE:T("SET_ELEMENT_TYPE","element",S({type:F(j)})),SET_ELEMENT_CONTEXT:T("SET_ELEMENT_CONTEXT","element",S({contextId:xe(v())})),MOVE_ELEMENT:T("MOVE_ELEMENT","element",S({after:xe(v())}),{mode:"sequence"}),ADD_ELEMENT:T("ADD_ELEMENT","page",S({id:X,type:F(j),name:L(v(),M(1)),description:N(v()),contextId:N(v())}),{dedupeKey:ie}),DELETE_ELEMENT:T("DELETE_ELEMENT","element",S({})),LINK_ELEMENTS:T("LINK_ELEMENTS","page",S({id:X,from:L(v(),M(1)),to:L(v(),M(1)),label:N(v()),kind:N(F(["member","flow"]))}),{dedupeKey:ie}),SET_LINK_LABEL:T("SET_LINK_LABEL","link",S({label:v()})),UNLINK_ELEMENTS:T("UNLINK_ELEMENTS","page",S({from:L(v(),M(1)),to:L(v(),M(1))}),{mode:"sequence"}),ADD_CONTEXT:T("ADD_CONTEXT","page",S({id:X,name:L(v(),M(1)),description:N(v())}),{dedupeKey:ie}),SET_CONTEXT_NAME:T("SET_CONTEXT_NAME","context",S({name:L(v(),M(1))})),DELETE_CONTEXT:T("DELETE_CONTEXT","context",S({}))},y={setElementName:(t,e)=>({type:"SET_ELEMENT_NAME",target:{type:"element",id:t},payload:{name:e}}),setElementDescription:(t,e)=>({type:"SET_ELEMENT_DESCRIPTION",target:{type:"element",id:t},payload:{description:e}}),setElementType:(t,e)=>({type:"SET_ELEMENT_TYPE",target:{type:"element",id:t},payload:{type:e}}),setElementContext:(t,e)=>({type:"SET_ELEMENT_CONTEXT",target:{type:"element",id:t},payload:{contextId:e}}),moveElement:(t,e)=>({type:"MOVE_ELEMENT",target:{type:"element",id:t},payload:{after:e}}),addElement:(t,e,n)=>({type:"ADD_ELEMENT",target:{type:"page",id:"event-storming"},payload:{id:t,type:e,name:n}}),deleteElement:t=>({type:"DELETE_ELEMENT",target:{type:"element",id:t},payload:{}}),linkElements:(t,e,n,o)=>({type:"LINK_ELEMENTS",target:{type:"page",id:"event-storming"},payload:{id:t,from:e,to:n,...o?.label===void 0?{}:{label:o.label},...o?.kind===void 0?{}:{kind:o.kind}}}),setLinkLabel:(t,e)=>({type:"SET_LINK_LABEL",target:{type:"link",id:t},payload:{label:e}}),unlinkElements:(t,e)=>({type:"UNLINK_ELEMENTS",target:{type:"page",id:"event-storming"},payload:{from:t,to:e}}),addContext:(t,e)=>({type:"ADD_CONTEXT",target:{type:"page",id:"event-storming"},payload:{id:t,name:e}}),setContextName:(t,e)=>({type:"SET_CONTEXT_NAME",target:{type:"context",id:t},payload:{name:e}}),deleteContext:t=>({type:"DELETE_CONTEXT",target:{type:"context",id:t},payload:{}})},Le=(t,e)=>{const n=mt(w,e);if(n===null)return null;const o=n.target.id;switch(n.type){case"SET_ELEMENT_NAME":return Z(t,o,i=>({...i,name:n.payload.name}));case"SET_ELEMENT_DESCRIPTION":return Z(t,o,i=>({...i,description:n.payload.description}));case"SET_ELEMENT_TYPE":return Z(t,o,i=>({...i,type:n.payload.type}));case"SET_ELEMENT_CONTEXT":{const{contextId:i}=n.payload;return i!==null&&!t.contexts.some(s=>s.id===i)?null:Z(t,o,s=>i===null?Me(s):{...s,contextId:i})}case"MOVE_ELEMENT":{const{after:i}=n.payload,s=Ot(t.elements,o,i);return s===null?null:{...t,elements:s}}case"ADD_ELEMENT":{const i=n.payload;if(t.elements.some(r=>r.id===i.id))return t;if(i.contextId!==void 0&&!t.contexts.some(r=>r.id===i.contextId))return null;const s={id:i.id,type:i.type,name:i.name,...i.description===void 0?{}:{description:i.description},...i.contextId===void 0?{}:{contextId:i.contextId}};return{...t,elements:[...t.elements,s]}}case"DELETE_ELEMENT":return t.elements.some(i=>i.id===o)?{...t,elements:t.elements.filter(i=>i.id!==o),links:t.links.filter(i=>i.from!==o&&i.to!==o)}:null;case"LINK_ELEMENTS":{const i=n.payload;return t.links.some(s=>s.id===i.id)?t:!t.elements.some(s=>s.id===i.from)||!t.elements.some(s=>s.id===i.to)?null:{...t,links:[...t.links,{id:i.id,from:i.from,to:i.to,...i.label===void 0?{}:{label:i.label},...i.kind===void 0?{}:{kind:i.kind}}]}}case"SET_LINK_LABEL":return t.links.some(i=>i.id===o)?{...t,links:t.links.map(i=>i.id===o?{...i,label:n.payload.label}:i)}:null;case"UNLINK_ELEMENTS":{const i=n.payload;return t.links.some(s=>s.from===i.from&&s.to===i.to)?{...t,links:t.links.filter(s=>!(s.from===i.from&&s.to===i.to))}:null}case"ADD_CONTEXT":{const i=n.payload;if(t.contexts.some(r=>r.id===i.id))return t;const s={id:i.id,name:i.name,...i.description===void 0?{}:{description:i.description}};return{...t,contexts:[...t.contexts,s]}}case"SET_CONTEXT_NAME":return t.contexts.some(i=>i.id===o)?{...t,contexts:t.contexts.map(i=>i.id===o?{...i,name:n.payload.name}:i)}:null;case"DELETE_CONTEXT":return t.contexts.some(i=>i.id===o)?{...t,contexts:t.contexts.filter(i=>i.id!==o),elements:t.elements.map(i=>i.contextId===o?Me(i):i)}:null;default:return ut(n)}},Me=t=>{const e={...t};return delete e.contextId,e},Z=(t,e,n)=>t.elements.some(o=>o.id===e)?{...t,elements:t.elements.map(o=>o.id===e?n(o):o)}:null,Ot=(t,e,n)=>{const o=t.findIndex(a=>a.id===e);if(o<0||n!==null&&!t.some(a=>a.id===n))return null;const i=t[o];if(i===void 0)return null;const r=[...t.filter(a=>a.id!==e)];return r.splice(n===null?0:r.findIndex(a=>a.id===n)+1,0,i),r},At=new Set(["actor>command","command>aggregate","aggregate>event","command>event","policy>command","external>event"]),J=(t,e)=>At.has(`${t}>${e}`),zt=(t,e,n)=>t.kind!==void 0?t.kind==="member":J(e,n),Dt=["readmodel","actor","policy","command","aggregate","external","event","hotspot"],Pt=(t,e)=>{const n=new Map;for(const o of t.links){const i=e.get(o.from),s=e.get(o.to);if(i===void 0||s===void 0||i==="hotspot"==(s==="hotspot")||o.kind!==void 0&&o.kind!=="member")continue;const r=i==="hotspot"?o.from:o.to;n.has(r)||n.set(r,i==="hotspot"?o.to:o.from)}return n},Rt=(t,e,n)=>{const o=new Map(t.map(a=>[a.id,a.id])),i=a=>{let d=a;for(;o.get(d)!==d;)d=o.get(d)??d;let l=a;for(;l!==d;){const p=o.get(l)??d;o.set(l,d),l=p}return d};for(const a of e){if(!o.has(a.from)||!o.has(a.to))continue;const d=n.get(a.from),l=n.get(a.to);d===void 0||l===void 0||zt(a,d,l)&&o.set(i(a.from),i(a.to))}const s=new Map,r=new Map;for(const a of t){const d=i(a.id);r.set(a.id,d);const l=s.get(d);l?l.push(a):s.set(d,[a])}return{groups:s,rootOf:r}},R=t=>{const e=new Map(t.elements.map(l=>[l.id,l.type])),n=Pt(t,e),o=t.elements.filter(l=>!n.has(l.id)),{groups:i,rootOf:s}=Rt(o,t.links,e),r=new Map;for(const[l,p]of n){const m=P(t,l),f=s.get(p);if(m===void 0||f===void 0)continue;const g=r.get(f);g?g.push({note:m,targetId:p}):r.set(f,[{note:m,targetId:p}])}const a=new Map(Dt.map((l,p)=>[l,p])),d=new Map(t.elements.map((l,p)=>[l.id,p]));return[...i].map(([l,p])=>{const m=[...p].sort((f,g)=>(a.get(f.type)??0)-(a.get(g.type)??0)||(d.get(f.id)??0)-(d.get(g.id)??0));return{id:p[0]?.id??"",notes:m,pins:r.get(l)??[],contextId:p.find(f=>f.contextId!==void 0)?.contextId}})},Bt=t=>{const e=R(t).flatMap(o=>[...o.notes,...o.pins.map(i=>i.note)]),n=new Set(e.map(o=>o.id));return{...t,elements:[...e,...t.elements.filter(o=>!n.has(o.id))]}},Ne=(t,e)=>{const n=[...t.notes,...t.pins.map(r=>r.note)],o=n.find(r=>J(e,r.type));if(o!==void 0)return{anchorId:o.id,incoming:!0};const i=n.find(r=>J(r.type,e));if(i!==void 0)return{anchorId:i.id,incoming:!1};const s=n[0];return s===void 0?void 0:{anchorId:s.id,incoming:!0}},_e=(t,e)=>{const n=new Map(e.flatMap(o=>o.notes.map(i=>[i.id,o.id])));return t.links.flatMap(o=>{const i=n.get(o.from),s=n.get(o.to);return i===void 0||s===void 0||i===s?[]:[{id:o.id,from:i,to:s,...o.label!==void 0?{label:o.label}:{}}]})},re=(t,e)=>`${t}\0${e}`,Ce=(t,e,n)=>{const{widthOf:o,gapX:i,padX:s,maxWidth:r}=n,a=new Map;for(const c of e)a.set(re(c.from,c.to),c),a.set(re(c.to,c.from),c);const d=(c,h)=>c===void 0||h===void 0?void 0:a.get(re(c,h)),l=c=>Mt(c,h=>o(h))+i*Math.max(0,c.length-1)+s*2<=r,p=[];let m=[],f;const g=()=>{m.length!==0&&(p.push({sliceIds:m,...f===void 0?{}:{cutFrom:f}}),m=[],f=void 0)};for(const c of t.map(h=>h.id)){if(m.length>0&&!l([...m,c])){let h=m.length;for(;d(m[h-1],h===m.length?c:m[h])!==void 0&&(h-=1,h!==0););const b=h===0?[]:m.splice(h),x=h===0?d(m.at(-1),c):d(m.at(-1),b[0]);g(),m=b,f=x}m.push(c)}return g(),p},G=t=>[...t.notes].reverse().find(e=>e.type==="event")??t.notes.at(-1),Oe=(t,e)=>{const n=G(t),o=e.notes[0];if(!(n===void 0||o===void 0))return{from:n.id,to:o.id}},Ae={actor:"Actor",command:"Command",aggregate:"Aggregate",event:"Domain Event",policy:"Policy",readmodel:"Read Model",external:"External System",hotspot:"Hotspot"},ze={actor:"\u30A2\u30AF\u30BF\u30FC",command:"\u30B3\u30DE\u30F3\u30C9",aggregate:"\u96C6\u7D04",event:"\u30A4\u30D9\u30F3\u30C8",policy:"\u30DD\u30EA\u30B7\u30FC",readmodel:"\u30EA\u30FC\u30C9\u30E2\u30C7\u30EB",external:"\u5916\u90E8\u30B7\u30B9\u30C6\u30E0",hotspot:"\u30DB\u30C3\u30C8\u30B9\u30DD\u30C3\u30C8"},O=ft({en:{renameElementTitle:"Rename element",updateDescriptionTitle:"Update element description",changeTypeTitle:"Change element type",changeContextTitle:"Change the element\u2019s context",moveTitle:"Change timeline position",addElementTitle:"Add element",deleteElementTitle:"Delete element",linkTitle:"Link elements",renameLinkTitle:"Change link label",unlinkTitle:"Remove link",addContextTitle:"Add bounded context",renameContextTitle:"Rename bounded context",deleteContextTitle:"Delete bounded context",renamed:(t,e)=>`"${t}" \u2192 "${e}"`,noContext:"No context",moveToFront:"\u2192 To the front",moveAfter:t=>`\u2192 Right after "${t}"`,elementLabel:t=>`Element \xB7 ${t}`,contextLabel:t=>`Bounded context \xB7 ${t}`,linkLabel:(t,e)=>`Link \xB7 ${t}\u2192${e}`,linkGroup:"Link",pageLabel:t=>`Page \xB7 ${t}`,elementGroup:"Element",contextGroup:"Bounded context",noteTypeLabel:t=>Ae[t],addTypeLabel:t=>`+ ${Ae[t]}`,addHotspot:"+ Hotspot",pinHotspotTitle:"Pin a hotspot on this note",deleteNote:"Delete",noteNameLabel:"Note name",newContextTitle:"New bounded context",contextNamePlaceholder:"Context name",cancel:"Cancel",create:"Create",save:"Save",appendMenuNext:"Note to add next",appendMenuAfter:t=>`Continue after \u201C${t}\u201D`,emptyTitle:"No notes yet",emptyBody:"Start Event Storming by placing domain events on the timeline.",addFirstEvent:"+ First event",portAriaLabel:"Add what comes next (pick a type, or drag to connect to another slice)",portTitle:"Click: pick a note to continue / Drag: connect to another slice",renameContextHint:"Click to rename",dissolveContextAria:t=>`Dissolve bounded context "${t}"`,dissolveContextTitle:"Dissolve the bounded context (notes stay)",noteCount:t=>`${t} notes`,sliceCount:t=>`${t} slices`,contextCount:t=>`${t} bounded contexts`,hudHint:"Wheel: pan \xB7 Pinch: zoom \xB7 Drag background: select area",zoomOut:"Zoom out",zoomReset:"Reset to 100%",zoomIn:"Zoom in",zoomFit:"Fit to view",selectedLinks:t=>`${t} links selected`,deleteLinks:"Delete links",deleteHint:"Delete works too",clearSelection:"Clear selection",selectedSlices:t=>`${t} slices selected`,groupIntoContext:"Group into a bounded context",addToExistingAria:"Add to an existing bounded context",addToExistingOption:"Add to existing\u2026",removeFromContext:"Remove from context",deleteButton:"Delete"},ja:{renameElementTitle:"\u8981\u7D20\u540D\u3092\u5909\u66F4",updateDescriptionTitle:"\u8981\u7D20\u306E\u8AAC\u660E\u3092\u66F4\u65B0",changeTypeTitle:"\u8981\u7D20\u306E\u7A2E\u5225\u3092\u5909\u66F4",changeContextTitle:"\u6240\u5C5E\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u3092\u5909\u66F4",moveTitle:"\u30BF\u30A4\u30E0\u30E9\u30A4\u30F3\u4F4D\u7F6E\u3092\u5909\u66F4",addElementTitle:"\u8981\u7D20\u3092\u8FFD\u52A0",deleteElementTitle:"\u8981\u7D20\u3092\u524A\u9664",linkTitle:"\u8981\u7D20\u3092\u9023\u7D50",renameLinkTitle:"\u30EA\u30F3\u30AF\u540D\u3092\u5909\u66F4",unlinkTitle:"\u30EA\u30F3\u30AF\u3092\u524A\u9664",addContextTitle:"\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u3092\u8FFD\u52A0",renameContextTitle:"\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u540D\u3092\u5909\u66F4",deleteContextTitle:"\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u3092\u524A\u9664",renamed:(t,e)=>`"${t}" \u2192 "${e}"`,noContext:"\u672A\u6240\u5C5E",moveToFront:"\u2192 \u5148\u982D\u3078",moveAfter:t=>`\u2192 "${t}" \u306E\u76F4\u5F8C\u3078`,elementLabel:t=>`\u8981\u7D20 \xB7 ${t}`,contextLabel:t=>`\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8 \xB7 ${t}`,linkLabel:(t,e)=>`\u30EA\u30F3\u30AF \xB7 ${t}\u2192${e}`,linkGroup:"\u30EA\u30F3\u30AF",pageLabel:t=>`\u30DA\u30FC\u30B8 \xB7 ${t}`,elementGroup:"\u8981\u7D20",contextGroup:"\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8",noteTypeLabel:t=>ze[t],addTypeLabel:t=>`+ ${ze[t]}`,addHotspot:"+ \u30DB\u30C3\u30C8\u30B9\u30DD\u30C3\u30C8",pinHotspotTitle:"\u3053\u306E\u4ED8\u7B8B\u306B\u30DB\u30C3\u30C8\u30B9\u30DD\u30C3\u30C8\u3092\u7ACB\u3066\u308B",deleteNote:"\u524A\u9664",noteNameLabel:"\u4ED8\u7B8B\u540D",newContextTitle:"\u65B0\u3057\u3044\u5883\u754C\u3065\u3051\u3089\u308C\u305F\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8",contextNamePlaceholder:"\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u540D",cancel:"\u30AD\u30E3\u30F3\u30BB\u30EB",create:"\u4F5C\u6210",save:"\u4FDD\u5B58",appendMenuNext:"\u7D9A\u304D\u306B\u8FFD\u52A0\u3059\u308B\u4ED8\u7B8B",appendMenuAfter:t=>`\u300C${t}\u300D\u306E\u7D9A\u304D\u306B\u8FFD\u52A0`,emptyTitle:"\u4ED8\u7B8B\u304C\u307E\u3060\u3042\u308A\u307E\u305B\u3093",emptyBody:"\u30A4\u30D9\u30F3\u30C8\u30B9\u30C8\u30FC\u30DF\u30F3\u30B0\u3092\u958B\u59CB\u3057\u307E\u3057\u3087\u3046\u3002\u30C9\u30E1\u30A4\u30F3\u30A4\u30D9\u30F3\u30C8\u3092\u6642\u7CFB\u5217\u306B\u8CBC\u308B\u3068\u3053\u308D\u304B\u3089\u59CB\u3081\u307E\u3059\u3002",addFirstEvent:"+ \u6700\u521D\u306E\u30A4\u30D9\u30F3\u30C8",portAriaLabel:"\u7D9A\u304D\u3092\u8FFD\u52A0\uFF08\u7A2E\u985E\u3092\u9078\u3093\u3067\u8FFD\u52A0 / \u30C9\u30E9\u30C3\u30B0\u3067\u4ED6\u306E\u30B9\u30E9\u30A4\u30B9\u3078\u63A5\u7D9A\uFF09",portTitle:"\u30AF\u30EA\u30C3\u30AF: \u7D9A\u304D\u306E\u4ED8\u7B8B\u3092\u9078\u3093\u3067\u8FFD\u52A0 / \u30C9\u30E9\u30C3\u30B0: \u4ED6\u306E\u30B9\u30E9\u30A4\u30B9\u3078\u63A5\u7D9A",renameContextHint:"\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u540D\u524D\u3092\u5909\u66F4",dissolveContextAria:t=>`\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u300C${t}\u300D\u3092\u89E3\u4F53`,dissolveContextTitle:"\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u3092\u89E3\u4F53\uFF08\u4ED8\u7B8B\u306F\u6B8B\u308A\u307E\u3059\uFF09",noteCount:t=>`${t} \u4ED8\u7B8B`,sliceCount:t=>`${t} \u30B9\u30E9\u30A4\u30B9`,contextCount:t=>`${t} \u30B3\u30F3\u30C6\u30AD\u30B9\u30C8`,hudHint:"\u30DB\u30A4\u30FC\u30EB: \u79FB\u52D5 \xB7 \u30D4\u30F3\u30C1: \u30BA\u30FC\u30E0 \xB7 \u80CC\u666F\u30C9\u30E9\u30C3\u30B0: \u7BC4\u56F2\u9078\u629E",zoomOut:"\u7E2E\u5C0F",zoomReset:"100% \u306B\u623B\u3059",zoomIn:"\u62E1\u5927",zoomFit:"\u5168\u4F53\u3092\u8868\u793A",selectedLinks:t=>`${t} \u672C\u306E\u30EA\u30F3\u30AF\u3092\u9078\u629E\u4E2D`,deleteLinks:"\u30EA\u30F3\u30AF\u3092\u524A\u9664",deleteHint:"Delete \u3067\u3082\u524A\u9664\u3067\u304D\u307E\u3059",clearSelection:"\u9078\u629E\u89E3\u9664",selectedSlices:t=>`${t} \u30B9\u30E9\u30A4\u30B9\u3092\u9078\u629E\u4E2D`,groupIntoContext:"\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u306B\u307E\u3068\u3081\u308B",addToExistingAria:"\u65E2\u5B58\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u3078\u8FFD\u52A0",addToExistingOption:"\u65E2\u5B58\u3078\u8FFD\u52A0\u2026",removeFromContext:"\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u89E3\u9664",deleteButton:"\u524A\u9664"}}),Xt={SET_ELEMENT_NAME:(t,e,n)=>({title:t.renameElementTitle,tone:"update",body:t.renamed(P(n,e.target.id)?.name??"?",$(w.SET_ELEMENT_NAME,e).name)}),SET_ELEMENT_DESCRIPTION:(t,e)=>({title:t.updateDescriptionTitle,tone:"update",body:`\u2192 "${$(w.SET_ELEMENT_DESCRIPTION,e).description.slice(0,60)}"`}),SET_ELEMENT_TYPE:(t,e)=>({title:t.changeTypeTitle,tone:"update",body:`\u2192 ${$(w.SET_ELEMENT_TYPE,e).type}`}),SET_ELEMENT_CONTEXT:(t,e)=>({title:t.changeContextTitle,tone:"move",body:`\u2192 ${$(w.SET_ELEMENT_CONTEXT,e).contextId??t.noContext}`}),MOVE_ELEMENT:(t,e)=>({title:t.moveTitle,tone:"move",body:$(w.MOVE_ELEMENT,e).after===null?t.moveToFront:t.moveAfter($(w.MOVE_ELEMENT,e).after??"")}),ADD_ELEMENT:(t,e)=>({title:t.addElementTitle,tone:"create",body:`+ "${$(w.ADD_ELEMENT,e).name}"`}),DELETE_ELEMENT:(t,e,n)=>({title:t.deleteElementTitle,tone:"delete",body:`\u2212 "${P(n,e.target.id)?.name??e.target.id}"`}),LINK_ELEMENTS:(t,e)=>({title:t.linkTitle,tone:"create",body:`${$(w.LINK_ELEMENTS,e).from} \u2192 ${$(w.LINK_ELEMENTS,e).to}`}),SET_LINK_LABEL:(t,e)=>({title:t.renameLinkTitle,tone:"update",body:`\u2192 "${$(w.SET_LINK_LABEL,e).label}"`}),UNLINK_ELEMENTS:(t,e)=>({title:t.unlinkTitle,tone:"delete",body:`${$(w.UNLINK_ELEMENTS,e).from} \u2192 ${$(w.UNLINK_ELEMENTS,e).to}`}),ADD_CONTEXT:(t,e)=>({title:t.addContextTitle,tone:"create",body:`+ "${$(w.ADD_CONTEXT,e).name}"`}),SET_CONTEXT_NAME:(t,e)=>({title:t.renameContextTitle,tone:"update",body:`\u2192 "${$(w.SET_CONTEXT_NAME,e).name}"`}),DELETE_CONTEXT:(t,e,n)=>({title:t.deleteContextTitle,tone:"delete",body:`\u2212 "${H(n,e.target.id)?.name??e.target.id}"`})},De=(t,e,n,o)=>{const i=Xt[e.type],r=i?i(t,e,o??n):{title:e.type,tone:"meta"};return{title:r.title,targetLabel:Re(t,n,e.target),tone:r.tone,...r.body===void 0?{}:{summary:r.body}}},Pe=t=>`${t.type} ${V(t.target)} ${JSON.stringify(t.payload)}`,Re=(t,e,n)=>{switch(n.type){case"element":{const o=P(e,n.id);return o?t.elementLabel(o.name):`${t.elementLabel(n.id)} (missing)`}case"context":{const o=H(e,n.id);return o?t.contextLabel(o.name):`${t.contextLabel(n.id)} (missing)`}case"link":{const o=se(e,n.id);return o?t.linkLabel(o.from,o.to):`${t.linkGroup} \xB7 ${n.id} (missing)`}case"page":return t.pageLabel(ae(e));default:return`${n.type} \xB7 ${n.id}`}},Be=(t,e)=>[...e.elements.map(n=>({value:V({type:"element",id:n.id}),label:n.name,group:t.elementGroup})),...e.contexts.map(n=>({value:V({type:"context",id:n.id}),label:n.name,group:t.contextGroup}))],Yt=(t,e,n)=>{const o=e.elements.find(i=>i.id===n.note);return o?{value:V({type:"element",id:o.id}),label:o.name,group:t.elementGroup}:null},ae=t=>t.title??"Event Storming",Xe=(t,e)=>{const n={...e},o=P(t,e.note);e.note!==void 0&&!o&&delete n.note;const i=H(t,e.context);return e.context!==void 0&&!i&&delete n.context,n},Ye=(t,e)=>{switch(e.type){case"element":return P(t,e.id)!==void 0;case"context":return H(t,e.id)!==void 0;case"link":return se(t,e.id)!==void 0;case"page":return!0;default:return!1}},He=t=>{const e=O(t);return{name:"event-storming",label:"Event Storming",parseBase:Se,emptyBase:Ie,actions:w,apply:Le,canonicalState:Bt,hasTarget:Ye,describe:(n,o,i)=>De(e,n,o,i),serialize:Pe,resolveNavigation:Xe,commentTargets:(n,o)=>Be(e,n),currentTarget:(n,o)=>Yt(e,n,o),title:ae}},Ht={width:300,height:260},Kt={event:{bg:"linear-gradient(178deg, #ffbc55, #f8a52e)",ink:"#402703"},command:{bg:"linear-gradient(178deg, #93c9f2, #74b4e8)",ink:"#0e2c4b"},aggregate:{bg:"linear-gradient(178deg, #fff3a6, #fdea7e)",ink:"#4a3a06"},actor:{bg:"linear-gradient(178deg, #ffdf63, #fdd23e)",ink:"#423204"},policy:{bg:"linear-gradient(178deg, #dcc2f7, #c9a6f0)",ink:"#32195c"},readmodel:{bg:"linear-gradient(178deg, #c0e788, #a8dc63)",ink:"#22380a"},external:{bg:"linear-gradient(178deg, #f9bcd3, #f4a0c0)",ink:"#4b1029"},hotspot:{bg:"linear-gradient(178deg, #d63550, #b81c33)",ink:"#ffffff"}},de=t=>{const{bg:e,ink:n}=Kt[t];return`--es-note-bg:${e};--es-note-ink:${n}`},Ft=ve`
|
|
1
|
+
import{ac as gt,ad as q,ae as oe,af as ie,aA as _,ag as v,az as X,ah as W,ai as M,aj as N,p as S,at as I,v as se,ay as ke,P as xt,e as bt,a0 as vt,V,R as $,a2 as Ee,a8 as kt,j as Et,a1 as ye,a9 as yt,a3 as L,aD as wt,a4 as k,A as $t,K as Tt,h as St,aG as It,a7 as Y,a5 as we,aH as Lt,T as $e,l as z}from"./shared-CSC14I4g.js";import{P as Te,p as Mt}from"./shared-aDPp8Vry.js";import{c as Nt,r as _t,p as Ct}from"./shared-CirHYajF.js";import{c as Se}from"./shared-ml5h7U5L.js";function Ot(t,e){let n=0;for(let o=0;o<t.length;o++)n+=e(t[o],o);return n}const j=["actor","command","aggregate","event","policy","readmodel","external","hotspot"],At=q({id:X,name:M(v(),N(1)),description:_(v())}),zt=q({id:X,type:W(j),name:M(v(),N(1)),description:_(v()),contextId:_(v())}),Dt=q({id:X,from:M(v(),N(1)),to:M(v(),N(1)),label:_(v()),kind:_(W(["member","flow"]))}),Ie=q({title:_(v()),contexts:oe(ie(At),[]),elements:oe(ie(zt),[]),links:oe(ie(Dt),[])}),Le=t=>{const e=gt(Ie,t),n=new Set(e.elements.map(i=>i.id)),o=new Set(e.contexts.map(i=>i.id));for(const i of e.elements)if(i.contextId!==void 0&&!o.has(i.contextId))throw new Error(`unknown context "${i.contextId}" for note "${i.id}"`);for(const i of e.links){if(!n.has(i.from))throw new Error(`unknown note "${i.from}" in link "${i.id}"`);if(!n.has(i.to))throw new Error(`unknown note "${i.to}" in link "${i.id}"`)}return e},Me=()=>({contexts:[],elements:[],links:[]}),R=(t,e)=>{if(e!==void 0)return t.elements.find(n=>n.id===e)},H=(t,e)=>{if(e!==void 0)return t.contexts.find(n=>n.id===e)},re=(t,e)=>{if(e!==void 0)return t.links.find(n=>n.id===e)},F=t=>t.elements.map(e=>e.id),w={SET_ELEMENT_NAME:S("SET_ELEMENT_NAME","element",I({name:M(v(),N(1))})),SET_ELEMENT_DESCRIPTION:S("SET_ELEMENT_DESCRIPTION","element",I({description:v()})),SET_ELEMENT_TYPE:S("SET_ELEMENT_TYPE","element",I({type:W(j)})),SET_ELEMENT_CONTEXT:S("SET_ELEMENT_CONTEXT","element",I({contextId:ke(v())})),MOVE_ELEMENT:S("MOVE_ELEMENT","element",I({after:ke(v())}),{mode:"sequence"}),ADD_ELEMENT:S("ADD_ELEMENT","page",I({id:X,type:W(j),name:M(v(),N(1)),description:_(v()),contextId:_(v())}),{dedupeKey:se}),DELETE_ELEMENT:S("DELETE_ELEMENT","element",I({})),LINK_ELEMENTS:S("LINK_ELEMENTS","page",I({id:X,from:M(v(),N(1)),to:M(v(),N(1)),label:_(v()),kind:_(W(["member","flow"]))}),{dedupeKey:se}),SET_LINK_LABEL:S("SET_LINK_LABEL","link",I({label:v()})),UNLINK_ELEMENTS:S("UNLINK_ELEMENTS","page",I({from:M(v(),N(1)),to:M(v(),N(1))}),{mode:"sequence"}),ADD_CONTEXT:S("ADD_CONTEXT","page",I({id:X,name:M(v(),N(1)),description:_(v())}),{dedupeKey:se}),SET_CONTEXT_NAME:S("SET_CONTEXT_NAME","context",I({name:M(v(),N(1))})),DELETE_CONTEXT:S("DELETE_CONTEXT","context",I({}))},y={setElementName:(t,e)=>({type:"SET_ELEMENT_NAME",target:{type:"element",id:t},payload:{name:e}}),setElementDescription:(t,e)=>({type:"SET_ELEMENT_DESCRIPTION",target:{type:"element",id:t},payload:{description:e}}),setElementType:(t,e)=>({type:"SET_ELEMENT_TYPE",target:{type:"element",id:t},payload:{type:e}}),setElementContext:(t,e)=>({type:"SET_ELEMENT_CONTEXT",target:{type:"element",id:t},payload:{contextId:e}}),moveElement:(t,e)=>({type:"MOVE_ELEMENT",target:{type:"element",id:t},payload:{after:e}}),addElement:(t,e,n)=>({type:"ADD_ELEMENT",target:{type:"page",id:"event-storming"},payload:{id:t,type:e,name:n}}),deleteElement:t=>({type:"DELETE_ELEMENT",target:{type:"element",id:t},payload:{}}),linkElements:(t,e,n,o)=>({type:"LINK_ELEMENTS",target:{type:"page",id:"event-storming"},payload:{id:t,from:e,to:n,...o?.label===void 0?{}:{label:o.label},...o?.kind===void 0?{}:{kind:o.kind}}}),setLinkLabel:(t,e)=>({type:"SET_LINK_LABEL",target:{type:"link",id:t},payload:{label:e}}),unlinkElements:(t,e)=>({type:"UNLINK_ELEMENTS",target:{type:"page",id:"event-storming"},payload:{from:t,to:e}}),addContext:(t,e)=>({type:"ADD_CONTEXT",target:{type:"page",id:"event-storming"},payload:{id:t,name:e}}),setContextName:(t,e)=>({type:"SET_CONTEXT_NAME",target:{type:"context",id:t},payload:{name:e}}),deleteContext:t=>({type:"DELETE_CONTEXT",target:{type:"context",id:t},payload:{}})},Ne=(t,e)=>{const n=xt(w,e);if(n===null)return null;const o=n.target.id;switch(n.type){case"SET_ELEMENT_NAME":return Z(t,o,i=>({...i,name:n.payload.name}));case"SET_ELEMENT_DESCRIPTION":return Z(t,o,i=>({...i,description:n.payload.description}));case"SET_ELEMENT_TYPE":return Z(t,o,i=>({...i,type:n.payload.type}));case"SET_ELEMENT_CONTEXT":{const{contextId:i}=n.payload;return i!==null&&!t.contexts.some(s=>s.id===i)?null:Z(t,o,s=>i===null?_e(s):{...s,contextId:i})}case"MOVE_ELEMENT":{const{after:i}=n.payload,s=Pt(t.elements,o,i);return s===null?null:{...t,elements:s}}case"ADD_ELEMENT":{const i=n.payload;if(t.elements.some(r=>r.id===i.id))return t;if(i.contextId!==void 0&&!t.contexts.some(r=>r.id===i.contextId))return null;const s={id:i.id,type:i.type,name:i.name,...i.description===void 0?{}:{description:i.description},...i.contextId===void 0?{}:{contextId:i.contextId}};return{...t,elements:[...t.elements,s]}}case"DELETE_ELEMENT":return t.elements.some(i=>i.id===o)?{...t,elements:t.elements.filter(i=>i.id!==o),links:t.links.filter(i=>i.from!==o&&i.to!==o)}:null;case"LINK_ELEMENTS":{const i=n.payload;return t.links.some(s=>s.id===i.id)?t:!t.elements.some(s=>s.id===i.from)||!t.elements.some(s=>s.id===i.to)?null:{...t,links:[...t.links,{id:i.id,from:i.from,to:i.to,...i.label===void 0?{}:{label:i.label},...i.kind===void 0?{}:{kind:i.kind}}]}}case"SET_LINK_LABEL":return t.links.some(i=>i.id===o)?{...t,links:t.links.map(i=>i.id===o?{...i,label:n.payload.label}:i)}:null;case"UNLINK_ELEMENTS":{const i=n.payload;return t.links.some(s=>s.from===i.from&&s.to===i.to)?{...t,links:t.links.filter(s=>!(s.from===i.from&&s.to===i.to))}:null}case"ADD_CONTEXT":{const i=n.payload;if(t.contexts.some(r=>r.id===i.id))return t;const s={id:i.id,name:i.name,...i.description===void 0?{}:{description:i.description}};return{...t,contexts:[...t.contexts,s]}}case"SET_CONTEXT_NAME":return t.contexts.some(i=>i.id===o)?{...t,contexts:t.contexts.map(i=>i.id===o?{...i,name:n.payload.name}:i)}:null;case"DELETE_CONTEXT":return t.contexts.some(i=>i.id===o)?{...t,contexts:t.contexts.filter(i=>i.id!==o),elements:t.elements.map(i=>i.contextId===o?_e(i):i)}:null;default:return bt(n)}},_e=t=>{const e={...t};return delete e.contextId,e},Z=(t,e,n)=>t.elements.some(o=>o.id===e)?{...t,elements:t.elements.map(o=>o.id===e?n(o):o)}:null,Pt=(t,e,n)=>{const o=t.findIndex(a=>a.id===e);if(o<0||n!==null&&!t.some(a=>a.id===n))return null;const i=t[o];if(i===void 0)return null;const r=[...t.filter(a=>a.id!==e)];return r.splice(n===null?0:r.findIndex(a=>a.id===n)+1,0,i),r},Rt=new Set(["actor>command","command>aggregate","aggregate>event","command>event","policy>command","external>event"]),J=(t,e)=>Rt.has(`${t}>${e}`),Bt=(t,e,n)=>t.kind!==void 0?t.kind==="member":J(e,n),Xt=["readmodel","actor","policy","command","aggregate","external","event","hotspot"],Yt=(t,e)=>{const n=new Map;for(const o of t.links){const i=e.get(o.from),s=e.get(o.to);if(i===void 0||s===void 0||i==="hotspot"==(s==="hotspot")||o.kind!==void 0&&o.kind!=="member")continue;const r=i==="hotspot"?o.from:o.to;n.has(r)||n.set(r,i==="hotspot"?o.to:o.from)}return n},Ht=(t,e,n)=>{const o=new Map(t.map(a=>[a.id,a.id])),i=a=>{let d=a;for(;o.get(d)!==d;)d=o.get(d)??d;let l=a;for(;l!==d;){const p=o.get(l)??d;o.set(l,d),l=p}return d};for(const a of e){if(!o.has(a.from)||!o.has(a.to))continue;const d=n.get(a.from),l=n.get(a.to);d===void 0||l===void 0||Bt(a,d,l)&&o.set(i(a.from),i(a.to))}const s=new Map,r=new Map;for(const a of t){const d=i(a.id);r.set(a.id,d);const l=s.get(d);l?l.push(a):s.set(d,[a])}return{groups:s,rootOf:r}},B=t=>{const e=new Map(t.elements.map(l=>[l.id,l.type])),n=Yt(t,e),o=t.elements.filter(l=>!n.has(l.id)),{groups:i,rootOf:s}=Ht(o,t.links,e),r=new Map;for(const[l,p]of n){const m=R(t,l),u=s.get(p);if(m===void 0||u===void 0)continue;const b=r.get(u);b?b.push({note:m,targetId:p}):r.set(u,[{note:m,targetId:p}])}const a=new Map(Xt.map((l,p)=>[l,p])),d=new Map(t.elements.map((l,p)=>[l.id,p]));return[...i].map(([l,p])=>{const m=[...p].sort((u,b)=>(a.get(u.type)??0)-(a.get(b.type)??0)||(d.get(u.id)??0)-(d.get(b.id)??0));return{id:p[0]?.id??"",notes:m,pins:r.get(l)??[],contextId:p.find(u=>u.contextId!==void 0)?.contextId}})},Kt=t=>{const e=B(t).flatMap(o=>[...o.notes,...o.pins.map(i=>i.note)]),n=new Set(e.map(o=>o.id));return{...t,elements:[...e,...t.elements.filter(o=>!n.has(o.id))]}},Ce=(t,e)=>{const n=[...t.notes,...t.pins.map(r=>r.note)],o=n.find(r=>J(e,r.type));if(o!==void 0)return{anchorId:o.id,incoming:!0};const i=n.find(r=>J(r.type,e));if(i!==void 0)return{anchorId:i.id,incoming:!1};const s=n[0];return s===void 0?void 0:{anchorId:s.id,incoming:!0}},Oe=(t,e)=>{const n=new Map(e.flatMap(o=>o.notes.map(i=>[i.id,o.id])));return t.links.flatMap(o=>{const i=n.get(o.from),s=n.get(o.to);return i===void 0||s===void 0||i===s?[]:[{id:o.id,from:i,to:s,...o.label!==void 0?{label:o.label}:{}}]})},ae=(t,e)=>`${t}\0${e}`,Ae=(t,e,n)=>{const{widthOf:o,gapX:i,padX:s,maxWidth:r}=n,a=new Map;for(const c of e)a.set(ae(c.from,c.to),c),a.set(ae(c.to,c.from),c);const d=(c,g)=>c===void 0||g===void 0?void 0:a.get(ae(c,g)),l=c=>Ot(c,g=>o(g))+i*Math.max(0,c.length-1)+s*2<=r,p=[];let m=[],u;const b=()=>{m.length!==0&&(p.push({sliceIds:m,...u===void 0?{}:{cutFrom:u}}),m=[],u=void 0)};for(const c of t.map(g=>g.id)){if(m.length>0&&!l([...m,c])){let g=m.length;for(;d(m[g-1],g===m.length?c:m[g])!==void 0&&(g-=1,g!==0););const f=g===0?[]:m.splice(g),x=g===0?d(m.at(-1),c):d(m.at(-1),f[0]);b(),m=f,u=x}m.push(c)}return b(),p},G=t=>[...t.notes].reverse().find(e=>e.type==="event")??t.notes.at(-1),ze=(t,e)=>{const n=G(t),o=e.notes[0];if(!(n===void 0||o===void 0))return{from:n.id,to:o.id}},De={actor:"Actor",command:"Command",aggregate:"Aggregate",event:"Domain Event",policy:"Policy",readmodel:"Read Model",external:"External System",hotspot:"Hotspot"},Pe={actor:"\u30A2\u30AF\u30BF\u30FC",command:"\u30B3\u30DE\u30F3\u30C9",aggregate:"\u96C6\u7D04",event:"\u30A4\u30D9\u30F3\u30C8",policy:"\u30DD\u30EA\u30B7\u30FC",readmodel:"\u30EA\u30FC\u30C9\u30E2\u30C7\u30EB",external:"\u5916\u90E8\u30B7\u30B9\u30C6\u30E0",hotspot:"\u30DB\u30C3\u30C8\u30B9\u30DD\u30C3\u30C8"},O=vt({en:{renameElementTitle:"Rename element",updateDescriptionTitle:"Update element description",changeTypeTitle:"Change element type",changeContextTitle:"Change the element\u2019s context",moveTitle:"Change timeline position",addElementTitle:"Add element",deleteElementTitle:"Delete element",linkTitle:"Link elements",renameLinkTitle:"Change link label",unlinkTitle:"Remove link",addContextTitle:"Add bounded context",renameContextTitle:"Rename bounded context",deleteContextTitle:"Delete bounded context",renamed:(t,e)=>`"${t}" \u2192 "${e}"`,noContext:"No context",moveToFront:"\u2192 To the front",moveAfter:t=>`\u2192 Right after "${t}"`,elementLabel:t=>`Element \xB7 ${t}`,contextLabel:t=>`Bounded context \xB7 ${t}`,linkLabel:(t,e)=>`Link \xB7 ${t}\u2192${e}`,linkGroup:"Link",pageLabel:t=>`Page \xB7 ${t}`,elementGroup:"Element",contextGroup:"Bounded context",noteTypeLabel:t=>De[t],addTypeLabel:t=>`+ ${De[t]}`,addHotspot:"+ Hotspot",pinHotspotTitle:"Pin a hotspot on this note",deleteNote:"Delete",noteNameLabel:"Note name",newContextTitle:"New bounded context",contextNamePlaceholder:"Context name",cancel:"Cancel",create:"Create",save:"Save",appendMenuNext:"Note to add next",appendMenuAfter:t=>`Continue after \u201C${t}\u201D`,emptyTitle:"No notes yet",emptyBody:"Start Event Storming by placing domain events on the timeline.",addFirstEvent:"+ First event",portAriaLabel:"Add what comes next (pick a type, or drag to connect to another slice)",portTitle:"Click: pick a note to continue / Drag: connect to another slice",renameContextHint:"Click to rename",dissolveContextAria:t=>`Dissolve bounded context "${t}"`,dissolveContextTitle:"Dissolve the bounded context (notes stay)",noteCount:t=>`${t} notes`,sliceCount:t=>`${t} slices`,contextCount:t=>`${t} bounded contexts`,hudHint:"Wheel: pan \xB7 Pinch: zoom \xB7 Drag background: select area",zoomOut:"Zoom out",zoomReset:"Reset to 100%",zoomIn:"Zoom in",zoomFit:"Fit to view",selectedLinks:t=>`${t} links selected`,deleteLinks:"Delete links",deleteHint:"Delete works too",clearSelection:"Clear selection",selectedSlices:t=>`${t} slices selected`,groupIntoContext:"Group into a bounded context",addToExistingAria:"Add to an existing bounded context",addToExistingOption:"Add to existing\u2026",removeFromContext:"Remove from context",deleteButton:"Delete"},ja:{renameElementTitle:"\u8981\u7D20\u540D\u3092\u5909\u66F4",updateDescriptionTitle:"\u8981\u7D20\u306E\u8AAC\u660E\u3092\u66F4\u65B0",changeTypeTitle:"\u8981\u7D20\u306E\u7A2E\u5225\u3092\u5909\u66F4",changeContextTitle:"\u6240\u5C5E\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u3092\u5909\u66F4",moveTitle:"\u30BF\u30A4\u30E0\u30E9\u30A4\u30F3\u4F4D\u7F6E\u3092\u5909\u66F4",addElementTitle:"\u8981\u7D20\u3092\u8FFD\u52A0",deleteElementTitle:"\u8981\u7D20\u3092\u524A\u9664",linkTitle:"\u8981\u7D20\u3092\u9023\u7D50",renameLinkTitle:"\u30EA\u30F3\u30AF\u540D\u3092\u5909\u66F4",unlinkTitle:"\u30EA\u30F3\u30AF\u3092\u524A\u9664",addContextTitle:"\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u3092\u8FFD\u52A0",renameContextTitle:"\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u540D\u3092\u5909\u66F4",deleteContextTitle:"\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u3092\u524A\u9664",renamed:(t,e)=>`"${t}" \u2192 "${e}"`,noContext:"\u672A\u6240\u5C5E",moveToFront:"\u2192 \u5148\u982D\u3078",moveAfter:t=>`\u2192 "${t}" \u306E\u76F4\u5F8C\u3078`,elementLabel:t=>`\u8981\u7D20 \xB7 ${t}`,contextLabel:t=>`\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8 \xB7 ${t}`,linkLabel:(t,e)=>`\u30EA\u30F3\u30AF \xB7 ${t}\u2192${e}`,linkGroup:"\u30EA\u30F3\u30AF",pageLabel:t=>`\u30DA\u30FC\u30B8 \xB7 ${t}`,elementGroup:"\u8981\u7D20",contextGroup:"\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8",noteTypeLabel:t=>Pe[t],addTypeLabel:t=>`+ ${Pe[t]}`,addHotspot:"+ \u30DB\u30C3\u30C8\u30B9\u30DD\u30C3\u30C8",pinHotspotTitle:"\u3053\u306E\u4ED8\u7B8B\u306B\u30DB\u30C3\u30C8\u30B9\u30DD\u30C3\u30C8\u3092\u7ACB\u3066\u308B",deleteNote:"\u524A\u9664",noteNameLabel:"\u4ED8\u7B8B\u540D",newContextTitle:"\u65B0\u3057\u3044\u5883\u754C\u3065\u3051\u3089\u308C\u305F\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8",contextNamePlaceholder:"\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u540D",cancel:"\u30AD\u30E3\u30F3\u30BB\u30EB",create:"\u4F5C\u6210",save:"\u4FDD\u5B58",appendMenuNext:"\u7D9A\u304D\u306B\u8FFD\u52A0\u3059\u308B\u4ED8\u7B8B",appendMenuAfter:t=>`\u300C${t}\u300D\u306E\u7D9A\u304D\u306B\u8FFD\u52A0`,emptyTitle:"\u4ED8\u7B8B\u304C\u307E\u3060\u3042\u308A\u307E\u305B\u3093",emptyBody:"\u30A4\u30D9\u30F3\u30C8\u30B9\u30C8\u30FC\u30DF\u30F3\u30B0\u3092\u958B\u59CB\u3057\u307E\u3057\u3087\u3046\u3002\u30C9\u30E1\u30A4\u30F3\u30A4\u30D9\u30F3\u30C8\u3092\u6642\u7CFB\u5217\u306B\u8CBC\u308B\u3068\u3053\u308D\u304B\u3089\u59CB\u3081\u307E\u3059\u3002",addFirstEvent:"+ \u6700\u521D\u306E\u30A4\u30D9\u30F3\u30C8",portAriaLabel:"\u7D9A\u304D\u3092\u8FFD\u52A0\uFF08\u7A2E\u985E\u3092\u9078\u3093\u3067\u8FFD\u52A0 / \u30C9\u30E9\u30C3\u30B0\u3067\u4ED6\u306E\u30B9\u30E9\u30A4\u30B9\u3078\u63A5\u7D9A\uFF09",portTitle:"\u30AF\u30EA\u30C3\u30AF: \u7D9A\u304D\u306E\u4ED8\u7B8B\u3092\u9078\u3093\u3067\u8FFD\u52A0 / \u30C9\u30E9\u30C3\u30B0: \u4ED6\u306E\u30B9\u30E9\u30A4\u30B9\u3078\u63A5\u7D9A",renameContextHint:"\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u540D\u524D\u3092\u5909\u66F4",dissolveContextAria:t=>`\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u300C${t}\u300D\u3092\u89E3\u4F53`,dissolveContextTitle:"\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u3092\u89E3\u4F53\uFF08\u4ED8\u7B8B\u306F\u6B8B\u308A\u307E\u3059\uFF09",noteCount:t=>`${t} \u4ED8\u7B8B`,sliceCount:t=>`${t} \u30B9\u30E9\u30A4\u30B9`,contextCount:t=>`${t} \u30B3\u30F3\u30C6\u30AD\u30B9\u30C8`,hudHint:"\u30DB\u30A4\u30FC\u30EB: \u79FB\u52D5 \xB7 \u30D4\u30F3\u30C1: \u30BA\u30FC\u30E0 \xB7 \u80CC\u666F\u30C9\u30E9\u30C3\u30B0: \u7BC4\u56F2\u9078\u629E",zoomOut:"\u7E2E\u5C0F",zoomReset:"100% \u306B\u623B\u3059",zoomIn:"\u62E1\u5927",zoomFit:"\u5168\u4F53\u3092\u8868\u793A",selectedLinks:t=>`${t} \u672C\u306E\u30EA\u30F3\u30AF\u3092\u9078\u629E\u4E2D`,deleteLinks:"\u30EA\u30F3\u30AF\u3092\u524A\u9664",deleteHint:"Delete \u3067\u3082\u524A\u9664\u3067\u304D\u307E\u3059",clearSelection:"\u9078\u629E\u89E3\u9664",selectedSlices:t=>`${t} \u30B9\u30E9\u30A4\u30B9\u3092\u9078\u629E\u4E2D`,groupIntoContext:"\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u306B\u307E\u3068\u3081\u308B",addToExistingAria:"\u65E2\u5B58\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u3078\u8FFD\u52A0",addToExistingOption:"\u65E2\u5B58\u3078\u8FFD\u52A0\u2026",removeFromContext:"\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u89E3\u9664",deleteButton:"\u524A\u9664"}}),Wt={SET_ELEMENT_NAME:(t,e,n)=>({title:t.renameElementTitle,tone:"update",body:t.renamed(R(n,e.target.id)?.name??"?",$(w.SET_ELEMENT_NAME,e).name)}),SET_ELEMENT_DESCRIPTION:(t,e)=>({title:t.updateDescriptionTitle,tone:"update",body:`\u2192 "${$(w.SET_ELEMENT_DESCRIPTION,e).description.slice(0,60)}"`}),SET_ELEMENT_TYPE:(t,e)=>({title:t.changeTypeTitle,tone:"update",body:`\u2192 ${$(w.SET_ELEMENT_TYPE,e).type}`}),SET_ELEMENT_CONTEXT:(t,e)=>({title:t.changeContextTitle,tone:"move",body:`\u2192 ${$(w.SET_ELEMENT_CONTEXT,e).contextId??t.noContext}`}),MOVE_ELEMENT:(t,e)=>({title:t.moveTitle,tone:"move",body:$(w.MOVE_ELEMENT,e).after===null?t.moveToFront:t.moveAfter($(w.MOVE_ELEMENT,e).after??"")}),ADD_ELEMENT:(t,e)=>({title:t.addElementTitle,tone:"create",body:`+ "${$(w.ADD_ELEMENT,e).name}"`}),DELETE_ELEMENT:(t,e,n)=>({title:t.deleteElementTitle,tone:"delete",body:`\u2212 "${R(n,e.target.id)?.name??e.target.id}"`}),LINK_ELEMENTS:(t,e)=>({title:t.linkTitle,tone:"create",body:`${$(w.LINK_ELEMENTS,e).from} \u2192 ${$(w.LINK_ELEMENTS,e).to}`}),SET_LINK_LABEL:(t,e)=>({title:t.renameLinkTitle,tone:"update",body:`\u2192 "${$(w.SET_LINK_LABEL,e).label}"`}),UNLINK_ELEMENTS:(t,e)=>({title:t.unlinkTitle,tone:"delete",body:`${$(w.UNLINK_ELEMENTS,e).from} \u2192 ${$(w.UNLINK_ELEMENTS,e).to}`}),ADD_CONTEXT:(t,e)=>({title:t.addContextTitle,tone:"create",body:`+ "${$(w.ADD_CONTEXT,e).name}"`}),SET_CONTEXT_NAME:(t,e)=>({title:t.renameContextTitle,tone:"update",body:`\u2192 "${$(w.SET_CONTEXT_NAME,e).name}"`}),DELETE_CONTEXT:(t,e,n)=>({title:t.deleteContextTitle,tone:"delete",body:`\u2212 "${H(n,e.target.id)?.name??e.target.id}"`})},Re=(t,e,n,o)=>{const i=Wt[e.type],r=i?i(t,e,o??n):{title:e.type,tone:"meta"};return{title:r.title,targetLabel:Xe(t,n,e.target),tone:r.tone,...r.body===void 0?{}:{summary:r.body}}},Be=t=>`${t.type} ${V(t.target)} ${JSON.stringify(t.payload)}`,Xe=(t,e,n)=>{switch(n.type){case"element":{const o=R(e,n.id);return o?t.elementLabel(o.name):`${t.elementLabel(n.id)} (missing)`}case"context":{const o=H(e,n.id);return o?t.contextLabel(o.name):`${t.contextLabel(n.id)} (missing)`}case"link":{const o=re(e,n.id);return o?t.linkLabel(o.from,o.to):`${t.linkGroup} \xB7 ${n.id} (missing)`}case"page":return t.pageLabel(de(e));default:return`${n.type} \xB7 ${n.id}`}},Ye=(t,e)=>[...e.elements.map(n=>({value:V({type:"element",id:n.id}),label:n.name,group:t.elementGroup})),...e.contexts.map(n=>({value:V({type:"context",id:n.id}),label:n.name,group:t.contextGroup}))],Ft=(t,e,n)=>{const o=e.elements.find(i=>i.id===n.note);return o?{value:V({type:"element",id:o.id}),label:o.name,group:t.elementGroup}:null},de=t=>t.title??"Event Storming",He=(t,e)=>{const n={...e},o=R(t,e.note);e.note!==void 0&&!o&&delete n.note;const i=H(t,e.context);return e.context!==void 0&&!i&&delete n.context,n},Ke=(t,e)=>{switch(e.type){case"element":return R(t,e.id)!==void 0;case"context":return H(t,e.id)!==void 0;case"link":return re(t,e.id)!==void 0;case"page":return!0;default:return!1}},We=t=>{const e=O(t);return{name:"event-storming",label:"Event Storming",parseBase:Le,emptyBase:Me,actions:w,apply:Ne,canonicalState:Kt,hasTarget:Ke,describe:(n,o,i)=>Re(e,n,o,i),serialize:Be,resolveNavigation:He,commentTargets:(n,o)=>Ye(e,n),currentTarget:(n,o)=>Ft(e,n,o),title:de}},Gt={width:300,height:260},Ut={event:{bg:"linear-gradient(178deg, #ffbc55, #f8a52e)",ink:"#402703"},command:{bg:"linear-gradient(178deg, #93c9f2, #74b4e8)",ink:"#0e2c4b"},aggregate:{bg:"linear-gradient(178deg, #fff3a6, #fdea7e)",ink:"#4a3a06"},actor:{bg:"linear-gradient(178deg, #ffdf63, #fdd23e)",ink:"#423204"},policy:{bg:"linear-gradient(178deg, #dcc2f7, #c9a6f0)",ink:"#32195c"},readmodel:{bg:"linear-gradient(178deg, #c0e788, #a8dc63)",ink:"#22380a"},external:{bg:"linear-gradient(178deg, #f9bcd3, #f4a0c0)",ink:"#4b1029"},hotspot:{bg:"linear-gradient(178deg, #d63550, #b81c33)",ink:"#ffffff"}},le=t=>{const{bg:e,ink:n}=Ut[t];return`--es-note-bg:${e};--es-note-ink:${n}`},qt=Ee`
|
|
2
2
|
:host {
|
|
3
3
|
display: flex;
|
|
4
4
|
flex-direction: column;
|
|
@@ -93,6 +93,8 @@ import{ac as ht,ad as q,ae as ne,af as oe,aA as N,ag as v,az as X,ah as F,ai as
|
|
|
93
93
|
line-height: 1.32;
|
|
94
94
|
letter-spacing: -0.01em;
|
|
95
95
|
overflow-wrap: anywhere;
|
|
96
|
+
/* As many lines as the fixed-size card holds; the rest ends in an ellipsis. */
|
|
97
|
+
--dpk-inline-edit-lines: 4;
|
|
96
98
|
}
|
|
97
99
|
|
|
98
100
|
:host([compact]) .note-name {
|
|
@@ -191,18 +193,19 @@ import{ac as ht,ad as q,ae as ne,af as oe,aA as N,ag as v,az as X,ah as F,ai as
|
|
|
191
193
|
backdrop-filter: blur(4px);
|
|
192
194
|
box-shadow: var(--dpk-bevel), var(--dpk-shadow-xs);
|
|
193
195
|
}
|
|
194
|
-
`;class
|
|
196
|
+
`;class Vt extends kt{static{this.styles=[Et,qt,ye]}static{this.properties={note:{attribute:!1},notes:{attribute:!1},mode:{type:String,reflect:!0,attribute:"data-mode"},focused:{type:Boolean,reflect:!0},compact:{type:Boolean,reflect:!0},onIntent:{attribute:!1}}}#e="";#n=new Te(this);#o=new yt(this);constructor(){super(),this.note=null,this.notes=[],this.mode="view",this.focused=!1,this.compact=!1,this.onIntent=null,this.addEventListener("click",()=>this.#r({kind:"select"}))}updated(e){if(e.has("note")&&this.note&&(this.setAttribute("data-type",this.note.type),this.note.description===void 0?this.removeAttribute("title"):this.setAttribute("title",this.note.description)),e.has("mode")&&(this.mode!=="commenting"&&(this.#e=""),this.mode==="editing"&&this.renderRoot.querySelector("dpk-component-inline-edit")?.startEditing()),this.mode!=="commenting")return;const n=this.renderRoot.querySelector(".comment-pop"),o=this.renderRoot.querySelector('[data-role="comment"]');n&&o&&this.#n.open(n,o,Gt)}render(){const e=this.note;if(!e)return L;const n=O(this.#o.locale),o=Nt(this.#o.locale);return k`
|
|
195
197
|
<div class="note-type">${n.noteTypeLabel(e.type)}</div>
|
|
196
198
|
<dpk-component-inline-edit
|
|
197
199
|
class="note-name"
|
|
198
200
|
?wrap=${!0}
|
|
201
|
+
?truncate=${!this.compact}
|
|
199
202
|
?seamless=${!0}
|
|
200
203
|
.value=${e.name}
|
|
201
204
|
.label=${n.noteNameLabel}
|
|
202
|
-
@dpk-commit=${
|
|
205
|
+
@dpk-commit=${wt(i=>this.#r({kind:"rename",name:i}))}
|
|
203
206
|
></dpk-component-inline-edit>
|
|
204
|
-
${this.notes.length>0?k`<span class="note-flag">${this.notes.length}</span>`:
|
|
205
|
-
${e.type==="hotspot"?
|
|
207
|
+
${this.notes.length>0?k`<span class="note-flag">${this.notes.length}</span>`:L}
|
|
208
|
+
${e.type==="hotspot"?L:k`<button
|
|
206
209
|
class="note-hotspot"
|
|
207
210
|
type="button"
|
|
208
211
|
data-role="hotspot"
|
|
@@ -220,7 +223,7 @@ import{ac as ht,ad as q,ae as ne,af as oe,aA as N,ag as v,az as X,ah as F,ai as
|
|
|
220
223
|
data-active=${String(this.mode==="commenting")}
|
|
221
224
|
@click=${this.#s(()=>({kind:"toggle-comment"}))}
|
|
222
225
|
>
|
|
223
|
-
${
|
|
226
|
+
${$t()}
|
|
224
227
|
</button>
|
|
225
228
|
<button
|
|
226
229
|
class="dpk-icon-btn"
|
|
@@ -229,11 +232,11 @@ import{ac as ht,ad as q,ae as ne,af as oe,aA as N,ag as v,az as X,ah as F,ai as
|
|
|
229
232
|
aria-label=${n.deleteNote}
|
|
230
233
|
@click=${this.#s(()=>({kind:"delete"}))}
|
|
231
234
|
>
|
|
232
|
-
${
|
|
235
|
+
${Tt()}
|
|
233
236
|
</button>
|
|
234
237
|
</div>
|
|
235
|
-
${this.mode==="commenting"?this.#t(o):
|
|
236
|
-
`}#t(e){return
|
|
238
|
+
${this.mode==="commenting"?this.#t(o):L}
|
|
239
|
+
`}#t(e){return _t(e,Ct(this.#e,this.notes.map(St),this.note?{key:`note:${this.note.id}`}:{}),n=>{n.kind==="input"?(this.#e=n.body,this.requestUpdate()):this.#r(n)})}#s(e){return n=>{n.stopPropagation(),this.#r(e(n))}}#r(e){this.onIntent?.(e)}}const jt=()=>{customElements.get("dpk-internal-event-storming-note")||customElements.define("dpk-internal-event-storming-note",Vt)},ce=.25,Fe=2,Ge=(t,e,n)=>({...t,panX:t.panX+e,panY:t.panY+n}),pe=(t,e,n,o)=>{const i=Se(t.zoom*o,ce,Fe),s=(e-t.panX)/t.zoom,r=(n-t.panY)/t.zoom;return{panX:e-s*i,panY:n-r*i,zoom:i}},Ue=(t,e,n)=>{const o=Math.max(1,e.width-n*2),i=Math.max(1,e.height-n*2),s=Math.max(ce,Math.min(1,o/Math.max(1,t.width),i/Math.max(1,t.height)));return{panX:(e.width-t.width*s)/2,panY:(e.height-t.height*s)/2,zoom:s}},qe=(t,e,n,o)=>{const i=(s,r,a,d)=>{const l=a*t.zoom;return l<=d?(d-l)/2-r*t.zoom:Math.min(-r*t.zoom,Math.max(d-(r+a)*t.zoom,s))};return{zoom:t.zoom,panX:i(t.panX,-o,e.width+o*2,n.width),panY:i(t.panY,-o,e.height+o*2,n.height)}},Zt=(t,e,n)=>e>=t.left&&e<=t.left+t.width&&n>=t.top&&n<=t.top+t.height,he=(t,e,n)=>{for(let o=t.length-1;o>=0;o-=1){const i=t[o];if(i!==void 0&&Zt(i.rect,e,n))return i.id}},Ve=(t,e)=>e<t.left+t.width/2?"before":"after",je=(t,e)=>t.filter(({rect:n})=>n.left<e.left+e.width&&e.left<n.left+n.width&&n.top<e.top+e.height&&e.top<n.top+n.height).map(({id:n})=>n),me=(t,e,n,o)=>{const i=new Set(e);if(n.some(p=>i.has(p)))return[];const s=t.filter(p=>!i.has(p)),r=n.map(p=>s.indexOf(p)).filter(p=>p>=0);if(r.length===0)return[];const a=o==="before"?Math.min(...r):Math.max(...r)+1,d=[];let l=s[a-1]??null;for(const p of t)i.has(p)&&(d.push({id:p,after:l}),l=p);return d},Ze=(t,e,n,o)=>{const i=me(t,e,n,o);if(i.length===0)return i;const s=[...t];for(const r of i){const a=s.indexOf(r.id),d=a<0?void 0:s[a];d!==void 0&&(s.splice(a,1),s.splice(r.after===null?0:s.indexOf(r.after)+1,0,d))}return It(s,t)?[]:i},Je=(t,e,n,o=4)=>{if(e.pointerId!==t.pointerId)return t;const{point:i}=e,s={pointerId:t.pointerId,start:t.start,current:i,moved:t.moved||Math.hypot(i.x-t.start.x,i.y-t.start.y)>o},r=he(n,i.x,i.y);switch(t.kind){case"connect":return{...s,kind:"connect",fromSliceId:t.fromSliceId,...r!==void 0&&r!==t.fromSliceId?{targetSliceId:r}:{}};case"move-slice":{const a=n.find(d=>d.id===r)?.rect;return{...s,kind:"move-slice",sliceId:t.sliceId,...r!==void 0&&r!==t.sliceId&&a!==void 0?{drop:{sliceId:r,side:Ve(a,i.x)}}:{}}}case"select":return{...s,kind:"select"}}},ue="data-pin";class Jt{#e;#n=new Set;#o;#t=new Map;constructor(e){this.#e=e,e.addController(this)}get heights(){return this.#t}hostConnected(){typeof ResizeObserver>"u"||(this.#o=new ResizeObserver(e=>this.#s(e)))}hostUpdated(){const e=this.#o;if(e===void 0)return;const n=new Set(this.#e.renderRoot.querySelectorAll(`[${ue}]`));for(const i of this.#n)n.has(i)||(e.unobserve(i),this.#n.delete(i));for(const i of n)this.#n.has(i)||(e.observe(i),this.#n.add(i));const o=new Set([...n].map(i=>i.getAttribute(ue)));[...this.#t.keys()].some(i=>!o.has(i))&&(this.#t=new Map([...this.#t].filter(([i])=>o.has(i))))}hostDisconnected(){this.#o?.disconnect(),this.#o=void 0,this.#n.clear()}#s(e){const n=new Map(this.#t);for(const o of e){const i=o.target.getAttribute(ue),s=o.borderBoxSize[0]?.blockSize;i===null||s===void 0||s===0||n.set(i,s)}[...n].every(([o,i])=>this.#t.get(o)===i)||(this.#t=n,this.#e.requestUpdate())}}const C={kind:"idle"},Qe=(t,e)=>t.kind==="editing"&&t.noteId===e?"editing":t.kind==="commenting"&&t.noteId===e?"commenting":"view",et=(t,e,n)=>{switch(n.kind){case"toggle-comment":return t.kind==="commenting"&&t.noteId===e?C:{kind:"commenting",noteId:e};case"comment":case"delete":case"dismiss":return C;case"select":case"add-hotspot":return t;case"rename":return t.kind==="editing"&&t.noteId===e?C:t}},Qt=6,en=10,tt="\u2026",tn=[[4352,4447],[11904,42191],[44032,55203],[63744,64255],[65072,65103],[65280,65376],[65504,65510],[127744,129791],[131072,262141]],fe=t=>{const e=t.codePointAt(0)??0;return tn.some(([n,o])=>e>=n&&e<=o)?en:Qt},nn=(t,e)=>{const n=Array.from(t);if(n.reduce((s,r)=>s+fe(r),0)<=e)return t;let o=fe(tt),i="";for(const s of n){if(o+=fe(s),o>e)break;i+=s}return`${i}${tt}`},nt=92,ge=54,on=18,ot=4,it=t=>{const e=[];let n=on;for(const o of t)e.push(n),n+=o+ot;return{lifts:e,extent:t.length===0?0:n-ot}},st=240,U=132,rt=96,xe=10,Q=24,ee=12,D=rt+ee*2,te=46,ne=16,at=44,dt=40,be=16,lt=13,K=8,sn=6,rn=26,an=(t,e)=>Math.max(at,t-ee+(e?rn:0)),dn=it([ge]).extent,ln=["actor","command","aggregate","event","policy","readmodel","external"],ct=t=>Q*2+t*U+(t-1)*xe,cn=(t,e)=>{const n=new Map;let o=0;for(const i of t.notes){const s=t.pins.filter(a=>a.targetId===i.id),r=it(s.map(a=>e(a.note.id)));s.forEach((a,d)=>n.set(a.note.id,r.lifts[d]??0)),o=Math.max(o,r.extent)}return{liftOf:n,extent:o}},pn=(t,e,n,o)=>{const i=new Map(e.map(f=>[f.id,ct(f.notes.length)])),s=Oe(t,e),r=Ae(e,s,{widthOf:f=>i.get(f)??0,gapX:te,padX:ne,maxWidth:Math.max(n,ct(1))}),a=new Map,d=new Map,l=new Map,p=new Map,m=new Map,u=new Map(e.map(f=>[f.id,f.contextId]));for(const f of e){const x=cn(f,E=>o.get(E)??ge);for(const[E,h]of x.liftOf)p.set(E,h);m.set(f.id,x.extent)}let b=K;const c=r.map((f,x)=>{const E=f.cutFrom===void 0?void 0:d.get(f.cutFrom.from),h=E===void 0?0:Math.max(0,E-ne);let T=h+ne;const A=an(Math.max(dn,...f.sliceIds.map(P=>m.get(P)??0)),f.sliceIds.some(P=>u.get(P)!==void 0));for(const P of f.sliceIds)a.set(P,T-h),d.set(P,T),l.set(P,x),T+=(i.get(P)??0)+te;const ve=A+D+dt,ft={sliceIds:f.sliceIds,x:h,width:T-te+ne-h,height:ve,y:b,head:A,cutFrom:f.cutFrom};return b+=ve+sn,ft}),g=c.at(-1);return{slices:e,bands:c,xOf:a,absXOf:d,bandOf:l,widthOf:i,pinLiftOf:p,arrows:s,width:Math.max(0,...c.map(f=>f.x+f.width))+K*2,height:g===void 0?K*2:g.y+g.height+K}},hn=t=>{const{m:e,context:n,maxRowWidth:o,pinHeights:i,viewport:s,handlers:r}=t,{state:a}=n,d=24*s.zoom,l=`background-size:${d}px ${d}px;background-position:${s.panX}px ${s.panY}px`;if(a.elements.length===0)return k`<div class="board-viewport board-viewport--empty" style=${l}>
|
|
237
240
|
<div class="empty">
|
|
238
241
|
<h2>${e.emptyTitle}</h2>
|
|
239
242
|
<p>${e.emptyBody}</p>
|
|
@@ -241,7 +244,7 @@ import{ac as ht,ad as q,ae as ne,af as oe,aA as N,ag as v,az as X,ah as F,ai as
|
|
|
241
244
|
${e.addFirstEvent}
|
|
242
245
|
</button>
|
|
243
246
|
</div>
|
|
244
|
-
</div>`;const p=
|
|
247
|
+
</div>`;const p=B(a),m=pn(a,p,o,i);return k`
|
|
245
248
|
<div
|
|
246
249
|
class="board-viewport${t.gesture!==void 0?" board-viewport--gesturing":""}"
|
|
247
250
|
data-testid="es-viewport"
|
|
@@ -260,74 +263,75 @@ import{ac as ht,ad as q,ae as ne,af as oe,aA as N,ag as v,az as X,ah as F,ai as
|
|
|
260
263
|
style=${`transform:translate(${s.panX}px, ${s.panY}px) scale(${s.zoom})`}
|
|
261
264
|
>
|
|
262
265
|
<div class="wall" data-testid="es-wall" style=${`width:${m.width}px;height:${m.height}px`}>
|
|
263
|
-
${
|
|
264
|
-
${m.bands.map((
|
|
266
|
+
${En(t,m)}
|
|
267
|
+
${m.bands.map((u,b)=>un(t,m,u,b))}
|
|
265
268
|
</div>
|
|
266
269
|
</div>
|
|
267
|
-
${
|
|
268
|
-
${
|
|
270
|
+
${gn(t.gesture)} ${xn(e,a,p)} ${bn(t)}
|
|
271
|
+
${vn(t)}
|
|
269
272
|
</div>
|
|
270
|
-
`},
|
|
271
|
-
style=${
|
|
273
|
+
`},mn=(t,e)=>{const n=["slice"];t.selectedSliceIds.includes(e.id)&&n.push("slice--selected");const o=t.gesture;return o?.kind==="connect"&&o.moved&&(o.fromSliceId!==e.id&&n.push("slice--candidate"),o.targetSliceId===e.id&&n.push("slice--target")),o?.kind==="move-slice"&&o.moved&&(o.sliceId===e.id&&n.push("slice--lifted"),o.drop?.sliceId===e.id&&n.push(o.drop.side==="before"?"slice--insert-before":"slice--insert-after")),n.join(" ")},un=(t,e,n,o)=>{const{m:i,context:s,mode:r,gesture:a,hoverSliceId:d,handlers:l}=t,{navigation:p}=s,m=n.sliceIds.flatMap(c=>e.slices.filter(g=>g.id===c)),u=c=>({x:e.xOf.get(c.id)??0,y:n.head,w:e.widthOf.get(c.id)??0}),b=(c,g,f=!1)=>k`<dpk-internal-event-storming-note
|
|
274
|
+
style=${g}
|
|
272
275
|
.note=${c}
|
|
273
276
|
.notes=${s.comments.filter(x=>x.target.type==="element"&&x.target.id===c.id)}
|
|
274
|
-
.mode=${
|
|
277
|
+
.mode=${Qe(r,c.id)}
|
|
275
278
|
?focused=${p.note===c.id}
|
|
276
|
-
?compact=${
|
|
277
|
-
data-pin=${
|
|
279
|
+
?compact=${f}
|
|
280
|
+
data-pin=${f?c.id:L}
|
|
278
281
|
.onIntent=${x=>l.noteIntent(c.id,x)}
|
|
279
282
|
></dpk-internal-event-storming-note>`;return k`
|
|
280
283
|
<section class="band" data-band=${o} style=${`left:${K+n.x}px;top:${n.y}px`}>
|
|
281
284
|
<div class="band-canvas" style=${`width:${n.width}px;height:${n.height}px`}>
|
|
282
|
-
${
|
|
283
|
-
${m.map(c=>{const{x:
|
|
284
|
-
class=${
|
|
285
|
+
${fn(t,e,o)}
|
|
286
|
+
${m.map(c=>{const{x:g,y:f,w:x}=u(c);return k`<div
|
|
287
|
+
class=${mn(t,c)}
|
|
285
288
|
data-slice-id=${c.id}
|
|
286
|
-
style=${`left:${
|
|
289
|
+
style=${`left:${g}px;top:${f}px;width:${x}px;height:${D}px`}
|
|
287
290
|
@pointerdown=${E=>l.slicePointerDown(c.id,E)}
|
|
288
291
|
></div>`})}
|
|
289
|
-
${
|
|
290
|
-
${
|
|
291
|
-
${m.map(c=>{const{x:
|
|
292
|
+
${we(m.flatMap(c=>c.notes.map((g,f)=>({slice:c,note:g,slot:f}))),({note:c})=>c.id,({slice:c,note:g,slot:f})=>{const{x,y:E}=u(c),h=x+Q+f*(U+xe);return b(g,`${le(g.type)};position:absolute;left:${h}px;top:${E+ee}px;width:${U}px;height:${rt}px;--es-tilt:${$n(g.id)}deg;z-index:2`)})}
|
|
293
|
+
${we(m.flatMap(c=>{const g=u(c);return c.notes.flatMap((f,x)=>c.pins.filter(h=>h.targetId===f.id).map((h,T)=>({pin:h,slot:x,index:T,at:g})))}),({pin:c})=>c.note.id,({pin:c,slot:g,index:f,at:x})=>{const E=x.x+Q+g*(U+xe),h=x.y+ee;return b(c.note,`${le(c.note.type)};position:absolute;left:${E+U-nt-6-f*10}px;bottom:${n.height-(h-(e.pinLiftOf.get(c.note.id)??0))}px;width:${nt}px;min-height:${ge}px;--es-tilt:-2.4deg;z-index:3`,!0)})}
|
|
294
|
+
${m.map(c=>{const{x:g,y:f,w:x}=u(c),E=d===c.id||a?.kind==="connect"&&a.fromSliceId===c.id;return k`<button
|
|
292
295
|
class="slice-port${E?" slice-port--on":""}"
|
|
293
296
|
type="button"
|
|
294
|
-
style=${`left:${
|
|
297
|
+
style=${`left:${g+x-lt}px;top:${f+D/2-lt}px`}
|
|
295
298
|
aria-label=${i.portAriaLabel}
|
|
296
299
|
title=${i.portTitle}
|
|
297
|
-
@pointerdown=${
|
|
300
|
+
@pointerdown=${h=>l.portPointerDown(c.id,h)}
|
|
298
301
|
>
|
|
299
302
|
→
|
|
300
303
|
</button>`})}
|
|
301
|
-
${m.map(c=>{if(d!==c.id||a!==void 0)return
|
|
304
|
+
${m.map(c=>{if(d!==c.id||a!==void 0)return L;const{x:g,y:f}=u(c),x=new Set(c.notes.map(h=>h.type)),E=ln.filter(h=>!x.has(h));return k`<div
|
|
302
305
|
class="slice-chips"
|
|
303
|
-
style=${`left:${
|
|
304
|
-
@pointerdown=${
|
|
306
|
+
style=${`left:${g}px;top:${f+D+6}px`}
|
|
307
|
+
@pointerdown=${h=>h.stopPropagation()}
|
|
305
308
|
>
|
|
306
|
-
${E.map(
|
|
307
|
-
${i.addTypeLabel(
|
|
309
|
+
${E.map(h=>k`<button class="slice-chip" type="button" @click=${()=>l.attachNote(c.id,h)}>
|
|
310
|
+
${i.addTypeLabel(h)}
|
|
308
311
|
</button>`)}
|
|
309
312
|
</div>`})}
|
|
310
313
|
</div>
|
|
311
314
|
</section>
|
|
312
|
-
`},
|
|
315
|
+
`},fn=(t,e,n)=>{const{m:o,context:i,handlers:s}=t,r=i.state.contexts.flatMap((a,d)=>{const p=e.slices.filter(h=>h.contextId===a.id).flatMap(h=>{const T=e.xOf.get(h.id),A=e.bandOf.get(h.id);return T===void 0||A===void 0?[]:[{x:T,band:A,width:e.widthOf.get(h.id)??0}]}),m=p.filter(h=>h.band===n);if(m.length===0)return[];const u=Math.min(...m.map(h=>h.x))-10,b=Math.max(...m.map(h=>h.x+h.width))+10,c=14,g=(e.bands[n]?.head??at)+D+12,f=p.some(h=>h.band<n)?"\u2026 ":"",x=p.some(h=>h.band>n)?" \u2026":"",E=String(d%5);return[k`<div
|
|
313
316
|
class="context-region"
|
|
314
317
|
data-hue=${E}
|
|
315
|
-
style=${`left:${
|
|
318
|
+
style=${`left:${u}px;top:${c}px;width:${b-u}px;height:${g-c}px`}
|
|
316
319
|
title=${a.description??a.name}
|
|
317
320
|
></div>
|
|
318
321
|
<div
|
|
319
322
|
class="context-label"
|
|
320
323
|
data-hue=${E}
|
|
321
|
-
style=${`left:${
|
|
322
|
-
@pointerdown=${
|
|
324
|
+
style=${`left:${u+10}px;top:${c}px;max-width:${b-u-20}px`}
|
|
325
|
+
@pointerdown=${h=>h.stopPropagation()}
|
|
323
326
|
>
|
|
324
327
|
<button
|
|
325
328
|
class="context-label-name"
|
|
326
329
|
type="button"
|
|
327
|
-
title=${
|
|
328
|
-
|
|
330
|
+
title=${`${a.name}
|
|
331
|
+
${o.renameContextHint}`}
|
|
332
|
+
@click=${h=>s.renameContext(a.id,{x:h.clientX,y:h.clientY})}
|
|
329
333
|
>
|
|
330
|
-
${
|
|
334
|
+
${f}${a.name}${x}
|
|
331
335
|
</button>
|
|
332
336
|
<button
|
|
333
337
|
class="context-label-x"
|
|
@@ -338,25 +342,25 @@ import{ac as ht,ad as q,ae as ne,af as oe,aA as N,ag as v,az as X,ah as F,ai as
|
|
|
338
342
|
>
|
|
339
343
|
✕
|
|
340
344
|
</button>
|
|
341
|
-
</div>`]});return r.length>0?k`${r}`:
|
|
345
|
+
</div>`]});return r.length>0?k`${r}`:L},gn=t=>{if(t===void 0||!t.moved)return L;if(t.kind==="connect")return k`<svg class="gesture-layer" aria-hidden="true">
|
|
342
346
|
${Y`<path class="connect-line" d=${`M ${t.start.x} ${t.start.y} L ${t.current.x} ${t.current.y}`}></path>
|
|
343
347
|
<circle class="connect-tip" cx=${t.current.x} cy=${t.current.y} r="5"></circle>`}
|
|
344
348
|
</svg>`;if(t.kind==="select"){const e=Math.min(t.start.x,t.current.x),n=Math.min(t.start.y,t.current.y),o=Math.abs(t.current.x-t.start.x),i=Math.abs(t.current.y-t.start.y);return k`<div
|
|
345
349
|
class="select-rect"
|
|
346
350
|
style=${`left:${e}px;top:${n}px;width:${o}px;height:${i}px`}
|
|
347
|
-
></div>`}return
|
|
351
|
+
></div>`}return L},xn=(t,e,n)=>k`<div class="board-hud">
|
|
348
352
|
<span class="board-hud-stat">${t.noteCount(e.elements.length)}</span>
|
|
349
353
|
<span class="board-hud-stat">${t.sliceCount(n.length)}</span>
|
|
350
354
|
<span class="board-hud-stat">${t.contextCount(e.contexts.length)}</span>
|
|
351
355
|
<span class="board-hint">${t.hudHint}</span>
|
|
352
|
-
</div>`,
|
|
356
|
+
</div>`,bn=t=>{const{m:e,viewport:n,handlers:o}=t;return k`<div class="board-zoom" @pointerdown=${i=>i.stopPropagation()}>
|
|
353
357
|
<button type="button" aria-label=${e.zoomOut} @click=${()=>o.zoomStep(-1)}>−</button>
|
|
354
358
|
<button type="button" class="board-zoom-pct" title=${e.zoomReset} @click=${()=>o.zoomReset()}>
|
|
355
359
|
${Math.round(n.zoom*100)}%
|
|
356
360
|
</button>
|
|
357
361
|
<button type="button" aria-label=${e.zoomIn} @click=${()=>o.zoomStep(1)}>+</button>
|
|
358
362
|
<button type="button" aria-label=${e.zoomFit} title=${e.zoomFit} @click=${()=>o.zoomFit()}>⛶</button>
|
|
359
|
-
</div>`},
|
|
363
|
+
</div>`},vn=t=>{const{m:e,context:n,selectedSliceIds:o,selectedLinkIds:i,handlers:s}=t;if(i.length===0&&o.length===0)return L;const r=n.state.contexts;return i.length>0?k`<div class="board-selection" @pointerdown=${a=>a.stopPropagation()}>
|
|
360
364
|
<span class="board-selection-count">${e.selectedLinks(i.length)}</span>
|
|
361
365
|
<button class="dpk-btn dpk-btn--accent" type="button" @click=${()=>s.deleteSelection()}>
|
|
362
366
|
${e.deleteLinks}
|
|
@@ -382,11 +386,11 @@ import{ac as ht,ad as q,ae as ne,af as oe,aA as N,ag as v,az as X,ah as F,ai as
|
|
|
382
386
|
${r.length>0?k`<select
|
|
383
387
|
class="dpk-select"
|
|
384
388
|
aria-label=${e.addToExistingAria}
|
|
385
|
-
@change=${a=>{const d
|
|
389
|
+
@change=${a=>{const d=Lt(a.target,HTMLSelectElement);d!==null&&(d.value!==""&&s.assignSelection(d.value),d.value="")}}
|
|
386
390
|
>
|
|
387
391
|
<option value="" selected>${e.addToExistingOption}</option>
|
|
388
392
|
${r.map(a=>k`<option value=${a.id}>${a.name}</option>`)}
|
|
389
|
-
</select>`:
|
|
393
|
+
</select>`:L}
|
|
390
394
|
<button class="dpk-btn" type="button" @click=${()=>s.stripSelectionContext()}>
|
|
391
395
|
${e.removeFromContext}
|
|
392
396
|
</button>
|
|
@@ -394,12 +398,12 @@ import{ac as ht,ad as q,ae as ne,af as oe,aA as N,ag as v,az as X,ah as F,ai as
|
|
|
394
398
|
<button class="dpk-icon-btn" type="button" aria-label=${e.clearSelection} @click=${()=>s.clearSelection()}>
|
|
395
399
|
✕
|
|
396
400
|
</button>
|
|
397
|
-
</div>`},
|
|
401
|
+
</div>`},pt=(t,e,n,o)=>({d:`M ${t.x} ${t.y} C ${e.x} ${e.y}, ${n.x} ${n.y}, ${o.x} ${o.y}`,mid:{x:(t.x+3*e.x+3*n.x+o.x)/8,y:(t.y+3*e.y+3*n.y+o.y)/8}}),kn=()=>Y`<marker id="es-arrow" viewBox="0 0 8 8" refX="7" refY="4" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
|
|
398
402
|
<path d="M0,0 L8,4 L0,8 z"></path>
|
|
399
|
-
</marker>`,
|
|
400
|
-
<defs>${
|
|
403
|
+
</marker>`,En=(t,e)=>{const n="url(#es-arrow)",o=[],i=a=>{const d=e.absXOf.get(a),l=e.bandOf.get(a),p=l===void 0?void 0:e.bands[l];if(!(d===void 0||l===void 0||p===void 0))return{x:K+d,y:p.y+p.head,w:e.widthOf.get(a)??0,band:l}},s=a=>{const d=e.bands[a];return d===void 0?0:d.y+d.height},r=(a,d,l,p,m)=>{o.push(Y`<path class="link-hit" d=${d} @pointerdown=${c=>c.stopPropagation()} @click=${c=>t.handlers.linkClick(a.id,c.shiftKey||c.metaKey||c.ctrlKey)}></path>`);const u=t.selectedLinkIds.includes(a.id)?" is-selected":"";if(o.push(Y`<path class="link-path${u}" d=${d} marker-end=${n}></path>`),a.label===void 0)return;const b={start:6,end:-6,middle:0}[p];o.push(Y`<text class="link-label" x=${l.x+b} y=${l.y-6} text-anchor=${p}><title>${a.label}</title>${nn(a.label,Math.min(m,st))}</text>`)};for(const a of e.arrows){const d=i(a.from),l=i(a.to);if(d===void 0||l===void 0)continue;if(d.band===l.band){const f=l.x>=d.x+d.w,x=f?l.x-(d.x+d.w):d.x-(l.x+l.w);if(x<=te+2){const h=d.y+D/2,T=f?d.x+d.w:d.x,A=f?l.x:l.x+l.w;r(a,`M ${T} ${h} L ${A} ${h}`,{x:(T+A)/2,y:h},"middle",Math.abs(A-T)-4);continue}const E=yn(d,l,s(d.band)-dt/2);r(a,E.d,E.mid,"middle",x+2*Q);continue}const p=d.y<l.y,m=d.x+be,u=Se(m,l.x+be,l.x+l.w-be),b={x:m,y:p?d.y+D:d.y},c={x:u,y:p?l.y:l.y+D},g=p?(s(d.band)+(e.bands[l.band]?.y??0))/2:(s(l.band)+(e.bands[d.band]?.y??0))/2;r(a,wn([b,{x:b.x,y:g},{x:c.x,y:g},c]),{x:c.x-6,y:g},"end",st)}return Y`<svg class="links-layer" width=${e.width} height=${e.height}>
|
|
404
|
+
<defs>${kn()}</defs>
|
|
401
405
|
${o}
|
|
402
|
-
</svg>`},
|
|
406
|
+
</svg>`},yn=(t,e,n)=>{const o=t.y+D;if(e.x>=t.x+t.w){const r={x:t.x+t.w-18,y:o},a={x:e.x+18,y:o};return pt(r,{x:r.x+48,y:n},{x:a.x-48,y:n},a)}const i={x:t.x+18,y:o},s={x:e.x+e.w-18,y:o};return pt(i,{x:i.x-48,y:n},{x:s.x+48,y:n},s)},wn=(t,e=10)=>{let n=`M ${t[0]?.x??0} ${t[0]?.y??0}`;for(let i=1;i<t.length-1;i+=1){const s=t[i-1],r=t[i],a=t[i+1];if(s===void 0||r===void 0||a===void 0)continue;const d=Math.sign(r.x-s.x),l=Math.sign(r.y-s.y),p=Math.sign(a.x-r.x),m=Math.sign(a.y-r.y),u=Math.hypot(r.x-s.x,r.y-s.y),b=Math.hypot(a.x-r.x,a.y-r.y),c=Math.max(0,Math.min(e,u/2,b/2));n+=` L ${r.x-d*c} ${r.y-l*c} Q ${r.x} ${r.y} ${r.x+p*c} ${r.y+m*c}`}const o=t.at(-1);return o===void 0?n:`${n} L ${o.x} ${o.y}`},$n=t=>{let e=0;for(const n of t)e=(e*31+n.charCodeAt(0))%997;return(e%17-8)*.09},Tn=Ee`
|
|
403
407
|
/* The board owns the whole main area; the viewport clips, never the shell. */
|
|
404
408
|
.dpk-main {
|
|
405
409
|
overflow: hidden;
|
|
@@ -421,6 +425,8 @@ import{ac as ht,ad as q,ae as ne,af as oe,aA as N,ag as v,az as X,ah as F,ai as
|
|
|
421
425
|
quiet sunken tray reads as the working surface under the wall. */
|
|
422
426
|
.board-viewport {
|
|
423
427
|
position: relative;
|
|
428
|
+
/* The board's own floating controls stack inside it, under the page's overlays (the review rail). */
|
|
429
|
+
isolation: isolate;
|
|
424
430
|
flex: 1 1 auto;
|
|
425
431
|
min-height: 0;
|
|
426
432
|
overflow: hidden;
|
|
@@ -660,7 +666,11 @@ import{ac as ht,ad as q,ae as ne,af as oe,aA as N,ag as v,az as X,ah as F,ai as
|
|
|
660
666
|
gap: 4px;
|
|
661
667
|
}
|
|
662
668
|
|
|
669
|
+
/* No wider than its region (the element sets the label's max-width); a long name ends in an ellipsis. */
|
|
663
670
|
.context-label-name {
|
|
671
|
+
min-width: 0;
|
|
672
|
+
overflow: hidden;
|
|
673
|
+
text-overflow: ellipsis;
|
|
664
674
|
border: none;
|
|
665
675
|
border-radius: 999px;
|
|
666
676
|
padding: 3px 10px;
|
|
@@ -686,6 +696,7 @@ import{ac as ht,ad as q,ae as ne,af as oe,aA as N,ag as v,az as X,ah as F,ai as
|
|
|
686
696
|
}
|
|
687
697
|
|
|
688
698
|
.context-label-x {
|
|
699
|
+
flex: none;
|
|
689
700
|
width: 18px;
|
|
690
701
|
height: 18px;
|
|
691
702
|
border: none;
|
|
@@ -802,11 +813,15 @@ import{ac as ht,ad as q,ae as ne,af as oe,aA as N,ag as v,az as X,ah as F,ai as
|
|
|
802
813
|
|
|
803
814
|
/* ------------------------------------------------------------ floating UI */
|
|
804
815
|
|
|
816
|
+
/* Keeps clear of the zoom control on the right: the hint's ellipsis gives way first. */
|
|
805
817
|
.board-hud {
|
|
806
818
|
position: absolute;
|
|
807
819
|
left: 12px;
|
|
808
820
|
bottom: 12px;
|
|
809
821
|
z-index: 40;
|
|
822
|
+
max-width: calc(100% - 200px);
|
|
823
|
+
overflow: hidden;
|
|
824
|
+
white-space: nowrap;
|
|
810
825
|
display: flex;
|
|
811
826
|
gap: 10px;
|
|
812
827
|
align-items: center;
|
|
@@ -836,11 +851,20 @@ import{ac as ht,ad as q,ae as ne,af as oe,aA as N,ag as v,az as X,ah as F,ai as
|
|
|
836
851
|
}
|
|
837
852
|
|
|
838
853
|
.board-hint {
|
|
854
|
+
overflow: hidden;
|
|
855
|
+
text-overflow: ellipsis;
|
|
839
856
|
color: var(--dpk-ink-faint);
|
|
840
857
|
opacity: 0.8;
|
|
841
858
|
letter-spacing: 0.02em;
|
|
842
859
|
}
|
|
843
860
|
|
|
861
|
+
/* A phone has no room beside the zoom control for the stats; the counts are in the review. */
|
|
862
|
+
@media (max-width: 760px) {
|
|
863
|
+
.board-hud {
|
|
864
|
+
display: none;
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
|
|
844
868
|
@keyframes dpk-hud-in {
|
|
845
869
|
from {
|
|
846
870
|
opacity: 0;
|
|
@@ -848,10 +872,12 @@ import{ac as ht,ad as q,ae as ne,af as oe,aA as N,ag as v,az as X,ah as F,ai as
|
|
|
848
872
|
}
|
|
849
873
|
}
|
|
850
874
|
|
|
875
|
+
/* Above the shell's hand-off dock while it floats in the same corner. */
|
|
851
876
|
.board-zoom {
|
|
852
877
|
position: absolute;
|
|
853
878
|
right: 12px;
|
|
854
|
-
|
|
879
|
+
/* Above the page's hand-off dock while it floats over this corner. */
|
|
880
|
+
bottom: calc(12px + var(--dpk-dock-clearance, 0px));
|
|
855
881
|
z-index: 40;
|
|
856
882
|
display: flex;
|
|
857
883
|
align-items: center;
|
|
@@ -978,11 +1004,11 @@ import{ac as ht,ad as q,ae as ne,af as oe,aA as N,ag as v,az as X,ah as F,ai as
|
|
|
978
1004
|
flex: 1 1 auto;
|
|
979
1005
|
min-width: 0;
|
|
980
1006
|
}
|
|
981
|
-
`,
|
|
982
|
-
${
|
|
983
|
-
${this.mode.kind==="append"?this.#P(e,this.mode.sliceId):
|
|
984
|
-
${this.naming!==void 0?this.#D(e,this.naming):
|
|
985
|
-
`}#i(){return this.renderRoot.querySelector(".board-viewport")}#a(e){const n=this.#i()?.getBoundingClientRect();return n===void 0?{x:e.clientX,y:e.clientY}:{x:e.clientX-n.left,y:e.clientY-n.top}}#l(e){const n=this.#i();if(n===null)return[];const o=n.getBoundingClientRect();return[...this.renderRoot.querySelectorAll("[data-slice-id]")].map(i=>{const s=i.getBoundingClientRect();return{id:i.dataset.sliceId??"",rect:{left:s.left-o.left-(e?.x??0),top:s.top-o.top-(e?.top??0),width:s.width+(e?.x??0)*2,height:s.height+(e?.top??0)+(e?.bottom??0)}}})}#h(e,n){const o=this.#i();o!==null&&(o.setPointerCapture(e.pointerId),this.gesture=n)}#
|
|
1007
|
+
`,Sn={width:260,height:150},In={width:236,height:210},Ln=64,Mn=["event","command","aggregate","actor","policy","readmodel","external"],Nn=1200,ht=5,_n={x:20,top:46,bottom:40};class mt extends $e{static{this.styles=[$e.styles,Tn,ye]}definitionFor(e){return We(e)}static{this.properties={mode:{state:!0},boardWidth:{state:!0},viewport:{state:!0},gesture:{state:!0},hoverSliceId:{state:!0},selectedSliceIds:{state:!0},selectedLinkIds:{state:!0},naming:{state:!0}}}#e;#n=new Te(this);#o=new Jt(this);constructor(){super(),this.mode=C,this.boardWidth=Nn,this.viewport={panX:24,panY:16,zoom:1},this.gesture=void 0,this.hoverSliceId=void 0,this.selectedSliceIds=[],this.selectedLinkIds=[],this.naming=void 0}disconnectedCallback(){super.disconnectedCallback(),this.#e?.disconnect(),this.#e=void 0}firstUpdated(){typeof ResizeObserver>"u"||(this.#e=new ResizeObserver(e=>{const n=e[0]?.contentRect.width;n!==void 0&&n>0&&(this.boardWidth=n)}),this.#e.observe(this))}updated(){super.updated(),this.#p(this.viewport),this.mode.kind==="append"&&this.#t("#append-menu",this.mode.point,In),this.naming!==void 0&&this.#t("#context-pop",this.naming.point,Sn,"#context-name")}#t(e,n,o,i){const s=this.renderRoot.querySelector(e);if(!s||s.matches(":popover-open")||(this.#n.open(s,Mt(n.x,n.y),o),i===void 0))return;const r=this.renderRoot.querySelector(i);r?.focus(),r instanceof HTMLInputElement&&r.select()}#s(){return Math.max(Cn,this.boardWidth-96)}renderRegions(e){return{main:this.#r(e)}}#r(e){const n=O(this.locale);return k`
|
|
1008
|
+
${hn({m:n,context:e,mode:this.mode,maxRowWidth:this.#s(),pinHeights:this.#o.heights,viewport:this.viewport,gesture:this.gesture,hoverSliceId:this.hoverSliceId,selectedSliceIds:this.selectedSliceIds,selectedLinkIds:this.selectedLinkIds,handlers:{noteIntent:(o,i)=>this.#S(o,i),addFirst:()=>this.#R(e),attachNote:(o,i)=>this.#C(e,o,i),viewportPointerDown:o=>this.#k(o),viewportPointerMove:o=>this.#E(o),viewportPointerUp:o=>this.#y(e,o),viewportPointerCancel:()=>this.gesture=void 0,viewportPointerLeave:()=>{this.gesture===void 0&&(this.hoverSliceId=void 0)},viewportWheel:o=>this.#w(o),portPointerDown:(o,i)=>this.#b(o,i),slicePointerDown:(o,i)=>this.#v(o,i),zoomStep:o=>this.#$(o),zoomFit:()=>this.#T(),zoomReset:()=>this.#m(1/this.viewport.zoom),groupSelection:o=>{this.selectedSliceIds.length>0&&(this.naming={kind:"create-context",sliceIds:this.selectedSliceIds,point:o})},assignSelection:o=>this.#g(e,o),stripSelectionContext:()=>this.#g(e,null),clearSelection:()=>{this.selectedSliceIds=[],this.selectedLinkIds=[]},linkClick:(o,i)=>this.#A(o,i),deleteSelection:()=>this.#f(e),keyDown:o=>this.#z(e,o),renameContext:(o,i)=>this.naming={kind:"rename-context",contextId:o,point:i},dissolveContext:o=>e.dispatch(y.deleteContext(o))}})}
|
|
1009
|
+
${this.mode.kind==="append"?this.#P(e,this.mode.sliceId):L}
|
|
1010
|
+
${this.naming!==void 0?this.#D(e,this.naming):L}
|
|
1011
|
+
`}#i(){return this.renderRoot.querySelector(".board-viewport")}#a(e){const n=this.#i()?.getBoundingClientRect();return n===void 0?{x:e.clientX,y:e.clientY}:{x:e.clientX-n.left,y:e.clientY-n.top}}#l(e){const n=this.#i();if(n===null)return[];const o=n.getBoundingClientRect();return[...this.renderRoot.querySelectorAll("[data-slice-id]")].map(i=>{const s=i.getBoundingClientRect();return{id:i.dataset.sliceId??"",rect:{left:s.left-o.left-(e?.x??0),top:s.top-o.top-(e?.top??0),width:s.width+(e?.x??0)*2,height:s.height+(e?.top??0)+(e?.bottom??0)}}})}#h(e,n){const o=this.#i();o!==null&&(o.setPointerCapture(e.pointerId),this.gesture=n)}#b(e,n){if(n.button!==0)return;n.stopPropagation(),n.preventDefault();const o=this.#a(n);this.#h(n,{kind:"connect",pointerId:n.pointerId,fromSliceId:e,start:o,current:o,moved:!1})}#v(e,n){if(n.button!==0)return;n.stopPropagation(),n.preventDefault();const o=this.#a(n);this.#h(n,{kind:"move-slice",pointerId:n.pointerId,sliceId:e,start:o,current:o,moved:!1})}#k(e){if(e.button!==0||this.gesture!==void 0)return;for(const o of e.composedPath()){if(o===e.currentTarget)break;if(o instanceof Element&&(o.tagName.toLowerCase()==="dpk-internal-event-storming-note"||o.matches("button, select, textarea, input, a")))return}const n=this.#a(e);(this.mode.kind==="editing"||this.mode.kind==="append")&&(this.mode=C),this.selectedLinkIds=[],this.#h(e,{kind:"select",pointerId:e.pointerId,start:n,current:n,moved:!1})}#E(e){const n=this.gesture,o=this.#a(e);if(n===void 0){const i=he(this.#l(_n),o.x,o.y);i!==this.hoverSliceId&&(this.hoverSliceId=i);return}this.gesture=Je(n,{pointerId:e.pointerId,point:o},this.#l(),ht)}#y(e,n){const o=this.gesture;if(o===void 0||n.pointerId!==o.pointerId)return;const i=Je(o,{pointerId:n.pointerId,point:this.#a(n)},this.#l(),ht);if(this.gesture=void 0,i.kind==="connect"){i.moved?i.targetSliceId!==void 0&&this.#I(e,i.fromSliceId,i.targetSliceId):this.#M(i.fromSliceId);return}if(i.kind==="move-slice"){if(!i.moved){this.selectedSliceIds=this.selectedSliceIds.includes(i.sliceId)?this.selectedSliceIds.filter(r=>r!==i.sliceId):[...this.selectedSliceIds,i.sliceId];return}i.drop!==void 0&&this.#O(e,i.sliceId,i.drop.sliceId,i.drop.side);return}if(!i.moved){this.selectedSliceIds=[];return}const s={left:Math.min(i.start.x,i.current.x),top:Math.min(i.start.y,i.current.y),width:Math.abs(i.current.x-i.start.x),height:Math.abs(i.current.y-i.start.y)};this.selectedSliceIds=[...je(this.#l(),s)]}#w(e){e.preventDefault();const n=this.#a(e);this.#p(e.ctrlKey||e.metaKey?pe(this.viewport,n.x,n.y,Math.exp(-e.deltaY*.01)):Ge(this.viewport,-e.deltaX,-e.deltaY))}#m(e){const n=this.#i()?.getBoundingClientRect();this.#p(pe(this.viewport,(n?.width??0)/2,(n?.height??0)/2,e))}#$(e){this.#m(e===1?1.2:1/1.2)}#T(){const e=this.#i()?.getBoundingClientRect(),n=this.#u();e===void 0||n===void 0||this.#p(Ue(n,{width:e.width,height:e.height},48))}#u(){const e=this.renderRoot.querySelector(".wall");return e===null?void 0:{width:e.offsetWidth,height:e.offsetHeight}}#p(e){const n=this.#i()?.getBoundingClientRect(),o=this.#u(),i=n===void 0||o===void 0||o.width===0||n.width===0?e:qe(e,o,{width:n.width,height:n.height},Ln),s=this.viewport;i.panX===s.panX&&i.panY===s.panY&&i.zoom===s.zoom||(this.viewport=i)}#S(e,n){const o=this.context();switch(n.kind){case"select":o.navigate({note:e});break;case"rename":o.dispatch(y.setElementName(e,n.name));break;case"comment":o.dispatch({type:"comment",target:`element:${e}`,payload:{body:n.body}});break;case"delete":o.dispatch(y.deleteElement(e)),o.navigation.note===e&&o.navigate({note:null});break;case"add-hotspot":this.#_(o,e);break}this.mode=et(this.mode,e,n)}#c(e,n){return B(e).find(o=>o.id===n)}#d(e){return e===void 0?[]:[...e.notes,...e.pins.map(n=>n.note)].map(n=>n.id)}#I(e,n,o){if(n===o)return;const i=B(e.state),s=i.find(u=>u.id===n),r=i.find(u=>u.id===o),a=s&&r?ze(s,r):void 0;if(s===void 0||r===void 0||a===void 0||e.state.links.some(u=>u.from===a.from&&u.to===a.to))return;const d=e.state.links.map(u=>u.id),l=e.state.elements.map(u=>u.id),p=G(s)?.id,m=p!==void 0&&i.indexOf(r)>i.indexOf(s)?Ze(l,this.#d(r),[p],"after"):[];e.dispatchBatch([y.linkElements(z(`link-${a.from}`,d),a.from,a.to,{kind:"flow"}),...m.map(u=>y.moveElement(u.id,u.after))])}#L(e){const n=this.#i(),o=this.#l().find(s=>s.id===e)?.rect;if(n===null||o===void 0)return;const i=n.getBoundingClientRect();return{x:i.left+o.left+o.width,y:i.top+o.top+o.height/2}}#M(e){const n=this.#L(e);n!==void 0&&(this.mode={kind:"append",sliceId:e,point:n})}#N(e,n,o){const i=this.#c(e.state,n),s=i?G(i):void 0;if(s===void 0){this.mode=C;return}const r=z(`new-${o}`,F(e.state)),a=e.state.links.map(l=>l.id);if(!e.dispatchBatch([y.addElement(r,o,O(this.locale).noteTypeLabel(o)),y.linkElements(z(`link-${s.id}`,a),s.id,r,{kind:"flow"})]).ok){this.mode=C;return}e.navigate({note:r}),this.mode={kind:"editing",noteId:r}}#_(e,n){const o=z("new-hotspot",F(e.state)),i=e.state.links.map(r=>r.id);e.dispatchBatch([y.addElement(o,"hotspot",O(this.locale).noteTypeLabel("hotspot")),y.linkElements(z(`link-${o}`,i),o,n,{kind:"member"})]).ok&&(e.navigate({note:o}),this.mode={kind:"editing",noteId:o})}#C(e,n,o){const i=this.#c(e.state,n),s=i===void 0?void 0:Ce(i,o);if(s===void 0)return;const r=z(`new-${o}`,F(e.state)),[a,d]=s.incoming?[r,s.anchorId]:[s.anchorId,r],l=e.state.links.map(m=>m.id);e.dispatchBatch([y.addElement(r,o,O(this.locale).noteTypeLabel(o)),y.linkElements(z(`link-${a}`,l),a,d,{kind:"member"})]).ok&&(e.navigate({note:r}),this.mode={kind:"editing",noteId:r})}#O(e,n,o,i){const s=e.state,r=me(s.elements.map(a=>a.id),this.#d(this.#c(s,n)),this.#d(this.#c(s,o)),i);e.dispatchBatch(r.map(a=>y.moveElement(a.id,a.after)))}#A(e,n){this.mode.kind==="editing"&&(this.mode=C),this.selectedSliceIds=[],this.selectedLinkIds=n?this.selectedLinkIds.includes(e)?this.selectedLinkIds.filter(o=>o!==e):[...this.selectedLinkIds,e]:[e],this.#i()?.focus()}#f(e){if(this.selectedLinkIds.length>0){const i=e.state.links.filter(s=>this.selectedLinkIds.includes(s.id));e.dispatchBatch(i.map(s=>y.unlinkElements(s.from,s.to))),this.selectedLinkIds=[];return}if(this.selectedSliceIds.length===0)return;const n=B(e.state),o=this.selectedSliceIds.flatMap(i=>this.#d(n.find(s=>s.id===i)));e.dispatchBatch(o.map(i=>y.deleteElement(i))),this.selectedSliceIds=[]}#z(e,n){if(n.target!==n.currentTarget)return;if(n.key==="Escape"){this.selectedSliceIds=[],this.selectedLinkIds=[];return}if(n.key!=="Delete"&&n.key!=="Backspace"||this.mode.kind!=="idle"||this.naming!==void 0)return;if(n.preventDefault(),this.selectedLinkIds.length>0||this.selectedSliceIds.length>0){this.#f(e);return}const o=e.navigation.note;o===void 0||R(e.state,o)===void 0||(e.dispatch(y.deleteElement(o)),e.navigate({note:null}))}#g(e,n){const o=B(e.state),i=this.selectedSliceIds.flatMap(r=>this.#d(o.find(a=>a.id===r)));e.dispatchBatch(i.map(r=>y.setElementContext(r,n))).ok&&(this.selectedSliceIds=[])}#x(e,n){const i=this.renderRoot.querySelector("#context-name")?.value.trim()??"";if(i==="")return;if(n.kind==="rename-context"){e.dispatch(y.setContextName(n.contextId,i)).ok&&(this.naming=void 0);return}const s=z("context",e.state.contexts.map(l=>l.id)),r=B(e.state),a=n.sliceIds.flatMap(l=>this.#d(r.find(p=>p.id===l)));e.dispatchBatch([y.addContext(s,i),...a.map(l=>y.setElementContext(l,s))]).ok&&(this.selectedSliceIds=[],this.naming=void 0)}#D(e,n){const o=O(this.locale),i=n.kind==="rename-context"?H(e.state,n.contextId)?.name??"":"";return k`<div id="context-pop" class="comment-pop context-pop" popover="manual">
|
|
986
1012
|
<span class="dpk-label"> ${n.kind==="create-context"?o.newContextTitle:o.renameContextTitle} </span>
|
|
987
1013
|
<input
|
|
988
1014
|
id="context-name"
|
|
@@ -990,28 +1016,28 @@ import{ac as ht,ad as q,ae as ne,af as oe,aA as N,ag as v,az as X,ah as F,ai as
|
|
|
990
1016
|
type="text"
|
|
991
1017
|
placeholder=${o.contextNamePlaceholder}
|
|
992
1018
|
.value=${i}
|
|
993
|
-
@keydown=${s=>{s.key==="Enter"&&this.#
|
|
1019
|
+
@keydown=${s=>{s.key==="Enter"&&this.#x(e,n),s.key==="Escape"&&(this.naming=void 0)}}
|
|
994
1020
|
/>
|
|
995
1021
|
<div class="pop-actions">
|
|
996
1022
|
<button class="dpk-btn" type="button" @click=${()=>this.naming=void 0}>${o.cancel}</button>
|
|
997
|
-
<button class="dpk-btn dpk-btn--accent" type="button" @click=${()=>this.#
|
|
1023
|
+
<button class="dpk-btn dpk-btn--accent" type="button" @click=${()=>this.#x(e,n)}>
|
|
998
1024
|
${n.kind==="create-context"?o.create:o.save}
|
|
999
1025
|
</button>
|
|
1000
1026
|
</div>
|
|
1001
1027
|
</div>`}#P(e,n){const o=O(this.locale),i=this.#c(e.state,n),s=i===void 0?void 0:G(i);return k`<div id="append-menu" class="comment-pop append-menu" popover="manual">
|
|
1002
1028
|
<span class="dpk-label">${s===void 0?o.appendMenuNext:o.appendMenuAfter(s.name)}</span>
|
|
1003
1029
|
<div class="type-options">
|
|
1004
|
-
${
|
|
1030
|
+
${Mn.map(r=>k`<button
|
|
1005
1031
|
class="type-chip"
|
|
1006
1032
|
type="button"
|
|
1007
1033
|
data-type=${r}
|
|
1008
|
-
style=${
|
|
1034
|
+
style=${le(r)}
|
|
1009
1035
|
@click=${()=>this.#N(e,n,r)}
|
|
1010
1036
|
>
|
|
1011
1037
|
${o.noteTypeLabel(r)}
|
|
1012
1038
|
</button>`)}
|
|
1013
1039
|
</div>
|
|
1014
1040
|
<div class="pop-actions">
|
|
1015
|
-
<button class="dpk-btn" type="button" @click=${()=>this.mode=
|
|
1041
|
+
<button class="dpk-btn" type="button" @click=${()=>this.mode=C}>${o.cancel}</button>
|
|
1016
1042
|
</div>
|
|
1017
|
-
</div>`}#R(e){const n=
|
|
1043
|
+
</div>`}#R(e){const n=z("new-event",F(e.state));if(!e.dispatch(y.addElement(n,"event",O(this.locale).noteTypeLabel("event"))).ok){this.mode=C;return}e.navigate({note:n}),this.mode={kind:"editing",noteId:n}}}const Cn=264,ut=()=>{jt(),customElements.get("dpk-template-event-storming")||customElements.define("dpk-template-event-storming",mt)},On=Object.freeze(Object.defineProperty({__proto__:null,DpkTemplateEventStorming:mt,ES_IDLE:C,NOTE_TYPES:j,ZOOM_MAX:Fe,ZOOM_MIN:ce,allNoteIds:F,applyEventStormingAction:Ne,attachAnchor:Ce,buildSlices:B,connectionEndpoints:ze,constrainViewport:qe,defineEventStormingElement:ut,describeEventStormingAction:Re,dropSide:Ve,emptyEventStormingBase:Me,eventStormingAction:y,eventStormingActions:w,eventStormingBaseSchema:Ie,eventStormingCommentTargets:Ye,eventStormingDefinitionFor:We,eventStormingHasTarget:Ke,eventStormingMessages:O,eventStormingTargetLabel:Xe,eventStormingTitle:de,findContext:H,findLink:re,findNote:R,fitViewport:Ue,hitRect:he,noteCardModeOf:Qe,panBy:Ge,parseEventStormingBase:Le,planSliceBands:Ae,rectsInBand:je,reduceNoteIntent:et,resolveEventStormingNavigation:He,sameSlice:J,serializeEventStormingAction:Be,sliceArrows:Oe,sliceMovePlan:me,sliceMoveSteps:Ze,sliceVoice:G,zoomAt:pe},Symbol.toStringTag,{value:"Module"}));export{ut as d,On as i};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const s=(t,o,e)=>e.top<o.top?t+e.top-o.top:e.bottom<=o.bottom?t:t+Math.min(e.bottom-o.bottom,e.top-o.top),b=(t,o)=>{const n=t.getBoundingClientRect().top+t.clientTop;t.scrollTop=s(t.scrollTop,{top:n,bottom:n+t.clientHeight},o.getBoundingClientRect())},g=(t,o)=>{const n=t.getBoundingClientRect().left+t.clientLeft,l=o.getBoundingClientRect();t.scrollLeft=s(t.scrollLeft,{top:n,bottom:n+t.clientWidth},{top:l.left,bottom:l.right})};export{g as a,b as r};
|