dev-process-kit 0.0.8 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/dist/THIRD_PARTY_LICENSES.md +47 -0
- package/dist/chunks/shared-BQFDKhM1.js +2402 -0
- package/dist/chunks/shared-Bd9pmv5a.js +30 -0
- package/dist/chunks/{shared-Dn4XK7mS.js → shared-BdUyaZo-.js} +26 -16
- package/dist/chunks/shared-C2ytkQtn.js +1094 -0
- package/dist/chunks/shared-CDUEK_Mh.js +599 -0
- package/dist/chunks/{shared-DEdm-PCj.js → shared-CNbKTeSv.js} +1 -1
- package/dist/chunks/{shared-DNk3phV5.js → shared-COrrbgIn.js} +1 -1
- package/dist/chunks/{shared-CwwZhA40.js → shared-CQXKAPdi.js} +336 -268
- package/dist/chunks/shared-CmNWTIOz.js +1 -0
- package/dist/chunks/{shared-BTlCV660.js → shared-DkFF4haI.js} +8 -8
- package/dist/chunks/shared-Dmq-C6h3.js +2239 -0
- package/dist/chunks/shared-Ds5vLeFk.js +556 -0
- package/dist/chunks/shared-FtbePk3S.js +1252 -0
- package/dist/chunks/{shared-CupreHTH.js → shared-qb0tjbw2.js} +7 -7
- 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 -0
- package/package.json +3 -2
- package/dist/chunks/shared-1AA-0t4O.js +0 -29
- package/dist/chunks/shared-BAePwoKi.js +0 -679
- package/dist/chunks/shared-BYZoeQ97.js +0 -1963
- package/dist/chunks/shared-CSV1HkB2.js +0 -1
- package/dist/chunks/shared-CaLe76va.js +0 -576
- package/dist/chunks/shared-Csmm_KdH.js +0 -761
- package/dist/chunks/shared-VNSWugEg.js +0 -556
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a9 as ht,aa as q,ab as ne,ac as oe,av as N,ad as v,at as X,ae as F,af as L,ag as M,q as T,an as S,v as ie,as as xe,P as mt,f as ut,_ as ft,V,R as $,a0 as ve,a5 as gt,k as bt,$ as ke,a6 as xt,a1 as I,ay as vt,a2 as k,A as kt,K as Et,i as yt,aB as wt,a4 as Y,a3 as Ee,aC as $t,T as ye,m as A}from"./shared-BYZoeQ97.js";import{P as we,c as Tt,r as St,p as It,a as Lt}from"./shared-1AA-0t4O.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{ab as ht,ac as q,ad as ne,ae as oe,ay as N,af as v,aw as X,ag as K,ah as L,ai as M,p as T,aq as S,v as ie,av as xe,P as mt,e as ut,a0 as ft,V,R as $,a2 as ve,a7 as gt,j as bt,a1 as ke,a8 as xt,a3 as I,aB as vt,a4 as k,A as kt,K as Et,h as yt,aE as wt,a6 as Y,a5 as Ee,aF as $t,T as ye,l as A}from"./shared-BQFDKhM1.js";import{P as we,c as Tt,r as St,p as It,a as Lt}from"./shared-Bd9pmv5a.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:K(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(K(["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:K(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:K(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(K(["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},Ft={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}=Ft[t];return`--es-note-bg:${e};--es-note-ink:${n}`},Kt=ve`
|
|
2
2
|
:host {
|
|
3
3
|
display: flex;
|
|
4
4
|
flex-direction: column;
|
|
@@ -191,7 +191,7 @@ import{a9 as ht,aa as q,ab as ne,ac as oe,av as N,ad as v,at as X,ae as F,af as
|
|
|
191
191
|
backdrop-filter: blur(4px);
|
|
192
192
|
box-shadow: var(--dpk-bevel), var(--dpk-shadow-xs);
|
|
193
193
|
}
|
|
194
|
-
`;class Wt extends gt{static{this.styles=[bt,
|
|
194
|
+
`;class Wt extends gt{static{this.styles=[bt,Kt,ke]}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 we(this);#o=new xt(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,Ht)}render(){const e=this.note;if(!e)return I;const n=O(this.#o.locale),o=Tt(this.#o.locale);return k`
|
|
195
195
|
<div class="note-type">${n.noteTypeLabel(e.type)}</div>
|
|
196
196
|
<dpk-component-inline-edit
|
|
197
197
|
class="note-name"
|
|
@@ -233,7 +233,7 @@ import{a9 as ht,aa as q,ab as ne,ac as oe,av as N,ad as v,at as X,ae as F,af as
|
|
|
233
233
|
</button>
|
|
234
234
|
</div>
|
|
235
235
|
${this.mode==="commenting"?this.#t(o):I}
|
|
236
|
-
`}#t(e){return St(e,It(this.#e,this.notes.map(yt)),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 Gt=()=>{customElements.get("dpk-internal-event-storming-note")||customElements.define("dpk-internal-event-storming-note",Wt)},le=.25,
|
|
236
|
+
`}#t(e){return St(e,It(this.#e,this.notes.map(yt),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 Gt=()=>{customElements.get("dpk-internal-event-storming-note")||customElements.define("dpk-internal-event-storming-note",Wt)},le=.25,Fe=2,Ke=(t,e,n)=>({...t,panX:t.panX+e,panY:t.panY+n}),ce=(t,e,n,o)=>{const i=$e(t.zoom*o,le,Fe),s=(e-t.panX)/t.zoom,r=(n-t.panY)/t.zoom;return{panX:e-s*i,panY:n-r*i,zoom:i}},We=(t,e,n)=>{const o=Math.max(1,e.width-n*2),i=Math.max(1,e.height-n*2),s=Math.max(le,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}},Ge=(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)}},Ut=(t,e,n)=>e>=t.left&&e<=t.left+t.width&&n>=t.top&&n<=t.top+t.height,pe=(t,e,n)=>{for(let o=t.length-1;o>=0;o-=1){const i=t[o];if(i!==void 0&&Ut(i.rect,e,n))return i.id}},Ue=(t,e)=>e<t.left+t.width/2?"before":"after",qe=(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),he=(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},Ve=(t,e,n,o)=>{const i=he(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 wt(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=pe(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:Ue(a,i.x)}}:{}}}case"select":return{...s,kind:"select"}}},me="data-pin";class qt{#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(`[${me}]`));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(me)));[...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(me),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 _={kind:"idle"},Ze=(t,e)=>t.kind==="editing"&&t.noteId===e?"editing":t.kind==="commenting"&&t.noteId===e?"commenting":"view",Je=(t,e,n)=>{switch(n.kind){case"toggle-comment":return t.kind==="commenting"&&t.noteId===e?_:{kind:"commenting",noteId:e};case"comment":case"delete":case"dismiss":return _;case"select":case"add-hotspot":return t;case"rename":return t.kind==="editing"&&t.noteId===e?_:t}},Qe=92,ue=54,Vt=18,et=4,tt=t=>{const e=[];let n=Vt;for(const o of t)e.push(n),n+=o+et;return{lifts:e,extent:t.length===0?0:n-et}},U=132,nt=96,fe=10,ge=24,Q=12,z=nt+Q*2,ee=46,te=16,ot=44,it=40,be=16,st=13,F=8,jt=6,Zt=t=>Math.max(ot,t-Q),Jt=tt([ue]).extent,Qt=["actor","command","aggregate","event","policy","readmodel","external"],rt=t=>ge*2+t*U+(t-1)*fe,en=(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=tt(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}},tn=(t,e,n,o)=>{const i=new Map(e.map(h=>[h.id,rt(h.notes.length)])),s=_e(t,e),r=Ce(e,s,{widthOf:h=>i.get(h)??0,gapX:ee,padX:te,maxWidth:Math.max(n,rt(1))}),a=new Map,d=new Map,l=new Map,p=new Map,m=new Map;for(const h of e){const b=en(h,x=>o.get(x)??ue);for(const[x,E]of b.liftOf)p.set(x,E);m.set(h.id,b.extent)}let f=F;const g=r.map((h,b)=>{const x=h.cutFrom===void 0?void 0:d.get(h.cutFrom.from),E=x===void 0?0:Math.max(0,x-te);let u=E+te;const C=Zt(Math.max(Jt,...h.sliceIds.map(B=>m.get(B)??0)));for(const B of h.sliceIds)a.set(B,u-E),d.set(B,u),l.set(B,b),u+=(i.get(B)??0)+ee;const D=C+z+it,pt={sliceIds:h.sliceIds,x:E,width:u-ee+te-E,height:D,y:f,head:C,cutFrom:h.cutFrom};return f+=D+jt,pt}),c=g.at(-1);return{slices:e,bands:g,xOf:a,absXOf:d,bandOf:l,widthOf:i,pinLiftOf:p,arrows:s,width:Math.max(0,...g.map(h=>h.x+h.width))+F*2,height:c===void 0?F*2:c.y+c.height+F}},nn=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
237
|
<div class="empty">
|
|
238
238
|
<h2>${e.emptyTitle}</h2>
|
|
239
239
|
<p>${e.emptyBody}</p>
|
|
@@ -277,7 +277,7 @@ import{a9 as ht,aa as q,ab as ne,ac as oe,av as N,ad as v,at as X,ae as F,af as
|
|
|
277
277
|
data-pin=${b?c.id:I}
|
|
278
278
|
.onIntent=${x=>l.noteIntent(c.id,x)}
|
|
279
279
|
></dpk-internal-event-storming-note>`;return k`
|
|
280
|
-
<section class="band" data-band=${o} style=${`left:${
|
|
280
|
+
<section class="band" data-band=${o} style=${`left:${F+n.x}px;top:${n.y}px`}>
|
|
281
281
|
<div class="band-canvas" style=${`width:${n.width}px;height:${n.height}px`}>
|
|
282
282
|
${rn(t,e,o)}
|
|
283
283
|
${m.map(c=>{const{x:h,y:b,w:x}=f(c);return k`<div
|
|
@@ -396,7 +396,7 @@ import{a9 as ht,aa as q,ab as ne,ac as oe,av as N,ad as v,at as X,ae as F,af as
|
|
|
396
396
|
</button>
|
|
397
397
|
</div>`},at=(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}}),pn=()=>Y`<marker id="es-arrow" viewBox="0 0 8 8" refX="7" refY="4" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
|
|
398
398
|
<path d="M0,0 L8,4 L0,8 z"></path>
|
|
399
|
-
</marker>`,hn=(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:
|
|
399
|
+
</marker>`,hn=(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:F+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)=>{o.push(Y`<path class="link-hit" d=${d} @pointerdown=${g=>g.stopPropagation()} @click=${g=>t.handlers.linkClick(a.id,g.shiftKey||g.metaKey||g.ctrlKey)}></path>`);const m=t.selectedLinkIds.includes(a.id)?" is-selected":"";if(o.push(Y`<path class="link-path${m}" d=${d} marker-end=${n}></path>`),a.label===void 0)return;const f={start:6,end:-6,middle:0}[p];o.push(Y`<text class="link-label" x=${l.x+f} y=${l.y-6} text-anchor=${p}>${a.label}</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 b=l.x>=d.x+d.w;if((b?l.x-(d.x+d.w):d.x-(l.x+l.w))<=ee+2){const u=d.y+z/2,C=b?d.x+d.w:d.x,D=b?l.x:l.x+l.w;r(a,`M ${C} ${u} L ${D} ${u}`,{x:(C+D)/2,y:u},"middle");continue}const E=mn(d,l,s(d.band)-it/2);r(a,E.d,E.mid,"middle");continue}const p=d.y<l.y,m=d.x+be,f=$e(m,l.x+be,l.x+l.w-be),g={x:m,y:p?d.y+z:d.y},c={x:f,y:p?l.y:l.y+z},h=p?(s(d.band)+(e.bands[l.band]?.y??0))/2:(s(l.band)+(e.bands[d.band]?.y??0))/2;r(a,un([g,{x:g.x,y:h},{x:c.x,y:h},c]),{x:c.x-6,y:h},"end")}return Y`<svg class="links-layer" width=${e.width} height=${e.height}>
|
|
400
400
|
<defs>${pn()}</defs>
|
|
401
401
|
${o}
|
|
402
402
|
</svg>`},mn=(t,e,n)=>{const o=t.y+z;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 at(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 at(i,{x:i.x-48,y:n},{x:s.x+48,y:n},s)},un=(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),f=Math.hypot(r.x-s.x,r.y-s.y),g=Math.hypot(a.x-r.x,a.y-r.y),c=Math.max(0,Math.min(e,f/2,g/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}`},fn=t=>{let e=0;for(const n of t)e=(e*31+n.charCodeAt(0))%997;return(e%17-8)*.09},gn=ve`
|
|
@@ -982,7 +982,7 @@ import{a9 as ht,aa as q,ab as ne,ac as oe,av as N,ad as v,at as X,ae as F,af as
|
|
|
982
982
|
${nn({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.#x(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))}})}
|
|
983
983
|
${this.mode.kind==="append"?this.#P(e,this.mode.sliceId):I}
|
|
984
984
|
${this.naming!==void 0?this.#D(e,this.naming):I}
|
|
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)}#x(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=_),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=pe(this.#l(yn),o.x,o.y);i!==this.hoverSliceId&&(this.hoverSliceId=i);return}this.gesture=je(n,{pointerId:e.pointerId,point:o},this.#l(),dt)}#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(),dt);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=[...qe(this.#l(),s)]}#w(e){e.preventDefault();const n=this.#a(e);this.#p(e.ctrlKey||e.metaKey?ce(this.viewport,n.x,n.y,Math.exp(-e.deltaY*.01)):
|
|
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)}#x(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=_),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=pe(this.#l(yn),o.x,o.y);i!==this.hoverSliceId&&(this.hoverSliceId=i);return}this.gesture=je(n,{pointerId:e.pointerId,point:o},this.#l(),dt)}#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(),dt);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=[...qe(this.#l(),s)]}#w(e){e.preventDefault();const n=this.#a(e);this.#p(e.ctrlKey||e.metaKey?ce(this.viewport,n.x,n.y,Math.exp(-e.deltaY*.01)):Ke(this.viewport,-e.deltaX,-e.deltaY))}#m(e){const n=this.#i()?.getBoundingClientRect();this.#p(ce(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(We(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:Ge(e,o,{width:n.width,height:n.height},vn),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=Je(this.mode,e,n)}#c(e,n){return R(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=R(e.state),s=i.find(f=>f.id===n),r=i.find(f=>f.id===o),a=s&&r?Oe(s,r):void 0;if(s===void 0||r===void 0||a===void 0||e.state.links.some(f=>f.from===a.from&&f.to===a.to))return;const d=e.state.links.map(f=>f.id),l=e.state.elements.map(f=>f.id),p=G(s)?.id,m=p!==void 0&&i.indexOf(r)>i.indexOf(s)?Ve(l,this.#d(r),[p],"after"):[];e.dispatchBatch([y.linkElements(A(`link-${a.from}`,d),a.from,a.to,{kind:"flow"}),...m.map(f=>y.moveElement(f.id,f.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=_;return}const r=A(`new-${o}`,W(e.state)),a=e.state.links.map(l=>l.id);if(!e.dispatchBatch([y.addElement(r,o,O(this.locale).noteTypeLabel(o)),y.linkElements(A(`link-${s.id}`,a),s.id,r,{kind:"flow"})]).ok){this.mode=_;return}e.navigate({note:r}),this.mode={kind:"editing",noteId:r}}#_(e,n){const o=A("new-hotspot",W(e.state)),i=e.state.links.map(r=>r.id);e.dispatchBatch([y.addElement(o,"hotspot",O(this.locale).noteTypeLabel("hotspot")),y.linkElements(A(`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:Ne(i,o);if(s===void 0)return;const r=A(`new-${o}`,W(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(A(`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=he(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=_),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=R(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||P(e.state,o)===void 0||(e.dispatch(y.deleteElement(o)),e.navigate({note:null}))}#g(e,n){const o=R(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=[])}#b(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=A("context",e.state.contexts.map(l=>l.id)),r=R(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
986
|
<span class="dpk-label"> ${n.kind==="create-context"?o.newContextTitle:o.renameContextTitle} </span>
|
|
987
987
|
<input
|
|
988
988
|
id="context-name"
|
|
@@ -1014,4 +1014,4 @@ import{a9 as ht,aa as q,ab as ne,ac as oe,av as N,ad as v,at as X,ae as F,af as
|
|
|
1014
1014
|
<div class="pop-actions">
|
|
1015
1015
|
<button class="dpk-btn" type="button" @click=${()=>this.mode=_}>${o.cancel}</button>
|
|
1016
1016
|
</div>
|
|
1017
|
-
</div>`}#R(e){const n=A("new-event",W(e.state));if(!e.dispatch(y.addElement(n,"event",O(this.locale).noteTypeLabel("event"))).ok){this.mode=_;return}e.navigate({note:n}),this.mode={kind:"editing",noteId:n}}}const wn=264,ct=()=>{Gt(),customElements.get("dpk-template-event-storming")||customElements.define("dpk-template-event-storming",lt)},$n=Object.freeze(Object.defineProperty({__proto__:null,DpkTemplateEventStorming:lt,ES_IDLE:_,NOTE_TYPES:j,ZOOM_MAX:
|
|
1017
|
+
</div>`}#R(e){const n=A("new-event",W(e.state));if(!e.dispatch(y.addElement(n,"event",O(this.locale).noteTypeLabel("event"))).ok){this.mode=_;return}e.navigate({note:n}),this.mode={kind:"editing",noteId:n}}}const wn=264,ct=()=>{Gt(),customElements.get("dpk-template-event-storming")||customElements.define("dpk-template-event-storming",lt)},$n=Object.freeze(Object.defineProperty({__proto__:null,DpkTemplateEventStorming:lt,ES_IDLE:_,NOTE_TYPES:j,ZOOM_MAX:Fe,ZOOM_MIN:le,allNoteIds:W,applyEventStormingAction:Le,attachAnchor:Ne,buildSlices:R,connectionEndpoints:Oe,constrainViewport:Ge,defineEventStormingElement:ct,describeEventStormingAction:De,dropSide:Ue,emptyEventStormingBase:Ie,eventStormingAction:y,eventStormingActions:w,eventStormingBaseSchema:Te,eventStormingCommentTargets:Be,eventStormingDefinitionFor:He,eventStormingHasTarget:Ye,eventStormingMessages:O,eventStormingTargetLabel:Re,eventStormingTitle:ae,findContext:H,findLink:se,findNote:P,fitViewport:We,hitRect:pe,noteCardModeOf:Ze,panBy:Ke,parseEventStormingBase:Se,planSliceBands:Ce,rectsInBand:qe,reduceNoteIntent:Je,resolveEventStormingNavigation:Xe,sameSlice:J,serializeEventStormingAction:Pe,sliceArrows:_e,sliceMovePlan:he,sliceMoveSteps:Ve,sliceVoice:G,zoomAt:ce},Symbol.toStringTag,{value:"Module"}));export{ct as d,$n as i};
|
package/dist/components.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as a}from"./chunks/shared-
|
|
1
|
+
import{r as a}from"./chunks/shared-CQXKAPdi.js";import{D as e,a as s,b as n,c as t,d as o,e as r,f as i,g as p,h as m,i as c,j as d,k as D,l as f,m as l,n as g,o as C,p as S,q as A,s as E,t as M,u as k,v as u}from"./chunks/shared-CQXKAPdi.js";import{s as y}from"./chunks/shared-BQFDKhM1.js";import{C as h,a as T,D as I,b as v,c as K,E as N,F as O,M as b,T as R,W as P,d as q,e as F,f as G,g as j,h as w,i as _,j as B,k as H,l as V,m as W,n as x,o as z,p as L,q as U,r as Y,t as J,u as Q,v as X,w as Z,x as $,y as aa,z as ea,A as sa,B as na,G as ta,H as oa,I as ra,J as ia,K as pa,L as ma,N as ca,O as da,P as Da,Q as fa,R as la,S as ga,U as Ca,V as Sa,X as Aa,Y as Ea,Z as Ma}from"./chunks/shared-BQFDKhM1.js";y({entry:"components.js",templates:[],register:()=>{a()}});export{h as COMMENT_ACTION,T as COMMENT_DESCRIPTOR,e as DpkComponentArchitectureMap,I as DpkComponentCommentPanel,s as DpkComponentDependencyGraph,n as DpkComponentErDiagram,t as DpkComponentFormalSpec,v as DpkComponentInlineEdit,o as DpkComponentKanban,r as DpkComponentMindMap,i as DpkComponentSequenceDiagram,p as DpkComponentStateDiagram,K as DraftController,N as EMPTY_NAVIGATION,O as FRAMEWORK_VERSION,b as MemoryDraftStorage,R as TemplateElement,P as WebStorageDraftStorage,q as appendAction,F as assertNever,G as buildAgentBrief,j as commentActionSchema,w as commentBody,_ as commentTargetKey,B as controls,H as createActionId,V as createEntityId,W as dedupeKeyOf,x as defaultStorage,z as defaultStorageKey,L as defineAction,m as defineArchitectureMap,U as defineCommentPanel,c as defineDependencyGraph,d as defineErDiagram,D as defineFormalSpec,Y as defineInlineEdit,f as defineKanban,l as defineMindMap,g as defineSequenceDiagram,C as defineStateDiagram,J as derive,Q as draftActionEnvelopeSchema,X as entityDedupeKey,Z as formatHash,$ as iconArrowDown,aa as iconArrowUp,ea as iconClose,sa as iconComment,na as iconGrip,ta as iconLink,oa as iconMove,ra as iconPencil,ia as iconPlus,pa as iconTrash,ma as liveActions,S as parseFormalSpecData,ca as parseHash,A as parseKanbanData,E as parseMindMapData,M as parseSequenceData,k as parseStateData,da as parseTargetRef,Da as parseTemplateAction,fa as patchNavigation,la as payloadFor,a as registerComponentElements,u as registerDiagramElements,ga as serializeDraft,Ca as slugify,Sa as targetRef,Aa as targetSchema,Ea as toTarget,Ma as tokens};
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./chunks/shared-
|
|
1
|
+
import{r as e}from"./chunks/shared-CQXKAPdi.js";import{D as r,a as s,b as i,c as m,d as n,e as p,f as l,g as f,v as d}from"./chunks/shared-CQXKAPdi.js";import{s as g,_ as E,$ as D,F as t}from"./chunks/shared-BQFDKhM1.js";import{C as c,D as k,b as C,c as y,M as S,T as M,W as b,e as u,f as A,h as T,l as h,n as v,o as P,p as R,t as N,v as O,w as x,N as I,O as B,P as F,Q as K,R as W,U as _,V as w}from"./chunks/shared-BQFDKhM1.js";import{d as V}from"./chunks/shared-CDUEK_Mh.js";import{i as G}from"./chunks/shared-CDUEK_Mh.js";import{d as H}from"./chunks/shared-qb0tjbw2.js";import{i as U}from"./chunks/shared-qb0tjbw2.js";import{d as j}from"./chunks/shared-Ds5vLeFk.js";import{i as q}from"./chunks/shared-Ds5vLeFk.js";import{d as L}from"./chunks/shared-DkFF4haI.js";import{i as Q}from"./chunks/shared-DkFF4haI.js";import{d as $}from"./chunks/shared-CmNWTIOz.js";import{i as z}from"./chunks/shared-CmNWTIOz.js";import{d as J}from"./chunks/shared-Dmq-C6h3.js";import{i as X}from"./chunks/shared-Dmq-C6h3.js";import{d as Y}from"./chunks/shared-CNbKTeSv.js";import{i as Z}from"./chunks/shared-CNbKTeSv.js";import{d as ee}from"./chunks/shared-BdUyaZo-.js";import{i as ae}from"./chunks/shared-BdUyaZo-.js";import{d as te}from"./chunks/shared-FtbePk3S.js";import{i as oe}from"./chunks/shared-FtbePk3S.js";import{d as re}from"./chunks/shared-C2ytkQtn.js";import{i as se}from"./chunks/shared-C2ytkQtn.js";const a=()=>{J(),te(),H(),j(),L(),$(),Y(),ee(),V(),re()},o=["prototype","usm","event-storming","example-mapping","grill","plain","slides","task-board","delegation-poker","whiteboard"],ie=()=>{e(),a(),E(t,o,D)};g({entry:"index.js",templates:o,register:()=>{e(),a()}});export{c as COMMENT_ACTION,r as DpkComponentArchitectureMap,k as DpkComponentCommentPanel,s as DpkComponentDependencyGraph,i as DpkComponentErDiagram,m as DpkComponentFormalSpec,C as DpkComponentInlineEdit,n as DpkComponentKanban,p as DpkComponentMindMap,l as DpkComponentSequenceDiagram,f as DpkComponentStateDiagram,y as DraftController,t as FRAMEWORK_VERSION,S as MemoryDraftStorage,M as TemplateElement,b as WebStorageDraftStorage,u as assertNever,A as buildAgentBrief,T as commentBody,h as createEntityId,v as defaultStorage,P as defaultStorageKey,R as defineAction,G as delegationPoker,N as derive,O as entityDedupeKey,U as eventStorming,q as exampleMapping,x as formatHash,Q as grill,I as parseHash,B as parseTargetRef,F as parseTemplateAction,K as patchNavigation,W as payloadFor,z as plain,X as prototype,ie as registerAllElements,e as registerComponentElements,d as registerDiagramElements,a as registerTemplateElements,Z as slides,_ as slugify,w as targetRef,ae as taskBoard,oe as usm,se as whiteboard};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{s as a,q as e,r as s}from"../chunks/shared-BQFDKhM1.js";import{C as t,a as o,D as n,b as r,c as i,E as m,F as c,M as l,T as p,W as d,d as f,e as g,f as A,g as E,h as y,i as T,j as C,k as D,l as S,m as I,n as k,o as M,p as N,t as O,u as P,v as h,w as u,x as R,y as v,z as K,A as w,B as _,G as b,H as B,I as F,J as G,K as H,L as V,N as W,O as j,P as x,Q as z,R as L,S as U,U as Y,V as q,X as J,Y as Q,Z as X}from"../chunks/shared-BQFDKhM1.js";import{d as Z}from"../chunks/shared-CDUEK_Mh.js";import{i as $}from"../chunks/shared-CDUEK_Mh.js";a({entry:"templates/delegation-poker.js",templates:["delegation-poker"],register:()=>{e(),s(),Z()}});export{t as COMMENT_ACTION,o as COMMENT_DESCRIPTOR,n as DpkComponentCommentPanel,r as DpkComponentInlineEdit,i as DraftController,m as EMPTY_NAVIGATION,c as FRAMEWORK_VERSION,l as MemoryDraftStorage,p as TemplateElement,d as WebStorageDraftStorage,f as appendAction,g as assertNever,A as buildAgentBrief,E as commentActionSchema,y as commentBody,T as commentTargetKey,C as controls,D as createActionId,S as createEntityId,I as dedupeKeyOf,k as defaultStorage,M as defaultStorageKey,N as defineAction,$ as delegationPoker,O as derive,P as draftActionEnvelopeSchema,h as entityDedupeKey,u as formatHash,R as iconArrowDown,v as iconArrowUp,K as iconClose,w as iconComment,_ as iconGrip,b as iconLink,B as iconMove,F as iconPencil,G as iconPlus,H as iconTrash,V as liveActions,W as parseHash,j as parseTargetRef,x as parseTemplateAction,z as patchNavigation,L as payloadFor,U as serializeDraft,Y as slugify,q as targetRef,J as targetSchema,Q as toTarget,X as tokens};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{s as a,q as e,r as s}from"../chunks/shared-BQFDKhM1.js";import{C as t,a as o,D as n,b as r,c as i,E as m,F as c,M as p,T as l,W as f,d,e as g,f as A,g as E,h as y,i as S,j as T,k as C,l as v,m as D,n as I,o as M,p as N,t as O,u as h,v as u,w as R,x as P,y as K,z as k,A as w,B as _,G as b,H as B,I as F,J as G,K as H,L as V,N as W,O as j,P as x,Q as z,R as L,S as U,U as Y,V as q,X as J,Y as Q,Z as X}from"../chunks/shared-BQFDKhM1.js";import{d as Z}from"../chunks/shared-qb0tjbw2.js";import{i as $}from"../chunks/shared-qb0tjbw2.js";a({entry:"templates/event-storming.js",templates:["event-storming"],register:()=>{e(),s(),Z()}});export{t as COMMENT_ACTION,o as COMMENT_DESCRIPTOR,n as DpkComponentCommentPanel,r as DpkComponentInlineEdit,i as DraftController,m as EMPTY_NAVIGATION,c as FRAMEWORK_VERSION,p as MemoryDraftStorage,l as TemplateElement,f as WebStorageDraftStorage,d as appendAction,g as assertNever,A as buildAgentBrief,E as commentActionSchema,y as commentBody,S as commentTargetKey,T as controls,C as createActionId,v as createEntityId,D as dedupeKeyOf,I as defaultStorage,M as defaultStorageKey,N as defineAction,O as derive,h as draftActionEnvelopeSchema,u as entityDedupeKey,$ as eventStorming,R as formatHash,P as iconArrowDown,K as iconArrowUp,k as iconClose,w as iconComment,_ as iconGrip,b as iconLink,B as iconMove,F as iconPencil,G as iconPlus,H as iconTrash,V as liveActions,W as parseHash,j as parseTargetRef,x as parseTemplateAction,z as patchNavigation,L as payloadFor,U as serializeDraft,Y as slugify,q as targetRef,J as targetSchema,Q as toTarget,X as tokens};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{s as a,q as e,r as s}from"../chunks/shared-BQFDKhM1.js";import{C as t,a as o,D as n,b as r,c as i,E as m,F as p,M as c,T as l,W as f,d,e as g,f as A,g as E,h as y,i as T,j as C,k as M,l as S,m as D,n as I,o as N,p as O,t as h,u,v as R,w as v,x as P,y as x,z as K,A as k,B as w,G as _,H as b,I as B,J as F,K as G,L as H,N as V,O as W,P as j,Q as z,R as L,S as U,U as Y,V as q,X as J,Y as Q,Z as X}from"../chunks/shared-BQFDKhM1.js";import{d as Z}from"../chunks/shared-Ds5vLeFk.js";import{i as $}from"../chunks/shared-Ds5vLeFk.js";a({entry:"templates/example-mapping.js",templates:["example-mapping"],register:()=>{e(),s(),Z()}});export{t as COMMENT_ACTION,o as COMMENT_DESCRIPTOR,n as DpkComponentCommentPanel,r as DpkComponentInlineEdit,i as DraftController,m as EMPTY_NAVIGATION,p as FRAMEWORK_VERSION,c as MemoryDraftStorage,l as TemplateElement,f as WebStorageDraftStorage,d as appendAction,g as assertNever,A as buildAgentBrief,E as commentActionSchema,y as commentBody,T as commentTargetKey,C as controls,M as createActionId,S as createEntityId,D as dedupeKeyOf,I as defaultStorage,N as defaultStorageKey,O as defineAction,h as derive,u as draftActionEnvelopeSchema,R as entityDedupeKey,$ as exampleMapping,v as formatHash,P as iconArrowDown,x as iconArrowUp,K as iconClose,k as iconComment,w as iconGrip,_ as iconLink,b as iconMove,B as iconPencil,F as iconPlus,G as iconTrash,H as liveActions,V as parseHash,W as parseTargetRef,j as parseTemplateAction,z as patchNavigation,L as payloadFor,U as serializeDraft,Y as slugify,q as targetRef,J as targetSchema,Q as toTarget,X as tokens};
|
package/dist/templates/grill.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{s as a,q as e,r as s}from"../chunks/shared-BQFDKhM1.js";import{C as t,a as o,D as r,b as n,c as i,E as m,F as l,M as c,T as p,W as f,d,e as g,f as A,g as E,h as y,i as T,j as C,k as S,l as D,m as I,n as M,o as N,p as O,t as h,u,v as R,w as v,x as P,y as K,z as k,A as w,B as G,G as _,H as b,I as B,J as F,K as H,L as V,N as W,O as j,P as x,Q as z,R as L,S as U,U as Y,V as q,X as J,Y as Q,Z as X}from"../chunks/shared-BQFDKhM1.js";import{d as Z}from"../chunks/shared-DkFF4haI.js";import{i as $}from"../chunks/shared-DkFF4haI.js";a({entry:"templates/grill.js",templates:["grill"],register:()=>{e(),s(),Z()}});export{t as COMMENT_ACTION,o as COMMENT_DESCRIPTOR,r as DpkComponentCommentPanel,n as DpkComponentInlineEdit,i as DraftController,m as EMPTY_NAVIGATION,l as FRAMEWORK_VERSION,c as MemoryDraftStorage,p as TemplateElement,f as WebStorageDraftStorage,d as appendAction,g as assertNever,A as buildAgentBrief,E as commentActionSchema,y as commentBody,T as commentTargetKey,C as controls,S as createActionId,D as createEntityId,I as dedupeKeyOf,M as defaultStorage,N as defaultStorageKey,O as defineAction,h as derive,u as draftActionEnvelopeSchema,R as entityDedupeKey,v as formatHash,$ as grill,P as iconArrowDown,K as iconArrowUp,k as iconClose,w as iconComment,G as iconGrip,_ as iconLink,b as iconMove,B as iconPencil,F as iconPlus,H as iconTrash,V as liveActions,W as parseHash,j as parseTargetRef,x as parseTemplateAction,z as patchNavigation,L as payloadFor,U as serializeDraft,Y as slugify,q as targetRef,J as targetSchema,Q as toTarget,X as tokens};
|
package/dist/templates/plain.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{s as a,q as e,r as s}from"../chunks/shared-BQFDKhM1.js";import{C as t,a as o,D as n,b as r,c as i,E as m,F as c,M as l,T as p,W as f,d,e as g,f as A,g as E,h as y,i as T,j as C,k as S,l as D,m as I,n as M,o as N,p as O,t as h,u,v as P,w as R,x as v,y as K,z as k,A as w,B as _,G as b,H as B,I as F,J as G,K as H,L as V,N as W,O as j,P as x,Q as z,R as L,S as U,U as Y,V as q,X as J,Y as Q,Z as X}from"../chunks/shared-BQFDKhM1.js";import{d as Z}from"../chunks/shared-CmNWTIOz.js";import{i as $}from"../chunks/shared-CmNWTIOz.js";a({entry:"templates/plain.js",templates:["plain"],register:()=>{e(),s(),Z()}});export{t as COMMENT_ACTION,o as COMMENT_DESCRIPTOR,n as DpkComponentCommentPanel,r as DpkComponentInlineEdit,i as DraftController,m as EMPTY_NAVIGATION,c as FRAMEWORK_VERSION,l as MemoryDraftStorage,p as TemplateElement,f as WebStorageDraftStorage,d as appendAction,g as assertNever,A as buildAgentBrief,E as commentActionSchema,y as commentBody,T as commentTargetKey,C as controls,S as createActionId,D as createEntityId,I as dedupeKeyOf,M as defaultStorage,N as defaultStorageKey,O as defineAction,h as derive,u as draftActionEnvelopeSchema,P as entityDedupeKey,R as formatHash,v as iconArrowDown,K as iconArrowUp,k as iconClose,w as iconComment,_ as iconGrip,b as iconLink,B as iconMove,F as iconPencil,G as iconPlus,H as iconTrash,V as liveActions,W as parseHash,j as parseTargetRef,x as parseTemplateAction,z as patchNavigation,L as payloadFor,$ as plain,U as serializeDraft,Y as slugify,q as targetRef,J as targetSchema,Q as toTarget,X as tokens};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{s as a,q as e,r as t}from"../chunks/shared-BQFDKhM1.js";import{C as s,a as o,D as r,b as n,c as i,E as m,F as p,M as c,T as l,W as f,d,e as y,f as g,g as A,h as E,i as T,j as C,k as S,l as D,m as I,n as M,o as N,p as O,t as h,u,v as P,w as R,x as v,y as K,z as k,A as w,B as _,G as b,H as B,I as F,J as G,K as H,L as V,N as W,O as j,P as x,Q as z,R as L,S as U,U as Y,V as q,X as J,Y as Q,Z as X}from"../chunks/shared-BQFDKhM1.js";import{d as Z}from"../chunks/shared-Dmq-C6h3.js";import{i as $}from"../chunks/shared-Dmq-C6h3.js";a({entry:"templates/prototype.js",templates:["prototype"],register:()=>{e(),t(),Z()}});export{s as COMMENT_ACTION,o as COMMENT_DESCRIPTOR,r as DpkComponentCommentPanel,n as DpkComponentInlineEdit,i as DraftController,m as EMPTY_NAVIGATION,p as FRAMEWORK_VERSION,c as MemoryDraftStorage,l as TemplateElement,f as WebStorageDraftStorage,d as appendAction,y as assertNever,g as buildAgentBrief,A as commentActionSchema,E as commentBody,T as commentTargetKey,C as controls,S as createActionId,D as createEntityId,I as dedupeKeyOf,M as defaultStorage,N as defaultStorageKey,O as defineAction,h as derive,u as draftActionEnvelopeSchema,P as entityDedupeKey,R as formatHash,v as iconArrowDown,K as iconArrowUp,k as iconClose,w as iconComment,_ as iconGrip,b as iconLink,B as iconMove,F as iconPencil,G as iconPlus,H as iconTrash,V as liveActions,W as parseHash,j as parseTargetRef,x as parseTemplateAction,z as patchNavigation,L as payloadFor,$ as prototype,U as serializeDraft,Y as slugify,q as targetRef,J as targetSchema,Q as toTarget,X as tokens};
|
package/dist/templates/slides.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{s as a,q as e,r as s}from"../chunks/shared-BQFDKhM1.js";import{C as t,a as o,D as n,b as r,c as i,E as m,F as c,M as l,T as p,W as d,d as f,e as g,f as A,g as E,h as y,i as T,j as C,k as S,l as D,m as I,n as M,o as N,p as O,t as h,u,v as R,w as v,x as P,y as K,z as k,A as w,B as _,G as b,H as B,I as F,J as G,K as H,L as V,N as W,O as j,P as x,Q as z,R as L,S as U,U as Y,V as q,X as J,Y as Q,Z as X}from"../chunks/shared-BQFDKhM1.js";import{d as Z}from"../chunks/shared-CNbKTeSv.js";import{i as $}from"../chunks/shared-CNbKTeSv.js";a({entry:"templates/slides.js",templates:["slides"],register:()=>{e(),s(),Z()}});export{t as COMMENT_ACTION,o as COMMENT_DESCRIPTOR,n as DpkComponentCommentPanel,r as DpkComponentInlineEdit,i as DraftController,m as EMPTY_NAVIGATION,c as FRAMEWORK_VERSION,l as MemoryDraftStorage,p as TemplateElement,d as WebStorageDraftStorage,f as appendAction,g as assertNever,A as buildAgentBrief,E as commentActionSchema,y as commentBody,T as commentTargetKey,C as controls,S as createActionId,D as createEntityId,I as dedupeKeyOf,M as defaultStorage,N as defaultStorageKey,O as defineAction,h as derive,u as draftActionEnvelopeSchema,R as entityDedupeKey,v as formatHash,P as iconArrowDown,K as iconArrowUp,k as iconClose,w as iconComment,_ as iconGrip,b as iconLink,B as iconMove,F as iconPencil,G as iconPlus,H as iconTrash,V as liveActions,W as parseHash,j as parseTargetRef,x as parseTemplateAction,z as patchNavigation,L as payloadFor,U as serializeDraft,$ as slides,Y as slugify,q as targetRef,J as targetSchema,Q as toTarget,X as tokens};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{s as a,q as e,r as s}from"../chunks/shared-BQFDKhM1.js";import{C as t,a as o,D as r,b as n,c as i,E as m,F as c,M as p,T as d,W as l,d as f,e as g,f as A,g as E,h as T,i as y,j as C,k as S,l as D,m as I,n as k,o as M,p as N,t as O,u as h,v as u,w as R,x as v,y as P,z as K,A as b,B,G as w,H as _,I as F,J as G,K as H,L as V,N as W,O as j,P as x,Q as z,R as L,S as U,U as Y,V as q,X as J,Y as Q,Z as X}from"../chunks/shared-BQFDKhM1.js";import{d as Z}from"../chunks/shared-BdUyaZo-.js";import{i as $}from"../chunks/shared-BdUyaZo-.js";a({entry:"templates/task-board.js",templates:["task-board"],register:()=>{e(),s(),Z()}});export{t as COMMENT_ACTION,o as COMMENT_DESCRIPTOR,r as DpkComponentCommentPanel,n as DpkComponentInlineEdit,i as DraftController,m as EMPTY_NAVIGATION,c as FRAMEWORK_VERSION,p as MemoryDraftStorage,d as TemplateElement,l as WebStorageDraftStorage,f as appendAction,g as assertNever,A as buildAgentBrief,E as commentActionSchema,T as commentBody,y as commentTargetKey,C as controls,S as createActionId,D as createEntityId,I as dedupeKeyOf,k as defaultStorage,M as defaultStorageKey,N as defineAction,O as derive,h as draftActionEnvelopeSchema,u as entityDedupeKey,R as formatHash,v as iconArrowDown,P as iconArrowUp,K as iconClose,b as iconComment,B as iconGrip,w as iconLink,_ as iconMove,F as iconPencil,G as iconPlus,H as iconTrash,V as liveActions,W as parseHash,j as parseTargetRef,x as parseTemplateAction,z as patchNavigation,L as payloadFor,U as serializeDraft,Y as slugify,q as targetRef,J as targetSchema,$ as taskBoard,Q as toTarget,X as tokens};
|
package/dist/templates/usm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{s as a,q as e,r as s}from"../chunks/shared-BQFDKhM1.js";import{C as t,a as o,D as n,b as r,c as i,E as m,F as c,M as p,T as l,W as f,d,e as g,f as A,g as E,h as y,i as T,j as C,k as u,l as S,m as D,n as I,o as M,p as N,t as O,u as h,v as R,w as v,x as P,y as K,z as k,A as w,B as _,G as b,H as B,I as F,J as G,K as H,L as U,N as V,O as W,P as j,Q as x,R as z,S as L,U as Y,V as q,X as J,Y as Q,Z as X}from"../chunks/shared-BQFDKhM1.js";import{d as Z}from"../chunks/shared-FtbePk3S.js";import{i as $}from"../chunks/shared-FtbePk3S.js";a({entry:"templates/usm.js",templates:["usm"],register:()=>{e(),s(),Z()}});export{t as COMMENT_ACTION,o as COMMENT_DESCRIPTOR,n as DpkComponentCommentPanel,r as DpkComponentInlineEdit,i as DraftController,m as EMPTY_NAVIGATION,c as FRAMEWORK_VERSION,p as MemoryDraftStorage,l as TemplateElement,f as WebStorageDraftStorage,d as appendAction,g as assertNever,A as buildAgentBrief,E as commentActionSchema,y as commentBody,T as commentTargetKey,C as controls,u as createActionId,S as createEntityId,D as dedupeKeyOf,I as defaultStorage,M as defaultStorageKey,N as defineAction,O as derive,h as draftActionEnvelopeSchema,R as entityDedupeKey,v as formatHash,P as iconArrowDown,K as iconArrowUp,k as iconClose,w as iconComment,_ as iconGrip,b as iconLink,B as iconMove,F as iconPencil,G as iconPlus,H as iconTrash,U as liveActions,V as parseHash,W as parseTargetRef,j as parseTemplateAction,x as patchNavigation,z as payloadFor,L as serializeDraft,Y as slugify,q as targetRef,J as targetSchema,Q as toTarget,X as tokens,$ as usm};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{s as a,q as e,r as s}from"../chunks/shared-BQFDKhM1.js";import{C as t,a as o,D as r,b as n,c as i,E as m,F as c,M as p,T as d,W as l,d as f,e as g,f as A,g as E,h as y,i as T,j as h,k as C,l as S,m as D,n as I,o as M,p as N,t as O,u,v as R,w as b,x as v,y as w,z as P,A as K,B as k,G as W,H as _,I as B,J as F,K as G,L as H,N as V,O as j,P as x,Q as z,R as L,S as U,U as Y,V as q,X as J,Y as Q,Z as X}from"../chunks/shared-BQFDKhM1.js";import{d as Z}from"../chunks/shared-C2ytkQtn.js";import{i as $}from"../chunks/shared-C2ytkQtn.js";a({entry:"templates/whiteboard.js",templates:["whiteboard"],register:()=>{e(),s(),Z()}});export{t as COMMENT_ACTION,o as COMMENT_DESCRIPTOR,r as DpkComponentCommentPanel,n as DpkComponentInlineEdit,i as DraftController,m as EMPTY_NAVIGATION,c as FRAMEWORK_VERSION,p as MemoryDraftStorage,d as TemplateElement,l as WebStorageDraftStorage,f as appendAction,g as assertNever,A as buildAgentBrief,E as commentActionSchema,y as commentBody,T as commentTargetKey,h as controls,C as createActionId,S as createEntityId,D as dedupeKeyOf,I as defaultStorage,M as defaultStorageKey,N as defineAction,O as derive,u as draftActionEnvelopeSchema,R as entityDedupeKey,b as formatHash,v as iconArrowDown,w as iconArrowUp,P as iconClose,K as iconComment,k as iconGrip,W as iconLink,_ as iconMove,B as iconPencil,F as iconPlus,G as iconTrash,H as liveActions,V as parseHash,j as parseTargetRef,x as parseTemplateAction,z as patchNavigation,L as payloadFor,U as serializeDraft,Y as slugify,q as targetRef,J as targetSchema,Q as toTarget,X as tokens,$ as whiteboard};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dev-process-kit",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.10",
|
|
4
4
|
"description": "Web Components for single-file HTML pages that a human reviews in the browser, with a structured draft/feedback loop back to an agent.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agent",
|
|
@@ -34,7 +34,8 @@
|
|
|
34
34
|
"./templates/plain": "./dist/templates/plain.js",
|
|
35
35
|
"./templates/slides": "./dist/templates/slides.js",
|
|
36
36
|
"./templates/task-board": "./dist/templates/task-board.js",
|
|
37
|
-
"./templates/delegation-poker": "./dist/templates/delegation-poker.js"
|
|
37
|
+
"./templates/delegation-poker": "./dist/templates/delegation-poker.js",
|
|
38
|
+
"./templates/whiteboard": "./dist/templates/whiteboard.js"
|
|
38
39
|
},
|
|
39
40
|
"engines": {
|
|
40
41
|
"node": ">=24"
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import{_ as Wt,a1 as lt,a2 as K}from"./shared-BYZoeQ97.js";const I=Math.min,S=Math.max,Q=Math.round,Z=Math.floor,$=t=>({x:t,y:t}),Nt={left:"right",right:"left",bottom:"top",top:"bottom"};function Vt(t,e,n){return S(t,I(e,n))}function U(t,e){return typeof t=="function"?t(e):t}function _(t){return t.split("-")[0]}function Y(t){return t.split("-")[1]}function xt(t){return t==="x"?"y":"x"}function bt(t){return t==="y"?"height":"width"}function k(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function vt(t){return xt(k(t))}function _t(t,e,n){n===void 0&&(n=!1);const o=Y(t),i=vt(t),s=bt(i);let r=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(r=tt(r)),[r,tt(r)]}function Ht(t){const e=tt(t);return[at(t),e,at(e)]}function at(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const Rt=["left","right"],Ct=["right","left"],Bt=["top","bottom"],zt=["bottom","top"];function It(t,e,n){switch(t){case"top":case"bottom":return n?e?Ct:Rt:e?Rt:Ct;case"left":case"right":return e?Bt:zt;default:return[]}}function Xt(t,e,n,o){const i=Y(t);let s=It(_(t),n==="start",o);return i&&(s=s.map(r=>r+"-"+i),e&&(s=s.concat(s.map(at)))),s}function tt(t){const e=_(t);return Nt[e]+t.slice(e.length)}function jt(t){var e,n,o,i;return{top:(e=t.top)!=null?e:0,right:(n=t.right)!=null?n:0,bottom:(o=t.bottom)!=null?o:0,left:(i=t.left)!=null?i:0}}function qt(t){return typeof t!="number"?jt(t):{top:t,right:t,bottom:t,left:t}}function et(t){const{x:e,y:n,width:o,height:i}=t;return{width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function At(t,e,n){let{reference:o,floating:i}=t;const s=k(e),r=vt(e),c=bt(r),l=_(e),a=s==="y",f=o.x+o.width/2-i.width/2,u=o.y+o.height/2-i.height/2,m=o[c]/2-i[c]/2;let d;switch(l){case"top":d={x:f,y:o.y-i.height};break;case"bottom":d={x:f,y:o.y+o.height};break;case"right":d={x:o.x+o.width,y:u};break;case"left":d={x:o.x-i.width,y:u};break;default:d={x:o.x,y:o.y}}const h=Y(e);return h&&(d[r]+=m*(h==="end"?1:-1)*(n&&a?-1:1)),d}async function Kt(t,e){var n;e===void 0&&(e={});const{x:o,y:i,platform:s,rects:r,elements:c,strategy:l}=t,{boundary:a="clippingAncestors",rootBoundary:f="viewport",elementContext:u="floating",altBoundary:m=!1,padding:d=0}=U(e,t),h=qt(d),w=c[m?u==="floating"?"reference":"floating":u],p=et(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(w)))==null||n?w:w.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:a,rootBoundary:f,strategy:l})),y=u==="floating"?{x:o,y:i,width:r.floating.width,height:r.floating.height}:r.reference,x=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),b=await(s.isElement==null?void 0:s.isElement(x))&&await(s.getScale==null?void 0:s.getScale(x))||{x:1,y:1},C=et(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:y,offsetParent:x,strategy:l}):y);return{top:(p.top-C.top+h.top)/b.y,bottom:(C.bottom-p.bottom+h.bottom)/b.y,left:(p.left-C.left+h.left)/b.x,right:(C.right-p.right+h.right)/b.x}}const Ut=50,Yt=async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:s=[],platform:r}=n,c=r.detectOverflow?r:{...r,detectOverflow:Kt},l=await(r.isRTL==null?void 0:r.isRTL(e));let a=await r.getElementRects({reference:t,floating:e,strategy:i}),{x:f,y:u}=At(a,o,l),m=o,d=0;const h={};for(let g=0;g<s.length;g++){const w=s[g];if(!w)continue;const{name:p,fn:y}=w,{x,y:b,data:C,reset:v}=await y({x:f,y:u,initialPlacement:o,placement:m,strategy:i,middlewareData:h,rects:a,platform:c,elements:{reference:t,floating:e}});f=x??f,u=b??u,h[p]={...h[p],...C},v&&d<Ut&&(d++,typeof v=="object"&&(v.placement&&(m=v.placement),v.rects&&(a=v.rects===!0?await r.getElementRects({reference:t,floating:e,strategy:i}):v.rects),{x:f,y:u}=At(a,m,l)),g=-1)}return{x:f,y:u,placement:m,strategy:i,middlewareData:h}},Gt=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:s,rects:r,initialPlacement:c,platform:l,elements:a}=e,{mainAxis:f=!0,crossAxis:u=!0,fallbackPlacements:m,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:g=!0,...w}=U(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const p=_(i),y=k(c),x=_(c)===c,b=await(l.isRTL==null?void 0:l.isRTL(a.floating)),C=m||(x||!g?[tt(c)]:Ht(c)),v=h!=="none";!m&&v&&C.push(...Xt(c,g,h,b));const P=[c,...C],T=await l.detectOverflow(e,w),W=[];let O=((o=s.flip)==null?void 0:o.overflows)||[];if(f&&W.push(T[p]),u){const N=_t(i,r,b);W.push(T[N[0]],T[N[1]])}if(O=[...O,{placement:i,overflows:W}],!W.every(N=>N<=0)){var gt,wt;const N=(((gt=s.flip)==null?void 0:gt.index)||0)+1,ct=P[N];if(ct&&(!(u==="alignment"?y!==k(ct):!1)||O.every(A=>k(A.placement)===y?A.overflows[0]>0:!0)))return{data:{index:N,overflows:O},reset:{placement:ct}};let q=(wt=O.filter(V=>V.overflows[0]<=0).sort((V,A)=>V.overflows[1]-A.overflows[1])[0])==null?void 0:wt.placement;if(!q)switch(d){case"bestFit":{var yt;const V=(yt=O.filter(A=>{if(v){const M=k(A.placement);return M===y||M==="y"}return!0}).map(A=>[A.placement,A.overflows.filter(M=>M>0).reduce((M,Ft)=>M+Ft,0)]).sort((A,M)=>A[1]-M[1])[0])==null?void 0:yt[0];V&&(q=V);break}case"initialPlacement":q=c;break}if(i!==q)return{reset:{placement:q}}}return{}}}},Jt=new Set(["left","top"]);async function Qt(t,e){const{placement:n,platform:o,elements:i}=t,s=await(o.isRTL==null?void 0:o.isRTL(i.floating)),r=_(n),c=Y(n),l=k(n)==="y",a=Jt.has(r)?-1:1,f=s&&l?-1:1,u=U(e,t);let{mainAxis:m,crossAxis:d,alignmentAxis:h}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return c&&typeof h=="number"&&(d=c==="end"?h*-1:h),l?{x:d*f,y:m*a}:{x:m*a,y:d*f}}const Zt=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:i,y:s,placement:r,middlewareData:c}=e,l=await Qt(e,t);return r===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:i+l.x,y:s+l.y,data:{...l,placement:r}}}}},te=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:i,platform:s}=e,{mainAxis:r=!0,crossAxis:c=!1,limiter:l={fn:y=>{let{x,y:b}=y;return{x,y:b}}},...a}=U(t,e),f={x:n,y:o},u=await s.detectOverflow(e,a),m=k(i),d=xt(m);let h=f[d],g=f[m];const w=(y,x)=>Vt(x+u[y==="y"?"top":"left"],x,x-u[y==="y"?"bottom":"right"]);r&&(h=w(d,h)),c&&(g=w(m,g));const p=l.fn({...e,[d]:h,[m]:g});return{...p,data:{x:p.x-n,y:p.y-o,enabled:{[d]:r,[m]:c}}}}}},ee=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:o,platform:i,elements:s}=e,{apply:r=()=>{},...c}=U(t,e),l=await i.detectOverflow(e,c),a=_(n),f=Y(n),u=k(n)==="y",{width:m,height:d}=o.floating;let h,g;a==="top"||a==="bottom"?(h=a,g=f===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(g=a,h=f==="end"?"top":"bottom");const w=d-l.top-l.bottom,p=m-l.left-l.right,y=I(d-l[h],w),x=I(m-l[g],p),b=e.middlewareData.shift,C=!b;let v=y,P=x;b!=null&&b.enabled.x&&(P=p),b!=null&&b.enabled.y&&(v=w),C&&!f&&(u?P=m-2*S(l.left,l.right):v=d-2*S(l.top,l.bottom)),await r({...e,availableWidth:P,availableHeight:v});const T=await i.getDimensions(s.floating);return m!==T.width||d!==T.height?{reset:{rects:!0}}:{}}}};function nt(){return typeof window<"u"}function X(t){return Ot(t)?(t.nodeName||"").toLowerCase():"#document"}function R(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function D(t){var e;return(e=(Ot(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Ot(t){return nt()?t instanceof Node||t instanceof R(t).Node:!1}function L(t){return nt()?t instanceof Element||t instanceof R(t).Element:!1}function F(t){return nt()?t instanceof HTMLElement||t instanceof R(t).HTMLElement:!1}function Lt(t){return!nt()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof R(t).ShadowRoot}function ot(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=E(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&i!=="inline"&&i!=="contents"}function ne(t){return/^(table|td|th)$/.test(X(t))}function it(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const oe=/transform|translate|scale|rotate|perspective|filter/,ie=/paint|layout|strict|content/,H=t=>!!t&&t!=="none";let ft;function ut(t){const e=L(t)?E(t):t;return H(e.transform)||H(e.translate)||H(e.scale)||H(e.rotate)||H(e.perspective)||!dt()&&(H(e.backdropFilter)||H(e.filter))||oe.test(e.willChange||"")||ie.test(e.contain||"")}function se(t){let e=B(t);for(;F(e)&&!G(e);){if(ut(e))return e;if(it(e))return null;e=B(e)}return null}function dt(){return ft==null&&(ft=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),ft}function G(t){return/^(html|body|#document)$/.test(X(t))}function E(t){return R(t).getComputedStyle(t)}function st(t){return L(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function B(t){if(X(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Lt(t)&&t.host||D(t);return Lt(e)?e.host:e}function Et(t){const e=B(t);return G(e)?(t.ownerDocument||t).body:F(e)&&ot(e)?e:Et(e)}function J(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=Et(t),s=i===((o=t.ownerDocument)==null?void 0:o.body),r=R(i);if(s){const c=mt(r);return e.concat(r,r.visualViewport||[],ot(i)?i:[],c&&n?J(c):[])}else return e.concat(i,J(i,[],n))}function mt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Tt(t){const e=E(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=F(t),s=i?t.offsetWidth:n,r=i?t.offsetHeight:o,c=Q(n)!==s||Q(o)!==r;return c&&(n=s,o=r),{width:n,height:o,$:c}}function ht(t){return L(t)?t:t.contextElement}function j(t){const e=ht(t);if(!F(e))return $(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:s}=Tt(e);let r=(s?Q(n.width):n.width)/o,c=(s?Q(n.height):n.height)/i;return(!r||!Number.isFinite(r))&&(r=1),(!c||!Number.isFinite(c))&&(c=1),{x:r,y:c}}const re=$(0);function St(t){const e=R(t);return!dt()||!e.visualViewport?re:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function ce(t,e,n){return e===void 0&&(e=!1),!!n&&e&&n===R(t)}function z(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),s=ht(t);let r=$(1);e&&(o?L(o)&&(r=j(o)):r=j(t));const c=ce(s,n,o)?St(s):$(0);let l=(i.left+c.x)/r.x,a=(i.top+c.y)/r.y,f=i.width/r.x,u=i.height/r.y;if(s&&o){const m=R(s),d=L(o)?R(o):o;let h=m,g=mt(h);for(;g&&d!==h;){const w=j(g),p=g.getBoundingClientRect(),y=E(g),x=p.left+(g.clientLeft+parseFloat(y.paddingLeft))*w.x,b=p.top+(g.clientTop+parseFloat(y.paddingTop))*w.y;l*=w.x,a*=w.y,f*=w.x,u*=w.y,l+=x,a+=b,h=R(g),g=mt(h)}}return et({width:f,height:u,x:l,y:a})}function rt(t,e){const n=st(t).scrollLeft;return e?e.left+n:z(D(t)).left+n}function $t(t,e){const n=t.getBoundingClientRect(),o=n.left+e.scrollLeft-rt(t,n),i=n.top+e.scrollTop;return{x:o,y:i}}function le(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const s=i==="fixed",r=D(o),c=e?it(e.floating):!1;if(o===r||c&&s)return n;let l={scrollLeft:0,scrollTop:0},a=$(1);const f=$(0),u=F(o);if((u||!s)&&((X(o)!=="body"||ot(r))&&(l=st(o)),u)){const d=z(o);a=j(o),f.x=d.x+o.clientLeft,f.y=d.y+o.clientTop}const m=r&&!u&&!s?$t(r,l):$(0);return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-l.scrollLeft*a.x+f.x+m.x,y:n.y*a.y-l.scrollTop*a.y+f.y+m.y}}function ae(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function fe(t){const e=st(t),n=t.ownerDocument.body,o=S(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=S(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let s=-e.scrollLeft+rt(t);const r=-e.scrollTop;return E(n).direction==="rtl"&&(s+=S(t.clientWidth,n.clientWidth)-o),{width:o,height:i,x:s,y:r}}const ue=25;function de(t,e,n){n===void 0&&(n="viewport");const o=n==="layoutViewport",i=R(t),s=D(t),r=i.visualViewport;let c=s.clientWidth,l=s.clientHeight,a=0,f=0;if(r){const m=!dt()||e==="fixed";o?m||(a=-r.offsetLeft,f=-r.offsetTop):(c=r.width,l=r.height,m&&(a=r.offsetLeft,f=r.offsetTop))}if(rt(s)<=0){const m=s.ownerDocument,d=m.body,h=getComputedStyle(d),g=m.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,w=Math.abs(s.clientWidth-d.clientWidth-g),p=getComputedStyle(s).scrollbarGutter==="stable both-edges"?w/2:w;p<=ue&&(c-=p)}return{width:c,height:l,x:a,y:f}}function me(t,e){const n=z(t,!0,e==="fixed"),o=n.top+t.clientTop,i=n.left+t.clientLeft,s=j(t),r=t.clientWidth*s.x,c=t.clientHeight*s.y,l=i*s.x,a=o*s.y;return{width:r,height:c,x:l,y:a}}function kt(t,e,n){let o;if(e==="viewport"||e==="layoutViewport")o=de(t,n,e);else if(e==="document")o=fe(D(t));else if(L(e))o=me(e,n);else{const i=St(t);o={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return et(o)}function he(t,e){const n=e.get(t);if(n)return n;let o=J(t,[],!1).filter(c=>L(c)&&X(c)!=="body"),i=null;const s=E(t).position==="fixed";let r=s?B(t):t;for(;L(r)&&!G(r);){const c=E(r),l=ut(r),a=i?i.position:s?"fixed":"";!l&&(a==="fixed"||a==="absolute"&&c.position==="static")?o=o.filter(u=>u!==r):i=c,r=B(r)}return e.set(t,o),o}function pe(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const r=[...n==="clippingAncestors"?it(e)?[]:he(e,this._c):[].concat(n),o],c=kt(e,r[0],i);let l=c.top,a=c.right,f=c.bottom,u=c.left;for(let m=1;m<r.length;m++){const d=kt(e,r[m],i);l=S(d.top,l),a=I(d.right,a),f=I(d.bottom,f),u=S(d.left,u)}return{width:a-u,height:f-l,x:u,y:l}}function ge(t){const{width:e,height:n}=Tt(t);return{width:e,height:n}}function we(t,e,n){const o=F(e),i=D(e),s=n==="fixed",r=z(t,!0,s,e);let c={scrollLeft:0,scrollTop:0};const l=$(0);if((o||!s)&&((X(e)!=="body"||ot(i))&&(c=st(e)),o)){const m=z(e,!0,s,e);l.x=m.x+e.clientLeft,l.y=m.y+e.clientTop}!o&&i&&(l.x=rt(i));const a=i&&!o&&!s?$t(i,c):$(0),f=r.left+c.scrollLeft-l.x-a.x,u=r.top+c.scrollTop-l.y-a.y;return{x:f,y:u,width:r.width,height:r.height}}function pt(t){return E(t).position==="static"}function Dt(t,e){if(!F(t)||E(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return D(t)===n&&(n=n.ownerDocument.body),n}function Pt(t,e){const n=R(t);if(it(t))return n;if(!F(t)){let i=B(t);for(;i&&!G(i);){if(L(i)&&!pt(i))return i;i=B(i)}return n}let o=Dt(t,e);for(;o&&ne(o)&&pt(o);)o=Dt(o,e);return o&&G(o)&&pt(o)&&!ut(o)?n:o||se(t)||n}const ye=async function(t){const e=this.getOffsetParent||Pt,n=this.getDimensions,o=await n(t.floating);return{reference:we(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function xe(t){return E(t).direction==="rtl"}const be={convertOffsetParentRelativeRectToViewportRelativeRect:le,getDocumentElement:D,getClippingRect:pe,getOffsetParent:Pt,getElementRects:ye,getClientRects:ae,getDimensions:ge,getScale:j,isElement:L,isRTL:xe};function Mt(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function ve(t,e,n){let o=null,i;const s=D(t);function r(){var f;clearTimeout(i),(f=o)==null||f.disconnect(),o=null}function c(f,u){f===void 0&&(f=!1),u===void 0&&(u=1),r();const m=t.getBoundingClientRect(),{left:d,top:h,width:g,height:w}=m;if(f||e(),!g||!w)return;const p=Z(h),y=Z(s.clientWidth-(d+g)),x=Z(s.clientHeight-(h+w)),b=Z(d),v={rootMargin:-p+"px "+-y+"px "+-x+"px "+-b+"px",threshold:S(0,I(1,u))||1};let P=!0;function T(W){const O=W[0].intersectionRatio;if(!Mt(m,t.getBoundingClientRect()))return c();if(O!==u){if(!P)return c();O?c(!1,O):i=setTimeout(()=>{c(!1,1e-7)},1e3)}P=!1}try{o=new IntersectionObserver(T,{...v,root:s.ownerDocument})}catch{o=new IntersectionObserver(T,v)}o.observe(t)}const l=R(t),a=()=>c(n);return l.addEventListener("resize",a),c(!0),()=>{l.removeEventListener("resize",a),r()}}function Re(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,a=ht(t),f=i||s?[...a?J(a):[],...e?J(e):[]]:[];f.forEach(p=>{i&&p.addEventListener("scroll",n),s&&p.addEventListener("resize",n)});const u=a&&c?ve(a,n,s):null;let m=-1,d=null;r&&(d=new ResizeObserver(p=>{let[y]=p;y&&y.target===a&&d&&e&&(d.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var x;(x=d)==null||x.observe(e)})),n()}),a&&!l&&d.observe(a),e&&d.observe(e));let h,g=l?z(t):null;l&&w();function w(){const p=z(t);g&&!Mt(g,p)&&n(),g=p,h=requestAnimationFrame(w)}return n(),()=>{var p;f.forEach(y=>{i&&y.removeEventListener("scroll",n),s&&y.removeEventListener("resize",n)}),u?.(),(p=d)==null||p.disconnect(),d=null,l&&cancelAnimationFrame(h)}}const Ce=Zt,Ae=te,Oe=Gt,Le=ee,Ee=(t,e,n)=>{const o=new Map,i=n??{},s={...be,...i.platform,_c:o};return Yt(t,e,{...i,platform:s})},Te=(t,e)=>({top:e,bottom:e,right:t}),Se=(t,e,n,o={})=>{if(typeof t.showPopover!="function")return()=>{};try{t.showPopover()}catch{return()=>{}}let i=!0,s=0;const r=e instanceof Element?e:{getBoundingClientRect:()=>({x:e.right,y:e.top,left:e.right,right:e.right,top:e.top,bottom:e.bottom,width:0,height:e.bottom-e.top})};t.style.width=`${n.width}px`,t.style.maxHeight=`${n.height}px`;const l=Re(r,t,()=>{const a=++s;Ee(r,t,{strategy:"fixed",placement:o.placement??"bottom-end",middleware:[Ce(8),Oe({padding:8,fallbackAxisSideDirection:"end"}),Ae({padding:8}),Le({padding:8,apply:({availableWidth:f,availableHeight:u})=>{!i||a!==s||(t.style.width=`${Math.max(0,Math.min(n.width,f))}px`,t.style.maxHeight=`${Math.max(0,Math.min(n.height,u))}px`)}})]}).then(({x:f,y:u})=>{!i||a!==s||!t.isConnected||(t.style.left=`${f}px`,t.style.top=`${u}px`)}).catch(()=>{})},{animationFrame:o.trackTransform??!1,elementResize:typeof ResizeObserver<"u",layoutShift:typeof IntersectionObserver<"u"});return()=>{i=!1,l()}};class $e{#e;#t=new Map;constructor(e){this.#e=e,e.addController(this)}hostConnected(){this.#e.requestUpdate()}hostUpdated(){for(const[e,n]of this.#t)e.isConnected||(n(),this.#t.delete(e))}hostDisconnected(){for(const e of this.#t.values())e();this.#t.clear()}open(e,n,o,i){this.#t.get(e)?.(),this.#t.set(e,Se(e,n,o,i))}}const ke=Wt({en:{comment:"Comment",commentOn:t=>`Comment on ${t}`,submit:"Send",cancel:"Cancel"},ja:{comment:"\u30B3\u30E1\u30F3\u30C8",commentOn:t=>`${t}\u3078\u306E\u30B3\u30E1\u30F3\u30C8`,submit:"\u9001\u4FE1",cancel:"\u30AD\u30E3\u30F3\u30BB\u30EB"}}),De=(t,e,n={})=>({body:t,notes:e,submission:t.trim()||null,label:n.label??null,error:n.error??null}),Pe=(t,e,n)=>{const o=()=>{e.submission!==null&&n({kind:"comment",body:e.submission})};return K`<div
|
|
2
|
-
class="comment-pop"
|
|
3
|
-
popover="manual"
|
|
4
|
-
role="dialog"
|
|
5
|
-
aria-label=${e.label?t.commentOn(e.label):t.comment}
|
|
6
|
-
@click=${i=>i.stopPropagation()}
|
|
7
|
-
@keydown=${i=>{i.isComposing||i.key!=="Escape"||(i.preventDefault(),i.stopPropagation(),n({kind:"dismiss"}))}}
|
|
8
|
-
>
|
|
9
|
-
${e.label?K`<strong class="comment-target">${e.label}</strong>`:lt}
|
|
10
|
-
${e.error?K`<p class="comment-error" role="alert">${e.error}</p>`:lt}
|
|
11
|
-
${e.notes.length?K`<ul class="comment-list">
|
|
12
|
-
${e.notes.map(i=>K`<li>${i}</li>`)}
|
|
13
|
-
</ul>`:lt}
|
|
14
|
-
<textarea
|
|
15
|
-
class="dpk-textarea"
|
|
16
|
-
aria-label=${t.comment}
|
|
17
|
-
.value=${e.body}
|
|
18
|
-
@input=${i=>{i.currentTarget instanceof HTMLTextAreaElement&&n({kind:"input",body:i.currentTarget.value})}}
|
|
19
|
-
@keydown=${i=>{i.isComposing||i.key==="Enter"&&(i.ctrlKey||i.metaKey)&&(i.preventDefault(),o())}}
|
|
20
|
-
></textarea>
|
|
21
|
-
<div class="pop-actions">
|
|
22
|
-
<button class="dpk-btn dpk-btn--accent" type="button" ?disabled=${e.submission===null} @click=${o}>
|
|
23
|
-
${t.submit}
|
|
24
|
-
</button>
|
|
25
|
-
<button class="dpk-btn dpk-btn--ghost" type="button" @click=${()=>n({kind:"dismiss"})}>
|
|
26
|
-
${t.cancel}
|
|
27
|
-
</button>
|
|
28
|
-
</div>
|
|
29
|
-
</div>`};export{$e as P,Te as a,ke as c,De as p,Pe as r};
|