dev-process-kit 0.2.0 → 0.3.0-beta.0
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 +178 -60
- package/dist/boards.js +1 -0
- package/dist/chunks/shared-B0QTGEwR.js +1844 -0
- package/dist/chunks/shared-BQqlFaPv.js +4928 -0
- package/dist/chunks/shared-BR7trWLo.js +3586 -0
- package/dist/chunks/shared-BpfuvyBP.js +1636 -0
- package/dist/chunks/shared-C1rWkW_W.js +705 -0
- package/dist/chunks/shared-C6hVLci2.js +574 -0
- package/dist/chunks/shared-CtoQ05tb.js +1 -0
- package/dist/chunks/{shared-DJruxrrR.js → shared-DW3QUBTw.js} +25 -56
- package/dist/chunks/shared-DXoggfKr.js +31 -0
- package/dist/chunks/shared-DbgUhOLb.js +686 -0
- package/dist/chunks/shared-Dj_D4ypT.js +2165 -0
- package/dist/chunks/shared-DuB4veji.js +904 -0
- package/dist/chunks/shared-TrlnHjrJ.js +1 -0
- package/dist/chunks/shared-bW1cft1H.js +2530 -0
- package/dist/chunks/shared-jVZVFFNq.js +602 -0
- package/dist/chunks/shared-xpAS9Ri4.js +6208 -0
- package/dist/chunks/shared-ztEUikTm.js +1 -0
- package/dist/components.js +1 -1
- package/dist/index.js +1 -1
- package/dist/views/delegation-poker.js +1 -0
- package/dist/views/plain.js +1 -0
- package/dist/views/prototype.js +1 -0
- package/dist/views/slides.js +1 -0
- package/dist/views/task-board.js +1 -0
- package/dist/views/usm.js +1 -0
- package/package.json +8 -10
- package/dist/chunks/shared-Ae8HmujL.js +0 -49
- package/dist/chunks/shared-B5lBiq5s.js +0 -1
- package/dist/chunks/shared-BCmqTEeQ.js +0 -1051
- package/dist/chunks/shared-BkM7jfZs.js +0 -1104
- package/dist/chunks/shared-Bo8OdTee.js +0 -4206
- package/dist/chunks/shared-C-7mxPbV.js +0 -301
- package/dist/chunks/shared-C-Os1zsf.js +0 -572
- package/dist/chunks/shared-C02b6b2m.js +0 -1
- package/dist/chunks/shared-DLdJfSN-.js +0 -1
- package/dist/chunks/shared-DYKbMmHn.js +0 -610
- package/dist/chunks/shared-DbBoZvUP.js +0 -1609
- package/dist/chunks/shared-DbnPOaXf.js +0 -4210
- package/dist/chunks/shared-DnJBtKmH.js +0 -3769
- package/dist/chunks/shared-v63w_5VP.js +0 -2774
- package/dist/templates/delegation-poker.js +0 -1
- package/dist/templates/event-storming.js +0 -1
- package/dist/templates/example-mapping.js +0 -1
- package/dist/templates/plain.js +0 -1
- package/dist/templates/prototype.js +0 -1
- package/dist/templates/slides.js +0 -1
- package/dist/templates/task-board.js +0 -1
- package/dist/templates/usm.js +0 -1
- package/dist/templates/whiteboard.js +0 -1
|
@@ -1,610 +0,0 @@
|
|
|
1
|
-
import{aj as se,ae as le,af as v,ag as w,ah as E,aG as D,aH as l,ai as p,ak as A,al as L,p as b,au as f,w as ce,P as pe,e as R,a0 as ue,V as B,R as $,aI as ge,aJ as me,a3 as c,B as ve,a4 as s,a5 as be,aK as he,K as ke,aL as ye,aM as fe,a2 as $e,T as z,l as xe}from"./shared-DnJBtKmH.js";const h=[1,2,3,4,5,6,7],k=se(h,"a delegation level is an integer from 1 to 7"),y=A(p(),L(1)),we=v({player:y,level:k,reason:l(p())}),K=v({title:l(p()),parties:l(v({delegator:l(y),delegate:l(y)})),players:w(E(v({id:D,name:y})),[]),decisions:w(E(v({id:D,name:y,description:l(p()),cards:w(E(we),[]),agreed:l(k)})),[])}),M=e=>{const a=le(K,e),r=new Set;for(const t of a.players){if(r.has(t.id))throw new Error(`duplicate id "${t.id}" in players`);r.add(t.id)}const o=new Set;for(const t of a.decisions){if(o.has(t.id))throw new Error(`duplicate id "${t.id}" in decisions`);o.add(t.id);const i=new Set;for(const d of t.cards){if(!r.has(d.player))throw new Error(`decision "${t.id}" has a card from unknown player "${d.player}"`);if(i.has(d.player))throw new Error(`player "${d.player}" played more than one card on decision "${t.id}"`);i.add(d.player)}}return a},j=()=>({players:[],decisions:[]}),u=(e,a)=>{if(a!==void 0)return e.decisions.find(r=>r.id===a)},F=(e,a)=>e.players.find(r=>r.id===a),T=e=>[...e.players.map(a=>a.id),...e.decisions.map(a=>a.id)],x="delegation-poker",g={PLAY_CARD:b("PLAY_CARD","decision",v({level:k})),AGREE_LEVEL:b("AGREE_LEVEL","decision",f({level:k})),ADD_DECISION:b("ADD_DECISION","page",f({id:D,name:A(p(),L(1)),description:l(p())}),{dedupeKey:ce}),SET_DECISION_NAME:b("SET_DECISION_NAME","decision",f({name:A(p(),L(1))})),DELETE_DECISION:b("DELETE_DECISION","decision",f({}))},m={playCard:(e,a)=>({type:"PLAY_CARD",target:{type:"decision",id:e},payload:{level:a}}),agreeLevel:(e,a)=>({type:"AGREE_LEVEL",target:{type:"decision",id:e},payload:{level:a}}),addDecision:(e,a)=>({type:"ADD_DECISION",target:{type:"page",id:x},payload:{id:e,name:a}}),setDecisionName:(e,a)=>({type:"SET_DECISION_NAME",target:{type:"decision",id:e},payload:{name:a}}),deleteDecision:e=>({type:"DELETE_DECISION",target:{type:"decision",id:e},payload:{}})},V=(e,a)=>{const r=pe(g,a);if(r===null)return null;const o=r.target.id;switch(r.type){case"PLAY_CARD":return C(e,o,t=>({...t,yours:r.payload.level}));case"AGREE_LEVEL":return C(e,o,t=>({...t,agreed:r.payload.level}));case"ADD_DECISION":{const t=r.payload;return e.decisions.some(i=>i.id===t.id)?e:T(e).includes(t.id)?null:{...e,decisions:[...e.decisions,{id:t.id,name:t.name,...t.description===void 0?{}:{description:t.description},cards:[]}]}}case"SET_DECISION_NAME":return C(e,o,t=>({...t,name:r.payload.name}));case"DELETE_DECISION":return e.decisions.some(t=>t.id===o)?{...e,decisions:e.decisions.filter(t=>t.id!==o)}:null;default:return R(r)}},C=(e,a,r)=>e.decisions.some(o=>o.id===a)?{...e,decisions:e.decisions.map(o=>o.id===a?r(o):o)}:null,G={1:"Tell",2:"Sell",3:"Consult",4:"Agree",5:"Advise",6:"Inquire",7:"Delegate"},H={1:"\u547D\u4EE4\u3059\u308B",2:"\u8AAC\u5F97\u3059\u308B",3:"\u76F8\u8AC7\u3059\u308B",4:"\u5408\u610F\u3059\u308B",5:"\u52A9\u8A00\u3059\u308B",6:"\u5C0B\u306D\u308B",7:"\u59D4\u4EFB\u3059\u308B"},Ee={1:(e,a)=>`${e} decide and tell ${a}`,2:(e,a)=>`${e} decide and convince ${a}`,3:(e,a)=>`${e} decide after hearing ${a}`,4:(e,a)=>`${e} and ${a} decide together`,5:(e,a)=>`${a} decides after ${e} advise`,6:(e,a)=>`${a} decides, then ${e} ask why`,7:(e,a)=>`${a} decides; ${e} need not know`},De={1:(e,a)=>`${e}\u304C\u6C7A\u3081\u3066\u3001${a}\u306B\u4F1D\u3048\u308B`,2:(e,a)=>`${e}\u304C\u6C7A\u3081\u3066\u3001${a}\u306B\u7D0D\u5F97\u3057\u3066\u3082\u3089\u3046`,3:(e,a)=>`${e}\u304C${a}\u306E\u610F\u898B\u3092\u805E\u3044\u3066\u304B\u3089\u6C7A\u3081\u308B`,4:(e,a)=>`${e}\u3068${a}\u304C\u4E00\u7DD2\u306B\u6C7A\u3081\u308B`,5:(e,a)=>`${e}\u304C\u52A9\u8A00\u3057\u3001${a}\u304C\u6C7A\u3081\u308B`,6:(e,a)=>`${a}\u304C\u6C7A\u3081\u3001\u3042\u3068\u3067${e}\u304C\u7406\u7531\u3092\u5C0B\u306D\u308B`,7:(e,a)=>`${a}\u304C\u6C7A\u3081\u308B\u3002${e}\u306F\u77E5\u3089\u306A\u304F\u3066\u3088\u3044`},Ae={"to-play":"Your card",discuss:"Discuss",consensus:"Same card",agreed:"Agreed"},Le={"to-play":"\u30AB\u30FC\u30C9\u5F85\u3061",discuss:"\u8981\u8B70\u8AD6",consensus:"\u4E00\u81F4",agreed:"\u5408\u610F\u6E08\u307F"},S=ue({en:{levelName:e=>G[e],levelPhrase:(e,a,r)=>Ee[e](a,r),levelLabel:e=>`${e} ${G[e]}`,statusLabel:e=>Ae[e],defaultDelegator:"Leaders",defaultDelegate:"Team",you:"You",progress:(e,a,r)=>`Played ${e}/${r} \xB7 Agreed ${a}/${r}`,partiesLabel:"Who delegates to whom",board:"Delegation board",boardHint:e=>e==="strict"?"Click a cell to play your card for that decision area. The other cards on a row stay face down until you play on it, and your card cannot be changed afterwards.":"Click a cell to play your card for that decision area. The other cards on a row stay face down until you play on it; you can still change your card afterwards.",modeLabel:e=>e==="strict"?"One card only":"Card can be changed",modeTitle:e=>e==="strict"?"Strict mode: a card, once played, is final":"Lax mode: you may change your card after seeing the others",locked:"Final",confirmTitle:"Your card is final",confirmBody:(e,a)=>`You are playing ${e} on \u201C${a}\u201D. On this board a card cannot be changed once played, even after you see the others.`,confirmSkip:"Don\u2019t ask again",confirmPlay:"Play this card",confirmCancel:"Cancel",decisionColumn:"Decision area",agreeColumn:"Agreed",notAgreed:"Not yet",agreeLabel:e=>`Agreed level for \u201C${e}\u201D`,playAt:(e,a)=>`Play ${e} on \u201C${a}\u201D`,hiddenCards:e=>`${e} face down`,addDecision:"+ Decision area",newDecision:"New decision area",noDecisionsTitle:"No decision areas yet",noDecisionsBody:"List the key decisions whose ownership is unclear. For each one, everyone plays one of seven cards, from 1 (the delegator decides alone) to 7 (fully delegated), and then settles on one level.",firstDecision:"+ First decision area",commentCount:e=>`${e} comments`,decisionNameLabel:"Decision area name",commentButton:"Comment",deleteButton:"Delete",cardPlayedTitle:"Played a card",levelAgreedTitle:"Agreed on a level",decisionAddedTitle:"Added a decision area",decisionRenamedTitle:"Renamed the decision area",decisionDeletedTitle:"Deleted the decision area",arrowTo:e=>`\u2192 ${e}`,arrowFrom:(e,a)=>`${e} \u2192 ${a}`,quotedArrowTo:e=>`\u2192 \u201C${e}\u201D`,quotedArrowFrom:(e,a)=>`\u201C${e}\u201D \u2192 \u201C${a}\u201D`,added:e=>`+ \u201C${e}\u201D`,deleted:e=>`\u2212 \u201C${e}\u201D`,decisionKind:"Decision area",boardKind:"Board",wholeBoard:"Whole board"},ja:{levelName:e=>H[e],levelPhrase:(e,a,r)=>De[e](a,r),levelLabel:e=>`${e} ${H[e]}`,statusLabel:e=>Le[e],defaultDelegator:"\u30EA\u30FC\u30C0\u30FC",defaultDelegate:"\u30C1\u30FC\u30E0",you:"\u3042\u306A\u305F",progress:(e,a,r)=>`\u63D0\u51FA ${e}/${r} \xB7 \u5408\u610F ${a}/${r}`,partiesLabel:"\u8AB0\u304C\u8AB0\u306B\u4EFB\u305B\u308B\u304B",board:"\u30C7\u30EA\u30B2\u30FC\u30B7\u30E7\u30F3\u30DC\u30FC\u30C9",boardHint:e=>e==="strict"?"\u30BB\u30EB\u3092\u30AF\u30EA\u30C3\u30AF\u3059\u308B\u3068\u3001\u305D\u306E\u5224\u65AD\u9818\u57DF\u306B\u3042\u306A\u305F\u306E\u30AB\u30FC\u30C9\u3092\u51FA\u3057\u307E\u3059\u3002\u30AB\u30FC\u30C9\u3092\u51FA\u3059\u307E\u3067\u305D\u306E\u884C\u306E\u4ED6\u306E\u30AB\u30FC\u30C9\u306F\u4F0F\u305B\u305F\u307E\u307E\u3067\u3059\u3002\u51FA\u3057\u305F\u30AB\u30FC\u30C9\u306F\u3042\u3068\u304B\u3089\u5909\u66F4\u3067\u304D\u307E\u305B\u3093\u3002":"\u30BB\u30EB\u3092\u30AF\u30EA\u30C3\u30AF\u3059\u308B\u3068\u3001\u305D\u306E\u5224\u65AD\u9818\u57DF\u306B\u3042\u306A\u305F\u306E\u30AB\u30FC\u30C9\u3092\u51FA\u3057\u307E\u3059\u3002\u30AB\u30FC\u30C9\u3092\u51FA\u3059\u307E\u3067\u305D\u306E\u884C\u306E\u4ED6\u306E\u30AB\u30FC\u30C9\u306F\u4F0F\u305B\u305F\u307E\u307E\u3067\u3059\u3002\u51FA\u3057\u305F\u3042\u3068\u3082\u5909\u66F4\u3067\u304D\u307E\u3059\u3002",modeLabel:e=>e==="strict"?"\u51FA\u3057\u76F4\u3057\u4E0D\u53EF":"\u51FA\u3057\u76F4\u3057\u53EF",modeTitle:e=>e==="strict"?"strict \u30E2\u30FC\u30C9: \u4E00\u5EA6\u51FA\u3057\u305F\u30AB\u30FC\u30C9\u306F\u5909\u66F4\u3067\u304D\u307E\u305B\u3093":"lax \u30E2\u30FC\u30C9: \u4ED6\u306E\u4EBA\u306E\u30AB\u30FC\u30C9\u3092\u898B\u305F\u3042\u3068\u3067\u3082\u30AB\u30FC\u30C9\u3092\u5909\u66F4\u3067\u304D\u307E\u3059",locked:"\u78BA\u5B9A",confirmTitle:"\u30AB\u30FC\u30C9\u3092\u51FA\u3059\u3068\u5909\u66F4\u3067\u304D\u307E\u305B\u3093",confirmBody:(e,a)=>`\u300C${a}\u300D\u306B\u300C${e}\u300D\u306E\u30AB\u30FC\u30C9\u3092\u51FA\u3057\u307E\u3059\u3002\u3053\u306E\u30DC\u30FC\u30C9\u3067\u306F\u3001\u4E00\u5EA6\u51FA\u3057\u305F\u30AB\u30FC\u30C9\u306F\u4ED6\u306E\u4EBA\u306E\u30AB\u30FC\u30C9\u3092\u898B\u305F\u3042\u3068\u3067\u3082\u5909\u66F4\u3067\u304D\u307E\u305B\u3093\u3002`,confirmSkip:"\u6B21\u56DE\u304B\u3089\u78BA\u8A8D\u3057\u306A\u3044",confirmPlay:"\u3053\u306E\u30AB\u30FC\u30C9\u3092\u51FA\u3059",confirmCancel:"\u30AD\u30E3\u30F3\u30BB\u30EB",decisionColumn:"\u5224\u65AD\u9818\u57DF",agreeColumn:"\u5408\u610F",notAgreed:"\u672A\u5408\u610F",agreeLabel:e=>`\u300C${e}\u300D\u306E\u5408\u610F\u30EC\u30D9\u30EB`,playAt:(e,a)=>`\u300C${a}\u300D\u306B ${e} \u3092\u51FA\u3059`,hiddenCards:e=>`\u4F0F\u305B\u672D ${e} \u679A`,addDecision:"+ \u5224\u65AD\u9818\u57DF",newDecision:"\u65B0\u3057\u3044\u5224\u65AD\u9818\u57DF",noDecisionsTitle:"\u5224\u65AD\u9818\u57DF\u304C\u307E\u3060\u3042\u308A\u307E\u305B\u3093",noDecisionsBody:"\u8AB0\u304C\u6C7A\u3081\u308B\u306E\u304B\u304C\u66D6\u6627\u306A\u5224\u65AD\u3092\u4E26\u3079\u307E\u3059\u3002\u5224\u65AD\u3054\u3068\u306B\u5168\u54E1\u304C 1\uFF08\u4EFB\u305B\u308B\u5074\u3060\u3051\u3067\u6C7A\u3081\u308B\uFF09\u301C 7\uFF08\u5B8C\u5168\u306B\u4EFB\u305B\u308B\uFF09\u306E\u30AB\u30FC\u30C9\u3092 1 \u679A\u51FA\u3057\u3001\u8A71\u3057\u5408\u3063\u3066 1 \u3064\u306E\u30EC\u30D9\u30EB\u306B\u5408\u610F\u3057\u307E\u3059\u3002",firstDecision:"+ \u6700\u521D\u306E\u5224\u65AD\u9818\u57DF",commentCount:e=>`\u30B3\u30E1\u30F3\u30C8 ${e} \u4EF6`,decisionNameLabel:"\u5224\u65AD\u9818\u57DF\u306E\u540D\u524D",commentButton:"\u30B3\u30E1\u30F3\u30C8",deleteButton:"\u524A\u9664",cardPlayedTitle:"\u30AB\u30FC\u30C9\u3092\u51FA\u3057\u305F",levelAgreedTitle:"\u30EC\u30D9\u30EB\u306B\u5408\u610F",decisionAddedTitle:"\u5224\u65AD\u9818\u57DF\u3092\u8FFD\u52A0",decisionRenamedTitle:"\u5224\u65AD\u9818\u57DF\u306E\u540D\u524D\u3092\u5909\u66F4",decisionDeletedTitle:"\u5224\u65AD\u9818\u57DF\u3092\u524A\u9664",arrowTo:e=>`\u2192 ${e}`,arrowFrom:(e,a)=>`${e} \u2192 ${a}`,quotedArrowTo:e=>`\u2192 \u300C${e}\u300D`,quotedArrowFrom:(e,a)=>`\u300C${e}\u300D\u2192\u300C${a}\u300D`,added:e=>`+ \u300C${e}\u300D`,deleted:e=>`\u2212 \u300C${e}\u300D`,decisionKind:"\u5224\u65AD\u9818\u57DF",boardKind:"\u30DC\u30FC\u30C9",wholeBoard:"\u30DC\u30FC\u30C9\u5168\u4F53"}}),_=e=>e==="strict"?"strict":"lax",P=(e,a)=>e==="strict"&&a.yours!==void 0,Y=(e,a,r)=>e==="lax"?{kind:"play"}:P(e,a)?{kind:"locked"}:r?{kind:"play"}:{kind:"confirm"},I=(e,a)=>({delegator:a.parties?.delegator??e.defaultDelegator,delegate:a.parties?.delegate??e.defaultDelegate}),q=e=>e.yours!==void 0||e.agreed!==void 0,Te=(e,a,r)=>[...r.yours===void 0?[]:[{label:e.you,kind:"you",level:r.yours}],...r.cards.map(t=>({label:F(a,t.player)?.name??t.player,kind:"player",level:t.level,...t.reason===void 0?{}:{reason:t.reason}}))],Ce=(e,a)=>e.agreed!==void 0?"agreed":e.yours===void 0?"to-play":a.every(r=>r.level===e.yours)?"consensus":"discuss",Se=(e,a,r,o)=>{const t=Te(e,a,o),i=q(o)?t:[];return{id:o.id,name:o.name,...o.description===void 0?{}:{description:o.description},status:Ce(o,t),hidden:q(o)?0:o.cards.length,...o.agreed===void 0?{}:{agreed:o.agreed},locked:P(r,o),cells:h.map(d=>({level:d,chips:i.filter(n=>n.level===d).map(({level:n,...ne})=>ne),yours:o.yours===d,agreed:o.agreed===d}))}},N=(e,a,r)=>{const{delegator:o,delegate:t}=I(e,a);return{levels:h.map(i=>({level:i,name:e.levelName(i),label:e.levelLabel(i),phrase:e.levelPhrase(i,o,t)})),rows:a.decisions.map(i=>Se(e,a,r,i)),progress:{played:a.decisions.filter(i=>i.yours!==void 0).length,agreed:a.decisions.filter(i=>i.agreed!==void 0).length,total:a.decisions.length}}},J=(e,a,r)=>{const o=r===void 0?"":e.levelLabel(r);return a===void 0?e.arrowTo(o):e.arrowFrom(e.levelLabel(a),o)},_e=(e,a,r)=>a===void 0?e.quotedArrowTo(r):e.quotedArrowFrom(a,r),U={PLAY_CARD:(e,a,r)=>{const o=$(g.PLAY_CARD,a);return{title:e.cardPlayedTitle,tone:"update",body:J(e,u(r,a.target.id)?.yours,o.level)}},AGREE_LEVEL:(e,a,r)=>({title:e.levelAgreedTitle,tone:"update",body:J(e,u(r,a.target.id)?.agreed,$(g.AGREE_LEVEL,a).level)}),ADD_DECISION:(e,a)=>({title:e.decisionAddedTitle,tone:"create",body:e.added(String($(g.ADD_DECISION,a).name??""))}),SET_DECISION_NAME:(e,a,r)=>({title:e.decisionRenamedTitle,tone:"update",body:_e(e,u(r,a.target.id)?.name,String($(g.SET_DECISION_NAME,a).name??""))}),DELETE_DECISION:(e,a,r)=>({title:e.decisionDeletedTitle,tone:"delete",body:e.deleted(u(r,a.target.id)?.name??a.target.id)})},W=(e,a,r,o)=>{let t;try{const i=Object.hasOwn(U,a.type)?U[a.type]:void 0;t=i?i(e,a,o??r):{title:a.type,tone:"meta"}}catch{t={title:a.type,tone:"meta"}}return{title:t.title,targetLabel:X(e,r,a.target),tone:t.tone,...t.body===void 0?{}:{summary:t.body}}},Q=e=>`${e.type} ${B(e.target)} ${JSON.stringify(e.payload)}`,X=(e,a,r)=>{switch(r.type){case"decision":{const o=u(a,r.id);return o?`${e.decisionKind} \xB7 ${o.name}`:`${e.decisionKind} \xB7 ${r.id} (missing)`}case"page":return`${e.boardKind} \xB7 ${O(a)}`;default:return`${r.type} \xB7 ${r.id}`}},Z=(e,a,r)=>[{value:`page:${x}`,label:e.wholeBoard,group:e.boardKind},...a.decisions.map(o=>({value:B({type:"decision",id:o.id}),label:o.name,group:e.decisionKind}))],O=e=>e.title??"Delegation Poker",ee=(e,a)=>a,ae=(e,a)=>{switch(a.type){case"decision":return u(e,a.id)!==void 0;case"page":return a.id===x;default:return!1}},re=e=>{const a=S(e);return{name:"delegation-poker",label:"Delegation Poker",parseBase:M,emptyBase:j,actions:g,apply:V,hasTarget:ae,describe:(r,o,t)=>W(a,r,o,t),serialize:Q,resolveNavigation:ee,commentTargets:(r,o)=>Z(a,r),title:O}},oe="dev-process-kit:delegation-poker:skip-strict-confirm",te=e=>e===!0?!0:null,Pe=e=>{const a=e?ge(te):me(te);return{read:()=>a.read(oe)===!0,remember:()=>a.write(oe,!0)}},Ie=(e,a,r,o)=>s`
|
|
2
|
-
<button
|
|
3
|
-
class="dpk-icon-btn"
|
|
4
|
-
type="button"
|
|
5
|
-
data-comment=${e}
|
|
6
|
-
aria-label=${a}
|
|
7
|
-
title=${a}
|
|
8
|
-
@click=${()=>o.comment(e)}
|
|
9
|
-
>
|
|
10
|
-
${ve()} ${r>0?s`<span class="dpk-icon-badge">${r}</span>`:c}
|
|
11
|
-
</button>
|
|
12
|
-
`,Ne=e=>{const{context:a,m:r,mode:o}=e,{progress:t}=N(r,a.state,o),{delegator:i,delegate:d}=I(r,a.state);return s`<div class="summary">
|
|
13
|
-
<span class="summary-chip" title=${`${r.partiesLabel}
|
|
14
|
-
${i} \u2192 ${d}`}
|
|
15
|
-
>${i} → ${d}</span
|
|
16
|
-
>
|
|
17
|
-
<span class="summary-chip" data-testid="mode" data-mode=${o} title=${r.modeTitle(o)}
|
|
18
|
-
>${r.modeLabel(o)}</span
|
|
19
|
-
>
|
|
20
|
-
<span class="summary-chip" data-testid="progress"
|
|
21
|
-
>${r.progress(t.played,t.agreed,t.total)}</span
|
|
22
|
-
>
|
|
23
|
-
</div>`},Oe=e=>{const{handlers:a,m:r}=e;return s`<div class="empty">
|
|
24
|
-
<h2>${r.noDecisionsTitle}</h2>
|
|
25
|
-
<p>${r.noDecisionsBody}</p>
|
|
26
|
-
<button class="dpk-btn dpk-btn--accent" type="button" data-testid="add-decision" @click=${a.addDecision}>
|
|
27
|
-
${r.firstDecision}
|
|
28
|
-
</button>
|
|
29
|
-
</div>`},Re=e=>{const{context:a,handlers:r,m:o,mode:t}=e,i=N(o,a.state,t);return s`<section class="board-panel" aria-labelledby="dp-board-title">
|
|
30
|
-
<header class="board-head">
|
|
31
|
-
<h2 id="dp-board-title">${o.board}</h2>
|
|
32
|
-
<p class="board-hint">${o.boardHint(t)}</p>
|
|
33
|
-
</header>
|
|
34
|
-
<div class="board" role="table" aria-labelledby="dp-board-title" data-testid="board">
|
|
35
|
-
<div class="board-head-scroll" role="rowgroup">
|
|
36
|
-
<div class="board-row board-row--head" role="row">
|
|
37
|
-
<span class="cell-name" role="columnheader">${o.decisionColumn}</span>
|
|
38
|
-
${i.levels.map(ze)}
|
|
39
|
-
<span class="cell-agree" role="columnheader">${o.agreeColumn}</span>
|
|
40
|
-
</div>
|
|
41
|
-
</div>
|
|
42
|
-
<div class="board-scroll" role="rowgroup" @scroll=${Be}>
|
|
43
|
-
${be(i.rows,d=>d.id,d=>Ke(e,i.levels,d))}
|
|
44
|
-
</div>
|
|
45
|
-
</div>
|
|
46
|
-
<button class="add-decision" type="button" data-testid="add-decision" @click=${r.addDecision}>
|
|
47
|
-
${o.addDecision}
|
|
48
|
-
</button>
|
|
49
|
-
</section>`},Be=e=>{const a=e.currentTarget;if(!(a instanceof HTMLElement))return;const r=a.previousElementSibling;r instanceof HTMLElement&&(r.scrollLeft=a.scrollLeft)},ze=e=>s`<span
|
|
50
|
-
class="cell cell--head"
|
|
51
|
-
role="columnheader"
|
|
52
|
-
data-level=${e.level}
|
|
53
|
-
>
|
|
54
|
-
<b>${e.level}</b>
|
|
55
|
-
<span class="level-name">${e.name}</span>
|
|
56
|
-
<small class="level-phrase">${e.phrase}</small>
|
|
57
|
-
</span>`,Ke=(e,a,r)=>{const{context:o,handlers:t,m:i}=e,d=`decision:${r.id}`;return s`<div
|
|
58
|
-
class="board-row"
|
|
59
|
-
role="row"
|
|
60
|
-
data-decision=${r.id}
|
|
61
|
-
data-dpk-target=${d}
|
|
62
|
-
data-status=${r.status}
|
|
63
|
-
?data-locked=${r.locked}
|
|
64
|
-
>
|
|
65
|
-
<div class="cell-name" role="rowheader">
|
|
66
|
-
<div class="row-title">
|
|
67
|
-
<dpk-component-inline-edit
|
|
68
|
-
class="row-name"
|
|
69
|
-
.value=${r.name}
|
|
70
|
-
.label=${i.decisionNameLabel}
|
|
71
|
-
@dpk-commit=${he(n=>t.rename(r.id,n))}
|
|
72
|
-
></dpk-component-inline-edit>
|
|
73
|
-
<span class="row-tools">
|
|
74
|
-
${Ie(d,i.commentButton,o.commentCount(d),t)}
|
|
75
|
-
<button
|
|
76
|
-
class="dpk-icon-btn"
|
|
77
|
-
type="button"
|
|
78
|
-
data-testid="delete-decision"
|
|
79
|
-
aria-label=${i.deleteButton}
|
|
80
|
-
title=${i.deleteButton}
|
|
81
|
-
@click=${()=>t.deleteDecision(r.id)}
|
|
82
|
-
>
|
|
83
|
-
${ke()}
|
|
84
|
-
</button>
|
|
85
|
-
</span>
|
|
86
|
-
</div>
|
|
87
|
-
${r.description===void 0?c:s`<p class="row-description">${r.description}</p>`}
|
|
88
|
-
<div class="row-meta">
|
|
89
|
-
<span class="status" data-status=${r.status}>${i.statusLabel(r.status)}</span>
|
|
90
|
-
${r.locked?s`<span class="locked" data-testid="locked">${i.locked}</span>`:c}
|
|
91
|
-
${r.hidden>0?s`<small>${i.hiddenCards(r.hidden)}</small>`:c}
|
|
92
|
-
</div>
|
|
93
|
-
</div>
|
|
94
|
-
${r.cells.map(n=>Me(e,r,a,n))}
|
|
95
|
-
<div class="cell-agree" role="cell">${je(e,a,r)}</div>
|
|
96
|
-
</div>`},Me=(e,a,r,o)=>{const{handlers:t,m:i}=e,d=r.find(n=>n.level===o.level)?.label??String(o.level);return s`<div class="cell" role="cell" data-level=${o.level} ?data-agreed=${o.agreed}>
|
|
97
|
-
<button
|
|
98
|
-
class="cell-play"
|
|
99
|
-
type="button"
|
|
100
|
-
data-level=${o.level}
|
|
101
|
-
aria-pressed=${o.yours?"true":"false"}
|
|
102
|
-
aria-disabled=${a.locked?"true":c}
|
|
103
|
-
aria-label=${i.playAt(d,a.name)}
|
|
104
|
-
@click=${()=>t.play(a.id,o.level)}
|
|
105
|
-
>
|
|
106
|
-
${o.chips.map(n=>s`<span
|
|
107
|
-
class="chip"
|
|
108
|
-
data-kind=${n.kind}
|
|
109
|
-
?data-reason=${n.reason!==void 0}
|
|
110
|
-
title=${n.reason??c}
|
|
111
|
-
>${n.label}</span
|
|
112
|
-
>`)}
|
|
113
|
-
</button>
|
|
114
|
-
</div>`},je=(e,a,r)=>{const{handlers:o,m:t}=e;return s`<select
|
|
115
|
-
class="dpk-select agree-select"
|
|
116
|
-
data-testid="agree"
|
|
117
|
-
aria-label=${t.agreeLabel(r.name)}
|
|
118
|
-
@change=${ye(i=>{const d=h.find(n=>String(n)===i);d!==void 0&&d!==r.agreed&&o.agree(r.id,d)})}
|
|
119
|
-
>
|
|
120
|
-
${r.agreed===void 0?s`<option value="" disabled selected>${t.notAgreed}</option>`:c}
|
|
121
|
-
${a.map(i=>s`<option value=${i.level} ?selected=${i.level===r.agreed}>${i.label}</option>`)}
|
|
122
|
-
</select>`},Fe=(e,a,r)=>a===null?c:s`<div class="confirm-backdrop" @click=${r.cancel}>
|
|
123
|
-
<div
|
|
124
|
-
class="confirm"
|
|
125
|
-
role="alertdialog"
|
|
126
|
-
aria-modal="true"
|
|
127
|
-
aria-labelledby="dp-confirm-title"
|
|
128
|
-
aria-describedby="dp-confirm-body"
|
|
129
|
-
data-testid="confirm-play"
|
|
130
|
-
@click=${o=>o.stopPropagation()}
|
|
131
|
-
@keydown=${o=>{o.key==="Escape"&&r.cancel()}}
|
|
132
|
-
>
|
|
133
|
-
<h2 id="dp-confirm-title">${e.confirmTitle}</h2>
|
|
134
|
-
<p id="dp-confirm-body">${e.confirmBody(e.levelLabel(a.level),a.decisionName)}</p>
|
|
135
|
-
<label class="confirm-skip">
|
|
136
|
-
<input type="checkbox" .checked=${a.skip} @change=${fe(r.toggleSkip)} />
|
|
137
|
-
${e.confirmSkip}
|
|
138
|
-
</label>
|
|
139
|
-
<div class="confirm-actions">
|
|
140
|
-
<button class="dpk-btn" type="button" data-testid="confirm-play-cancel" @click=${r.cancel}>
|
|
141
|
-
${e.confirmCancel}
|
|
142
|
-
</button>
|
|
143
|
-
<button
|
|
144
|
-
class="dpk-btn dpk-btn--accent"
|
|
145
|
-
type="button"
|
|
146
|
-
data-testid="confirm-play-ok"
|
|
147
|
-
data-level=${a.level}
|
|
148
|
-
@click=${r.confirm}
|
|
149
|
-
>
|
|
150
|
-
${e.confirmPlay}
|
|
151
|
-
</button>
|
|
152
|
-
</div>
|
|
153
|
-
</div>
|
|
154
|
-
</div>`,Ve=$e`
|
|
155
|
-
[data-level='1'] {
|
|
156
|
-
--lv: var(--dpk-blue);
|
|
157
|
-
}
|
|
158
|
-
[data-level='2'] {
|
|
159
|
-
--lv: color-mix(in oklab, var(--dpk-blue) 83%, var(--dpk-green));
|
|
160
|
-
}
|
|
161
|
-
[data-level='3'] {
|
|
162
|
-
--lv: color-mix(in oklab, var(--dpk-blue) 67%, var(--dpk-green));
|
|
163
|
-
}
|
|
164
|
-
[data-level='4'] {
|
|
165
|
-
--lv: color-mix(in oklab, var(--dpk-blue) 50%, var(--dpk-green));
|
|
166
|
-
}
|
|
167
|
-
[data-level='5'] {
|
|
168
|
-
--lv: color-mix(in oklab, var(--dpk-blue) 33%, var(--dpk-green));
|
|
169
|
-
}
|
|
170
|
-
[data-level='6'] {
|
|
171
|
-
--lv: color-mix(in oklab, var(--dpk-blue) 17%, var(--dpk-green));
|
|
172
|
-
}
|
|
173
|
-
[data-level='7'] {
|
|
174
|
-
--lv: var(--dpk-green);
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
/* ---------------------------------------------------------- summary */
|
|
178
|
-
|
|
179
|
-
.summary {
|
|
180
|
-
display: flex;
|
|
181
|
-
flex-wrap: wrap;
|
|
182
|
-
min-width: 0;
|
|
183
|
-
gap: 6px;
|
|
184
|
-
font-size: 12px;
|
|
185
|
-
color: var(--dpk-ink-soft);
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
/* A chip stays one line: a party name too long for the header ellipsizes,
|
|
189
|
-
its title has it whole. */
|
|
190
|
-
.summary-chip {
|
|
191
|
-
max-width: 100%;
|
|
192
|
-
overflow: hidden;
|
|
193
|
-
text-overflow: ellipsis;
|
|
194
|
-
white-space: nowrap;
|
|
195
|
-
padding: 4px 10px;
|
|
196
|
-
border: 1px solid var(--dpk-rule);
|
|
197
|
-
border-radius: 999px;
|
|
198
|
-
background: var(--dpk-paper-raised);
|
|
199
|
-
box-shadow: var(--dpk-bevel), var(--dpk-shadow-xs);
|
|
200
|
-
font-variant-numeric: tabular-nums;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
/* ----------------------------------------------------------- status */
|
|
204
|
-
|
|
205
|
-
.status {
|
|
206
|
-
display: inline-block;
|
|
207
|
-
padding: 2px 9px;
|
|
208
|
-
border-radius: 999px;
|
|
209
|
-
font-size: 11.5px;
|
|
210
|
-
font-weight: 600;
|
|
211
|
-
white-space: nowrap;
|
|
212
|
-
background: var(--dpk-paper-sunken);
|
|
213
|
-
color: var(--dpk-ink-soft);
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
.status[data-status='discuss'] {
|
|
217
|
-
background: var(--dpk-amber-soft);
|
|
218
|
-
color: var(--dpk-amber);
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
.status[data-status='consensus'] {
|
|
222
|
-
background: var(--dpk-blue-soft);
|
|
223
|
-
color: var(--dpk-blue);
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
.status[data-status='agreed'] {
|
|
227
|
-
background: var(--dpk-green-soft);
|
|
228
|
-
color: var(--dpk-green);
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
.locked {
|
|
232
|
-
display: inline-flex;
|
|
233
|
-
align-items: center;
|
|
234
|
-
gap: 3px;
|
|
235
|
-
padding: 2px 8px;
|
|
236
|
-
border: 1px solid var(--dpk-rule);
|
|
237
|
-
border-radius: 999px;
|
|
238
|
-
font-size: 11px;
|
|
239
|
-
color: var(--dpk-ink-soft);
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
.locked::before {
|
|
243
|
-
content: '';
|
|
244
|
-
width: 6px;
|
|
245
|
-
height: 6px;
|
|
246
|
-
border-radius: 1px;
|
|
247
|
-
background: currentColor;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
.summary-chip[data-mode='strict'] {
|
|
251
|
-
border-color: color-mix(in srgb, var(--dpk-amber) 45%, var(--dpk-rule));
|
|
252
|
-
color: var(--dpk-amber);
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
/* ----------------------------------------------------------- confirm */
|
|
256
|
-
|
|
257
|
-
.confirm-backdrop {
|
|
258
|
-
position: fixed;
|
|
259
|
-
inset: 0;
|
|
260
|
-
z-index: 20;
|
|
261
|
-
display: grid;
|
|
262
|
-
place-items: center;
|
|
263
|
-
padding: 16px;
|
|
264
|
-
background: color-mix(in srgb, var(--dpk-ink) 28%, transparent);
|
|
265
|
-
animation: dp-fade-in 140ms var(--dpk-ease);
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
.confirm {
|
|
269
|
-
box-sizing: border-box;
|
|
270
|
-
display: grid;
|
|
271
|
-
gap: 12px;
|
|
272
|
-
width: min(420px, 100%);
|
|
273
|
-
padding: 20px;
|
|
274
|
-
border: 1px solid var(--dpk-rule-strong);
|
|
275
|
-
border-radius: var(--dpk-radius-lg);
|
|
276
|
-
background: var(--dpk-paper-raised);
|
|
277
|
-
box-shadow: var(--dpk-bevel), var(--dpk-shadow-lg);
|
|
278
|
-
color: var(--dpk-ink);
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
.confirm h2 {
|
|
282
|
-
margin: 0;
|
|
283
|
-
font-size: 15px;
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
.confirm p {
|
|
287
|
-
margin: 0;
|
|
288
|
-
color: var(--dpk-ink-soft);
|
|
289
|
-
font-size: 13px;
|
|
290
|
-
line-height: 1.6;
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
.confirm-skip {
|
|
294
|
-
display: flex;
|
|
295
|
-
align-items: center;
|
|
296
|
-
gap: 6px;
|
|
297
|
-
font-size: 12.5px;
|
|
298
|
-
color: var(--dpk-ink-soft);
|
|
299
|
-
cursor: pointer;
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
.confirm-actions {
|
|
303
|
-
display: flex;
|
|
304
|
-
justify-content: flex-end;
|
|
305
|
-
gap: 8px;
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
@keyframes dp-fade-in {
|
|
309
|
-
from {
|
|
310
|
-
opacity: 0;
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
/* ------------------------------------------------------------- board */
|
|
315
|
-
|
|
316
|
-
.board-panel {
|
|
317
|
-
display: grid;
|
|
318
|
-
gap: 12px;
|
|
319
|
-
align-content: start;
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
.board-head {
|
|
323
|
-
display: grid;
|
|
324
|
-
gap: 4px;
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
.board-head h2 {
|
|
328
|
-
margin: 0;
|
|
329
|
-
font-size: 16px;
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
.board-hint {
|
|
333
|
-
margin: 0;
|
|
334
|
-
font-size: 12.5px;
|
|
335
|
-
line-height: 1.6;
|
|
336
|
-
color: var(--dpk-ink-soft);
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
.board {
|
|
340
|
-
display: grid;
|
|
341
|
-
border: 1px solid var(--dpk-rule);
|
|
342
|
-
border-radius: var(--dpk-radius-lg);
|
|
343
|
-
background: var(--dpk-paper-raised);
|
|
344
|
-
box-shadow: var(--dpk-shadow-sm);
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
/* The level heads stay in sight while the decisions scroll under them. */
|
|
348
|
-
.board-head-scroll {
|
|
349
|
-
position: sticky;
|
|
350
|
-
top: 0;
|
|
351
|
-
z-index: 2;
|
|
352
|
-
overflow: hidden;
|
|
353
|
-
border-bottom: 1px solid var(--dpk-rule);
|
|
354
|
-
border-radius: var(--dpk-radius-lg) var(--dpk-radius-lg) 0 0;
|
|
355
|
-
background: var(--dpk-paper-raised);
|
|
356
|
-
box-shadow: 0 6px 14px -12px var(--dpk-shade-3);
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
.board-scroll {
|
|
360
|
-
overflow-x: auto;
|
|
361
|
-
border-radius: 0 0 var(--dpk-radius-lg) var(--dpk-radius-lg);
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
.board-head-scroll > .board-row,
|
|
365
|
-
.board-scroll > .board-row {
|
|
366
|
-
min-width: 980px;
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
.board-scroll > .board-row:first-child {
|
|
370
|
-
border-top: 0;
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
.board-row {
|
|
374
|
-
display: grid;
|
|
375
|
-
grid-template-columns: minmax(220px, 2fr) repeat(7, minmax(84px, 1fr)) minmax(132px, 1fr);
|
|
376
|
-
align-items: stretch;
|
|
377
|
-
border-top: 1px solid var(--dpk-rule);
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
.board-row--head {
|
|
381
|
-
border-top: 0;
|
|
382
|
-
font-size: 11.5px;
|
|
383
|
-
color: var(--dpk-ink-soft);
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
.board-row:not(.board-row--head):hover {
|
|
387
|
-
background: color-mix(in srgb, var(--dpk-paper-sunken) 60%, transparent);
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
.board-row--head .cell-name,
|
|
391
|
-
.board-row--head .cell-agree {
|
|
392
|
-
align-content: end;
|
|
393
|
-
font-weight: 600;
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
/* Decision area: its name, description, where it stands and its tools. */
|
|
397
|
-
.cell-name {
|
|
398
|
-
display: grid;
|
|
399
|
-
align-content: center;
|
|
400
|
-
gap: 4px;
|
|
401
|
-
padding: 10px 12px;
|
|
402
|
-
min-width: 0;
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
.row-title {
|
|
406
|
-
display: flex;
|
|
407
|
-
align-items: flex-start;
|
|
408
|
-
gap: 6px;
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
.row-name {
|
|
412
|
-
flex: 1;
|
|
413
|
-
min-width: 0;
|
|
414
|
-
font-size: 13.5px;
|
|
415
|
-
font-weight: 600;
|
|
416
|
-
line-height: 1.4;
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
.row-tools {
|
|
420
|
-
display: flex;
|
|
421
|
-
gap: 2px;
|
|
422
|
-
opacity: 0;
|
|
423
|
-
transition: opacity 120ms ease;
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
.board-row:hover .row-tools,
|
|
427
|
-
.row-tools:focus-within {
|
|
428
|
-
opacity: 1;
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
.row-description {
|
|
432
|
-
margin: 0;
|
|
433
|
-
font-size: 11.5px;
|
|
434
|
-
line-height: 1.5;
|
|
435
|
-
color: var(--dpk-ink-soft);
|
|
436
|
-
}
|
|
437
|
-
|
|
438
|
-
.row-meta {
|
|
439
|
-
display: flex;
|
|
440
|
-
flex-wrap: wrap;
|
|
441
|
-
align-items: center;
|
|
442
|
-
gap: 6px;
|
|
443
|
-
font-size: 11px;
|
|
444
|
-
color: var(--dpk-ink-faint);
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
/* Level columns. */
|
|
448
|
-
.cell {
|
|
449
|
-
display: grid;
|
|
450
|
-
border-left: 1px solid var(--dpk-rule);
|
|
451
|
-
background: color-mix(in srgb, var(--lv) 5%, transparent);
|
|
452
|
-
}
|
|
453
|
-
|
|
454
|
-
.cell--head {
|
|
455
|
-
align-content: end;
|
|
456
|
-
justify-items: center;
|
|
457
|
-
gap: 2px;
|
|
458
|
-
padding: 10px 6px;
|
|
459
|
-
background: color-mix(in srgb, var(--lv) 10%, transparent);
|
|
460
|
-
text-align: center;
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
.cell--head b {
|
|
464
|
-
font-size: 16px;
|
|
465
|
-
line-height: 1;
|
|
466
|
-
color: var(--lv);
|
|
467
|
-
}
|
|
468
|
-
|
|
469
|
-
.level-name {
|
|
470
|
-
font-weight: 600;
|
|
471
|
-
color: var(--dpk-ink);
|
|
472
|
-
}
|
|
473
|
-
|
|
474
|
-
.level-phrase {
|
|
475
|
-
font-size: 10.5px;
|
|
476
|
-
line-height: 1.45;
|
|
477
|
-
color: var(--dpk-ink-faint);
|
|
478
|
-
}
|
|
479
|
-
|
|
480
|
-
.cell[data-agreed] {
|
|
481
|
-
background: color-mix(in srgb, var(--lv) 26%, var(--dpk-paper-raised));
|
|
482
|
-
box-shadow: inset 0 0 0 2px var(--lv);
|
|
483
|
-
}
|
|
484
|
-
|
|
485
|
-
/* The whole cell is the button that plays the reader's card at its level. */
|
|
486
|
-
.cell-play {
|
|
487
|
-
display: flex;
|
|
488
|
-
flex-wrap: wrap;
|
|
489
|
-
gap: 3px;
|
|
490
|
-
align-content: center;
|
|
491
|
-
justify-content: center;
|
|
492
|
-
min-height: 56px;
|
|
493
|
-
margin: 0;
|
|
494
|
-
padding: 6px 4px;
|
|
495
|
-
border: 0;
|
|
496
|
-
background: transparent;
|
|
497
|
-
color: inherit;
|
|
498
|
-
font: inherit;
|
|
499
|
-
cursor: pointer;
|
|
500
|
-
}
|
|
501
|
-
|
|
502
|
-
.cell-play:hover {
|
|
503
|
-
background: color-mix(in srgb, var(--lv) 14%, transparent);
|
|
504
|
-
}
|
|
505
|
-
|
|
506
|
-
/* strict mode: the reader's card is final, so the row no longer takes clicks. */
|
|
507
|
-
.cell-play[aria-disabled='true'] {
|
|
508
|
-
cursor: default;
|
|
509
|
-
}
|
|
510
|
-
|
|
511
|
-
.cell-play[aria-disabled='true']:hover {
|
|
512
|
-
background: transparent;
|
|
513
|
-
}
|
|
514
|
-
|
|
515
|
-
.cell-play:focus-visible {
|
|
516
|
-
outline: none;
|
|
517
|
-
box-shadow: inset var(--dpk-focus);
|
|
518
|
-
}
|
|
519
|
-
|
|
520
|
-
.chip {
|
|
521
|
-
max-width: 100%;
|
|
522
|
-
padding: 1px 7px;
|
|
523
|
-
overflow: hidden;
|
|
524
|
-
border-radius: 999px;
|
|
525
|
-
background: var(--dpk-paper-raised);
|
|
526
|
-
border: 1px solid color-mix(in srgb, var(--lv) 45%, var(--dpk-rule));
|
|
527
|
-
font-size: 10.5px;
|
|
528
|
-
white-space: nowrap;
|
|
529
|
-
text-overflow: ellipsis;
|
|
530
|
-
}
|
|
531
|
-
|
|
532
|
-
/* A chip with a reason: hover it to read why. */
|
|
533
|
-
.chip[data-reason] {
|
|
534
|
-
text-decoration: underline dotted color-mix(in srgb, var(--dpk-ink-faint) 70%, transparent);
|
|
535
|
-
text-underline-offset: 2px;
|
|
536
|
-
cursor: help;
|
|
537
|
-
}
|
|
538
|
-
|
|
539
|
-
.chip[data-kind='you'] {
|
|
540
|
-
border-color: var(--dpk-accent);
|
|
541
|
-
background: var(--dpk-accent);
|
|
542
|
-
color: var(--dpk-accent-ink);
|
|
543
|
-
font-weight: 600;
|
|
544
|
-
}
|
|
545
|
-
|
|
546
|
-
/* The settled level. */
|
|
547
|
-
.cell-agree {
|
|
548
|
-
display: grid;
|
|
549
|
-
align-content: center;
|
|
550
|
-
padding: 8px 10px;
|
|
551
|
-
border-left: 1px solid var(--dpk-rule);
|
|
552
|
-
}
|
|
553
|
-
|
|
554
|
-
.agree-select {
|
|
555
|
-
width: 100%;
|
|
556
|
-
min-width: 0;
|
|
557
|
-
font-size: 12px;
|
|
558
|
-
}
|
|
559
|
-
|
|
560
|
-
.board-row[data-status='agreed'] .agree-select {
|
|
561
|
-
border-color: color-mix(in srgb, var(--dpk-green) 55%, var(--dpk-rule));
|
|
562
|
-
}
|
|
563
|
-
|
|
564
|
-
.add-decision {
|
|
565
|
-
justify-self: start;
|
|
566
|
-
padding: 8px 14px;
|
|
567
|
-
border: 1px dashed var(--dpk-rule-strong);
|
|
568
|
-
border-radius: var(--dpk-radius);
|
|
569
|
-
background: transparent;
|
|
570
|
-
color: var(--dpk-ink-soft);
|
|
571
|
-
font: inherit;
|
|
572
|
-
cursor: pointer;
|
|
573
|
-
}
|
|
574
|
-
|
|
575
|
-
.add-decision:hover {
|
|
576
|
-
border-color: var(--dpk-accent);
|
|
577
|
-
color: var(--dpk-accent);
|
|
578
|
-
}
|
|
579
|
-
|
|
580
|
-
.add-decision:focus-visible {
|
|
581
|
-
outline: none;
|
|
582
|
-
box-shadow: var(--dpk-focus);
|
|
583
|
-
}
|
|
584
|
-
|
|
585
|
-
/* ------------------------------------------------------------- empty */
|
|
586
|
-
|
|
587
|
-
.empty {
|
|
588
|
-
display: grid;
|
|
589
|
-
gap: 10px;
|
|
590
|
-
max-width: 620px;
|
|
591
|
-
padding: 28px 24px;
|
|
592
|
-
border: 1px dashed var(--dpk-rule-strong);
|
|
593
|
-
border-radius: var(--dpk-radius-lg);
|
|
594
|
-
background: var(--dpk-dots), var(--dpk-paper-sunken);
|
|
595
|
-
}
|
|
596
|
-
|
|
597
|
-
.empty h2 {
|
|
598
|
-
margin: 0;
|
|
599
|
-
}
|
|
600
|
-
|
|
601
|
-
.empty p {
|
|
602
|
-
margin: 0;
|
|
603
|
-
color: var(--dpk-ink-soft);
|
|
604
|
-
line-height: 1.7;
|
|
605
|
-
}
|
|
606
|
-
|
|
607
|
-
.empty .dpk-btn {
|
|
608
|
-
justify-self: start;
|
|
609
|
-
}
|
|
610
|
-
`;class ie extends z{static{this.styles=[z.styles,Ve]}static{this.properties={mode:{type:String},pending:{state:!0},skipConfirm:{state:!0}}}#a=null;#e=null;constructor(){super(),this.mode=null,this.pending=null,this.skipConfirm=!1}connectedCallback(){super.connectedCallback(),this.#a=Pe(this.storage!=="off"&&this.storage!=="memory"),this.skipConfirm=this.#a.read()}definitionFor(a){return re(a)}renderRegions(a){const r=S(this.locale),o=this.#r(a,r),t={context:a,handlers:o,m:r,mode:_(this.mode)},i=a.state.decisions.length===0?Oe(t):Re(t);return{header:Ne(t),main:s`${i}${Fe(r,this.pending,this.#o(a))}`}}updated(){super.updated();const a=this.#e;if(a!==null){if(this.#e=null,a==="dialog"){this.renderRoot.querySelector('[data-testid="confirm-play-ok"]')?.focus();return}this.renderRoot.querySelector(`[data-decision="${a.decisionId}"] .cell-play[data-level="${a.level}"]`)?.focus()}}#r(a,r){return{play:(o,t)=>{const i=a.state.decisions.find(n=>n.id===o);if(i===void 0)return;const d=Y(_(this.mode),i,this.skipConfirm);switch(d.kind){case"play":a.dispatch(m.playCard(o,t));return;case"confirm":this.pending={decisionId:o,decisionName:i.name,level:t,skip:!1},this.#e="dialog";return;case"locked":return;default:R(d)}},agree:(o,t)=>{a.dispatch(m.agreeLevel(o,t))},addDecision:()=>{const o=xe("decision",T(a.state));a.dispatch(m.addDecision(o,r.newDecision))},rename:(o,t)=>{a.dispatch(m.setDecisionName(o,t))},deleteDecision:o=>{a.dispatch(m.deleteDecision(o))},comment:o=>this.requestComment(o)}}#o(a){const r=o=>{this.pending=null,this.#e={decisionId:o.decisionId,level:o.level}};return{toggleSkip:o=>{this.pending!==null&&(this.pending={...this.pending,skip:o})},confirm:()=>{const o=this.pending;o!==null&&(o.skip&&(this.#a?.remember(),this.skipConfirm=!0),a.dispatch(m.playCard(o.decisionId,o.level)),r(o))},cancel:()=>{this.pending!==null&&r(this.pending)}}}}const de=()=>{customElements.get("dpk-template-delegation-poker")||customElements.define("dpk-template-delegation-poker",ie)},Ge=Object.freeze(Object.defineProperty({__proto__:null,DELEGATION_LEVELS:h,DELEGATION_POKER_PAGE:x,DpkTemplateDelegationPoker:ie,allDelegationPokerIds:T,applyDelegationPokerAction:V,defineDelegationPokerElement:de,delegationLevelSchema:k,delegationParties:I,delegationPokerAction:m,delegationPokerActions:g,delegationPokerBaseSchema:K,delegationPokerCommentTargets:Z,delegationPokerDefinitionFor:re,delegationPokerHasTarget:ae,delegationPokerMessages:S,delegationPokerTargetLabel:X,delegationPokerTitle:O,describeDelegationPokerAction:W,emptyDelegationPokerBase:j,findDecision:u,findPlayer:F,isLocked:P,parseDelegationPokerBase:M,parsePlayMode:_,playIntent:Y,presentBoard:N,resolveDelegationPokerNavigation:ee,serializeDelegationPokerAction:Q},Symbol.toStringTag,{value:"Module"}));export{de as d,Ge as i};
|