dev-process-kit 0.4.2 → 0.4.4
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 +1 -0
- package/dist/boards.js +1 -1
- package/dist/chunks/shared-B3ddPOb7.js +1 -0
- package/dist/chunks/shared-BEcs-9nd.js +6077 -0
- package/dist/chunks/{shared-CHQBlCl0.js → shared-BIODquqM.js} +4 -4
- package/dist/chunks/{shared-D2fmf6zb.js → shared-BZ0Y7lDS.js} +41 -41
- package/dist/chunks/{shared-CMWEqwI3.js → shared-BncKaYRX.js} +1 -1
- package/dist/chunks/{shared-D1ZujbZA.js → shared-BqjrIOYm.js} +54 -54
- package/dist/chunks/shared-CaQMHNzp.js +3 -0
- package/dist/chunks/shared-Cd0znWBB.js +3545 -0
- package/dist/chunks/shared-Cuc_13rI.js +7378 -0
- package/dist/chunks/shared-D2yn0bY8.js +1883 -0
- package/dist/chunks/{shared-4JaCIu01.js → shared-D5_ZJTgh.js} +152 -46
- package/dist/chunks/shared-DDIKBRRU.js +1 -0
- package/dist/chunks/{shared-D0_BoWj3.js → shared-DbfVyq_3.js} +18 -18
- package/dist/chunks/{shared-D80rPPNF.js → shared-Dha4GwGq.js} +3 -3
- package/dist/chunks/shared-GVsZCCAa.js +4954 -0
- package/dist/chunks/{shared-C-ujfGnT.js → shared-IlpAgOtF.js} +1 -1
- package/dist/chunks/{shared-SjAP9bK0.js → shared-M5nBQyzE.js} +4 -4
- package/dist/chunks/{shared-DErYmK9C.js → shared-lNnnWUPH.js} +14 -14
- package/dist/components.js +1 -1
- package/dist/index.js +1 -1
- package/dist/sync.js +1 -1
- package/dist/views/delegation-poker.js +1 -1
- package/dist/views/plain.js +1 -1
- package/dist/views/prototype.js +1 -1
- package/dist/views/slides.js +1 -1
- package/dist/views/task-board.js +1 -1
- package/dist/views/usm.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/shared-CJZKj_HI.js +0 -3
- package/dist/chunks/shared-CsLKVrK7.js +0 -6912
- package/dist/chunks/shared-DPD_cXES.js +0 -1883
- package/dist/chunks/shared-HkbNG84_.js +0 -1
- package/dist/chunks/shared-JOvfFoxb.js +0 -3645
- package/dist/chunks/shared-KHA87RsJ.js +0 -3360
- package/dist/chunks/shared-_0Ev6y6i.js +0 -5357
- package/dist/chunks/shared-lVXxL9i3.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{x as se,m as le,q as v,k as E,h as D,C as A,B as l,j as c,v as L,w as S,d as h,o as f,e as ce,p as pe,b as B,f as $}from"./shared-CJZKj_HI.js";import{ap as ue,_ as ge,L as z,aK as me,a0 as ve,$ as he,a5 as p,u as be,ag as s,al as ke,aq as ye,B as fe,aL as $e,a4 as xe,V as q,aM as we,k as Ee}from"./shared-_0Ev6y6i.js";import{o as De}from"./shared-lVXxL9i3.js";const b=[1,2,3,4,5,6,7],k=se(b,"a delegation level is an integer from 1 to 7"),y=L(c(),S(1)),Ae=v({player:y,level:k,reason:l(c())}),M=v({title:l(c()),parties:l(v({delegator:l(y),delegate:l(y)})),players:E(D(v({id:A,name:y})),[]),decisions:E(D(v({id:A,name:y,description:l(c()),cards:E(D(Ae),[]),agreed:l(k),questions:ue})),[])}),V=e=>{const a=le(M,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},K=()=>({players:[],decisions:[]}),u=(e,a)=>{if(a!==void 0)return e.decisions.find(r=>r.id===a)},j=(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:h("PLAY_CARD","decision",v({level:k})),AGREE_LEVEL:h("AGREE_LEVEL","decision",f({level:k})),ADD_DECISION:h("ADD_DECISION","page",f({id:A,name:L(c(),S(1)),description:l(c())}),{dedupeKey:ce}),SET_DECISION_NAME:h("SET_DECISION_NAME","decision",f({name:L(c(),S(1))})),DELETE_DECISION:h("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:{}})},F=(e,a)=>{const r=pe(g,a);if(r===null)return null;const o=r.target.id;switch(r.type){case"PLAY_CARD":return T(e,o,t=>({...t,yours:r.payload.level}));case"AGREE_LEVEL":return T(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:C(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 T(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 B(r)}},T=(e,a,r)=>e.decisions.some(o=>o.id===a)?{...e,decisions:e.decisions.map(o=>o.id===a?r(o):o)}:null,Y={1:"Tell",2:"Sell",3:"Consult",4:"Agree",5:"Advise",6:"Inquire",7:"Delegate"},G={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"},Le={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`},Se={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`},Ce={"to-play":"Your card",discuss:"Discuss",consensus:"Same card",agreed:"Agreed"},Te={"to-play":"\u30AB\u30FC\u30C9\u5F85\u3061",discuss:"\u8981\u8B70\u8AD6",consensus:"\u4E00\u81F4",agreed:"\u5408\u610F\u6E08\u307F"},_=ge({en:{levelName:e=>Y[e],levelPhrase:(e,a,r)=>Le[e](a,r),levelLabel:e=>`${e} ${Y[e]}`,statusLabel:e=>Ce[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=>G[e],levelPhrase:(e,a,r)=>Se[e](a,r),levelLabel:e=>`${e} ${G[e]}`,statusLabel:e=>Te[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"}}),P=e=>e==="strict"?"strict":"lax",N=(e,a)=>e==="strict"&&a.yours!==void 0,H=(e,a,r)=>e==="lax"?{kind:"play"}:N(e,a)?{kind:"locked"}:r?{kind:"play"}:{kind:"confirm"},I=(e,a)=>({delegator:a.parties?.delegator??e.defaultDelegator,delegate:a.parties?.delegate??e.defaultDelegate}),J=e=>e.yours!==void 0||e.agreed!==void 0,_e=(e,a,r)=>[...r.yours===void 0?[]:[{label:e.you,kind:"you",level:r.yours}],...r.cards.map(t=>({label:j(a,t.player)?.name??t.player,kind:"player",level:t.level,...t.reason===void 0?{}:{reason:t.reason}}))],Pe=(e,a)=>e.agreed!==void 0?"agreed":e.yours===void 0?"to-play":a.every(r=>r.level===e.yours)?"consensus":"discuss",Ne=(e,a,r,o)=>{const t=_e(e,a,o),i=J(o)?t:[];return{id:o.id,name:o.name,...o.description===void 0?{}:{description:o.description},status:Pe(o,t),hidden:J(o)?0:o.cards.length,...o.agreed===void 0?{}:{agreed:o.agreed},locked:N(r,o),...me(o.questions),cells:b.map(d=>({level:d,chips:i.filter(n=>n.level===d).map(({level:n,...w})=>w),yours:o.yours===d,agreed:o.agreed===d}))}},O=(e,a,r)=>{const{delegator:o,delegate:t}=I(e,a);return{levels:b.map(i=>({level:i,name:e.levelName(i),label:e.levelLabel(i),phrase:e.levelPhrase(i,o,t)})),rows:a.decisions.map(i=>Ne(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}}},U=(e,a,r)=>{const o=r===void 0?"":e.levelLabel(r);return a===void 0?e.arrowTo(o):e.arrowFrom(e.levelLabel(a),o)},Ie=(e,a,r)=>a===void 0?e.quotedArrowTo(r):e.quotedArrowFrom(a,r),W={PLAY_CARD:(e,a,r)=>{const o=$(g.PLAY_CARD,a);return{title:e.cardPlayedTitle,tone:"update",body:U(e,u(r,a.target.id)?.yours,o.level)}},AGREE_LEVEL:(e,a,r)=>({title:e.levelAgreedTitle,tone:"update",body:U(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:Ie(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)})},Q=(e,a,r,o)=>{let t;try{const i=Object.hasOwn(W,a.type)?W[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:Z(e,r,a.target),tone:t.tone,...t.body===void 0?{}:{summary:t.body}}},X=e=>`${e.type} ${z(e.target)} ${JSON.stringify(e.payload)}`,Z=(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 ${R(a)}`;default:return`${r.type} \xB7 ${r.id}`}},ee=(e,a,r)=>[{value:`page:${x}`,label:e.wholeBoard,group:e.boardKind},...a.decisions.map(o=>({value:z({type:"decision",id:o.id}),label:o.name,group:e.decisionKind}))],R=e=>e.title??"Delegation Poker",ae=(e,a)=>a,re=(e,a)=>{switch(a.type){case"decision":return u(e,a.id)!==void 0;case"page":return a.id===x;default:return!1}},oe=e=>{const a=_(e);return{kind:"view",name:"delegation-poker",label:"Delegation Poker",addable:!1,parseBase:V,emptyBase:K,actions:g,apply:F,hasTarget:re,describe:(r,o,t)=>Q(a,r,o,t),serialize:X,resolveNavigation:ae,commentTargets:(r,o)=>ee(a,r),title:R}},te="dev-process-kit:delegation-poker:skip-strict-confirm",ie=e=>e===!0?!0:null,Oe=e=>{const a=e?ve(ie):he(ie);return{read:()=>a.read(te)===!0,remember:()=>a.write(te,!0)}},Re=(e,a,r,o)=>s`
|
|
1
|
+
import{x as se,m as le,q as v,k as E,h as D,C as A,B as l,j as c,v as L,w as S,d as b,o as f,e as ce,p as pe,b as B,f as $}from"./shared-CaQMHNzp.js";import{ar as ue,a4 as ge,L as z,b1 as me,a6 as ve,a5 as be,a2 as p,u as he,a3 as s,aq as ke,as as ye,B as fe,b2 as $e,a0 as xe,V as q,b3 as we,k as Ee}from"./shared-BEcs-9nd.js";import{o as De}from"./shared-B3ddPOb7.js";const h=[1,2,3,4,5,6,7],k=se(h,"a delegation level is an integer from 1 to 7"),y=L(c(),S(1)),Ae=v({player:y,level:k,reason:l(c())}),M=v({title:l(c()),parties:l(v({delegator:l(y),delegate:l(y)})),players:E(D(v({id:A,name:y})),[]),decisions:E(D(v({id:A,name:y,description:l(c()),cards:E(D(Ae),[]),agreed:l(k),questions:ue})),[])}),V=e=>{const a=le(M,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},K=()=>({players:[],decisions:[]}),u=(e,a)=>{if(a!==void 0)return e.decisions.find(r=>r.id===a)},j=(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:b("PLAY_CARD","decision",v({level:k})),AGREE_LEVEL:b("AGREE_LEVEL","decision",f({level:k})),ADD_DECISION:b("ADD_DECISION","page",f({id:A,name:L(c(),S(1)),description:l(c())}),{dedupeKey:ce}),SET_DECISION_NAME:b("SET_DECISION_NAME","decision",f({name:L(c(),S(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:{}})},F=(e,a)=>{const r=pe(g,a);if(r===null)return null;const o=r.target.id;switch(r.type){case"PLAY_CARD":return T(e,o,t=>({...t,yours:r.payload.level}));case"AGREE_LEVEL":return T(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:C(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 T(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 B(r)}},T=(e,a,r)=>e.decisions.some(o=>o.id===a)?{...e,decisions:e.decisions.map(o=>o.id===a?r(o):o)}:null,Y={1:"Tell",2:"Sell",3:"Consult",4:"Agree",5:"Advise",6:"Inquire",7:"Delegate"},G={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"},Le={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`},Se={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`},Ce={"to-play":"Your card",discuss:"Discuss",consensus:"Same card",agreed:"Agreed"},Te={"to-play":"\u30AB\u30FC\u30C9\u5F85\u3061",discuss:"\u8981\u8B70\u8AD6",consensus:"\u4E00\u81F4",agreed:"\u5408\u610F\u6E08\u307F"},_=ge({en:{levelName:e=>Y[e],levelPhrase:(e,a,r)=>Le[e](a,r),levelLabel:e=>`${e} ${Y[e]}`,statusLabel:e=>Ce[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=>G[e],levelPhrase:(e,a,r)=>Se[e](a,r),levelLabel:e=>`${e} ${G[e]}`,statusLabel:e=>Te[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"}}),P=e=>e==="strict"?"strict":"lax",N=(e,a)=>e==="strict"&&a.yours!==void 0,H=(e,a,r)=>e==="lax"?{kind:"play"}:N(e,a)?{kind:"locked"}:r?{kind:"play"}:{kind:"confirm"},I=(e,a)=>({delegator:a.parties?.delegator??e.defaultDelegator,delegate:a.parties?.delegate??e.defaultDelegate}),J=e=>e.yours!==void 0||e.agreed!==void 0,_e=(e,a,r)=>[...r.yours===void 0?[]:[{label:e.you,kind:"you",level:r.yours}],...r.cards.map(t=>({label:j(a,t.player)?.name??t.player,kind:"player",level:t.level,...t.reason===void 0?{}:{reason:t.reason}}))],Pe=(e,a)=>e.agreed!==void 0?"agreed":e.yours===void 0?"to-play":a.every(r=>r.level===e.yours)?"consensus":"discuss",Ne=(e,a,r,o)=>{const t=_e(e,a,o),i=J(o)?t:[];return{id:o.id,name:o.name,...o.description===void 0?{}:{description:o.description},status:Pe(o,t),hidden:J(o)?0:o.cards.length,...o.agreed===void 0?{}:{agreed:o.agreed},locked:N(r,o),...me(o.questions),cells:h.map(d=>({level:d,chips:i.filter(n=>n.level===d).map(({level:n,...w})=>w),yours:o.yours===d,agreed:o.agreed===d}))}},O=(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=>Ne(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}}},U=(e,a,r)=>{const o=r===void 0?"":e.levelLabel(r);return a===void 0?e.arrowTo(o):e.arrowFrom(e.levelLabel(a),o)},Ie=(e,a,r)=>a===void 0?e.quotedArrowTo(r):e.quotedArrowFrom(a,r),W={PLAY_CARD:(e,a,r)=>{const o=$(g.PLAY_CARD,a);return{title:e.cardPlayedTitle,tone:"update",body:U(e,u(r,a.target.id)?.yours,o.level)}},AGREE_LEVEL:(e,a,r)=>({title:e.levelAgreedTitle,tone:"update",body:U(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:Ie(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)})},Q=(e,a,r,o)=>{let t;try{const i=Object.hasOwn(W,a.type)?W[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:Z(e,r,a.target),tone:t.tone,...t.body===void 0?{}:{summary:t.body}}},X=e=>`${e.type} ${z(e.target)} ${JSON.stringify(e.payload)}`,Z=(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 ${R(a)}`;default:return`${r.type} \xB7 ${r.id}`}},ee=(e,a,r)=>[{value:`page:${x}`,label:e.wholeBoard,group:e.boardKind},...a.decisions.map(o=>({value:z({type:"decision",id:o.id}),label:o.name,group:e.decisionKind}))],R=e=>e.title??"Delegation Poker",ae=(e,a)=>a,re=(e,a)=>{switch(a.type){case"decision":return u(e,a.id)!==void 0;case"page":return a.id===x;default:return!1}},oe=e=>{const a=_(e);return{kind:"view",name:"delegation-poker",label:"Delegation Poker",addable:!1,parseBase:V,emptyBase:K,actions:g,apply:F,hasTarget:re,describe:(r,o,t)=>Q(a,r,o,t),serialize:X,resolveNavigation:ae,commentTargets:(r,o)=>ee(a,r),title:R}},te="dev-process-kit:delegation-poker:skip-strict-confirm",ie=e=>e===!0?!0:null,Oe=e=>{const a=e?ve(ie):be(ie);return{read:()=>a.read(te)===!0,remember:()=>a.write(te,!0)}},Re=(e,a,r,o)=>s`
|
|
2
2
|
<button
|
|
3
3
|
class="dpk-icon-btn"
|
|
4
4
|
type="button"
|
|
@@ -7,7 +7,7 @@ import{x as se,m as le,q as v,k as E,h as D,C as A,B as l,j as c,v as L,w as S,d
|
|
|
7
7
|
title=${a}
|
|
8
8
|
@click=${()=>o.comment(e)}
|
|
9
9
|
>
|
|
10
|
-
${
|
|
10
|
+
${he()} ${r>0?s`<span class="dpk-icon-badge">${r}</span>`:p}
|
|
11
11
|
</button>
|
|
12
12
|
`,Be=e=>{const{context:a,m:r,mode:o}=e,{progress:t}=O(r,a.state,o),{delegator:i,delegate:d}=I(r,a.state);return s`<div class="summary">
|
|
13
13
|
<span class="summary-chip" title=${`${r.partiesLabel}
|
|
@@ -111,7 +111,7 @@ ${i} \u2192 ${d}`}
|
|
|
111
111
|
>${n.label}</span
|
|
112
112
|
>`)}
|
|
113
113
|
</button>
|
|
114
|
-
</div>`},Fe=(e,a,r)=>{const{handlers:o,m:t,agreeSelects:i}=e;return i.get(r.id).render({options:a.map(d=>({value:String(d.level),label:d.label})),value:r.agreed===void 0?"":String(r.agreed),onChange:d=>{const n=
|
|
114
|
+
</div>`},Fe=(e,a,r)=>{const{handlers:o,m:t,agreeSelects:i}=e;return i.get(r.id).render({options:a.map(d=>({value:String(d.level),label:d.label})),value:r.agreed===void 0?"":String(r.agreed),onChange:d=>{const n=h.find(w=>String(w)===d);n!==void 0&&n!==r.agreed&&o.agree(r.id,n)},ariaLabel:t.agreeLabel(r.name),placeholder:t.notAgreed,className:"agree-select"})},Ye=(e,a,r)=>a===null?p:s`<div class="confirm-backdrop" @click=${r.cancel}>
|
|
115
115
|
<div
|
|
116
116
|
class="confirm"
|
|
117
117
|
role="alertdialog"
|
|
@@ -599,4 +599,4 @@ ${i} \u2192 ${d}`}
|
|
|
599
599
|
.empty .dpk-btn {
|
|
600
600
|
justify-self: start;
|
|
601
601
|
}
|
|
602
|
-
`;class de extends q{static{this.styles=[q.styles,Ge]}static{this.properties={mode:{type:String},pending:{state:!0},skipConfirm:{state:!0}}}#a=null;#e=null;#r=new we(this);constructor(){super(),this.mode=null,this.pending=null,this.skipConfirm=!1}connectedCallback(){super.connectedCallback(),this.#a=Oe(this.storage!=="off"&&this.storage!=="memory"),this.skipConfirm=this.#a.read()}definitionFor(a){return oe(a)}renderRegions(a){const r=_(this.locale),o=this.#o(a,r),t={context:a,handlers:o,m:r,mode:P(this.mode),agreeSelects:this.#r},i=a.state.decisions.length===0?ze(t):qe(t);return{header:Be(t),main:s`${i}${Ye(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()}}#o(a,r){return{play:(o,t)=>{const i=a.state.decisions.find(n=>n.id===o);if(i===void 0)return;const d=H(P(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:B(d)}},agree:(o,t)=>{a.dispatch(m.agreeLevel(o,t))},addDecision:()=>{const o=Ee("decision",C(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)}}#t(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 ne=()=>{customElements.get("dpk-view-delegation-poker")||customElements.define("dpk-view-delegation-poker",de)},He=Object.freeze(Object.defineProperty({__proto__:null,DELEGATION_LEVELS:
|
|
602
|
+
`;class de extends q{static{this.styles=[q.styles,Ge]}static{this.properties={mode:{type:String},pending:{state:!0},skipConfirm:{state:!0}}}#a=null;#e=null;#r=new we(this);constructor(){super(),this.mode=null,this.pending=null,this.skipConfirm=!1}connectedCallback(){super.connectedCallback(),this.#a=Oe(this.storage!=="off"&&this.storage!=="memory"),this.skipConfirm=this.#a.read()}definitionFor(a){return oe(a)}renderRegions(a){const r=_(this.locale),o=this.#o(a,r),t={context:a,handlers:o,m:r,mode:P(this.mode),agreeSelects:this.#r},i=a.state.decisions.length===0?ze(t):qe(t);return{header:Be(t),main:s`${i}${Ye(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()}}#o(a,r){return{play:(o,t)=>{const i=a.state.decisions.find(n=>n.id===o);if(i===void 0)return;const d=H(P(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:B(d)}},agree:(o,t)=>{a.dispatch(m.agreeLevel(o,t))},addDecision:()=>{const o=Ee("decision",C(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)}}#t(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 ne=()=>{customElements.get("dpk-view-delegation-poker")||customElements.define("dpk-view-delegation-poker",de)},He=Object.freeze(Object.defineProperty({__proto__:null,DELEGATION_LEVELS:h,DELEGATION_POKER_PAGE:x,DpkViewDelegationPoker:de,allDelegationPokerIds:C,applyDelegationPokerAction:F,defineDelegationPokerElement:ne,delegationLevelSchema:k,delegationParties:I,delegationPokerAction:m,delegationPokerActions:g,delegationPokerBaseSchema:M,delegationPokerCommentTargets:ee,delegationPokerDefinitionFor:oe,delegationPokerHasTarget:re,delegationPokerMessages:_,delegationPokerTargetLabel:Z,delegationPokerTitle:R,describeDelegationPokerAction:Q,emptyDelegationPokerBase:K,findDecision:u,findPlayer:j,isLocked:N,parseDelegationPokerBase:V,parsePlayMode:P,playIntent:H,presentBoard:O,resolveDelegationPokerNavigation:ae,serializeDelegationPokerAction:X},Symbol.toStringTag,{value:"Module"}));export{ne as d,He as i};
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a4 as ee,L as g,C as $,g as te,aq as S,a2 as d,a3 as r,bd as ie,aA as se,aJ as ne,t as T,aG as N,a0 as ae,V as E}from"./shared-BEcs-9nd.js";import{a as oe}from"./shared-BqjrIOYm.js";import{m as re,q,k as p,h as P,j as u,C as de,v as le,w as ce,x as pe,d as ue,o as he}from"./shared-CaQMHNzp.js";const C=["title","section","content"],me=q({id:de,layout:p(pe(C),"content"),title:le(u(),ce(1)),subtitle:p(u(),""),points:p(P(u()),[]),notes:p(u(),"")}),A=q({title:p(u(),""),slides:p(P(me),[])}),z=t=>{const e=re(A,t),i=new Set;for(const s of e.slides){if(i.has(s.id))throw new Error(`duplicate slide id: ${s.id}`);i.add(s.id)}return{title:e.title,slides:e.slides}},D=()=>({title:"",slides:[]}),l=(t,e)=>e===void 0?-1:t.slides.findIndex(i=>i.id===e),L=(t,e)=>t.slides[l(t,e)],c="SET_SLIDE_NOTES",ge=he({notes:u()}),f={[c]:ue(c,"slide",ge)},M={setNotes:(t,e)=>({type:c,target:{type:"slide",id:t},payload:{notes:e}})},O=(t,e)=>{switch(e.type){case c:{if(e.target.type!=="slide")return null;const i=l(t,e.target.id);if(i===-1)return null;const s=f[c].parse(e);if(s===null)return null;const{notes:a}=s.payload;return{...t,slides:t.slides.map((n,o)=>o===i?{...n,notes:a}:n)}}default:return null}},v=ee({en:{wholeDeck:"Whole deck",slideGroup:"Slide",outline:"Slides",previous:"Previous slide",next:"Next slide",position:(t,e)=>`Slide ${t} of ${e}`,present:"Present",presentation:"Presentation",exitPresentation:"Exit presentation",speakerNotes:"Speaker notes",speakerNotesHint:"Only the presenter sees these. They are never projected.",speakerNotesPlaceholder:"What to say on this slide",saveNotes:"Save notes",commentOnSlide:"Comment on this slide",commentPlaceholder:"A question, or what should change (passed to the agent)",addComment:"Add comment",deleteComment:"Delete this comment",fullscreen:"Full screen",fullscreenHint:"\u2190 \u2192 to move \xB7 Esc to leave",noSlidesBefore:"There are no slides yet. Add them to ",noSlidesAfter:" in the base data."},ja:{wholeDeck:"\u30C7\u30C3\u30AD\u5168\u4F53",slideGroup:"\u30B9\u30E9\u30A4\u30C9",outline:"\u30B9\u30E9\u30A4\u30C9",previous:"\u524D\u306E\u30B9\u30E9\u30A4\u30C9",next:"\u6B21\u306E\u30B9\u30E9\u30A4\u30C9",position:(t,e)=>`${e} \u679A\u4E2D ${t} \u679A\u76EE`,present:"\u30D7\u30EC\u30BC\u30F3",presentation:"\u30D7\u30EC\u30BC\u30F3\u8868\u793A",exitPresentation:"\u30D7\u30EC\u30BC\u30F3\u3092\u7D42\u4E86",speakerNotes:"\u30B9\u30D4\u30FC\u30AB\u30FC\u30CE\u30FC\u30C8",speakerNotesHint:"\u767A\u8868\u8005\u3060\u3051\u306B\u898B\u3048\u307E\u3059\u3002\u30B9\u30E9\u30A4\u30C9\u306B\u306F\u6295\u5F71\u3055\u308C\u307E\u305B\u3093\u3002",speakerNotesPlaceholder:"\u3053\u306E\u30B9\u30E9\u30A4\u30C9\u3067\u8A71\u3059\u3053\u3068",saveNotes:"\u30CE\u30FC\u30C8\u3092\u4FDD\u5B58",commentOnSlide:"\u3053\u306E\u30B9\u30E9\u30A4\u30C9\u306B\u30B3\u30E1\u30F3\u30C8",commentPlaceholder:"\u8CEA\u554F\u3084\u3001\u5909\u3048\u3066\u307B\u3057\u3044\u3053\u3068\uFF08Agent \u306B\u6E21\u308B\uFF09",addComment:"\u30B3\u30E1\u30F3\u30C8\u3092\u8FFD\u52A0",deleteComment:"\u3053\u306E\u30B3\u30E1\u30F3\u30C8\u3092\u524A\u9664",fullscreen:"\u5168\u753B\u9762\u8868\u793A",fullscreenHint:"\u2190 \u2192 \u3067\u79FB\u52D5 \xB7 Esc \u3067\u623B\u308B",noSlidesBefore:"\u30B9\u30E9\u30A4\u30C9\u304C\u307E\u3060\u3042\u308A\u307E\u305B\u3093\u3002base data \u306E ",noSlidesAfter:" \u306B\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002"}}),b="present",x="1",m=t=>t[b]===x,j=t=>({[b]:t?x:null}),F=t=>t.title===""?"Slides":t.title,k=(t,e)=>`${e+1}. ${t.title}`,H=(t,e,i)=>{switch(i.type){case"slide":{const s=l(e,i.id),a=e.slides[s];return a===void 0?i.id:k(a,s)}case"page":return t.wholeDeck;default:return i.id}},_=(t,e,i)=>{const s=H(t,i,e.target);return e.type===c?{title:t.speakerNotes,targetLabel:s,tone:"update"}:{title:e.type,targetLabel:s,tone:"meta"}},K=t=>`${t.type} ${g(t.target)} ${JSON.stringify(t.payload)}`,R=(t,e)=>e.slides.map((i,s)=>({value:g({type:"slide",id:i.id}),label:k(i,s),group:t.slideGroup})),B=(t,e,i)=>{const s=l(e,i.slide),a=e.slides[s];return a===void 0?null:{value:g({type:"slide",id:a.id}),label:k(a,s),group:t.slideGroup}},G=(t,e)=>{const i=t.slides[l(t,e.slide)]??t.slides[0],s={...e};return i?s.slide=i.id:delete s.slide,(i===void 0||!m(e))&&delete s[b],s},w=(t,e)=>{const i=l(t,e.slide),s=i===-1?0:i,a=t.slides[s];return a===void 0?null:{slide:a,index:s,total:t.slides.length,previous:t.slides[s-1],next:t.slides[s+1]}},be=(t,e)=>t.filter(i=>i.type===$&&i.target.type==="slide"&&i.target.id===e).map(i=>({id:i.id,body:te(i)})).filter(i=>i.body!==""),I=(t,e)=>{switch(e.type){case"slide":return L(t,e.id)!==void 0;case"page":return!0;default:return!1}},U=t=>{const e=v(t);return{kind:"view",name:"slides",label:"Slides",addable:!1,parseBase:z,emptyBase:D,actions:f,apply:O,hasTarget:I,describe:(i,s)=>_(e,i,s),serialize:K,resolveNavigation:G,navigationFor:(i,s)=>s.type==="slide"?{slide:s.id}:null,commentTargets:i=>R(e,i),currentTarget:(i,s)=>B(e,i,s),title:F}},fe={ArrowRight:"next",PageDown:"next",ArrowLeft:"previous",PageUp:"previous",Home:"first",End:"last"},Y=t=>t.altKey===!0||t.ctrlKey===!0||t.metaKey===!0||t.shiftKey===!0?null:fe[t.key]??null,V=(t,e,i)=>{const s=t.slides.length-1;if(s<0)return;const a=Math.max(l(t,e),0),n={next:Math.min(a+1,s),previous:Math.max(a-1,0),first:0,last:s}[i];return t.slides[n]?.id},ve=(t,e)=>{const{state:i,navigation:s}=t,a=s.slide;return r`
|
|
2
2
|
<nav class="outline" aria-label=${e.outline}>
|
|
3
3
|
<div class="outline-head">
|
|
4
4
|
<span class="dpk-label">${e.outline}</span>
|
|
5
5
|
<span class="dpk-label">${i.slides.length}</span>
|
|
6
6
|
</div>
|
|
7
7
|
<ol class="dpk-navlist outline-list">
|
|
8
|
-
${S(i.slides,
|
|
9
|
-
<li class="outline-row" data-current=${String(h)} data-layout=${
|
|
10
|
-
<a href=${t.hashFor({slide:
|
|
8
|
+
${S(i.slides,n=>n.id,(n,o)=>{const h=n.id===a,y=t.commentCount({type:"slide",id:n.id});return r`
|
|
9
|
+
<li class="outline-row" data-current=${String(h)} data-layout=${n.layout}>
|
|
10
|
+
<a href=${t.hashFor({slide:n.id})} aria-current=${h?"page":d}>
|
|
11
11
|
<span class="outline-index">${String(o+1).padStart(2,"0")}</span>
|
|
12
|
-
<span class="outline-title">${
|
|
12
|
+
<span class="outline-title">${n.title}</span>
|
|
13
13
|
${y>0?r`<span class="outline-note">${y}</span>`:d}
|
|
14
14
|
</a>
|
|
15
15
|
</li>
|
|
16
16
|
`})}
|
|
17
17
|
</ol>
|
|
18
18
|
</nav>
|
|
19
|
-
`},
|
|
19
|
+
`},J=(t,e)=>r`
|
|
20
20
|
<article
|
|
21
21
|
class="slide"
|
|
22
22
|
data-layout=${t.layout}
|
|
@@ -34,18 +34,18 @@ import{_ as X,L as g,C as $,g as ee,al as S,a5 as d,ag as r,aZ as te,aw as ie,aD
|
|
|
34
34
|
</div>
|
|
35
35
|
<span class="slide-number" aria-hidden="true">${e+1}</span>
|
|
36
36
|
</article>
|
|
37
|
-
`,W=(t,e)=>{const i=t.slides.filter(
|
|
38
|
-
${i.map(
|
|
39
|
-
</div>`},
|
|
37
|
+
`,W=(t,e)=>{const i=t.slides.filter(s=>s.id!==e);return i.length===0?d:r`<div class="parked" aria-hidden="true">
|
|
38
|
+
${i.map(s=>r`<slot name=${`preview:${s.id}`}></slot>`)}
|
|
39
|
+
</div>`},Q=(t,e)=>{const{position:i,onStep:s,prefix:a}=e;return r`<div class="${a}-move">
|
|
40
40
|
<button
|
|
41
41
|
class="dpk-icon-btn ${a}-prev"
|
|
42
42
|
type="button"
|
|
43
43
|
aria-label=${t.previous}
|
|
44
44
|
title=${t.previous}
|
|
45
45
|
?disabled=${!i.hasPrevious}
|
|
46
|
-
@click=${()=>
|
|
46
|
+
@click=${()=>s("previous")}
|
|
47
47
|
>
|
|
48
|
-
${
|
|
48
|
+
${ie()}
|
|
49
49
|
</button>
|
|
50
50
|
<span class="deck-counter" role="status" aria-label=${t.position(i.index+1,i.total)}>
|
|
51
51
|
<strong>${i.index+1}</strong> / ${i.total}
|
|
@@ -56,13 +56,13 @@ import{_ as X,L as g,C as $,g as ee,al as S,a5 as d,ag as r,aZ as te,aw as ie,aD
|
|
|
56
56
|
aria-label=${t.next}
|
|
57
57
|
title=${t.next}
|
|
58
58
|
?disabled=${!i.hasNext}
|
|
59
|
-
@click=${()=>
|
|
59
|
+
@click=${()=>s("next")}
|
|
60
60
|
>
|
|
61
|
-
${
|
|
61
|
+
${se()}
|
|
62
62
|
</button>
|
|
63
|
-
</div>`},
|
|
63
|
+
</div>`},xe=(t,e,i,s)=>e?r`<button class="dpk-btn ${s}" type="button" title=${t.fullscreenHint} @click=${i}>
|
|
64
64
|
${ne()} ${t.fullscreen}
|
|
65
|
-
</button>`:d,ke=(t,e,i)=>{const
|
|
65
|
+
</button>`:d,ke=(t,e,i)=>{const s=w(t.state,t.navigation);if(s===null)return d;const{slide:a,index:n,total:o}=s,h=a.notes.trim();return r`
|
|
66
66
|
<div
|
|
67
67
|
class="presentation"
|
|
68
68
|
popover="manual"
|
|
@@ -71,12 +71,12 @@ import{_ as X,L as g,C as $,g as ee,al as S,a5 as d,ag as r,aZ as te,aw as ie,aD
|
|
|
71
71
|
aria-label=${e.presentation}
|
|
72
72
|
tabindex="-1"
|
|
73
73
|
>
|
|
74
|
-
<div class="presentation-stage">${
|
|
74
|
+
<div class="presentation-stage">${J(a,n)}</div>
|
|
75
75
|
<div class="presentation-bar" role="group" aria-label=${e.presentation}>
|
|
76
|
-
${
|
|
77
|
-
${
|
|
76
|
+
${Q(e,{position:{index:n,total:o,hasPrevious:s.previous!==void 0,hasNext:s.next!==void 0},onStep:i.onStep,prefix:"presentation"})}
|
|
77
|
+
${xe(e,i.canFullscreen,i.onFullscreen,"deck-fullscreen")}
|
|
78
78
|
<button class="dpk-btn presentation-exit" type="button" @click=${i.onExit}>
|
|
79
|
-
${
|
|
79
|
+
${T()} ${e.exitPresentation}
|
|
80
80
|
</button>
|
|
81
81
|
</div>
|
|
82
82
|
${h===""?d:r`<aside class="presentation-notes" aria-label=${e.speakerNotes}>
|
|
@@ -85,7 +85,7 @@ import{_ as X,L as g,C as $,g as ee,al as S,a5 as d,ag as r,aZ as te,aw as ie,aD
|
|
|
85
85
|
</aside>`}
|
|
86
86
|
${W(t.state,a.id)}
|
|
87
87
|
</div>
|
|
88
|
-
`},
|
|
88
|
+
`},we=(t,e,i)=>{const s=i.textFor(e),a=s.trim()!==e.notes;return r`<section class="slide-notes" aria-label=${t.speakerNotes}>
|
|
89
89
|
<div class="slide-notes-head">
|
|
90
90
|
<span class="dpk-label">${t.speakerNotes}</span>
|
|
91
91
|
<span class="slide-notes-hint">${t.speakerNotesHint}</span>
|
|
@@ -95,12 +95,12 @@ import{_ as X,L as g,C as $,g as ee,al as S,a5 as d,ag as r,aZ as te,aw as ie,aD
|
|
|
95
95
|
data-dpk-text-key=${`slide:${e.id}`}
|
|
96
96
|
aria-label=${t.speakerNotes}
|
|
97
97
|
placeholder=${t.speakerNotesPlaceholder}
|
|
98
|
-
.value=${
|
|
99
|
-
@input=${
|
|
100
|
-
@keydown=${
|
|
98
|
+
.value=${s}
|
|
99
|
+
@input=${n=>{n.currentTarget instanceof HTMLTextAreaElement&&i.onDraft(e,n.currentTarget.value)}}
|
|
100
|
+
@keydown=${n=>{N(n)==="submit"&&a&&i.onSave(e.id)}}
|
|
101
101
|
></textarea>
|
|
102
102
|
<div class="slide-notes-actions">
|
|
103
|
-
<span class="slide-notes-submit-hint">${
|
|
103
|
+
<span class="slide-notes-submit-hint">${i.submitKey}</span>
|
|
104
104
|
<button
|
|
105
105
|
class="dpk-btn dpk-btn--accent slide-notes-save"
|
|
106
106
|
type="button"
|
|
@@ -110,25 +110,25 @@ import{_ as X,L as g,C as $,g as ee,al as S,a5 as d,ag as r,aZ as te,aw as ie,aD
|
|
|
110
110
|
${t.saveNotes}
|
|
111
111
|
</button>
|
|
112
112
|
</div>
|
|
113
|
-
</section>`},
|
|
113
|
+
</section>`},ye=(t,e,i)=>{const s=w(t.state,t.navigation);if(s===null)return r`<div class="deck">
|
|
114
114
|
<p class="dpk-empty deck-empty">${e.noSlidesBefore}<code>slides</code>${e.noSlidesAfter}</p>
|
|
115
|
-
</div>`;const{slide:a,index:
|
|
115
|
+
</div>`;const{slide:a,index:n,total:o}=s;return r`
|
|
116
116
|
<div class="deck">
|
|
117
|
-
<div class="stage">${
|
|
117
|
+
<div class="stage">${J(a,n)}</div>
|
|
118
118
|
<div class="dpk-toolbar deck-bar">
|
|
119
|
-
${
|
|
119
|
+
${Q(e,{position:{index:n,total:o,hasPrevious:s.previous!==void 0,hasNext:s.next!==void 0},onStep:i.onStep,prefix:"deck"})}
|
|
120
120
|
<div class="deck-progress" aria-hidden="true">
|
|
121
|
-
<span style=${`width:${(
|
|
121
|
+
<span style=${`width:${(n+1)/o*100}%`}></span>
|
|
122
122
|
</div>
|
|
123
123
|
<button class="dpk-btn deck-present" type="button" title=${e.fullscreenHint} @click=${i.onPresent}>
|
|
124
124
|
${e.present}
|
|
125
125
|
</button>
|
|
126
126
|
</div>
|
|
127
|
-
${
|
|
128
|
-
${
|
|
127
|
+
${we(e,a,i.notes)}
|
|
128
|
+
${$e(e,a,be(t.comments,a.id),i)}
|
|
129
129
|
${W(t.state,a.id)}
|
|
130
130
|
</div>
|
|
131
|
-
`}
|
|
131
|
+
`},$e=(t,e,i,s)=>{const a=s.draftFor(e.id),n=a.trim()!=="";return r`
|
|
132
132
|
<section class="slide-comments" aria-label=${t.commentOnSlide}>
|
|
133
133
|
${i.length===0?d:r`<ul class="slide-comment-list">
|
|
134
134
|
${S(i,o=>o.id,o=>r`<li>
|
|
@@ -138,9 +138,9 @@ import{_ as X,L as g,C as $,g as ee,al as S,a5 as d,ag as r,aZ as te,aw as ie,aD
|
|
|
138
138
|
type="button"
|
|
139
139
|
aria-label=${t.deleteComment}
|
|
140
140
|
title=${t.deleteComment}
|
|
141
|
-
@click=${()=>
|
|
141
|
+
@click=${()=>s.onDeleteComment(o.id)}
|
|
142
142
|
>
|
|
143
|
-
${
|
|
143
|
+
${T()}
|
|
144
144
|
</button>
|
|
145
145
|
</li>`)}
|
|
146
146
|
</ul>`}
|
|
@@ -150,23 +150,23 @@ import{_ as X,L as g,C as $,g as ee,al as S,a5 as d,ag as r,aZ as te,aw as ie,aD
|
|
|
150
150
|
aria-label=${t.commentOnSlide}
|
|
151
151
|
placeholder=${t.commentPlaceholder}
|
|
152
152
|
.value=${a}
|
|
153
|
-
@input=${o=>{o.currentTarget instanceof HTMLTextAreaElement&&
|
|
154
|
-
@keydown=${o=>{o
|
|
153
|
+
@input=${o=>{o.currentTarget instanceof HTMLTextAreaElement&&s.onDraft(e.id,o.currentTarget.value)}}
|
|
154
|
+
@keydown=${o=>{N(o)==="submit"&&n&&s.onComment(e.id)}}
|
|
155
155
|
></textarea>
|
|
156
156
|
<div class="slide-comment-actions">
|
|
157
157
|
<button
|
|
158
158
|
class="dpk-btn dpk-btn--accent slide-comment-submit"
|
|
159
159
|
type="button"
|
|
160
|
-
?disabled=${!
|
|
161
|
-
@click=${()=>
|
|
160
|
+
?disabled=${!n}
|
|
161
|
+
@click=${()=>s.onComment(e.id)}
|
|
162
162
|
>
|
|
163
163
|
${t.addComment}
|
|
164
164
|
</button>
|
|
165
|
-
<span class="slide-comment-hint">${
|
|
165
|
+
<span class="slide-comment-hint">${s.submitKey}</span>
|
|
166
166
|
</div>
|
|
167
167
|
</div>
|
|
168
168
|
</section>
|
|
169
|
-
`}
|
|
169
|
+
`},Se=ae`
|
|
170
170
|
/* ------------------------------------------------------------ outline */
|
|
171
171
|
|
|
172
172
|
.outline-head {
|
|
@@ -764,4 +764,4 @@ import{_ as X,L as g,C as $,g as ee,al as S,a5 as d,ag as r,aZ as te,aw as ie,aD
|
|
|
764
764
|
transition: none;
|
|
765
765
|
}
|
|
766
766
|
}
|
|
767
|
-
`,
|
|
767
|
+
`,Te='input, textarea, select, [contenteditable]:not([contenteditable="false"])',Ne=t=>t instanceof HTMLElement&&(t.isContentEditable||t.matches(Te)),Ee=t=>{for(let e=t;e!==null;){if(e.hasAttribute("hidden"))return!1;const i=e.getRootNode();e=e.parentElement??(i instanceof ShadowRoot?i.host:null)}return!0};class X extends E{static{this.styles=[E.styles,oe,Se]}#t=new Map;#e=new Map;#s=!1;#n={slide:"",count:0};definitionFor(e){return U(e)}connectedCallback(){super.connectedCallback(),document.addEventListener("keydown",this.#r)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this.#r)}renderRegions(e){const i=v(this.locale),s=m(e.navigation),a={canFullscreen:document.fullscreenEnabled===!0,draftFor:n=>this.#t.get(n)??"",notes:{textFor:n=>this.#e.get(n.id)??n.notes,onDraft:(n,o)=>this.#p(n,o),onSave:n=>this.#u(n),submitKey:this.textSubmitLabel},onStep:n=>this.#a(n),onPresent:()=>this.#i(!0),onExit:()=>this.#i(!1),onFullscreen:()=>this.#h(),onDraft:(n,o)=>this.#o(n,o),onComment:n=>this.#c(n),onDeleteComment:n=>this.removeAction(n),submitKey:this.textSubmitLabel};return{sidebar:s?d:ve(e,i),sidebarHidden:s||e.state.slides.length===0,main:s?ke(e,i,a):ye(e,i,a)}}updated(){super.updated(),this.#d(),this.#l()}#d(){const e=m(this.navigation);e&&!this.#s&&this.renderRoot.querySelector(".presentation")?.focus(),this.#s=e}#l(){const e=this.renderRoot.querySelector(".slide-comment-list"),i={slide:this.navigation.slide??"",count:e?.childElementCount??0},s=this.#n;this.#n=i,!(e===null||i.slide===s.slide&&i.count<=s.count)&&(e.scrollTop=e.scrollHeight)}#a(e){const i=V(this.derivation.state,this.navigation.slide,e);i!==void 0&&this.navigate({slide:i})}#i(e){this.navigate(j(e))}#o(e,i){const s=new Map(this.#t);i===""?s.delete(e):s.set(e,i),this.#t=s,this.requestUpdate()}#c(e){const i=(this.#t.get(e)??"").trim();if(i==="")return;this.dispatch({type:$,target:{type:"slide",id:e},payload:{body:i}}).ok&&this.#o(e,"")}#p(e,i){const s=new Map(this.#e);i===e.notes?s.delete(e.id):s.set(e.id,i),this.#e=s,this.requestUpdate()}#u(e){const i=(this.#e.get(e)??"").trim();if(!this.dispatch(M.setNotes(e,i)).ok)return;const a=new Map(this.#e);a.delete(e),this.#e=a,this.requestUpdate()}#h(){const e=this.renderRoot.querySelector(".presentation");!(e instanceof HTMLElement)||document.fullscreenElement!==null||e.requestFullscreen().catch(()=>{})}#r=e=>{if(e.defaultPrevented||!Ee(this))return;if(e.key==="Escape"){if(!m(this.navigation)||this.notesOpen||e.isComposing)return;e.preventDefault(),this.#i(!1);return}const i=Y(e);i===null||e.composedPath().some(Ne)||(e.preventDefault(),this.#a(i))}}const Z=()=>{customElements.get("dpk-view-slides")||customElements.define("dpk-view-slides",X)},qe=Object.freeze(Object.defineProperty({__proto__:null,DpkViewSlides:X,PRESENT_KEY:b,PRESENT_ON:x,SET_SLIDE_NOTES:c,SLIDE_LAYOUTS:C,applySlidesAction:O,defineSlidesElement:Z,describeSlidesAction:_,emptySlidesBase:D,findSlide:L,findSlideIndex:l,parseSlidesBase:z,resolveSlidesNavigation:G,serializeSlidesAction:K,slideKeyStep:Y,slidePosition:w,slidesAction:M,slidesActions:f,slidesBaseSchema:A,slidesCommentTargets:R,slidesCurrentTarget:B,slidesDefinitionFor:U,slidesHasTarget:I,slidesMessages:v,slidesPresentation:j,slidesPresenting:m,slidesTargetLabel:H,slidesTitle:F,stepSlide:V},Symbol.toStringTag,{value:"Module"}));export{Z as d,qe as i};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a4 as d,a1 as p,O as f,i as b,a0 as v,aa as m,am as k,a3 as a}from"./shared-BEcs-9nd.js";import{o as g}from"./shared-D4PPk0Dk.js";import{m as y,q as o,k as q,j as l,h as C,v as n,w as r}from"./shared-CaQMHNzp.js";const h=d({en:{fallbackLabel:"Select",required:"Choose one."},ja:{fallbackLabel:"\u9078\u629E",required:"\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044\u3002"}}),S=o({value:n(l(),r(1)),label:n(l(),r(1))}),w=o({options:C(S),value:q(l())}),c=i=>{const e=y(w,i),t=new Set;for(const s of e.options){if(t.has(s.value))throw new Error(`duplicate option value: ${s.value}`);t.add(s.value)}return{options:e.options,value:e.value??null}};class u extends p{static{this.formAssociated=!0}static{this.styles=[f,b,v`
|
|
2
2
|
:host {
|
|
3
3
|
display: inline-block;
|
|
4
4
|
}
|