dev-process-kit 0.0.2 → 0.0.3

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.
Files changed (32) hide show
  1. package/README.md +10 -9
  2. package/dist/chunks/shared-B2K3LoOU.js +1016 -0
  3. package/dist/chunks/{shared-D6UXy-Qw.js → shared-BqW3KAJ4.js} +99 -46
  4. package/dist/chunks/{shared-DZlREPaN.js → shared-Byv6cc0r.js} +480 -238
  5. package/dist/chunks/{shared-D3EKtSkd.js → shared-CKG_SQh5.js} +1 -1
  6. package/dist/chunks/{shared-C4Y4jSXa.js → shared-CPAT0Cgk.js} +4 -2
  7. package/dist/chunks/shared-CwbzACTe.js +1874 -0
  8. package/dist/chunks/{shared-utv1engQ.js → shared-DBDgdVsd.js} +1 -1
  9. package/dist/chunks/shared-DMlMTd3c.js +1018 -0
  10. package/dist/chunks/shared-DaoPCw6-.js +556 -0
  11. package/dist/chunks/shared-DqB_TR20.js +1599 -0
  12. package/dist/chunks/shared-DsVxrO_3.js +609 -0
  13. package/dist/chunks/shared-iQIywbRc.js +676 -0
  14. package/dist/chunks/shared-xrCdgpNS.js +1 -0
  15. package/dist/components.js +1 -1
  16. package/dist/index.js +1 -1
  17. package/dist/templates/event-storming.js +1 -1
  18. package/dist/templates/example-mapping.js +1 -1
  19. package/dist/templates/grill.js +1 -1
  20. package/dist/templates/plain.js +1 -1
  21. package/dist/templates/prototype.js +1 -1
  22. package/dist/templates/slides.js +1 -1
  23. package/dist/templates/task-board.js +1 -0
  24. package/dist/templates/usm.js +1 -1
  25. package/package.json +3 -2
  26. package/dist/chunks/shared-BFAVBf4I.js +0 -1
  27. package/dist/chunks/shared-BXV4Dm_n.js +0 -522
  28. package/dist/chunks/shared-CQlssGTf.js +0 -692
  29. package/dist/chunks/shared-CcD4vDCE.js +0 -1461
  30. package/dist/chunks/shared-D2QreyJq.js +0 -926
  31. package/dist/chunks/shared-OdGbSUTa.js +0 -574
  32. package/dist/chunks/shared-TjJWiz7W.js +0 -546
