dev-process-kit 0.0.5 → 0.0.6
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 +11 -10
- package/dist/chunks/{shared-C2CXBRPi.js → shared-BF8AzhLw.js} +1 -1
- package/dist/chunks/{shared-C0mdkwlb.js → shared-BN5XrMLt.js} +35 -35
- package/dist/chunks/{shared-Cw5CeV8i.js → shared-BZ71JLz_.js} +3 -3
- package/dist/chunks/{shared-C3elMbSj.js → shared-B_b3KXSe.js} +1 -1
- package/dist/chunks/{shared-BQ0E-JVR.js → shared-Blnsyn6U.js} +5 -5
- package/dist/chunks/{shared-CAGOmktw.js → shared-CbTVavOV.js} +1 -1
- package/dist/chunks/{shared-CdnRdasm.js → shared-D9zBdXMP.js} +1 -1
- package/dist/chunks/{shared-DMl5yToi.js → shared-DI7xrx1a.js} +2 -2
- package/dist/chunks/{shared-CmatZh_d.js → shared-DL7Zn-cH.js} +1 -1
- package/dist/chunks/{shared-BBOnWWgd.js → shared-DSF_A3cy.js} +1 -1
- package/dist/chunks/{shared-ZyeN4ds2.js → shared-Pli_DImS.js} +1 -1
- package/dist/chunks/shared-nn8xc7-Q.js +576 -0
- package/dist/chunks/{shared-HAkNFTDO.js → shared-vUXShHFm.js} +9 -9
- package/dist/components.js +1 -1
- package/dist/index.js +1 -1
- package/dist/templates/delegation-poker.js +1 -0
- 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/package.json +3 -2
|
@@ -0,0 +1,576 @@
|
|
|
1
|
+
import{a9 as se,ae as le,aa as v,ab as E,ac as D,at as w,av as l,ad as p,af as A,ag as L,q as y,an as f,v as ce,P as pe,f as R,_ as ue,V as B,R as $,aw as ge,ax as me,a1 as c,A as ve,a2 as s,a3 as ye,ay as be,K as ke,az as he,aA as fe,a0 as $e,T as z,m as xe}from"./shared-BN5XrMLt.js";const b=[1,2,3,4,5,6,7],k=le(b,"a delegation level is an integer from 1 to 7"),h=A(p(),L(1)),Ee=v({player:h,level:k,reason:l(p())}),K=v({title:l(p()),parties:l(v({delegator:l(h),delegate:l(h)})),players:E(D(v({id:w,name:h})),[]),decisions:E(D(v({id:w,name:h,description:l(p()),cards:E(D(Ee),[]),agreed:l(k)})),[])}),F=e=>{const a=se(K,e),r=new Set;for(const o of a.players){if(r.has(o.id))throw new Error(`duplicate id "${o.id}" in players`);r.add(o.id)}const t=new Set;for(const o of a.decisions){if(t.has(o.id))throw new Error(`duplicate id "${o.id}" in decisions`);t.add(o.id);const i=new Set;for(const n of o.cards){if(!r.has(n.player))throw new Error(`decision "${o.id}" has a card from unknown player "${n.player}"`);if(i.has(n.player))throw new Error(`player "${n.player}" played more than one card on decision "${o.id}"`);i.add(n.player)}}return a},M=()=>({players:[],decisions:[]}),u=(e,a)=>{if(a!==void 0)return e.decisions.find(r=>r.id===a)},V=(e,a)=>e.players.find(r=>r.id===a),C=e=>[...e.players.map(a=>a.id),...e.decisions.map(a=>a.id)],x="delegation-poker",g={PLAY_CARD:y("PLAY_CARD","decision",v({level:k})),AGREE_LEVEL:y("AGREE_LEVEL","decision",f({level:k})),ADD_DECISION:y("ADD_DECISION","page",f({id:w,name:A(p(),L(1)),description:l(p())}),{dedupeKey:ce}),SET_DECISION_NAME:y("SET_DECISION_NAME","decision",f({name:A(p(),L(1))})),DELETE_DECISION:y("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:{}})},j=(e,a)=>{const r=pe(g,a);if(r===null)return null;const t=r.target.id;switch(r.type){case"PLAY_CARD":return T(e,t,o=>({...o,yours:r.payload.level}));case"AGREE_LEVEL":return T(e,t,o=>({...o,agreed:r.payload.level}));case"ADD_DECISION":{const o=r.payload;return e.decisions.some(i=>i.id===o.id)?e:C(e).includes(o.id)?null:{...e,decisions:[...e.decisions,{id:o.id,name:o.name,...o.description===void 0?{}:{description:o.description},cards:[]}]}}case"SET_DECISION_NAME":return T(e,t,o=>({...o,name:r.payload.name}));case"DELETE_DECISION":return e.decisions.some(o=>o.id===t)?{...e,decisions:e.decisions.filter(o=>o.id!==t)}:null;default:return R(r)}},T=(e,a,r)=>e.decisions.some(t=>t.id===a)?{...e,decisions:e.decisions.map(t=>t.id===a?r(t):t)}:null,q={1:"Tell",2:"Sell",3:"Consult",4:"Agree",5:"Advise",6:"Inquire",7:"Delegate"},Y={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"},De={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`},we={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=>q[e],levelPhrase:(e,a,r)=>De[e](a,r),levelLabel:e=>`${e} ${q[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=>Y[e],levelPhrase:(e,a,r)=>we[e](a,r),levelLabel:e=>`${e} ${Y[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,G=(e,a,r)=>e==="lax"?{kind:"play"}:P(e,a)?{kind:"locked"}:r?{kind:"play"}:{kind:"confirm"},N=(e,a)=>({delegator:a.parties?.delegator??e.defaultDelegator,delegate:a.parties?.delegate??e.defaultDelegate}),H=e=>e.yours!==void 0||e.agreed!==void 0,Ce=(e,a,r)=>[...r.yours===void 0?[]:[{label:e.you,kind:"you",level:r.yours}],...r.cards.map(o=>({label:V(a,o.player)?.name??o.player,kind:"player",level:o.level,...o.reason===void 0?{}:{reason:o.reason}}))],Te=(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,t)=>{const o=Ce(e,a,t),i=H(t)?o:[];return{id:t.id,name:t.name,...t.description===void 0?{}:{description:t.description},status:Te(t,o),hidden:H(t)?0:t.cards.length,...t.agreed===void 0?{}:{agreed:t.agreed},locked:P(r,t),cells:b.map(n=>({level:n,chips:i.filter(d=>d.level===n).map(({level:d,...de})=>de),yours:t.yours===n,agreed:t.agreed===n}))}},I=(e,a,r)=>{const{delegator:t,delegate:o}=N(e,a);return{levels:b.map(i=>({level:i,name:e.levelName(i),label:e.levelLabel(i),phrase:e.levelPhrase(i,t,o)})),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 t=r===void 0?"":e.levelLabel(r);return a===void 0?e.arrowTo(t):e.arrowFrom(e.levelLabel(a),t)},_e=(e,a,r)=>a===void 0?e.quotedArrowTo(r):e.quotedArrowFrom(a,r),U={PLAY_CARD:(e,a,r)=>{const t=$(g.PLAY_CARD,a);return{title:e.cardPlayedTitle,tone:"update",body:J(e,u(r,a.target.id)?.yours,t.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,t)=>{let o;try{const i=Object.hasOwn(U,a.type)?U[a.type]:void 0;o=i?i(e,a,t??r):{title:a.type,tone:"meta"}}catch{o={title:a.type,tone:"meta"}}return{title:o.title,targetLabel:X(e,r,a.target),tone:o.tone,...o.body===void 0?{}:{summary:o.body}}},Q=e=>`${e.type} ${B(e.target)} ${JSON.stringify(e.payload)}`,X=(e,a,r)=>{switch(r.type){case"decision":{const t=u(a,r.id);return t?`${e.decisionKind} \xB7 ${t.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(t=>({value:B({type:"decision",id:t.id}),label:t.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:F,emptyBase:M,actions:g,apply:j,hasTarget:ae,describe:(r,t,o)=>W(a,r,t,o),serialize:Q,resolveNavigation:ee,commentTargets:(r,t)=>Z(a,r),title:O}},te="dev-process-kit:delegation-poker:skip-strict-confirm",oe=e=>e===!0?!0:null,Pe=e=>{const a=e?ge(oe):me(oe);return{read:()=>a.read(te)===!0,remember:()=>a.write(te,!0)}},Ne=(e,a,r,t)=>s`
|
|
2
|
+
<button
|
|
3
|
+
class="dpk-icon-btn"
|
|
4
|
+
type="button"
|
|
5
|
+
data-comment=${e}
|
|
6
|
+
aria-label=${a}
|
|
7
|
+
title=${a}
|
|
8
|
+
@click=${()=>t.comment(e)}
|
|
9
|
+
>
|
|
10
|
+
${ve()} ${r>0?s`<span class="dpk-icon-badge">${r}</span>`:c}
|
|
11
|
+
</button>
|
|
12
|
+
`,Ie=e=>{const{context:a,m:r,mode:t}=e,{progress:o}=I(r,a.state,t),{delegator:i,delegate:n}=N(r,a.state);return s`<div class="summary">
|
|
13
|
+
<span class="summary-chip" title=${r.partiesLabel}>${i} → ${n}</span>
|
|
14
|
+
<span class="summary-chip" data-testid="mode" data-mode=${t} title=${r.modeTitle(t)}
|
|
15
|
+
>${r.modeLabel(t)}</span
|
|
16
|
+
>
|
|
17
|
+
<span class="summary-chip" data-testid="progress"
|
|
18
|
+
>${r.progress(o.played,o.agreed,o.total)}</span
|
|
19
|
+
>
|
|
20
|
+
</div>`},Oe=e=>{const{handlers:a,m:r}=e;return s`<div class="empty">
|
|
21
|
+
<h2>${r.noDecisionsTitle}</h2>
|
|
22
|
+
<p>${r.noDecisionsBody}</p>
|
|
23
|
+
<button class="dpk-btn dpk-btn--accent" type="button" data-testid="add-decision" @click=${a.addDecision}>
|
|
24
|
+
${r.firstDecision}
|
|
25
|
+
</button>
|
|
26
|
+
</div>`},Re=e=>{const{context:a,handlers:r,m:t,mode:o}=e,i=I(t,a.state,o);return s`<section class="board-panel" aria-labelledby="dp-board-title">
|
|
27
|
+
<header class="board-head">
|
|
28
|
+
<h2 id="dp-board-title">${t.board}</h2>
|
|
29
|
+
<p class="board-hint">${t.boardHint(o)}</p>
|
|
30
|
+
</header>
|
|
31
|
+
<div class="board-scroll">
|
|
32
|
+
<div class="board" role="table" aria-labelledby="dp-board-title" data-testid="board">
|
|
33
|
+
<div class="board-row board-row--head" role="row">
|
|
34
|
+
<span class="cell-name" role="columnheader">${t.decisionColumn}</span>
|
|
35
|
+
${i.levels.map(Be)}
|
|
36
|
+
<span class="cell-agree" role="columnheader">${t.agreeColumn}</span>
|
|
37
|
+
</div>
|
|
38
|
+
${ye(i.rows,n=>n.id,n=>ze(e,i.levels,n))}
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
<button class="add-decision" type="button" data-testid="add-decision" @click=${r.addDecision}>
|
|
42
|
+
${t.addDecision}
|
|
43
|
+
</button>
|
|
44
|
+
</section>`},Be=e=>s`<span
|
|
45
|
+
class="cell cell--head"
|
|
46
|
+
role="columnheader"
|
|
47
|
+
data-level=${e.level}
|
|
48
|
+
>
|
|
49
|
+
<b>${e.level}</b>
|
|
50
|
+
<span class="level-name">${e.name}</span>
|
|
51
|
+
<small class="level-phrase">${e.phrase}</small>
|
|
52
|
+
</span>`,ze=(e,a,r)=>{const{context:t,handlers:o,m:i}=e,n=`decision:${r.id}`;return s`<div
|
|
53
|
+
class="board-row"
|
|
54
|
+
role="row"
|
|
55
|
+
data-decision=${r.id}
|
|
56
|
+
data-status=${r.status}
|
|
57
|
+
?data-locked=${r.locked}
|
|
58
|
+
>
|
|
59
|
+
<div class="cell-name" role="rowheader">
|
|
60
|
+
<div class="row-title">
|
|
61
|
+
<dpk-component-inline-edit
|
|
62
|
+
class="row-name"
|
|
63
|
+
.value=${r.name}
|
|
64
|
+
.label=${i.decisionNameLabel}
|
|
65
|
+
@dpk-commit=${be(d=>o.rename(r.id,d))}
|
|
66
|
+
></dpk-component-inline-edit>
|
|
67
|
+
<span class="row-tools">
|
|
68
|
+
${Ne(n,i.commentButton,t.commentCount(n),o)}
|
|
69
|
+
<button
|
|
70
|
+
class="dpk-icon-btn"
|
|
71
|
+
type="button"
|
|
72
|
+
data-testid="delete-decision"
|
|
73
|
+
aria-label=${i.deleteButton}
|
|
74
|
+
title=${i.deleteButton}
|
|
75
|
+
@click=${()=>o.deleteDecision(r.id)}
|
|
76
|
+
>
|
|
77
|
+
${ke()}
|
|
78
|
+
</button>
|
|
79
|
+
</span>
|
|
80
|
+
</div>
|
|
81
|
+
${r.description===void 0?c:s`<p class="row-description">${r.description}</p>`}
|
|
82
|
+
<div class="row-meta">
|
|
83
|
+
<span class="status" data-status=${r.status}>${i.statusLabel(r.status)}</span>
|
|
84
|
+
${r.locked?s`<span class="locked" data-testid="locked">${i.locked}</span>`:c}
|
|
85
|
+
${r.hidden>0?s`<small>${i.hiddenCards(r.hidden)}</small>`:c}
|
|
86
|
+
</div>
|
|
87
|
+
</div>
|
|
88
|
+
${r.cells.map(d=>Ke(e,r,a,d))}
|
|
89
|
+
<div class="cell-agree" role="cell">${Fe(e,a,r)}</div>
|
|
90
|
+
</div>`},Ke=(e,a,r,t)=>{const{handlers:o,m:i}=e,n=r.find(d=>d.level===t.level)?.label??String(t.level);return s`<div class="cell" role="cell" data-level=${t.level} ?data-agreed=${t.agreed}>
|
|
91
|
+
<button
|
|
92
|
+
class="cell-play"
|
|
93
|
+
type="button"
|
|
94
|
+
data-level=${t.level}
|
|
95
|
+
aria-pressed=${t.yours?"true":"false"}
|
|
96
|
+
aria-disabled=${a.locked?"true":c}
|
|
97
|
+
aria-label=${i.playAt(n,a.name)}
|
|
98
|
+
@click=${()=>o.play(a.id,t.level)}
|
|
99
|
+
>
|
|
100
|
+
${t.chips.map(d=>s`<span
|
|
101
|
+
class="chip"
|
|
102
|
+
data-kind=${d.kind}
|
|
103
|
+
?data-reason=${d.reason!==void 0}
|
|
104
|
+
title=${d.reason??c}
|
|
105
|
+
>${d.label}</span
|
|
106
|
+
>`)}
|
|
107
|
+
</button>
|
|
108
|
+
</div>`},Fe=(e,a,r)=>{const{handlers:t,m:o}=e;return s`<select
|
|
109
|
+
class="dpk-select agree-select"
|
|
110
|
+
data-testid="agree"
|
|
111
|
+
aria-label=${o.agreeLabel(r.name)}
|
|
112
|
+
@change=${he(i=>{const n=b.find(d=>String(d)===i);n!==void 0&&n!==r.agreed&&t.agree(r.id,n)})}
|
|
113
|
+
>
|
|
114
|
+
${r.agreed===void 0?s`<option value="" disabled selected>${o.notAgreed}</option>`:c}
|
|
115
|
+
${a.map(i=>s`<option value=${i.level} ?selected=${i.level===r.agreed}>${i.label}</option>`)}
|
|
116
|
+
</select>`},Me=(e,a,r)=>a===null?c:s`<div class="confirm-backdrop" @click=${r.cancel}>
|
|
117
|
+
<div
|
|
118
|
+
class="confirm"
|
|
119
|
+
role="alertdialog"
|
|
120
|
+
aria-modal="true"
|
|
121
|
+
aria-labelledby="dp-confirm-title"
|
|
122
|
+
aria-describedby="dp-confirm-body"
|
|
123
|
+
data-testid="confirm-play"
|
|
124
|
+
@click=${t=>t.stopPropagation()}
|
|
125
|
+
@keydown=${t=>{t.key==="Escape"&&r.cancel()}}
|
|
126
|
+
>
|
|
127
|
+
<h2 id="dp-confirm-title">${e.confirmTitle}</h2>
|
|
128
|
+
<p id="dp-confirm-body">${e.confirmBody(e.levelLabel(a.level),a.decisionName)}</p>
|
|
129
|
+
<label class="confirm-skip">
|
|
130
|
+
<input type="checkbox" .checked=${a.skip} @change=${fe(r.toggleSkip)} />
|
|
131
|
+
${e.confirmSkip}
|
|
132
|
+
</label>
|
|
133
|
+
<div class="confirm-actions">
|
|
134
|
+
<button class="dpk-btn" type="button" data-testid="confirm-play-cancel" @click=${r.cancel}>
|
|
135
|
+
${e.confirmCancel}
|
|
136
|
+
</button>
|
|
137
|
+
<button
|
|
138
|
+
class="dpk-btn dpk-btn--accent"
|
|
139
|
+
type="button"
|
|
140
|
+
data-testid="confirm-play-ok"
|
|
141
|
+
data-level=${a.level}
|
|
142
|
+
@click=${r.confirm}
|
|
143
|
+
>
|
|
144
|
+
${e.confirmPlay}
|
|
145
|
+
</button>
|
|
146
|
+
</div>
|
|
147
|
+
</div>
|
|
148
|
+
</div>`,Ve=$e`
|
|
149
|
+
[data-level='1'] {
|
|
150
|
+
--lv: var(--dpk-blue);
|
|
151
|
+
}
|
|
152
|
+
[data-level='2'] {
|
|
153
|
+
--lv: color-mix(in oklab, var(--dpk-blue) 83%, var(--dpk-green));
|
|
154
|
+
}
|
|
155
|
+
[data-level='3'] {
|
|
156
|
+
--lv: color-mix(in oklab, var(--dpk-blue) 67%, var(--dpk-green));
|
|
157
|
+
}
|
|
158
|
+
[data-level='4'] {
|
|
159
|
+
--lv: color-mix(in oklab, var(--dpk-blue) 50%, var(--dpk-green));
|
|
160
|
+
}
|
|
161
|
+
[data-level='5'] {
|
|
162
|
+
--lv: color-mix(in oklab, var(--dpk-blue) 33%, var(--dpk-green));
|
|
163
|
+
}
|
|
164
|
+
[data-level='6'] {
|
|
165
|
+
--lv: color-mix(in oklab, var(--dpk-blue) 17%, var(--dpk-green));
|
|
166
|
+
}
|
|
167
|
+
[data-level='7'] {
|
|
168
|
+
--lv: var(--dpk-green);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/* ---------------------------------------------------------- summary */
|
|
172
|
+
|
|
173
|
+
.summary {
|
|
174
|
+
display: flex;
|
|
175
|
+
flex-wrap: wrap;
|
|
176
|
+
gap: 6px;
|
|
177
|
+
font-size: 12px;
|
|
178
|
+
color: var(--dpk-ink-soft);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.summary-chip {
|
|
182
|
+
padding: 4px 10px;
|
|
183
|
+
border: 1px solid var(--dpk-rule);
|
|
184
|
+
border-radius: 999px;
|
|
185
|
+
background: var(--dpk-paper-raised);
|
|
186
|
+
box-shadow: var(--dpk-bevel), var(--dpk-shadow-xs);
|
|
187
|
+
font-variant-numeric: tabular-nums;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/* ----------------------------------------------------------- status */
|
|
191
|
+
|
|
192
|
+
.status {
|
|
193
|
+
display: inline-block;
|
|
194
|
+
padding: 2px 9px;
|
|
195
|
+
border-radius: 999px;
|
|
196
|
+
font-size: 11.5px;
|
|
197
|
+
font-weight: 600;
|
|
198
|
+
white-space: nowrap;
|
|
199
|
+
background: var(--dpk-paper-sunken);
|
|
200
|
+
color: var(--dpk-ink-soft);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.status[data-status='discuss'] {
|
|
204
|
+
background: var(--dpk-amber-soft);
|
|
205
|
+
color: var(--dpk-amber);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.status[data-status='consensus'] {
|
|
209
|
+
background: var(--dpk-blue-soft);
|
|
210
|
+
color: var(--dpk-blue);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.status[data-status='agreed'] {
|
|
214
|
+
background: var(--dpk-green-soft);
|
|
215
|
+
color: var(--dpk-green);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.locked {
|
|
219
|
+
display: inline-flex;
|
|
220
|
+
align-items: center;
|
|
221
|
+
gap: 3px;
|
|
222
|
+
padding: 2px 8px;
|
|
223
|
+
border: 1px solid var(--dpk-rule);
|
|
224
|
+
border-radius: 999px;
|
|
225
|
+
font-size: 11px;
|
|
226
|
+
color: var(--dpk-ink-soft);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.locked::before {
|
|
230
|
+
content: '';
|
|
231
|
+
width: 6px;
|
|
232
|
+
height: 6px;
|
|
233
|
+
border-radius: 1px;
|
|
234
|
+
background: currentColor;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.summary-chip[data-mode='strict'] {
|
|
238
|
+
border-color: color-mix(in srgb, var(--dpk-amber) 45%, var(--dpk-rule));
|
|
239
|
+
color: var(--dpk-amber);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/* ----------------------------------------------------------- confirm */
|
|
243
|
+
|
|
244
|
+
.confirm-backdrop {
|
|
245
|
+
position: fixed;
|
|
246
|
+
inset: 0;
|
|
247
|
+
z-index: 20;
|
|
248
|
+
display: grid;
|
|
249
|
+
place-items: center;
|
|
250
|
+
padding: 16px;
|
|
251
|
+
background: color-mix(in srgb, var(--dpk-ink) 28%, transparent);
|
|
252
|
+
animation: dp-fade-in 140ms var(--dpk-ease);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
.confirm {
|
|
256
|
+
box-sizing: border-box;
|
|
257
|
+
display: grid;
|
|
258
|
+
gap: 12px;
|
|
259
|
+
width: min(420px, 100%);
|
|
260
|
+
padding: 20px;
|
|
261
|
+
border: 1px solid var(--dpk-rule-strong);
|
|
262
|
+
border-radius: var(--dpk-radius-lg);
|
|
263
|
+
background: var(--dpk-paper-raised);
|
|
264
|
+
box-shadow: var(--dpk-bevel), var(--dpk-shadow-lg);
|
|
265
|
+
color: var(--dpk-ink);
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
.confirm h2 {
|
|
269
|
+
margin: 0;
|
|
270
|
+
font-size: 15px;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
.confirm p {
|
|
274
|
+
margin: 0;
|
|
275
|
+
color: var(--dpk-ink-soft);
|
|
276
|
+
font-size: 13px;
|
|
277
|
+
line-height: 1.6;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.confirm-skip {
|
|
281
|
+
display: flex;
|
|
282
|
+
align-items: center;
|
|
283
|
+
gap: 6px;
|
|
284
|
+
font-size: 12.5px;
|
|
285
|
+
color: var(--dpk-ink-soft);
|
|
286
|
+
cursor: pointer;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
.confirm-actions {
|
|
290
|
+
display: flex;
|
|
291
|
+
justify-content: flex-end;
|
|
292
|
+
gap: 8px;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
@keyframes dp-fade-in {
|
|
296
|
+
from {
|
|
297
|
+
opacity: 0;
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
/* ------------------------------------------------------------- board */
|
|
302
|
+
|
|
303
|
+
.board-panel {
|
|
304
|
+
display: grid;
|
|
305
|
+
gap: 12px;
|
|
306
|
+
align-content: start;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
.board-head {
|
|
310
|
+
display: grid;
|
|
311
|
+
gap: 4px;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
.board-head h2 {
|
|
315
|
+
margin: 0;
|
|
316
|
+
font-size: 16px;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
.board-hint {
|
|
320
|
+
margin: 0;
|
|
321
|
+
font-size: 12.5px;
|
|
322
|
+
line-height: 1.6;
|
|
323
|
+
color: var(--dpk-ink-soft);
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
.board-scroll {
|
|
327
|
+
overflow-x: auto;
|
|
328
|
+
border: 1px solid var(--dpk-rule);
|
|
329
|
+
border-radius: var(--dpk-radius-lg);
|
|
330
|
+
background: var(--dpk-paper-raised);
|
|
331
|
+
box-shadow: var(--dpk-shadow-sm);
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
.board {
|
|
335
|
+
display: grid;
|
|
336
|
+
min-width: 980px;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
.board-row {
|
|
340
|
+
display: grid;
|
|
341
|
+
grid-template-columns: minmax(220px, 2fr) repeat(7, minmax(84px, 1fr)) minmax(132px, 1fr);
|
|
342
|
+
align-items: stretch;
|
|
343
|
+
border-top: 1px solid var(--dpk-rule);
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
.board-row--head {
|
|
347
|
+
border-top: 0;
|
|
348
|
+
font-size: 11.5px;
|
|
349
|
+
color: var(--dpk-ink-soft);
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
.board-row:not(.board-row--head):hover {
|
|
353
|
+
background: color-mix(in srgb, var(--dpk-paper-sunken) 60%, transparent);
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
.board-row--head .cell-name,
|
|
357
|
+
.board-row--head .cell-agree {
|
|
358
|
+
align-content: end;
|
|
359
|
+
font-weight: 600;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
/* Decision area: its name, description, where it stands and its tools. */
|
|
363
|
+
.cell-name {
|
|
364
|
+
display: grid;
|
|
365
|
+
align-content: center;
|
|
366
|
+
gap: 4px;
|
|
367
|
+
padding: 10px 12px;
|
|
368
|
+
min-width: 0;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
.row-title {
|
|
372
|
+
display: flex;
|
|
373
|
+
align-items: flex-start;
|
|
374
|
+
gap: 6px;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
.row-name {
|
|
378
|
+
flex: 1;
|
|
379
|
+
min-width: 0;
|
|
380
|
+
font-size: 13.5px;
|
|
381
|
+
font-weight: 600;
|
|
382
|
+
line-height: 1.4;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
.row-tools {
|
|
386
|
+
display: flex;
|
|
387
|
+
gap: 2px;
|
|
388
|
+
opacity: 0;
|
|
389
|
+
transition: opacity 120ms ease;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
.board-row:hover .row-tools,
|
|
393
|
+
.row-tools:focus-within {
|
|
394
|
+
opacity: 1;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
.row-description {
|
|
398
|
+
margin: 0;
|
|
399
|
+
font-size: 11.5px;
|
|
400
|
+
line-height: 1.5;
|
|
401
|
+
color: var(--dpk-ink-soft);
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
.row-meta {
|
|
405
|
+
display: flex;
|
|
406
|
+
flex-wrap: wrap;
|
|
407
|
+
align-items: center;
|
|
408
|
+
gap: 6px;
|
|
409
|
+
font-size: 11px;
|
|
410
|
+
color: var(--dpk-ink-faint);
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
/* Level columns. */
|
|
414
|
+
.cell {
|
|
415
|
+
display: grid;
|
|
416
|
+
border-left: 1px solid var(--dpk-rule);
|
|
417
|
+
background: color-mix(in srgb, var(--lv) 5%, transparent);
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
.cell--head {
|
|
421
|
+
align-content: end;
|
|
422
|
+
justify-items: center;
|
|
423
|
+
gap: 2px;
|
|
424
|
+
padding: 10px 6px;
|
|
425
|
+
background: color-mix(in srgb, var(--lv) 10%, transparent);
|
|
426
|
+
text-align: center;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
.cell--head b {
|
|
430
|
+
font-size: 16px;
|
|
431
|
+
line-height: 1;
|
|
432
|
+
color: var(--lv);
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
.level-name {
|
|
436
|
+
font-weight: 600;
|
|
437
|
+
color: var(--dpk-ink);
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
.level-phrase {
|
|
441
|
+
font-size: 10.5px;
|
|
442
|
+
line-height: 1.45;
|
|
443
|
+
color: var(--dpk-ink-faint);
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
.cell[data-agreed] {
|
|
447
|
+
background: color-mix(in srgb, var(--lv) 26%, var(--dpk-paper-raised));
|
|
448
|
+
box-shadow: inset 0 0 0 2px var(--lv);
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
/* The whole cell is the button that plays the reader's card at its level. */
|
|
452
|
+
.cell-play {
|
|
453
|
+
display: flex;
|
|
454
|
+
flex-wrap: wrap;
|
|
455
|
+
gap: 3px;
|
|
456
|
+
align-content: center;
|
|
457
|
+
justify-content: center;
|
|
458
|
+
min-height: 56px;
|
|
459
|
+
margin: 0;
|
|
460
|
+
padding: 6px 4px;
|
|
461
|
+
border: 0;
|
|
462
|
+
background: transparent;
|
|
463
|
+
color: inherit;
|
|
464
|
+
font: inherit;
|
|
465
|
+
cursor: pointer;
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
.cell-play:hover {
|
|
469
|
+
background: color-mix(in srgb, var(--lv) 14%, transparent);
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
/* strict mode: the reader's card is final, so the row no longer takes clicks. */
|
|
473
|
+
.cell-play[aria-disabled='true'] {
|
|
474
|
+
cursor: default;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
.cell-play[aria-disabled='true']:hover {
|
|
478
|
+
background: transparent;
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
.cell-play:focus-visible {
|
|
482
|
+
outline: none;
|
|
483
|
+
box-shadow: inset var(--dpk-focus);
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
.chip {
|
|
487
|
+
max-width: 100%;
|
|
488
|
+
padding: 1px 7px;
|
|
489
|
+
overflow: hidden;
|
|
490
|
+
border-radius: 999px;
|
|
491
|
+
background: var(--dpk-paper-raised);
|
|
492
|
+
border: 1px solid color-mix(in srgb, var(--lv) 45%, var(--dpk-rule));
|
|
493
|
+
font-size: 10.5px;
|
|
494
|
+
white-space: nowrap;
|
|
495
|
+
text-overflow: ellipsis;
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
/* A chip with a reason: hover it to read why. */
|
|
499
|
+
.chip[data-reason] {
|
|
500
|
+
text-decoration: underline dotted color-mix(in srgb, var(--dpk-ink-faint) 70%, transparent);
|
|
501
|
+
text-underline-offset: 2px;
|
|
502
|
+
cursor: help;
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
.chip[data-kind='you'] {
|
|
506
|
+
border-color: var(--dpk-accent);
|
|
507
|
+
background: var(--dpk-accent);
|
|
508
|
+
color: var(--dpk-accent-ink);
|
|
509
|
+
font-weight: 600;
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
/* The settled level. */
|
|
513
|
+
.cell-agree {
|
|
514
|
+
display: grid;
|
|
515
|
+
align-content: center;
|
|
516
|
+
padding: 8px 10px;
|
|
517
|
+
border-left: 1px solid var(--dpk-rule);
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
.agree-select {
|
|
521
|
+
width: 100%;
|
|
522
|
+
min-width: 0;
|
|
523
|
+
font-size: 12px;
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
.board-row[data-status='agreed'] .agree-select {
|
|
527
|
+
border-color: color-mix(in srgb, var(--dpk-green) 55%, var(--dpk-rule));
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
.add-decision {
|
|
531
|
+
justify-self: start;
|
|
532
|
+
padding: 8px 14px;
|
|
533
|
+
border: 1px dashed var(--dpk-rule-strong);
|
|
534
|
+
border-radius: var(--dpk-radius);
|
|
535
|
+
background: transparent;
|
|
536
|
+
color: var(--dpk-ink-soft);
|
|
537
|
+
font: inherit;
|
|
538
|
+
cursor: pointer;
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
.add-decision:hover {
|
|
542
|
+
border-color: var(--dpk-accent);
|
|
543
|
+
color: var(--dpk-accent);
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
.add-decision:focus-visible {
|
|
547
|
+
outline: none;
|
|
548
|
+
box-shadow: var(--dpk-focus);
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
/* ------------------------------------------------------------- empty */
|
|
552
|
+
|
|
553
|
+
.empty {
|
|
554
|
+
display: grid;
|
|
555
|
+
gap: 10px;
|
|
556
|
+
max-width: 620px;
|
|
557
|
+
padding: 28px 24px;
|
|
558
|
+
border: 1px dashed var(--dpk-rule-strong);
|
|
559
|
+
border-radius: var(--dpk-radius-lg);
|
|
560
|
+
background: var(--dpk-dots), var(--dpk-paper-sunken);
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
.empty h2 {
|
|
564
|
+
margin: 0;
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
.empty p {
|
|
568
|
+
margin: 0;
|
|
569
|
+
color: var(--dpk-ink-soft);
|
|
570
|
+
line-height: 1.7;
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
.empty .dpk-btn {
|
|
574
|
+
justify-self: start;
|
|
575
|
+
}
|
|
576
|
+
`;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),t=this.#r(a,r),o={context:a,handlers:t,m:r,mode:_(this.mode)},i=a.state.decisions.length===0?Oe(o):Re(o);return{header:Ie(o),main:s`${i}${Me(r,this.pending,this.#t(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:(t,o)=>{const i=a.state.decisions.find(d=>d.id===t);if(i===void 0)return;const n=G(_(this.mode),i,this.skipConfirm);switch(n.kind){case"play":a.dispatch(m.playCard(t,o));return;case"confirm":this.pending={decisionId:t,decisionName:i.name,level:o,skip:!1},this.#e="dialog";return;case"locked":return;default:R(n)}},agree:(t,o)=>{a.dispatch(m.agreeLevel(t,o))},addDecision:()=>{const t=xe("decision",C(a.state));a.dispatch(m.addDecision(t,r.newDecision))},rename:(t,o)=>{a.dispatch(m.setDecisionName(t,o))},deleteDecision:t=>{a.dispatch(m.deleteDecision(t))},comment:t=>this.requestComment(t)}}#t(a){const r=t=>{this.pending=null,this.#e={decisionId:t.decisionId,level:t.level}};return{toggleSkip:t=>{this.pending!==null&&(this.pending={...this.pending,skip:t})},confirm:()=>{const t=this.pending;t!==null&&(t.skip&&(this.#a?.remember(),this.skipConfirm=!0),a.dispatch(m.playCard(t.decisionId,t.level)),r(t))},cancel:()=>{this.pending!==null&&r(this.pending)}}}}const ne=()=>{customElements.get("dpk-template-delegation-poker")||customElements.define("dpk-template-delegation-poker",ie)},je=Object.freeze(Object.defineProperty({__proto__:null,DELEGATION_LEVELS:b,DELEGATION_POKER_PAGE:x,DpkTemplateDelegationPoker:ie,allDelegationPokerIds:C,applyDelegationPokerAction:j,defineDelegationPokerElement:ne,delegationLevelSchema:k,delegationParties:N,delegationPokerAction:m,delegationPokerActions:g,delegationPokerBaseSchema:K,delegationPokerCommentTargets:Z,delegationPokerDefinitionFor:re,delegationPokerHasTarget:ae,delegationPokerMessages:S,delegationPokerTargetLabel:X,delegationPokerTitle:O,describeDelegationPokerAction:W,emptyDelegationPokerBase:M,findDecision:u,findPlayer:V,isLocked:P,parseDelegationPokerBase:F,parsePlayMode:_,playIntent:G,presentBoard:I,resolveDelegationPokerNavigation:ee,serializeDelegationPokerAction:Q},Symbol.toStringTag,{value:"Module"}));export{ne as d,je as i};
|