@@ -1,692 +0,0 @@
1
- import{q as le,ai as se,aa as h,af as f,ag as b,ad as p,ak as C,a9 as de,ac as z,ab as k,al as pe,R as L,_ as ce,V as ge,a2 as l,a3 as ue,a1 as u,a0 as he,T as Q,ay as fe,az as be}from"./shared-CcD4vDCE.js";import{c as F}from"./shared-ml5h7U5L.js";const ke=se("kind",[h({kind:C("option"),optionId:f(p(),b(1))}),h({kind:C("free"),text:p()}),h({kind:C("clear")})]),m={ANSWER_QUESTION:le("ANSWER_QUESTION","question",ke)},N=(r,e)=>({type:"ANSWER_QUESTION",target:{type:"question",id:r},payload:e}),xe=h({id:f(p(),b(1)),label:f(p(),b(1))}),ve=h({id:f(p(),b(1)),ref:k(f(p(),b(1))),title:f(p(),b(1)),description:k(p()),note:k(p()),options:k(z(xe),[]),freeText:k(pe(),!0)}),O=h({title:k(p(),""),questions:z(ve)}),P=r=>{const e=de(O,r),t=new Set,i=e.questions.map((n,o)=>{if(t.has(n.id))throw new Error(`duplicate question id: ${n.id}`);t.add(n.id);const s=new Set;for(const a of n.options){if(s.has(a.id))throw new Error(`duplicate option id: ${a.id} in question ${n.id}`);s.add(a.id)}return{id:n.id,ref:n.ref??`Q${o+1}`,title:n.title,description:n.description??null,note:n.note??null,options:n.options,freeText:n.freeText}});return{title:e.title,questions:i,answers:{}}},G=()=>({title:"",questions:[],answers:{}}),c=(r,e)=>r.questions.find(t=>t.id===e),we=(r,e)=>c(r,e)?.ref??e,R=(r,e)=>{const t=c(r,e);return t?`${t.ref} \xB7 ${t.title}`:e},y=(r,e)=>e?e.kind==="option"?r.options.find(t=>t.id===e.optionId)?.label??"":e.text.trim():"",$=(r,e)=>y(r,e)!=="",_=r=>{let e="";for(let t=r+1;t>0;t=Math.floor((t-1)/26))e=String.fromCharCode(97+(t-1)%26)+e;return e},B=r=>({total:r.questions.length,answered:r.questions.filter(e=>$(e,r.answers[e.id])).length}),T=(r,e,t)=>{const i=r.answers[e];if(t===null){if(i===void 0)return r;const n={...r.answers};return delete n[e],{...r,answers:n}}return i?.kind===t.kind&&(i.kind==="option"&&t.kind==="option"&&i.optionId===t.optionId||i.kind==="free"&&t.kind==="free"&&i.text===t.text)?r:{...r,answers:{...r.answers,[e]:t}}},U=(r,e)=>{if(e.type!=="ANSWER_QUESTION")return null;const t=c(r,e.target.id);if(!t)return null;const i=L(m.ANSWER_QUESTION,e);return i.kind==="clear"?T(r,t.id,null):i.kind==="option"?t.options.some(n=>n.id===i.optionId)?T(r,t.id,{kind:"option",optionId:i.optionId}):null:T(r,t.id,{kind:"free",text:i.text})},x=ce({en:{wholePage:"Whole page",questionGroup:"Question",answerCleared:"Clear answer",answered:"Answer",answeredFreely:"Answer in your own words",quoted:r=>`\u2192 \u201C${r}\u201D`,progress:(r,e)=>`${r} of ${e} answered`,openPanel:"Show questions / review",closePanel:"Hide questions / review",toggleLabel:(r,e)=>`${r} (${e})`,tabs:"Questions / review",questionsTab:"Questions",reviewTab:"Review",copied:"Copied",copyFailed:"Could not copy",copyAll:"Copy answers and review",sending:"Sending\u2026",sent:"Sent to Claude",sendFailed:"Could not send",sendAll:"Send answers and review to Claude",copyDone:"Copied",copy:"Copy",noQuestions:"No matching questions.",freeText:"Your own answer",freeTextOf:r=>`Your own answer to ${r}`,freeTextPlaceholder:"Type an answer\u2026 (\u2318/Ctrl+Enter for next)",clearAnswer:"Clear answer"},ja:{wholePage:"\u30DA\u30FC\u30B8\u5168\u4F53",questionGroup:"\u8CEA\u554F",answerCleared:"\u56DE\u7B54\u3092\u30AF\u30EA\u30A2",answered:"\u56DE\u7B54",answeredFreely:"\u81EA\u7531\u8A18\u8FF0\u3067\u56DE\u7B54",quoted:r=>`\u2192 \u300C${r}\u300D`,progress:(r,e)=>`\u56DE\u7B54\u6E08\u307F ${r} / ${e}`,openPanel:"\u8CEA\u554F / Review \u3092\u3072\u3089\u304F",closePanel:"\u8CEA\u554F / Review \u3092\u305F\u305F\u3080",toggleLabel:(r,e)=>`${r}\uFF08${e}\uFF09`,tabs:"\u8CEA\u554F / Review",questionsTab:"\u8CEA\u554F",reviewTab:"Review",copied:"\u30B3\u30D4\u30FC\u3057\u307E\u3057\u305F",copyFailed:"\u30B3\u30D4\u30FC\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F",copyAll:"\u56DE\u7B54\u30FBReview \u3092\u307E\u3068\u3081\u3066\u30B3\u30D4\u30FC",sending:"\u9001\u4FE1\u4E2D\u2026",sent:"Claude \u306B\u9001\u308A\u307E\u3057\u305F",sendFailed:"\u9001\u308C\u307E\u305B\u3093\u3067\u3057\u305F",sendAll:"\u56DE\u7B54\u30FBReview \u3092 Claude \u306B\u9001\u308B",copyDone:"\u30B3\u30D4\u30FC\u6E08\u307F",copy:"\u30B3\u30D4\u30FC",noQuestions:"\u8A72\u5F53\u3059\u308B\u8CEA\u554F\u306F\u3042\u308A\u307E\u305B\u3093\u3002",freeText:"\u81EA\u7531\u8A18\u8FF0",freeTextOf:r=>`${r} \u306E\u81EA\u7531\u8A18\u8FF0`,freeTextPlaceholder:"\u56DE\u7B54\u3092\u5165\u529B\u2026\uFF08\u2318/Ctrl+Enter \u3067\u6B21\u3078\uFF09",clearAnswer:"\u56DE\u7B54\u3092\u30AF\u30EA\u30A2"}}),M=r=>r.title===""?"Visually Grill":r.title,H=(r,e,t)=>{switch(t.type){case"question":return R(e,t.id);case"page":return r.wholePage;default:return t.id}},me=(r,e,t)=>{const i=L(m.ANSWER_QUESTION,t);if(i.kind==="clear")return{title:r.answerCleared,tone:"delete"};if(i.kind==="option"){const n=c(e,t.target.id)?.options.find(o=>o.id===i.optionId);return{title:r.answered,tone:"update",body:r.quoted(n?.label??i.optionId)}}return{title:r.answeredFreely,tone:"update",body:r.quoted(i.text.slice(0,120))}},W=(r,e,t,i)=>{let n;try{n=me(r,i??t,e)}catch{n={title:e.type,tone:"meta"}}return{title:n.title,targetLabel:H(r,t,e.target),tone:n.tone,...n.body===void 0?{}:{summary:n.body}}},D=r=>`${r.type} ${ge(r.target)} ${JSON.stringify(r.payload)}`,j=(r,e)=>e.questions.map(t=>({value:`question:${t.id}`,label:R(e,t.id),group:r.questionGroup})),V=(r,e)=>{const t=e.question;if(t!==void 0&&c(r,t))return e;const i=r.questions[0];return i===void 0?e:{...e,question:i.id}},Y=(r,e)=>{const t=e.question;return t!==void 0&&c(r,t)?t:r.questions[0]?.id??null},ye=(r,e)=>{const t=r.questions,i=t.findIndex(o=>o.id===e);return(i===-1?t:[...t.slice(i+1),...t.slice(0,i)]).find(o=>!$(o,r.answers[o.id]))?.id??null},$e=(r,e,t)=>{const i=e.answers[r.id];return{id:r.id,ref:r.ref,title:r.title,description:r.description,note:r.note,open:r.id===t,answered:y(r,i)!=="",summary:y(r,i),choices:r.options.map((n,o)=>({id:n.id,letter:_(o),label:n.label,checked:i?.kind==="option"&&i.optionId===n.id})),draft:i?.kind==="free"?i.text:"",freeSelected:i?.kind==="free",allowFreeText:r.freeText}},K=(r,e)=>{const t=Y(r,e);return{questions:r.questions.map(i=>$e(i,r,t))}},J=(r,e)=>{const t=B(e);return{progress:r.progress(t.answered,t.total),answered:t.answered,total:t.total}},X=(r,e)=>{switch(e.type){case"question":return c(r,e.id)!==void 0;case"page":return!0;default:return!1}},Z=r=>{const e=x(r);return{name:"grill",label:"Visually Grill",parseBase:P,emptyBase:G,actions:m,apply:U,hasTarget:X,describe:(t,i,n)=>W(e,t,i,n),serialize:D,resolveNavigation:V,commentTargets:t=>j(e,t),title:M}},v="data-grill-questions",Te=r=>{const e=[r];for(const t of r.querySelectorAll("*"))t.shadowRoot&&e.push(t.shadowRoot);return e},ee=(r,e,t)=>{const i=t.question??e.questions[0]?.id??null,n=new Map(e.questions.map(s=>[s.ref,s])),o=[];for(const s of Te(r))for(const a of s.querySelectorAll(`[${v}]`)){const g=a.getAttribute(v)??"";for(const S of g.split(/\s+/)){if(S==="")continue;const d=n.get(S);d&&o.push({index:o.length,target:a,questionId:d.id,ref:d.ref,title:d.title,answered:$(d,e.answers[d.id]),open:d.id===i})}}return o},te=(r,e)=>{const t=r.getBoundingClientRect(),i=new Map;e.forEach((o,s)=>{const a=r.querySelector(`[data-label="${s}"]`);if(!a)return;const g=i.get(o.target)??[];g.push(a),i.set(o.target,g)});const n=new Map;for(const[o,s]of i){const a=o.getBoundingClientRect(),g=a.width>0||a.height>0,d=n.get(o)??Se(o,r);n.set(o,d);const E=a.bottom>t.top&&a.top<t.bottom&&a.right>t.left&&a.left<t.right,q=a.bottom>d.top&&a.top<d.bottom;s.forEach((w,ne)=>{if(w.dataset.visible=String(g&&E&&q),!g||!E||!q)return;const A=w.offsetWidth,I=w.offsetHeight,oe=a.right-t.left-A+8-(s.length-1-ne)*(A+5),ae=a.top-t.top-I/2;w.style.transform=`translate(${F(oe,0,Math.max(0,r.clientWidth-A))}px, ${F(ae,0,Math.max(0,r.clientHeight-I))}px)`})}},Se=(r,e)=>{const t=r.getRootNode(),i=t instanceof ShadowRoot?t.host:null,n=i?.shadowRoot?.querySelector(".diagram-canvas")??null;return n instanceof Element?n.getBoundingClientRect():i instanceof Element?i.getBoundingClientRect():e.getBoundingClientRect()},Ae=(r,e,t)=>l`
2
- <div class="grill-list">
3
- ${e.questions.length===0?l`<p class="grill-empty">${r.noQuestions}</p>`:ue(e.questions,i=>i.id,i=>Ce(r,i,t))}
4
- </div>
5
- `,Ce=(r,e,t)=>l`
6
- <section class="grill-question" data-question=${e.id} data-answered=${String(e.answered)}>
7
- <button
8
- class="grill-heading"
9
- type="button"
10
- aria-expanded=${e.open?"true":"false"}
11
- aria-controls=${`grill-body-${e.id}`}
12
- @click=${()=>t.open(e.id)}
13
- >
14
- <span class="grill-ref">${e.ref}</span>
15
- <span class="grill-heading-text">
16
- <strong>${e.title}</strong>
17
- ${!e.open&&e.answered?l`<span class="grill-summary">${e.summary}</span>`:u}
18
- </span>
19
- <span class="grill-chevron" aria-hidden="true">${e.open?"\u2212":"+"}</span>
20
- </button>
21
- ${e.open?l`<div class="grill-body" id=${`grill-body-${e.id}`}>
22
- ${e.description?l`<p class="grill-description">${e.description}</p>`:u}
23
- ${e.note?l`<p class="grill-note">${e.note}</p>`:u}
24
- <div class="grill-choices" role="radiogroup" aria-label=${e.title}>
25
- ${e.choices.map(i=>Re(e.id,i,t))}
26
- ${e.allowFreeText?l`<label class="grill-choice grill-choice--free" data-free=${String(e.freeSelected)}>
27
- <input
28
- type="radio"
29
- name=${`grill-${e.id}`}
30
- value="__free"
31
- .checked=${e.freeSelected}
32
- @change=${()=>t.answer(e.id,{kind:"free",text:""})}
33
- />
34
- <span class="grill-choice-text">${r.freeText}</span>
35
- </label>`:u}
36
- </div>
37
- ${e.allowFreeText?l`<textarea
38
- class="dpk-textarea grill-free"
39
- data-free-text=${e.id}
40
- aria-label=${r.freeTextOf(e.ref)}
41
- placeholder=${r.freeTextPlaceholder}
42
- .value=${e.draft}
43
- ?hidden=${!e.freeSelected}
44
- @input=${i=>{const n=i.currentTarget;n instanceof HTMLTextAreaElement&&t.answer(e.id,{kind:"free",text:n.value})}}
45
- @keydown=${i=>{i.isComposing||!(i.metaKey||i.ctrlKey)||i.key!=="Enter"||(i.preventDefault(),t.next(e.id))}}
46
- ></textarea>`:u}
47
- ${e.answered?l`<button
48
- type="button"
49
- class="grill-clear"
50
- @click=${()=>t.answer(e.id,{kind:"clear"})}
51
- >
52
- ${r.clearAnswer}
53
- </button>`:u}
54
- </div>`:u}
55
- </section>
56
- `,Re=(r,e,t)=>l`
57
- <label class="grill-choice" data-choice=${e.id}>
58
- <input
59
- type="radio"
60
- name=${`grill-${r}`}
61
- value=${e.id}
62
- .checked=${e.checked}
63
- @change=${()=>t.answer(r,{kind:"option",optionId:e.id})}
64
- />
65
- <span class="grill-choice-text">
66
- <span class="grill-letter">(${e.letter})</span>
67
- <span>${e.label}</span>
68
- </span>
69
- </label>
70
- `,Ee=he`
71
- .dpk-main {
72
- order: 1;
73
- }
74
-
75
- /* The shell's sidebar becomes a right-hand rail, keeping its width and scroll. */
76
- .dpk-sidebar {
77
- order: 2;
78
- width: 336px;
79
- display: flex;
80
- flex-direction: column;
81
- gap: 0;
82
- padding: 0;
83
- border-right: 0;
84
- border-left: 1px solid var(--dpk-rule);
85
- }
86
-
87
- /* The header reserves room for the corner button, exactly like the review
88
- button in the other templates. */
89
- .grill-panel {
90
- display: flex;
91
- flex-direction: column;
92
- flex: 1;
93
- min-height: 0;
94
- }
95
-
96
- .grill-tab-panel {
97
- display: flex;
98
- flex-direction: column;
99
- flex: 1;
100
- min-height: 0;
101
- overflow: auto;
102
- }
103
-
104
- .grill-tab-panel[hidden],
105
- .dpk-sidebar[hidden] {
106
- display: none;
107
- }
108
-
109
- .grill-tab-panel dpk-component-comment-panel {
110
- flex: 1;
111
- }
112
-
113
- /* ------------------------------------------------------- header control */
114
-
115
- /*
116
- * The one control the reader always needs: the questions. It sits where the
117
- * other templates put their review button, and folds the question column away
118
- * so the diagrams get the width back.
119
- */
120
- .grill-toggle {
121
- position: fixed;
122
- top: 10px;
123
- right: 16px;
124
- z-index: 60;
125
- display: inline-flex;
126
- align-items: center;
127
- justify-content: center;
128
- width: 38px;
129
- height: 38px;
130
- padding: 0;
131
- border: 1px solid var(--dpk-rule-strong);
132
- border-radius: 999px;
133
- background: var(--dpk-paper-raised);
134
- color: var(--dpk-ink-soft);
135
- font-size: 16.5px;
136
- font-weight: 650;
137
- line-height: 1;
138
- box-shadow: var(--dpk-shadow);
139
- cursor: pointer;
140
- transition:
141
- color 160ms ease,
142
- background 160ms ease,
143
- border-color 160ms ease,
144
- box-shadow 160ms ease,
145
- transform 160ms cubic-bezier(0.34, 1.56, 0.64, 1);
146
- }
147
-
148
- .grill-toggle:hover {
149
- color: var(--dpk-ink);
150
- transform: translateY(-2px) scale(1.05);
151
- box-shadow: var(--dpk-shadow-lg);
152
- }
153
-
154
- .grill-toggle:active {
155
- transform: translateY(0) scale(0.97);
156
- box-shadow: var(--dpk-shadow-xs);
157
- }
158
-
159
- .grill-toggle:focus-visible {
160
- outline: none;
161
- box-shadow: var(--dpk-focus);
162
- }
163
-
164
- .grill-toggle[aria-expanded='true'] {
165
- color: var(--dpk-accent-ink);
166
- border-color: transparent;
167
- background: linear-gradient(135deg, var(--dpk-accent), var(--dpk-accent-strong));
168
- box-shadow: 0 2px 8px rgba(217, 73, 32, 0.3);
169
- }
170
-
171
- .grill-toggle-glyph {
172
- display: block;
173
- }
174
-
175
- .grill-toggle-badge {
176
- position: absolute;
177
- top: -5px;
178
- right: -5px;
179
- min-width: 22px;
180
- height: 18px;
181
- padding: 0 5px;
182
- border: 2px solid var(--dpk-paper-raised);
183
- border-radius: 999px;
184
- background: var(--dpk-paper-inset);
185
- color: var(--dpk-ink-faint);
186
- font-family: var(--dpk-mono);
187
- font-size: 9px;
188
- font-weight: 600;
189
- font-variant-numeric: tabular-nums;
190
- line-height: 14px;
191
- /* The widest value is wider than the button it sits on: keep it on one line. */
192
- white-space: nowrap;
193
- text-align: center;
194
- }
195
-
196
- .grill-toggle[aria-expanded='true'] .grill-toggle-badge {
197
- background: var(--dpk-paper-raised);
198
- color: var(--dpk-ink-soft);
199
- }
200
-
201
- /* ------------------------------------------------------------- the list */
202
-
203
- .grill-tabs {
204
- display: flex;
205
- align-items: center;
206
- gap: 2px;
207
- flex-shrink: 0;
208
- padding: 8px 10px;
209
- border-bottom: 1px solid var(--dpk-rule);
210
- background: var(--dpk-paper-raised);
211
- }
212
-
213
- .grill-tabs button {
214
- display: inline-flex;
215
- align-items: center;
216
- gap: 5px;
217
- padding: 5px 9px;
218
- border: 1px solid transparent;
219
- border-radius: var(--dpk-radius-xs);
220
- background: transparent;
221
- color: var(--dpk-ink-faint);
222
- font-size: 11.5px;
223
- cursor: pointer;
224
- }
225
-
226
- .grill-tabs button:hover {
227
- background: var(--dpk-paper-inset);
228
- color: var(--dpk-ink);
229
- }
230
-
231
- .grill-tabs button[aria-selected='true'] {
232
- border-color: var(--dpk-rule-strong);
233
- background: var(--dpk-paper-raised);
234
- color: var(--dpk-ink);
235
- font-weight: 600;
236
- box-shadow: var(--dpk-shadow-xs);
237
- }
238
-
239
- .grill-count {
240
- font-family: var(--dpk-mono);
241
- font-size: 10px;
242
- font-variant-numeric: tabular-nums;
243
- color: var(--dpk-ink-faint);
244
- }
245
-
246
- .grill-list {
247
- flex: 1;
248
- min-height: 0;
249
- overflow: auto;
250
- overscroll-behavior: contain;
251
- padding: 2px 10px 12px;
252
- }
253
-
254
- .grill-empty {
255
- margin: 0;
256
- padding: 22px 8px;
257
- text-align: center;
258
- font-size: 12px;
259
- color: var(--dpk-ink-faint);
260
- }
261
-
262
- .grill-question {
263
- border-bottom: 1px solid var(--dpk-rule);
264
- }
265
-
266
- .grill-question:last-child {
267
- border-bottom: 0;
268
- }
269
-
270
- .grill-heading {
271
- display: flex;
272
- align-items: flex-start;
273
- gap: 9px;
274
- width: 100%;
275
- padding: 11px 6px;
276
- border: 0;
277
- border-radius: var(--dpk-radius-xs);
278
- background: none;
279
- text-align: left;
280
- cursor: pointer;
281
- }
282
-
283
- .grill-heading:hover {
284
- background: var(--dpk-paper-sunken);
285
- }
286
-
287
- .grill-ref {
288
- flex: 0 0 auto;
289
- display: grid;
290
- place-items: center;
291
- min-width: 30px;
292
- height: 22px;
293
- padding: 0 6px;
294
- border: 1px solid var(--dpk-rule-strong);
295
- border-radius: 999px;
296
- font-family: var(--dpk-mono);
297
- font-size: 10px;
298
- font-variant-numeric: tabular-nums;
299
- color: var(--dpk-ink-faint);
300
- }
301
-
302
- .grill-question[data-answered='true'] .grill-ref {
303
- border-color: transparent;
304
- background: var(--dpk-green-soft);
305
- color: var(--dpk-green);
306
- font-weight: 600;
307
- }
308
-
309
- .grill-question:has(.grill-heading[aria-expanded='true']) .grill-ref {
310
- border-color: transparent;
311
- background: var(--dpk-accent-soft);
312
- color: var(--dpk-accent);
313
- font-weight: 600;
314
- }
315
-
316
- .grill-heading-text {
317
- flex: 1;
318
- min-width: 0;
319
- }
320
-
321
- .grill-heading-text strong {
322
- display: block;
323
- font-size: 12.5px;
324
- font-weight: 600;
325
- line-height: 1.6;
326
- }
327
-
328
- .grill-summary {
329
- display: block;
330
- margin-top: 4px;
331
- font-size: 10.5px;
332
- line-height: 1.6;
333
- color: var(--dpk-green);
334
- white-space: nowrap;
335
- overflow: hidden;
336
- text-overflow: ellipsis;
337
- }
338
-
339
- .grill-chevron {
340
- flex: 0 0 auto;
341
- width: 16px;
342
- color: var(--dpk-ink-faint);
343
- font-size: 12px;
344
- line-height: 22px;
345
- text-align: center;
346
- }
347
-
348
- .grill-body {
349
- padding: 0 6px 13px 45px;
350
- }
351
-
352
- .grill-description {
353
- margin: 0 0 8px;
354
- font-size: 11.5px;
355
- line-height: 1.85;
356
- color: var(--dpk-ink-soft);
357
- }
358
-
359
- .grill-note {
360
- margin: 0 0 10px;
361
- padding: 7px 10px;
362
- border-left: 2px solid var(--dpk-amber);
363
- border-radius: 0 var(--dpk-radius-xs) var(--dpk-radius-xs) 0;
364
- background: var(--dpk-amber-soft);
365
- font-size: 11px;
366
- line-height: 1.7;
367
- color: var(--dpk-ink-soft);
368
- }
369
-
370
- .grill-choices {
371
- display: grid;
372
- gap: 6px;
373
- }
374
-
375
- .grill-choice {
376
- display: flex;
377
- align-items: flex-start;
378
- gap: 8px;
379
- padding: 8px 9px;
380
- border: 1px solid var(--dpk-rule);
381
- border-radius: var(--dpk-radius-sm);
382
- background: var(--dpk-paper);
383
- font-size: 11.5px;
384
- line-height: 1.7;
385
- cursor: pointer;
386
- }
387
-
388
- .grill-choice:hover {
389
- border-color: var(--dpk-rule-strong);
390
- }
391
-
392
- .grill-choice:has(input:checked) {
393
- border-color: color-mix(in srgb, var(--dpk-green) 45%, transparent);
394
- background: var(--dpk-green-soft);
395
- }
396
-
397
- .grill-choice input {
398
- flex: 0 0 auto;
399
- margin: 3px 0 0;
400
- accent-color: var(--dpk-green);
401
- }
402
-
403
- .grill-choice-text {
404
- display: flex;
405
- gap: 7px;
406
- min-width: 0;
407
- }
408
-
409
- .grill-letter {
410
- flex: 0 0 auto;
411
- font-family: var(--dpk-mono);
412
- font-size: 10px;
413
- line-height: 1.9;
414
- color: var(--dpk-green);
415
- }
416
-
417
- .grill-free {
418
- margin-top: 7px;
419
- min-height: 76px;
420
- max-height: 240px;
421
- }
422
-
423
- .grill-clear {
424
- margin-top: 10px;
425
- padding: 0;
426
- border: 0;
427
- background: none;
428
- color: var(--dpk-ink-faint);
429
- font-size: 10.5px;
430
- text-decoration: underline;
431
- text-underline-offset: 3px;
432
- cursor: pointer;
433
- }
434
-
435
- .grill-clear:hover {
436
- color: var(--dpk-ink);
437
- }
438
-
439
- .grill-footer {
440
- flex-shrink: 0;
441
- padding: 10px 12px;
442
- border-top: 1px solid var(--dpk-rule);
443
- background: var(--dpk-paper-raised);
444
- }
445
-
446
- .grill-copy {
447
- width: 100%;
448
- }
449
-
450
- /* Inside a Claude Artifact: send is the way, copy the fallback beside it. */
451
- .grill-footer-actions {
452
- display: flex;
453
- gap: 6px;
454
- }
455
-
456
- .grill-send {
457
- flex: 1;
458
- min-width: 0;
459
- }
460
-
461
- .grill-footer-actions .grill-copy {
462
- width: auto;
463
- flex-shrink: 0;
464
- }
465
-
466
- .grill-send[data-status='sent'] {
467
- border-color: transparent;
468
- background: var(--dpk-green);
469
- color: var(--dpk-accent-ink);
470
- }
471
-
472
- .grill-send[data-status='failed'] {
473
- border-color: transparent;
474
- background: var(--dpk-amber);
475
- color: var(--dpk-accent-ink);
476
- }
477
-
478
- .grill-footer-note {
479
- margin: 8px 0 0;
480
- color: var(--dpk-ink-soft);
481
- font-size: 11.5px;
482
- line-height: 1.5;
483
- }
484
-
485
- /* The copy button reports the outcome, so a click is never silent. */
486
- .grill-copy[data-status='copied'] {
487
- border-color: transparent;
488
- background: var(--dpk-green);
489
- color: var(--dpk-accent-ink);
490
- }
491
-
492
- .grill-copy[data-status='copied']:hover:not([disabled]) {
493
- border-color: transparent;
494
- background: color-mix(in srgb, var(--dpk-green) 85%, #000);
495
- }
496
-
497
- .grill-copy[data-status='failed'] {
498
- border-color: transparent;
499
- background: var(--dpk-amber);
500
- color: var(--dpk-accent-ink);
501
- }
502
-
503
- .grill-copy[data-status='failed']:hover:not([disabled]) {
504
- border-color: transparent;
505
- background: color-mix(in srgb, var(--dpk-amber) 85%, #000);
506
- }
507
-
508
- /* Announced to assistive tech; the button label change alone is easy to miss. */
509
- .grill-sr {
510
- position: absolute;
511
- width: 1px;
512
- height: 1px;
513
- margin: -1px;
514
- padding: 0;
515
- overflow: hidden;
516
- clip-path: inset(50%);
517
- white-space: nowrap;
518
- border: 0;
519
- }
520
-
521
- /* -------------------------------------------------- main area and badges */
522
-
523
- .grill-stage {
524
- position: relative;
525
- min-width: 0;
526
- }
527
-
528
- .grill-labels {
529
- position: absolute;
530
- inset: 0;
531
- z-index: 3;
532
- overflow: hidden;
533
- pointer-events: none;
534
- }
535
-
536
- .grill-label {
537
- position: absolute;
538
- display: inline-flex;
539
- align-items: center;
540
- justify-content: center;
541
- min-width: 30px;
542
- height: 22px;
543
- padding: 0 7px;
544
- border: 2px solid var(--dpk-paper-raised);
545
- border-radius: 999px;
546
- background: var(--dpk-accent);
547
- color: var(--dpk-accent-ink);
548
- font-family: var(--dpk-mono);
549
- font-size: 10px;
550
- font-weight: 600;
551
- font-variant-numeric: tabular-nums;
552
- box-shadow: var(--dpk-shadow-xs);
553
- cursor: pointer;
554
- pointer-events: auto;
555
- }
556
-
557
- .grill-label[data-visible='false'] {
558
- visibility: hidden;
559
- }
560
-
561
- .grill-label:hover {
562
- background: color-mix(in srgb, var(--dpk-accent) 80%, #000);
563
- }
564
-
565
- .grill-label[data-answered='true'] {
566
- background: var(--dpk-green);
567
- }
568
-
569
- .grill-label[aria-pressed='true'] {
570
- box-shadow:
571
- 0 0 0 2px color-mix(in srgb, var(--dpk-accent) 45%, transparent),
572
- var(--dpk-shadow-xs);
573
- }
574
-
575
- .grill-label:focus-visible {
576
- outline: none;
577
- box-shadow: var(--dpk-focus);
578
- }
579
- `;class re extends Q{static{this.styles=[Q.styles,Ee]}definitionFor(e){return Z(e)}static{this.properties={tab:{state:!0},folded:{state:!0}}}#o=[];#a=!1;#l=null;#s=null;#r=null;#e="idle";#i=null;#n={kind:"idle"};constructor(){super(),this.tab="questions",this.folded=!1}connectedCallback(){super.connectedCallback(),document.addEventListener("scroll",this.#t,!0),window.addEventListener("resize",this.#t),this.addEventListener("dpk-diagram-view",this.#t)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("scroll",this.#t,!0),window.removeEventListener("resize",this.#t),this.removeEventListener("dpk-diagram-view",this.#t),this.#r?.disconnect(),this.#r=null,this.#d()}renderRegions(e){return this.#o=ee(this,e.state,e.navigation),{header:this.#h(e),main:this.#x(e,this.#o),sidebar:this.#f(e),sidebarHidden:this.folded}}updated(){super.updated(),this.#y(),this.#t(),this.#$();const e=this.#s;e!==null&&(this.#s=null,this.renderRoot.querySelector(`[data-free-text="${e}"]`)?.focus())}get integratedReview(){return!0}requestComment(e){this.tab="review",this.folded=!1,super.requestComment(e)}#p(e,t){this.tab="questions",this.folded=!1,this.#l=null,e.navigate({question:t})}#h(e){const t=x(this.locale),i=J(t,e.state),n=t.toggleLabel(this.folded?t.openPanel:t.closePanel,i.progress);return l`
580
- <button
581
- type="button"
582
- class="grill-toggle"
583
- aria-expanded=${this.folded?"false":"true"}
584
- aria-label=${n}
585
- title=${n}
586
- @click=${()=>this.folded=!this.folded}
587
- >
588
- <span class="grill-toggle-glyph" aria-hidden="true">?</span>
589
- <span class="grill-toggle-badge" aria-hidden="true">${i.answered} / ${i.total}</span>
590
- </button>
591
- `}#f(e){const t=x(this.locale),i=K(e.state,e.navigation);return l`
592
- <div class="grill-panel">
593
- <div class="grill-tabs" role="tablist" aria-label=${t.tabs}>
594
- ${["questions","review"].map(n=>l`
595
- <button
596
- type="button"
597
- role="tab"
598
- id=${`grill-tab-${n}`}
599
- data-tab=${n}
600
- aria-controls=${`grill-panel-${n}`}
601
- aria-selected=${String(this.tab===n)}
602
- tabindex=${this.tab===n?0:-1}
603
- @click=${()=>this.tab=n}
604
- @keydown=${o=>this.#k(o)}
605
- >
606
- ${n==="questions"?t.questionsTab:t.reviewTab}<span class="grill-count"
607
- >${n==="questions"?e.state.questions.length:e.actions.length}</span
608
- >
609
- </button>
610
- `)}
611
- </div>
612
- <div
613
- class="grill-tab-panel"
614
- id="grill-panel-questions"
615
- role="tabpanel"
616
- aria-labelledby="grill-tab-questions"
617
- ?hidden=${this.tab!=="questions"}
618
- >
619
- ${Ae(t,i,{open:n=>this.#p(e,n),answer:(n,o)=>this.#v(n,o),next:n=>this.#c(n)})}
620
- </div>
621
- <div
622
- class="grill-tab-panel"
623
- id="grill-panel-review"
624
- role="tabpanel"
625
- aria-labelledby="grill-tab-review"
626
- ?hidden=${this.tab!=="review"}
627
- >
628
- ${this.renderReviewPanel(e)}
629
- </div>
630
- ${this.#b(e.actions.length===0)}
631
- </div>
632
- `}#b(e){const t=x(this.locale),i=this.#e==="copied"?t.copied:this.#e==="failed"?t.copyFailed:t.copyAll;if(!this.canSendToClaude)return l`
633
- <div class="grill-footer">
634
- <button
635
- class="dpk-btn dpk-btn--accent grill-copy"
636
- type="button"
637
- data-status=${this.#e}
638
- ?disabled=${e}
639
- @click=${()=>{this.#g()}}
640
- >
641
- ${i}
642
- </button>
643
- <span class="grill-sr" role="status">${this.#e==="idle"?"":i}</span>
644
- </div>
645
- `;const n=this.#n,o=n.kind==="pending"?t.sending:n.kind==="sent"?t.sent:n.kind==="failed"?t.sendFailed:t.sendAll,s=n.kind==="failed"?fe(n.reason,this.locale):null,a=s??(n.kind==="sent"?o:this.#e==="idle"?"":i);return l`
646
- <div class="grill-footer">
647
- <div class="grill-footer-actions">
648
- <button
649
- class="dpk-btn dpk-btn--accent grill-send"
650
- type="button"
651
- data-status=${n.kind}
652
- ?disabled=${e||n.kind==="pending"}
653
- @click=${()=>{this.#w()}}
654
- >
655
- ${o}
656
- </button>
657
- <button
658
- class="dpk-btn dpk-btn--ghost grill-copy"
659
- type="button"
660
- data-status=${this.#e}
661
- title=${t.copyAll}
662
- ?disabled=${e}
663
- @click=${()=>{this.#g()}}
664
- >
665
- ${this.#e==="copied"?t.copyDone:t.copy}
666
- </button>
667
- </div>
668
- ${s===null?null:l`<p class="grill-footer-note">${s}</p>`}
669
- <span class="grill-sr" role="status">${a}</span>
670
- </div>
671
- `}#k(e){["ArrowLeft","ArrowRight","Home","End"].includes(e.key)&&(e.preventDefault(),this.tab=e.key==="Home"?"questions":e.key==="End"||this.tab==="questions"?"review":"questions",this.renderRoot.querySelector(`[data-tab="${this.tab}"]`)?.focus())}#x(e,t){return l`
672
- <div class="grill-stage">
673
- <slot name="main"></slot>
674
- <div class="grill-labels">
675
- ${t.map(i=>l`
676
- <button
677
- type="button"
678
- class="grill-label"
679
- data-label=${i.index}
680
- data-answered=${String(i.answered)}
681
- data-visible="false"
682
- aria-pressed=${i.open?"true":"false"}
683
- aria-label=${`${i.ref} \xB7 ${i.title}`}
684
- title=${`${i.ref} \xB7 ${i.title}`}
685
- @click=${()=>this.#p(e,i.questionId)}
686
- >
687
- ${i.ref}
688
- </button>
689
- `)}
690
- </div>
691
- </div>
692
- `}#v(e,t){if(this.dispatch(N(e,t)).ok){if(t.kind==="option"){this.#c(e);return}t.kind==="free"&&t.text===""&&(this.#s=e)}}#c(e){const t=ye(this.derivation.state,e);t!==null&&this.navigate({question:t})}async#g(){const e=this.api.exportBrief(),t=await be(e);this.#d(),this.#e=t?"copied":"failed",this.#u()}async#w(){this.#d(),this.#n={kind:"pending"},this.requestUpdate();const e=await this.sendToClaude();this.#n=e.ok?{kind:"sent"}:{kind:"failed",reason:e.reason},e.ok?this.#u():this.requestUpdate()}#u(){this.requestUpdate(),this.#i=setTimeout(()=>{this.#i=null,this.#e="idle",this.#n={kind:"idle"},this.requestUpdate()},2400)}#d(){this.#i!==null&&clearTimeout(this.#i),this.#i=null,this.#e="idle",this.#n={kind:"idle"}}#m(){this.requestUpdate()}#y(){this.#r?.disconnect(),this.#r??=new MutationObserver(()=>{this.#m(),this.#t()}),this.#r.observe(this,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[v]});for(const e of this.querySelectorAll("*"))e===this||!e.shadowRoot||this.#r.observe(e.shadowRoot,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[v]})}#t=()=>{this.#a||(this.#a=!0,requestAnimationFrame(()=>{this.#a=!1;const e=this.renderRoot.querySelector(".grill-labels");e&&te(e,this.#o)}))};#$(){const e=this.navigation.question??null;if(this.tab!=="questions"||this.folded||e===null||e===this.#l)return;this.#l=e;const t=this.renderRoot.querySelector(`[data-question="${e}"]`);t!==null&&typeof t.scrollIntoView=="function"&&t.scrollIntoView({block:"nearest"})}}const ie=()=>{customElements.get("dpk-template-grill")||customElements.define("dpk-template-grill",re)},qe=Object.freeze(Object.defineProperty({__proto__:null,DpkTemplateGrill:re,GRILL_QUESTIONS_ATTRIBUTE:v,answerCounts:B,answerQuestion:N,answerText:y,applyGrillAction:U,collectLabelBindings:ee,defineGrillElement:ie,describeGrillAction:W,emptyGrillBase:G,findQuestion:c,grillActions:m,grillBaseSchema:O,grillCommentTargets:j,grillDefinitionFor:Z,grillHasTarget:X,grillMessages:x,grillTargetLabel:H,grillTitle:M,isAnswered:$,openQuestionId:Y,optionLetter:_,parseGrillBase:P,positionLabels:te,presentGrillHeader:J,presentGrillPanel:K,questionLabel:R,questionRef:we,resolveGrillNavigation:V,serializeGrillAction:D,withAnswer:T},Symbol.toStringTag,{value:"Module"}));export{ie as d,qe as i};