dev-process-kit 0.0.12 → 0.0.14

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 (36) hide show
  1. package/dist/chunks/{shared-CLnfjHCQ.js → shared-BESRsbtm.js} +1 -1
  2. package/dist/chunks/{shared-DBJaP5gF.js → shared-BFTEmZvI.js} +147 -95
  3. package/dist/chunks/{shared-BwaDMwUS.js → shared-C2gu-y4m.js} +61 -33
  4. package/dist/chunks/{shared-DkkBQzIf.js → shared-CE1P_7xs.js} +199 -168
  5. package/dist/chunks/shared-CGPv8MQ7.js +1049 -0
  6. package/dist/chunks/shared-CTK76mc_.js +2457 -0
  7. package/dist/chunks/{shared-BvuW5NtY.js → shared-CmBhMY6X.js} +14 -3
  8. package/dist/chunks/shared-D4K7KsfJ.js +1 -0
  9. package/dist/chunks/shared-DD-fi15c.js +1104 -0
  10. package/dist/chunks/shared-DUEkF1z7.js +572 -0
  11. package/dist/chunks/{shared-CcrRNZCH.js → shared-Dc_FGuLM.js} +1 -1
  12. package/dist/chunks/shared-DdefS1nG.js +1 -0
  13. package/dist/chunks/{shared-C__W71Hw.js → shared-DjOBIYHF.js} +1 -1
  14. package/dist/chunks/{shared-DYe0OZr-.js → shared-NnvpqsPp.js} +19 -10
  15. package/dist/chunks/shared-rZQ5j0Kh.js +2683 -0
  16. package/dist/chunks/{shared-DUq2-pM9.js → shared-wtt8CCP_.js} +184 -134
  17. package/dist/components.js +1 -1
  18. package/dist/index.js +1 -1
  19. package/dist/templates/delegation-poker.js +1 -1
  20. package/dist/templates/event-storming.js +1 -1
  21. package/dist/templates/example-mapping.js +1 -1
  22. package/dist/templates/grill.js +1 -1
  23. package/dist/templates/plain.js +1 -1
  24. package/dist/templates/prototype.js +1 -1
  25. package/dist/templates/slides.js +1 -1
  26. package/dist/templates/task-board.js +1 -1
  27. package/dist/templates/usm.js +1 -1
  28. package/dist/templates/whiteboard.js +1 -1
  29. package/package.json +1 -1
  30. package/dist/chunks/shared-BC5MlWBY.js +0 -2209
  31. package/dist/chunks/shared-CoDXb-Yj.js +0 -556
  32. package/dist/chunks/shared-D7CMQLaX.js +0 -2323
  33. package/dist/chunks/shared-DhwK_dh_.js +0 -1093
  34. package/dist/chunks/shared-aDPp8Vry.js +0 -1
  35. package/dist/chunks/shared-xrCdgpNS.js +0 -1
  36. package/dist/chunks/shared-y3FwoRgh.js +0 -1017
@@ -1,2323 +0,0 @@
1
- import{ai as x,aK as Er,ad as D,az as _,aA as f,ag as u,ae as N,ah as le,ac as Sr,aL as Ze,aM as Tr,af as V,aj as E,ar as Ir,p as w,at as m,v as ce,ay as te,P as Ar,e as Pr,a0 as _r,h as Qe,N as Ae,V as Y,U as Rr,R as y,a4 as d,a3 as c,aN as Pe,aO as _e,aE as Re,a5 as Dr,z as ue,aD as et,l as Or,aP as O,aQ as Cr,aR as Lr,J as tt,aS as Mr,A as rt,ab as Nr,aa as zr,a2 as Vr,T as it,a1 as Yr,aT as Ur,C as Wr}from"./shared-BC5MlWBY.js";import{p as Br,r as Hr,c as Gr}from"./shared-CcrRNZCH.js";import{P as Fr,c as qr}from"./shared-aDPp8Vry.js";import{i as nt}from"./shared-C__W71Hw.js";const jr=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20"}],["path",{d:"M2 12h20"}]],Kr=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4"}]],Xr=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21"}]],Jr=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z"}]],Zr=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"}],["path",{d:"M21 3v5h-5"}]],Qr=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2"}],["path",{d:"M12 18h.01"}]],ei=[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2"}],["line",{x1:"12",x2:"12.01",y1:"18",y2:"18"}]],ti=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"}],["circle",{cx:"12",cy:"7",r:"4"}]],ot=["browser","native","mail","plain"],st=["mobile","tablet","desktop","fluid"],K=e=>"screen"in e,ri=D({from:f(u()),to:f(u()),cc:f(u()),subject:f(u()),date:f(u())}),ii={id:_,kind:N(le(ot),"browser"),viewport:N(le(st),"fluid"),label:f(u()),url:f(u()),mail:f(ri)},De=x(D(ii),Er(e=>e.mail===void 0||e.kind==="mail",'a preview `mail` envelope needs `"kind": "mail"`')),at=Ir([D({screen:_,preview:f(_)}),D({material:De})]),ni=D({id:_,name:x(u(),E(1)),description:f(u()),actor:f(x(u(),E(1))),situation:f(x(u(),E(1))),panes:N(V(at),[])}),oi=D({id:_,name:x(u(),E(1)),description:f(u()),actor:f(x(u(),E(1))),steps:N(V(ni),[])}),si=D({id:_,name:x(u(),E(1)),description:f(u()),actor:f(x(u(),E(1))),stories:N(V(oi),[])}),ai=D({id:_,title:x(u(),E(1)),description:f(u()),previews:N(V(De),[])}),di=D({id:_,name:x(u(),E(1)),description:f(u()),actor:f(x(u(),E(1))),screens:N(V(ai),[])}),dt=D({title:f(u()),baseUrl:f(u()),apps:N(V(di),[]),activities:N(V(si),[])}),pt=e=>e.flatMap(t=>K(t)?[]:[t.material]),pi=e=>{const t=new Set,r=s=>{for(const a of s){if(t.has(a.id))return`duplicate preview id "${a.id}": preview ids are global, they name a light DOM slot`;t.add(a.id)}return null},i=new Set,n=new Set;for(const s of e.apps){if(i.has(s.id))return`duplicate app id "${s.id}"`;i.add(s.id);for(const a of s.screens){if(n.has(a.id))return`duplicate screen id "${a.id}": screen ids are global`;n.add(a.id);const p=r(a.previews);if(p!==null)return p}}const o=new Set;for(const s of e.activities){if(o.has(s.id))return`duplicate activity id "${s.id}"`;o.add(s.id);const a=new Set;for(const p of s.stories){if(a.has(p.id))return`duplicate story id "${p.id}" in activity "${s.id}"`;a.add(p.id);const l=new Set;for(const b of p.steps){if(l.has(b.id))return`duplicate step id "${b.id}" in story "${p.id}"`;l.add(b.id);const h=r(pt(b.panes));if(h!==null)return h}}}return null},lt=(e,t)=>{const r=new Map;for(const i of t.panes){if(!K(i))continue;const n=e(i.screen);if(n===void 0)return`unknown screen "${i.screen}" on step "${t.id}": declare it under \`apps[].screens\``;if(i.preview!==void 0&&!n.includes(i.preview))return`preview "${i.preview}" on step "${t.id}" is not a rendition of screen "${i.screen}"`;const o=r.get(i.screen)??[];if(o.length>0&&(i.preview===void 0||o.includes(i.preview)||o.includes(void 0)))return`screen "${i.screen}" is shown twice on step "${t.id}": give each pane a different \`preview\``;r.set(i.screen,[...o,i.preview])}return null},li=e=>{const t=new Map(e.apps.flatMap(r=>r.screens.map(i=>[i.id,i.previews.map(n=>n.id)])));for(const r of e.activities.flatMap(i=>i.stories.flatMap(n=>n.steps))){const i=lt(n=>t.get(n),r);if(i!==null)return i}return null},ci=(e,t)=>lt(r=>C(e,r)?.screen.previews.map(i=>i.id),t),re="ui",ct=e=>{const t=e.text?.replaceAll('"',"'");return`${e.previewId}/${e.selector}${t===void 0?"":` "${t}"`}`},Oe=e=>{const t=e.indexOf("/");if(t<=0)return;const r=e.slice(0,t);if(!Tr(_,r))return;const i=e.slice(t+1),n=/ "([^"]*)"$/.exec(i),o=(n?i.slice(0,n.index):i).trim();if(o!=="")return n?.[1]===void 0?{previewId:r,selector:o}:{previewId:r,selector:o,text:n[1]}},ut=e=>{const t=Sr(dt,e),r=pi(t)??li(t);if(r!==null)throw new Error(r);return t},ht=()=>({apps:[],activities:[]}),U=e=>e.apps.flatMap(t=>t.screens.map(r=>({app:t,screen:r}))),C=(e,t)=>{if(t!==void 0)return U(e).find(r=>r.screen.id===t)},he=(e,t)=>t.panes.flatMap(r=>{const i=K(r)?C(e,r.screen):void 0;return i?[i]:[]}),X=e=>pt(e.panes),ui=(e,t)=>e.panes.some(r=>K(r)&&r.screen===t),L=(e,t)=>{if(t!==void 0)return e.activities.find(r=>r.id===t)},M=(e,t)=>`${e}.${t}`,$=(e,t)=>{if(t===void 0)return;const r=Ze(t,2);if(r){const[n,o]=r;if(n===void 0||o===void 0)return;const s=e.activities.find(p=>p.id===n),a=s?.stories.find(p=>p.id===o);return s&&a?{activity:s,story:a}:void 0}if(t.includes("."))return;const i=e.activities.flatMap(n=>n.stories.filter(o=>o.id===t).map(o=>({activity:n,story:o})));return i.length===1?i[0]:void 0},vt=e=>{const t=e.lastIndexOf(".");return t>=0?e.slice(t+1):e},ve=e=>`${e.activity.id}.${e.story.id}.${e.step.id}`,fe=(e,t,r)=>`${e.id}.${t.id}.${r.id}`,k=(e,t)=>{if(t===void 0)return;const r=Ze(t,3);if(r){const[n,o,s]=r;if(n===void 0||o===void 0||s===void 0)return;const a=e.activities.find(h=>h.id===n),p=a?.stories.find(h=>h.id===o),l=p?p.steps.findIndex(h=>h.id===s):-1,b=p&&l>=0?p.steps[l]:void 0;return a&&p&&b?{activity:a,story:p,step:b,stepIndex:l}:void 0}if(t.includes("."))return;const i=W(e).filter(n=>n.step.id===t);return i.length===1?i[0]:void 0},I=(e,t)=>{if(t!==void 0){for(const r of U(e)){const i=r.screen.previews.find(n=>n.id===t);if(i)return{owner:{kind:"screen",...r},preview:i}}for(const r of W(e)){const i=X(r.step).find(n=>n.id===t);if(i)return{owner:{kind:"step",...r},preview:i}}}},W=e=>e.activities.flatMap(t=>t.stories.flatMap(r=>r.steps.map((i,n)=>({activity:t,story:r,step:i,stepIndex:n})))),ft=e=>W(e).map(t=>t.step.id),g={SET_ACTIVITY_NAME:w("SET_ACTIVITY_NAME","activity",m({name:x(u(),E(1))})),SET_ACTIVITY_DESCRIPTION:w("SET_ACTIVITY_DESCRIPTION","activity",m({description:u()})),SET_STORY_NAME:w("SET_STORY_NAME","story",m({name:x(u(),E(1))})),SET_STORY_DESCRIPTION:w("SET_STORY_DESCRIPTION","story",m({description:u()})),SET_STEP_NAME:w("SET_STEP_NAME","step",m({name:x(u(),E(1))})),SET_STEP_DESCRIPTION:w("SET_STEP_DESCRIPTION","step",m({description:u()})),SET_PREVIEW_KIND:w("SET_PREVIEW_KIND","preview",m({kind:le(ot)})),SET_PREVIEW_VIEWPORT:w("SET_PREVIEW_VIEWPORT","preview",m({viewport:le(st)})),SET_PREVIEW_LABEL:w("SET_PREVIEW_LABEL","preview",m({label:u()})),REORDER_ACTIVITY:w("REORDER_ACTIVITY","activity",m({after:te(u())}),{mode:"sequence"}),REORDER_STORY:w("REORDER_STORY","story",m({after:te(u())}),{mode:"sequence"}),REORDER_STEP:w("REORDER_STEP","step",m({after:te(u())}),{mode:"sequence"}),MOVE_STORY:w("MOVE_STORY","story",m({toActivity:x(u(),E(1)),after:te(u())}),{mode:"sequence"}),MOVE_STEP:w("MOVE_STEP","step",m({toStory:x(u(),E(1)),after:te(u())}),{mode:"sequence"}),ADD_ACTIVITY:w("ADD_ACTIVITY","page",m({id:_,name:x(u(),E(1)),description:f(u())}),{dedupeKey:ce}),ADD_STORY:w("ADD_STORY","activity",m({id:_,name:x(u(),E(1)),description:f(u())}),{dedupeKey:ce}),ADD_STEP:w("ADD_STEP","story",m({id:_,name:x(u(),E(1)),description:f(u()),panes:f(V(at))}),{dedupeKey:ce}),ADD_PREVIEW:w("ADD_PREVIEW","step",De,{dedupeKey:ce}),DELETE_ACTIVITY:w("DELETE_ACTIVITY","activity",m({})),DELETE_STORY:w("DELETE_STORY","story",m({})),DELETE_STEP:w("DELETE_STEP","step",m({})),DELETE_PREVIEW:w("DELETE_PREVIEW","preview",m({}))},ie={setActivityName:(e,t)=>({type:"SET_ACTIVITY_NAME",target:{type:"activity",id:e},payload:{name:t}}),setActivityDescription:(e,t)=>({type:"SET_ACTIVITY_DESCRIPTION",target:{type:"activity",id:e},payload:{description:t}}),setStoryName:(e,t)=>({type:"SET_STORY_NAME",target:{type:"story",id:e},payload:{name:t}}),setStoryDescription:(e,t)=>({type:"SET_STORY_DESCRIPTION",target:{type:"story",id:e},payload:{description:t}}),setStepName:(e,t)=>({type:"SET_STEP_NAME",target:{type:"step",id:e},payload:{name:t}}),setStepDescription:(e,t)=>({type:"SET_STEP_DESCRIPTION",target:{type:"step",id:e},payload:{description:t}}),setPreviewViewport:(e,t)=>({type:"SET_PREVIEW_VIEWPORT",target:{type:"preview",id:e},payload:{viewport:t}}),setPreviewKind:(e,t)=>({type:"SET_PREVIEW_KIND",target:{type:"preview",id:e},payload:{kind:t}}),setPreviewLabel:(e,t)=>({type:"SET_PREVIEW_LABEL",target:{type:"preview",id:e},payload:{label:t}}),reorderActivity:(e,t)=>({type:"REORDER_ACTIVITY",target:{type:"activity",id:e},payload:{after:t}}),reorderStory:(e,t)=>({type:"REORDER_STORY",target:{type:"story",id:e},payload:{after:t}}),reorderStep:(e,t)=>({type:"REORDER_STEP",target:{type:"step",id:e},payload:{after:t}}),moveStep:(e,t,r)=>({type:"MOVE_STEP",target:{type:"step",id:e},payload:{toStory:t,after:r}}),moveStory:(e,t,r)=>({type:"MOVE_STORY",target:{type:"story",id:e},payload:{toActivity:t,after:r}}),addActivity:(e,t,r)=>({type:"ADD_ACTIVITY",target:{type:"page",id:"prototype"},payload:{id:e,name:t,...r===void 0?{}:{description:r}}}),addStory:(e,t,r,i)=>({type:"ADD_STORY",target:{type:"activity",id:e},payload:{id:t,name:r,...i===void 0?{}:{description:i}}}),addStep:(e,t,r,i)=>({type:"ADD_STEP",target:{type:"story",id:e},payload:{id:t,name:r,...i===void 0?{}:{panes:i}}}),addPreview:(e,t)=>({type:"ADD_PREVIEW",target:{type:"step",id:e},payload:{...t}}),deleteActivity:e=>({type:"DELETE_ACTIVITY",target:{type:"activity",id:e},payload:{}}),deleteStory:e=>({type:"DELETE_STORY",target:{type:"story",id:e},payload:{}}),deleteStep:e=>({type:"DELETE_STEP",target:{type:"step",id:e},payload:{}}),deletePreview:e=>({type:"DELETE_PREVIEW",target:{type:"preview",id:e},payload:{}})},gt=(e,t)=>{const r=Ar(g,t);if(r===null)return null;const i=r.target.id;switch(r.type){case"SET_ACTIVITY_NAME":return B(e,i,n=>({...n,name:r.payload.name}));case"SET_ACTIVITY_DESCRIPTION":return B(e,i,n=>({...n,description:r.payload.description}));case"SET_STORY_NAME":return H(e,i,n=>({...n,name:r.payload.name}));case"SET_STORY_DESCRIPTION":return H(e,i,n=>({...n,description:r.payload.description}));case"SET_STEP_NAME":return ge(e,i,n=>({...n,name:r.payload.name}));case"SET_STEP_DESCRIPTION":return ge(e,i,n=>({...n,description:r.payload.description}));case"SET_PREVIEW_KIND":return Le(e,i,n=>({...n,kind:r.payload.kind}));case"SET_PREVIEW_VIEWPORT":return Le(e,i,n=>({...n,viewport:r.payload.viewport}));case"SET_PREVIEW_LABEL":return Le(e,i,n=>({...n,label:r.payload.label}));case"REORDER_ACTIVITY":{const{after:n}=r.payload,o=ne(e.activities,i,n);return o===null?null:{...e,activities:o}}case"REORDER_STORY":{const{after:n}=r.payload,o=$(e,i);if(!o)return null;const s=n===null?null:$(e,n);if(n!==null&&(!s||s.activity!==o.activity))return null;const a=ne(o.activity.stories,o.story.id,s?.story.id??null);return a===null?null:B(e,o.activity.id,p=>({...p,stories:a}))}case"REORDER_STEP":{const{after:n}=r.payload,o=k(e,i);if(!o)return null;const s=n===null?null:k(e,n);if(n!==null&&(!s||s.story!==o.story))return null;const a=ne(o.story.steps,o.step.id,s?.step.id??null);return a===null?null:H(e,M(o.activity.id,o.story.id),p=>({...p,steps:a}))}case"MOVE_STORY":{const{toActivity:n,after:o}=r.payload,s=$(e,i);if(!s)return null;const a=e.activities.find(h=>h.id===n);if(!a)return null;const p=o===null?null:$(e,o);if(o!==null&&(!p||p.activity!==a))return null;const l=p?.story.id??null;if(s.activity.id===n){const h=ne(s.activity.stories,s.story.id,l);return h===null?null:B(e,n,v=>({...v,stories:h}))}if(a.stories.some(h=>h.id===s.story.id))return null;const b=Me(a.stories,s.story,l);return Ce(e,h=>h.id===s.activity.id?{...h,stories:h.stories.filter(v=>v.id!==vt(i))}:h.id===n?{...h,stories:b}:h)}case"MOVE_STEP":{const{toStory:n,after:o}=r.payload,s=k(e,i);if(!s)return null;const a=$(e,n);if(!a)return null;const p=o===null?null:k(e,o);if(o!==null&&(!p||p.story!==a.story))return null;const l=p?.step.id??null;if(s.story===a.story){const h=ne(s.story.steps,s.step.id,l);return h===null?null:H(e,n,v=>({...v,steps:h}))}if(a.story.steps.some(h=>h.id===s.step.id))return null;const b=Me(a.story.steps,s.step,l);return Ce(e,h=>({...h,stories:h.stories.map(v=>v===s.story?{...v,steps:v.steps.filter(A=>A.id!==vt(i))}:v===a.story?{...v,steps:b}:v)}))}case"ADD_ACTIVITY":{const n=r.payload;if(e.activities.some(s=>s.id===n.id))return e;const o={id:n.id,name:n.name,...n.description===void 0?{}:{description:n.description},stories:[]};return{...e,activities:[...e.activities,o]}}case"ADD_STORY":{const n=r.payload,o=e.activities.find(a=>a.id===i);if(!o)return null;if(o.stories.some(a=>a.id===n.id))return e;const s={id:n.id,name:n.name,...n.description===void 0?{}:{description:n.description},steps:[]};return B(e,i,a=>({...a,stories:[...a.stories,s]}))}case"ADD_STEP":{const n=r.payload,o=$(e,i)?.story;if(!o)return null;if(o.steps.some(p=>p.id===n.id))return e;const s=n.panes??[],a={id:n.id,name:n.name,...n.description===void 0?{}:{description:n.description},panes:s};return hi(e,a)?H(e,i,p=>({...p,steps:[...p.steps,a]})):null}case"ADD_PREVIEW":{const n=r.payload,o=k(e,i)?.step;return o?X(o).some(s=>s.id===n.id)?e:I(e,n.id)?null:ge(e,i,s=>({...s,panes:[...s.panes,{material:n}]})):null}case"DELETE_ACTIVITY":{const n=i;return e.activities.some(o=>o.id===n)?{...e,activities:e.activities.filter(o=>o.id!==n)}:null}case"DELETE_STORY":{const n=$(e,i);return n?B(e,n.activity.id,o=>({...o,stories:o.stories.filter(s=>s.id!==n.story.id)})):null}case"DELETE_STEP":{const n=k(e,i);return n?H(e,M(n.activity.id,n.story.id),o=>({...o,steps:o.steps.filter(s=>s.id!==n.step.id)})):null}case"DELETE_PREVIEW":{const n=I(e,i);return n?bt(e,n.owner,o=>o.filter(s=>s.id!==n.preview.id)):null}default:return Pr(r)}},Ce=(e,t)=>({...e,activities:e.activities.map(t)}),B=(e,t,r)=>{const i=t;return e.activities.some(n=>n.id===i)?Ce(e,n=>n.id===i?r(n):n):null},H=(e,t,r)=>{const i=$(e,t);if(!i)return null;const n=i.story.id;return B(e,i.activity.id,o=>({...o,stories:o.stories.map(s=>s.id===n?r(s):s)}))},ge=(e,t,r)=>{const i=k(e,t);if(!i)return null;const n=i.step.id;return H(e,M(i.activity.id,i.story.id),o=>({...o,steps:o.steps.map(s=>s.id===n?r(s):s)}))},Le=(e,t,r)=>{const i=I(e,t);if(!i)return null;const n=i.preview.id;return bt(e,i.owner,o=>o.map(s=>s.id===n?r(s):s))},hi=(e,t)=>{const r=X(t).map(i=>i.id);return ci(e,t)===null&&new Set(r).size===r.length&&!r.some(i=>I(e,i))},bt=(e,t,r)=>{if(t.kind==="step")return ge(e,ve(t),n=>{const o=new Map(r([...X(n)]).map(s=>[s.id,s]));return{...n,panes:n.panes.flatMap(s=>{if(K(s))return[s];const a=o.get(s.material.id);return a?[{material:a}]:[]})}});const i=t.screen.id;return{...e,apps:e.apps.map(n=>n.id===t.app.id?{...n,screens:n.screens.map(o=>o.id===i?{...o,previews:r(o.previews)}:o)}:n)}},ne=(e,t,r)=>{const i=e.findIndex(s=>s.id===t);if(i<0||r!==null&&!e.some(s=>s.id===r))return null;if(t===r)return[...e];const n=e[i];if(n===void 0)return null;const o=e.filter(s=>s.id!==t);return Me(o,n,r)},Me=(e,t,r)=>{const i=[...e],n=r===null?-1:i.findIndex(o=>o.id===r);return i.splice(n+1,0,t),i},wt={"iphone-se":"iPhone SE","iphone-16":"iPhone 16","iphone-16-pro-max":"iPhone 16 Pro Max","pixel-7":"Pixel 7","galaxy-s24":"Galaxy S24","ipad-mini":"iPad mini","ipad-air-11":'iPad Air 11"',"ipad-pro-11":'iPad Pro 11"',"ipad-pro-13":'iPad Pro 13"'},vi={"laptop-13":'13" laptop',"laptop-15":'15" laptop',"full-hd":"Full HD","monitor-27":'27" monitor',ultrawide:"Ultrawide"},fi={"laptop-13":"13 \u30A4\u30F3\u30C1 \u30CE\u30FC\u30C8","laptop-15":"15 \u30A4\u30F3\u30C1 \u30CE\u30FC\u30C8","full-hd":"\u30D5\u30EB HD","monitor-27":"27 \u30A4\u30F3\u30C1 \u30E2\u30CB\u30BF\u30FC",ultrawide:"\u30A6\u30EB\u30C8\u30E9\u30EF\u30A4\u30C9"},be=_r({en:{renameActivity:"Rename Activity",updateActivityDescription:"Update Activity description",renameStory:"Rename UserStory",updateStoryDescription:"Update UserStory description",renameStep:"Rename Step",updateStepDescription:"Update Step description",changePreviewKind:"Change Preview kind",changePreviewViewport:"Change Preview viewport",changePreviewLabel:"Change Preview label",moveStory:"Move UserStory",moveStep:"Move Step",deleteTitle:"Delete",reorderTitle:e=>`Reorder ${e}`,addTitle:e=>`Add ${e}`,toFront:"\u2192 To the front",afterName:e=>`\u2192 Right after "${e}"`,unknownTarget:"(unknown target)",activityGroup:"Activity",storyGroup:"UserStory",stepGroup:"Step",screenGroup:"Screen",openInApp:"Open this screen in the app view",previewGroup:"Preview",pageGroup:"Page",uiGroup:"UI",targetLabel:(e,t)=>`${e} \xB7 ${t}`,targetMissing:(e,t)=>`${e} \xB7 ${t} (missing)`,noActivityBefore:"There are no Activities yet. Add ",noActivityAfter:" to the base JSON, or ask the agent.",deleteStepAria:"Delete step",addStepButton:"+ Step",stepNameLabel:"Step name",descriptionLabel:"Description",descriptionPlaceholder:"What happens in this Step (click to edit)",newStepName:"New step",viewLabel:"View",viewScenario:"Scenario",viewApp:"App",viewScenarioHint:"Follow one user story step by step",viewAppHint:"Use the UI as one app, whatever the scenario",appScreens:"Screens",appScreensHint:"Pick a screen to start from, then move around through the UI itself.",appSelectLabel:"App",appOutsideBrowser:"Outside the browser",noStepBefore:"There are no Steps yet. A Prototype has the meaning structure ",noStepAfter:" \u2014 one Step is one moment of the story: the screen the user is on and what they have at hand. Add a Step to the base JSON, and its screen will appear here.",noScreens:"This product has no screens yet. Declare its apps and their screens under apps[].screens in the base JSON, and they will appear here.",noPreviewMetadata:"No preview metadata \u2014 ask the agent to add it.",storyWithoutSteps:"This UserStory has no Steps yet, so there is no screen to show. Add one with + Step, or ask the agent to prototype it.",pageActor:e=>`Used by ${e}`,maximize:"Maximize",restore:"Restore size",maximizeHint:"Show the preview alone across the tab \xB7 Esc to restore",situation:"Situation",uiComment:"Comment on UI",uiCommentHint:"Click any part of the preview to comment on it \xB7 Esc to finish",uiCommentPin:(e,t)=>`Comment ${e}: ${t}`,mailFrom:"From",mailTo:"To",mailCc:"Cc",mailDate:"Date",demo:"Demo",demoHint:"Use the app in a browser across the tab, with nothing else on screen \xB7 Esc to finish",exitDemo:"Exit demo",browserBack:"Back",browserForward:"Forward",browserReload:"Reload",browserAddress:"Address",browserTabs:"Tabs",newTab:"New tab",closeTab:"Close tab",browserProfile:e=>`Profile: ${e}`,browserGuest:"Guest",newTabShortcuts:"Pages of this app",unreachableTitle:"This site can\u2019t be reached",unreachableBody:"No page of the prototype has this address.",device:"Device",deviceHint:"The window the app runs in: a page taller than it scrolls inside, as on the device",deviceName:e=>wt[e]??vi[e]??e,deviceZoom:e=>`Shown at ${e}% to fit`},ja:{renameActivity:"Activity \u540D\u3092\u5909\u66F4",updateActivityDescription:"Activity \u306E\u8AAC\u660E\u3092\u66F4\u65B0",renameStory:"UserStory \u540D\u3092\u5909\u66F4",updateStoryDescription:"UserStory \u306E\u8AAC\u660E\u3092\u66F4\u65B0",renameStep:"Step \u540D\u3092\u5909\u66F4",updateStepDescription:"Step \u306E\u8AAC\u660E\u3092\u66F4\u65B0",changePreviewKind:"Preview \u306E\u7A2E\u5225\u3092\u5909\u66F4",changePreviewViewport:"Preview \u306E\u30D3\u30E5\u30FC\u30DD\u30FC\u30C8\u3092\u5909\u66F4",changePreviewLabel:"Preview \u306E\u30E9\u30D9\u30EB\u3092\u5909\u66F4",moveStory:"UserStory \u3092\u79FB\u52D5",moveStep:"Step \u3092\u79FB\u52D5",deleteTitle:"\u524A\u9664",reorderTitle:e=>`${e} \u306E\u9806\u5E8F\u3092\u5909\u66F4`,addTitle:e=>`${e} \u3092\u8FFD\u52A0`,toFront:"\u2192 \u5148\u982D\u3078",afterName:e=>`\u2192 "${e}" \u306E\u76F4\u5F8C\u3078`,unknownTarget:"(unknown target)",activityGroup:"Activity",storyGroup:"UserStory",stepGroup:"Step",screenGroup:"\u753B\u9762",openInApp:"\u3053\u306E\u753B\u9762\u3092\u30A2\u30D7\u30EA\u30D3\u30E5\u30FC\u3067\u958B\u304F",previewGroup:"Preview",pageGroup:"Page",uiGroup:"UI",targetLabel:(e,t)=>`${e} \xB7 ${t}`,targetMissing:(e,t)=>`${e} \xB7 ${t} (missing)`,noActivityBefore:"Activity \u304C\u307E\u3060\u3042\u308A\u307E\u305B\u3093\u3002base JSON \u306E ",noActivityAfter:" \u3092\u8FFD\u52A0\u3059\u308B\u304B\u3001Agent \u306B\u4F9D\u983C\u3057\u3066\u304F\u3060\u3055\u3044\u3002",deleteStepAria:"\u30B9\u30C6\u30C3\u30D7\u3092\u524A\u9664",addStepButton:"+ Step",stepNameLabel:"Step \u540D",descriptionLabel:"\u8AAC\u660E",descriptionPlaceholder:"\u3053\u306E Step \u3067\u4F55\u304C\u8D77\u304D\u308B\u304B\uFF08\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u7DE8\u96C6\uFF09",newStepName:"\u65B0\u3057\u3044\u30B9\u30C6\u30C3\u30D7",viewLabel:"\u8868\u793A",viewScenario:"\u30B7\u30CA\u30EA\u30AA",viewApp:"\u30A2\u30D7\u30EA",viewScenarioHint:"\u30E6\u30FC\u30B6\u30FC\u30B9\u30C8\u30FC\u30EA\u30FC\u306B\u6CBF\u3063\u3066 Step \u3092\u9806\u306B\u305F\u3069\u308B",viewAppHint:"\u30B7\u30CA\u30EA\u30AA\u306B\u95A2\u4FC2\u306A\u304F\u3001UI \u3092 1 \u3064\u306E\u30A2\u30D7\u30EA\u3068\u3057\u3066\u89E6\u308B",appScreens:"\u753B\u9762",appScreensHint:"\u8D77\u70B9\u306B\u3059\u308B\u753B\u9762\u3092\u9078\u3073\u3001\u3042\u3068\u306F UI \u306E\u30EA\u30F3\u30AF\u3067\u79FB\u52D5\u3057\u307E\u3059\u3002",appSelectLabel:"\u30A2\u30D7\u30EA",appOutsideBrowser:"\u30D6\u30E9\u30A6\u30B6\u4EE5\u5916",noStepBefore:"Step \u304C\u307E\u3060\u3042\u308A\u307E\u305B\u3093\u3002Prototype \u306F ",noStepAfter:" \u306E\u610F\u5473\u69CB\u9020\u3092\u6301\u3061\u30011 Step = \u30B7\u30CA\u30EA\u30AA\u306E 1 \u5834\u9762\uFF08\u30E6\u30FC\u30B6\u30FC\u304C\u3044\u308B\u753B\u9762\u3068\u3001\u624B\u5143\u306B\u3042\u308B\u3082\u306E\uFF09\u3067\u3059\u3002base JSON \u306B Step \u3092\u8FFD\u52A0\u3059\u308B\u3068\u3001\u3053\u3053\u306B\u305D\u306E\u753B\u9762\u304C\u73FE\u308C\u307E\u3059\u3002",noScreens:"\u3053\u306E\u30D7\u30ED\u30C0\u30AF\u30C8\u306B\u306F\u307E\u3060\u753B\u9762\u304C\u3042\u308A\u307E\u305B\u3093\u3002base JSON \u306E apps[].screens \u306B\u30A2\u30D7\u30EA\u3068\u753B\u9762\u3092\u5BA3\u8A00\u3059\u308B\u3068\u3001\u3053\u3053\u306B\u73FE\u308C\u307E\u3059\u3002",noPreviewMetadata:"preview metadata \u304C\u3042\u308A\u307E\u305B\u3093 \u2014 \u8FFD\u52A0\u306F Agent \u306B\u4F9D\u983C\u3057\u3066\u304F\u3060\u3055\u3044",storyWithoutSteps:"\u3053\u306E UserStory \u306B\u306F\u307E\u3060 Step \u304C\u306A\u304F\u3001\u898B\u305B\u308B\u753B\u9762\u304C\u3042\u308A\u307E\u305B\u3093\u3002+ Step \u3067\u8FFD\u52A0\u3059\u308B\u304B\u3001Agent \u306B\u30D7\u30ED\u30C8\u30BF\u30A4\u30D7\u3092\u4F9D\u983C\u3057\u3066\u304F\u3060\u3055\u3044\u3002",pageActor:e=>`\u5229\u7528\u8005: ${e}`,maximize:"\u6700\u5927\u5316",restore:"\u5143\u306E\u30B5\u30A4\u30BA\u306B\u623B\u3059",maximizeHint:"\u30D7\u30EC\u30D3\u30E5\u30FC\u3060\u3051\u3092\u30BF\u30D6\u3044\u3063\u3071\u3044\u306B\u8868\u793A \xB7 Esc \u3067\u623B\u308B",situation:"\u72B6\u6CC1",uiComment:"UI \u306B\u30B3\u30E1\u30F3\u30C8",uiCommentHint:"\u30D7\u30EC\u30D3\u30E5\u30FC\u306E\u8981\u7D20\u3092\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u30B3\u30E1\u30F3\u30C8 \xB7 Esc \u3067\u7D42\u4E86",uiCommentPin:(e,t)=>`\u30B3\u30E1\u30F3\u30C8 ${e}: ${t}`,mailFrom:"\u5DEE\u51FA\u4EBA",mailTo:"\u5B9B\u5148",mailCc:"Cc",mailDate:"\u65E5\u6642",demo:"\u30C7\u30E2",demoHint:"\u307B\u304B\u306B\u4F55\u3082\u51FA\u3055\u305A\u3001\u30BF\u30D6\u3044\u3063\u3071\u3044\u306E\u30D6\u30E9\u30A6\u30B6\u3067\u30A2\u30D7\u30EA\u3092\u89E6\u308B \xB7 Esc \u3067\u7D42\u4E86",exitDemo:"\u30C7\u30E2\u3092\u7D42\u4E86",browserBack:"\u623B\u308B",browserForward:"\u9032\u3080",browserReload:"\u518D\u8AAD\u307F\u8FBC\u307F",browserAddress:"\u30A2\u30C9\u30EC\u30B9",browserTabs:"\u30BF\u30D6",newTab:"\u65B0\u3057\u3044\u30BF\u30D6",closeTab:"\u30BF\u30D6\u3092\u9589\u3058\u308B",browserProfile:e=>`\u30D7\u30ED\u30D5\u30A3\u30FC\u30EB: ${e}`,browserGuest:"\u30B2\u30B9\u30C8",newTabShortcuts:"\u3053\u306E\u30A2\u30D7\u30EA\u306E\u30DA\u30FC\u30B8",unreachableTitle:"\u3053\u306E\u30B5\u30A4\u30C8\u306B\u30A2\u30AF\u30BB\u30B9\u3067\u304D\u307E\u305B\u3093",unreachableBody:"\u30D7\u30ED\u30C8\u30BF\u30A4\u30D7\u306B\u3053\u306E\u30A2\u30C9\u30EC\u30B9\u306E\u30DA\u30FC\u30B8\u306F\u3042\u308A\u307E\u305B\u3093\u3002",device:"\u30C7\u30D0\u30A4\u30B9",deviceHint:"\u30A2\u30D7\u30EA\u3092\u52D5\u304B\u3059\u753B\u9762\u306E\u5927\u304D\u3055\u3002\u53CE\u307E\u3089\u306A\u3044\u30DA\u30FC\u30B8\u306F\u5B9F\u6A5F\u3068\u540C\u3058\u304F\u753B\u9762\u306E\u4E2D\u3067\u30B9\u30AF\u30ED\u30FC\u30EB\u3059\u308B",deviceName:e=>wt[e]??fi[e]??e,deviceZoom:e=>`\u53CE\u307E\u308B\u3088\u3046 ${e}% \u3067\u8868\u793A`}}),gi=["scenario","app"],G="view",oe=e=>e[G]==="app"?"app":"scenario",mt=e=>({[G]:e==="app"?"app":null}),se=(e,t)=>e===void 0?`\u2192 "${t}"`:`"${e}" \u2192 "${t}"`,bi=e=>({SET_ACTIVITY_NAME:(t,r)=>({title:e.renameActivity,tone:"update",body:se(L(r,t.target.id)?.name,y(g.SET_ACTIVITY_NAME,t).name)}),SET_ACTIVITY_DESCRIPTION:(t,r)=>({title:e.updateActivityDescription,tone:"update",body:Ne(L(r,t.target.id)?.description,y(g.SET_ACTIVITY_DESCRIPTION,t).description)}),SET_STORY_NAME:(t,r)=>({title:e.renameStory,tone:"update",body:se($(r,t.target.id)?.story.name,y(g.SET_STORY_NAME,t).name)}),SET_STORY_DESCRIPTION:(t,r)=>({title:e.updateStoryDescription,tone:"update",body:Ne($(r,t.target.id)?.story.description,y(g.SET_STORY_DESCRIPTION,t).description)}),SET_STEP_NAME:(t,r)=>({title:e.renameStep,tone:"update",body:se(k(r,t.target.id)?.step.name,y(g.SET_STEP_NAME,t).name)}),SET_STEP_DESCRIPTION:(t,r)=>({title:e.updateStepDescription,tone:"update",body:Ne(k(r,t.target.id)?.step.description,y(g.SET_STEP_DESCRIPTION,t).description)}),SET_PREVIEW_KIND:(t,r)=>({title:e.changePreviewKind,tone:"update",body:se(I(r,t.target.id)?.preview.kind,y(g.SET_PREVIEW_KIND,t).kind)}),SET_PREVIEW_VIEWPORT:(t,r)=>({title:e.changePreviewViewport,tone:"update",body:se(I(r,t.target.id)?.preview.viewport,y(g.SET_PREVIEW_VIEWPORT,t).viewport)}),SET_PREVIEW_LABEL:t=>({title:e.changePreviewLabel,tone:"update",body:`\u2192 "${y(g.SET_PREVIEW_LABEL,t).label}"`}),REORDER_ACTIVITY:t=>ze(e,e.activityGroup,y(g.REORDER_ACTIVITY,t).after),REORDER_STORY:t=>ze(e,e.storyGroup,y(g.REORDER_STORY,t).after),REORDER_STEP:t=>ze(e,e.stepGroup,y(g.REORDER_STEP,t).after),MOVE_STORY:(t,r)=>({title:e.moveStory,tone:"move",body:`\u2192 ${L(r,y(g.MOVE_STORY,t).toActivity)?.name??y(g.MOVE_STORY,t).toActivity}`}),MOVE_STEP:(t,r)=>({title:e.moveStep,tone:"move",body:`\u2192 ${$(r,y(g.MOVE_STEP,t).toStory)?.story.name??y(g.MOVE_STEP,t).toStory}`}),ADD_ACTIVITY:t=>we(e,e.activityGroup,y(g.ADD_ACTIVITY,t).name),ADD_STORY:t=>we(e,e.storyGroup,y(g.ADD_STORY,t).name),ADD_STEP:t=>we(e,e.stepGroup,y(g.ADD_STEP,t).name),ADD_PREVIEW:t=>we(e,e.previewGroup,y(g.ADD_PREVIEW,t).label??y(g.ADD_PREVIEW,t).id),DELETE_ACTIVITY:(t,r)=>me(e,L(r,t.target.id)?.name),DELETE_STORY:(t,r)=>me(e,$(r,t.target.id)?.story.name),DELETE_STEP:(t,r)=>me(e,k(r,t.target.id)?.step.name),DELETE_PREVIEW:(t,r)=>me(e,I(r,t.target.id)?.preview.label)}),Ne=(e,t)=>{const r=t.length>90?`${t.slice(0,90)}\u2026`:t;return e===void 0||e===""?`\u2192 "${r}"`:`"${wi(e)}" \u2192 "${r}"`},wi=e=>e.length>60?`${e.slice(0,60)}\u2026`:e,ze=(e,t,r)=>({title:e.reorderTitle(t),tone:"move",body:r===null?e.toFront:e.afterName(r)}),we=(e,t,r)=>({title:e.addTitle(t),tone:"create",body:`+ "${r}"`}),me=(e,t)=>({title:e.deleteTitle,tone:"delete",body:t===void 0?e.unknownTarget:`\u2212 "${t}"`}),yt=(e,t,r,i)=>{const n=bi(e),o=Object.hasOwn(n,t.type)?n[t.type]:void 0,s=o?o(t,i??r):{title:t.type,tone:"meta"};return{title:s.title,targetLabel:xt(e,r,t.target),tone:s.tone,...s.body===void 0?{}:{summary:s.body}}},kt=e=>`${e.type} ${Y(e.target)} ${JSON.stringify(e.payload)}`,xt=(e,t,r)=>{switch(r.type){case"activity":{const i=L(t,r.id);return i?e.targetLabel(e.activityGroup,i.name):e.targetMissing(e.activityGroup,r.id)}case"story":{const i=$(t,r.id)?.story;return i?e.targetLabel(e.storyGroup,i.name):e.targetMissing(e.storyGroup,r.id)}case"step":{const i=k(t,r.id)?.step;return i?e.targetLabel(e.stepGroup,i.name):e.targetMissing(e.stepGroup,r.id)}case"screen":{const i=C(t,r.id)?.screen;return i?e.targetLabel(e.screenGroup,i.title):e.targetMissing(e.screenGroup,r.id)}case"preview":{const i=I(t,r.id)?.preview;return i?e.targetLabel(e.previewGroup,i.label??i.id):e.targetMissing(e.previewGroup,r.id)}case"page":return e.targetLabel(e.pageGroup,Ue(t));case re:{const i=Oe(r.id),n=i?I(t,i.previewId)?.preview:void 0;return i&&n?e.targetLabel(e.uiGroup,$t(n,i)):e.targetMissing(e.uiGroup,r.id)}default:return e.targetLabel(r.type,r.id)}},$t=(e,t)=>{const r=t.text===void 0?t.selector:`"${t.text}"`;return`${e.label??e.id} \u203A ${r}`},Et=(e,t)=>{const r=[];for(const i of e){if(i.target.type!==re)continue;const n=Oe(i.target.id);!n||!t.includes(n.previewId)||r.push({id:i.id,previewId:n.previewId,selector:n.selector,number:r.length+1,body:Qe(i)})}return r},St=(e,t)=>Et(e,t).length,mi=/^[a-z][a-z0-9+.-]*:/i,yi=e=>{const t=e.baseUrl?.trim(),r=Rr(e.title??"");return`${(t?t.startsWith("http")?t:`https://${t}`:`https://${r==="item"?"page":r}.example.com`).replace(/\/+$/,"")}/`},ye=(e,t)=>{const r=yi(e);if(!t.url)return`${r}${t.id}`;if(mi.test(t.url))return t.url;try{return decodeURI(new URL(t.url,r).href)}catch{return t.url}},Ve=",",Tt=e=>e.preview?.split(Ve)??[],ki=(e,t)=>e.kind===t.kind&&e.viewport===t.viewport,It=(e,t,r)=>{const i=t.find(o=>r.includes(o.id));if(i)return i;const n=r.flatMap(o=>I(e,o)?.preview??[]);return t.find(o=>n.some(s=>ki(o,s)))??t[0]},At=(e,t,r,i)=>{const n=t.screen.previews,o=r===void 0?It(e,n,Tt(i)):n.find(a=>a.id===r);if(!o)return;const s=r===void 0&&n.length>1;return{kind:"screen",screen:t,preview:o,pinned:r!==void 0,tabs:s?n:[]}},Pt=e=>({layout:e.length>1?"side-by-side":"single",panes:e,shown:e.map(t=>t.preview)}),_t=(e,t,r)=>t.panes.flatMap(i=>{if(!K(i))return[{kind:"material",preview:i.material}];const n=C(e,i.screen),o=n&&At(e,n,i.preview,r);return o?[o]:[]}),Ye=(e,t,r)=>{if(t.kind==="screen"){const i=At(e,t,void 0,r);return Pt(i?[i]:[])}return Pt(_t(e,t.step,r))},xi=(e,t)=>e.panes.flatMap(r=>r.kind!=="screen"||r.tabs.length===0?[]:[r.tabs.some(i=>i.id===t)?t:r.preview.id]).join(Ve),$i=(e,t)=>[...X(t),...he(e,t).flatMap(r=>r.screen.previews)],Ei=["activity","story","step","screen","preview"],Si=(e,t,r)=>{switch(t){case"activity":return L(e,r)!==void 0;case"story":return $(e,r)!==void 0||e.activities.some(i=>i.stories.some(n=>n.id===r));case"step":return k(e,r)!==void 0||W(e).some(i=>i.step.id===r);case"screen":return C(e,r)!==void 0;case"preview":return I(e,r)!==void 0;default:return!1}},Ti=(e,t)=>{let r;if(t.navigate!==null)r=t.navigate.includes("=")?t.navigate:`step=${t.navigate}`;else{const o=t.href?.trim()??"";if(o===""||o==="#"||o.toLowerCase().startsWith("javascript:"))return"no-destination";if(!o.startsWith("#"))return null;r=o}const i=Ae(r),n=Ei.filter(o=>i[o]!==void 0);return n.length===0?t.navigate===null?null:"unknown-target":n.every(o=>Si(e,o,i[o]??""))?null:"unknown-target"},Ii=(e,t)=>{const r=t.mail??{},i=[{label:e.mailFrom,value:r.from},{label:e.mailTo,value:r.to},{label:e.mailCc,value:r.cc},{label:e.mailDate,value:r.date}].flatMap(s=>s.value===void 0||s.value.trim()===""?[]:[{label:s.label,value:s.value}]),n=r.from?.replace(/<[^>]*>/g,"").replace(/["']/g,"").trim()||r.from?.trim(),o=n?Array.from(n)[0]?.toUpperCase():void 0;return{...r.subject===void 0||r.subject.trim()===""?{}:{subject:r.subject},...n?{sender:n}:{},...o===void 0?{}:{initial:o},rows:i}},Rt=(e,t)=>{const r=[];for(const i of t.activities){r.push({value:Y({type:"activity",id:i.id}),label:i.name,group:e.activityGroup});for(const n of i.stories){r.push({value:Y({type:"story",id:M(i.id,n.id)}),label:`${i.name} \u203A ${n.name}`,group:e.storyGroup});for(const o of n.steps)r.push({value:Y({type:"step",id:fe(i,n,o)}),label:`${n.name} \u203A ${o.name}`,group:e.stepGroup})}}for(const{app:i,screen:n}of U(t))r.push({value:Y({type:"screen",id:n.id}),label:`${i.name} \u203A ${n.title}`,group:e.screenGroup});return r},Ai=(e,t,r)=>{const i=J(t,r);if(i?.kind==="screen"){const{screen:n}=i;return{value:Y({type:"screen",id:n.id}),label:n.title,group:e.screenGroup}}return i?.kind!=="step"?null:{value:Y({type:"step",id:ve(i)}),label:i.step.name,group:e.stepGroup}},J=(e,t)=>{if(oe(t)==="app"){const o=C(e,t.screen);return o?{kind:"screen",...o}:void 0}const r=k(e,t.step);if(r)return{kind:"step",...r};const i=L(e,t.activity),n=i?.stories.find(o=>o.id===t.story||M(i.id,o.id)===t.story);return i&&n?{kind:"story",activity:i,story:n}:void 0},Dt=(e,t)=>{const r=(p,l)=>l===void 0?{title:p}:{actor:l,title:p};if(t.kind==="screen")return r(t.screen.title,t.app.actor);const{activity:i,story:n,step:o}=t,s=he(e,o),a=s.length===1?s[0]:void 0;return r(a?.screen.title??o.name,o.actor??n.actor??i.actor??a?.app.actor)},Pi=(e,t)=>{const r=t.actor??e.actor;return r===void 0?{title:t.name}:{actor:r,title:t.name}},Ue=e=>e.title??"UX Prototype",Ot=(e,t)=>(t?e.preview=t:delete e.preview,e),_i=(e,t,r)=>{if(!t)return;const i=_t(e,t,r).flatMap(n=>n.kind==="screen"&&!n.pinned?[n.preview.id]:[]);return i.length===0?void 0:i.join(Ve)},Ct=(e,t)=>{const r=()=>{if(t.step===void 0&&t.story===void 0)return;const o=Lt(e,{...t,[G]:""}),s=k(e,o.step);return s&&he(e,s.step)[0]},i=C(e,t.screen)??r()??U(e)[0],n={...t,[G]:"app"};for(const o of["activity","story","step"])delete n[o];return i?n.screen=i.screen.id:delete n.screen,Ot(n,i&&It(e,i.screen.previews,Tt(t))?.id)},Ri=(e,t,r)=>{const i=s=>ui(s.step,t);if(r&&i(r))return r;const n=r?.story.steps??[],o=s=>{const a=n[s];return r&&a?{...r,step:a,stepIndex:s}:void 0};for(let s=(r?.stepIndex??0)+1;s<n.length;s+=1){const a=o(s);if(a&&i(a))return a}for(let s=(r?.stepIndex??0)-1;s>=0;s-=1){const a=o(s);if(a&&i(a))return a}return W(e).find(i)},Lt=(e,t)=>{const r=L(e,t.activity),i=t.story,n=r?.stories.find(z=>z.id===i||M(r.id,z.id)===i),o=n&&r?{activity:r,story:n}:$(e,i),s=t.step,p=(o&&s?k(e,`${M(o.activity.id,o.story.id)}.${s}`):void 0)??k(e,s),l=t.screen,b=l===void 0?void 0:Ri(e,l,p);if(l!==void 0&&!b&&C(e,l))return Ct(e,{...t,[G]:"app"});const h=b??p,v=h?.activity??o?.activity??r??e.activities[0],A=h?.story??(o&&o.activity===v?o.story:void 0)??v?.stories[0],R=h?.step??A?.steps[0],S={...t};return delete S.screen,v?S.activity=v.id:delete S.activity,A&&v?S.story=$(e,A.id)?A.id:M(v.id,A.id):delete S.story,R&&A&&v?S.step=k(e,R.id)?R.id:fe(v,A,R):delete S.step,delete S[G],Ot(S,_i(e,R,t))},Di=["activity","story","step","screen"],ke=(e,t)=>oe(t)==="app"?Ct(e,t):Lt(e,t),Oi=(e,t)=>{const r=t.screen.previews.find(o=>o.kind==="browser");if(!r)return;let i;try{i=new URL(ye(e,r),"https://page.example.com")}catch{return}const n=i.pathname.split("/").filter(o=>o!=="").map(o=>{try{return decodeURIComponent(o)}catch{return o}});return{origin:i.origin,segments:n}},Mt=()=>({screens:[],children:new Map}),We=(e,t,r)=>{const[i,...n]=e.children.entries();if(e.screens.length===0&&i&&n.length===0&&r!=="/"){const[o,s]=i;return We(s,`${t}/${o}`,`${r}/${o}`)}return{segment:t,path:r,screens:e.screens,children:[...e.children.entries()].map(([o,s])=>We(s,`/${o}`,`${r==="/"?"":r}/${o}`))}},Ci=e=>{const t=new Map;for(const[r,i]of e){const n=t.get(i.origin)??Mt();t.set(i.origin,n);let o=n;for(const s of i.segments){const a=o.children.get(s)??Mt();o.children.set(s,a),o=a}o.screens.push(r)}return[...t.entries()].map(([r,i])=>({origin:r,root:We(i,"/","/")}))},Li=(e,t)=>{const r=t.screens.map(o=>({app:t,screen:o})),i=[],n=[];for(const o of r){const s=Oi(e,o);s?i.push([o,s]):n.push(o)}return{app:t,screens:r,trees:Ci(i),others:n}},Nt=e=>e.apps.map(t=>Li(e,t)).filter(t=>t.screens.length>0),zt=(e,t)=>t?.kind!=="screen"?e[0]:e.find(r=>r.app.id===t.app.id)??e[0],Mi=(e,t)=>{switch(t.type){case"activity":return L(e,t.id)!==void 0;case"story":return $(e,t.id)!==void 0;case"step":return k(e,t.id)!==void 0;case"screen":return C(e,t.id)!==void 0;case"preview":return I(e,t.id)!==void 0;case"page":return!0;case re:{const r=Oe(t.id);return r!==void 0&&I(e,r.previewId)!==void 0}default:return!1}},Vt=e=>{const t=be(e);return{name:"prototype",label:"UX Prototype",parseBase:ut,emptyBase:ht,actions:g,apply:gt,hasTarget:Mi,canonicalTarget:(r,i)=>{if(i.type==="step"){const n=k(r,i.id);return n?{...i,id:ve(n)}:i}if(i.type==="story"){const n=$(r,i.id);return n?{...i,id:M(n.activity.id,n.story.id)}:i}if(i.type==="preview"){const n=I(r,i.id);return n?{...i,id:n.preview.id}:i}return i},describe:(r,i,n)=>yt(t,r,i,n),serialize:kt,resolveNavigation:ke,navigationHierarchy:Di,commentTargets:(r,i)=>Rt(t,r),currentTarget:(r,i)=>Ai(t,r,i),title:Ue}},xe="data-dpk-modal",Ni=e=>{try{return e.matches(":modal")}catch{return!1}},Yt=e=>{e.setAttribute(xe,""),e.open||e.show()},Ut=e=>{Object.hasOwn(e,"showModal")||Object.defineProperty(e,"showModal",{configurable:!0,value:()=>Yt(e)})},Wt=(e,t)=>{if(!Ni(t))return;const r=i=>{i.target===t&&(i.stopImmediatePropagation(),e.removeEventListener("close",r,!0))};e.addEventListener("close",r,!0),t.close(),Yt(t)},zi='a, button, input, select, textarea, label, summary, [role="button"], [role="link"], [role="tab"]',Bt=/^-?[A-Za-z_][\w-]*$/,Ht=40,Vi=(e,t)=>{const r=e.closest(zi);return r!==null&&r!==t&&t.contains(r)?r:e},$e=e=>{const t=e.replace(/\s+/g," ").trim();if(t==="")return;const r=Array.from(t);return r.length>Ht?`${r.slice(0,Ht).join("")}\u2026`:t},Yi=e=>{const t=e.getAttribute("aria-label")??e.getAttribute("title");if(t)return $e(t);const r=e.tagName.toLowerCase();return $e(r==="input"||r==="textarea"||r==="select"?e.getAttribute("placeholder")??e.getAttribute("name")??"":r==="img"?e.getAttribute("alt")??"":e.textContent??"")},Ui=e=>{const t=e.getAttribute("id");if(t&&Bt.test(t))return`#${t}`;const r=e.tagName.toLowerCase(),i=Array.from(e.classList).filter(a=>Bt.test(a)).slice(0,2).map(a=>`.${a}`).join(""),n=e.parentElement,o=n?Array.from(n.children).filter(a=>a.tagName===e.tagName):[],s=o.length>1?`:nth-of-type(${o.indexOf(e)+1})`:"";return`${r}${i}${s}`},Wi=(e,t,r)=>{try{const i=e.querySelectorAll(t);return i.length===1&&i[0]===r}catch{return!1}},Bi=(e,t)=>{const r=[];let i=e;for(;i!==null&&i!==t;){const o=Ui(i);if(r.unshift(o),o.startsWith("#")||Wi(t,r.join(" > "),e))break;i=i.parentElement}const n=Yi(e);return{selector:r.length===0?":scope":r.join(" > "),tag:e.tagName.toLowerCase(),...n===void 0?{}:{text:n}}},Hi=(e,t)=>{if(t===":scope")return e;try{return e.querySelector(t)}catch{return null}},Gi=["screen","preview"],ae=e=>JSON.stringify(Gi.map(t=>e[t]??null)),Gt=(e,t)=>e?.kind==="page"&&ae(e.page)===t,Ee=e=>`tab-${e}`,Fi=e=>({tabs:[{id:Ee(1),history:[{kind:"page",page:e}],index:0}],activeId:Ee(1),seen:ae(e),nextId:2}),qi={id:"",history:[],index:0},Z=e=>e.tabs.find(t=>t.id===e.activeId)??e.tabs[0]??qi,de=e=>{const t=Z(e);return t.history[t.index]},ji=e=>Z(e).index>0,Ki=e=>{const t=Z(e);return t.index<t.history.length-1},Ft=(e,t)=>({...e,tabs:e.tabs.map(r=>r.id===e.activeId?t(r):r)}),Be=(e,t)=>Ft(e,r=>({...r,history:[...r.history.slice(0,r.index+1),t],index:r.index+1})),Se=e=>{const t=de(e);return t?.kind==="page"?{...e,seen:ae(t.page)}:e},qt=(e,t)=>{const r=Z(e),i=r.index+t;return i<0||i>=r.history.length?e:Se(Ft(e,n=>({...n,index:i})))},jt=(e,t,r)=>{const i=Ee(e.nextId),n=e.tabs.findIndex(o=>o.id===e.activeId)+1;return Se({...e,tabs:[...e.tabs.slice(0,n),{id:i,history:[t],index:0},...e.tabs.slice(n)],activeId:r?e.activeId:i,nextId:e.nextId+1})},Xi=(e,t)=>{const r=e.tabs.findIndex(o=>o.id===t);if(r<0)return e;if(e.tabs.length===1){const o=Ee(e.nextId);return{...e,tabs:[{id:o,history:[{kind:"new-tab"}],index:0}],activeId:o,nextId:e.nextId+1}}const i=e.tabs.filter(o=>o.id!==t);if(t!==e.activeId)return{...e,tabs:i};const n=i[r]??i[r-1];return Se({...e,tabs:i,activeId:n?.id??e.activeId})},Ji=(e,t)=>{const r=t===null?null:ae(t);if(r===e.seen)return e;const i={...e,seen:r};return t===null||r===null||Gt(de(e),r)?i:Be(i,{kind:"page",page:t})},Zi=(e,t)=>{const r=ae(t);return Gt(de(e),r)?e.seen===r?e:{...e,seen:r}:Be({...e,seen:r},{kind:"page",page:t})},Kt=(e,t)=>{switch(t.kind){case"observe":return Ji(e,t.page);case"visit":return Zi(e,t.page);case"back":return qt(e,-1);case"forward":return qt(e,1);case"open-tab":return jt(e,t.entry,t.background);case"new-tab":return jt(e,{kind:"new-tab"},!1);case"unreachable":return Be(e,{kind:"unreachable",url:t.url});case"activate":return e.tabs.some(r=>r.id===t.id)&&t.id!==e.activeId?Se({...e,activeId:t.id}):e;case"close-tab":return Xi(e,t.id);default:return e}},Xt=(e,t)=>{const r=ke(e,t),i=J(e,r);if(i?.kind!=="screen")return null;const[n]=Ye(e,i,r).shown;return n?.kind!=="browser"?null:{screen:i.screen.id,preview:n.id}},Te=(e,t)=>{const r=J(e,ke(e,{[G]:"app",...t}));return r?.kind==="screen"?r:void 0},Jt=(e,t)=>{const r=e.trim();if(r==="")return null;try{return r.startsWith("/")?new URL(r,t):new URL(/^[a-z][a-z0-9+.-]*:\/\//i.test(r)?r:`https://${r}`)}catch{return null}},Zt=e=>`${e.origin}${e.pathname.replace(/\/+$/,"")}`,Qi=(e,t,r)=>{const i=Jt(t,r);if(i===null)return null;const n=Zt(i);for(const{screen:o}of U(e))for(const s of o.previews){if(s.kind!=="browser")continue;const a=Jt(ye(e,s),r);if(a!==null&&Zt(a)===n)return{screen:o.id,preview:s.id}}return null},Qt=e=>{try{return new URL(e).host||e}catch{return e}},en=(e,t,r)=>t===void 0||t.kind==="new-tab"?r.newTab:t.kind==="unreachable"?Qt(t.url):Te(e,t.page)?.screen.title??r.newTab,er=(e,t)=>{if(t===void 0||t.kind==="new-tab")return"";if(t.kind==="unreachable")return t.url;const r=Te(e,t.page)?.screen.previews.find(i=>i.id===t.page.preview);return r===void 0?"":ye(e,r)},tr=e=>{const t=Z(e);for(let r=t.index;r>=0;r-=1){const i=t.history[r];if(i?.kind==="page")return i.page}for(const r of e.tabs){const i=r.history[r.index];if(i?.kind==="page")return i.page}},tn=(e,t)=>t===void 0?void 0:Te(e,t)?.app.actor,rr=(e,t,r,i=null)=>{const n=Z(t),o=n.history[n.index],s=tn(e,tr(t)??i??void 0);return{tabs:t.tabs.map(a=>({id:a.id,title:en(e,a.history[a.index],r),url:er(e,a.history[a.index]),active:a.id===n.id})),entry:o,url:er(e,o),canBack:ji(t),canForward:Ki(t),...s===void 0?{}:{profile:s}}},rn=e=>tr(e)??null,nn=(e,t)=>{const r=t===null?void 0:Te(e,t),i=zt(Nt(e),r),n=[],o=(s,a)=>{for(const{screen:p}of a.screens){const l=p.previews.find(b=>b.kind==="browser");l!==void 0&&n.push({title:p.title,url:`${s}${a.path==="/"?"":a.path}`,page:{screen:p.id,preview:l.id}})}for(const p of a.children)o(s,p)};for(const s of i?.trees??[])o(Qt(s.origin),s.root);return n},T=(e,t,r,i)=>({id:t,deviceClass:e,width:r,height:i}),ir=[T("phone","iphone-se",375,667),T("phone","iphone-16",393,852),T("phone","iphone-16-pro-max",440,956),T("phone","pixel-7",412,915),T("phone","galaxy-s24",360,780),T("tablet","ipad-mini",744,1133),T("tablet","ipad-air-11",820,1180),T("tablet","ipad-pro-11",834,1194),T("tablet","ipad-pro-13",1024,1366),T("desktop","laptop-13",1280,800),T("desktop","laptop-15",1440,900),T("desktop","full-hd",1920,1080),T("desktop","monitor-27",2560,1440),T("desktop","ultrawide",3440,1440)],on={phone:T("phone","iphone-16",393,852),tablet:T("tablet","ipad-pro-11",834,1194),desktop:T("desktop","laptop-13",1280,800)},nr=e=>e==="mobile"?"phone":e==="tablet"?"tablet":"desktop",sn=e=>e!=="plain",or=e=>ir.filter(t=>t.deviceClass===e),an=(e,t)=>{const r=nr(e),i=t[r];return or(r).find(n=>n.id===i)??on[r]},dn=(e,t)=>{const r=ir.find(i=>i.id===t);return r===void 0||e[r.deviceClass]===t?e:{...e,[r.deviceClass]:t}},pn=(e,t)=>`${e.deviceName(t.id)} \xB7 ${t.width}\xD7${t.height}`,ln=(e,t)=>{const r=[1,t.width/e.width];t.height!==void 0&&r.push(t.height/e.height);const i=Math.min(...r);return!Number.isFinite(i)||i<=0?1:Math.max(.1,Math.floor(i*100)/100)},sr=(e,t)=>{const{state:r,navigation:i}=e,n=J(r,i),o=oe(i);return d`
2
- <div class="nav">
3
- ${hn(e,t,o)}
4
- ${o==="app"?vn(e,t,n):n!==void 0&&n.kind!=="screen"?bn(e,t,n):d`<p class="nav-empty">${t.noActivityBefore}<code>activities</code>${t.noActivityAfter}</p>`}
5
- </div>
6
- `},cn={scenario:"viewScenario",app:"viewApp"},un={scenario:"viewScenarioHint",app:"viewAppHint"},hn=(e,t,r)=>d`<nav class="view-switch" aria-label=${t.viewLabel}>
7
- ${gi.map(i=>d`<a
8
- class="view-option"
9
- href=${e.hashFor(mt(i))}
10
- title=${t[un[i]]}
11
- aria-current=${i===r?"page":c}
12
- data-view=${i}
13
- >${t[cn[i]]}</a
14
- >`)}
15
- </nav>`,vn=(e,t,r)=>{const i=r?.kind==="screen"?r:void 0,n=Nt(e.state),o=zt(n,r),s={context:e,currentId:i?.screen.id},a=o?.others??[];return d`
16
- ${n.length>1&&o?fn(e,t,n,o):c}
17
- ${n.length===1&&o?.app.description?d`<p class="app-description">${o.app.description}</p>`:c}
18
- <div class="steps-head">
19
- <span class="dpk-label">${t.appScreens}</span>
20
- <span class="dpk-label">${o?.screens.length??0}</span>
21
- </div>
22
- <p class="app-hint">${t.appScreensHint}</p>
23
- ${o?.trees.map(p=>d`<section class="app-tree">
24
- <h3 class="app-origin">${gn(p.origin)}</h3>
25
- <ul class="tree">
26
- ${ar(s,p.root,0)}
27
- </ul>
28
- </section>`)}
29
- ${a.length===0?c:d`<section class="app-group">
30
- ${(o?.trees.length??0)>0?d`<h3 class="app-group-heading">${t.appOutsideBrowser}</h3>`:c}
31
- <ul class="steps app-screens">
32
- ${a.map(p=>{const l=dr(s,p);return d`<li class="step-row" data-current=${String(l)}>
33
- <a class="step-link" href=${lr(e,p)} aria-current=${l?"page":c}>
34
- <span class="step-name">${p.screen.title}</span>
35
- ${cr(e,p)}
36
- </a>
37
- </li>`})}
38
- </ul>
39
- </section>`}
40
- ${i?.screen.description?d`<div class="detail">
41
- <div class="screen-description dpk-prose">${Pe(_e(i.screen.description))}</div>
42
- </div>`:c}
43
- `},fn=(e,t,r,i)=>d`<div class="field">
44
- <span class="dpk-label">${t.appSelectLabel}</span>
45
- <select
46
- class="dpk-select"
47
- aria-label=${t.appSelectLabel}
48
- @change=${Re(n=>{const o=r[Number(n)]?.screens[0];o&&e.navigate(pr(o))})}
49
- >
50
- ${r.map((n,o)=>d`<option value=${String(o)} ?selected=${n===i}>${n.app.name}</option>`)}
51
- </select>
52
- ${i.app.description?d`<p class="app-description">${i.app.description}</p>`:c}
53
- </div>`,ar=(e,t,r)=>d`<li
54
- class="tree-node"
55
- >
56
- ${t.screens.length===0&&r===0?c:t.screens.length===0?d`<div class="tree-row" data-depth=${String(r)} data-current="false">
57
- <span class="tree-link" title=${t.path}><code class="tree-path">${t.segment}</code></span>
58
- </div>`:t.screens.map(i=>{const n=dr(e,i);return d`<div class="tree-row" data-depth=${String(r)} data-current=${String(n)}>
59
- <a
60
- class="tree-link"
61
- href=${lr(e.context,i)}
62
- title=${t.path}
63
- aria-current=${n?"page":c}
64
- >
65
- <code class="tree-path">${t.segment}</code>
66
- <span class="tree-title">${i.screen.title}</span>
67
- ${cr(e.context,i)}
68
- </a>
69
- </div>`})}
70
- ${t.children.length>0?d`<ul class="tree">
71
- ${t.children.map(i=>ar(e,i,r+1))}
72
- </ul>`:c}
73
- </li>`,dr=(e,t)=>t.screen.id===e.currentId,pr=e=>({screen:e.screen.id,preview:null}),lr=(e,t)=>e.hashFor(pr(t)),cr=(e,t)=>{const r=e.commentCount({type:"screen",id:t.screen.id})+St(e.comments,t.screen.previews.map(i=>i.id));return r>0?d`<span class="step-note">${r}</span>`:c},gn=e=>e.replace(/^[a-z][a-z0-9+.-]*:\/\//i,""),bn=(e,t,r)=>{const{state:i}=e,{activity:n,story:o}=r,s=o.steps,a=r.kind==="step"?r.step:void 0,p=r.kind==="step"?ve(r):void 0;return d`
74
- <div class="field">
75
- <span class="dpk-label">Activity</span>
76
- <select
77
- class="dpk-select"
78
- aria-label="Activity"
79
- @change=${Re(l=>e.navigate({activity:l,story:null,step:null}))}
80
- >
81
- ${i.activities.map(l=>d`<option value=${l.id} ?selected=${l.id===n.id}>${l.name}</option>`)}
82
- </select>
83
- </div>
84
- <div class="field">
85
- <span class="dpk-label">User Story</span>
86
- <select
87
- class="dpk-select"
88
- aria-label="User Story"
89
- @change=${Re(l=>e.navigate({activity:n.id,story:l,step:null}))}
90
- >
91
- ${n.stories.map(l=>d`<option value=${l.id} ?selected=${l.id===o.id}>${l.name}</option>`)}
92
- </select>
93
- </div>
94
- <div class="steps-head">
95
- <span class="dpk-label">Step</span>
96
- <span class="dpk-label">${s.length}</span>
97
- </div>
98
- <ol class="steps">
99
- ${Dr(s,l=>fe(n,o,l),(l,b)=>{const h=fe(n,o,l),v=e.commentCount({type:"step",id:h})+St(e.comments,$i(i,l).map(A=>A.id));return d`
100
- <li class="step-row" data-current=${String(l.id===a?.id)}>
101
- <a class="step-link" href=${e.hashFor({activity:n.id,story:o.id,step:l.id})}>
102
- <span class="step-index">${String(b+1).padStart(2,"0")}</span>
103
- <span class="step-name">${l.name}</span>
104
- ${v>0?d`<span class="step-note">${v}</span>`:c}
105
- </a>
106
- <span class="row-tools">
107
- <button
108
- class="dpk-icon-btn"
109
- type="button"
110
- aria-label=${t.deleteStepAria}
111
- @click=${()=>e.dispatch(ie.deleteStep(h))}
112
- >
113
- ${ue()}
114
- </button>
115
- </span>
116
- </li>
117
- `})}
118
- </ol>
119
- <button class="dpk-btn" type="button" @click=${()=>mn(e,t,M(n.id,o.id))}>
120
- ${t.addStepButton}
121
- </button>
122
- ${a?nt(p,d`<div class="detail">
123
- <div class="detail-row">
124
- <span class="dpk-label">${t.stepNameLabel}</span>
125
- <span class="detail-value">
126
- <dpk-component-inline-edit
127
- .value=${a.name}
128
- .label=${t.stepNameLabel}
129
- @dpk-commit=${et(l=>e.dispatch(ie.setStepName(p??a.id,l)))}
130
- ></dpk-component-inline-edit>
131
- </span>
132
- </div>
133
- <div class="detail-row">
134
- <span class="dpk-label">${t.descriptionLabel}</span>
135
- <span class="detail-value">
136
- <dpk-component-inline-edit
137
- multiline
138
- markdown
139
- .value=${a.description??""}
140
- .placeholder=${t.descriptionPlaceholder}
141
- .label=${t.descriptionLabel}
142
- @dpk-commit=${et(l=>e.dispatch(ie.setStepDescription(p??a.id,l)))}
143
- ></dpk-component-inline-edit>
144
- </span>
145
- </div>
146
- ${wn(e,t,a)}
147
- </div>`):c}
148
- `},wn=(e,t,r)=>{const i=he(e.state,r);return i.length===0?c:d`<div class="detail-row">
149
- <span class="dpk-label">${t.screenGroup}</span>
150
- <span class="detail-value">
151
- ${i.map(({app:n,screen:o})=>d`<div class="step-screen-entry">
152
- <a
153
- class="step-screen"
154
- href=${e.hashFor({...mt("app"),screen:o.id})}
155
- title=${t.openInApp}
156
- >${n.name} › ${o.title}</a
157
- >
158
- ${o.description?d`<div class="screen-description dpk-prose">
159
- ${Pe(_e(o.description))}
160
- </div>`:c}
161
- </div>`)}
162
- </span>
163
- </div>`},mn=(e,t,r)=>{const i=Or("new-step",ft(e.state));e.dispatch(ie.addStep(r,i,t.newStepName)).ok&&e.navigate({story:r,step:i})},ur={mobile:"390px",tablet:"834px",desktop:"1180px",fluid:"100%"},hr={mobile:"620px",tablet:"640px",desktop:"520px",fluid:"420px"},yn={browser:0,native:22,mail:0,plain:0},vr=(e,t,r)=>{const i=`--frame-width:${ur[t]};--frame-min-height:${hr[t]}`;if(r?.kind!=="device")return i;const n=yn[e];return`${i};--device-width:${r.width+n}px;--device-height:${r.height+n}px;zoom:${r.zoom}`},kn=O(Cr),xn=O(Lr),$n=O(Zr),En=O(Kr),He=O(jr),Sn=(e,t,r)=>{const i=t.length-1;if(e==="ArrowRight")return t[r===i?0:r+1];if(e==="ArrowLeft")return t[r===0?i:r-1];if(e==="Home")return t[0];if(e==="End")return t[i]},Tn=(e,t)=>{const{view:r,send:i}=t,n=o=>s=>{const a=r.tabs[o],p=s.key==="Enter"||s.key===" "?a:Sn(s.key,r.tabs,o);p!==void 0&&(s.preventDefault(),i({kind:"activate",id:p.id,focus:!0}))};return d`<div class="browser-tabs">
164
- <div class="browser-tab-list" role="tablist" aria-label=${e.browserTabs}>
165
- ${r.tabs.map((o,s)=>d`<div
166
- class="browser-tab"
167
- role="tab"
168
- tabindex=${o.active?"0":"-1"}
169
- aria-selected=${o.active?"true":"false"}
170
- title=${o.title}
171
- @click=${()=>i({kind:"activate",id:o.id})}
172
- @keydown=${n(s)}
173
- >
174
- <span class="browser-favicon">${He()}</span>
175
- <span class="browser-tab-title">${o.title}</span>
176
- ${fr(e,t,o.id)}
177
- </div>`)}
178
- </div>
179
- <button
180
- class="browser-new-tab"
181
- type="button"
182
- aria-label=${e.newTab}
183
- title=${e.newTab}
184
- @click=${()=>i({kind:"new-tab"})}
185
- >
186
- ${tt()}
187
- </button>
188
- ${t.onExitDemo===void 0?c:d`<button class="demo-exit" type="button" title=${e.exitDemo} @click=${t.onExitDemo}>
189
- ${ue()} ${e.exitDemo} <kbd>Esc</kbd>
190
- </button>`}
191
- </div>`},fr=(e,t,r)=>d`<button
192
- class="browser-tab-close"
193
- type="button"
194
- aria-label=${e.closeTab}
195
- title=${e.closeTab}
196
- @click=${i=>{i.stopPropagation(),t.send({kind:"close-tab",id:r})}}
197
- >
198
- ${ue()}
199
- </button>`,In={back:kn,forward:xn,reload:$n},Q=(e,t,r)=>{const{view:i,send:n}=t,o={back:e.browserBack,forward:e.browserForward,reload:e.browserReload}[r],s={back:!i.canBack,forward:!i.canForward,reload:i.entry?.kind!=="page"}[r];return d`<button
200
- class=${`browser-nav browser-${r}`}
201
- type="button"
202
- aria-label=${o}
203
- title=${o}
204
- ?disabled=${s}
205
- @click=${()=>n({kind:r})}
206
- >
207
- ${In[r]()}
208
- </button>`},An=(e,t,r)=>{const{view:i,send:n}=t,o=i.profile??e.browserGuest;return d`<div class="browser-toolbar">
209
- ${r?c:d`${Q(e,t,"back")} ${Q(e,t,"forward")} ${Q(e,t,"reload")}`}
210
- <form
211
- class="browser-address-form"
212
- @submit=${s=>{s.preventDefault();const a=s.currentTarget,p=a instanceof HTMLFormElement?a.querySelector("input"):null;!p||p.value.trim()===""||(p.blur(),n({kind:"address",input:p.value}))}}
213
- >
214
- <span class="browser-lock">${i.entry?.kind==="page"?En():He()}</span>
215
- <input
216
- class="browser-address"
217
- type="text"
218
- aria-label=${e.browserAddress}
219
- spellcheck="false"
220
- autocomplete="off"
221
- .value=${Mr(i.url)}
222
- @focus=${s=>{s.currentTarget instanceof HTMLInputElement&&s.currentTarget.select()}}
223
- @keydown=${s=>{if(s.key!=="Escape")return;s.preventDefault();const a=s.currentTarget;a instanceof HTMLInputElement&&(a.value=i.url,a.blur())}}
224
- />
225
- </form>
226
- <span class="browser-profile" title=${e.browserProfile(o)}>
227
- <span class="browser-avatar" aria-hidden="true">${Array.from(o)[0]??""}</span>
228
- ${r?c:d`<span class="browser-profile-name">${o}</span>`}
229
- </span>
230
- </div>`},Pn=(e,t)=>{const{view:r,send:i}=t;return d`<div class="browser-bottom">
231
- ${Q(e,t,"back")} ${Q(e,t,"forward")}
232
- <button
233
- class="browser-nav browser-new-tab"
234
- type="button"
235
- aria-label=${e.newTab}
236
- title=${e.newTab}
237
- @click=${()=>i({kind:"new-tab"})}
238
- >
239
- ${tt()}
240
- </button>
241
- <button
242
- class="browser-nav browser-tab-count"
243
- type="button"
244
- aria-label=${e.browserTabs}
245
- title=${e.browserTabs}
246
- aria-expanded=${t.switcher?"true":"false"}
247
- @click=${()=>i({kind:"switcher",open:!t.switcher})}
248
- >
249
- <span class="browser-tab-count-box">${r.tabs.length}</span>
250
- </button>
251
- ${Q(e,t,"reload")}
252
- </div>`},_n=(e,t)=>{const{view:r,send:i}=t;return d`<div class="browser-switcher" role="dialog" aria-label=${e.browserTabs}>
253
- ${r.tabs.map(n=>d`<div class="browser-card" aria-current=${n.active?"true":c}>
254
- <button class="browser-card-open" type="button" @click=${()=>i({kind:"activate",id:n.id})}>
255
- <span class="browser-favicon">${He()}</span>
256
- <span class="browser-card-title">${n.title}</span>
257
- <span class="browser-card-url">${n.url}</span>
258
- </button>
259
- ${fr(e,t,n.id)}
260
- </div>`)}
261
- </div>`},Rn=(e,t,r)=>d`<div class="browser-newtab">
262
- <p class="browser-newtab-label">${t.newTabShortcuts}</p>
263
- <div class="browser-shortcuts">
264
- ${r.shortcuts.map(i=>d`<a
265
- class="browser-shortcut"
266
- href=${e.hashFor(i.page)}
267
- @click=${n=>{n.preventDefault(),r.send({kind:"visit",page:i.page})}}
268
- >
269
- <span class="browser-shortcut-icon" aria-hidden="true">${Array.from(i.title)[0]??""}</span>
270
- <span class="browser-shortcut-title">${i.title}</span>
271
- <span class="browser-shortcut-url">${i.url}</span>
272
- </a>`)}
273
- </div>
274
- </div>`,Dn=(e,t)=>d`<div class="browser-unreachable" role="alert">
275
- <h3>${e.unreachableTitle}</h3>
276
- <p>${e.unreachableBody}</p>
277
- <code>${t}</code>
278
- </div>`,On=(e,t,r)=>{const{view:i,preview:n,viewport:o}=r,s=i.entry,a=o==="mobile";return d`<figure
279
- class="frame browser"
280
- data-kind="browser"
281
- data-viewport=${o}
282
- ?data-loading=${r.loading}
283
- ?data-empty=${n!==void 0&&!r.hasContent}
284
- data-window=${r.window.kind}
285
- style=${vr("browser",o,r.window)}
286
- >
287
- ${a?c:Tn(t,r)} ${An(t,r,a)}
288
- <div class="browser-progress" aria-hidden="true"></div>
289
- <div class="viewport">
290
- ${a&&r.switcher?_n(t,r):c}
291
- ${s?.kind==="unreachable"?Dn(t,s.url):n===void 0?Rn(e,t,r):d`<slot name=${`preview:${n.id}`}></slot> ${r.hasContent?c:d`<div class="frame-placeholder">
292
- <span class="dpk-label">light dom preview</span>
293
- <code>&lt;div slot="preview" data-preview-id="${n.id}"&gt;</code>
294
- </div>`}`}
295
- </div>
296
- ${a?Pn(t,r):c}
297
- </figure>`},Cn=(e,t)=>{const r=t.mode.kind!=="off";return d`<button
298
- class=${r?"dpk-btn dpk-btn--accent ui-comment-toggle":"dpk-btn ui-comment-toggle"}
299
- type="button"
300
- aria-pressed=${r?"true":"false"}
301
- title=${e.uiCommentHint}
302
- @click=${()=>t.send({kind:"toggle"})}
303
- >
304
- ${rt()} ${e.uiComment}
305
- </button>`},Ln=(e,t)=>t.mode.kind==="off"?c:d`<p class="ui-comment-hint" role="status">${rt()} ${e.uiCommentHint}</p>`,Mn=(e,t)=>t.mode.kind==="off"?c:d`<div class="ui-layer" aria-hidden="true">
306
- <div class="ui-catcher"></div>
307
- <div class="ui-box ui-hover" hidden></div>
308
- <div class="ui-box ui-picked" hidden></div>
309
- ${t.pins.map(r=>d`<span
310
- class="ui-pin"
311
- hidden
312
- data-preview=${r.previewId}
313
- data-selector=${r.selector}
314
- title=${e.uiCommentPin(r.number,r.body)}
315
- >${r.number}</span
316
- >`)}
317
- </div>`,Nn=e=>{const t=e.mode;if(t.kind!=="composing")return c;const r=Br(t.body,e.notes,{key:`ui:${t.target.previewId}/${t.target.selector}`,...e.targetLabel===void 0?{}:{label:e.targetLabel}});return d`${nt(`${t.target.previewId}/${t.target.selector}`,Hr(e.composer,r,i=>{i.kind==="input"?e.send({kind:"input",body:i.body}):i.kind==="comment"?e.submit(i.body):e.send({kind:"dismiss"})}))}`},gr=(e,t,r)=>{const{state:i,navigation:n}=e,o=J(i,n),s=o===void 0||o.kind==="story"?void 0:o,a=oe(n)==="app",p=mr(i,[]);if(o?.kind==="story"){const{activity:P,story:Ie}=o;return d`
318
- <div class="stage">
319
- <section class="stage-story">
320
- ${br(t,Pi(P,Ie))}
321
- ${Ie.description?d`<div class="story-description dpk-prose">${Pe(_e(Ie.description))}</div>`:c}
322
- <p class="stage-empty">${t.storyWithoutSteps}</p>
323
- </section>
324
- ${p}
325
- </div>
326
- `}if(!s)return d`
327
- <div class="stage">
328
- ${a?d`<p class="stage-empty">${t.noScreens}</p>`:d`<p class="stage-empty">
329
- ${t.noStepBefore}<strong>Activity › UserStory › Step</strong>${t.noStepAfter}
330
- </p>`}
331
- ${p}
332
- </div>
333
- `;const l=Ye(i,s,n),{layout:b,panes:h,shown:v}=l,[A]=b==="single"?h:[],R=r.uiComment,S=r.lift,z=S?.mode==="demo",F=r.browser,qe=F!==null&&F.view.entry?.kind!=="page"?[]:v,[q]=qe,pe=(q??v[0])?.viewport??"desktop",je=z&&F!==null&&pe!=="mobile",$r=q??v[0],Ke=F!==null?"browser":$r?.kind??"browser",Xe=z&&Ke==="browser"&&nr(pe)==="desktop",j=r.devices,ee=j===null||Xe||!sn(Ke)?null:an(pe,j.choice),Je=ee!==null&&j!==null?{kind:"device",width:ee.width,height:ee.height,zoom:j.zoom}:Xe?{kind:"fill"}:null;return d`
334
- ${S===null?c:d`<div class="stage-placeholder" style=${`height:${S.height}px`}></div>`}
335
- <div
336
- class=${S===null?"stage":z?"stage is-demo":"stage is-maximized"}
337
- data-ui-comment=${R.mode.kind}
338
- popover=${S===null?c:"manual"}
339
- @wheel=${S===null?c:{handleEvent:r.onLiftedWheel,passive:!1}}
340
- >
341
- ${z?je?c:d`<button class="demo-exit" type="button" title=${t.exitDemo} @click=${r.onToggleDemo}>
342
- ${ue()} ${t.exitDemo} <kbd>Esc</kbd>
343
- </button>`:d`<div class="stage-bar">
344
- ${br(t,Dt(i,s))}
345
- <div class="stage-tools">
346
- ${A?.kind==="screen"&&A.tabs.length>0?wr(e,l,A):c}
347
- ${ee!==null&&j!==null?Bn(t,ee,j):c}
348
- ${v.length>0?Cn(t,R):c}
349
- ${v.length===0?c:a?Hn(t,r.onToggleDemo):Gn(t,S!==null,r.onToggleMaximize)}
350
- </div>
351
- </div>`}
352
- ${s.kind==="step"&&s.step.situation!==void 0?Un(t,s.step.situation):c}
353
- ${z?c:Ln(t,R)}
354
- <div
355
- class="canvas"
356
- data-layout=${b}
357
- @click=${{handleEvent:r.canvasEvents.click,capture:!0}}
358
- @pointermove=${{handleEvent:r.canvasEvents.pointermove,capture:!0}}
359
- @pointerleave=${r.canvasEvents.pointerleave}
360
- @wheel=${{handleEvent:r.canvasEvents.wheel,passive:!1}}
361
- @scroll=${{handleEvent:r.canvasEvents.scroll,capture:!0}}
362
- >
363
- ${F!==null?On(e,t,{...F,...q===void 0?{}:{preview:q},...je?{onExitDemo:r.onToggleDemo}:{},hasContent:q===void 0||r.hasPreviewContent(q.id),viewport:pe,window:Je??{kind:"fill"}}):b==="side-by-side"?d`<div class="panes">
364
- ${h.map(P=>d`<div class="pane" data-viewport=${P.preview.viewport} data-pane=${P.kind}>
365
- ${Wn(e,l,P)}
366
- ${Ge(e,t,P.preview,r.hasPreviewContent(P.preview.id))}
367
- </div>`)}
368
- </div>`:v.map(P=>Ge(e,t,P,r.hasPreviewContent(P.id),Je))}
369
- ${v.length===0?d`<p class="dpk-label">${t.noPreviewMetadata}</p>`:c}
370
- ${Mn(t,R)}
371
- </div>
372
- ${Nn(R)}
373
- ${mr(i,qe.map(P=>P.id))}
374
- </div>
375
- `},zn=O(ti),Vn=O(Jr),Yn={phone:O(Qr),tablet:O(ei),desktop:O(Xr)},br=(e,t)=>d`<div class="page-head">
376
- ${t.actor===void 0?c:d`<span class="page-actor" role="note" aria-label=${e.pageActor(t.actor)}>
377
- ${zn()} ${t.actor}
378
- </span>`}
379
- <h2 class="page-title">${t.title}</h2>
380
- </div>`,Un=(e,t)=>d`<aside class="situation">
381
- <span class="situation-label">${e.situation}</span>
382
- <p class="situation-text">${t}</p>
383
- </aside>`,wr=(e,t,r)=>d`<div class="tabs" role="tablist">
384
- ${r.tabs.map(i=>{const n=i.id===r.preview.id;return d`<a
385
- class="tab"
386
- role="tab"
387
- data-current=${String(n)}
388
- aria-selected=${n?"true":"false"}
389
- href=${e.hashFor({preview:xi(t,i.id)})}
390
- >${i.label??i.viewport}</a
391
- >`})}
392
- </div>`,Wn=(e,t,r)=>r.kind==="material"?r.preview.label===void 0?c:d`<span class="pane-label">${r.preview.label}</span>`:d`<div class="pane-head">
393
- <span class="pane-label">${r.screen.screen.title}</span>
394
- ${r.tabs.length>0?wr(e,t,r):c}
395
- </div>`,Bn=(e,t,r)=>{const i=Math.round(r.zoom*100);return d`<span class="device-pick" title=${e.deviceHint}>
396
- ${Yn[t.deviceClass]()}
397
- <select
398
- class="device-select"
399
- aria-label=${e.device}
400
- @change=${n=>{n.currentTarget instanceof HTMLSelectElement&&r.onPick(n.currentTarget.value)}}
401
- >
402
- ${or(t.deviceClass).map(n=>d`<option value=${n.id} ?selected=${n.id===t.id}>
403
- ${pn(e,n)}
404
- </option>`)}
405
- </select>
406
- ${i<100?d`<span class="device-zoom" title=${e.deviceZoom(i)}>${i}%</span>`:c}
407
- </span>`},Hn=(e,t)=>d`<button class="dpk-btn stage-demo" type="button" title=${e.demoHint} @click=${t}>
408
- ${Vn()} ${e.demo}
409
- </button>`,Gn=(e,t,r)=>d`<button
410
- class="dpk-btn stage-maximize"
411
- type="button"
412
- aria-pressed=${t?"true":"false"}
413
- title=${e.maximizeHint}
414
- @click=${r}
415
- >
416
- ${t?d`${Nr()} ${e.restore}`:d`${zr()} ${e.maximize}`}
417
- </button>`,Ge=(e,t,r,i,n=null)=>d`
418
- <figure
419
- class="frame"
420
- data-kind=${r.kind}
421
- data-viewport=${r.viewport}
422
- data-window=${n?.kind??c}
423
- ?data-empty=${!i}
424
- style=${vr(r.kind,r.viewport,n)}
425
- >
426
- ${r.kind==="browser"?d`<div class="chrome">
427
- <span class="dots"><i></i><i></i><i></i></span>
428
- <span class="url">${ye(e.state,r)}</span>
429
- </div>`:r.kind==="mail"?Fn(Ii(t,r)):c}
430
- <div class="viewport">
431
- ${r.kind==="native"?qn():c}
432
- <slot name=${`preview:${r.id}`}></slot>
433
- ${i?c:d`<div class="frame-placeholder">
434
- <span class="dpk-label">light dom preview</span>
435
- <code>&lt;div slot="preview" data-preview-id="${r.id}"&gt;</code>
436
- </div>`}
437
- </div>
438
- </figure>
439
- `,Fn=e=>d`<header class="mail-head">
440
- ${e.subject===void 0?c:d`<h3 class="mail-subject">${e.subject}</h3>`}
441
- <div class="mail-envelope">
442
- ${e.initial===void 0?c:d`<span class="mail-avatar" aria-hidden="true">${e.initial}</span>`}
443
- <dl class="mail-meta">
444
- ${e.rows.map(t=>d`<div class="mail-row">
445
- <dt>${t.label}</dt>
446
- <dd>${t.value}</dd>
447
- </div>`)}
448
- </dl>
449
- </div>
450
- </header>`,qn=()=>d`<div class="status-bar">
451
- <span class="status-time">9:41</span>
452
- <span class="punch-hole" aria-hidden="true"></span>
453
- <svg class="status-wifi" viewBox="0 0 16 12" aria-hidden="true">
454
- <path d="M8 9.2a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3Z" />
455
- <path
456
- d="M4.7 7.4a4.8 4.8 0 0 1 6.6 0"
457
- fill="none"
458
- stroke="currentColor"
459
- stroke-width="1.5"
460
- stroke-linecap="round"
461
- />
462
- <path
463
- d="M2.1 4.7a8.4 8.4 0 0 1 11.8 0"
464
- fill="none"
465
- stroke="currentColor"
466
- stroke-width="1.5"
467
- stroke-linecap="round"
468
- />
469
- </svg>
470
- </div>`,mr=(e,t)=>{const i=[...U(e).flatMap(n=>n.screen.previews),...W(e).flatMap(n=>X(n.step))].filter(n=>!t.includes(n.id));return i.length===0?d`${c}`:d`<div class="parked" aria-hidden="true">
471
- ${i.map(n=>d`<slot name=${`preview:${n.id}`}></slot>`)}
472
- </div>`},jn=Vr`
473
- :host {
474
- --dpk-prototype-accent: var(--dpk-blue);
475
- }
476
-
477
- /* ---------------------------------------------------------------- sidebar */
478
-
479
- .nav {
480
- display: grid;
481
- gap: 14px;
482
- align-content: start;
483
- min-width: 188px;
484
- }
485
-
486
- .field {
487
- display: grid;
488
- gap: 5px;
489
- }
490
-
491
- /* Scenario or app: a segmented control at the top of the sidebar. */
492
- .view-switch {
493
- display: flex;
494
- gap: 3px;
495
- padding: 3px;
496
- border: 1px solid var(--dpk-rule);
497
- border-radius: var(--dpk-radius);
498
- background: var(--dpk-paper-inset);
499
- box-shadow: inset 0 1px 2px var(--dpk-shade-1);
500
- }
501
-
502
- .view-option {
503
- flex: 1 1 0;
504
- padding: 6px 9px;
505
- border: 1px solid transparent;
506
- border-radius: var(--dpk-radius-sm);
507
- color: var(--dpk-ink-soft);
508
- font-size: 12px;
509
- font-weight: 500;
510
- text-align: center;
511
- text-decoration: none;
512
- transition:
513
- background 140ms var(--dpk-ease),
514
- color 140ms var(--dpk-ease),
515
- box-shadow 140ms var(--dpk-ease);
516
- }
517
-
518
- .view-option:hover {
519
- color: var(--dpk-ink);
520
- }
521
-
522
- .view-option[aria-current='page'] {
523
- background: var(--dpk-paper-raised);
524
- color: var(--dpk-ink);
525
- font-weight: 600;
526
- box-shadow: var(--dpk-bevel), var(--dpk-shadow-xs);
527
- }
528
-
529
- .view-option:focus-visible {
530
- outline: none;
531
- box-shadow: var(--dpk-focus);
532
- }
533
-
534
- .app-hint {
535
- margin: -6px 0 0;
536
- font-size: 11.5px;
537
- line-height: 1.55;
538
- color: var(--dpk-ink-faint);
539
- }
540
-
541
- .app-group {
542
- display: grid;
543
- gap: 4px;
544
- }
545
-
546
- .app-group-heading {
547
- margin: 0;
548
- padding-left: 9px;
549
- font-size: 11px;
550
- font-weight: 600;
551
- color: var(--dpk-ink-soft);
552
- }
553
-
554
- .app-description {
555
- margin: 2px 0 0;
556
- font-size: 11.5px;
557
- line-height: 1.5;
558
- color: var(--dpk-ink-faint);
559
- }
560
-
561
- .step-screen {
562
- color: var(--dpk-ink);
563
- font-size: 12.5px;
564
- font-weight: 550;
565
- }
566
-
567
- .screen-description {
568
- font-size: 12.5px;
569
- line-height: 1.6;
570
- color: var(--dpk-ink);
571
- }
572
-
573
- .app-tree {
574
- display: grid;
575
- gap: 4px;
576
- }
577
-
578
- .app-origin {
579
- margin: 0;
580
- padding-left: 9px;
581
- font-family: var(--dpk-mono);
582
- font-size: 10.5px;
583
- font-weight: 500;
584
- color: var(--dpk-ink-faint);
585
- overflow-wrap: anywhere;
586
- }
587
-
588
- .tree {
589
- list-style: none;
590
- margin: 0;
591
- padding: 0;
592
- display: grid;
593
- gap: 2px;
594
- }
595
-
596
- /* A path below another one is indented under it, with a guide line. */
597
- .tree .tree {
598
- margin-left: 14px;
599
- padding-left: 6px;
600
- border-left: 1px solid var(--dpk-rule);
601
- }
602
-
603
- .tree-node {
604
- display: grid;
605
- gap: 2px;
606
- }
607
-
608
- .tree-row {
609
- position: relative;
610
- border-radius: var(--dpk-radius-sm);
611
- transition: background 140ms ease;
612
- }
613
-
614
- .tree-row:has(a):hover {
615
- background: var(--dpk-paper-inset);
616
- }
617
-
618
- .tree-row[data-current='true'] {
619
- background: linear-gradient(
620
- 180deg,
621
- color-mix(in srgb, var(--dpk-prototype-accent) 10%, var(--dpk-paper-raised)),
622
- color-mix(in srgb, var(--dpk-prototype-accent) 5%, var(--dpk-paper-raised))
623
- );
624
- box-shadow:
625
- inset 0 0 0 1px color-mix(in srgb, var(--dpk-prototype-accent) 22%, transparent),
626
- var(--dpk-shadow-xs);
627
- }
628
-
629
- .tree-link {
630
- display: flex;
631
- align-items: baseline;
632
- flex-wrap: wrap;
633
- gap: 2px 8px;
634
- padding: 6px 4px 6px 9px;
635
- text-decoration: none;
636
- color: var(--dpk-ink-soft);
637
- font-size: 12.5px;
638
- }
639
-
640
- .tree-path {
641
- font-family: var(--dpk-mono);
642
- font-size: 11.5px;
643
- color: var(--dpk-ink);
644
- overflow-wrap: anywhere;
645
- }
646
-
647
- span.tree-link .tree-path {
648
- color: var(--dpk-ink-faint);
649
- }
650
-
651
- .tree-title {
652
- min-width: 0;
653
- color: var(--dpk-ink-soft);
654
- }
655
-
656
- .tree-row[data-current='true'] .tree-path,
657
- .tree-row[data-current='true'] .tree-title {
658
- color: var(--dpk-ink);
659
- font-weight: 550;
660
- }
661
-
662
- .tree-link .step-note {
663
- align-self: center;
664
- }
665
-
666
- .tree-link:focus-visible {
667
- outline: none;
668
- border-radius: var(--dpk-radius-sm);
669
- box-shadow: var(--dpk-focus);
670
- }
671
-
672
- .steps.app-screens {
673
- max-height: none;
674
- }
675
-
676
- .steps-head {
677
- display: flex;
678
- align-items: baseline;
679
- justify-content: space-between;
680
- padding-bottom: 5px;
681
- border-bottom: 1px solid var(--dpk-rule);
682
- }
683
-
684
- .steps {
685
- list-style: none;
686
- margin: 0;
687
- padding: 0;
688
- display: grid;
689
- gap: 2px;
690
- max-height: 38vh;
691
- overflow: auto;
692
- }
693
-
694
- .step-row {
695
- position: relative;
696
- display: flex;
697
- align-items: center;
698
- gap: 4px;
699
- padding: 0 4px 0 9px;
700
- border-radius: var(--dpk-radius-sm);
701
- transition:
702
- background 140ms ease,
703
- box-shadow 140ms ease;
704
- }
705
-
706
- .step-row:hover {
707
- background: var(--dpk-paper-inset);
708
- }
709
-
710
- .step-row[data-current='true'] {
711
- background: linear-gradient(
712
- 180deg,
713
- color-mix(in srgb, var(--dpk-prototype-accent) 10%, var(--dpk-paper-raised)),
714
- color-mix(in srgb, var(--dpk-prototype-accent) 5%, var(--dpk-paper-raised))
715
- );
716
- box-shadow:
717
- inset 0 0 0 1px color-mix(in srgb, var(--dpk-prototype-accent) 22%, transparent),
718
- var(--dpk-shadow-xs);
719
- }
720
-
721
- .step-row[data-current='true']::before {
722
- content: '';
723
- position: absolute;
724
- left: 0;
725
- top: 8px;
726
- bottom: 8px;
727
- width: 3px;
728
- border-radius: var(--dpk-radius-xs);
729
- background: linear-gradient(180deg, var(--dpk-blue), var(--dpk-blue-strong));
730
- box-shadow: 0 0 8px color-mix(in srgb, var(--dpk-prototype-accent) 45%, transparent);
731
- }
732
-
733
- .step-link {
734
- display: flex;
735
- flex: 1;
736
- min-width: 0;
737
- align-items: center;
738
- gap: 7px;
739
- padding: 7px 0;
740
- text-decoration: none;
741
- color: var(--dpk-ink-soft);
742
- font-size: 12.5px;
743
- font-weight: 460;
744
- }
745
-
746
- .step-row[data-current='true'] .step-link {
747
- color: var(--dpk-ink);
748
- font-weight: 550;
749
- }
750
-
751
- .step-index {
752
- flex: 0 0 auto;
753
- min-width: 17px;
754
- padding: 1px 4px;
755
- border-radius: var(--dpk-radius-xs);
756
- background: var(--dpk-paper-inset);
757
- font-family: var(--dpk-mono);
758
- font-size: 9.5px;
759
- font-variant-numeric: tabular-nums;
760
- text-align: center;
761
- color: var(--dpk-ink-faint);
762
- transition:
763
- background 140ms ease,
764
- color 140ms ease;
765
- }
766
-
767
- .step-row[data-current='true'] .step-index {
768
- background: linear-gradient(180deg, var(--dpk-blue), var(--dpk-blue-strong));
769
- color: #fff;
770
- box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
771
- }
772
-
773
- .step-name {
774
- min-width: 0;
775
- overflow: hidden;
776
- white-space: nowrap;
777
- text-overflow: ellipsis;
778
- }
779
-
780
- .step-note {
781
- margin-left: auto;
782
- min-width: 16px;
783
- padding: 1px 5px;
784
- border-radius: 999px;
785
- background: var(--dpk-accent);
786
- color: var(--dpk-accent-ink);
787
- font-family: var(--dpk-mono);
788
- font-size: 9px;
789
- font-variant-numeric: tabular-nums;
790
- text-align: center;
791
- }
792
-
793
- .row-tools {
794
- display: flex;
795
- gap: 0;
796
- opacity: 0;
797
- transition: opacity 120ms ease;
798
- }
799
-
800
- .step-row:hover .row-tools,
801
- .step-row[data-current='true'] .row-tools {
802
- opacity: 1;
803
- }
804
-
805
- .detail {
806
- display: grid;
807
- gap: 12px;
808
- padding: 12px 12px 14px;
809
- border: 1px solid var(--dpk-rule);
810
- border-radius: var(--dpk-radius);
811
- background: var(--dpk-paper-raised);
812
- box-shadow: var(--dpk-bevel), var(--dpk-shadow-sm);
813
- }
814
-
815
- .detail-row {
816
- display: grid;
817
- gap: 4px;
818
- }
819
-
820
- .detail-value {
821
- font-size: 12.5px;
822
- color: var(--dpk-ink-soft);
823
- }
824
-
825
- .nav-empty {
826
- font-size: 12px;
827
- line-height: 1.6;
828
- color: var(--dpk-ink-faint);
829
- }
830
-
831
- /* ------------------------------------------------------------------ stage */
832
-
833
- .stage {
834
- display: grid;
835
- /* One column no wider than the main area: a wide row of panes scrolls inside the canvas. */
836
- grid-template-columns: minmax(0, 1fr);
837
- gap: 14px;
838
- width: 100%;
839
- min-width: 0;
840
- }
841
-
842
- .stage-bar {
843
- display: flex;
844
- align-items: center;
845
- justify-content: space-between;
846
- gap: 10px 16px;
847
- min-width: 0;
848
- flex-wrap: wrap;
849
- }
850
-
851
- /* ------------------------------------------------------------- page head */
852
-
853
- .page-head {
854
- display: flex;
855
- align-items: center;
856
- gap: 12px;
857
- min-width: 0;
858
- animation: dpk-page-head-in 260ms var(--dpk-ease) backwards;
859
- }
860
-
861
- @keyframes dpk-page-head-in {
862
- from {
863
- opacity: 0;
864
- transform: translateY(4px);
865
- }
866
- }
867
-
868
- .page-actor {
869
- display: inline-flex;
870
- flex: none;
871
- align-items: center;
872
- gap: 6px;
873
- height: 26px;
874
- padding: 0 11px 0 8px;
875
- border-radius: 999px;
876
- background: linear-gradient(
877
- 180deg,
878
- color-mix(in srgb, var(--dpk-blue) 16%, var(--dpk-paper-raised)),
879
- color-mix(in srgb, var(--dpk-blue) 9%, var(--dpk-paper-raised))
880
- );
881
- box-shadow:
882
- var(--dpk-bevel),
883
- inset 0 0 0 1px color-mix(in srgb, var(--dpk-blue) 32%, transparent),
884
- var(--dpk-shadow-xs);
885
- color: var(--dpk-blue);
886
- font-size: 12px;
887
- font-weight: 650;
888
- letter-spacing: 0.01em;
889
- white-space: nowrap;
890
- }
891
-
892
- .page-actor svg {
893
- width: 13px;
894
- height: 13px;
895
- opacity: 0.9;
896
- }
897
-
898
- .page-title {
899
- margin: 0;
900
- min-width: 0;
901
- overflow: hidden;
902
- font-size: 19px;
903
- font-weight: 700;
904
- line-height: 1.3;
905
- letter-spacing: -0.02em;
906
- color: var(--dpk-ink);
907
- text-overflow: ellipsis;
908
- white-space: nowrap;
909
- }
910
-
911
- .stage-tools {
912
- display: flex;
913
- align-items: center;
914
- gap: 8px;
915
- margin-left: auto;
916
- }
917
-
918
- .stage-maximize svg,
919
- .stage-demo svg {
920
- width: 13px;
921
- height: 13px;
922
- }
923
-
924
- .stage-demo {
925
- display: inline-flex;
926
- align-items: center;
927
- gap: 6px;
928
- }
929
-
930
- /* The app view's device: a pill like the rendition tabs, with the zoom it is drawn at. */
931
- .device-pick {
932
- position: relative;
933
- display: inline-flex;
934
- align-items: center;
935
- gap: 6px;
936
- height: 32px;
937
- padding: 0 6px 0 10px;
938
- box-sizing: border-box;
939
- border: 1px solid var(--dpk-rule);
940
- border-radius: 999px;
941
- background: var(--dpk-paper-sunken);
942
- box-shadow: inset 0 1px 2px rgba(20, 28, 44, 0.04);
943
- color: var(--dpk-ink-soft);
944
- }
945
-
946
- .device-pick:focus-within {
947
- box-shadow: var(--dpk-focus);
948
- }
949
-
950
- .device-pick svg {
951
- flex: none;
952
- width: 14px;
953
- height: 14px;
954
- }
955
-
956
- .device-select {
957
- min-width: 0;
958
- padding: 0 18px 0 0;
959
- border: 0;
960
- outline: none;
961
- background: transparent
962
- url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'><path d='M3 4.5 6 7.5 9 4.5' fill='none' stroke='%23878e9e' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>")
963
- no-repeat right 2px center;
964
- appearance: none;
965
- /* As wide as the device shown, not the longest name in the list. */
966
- field-sizing: content;
967
- color: var(--dpk-ink);
968
- font: 600 12px/1 var(--dpk-body);
969
- cursor: pointer;
970
- }
971
-
972
- .device-zoom {
973
- padding: 3px 7px;
974
- border-radius: 999px;
975
- background: var(--dpk-paper-raised);
976
- box-shadow: var(--dpk-bevel), var(--dpk-shadow-xs);
977
- font: 600 10.5px/1 var(--dpk-mono);
978
- font-variant-numeric: tabular-nums;
979
- color: var(--dpk-ink-soft);
980
- }
981
-
982
- .tabs {
983
- display: inline-flex;
984
- gap: 2px;
985
- padding: 3px;
986
- border: 1px solid var(--dpk-rule);
987
- border-radius: 999px;
988
- background: var(--dpk-paper-sunken);
989
- box-shadow: inset 0 1px 2px rgba(20, 28, 44, 0.04);
990
- }
991
-
992
- .tab {
993
- padding: 4px 14px;
994
- border-radius: 999px;
995
- font-size: 12px;
996
- font-weight: 500;
997
- text-decoration: none;
998
- color: var(--dpk-ink-soft);
999
- white-space: nowrap;
1000
- transition:
1001
- background 120ms ease,
1002
- color 120ms ease;
1003
- }
1004
-
1005
- .tab:hover {
1006
- color: var(--dpk-ink);
1007
- background: var(--dpk-paper-raised);
1008
- }
1009
-
1010
- .tab[data-current='true'] {
1011
- background: var(--dpk-paper-raised);
1012
- color: var(--dpk-ink);
1013
- font-weight: 600;
1014
- box-shadow: var(--dpk-bevel), var(--dpk-shadow-xs);
1015
- }
1016
-
1017
- .stage-empty {
1018
- max-width: 62ch;
1019
- padding: 16px 18px;
1020
- border: 1px dashed var(--dpk-rule-strong);
1021
- border-radius: var(--dpk-radius-lg);
1022
- background: var(--dpk-paper-sunken);
1023
- font-size: 13px;
1024
- line-height: 1.7;
1025
- color: var(--dpk-ink-soft);
1026
- }
1027
-
1028
- /* A story that has no steps yet: its heading, what it is for, and why no frame. */
1029
- .stage-story {
1030
- display: grid;
1031
- gap: 12px;
1032
- justify-items: start;
1033
- }
1034
-
1035
- .story-description {
1036
- max-width: 62ch;
1037
- margin: 0;
1038
- font-size: 14px;
1039
- line-height: 1.7;
1040
- color: var(--dpk-ink);
1041
- }
1042
-
1043
- /* -------------------------------------------------------------- situation */
1044
-
1045
- /*
1046
- * What is going on around the previews: a stage direction, read before them.
1047
- * The band spans the stage at any width (a maximized stage too); only the
1048
- * text keeps a readable line length.
1049
- */
1050
- .situation {
1051
- display: flex;
1052
- align-items: baseline;
1053
- gap: 10px;
1054
- margin: -4px 0 -2px;
1055
- padding: 8px 14px 8px 10px;
1056
- border: 1px solid color-mix(in srgb, var(--dpk-prototype-accent) 16%, var(--dpk-rule));
1057
- border-radius: var(--dpk-radius);
1058
- background: color-mix(in srgb, var(--dpk-prototype-accent) 5%, var(--dpk-paper-raised));
1059
- box-shadow: var(--dpk-bevel);
1060
- }
1061
-
1062
- .situation-label {
1063
- flex: none;
1064
- padding: 2px 8px;
1065
- border-radius: 999px;
1066
- background: color-mix(in srgb, var(--dpk-prototype-accent) 13%, transparent);
1067
- font-size: 10.5px;
1068
- font-weight: 650;
1069
- letter-spacing: 0.06em;
1070
- color: var(--dpk-prototype-accent);
1071
- }
1072
-
1073
- .situation-text {
1074
- max-width: 90ch;
1075
- margin: 0;
1076
- min-width: 0;
1077
- font-size: 13px;
1078
- line-height: 1.65;
1079
- color: var(--dpk-ink);
1080
- white-space: pre-line;
1081
- }
1082
-
1083
- /* ----------------------------------------------------------------- canvas */
1084
-
1085
- /*
1086
- * The work surface the frame sits on: a quiet dot lattice that reads as a
1087
- * canvas rather than empty page background, giving the frame somewhere to
1088
- * cast its shadow.
1089
- */
1090
- .canvas {
1091
- display: flex;
1092
- justify-content: center;
1093
- padding: 30px;
1094
- border: 1px solid var(--dpk-rule);
1095
- border-radius: var(--dpk-radius-xl);
1096
- background: var(--dpk-dots), var(--dpk-paper-sunken);
1097
- box-shadow: inset 0 1px 3px var(--dpk-shade-1);
1098
- }
1099
-
1100
- /* ---------------------------------------------------------- comment on UI */
1101
-
1102
- .ui-comment-toggle svg,
1103
- .ui-comment-hint svg {
1104
- width: 14px;
1105
- height: 14px;
1106
- }
1107
-
1108
- .ui-comment-toggle {
1109
- display: inline-flex;
1110
- align-items: center;
1111
- gap: 6px;
1112
- }
1113
-
1114
- .ui-comment-hint {
1115
- display: flex;
1116
- align-items: center;
1117
- gap: 8px;
1118
- margin: -4px 0 -2px;
1119
- padding: 7px 12px;
1120
- border-radius: var(--dpk-radius);
1121
- background: var(--dpk-accent-soft);
1122
- color: var(--dpk-accent-strong, var(--dpk-accent));
1123
- font-size: 12.5px;
1124
- font-weight: 550;
1125
- }
1126
-
1127
- .canvas {
1128
- position: relative;
1129
- }
1130
-
1131
- .stage:not([data-ui-comment='off']) .canvas ::slotted(*) {
1132
- cursor: crosshair;
1133
- }
1134
-
1135
- /* Sized to the canvas's scroll area by the element; the boxes and pins show through. */
1136
- .ui-catcher {
1137
- position: absolute;
1138
- top: 0;
1139
- left: 0;
1140
- z-index: 4;
1141
- cursor: crosshair;
1142
- }
1143
-
1144
- /* Positioned against the canvas by the element, which measures the author's markup. */
1145
- .ui-layer {
1146
- display: contents;
1147
- }
1148
-
1149
- .ui-box {
1150
- position: absolute;
1151
- z-index: 2;
1152
- box-sizing: border-box;
1153
- border-radius: 4px;
1154
- pointer-events: none;
1155
- }
1156
-
1157
- .ui-hover {
1158
- outline: 2px solid var(--dpk-accent);
1159
- outline-offset: 1px;
1160
- background: color-mix(in srgb, var(--dpk-accent) 8%, transparent);
1161
- }
1162
-
1163
- .ui-picked {
1164
- outline: 2px solid var(--dpk-accent);
1165
- outline-offset: 2px;
1166
- background: color-mix(in srgb, var(--dpk-accent) 14%, transparent);
1167
- box-shadow: 0 0 0 6px color-mix(in srgb, var(--dpk-accent) 18%, transparent);
1168
- }
1169
-
1170
- .ui-pin {
1171
- position: absolute;
1172
- z-index: 3;
1173
- display: grid;
1174
- place-items: center;
1175
- min-width: 20px;
1176
- height: 20px;
1177
- padding: 0 5px;
1178
- box-sizing: border-box;
1179
- transform: translate(-50%, -50%);
1180
- border: 2px solid var(--dpk-paper-raised);
1181
- border-radius: 999px 999px 999px 2px;
1182
- background: var(--dpk-accent);
1183
- color: var(--dpk-accent-ink);
1184
- box-shadow: var(--dpk-shadow-sm);
1185
- font-family: var(--dpk-mono);
1186
- font-size: 10px;
1187
- font-weight: 700;
1188
- pointer-events: none;
1189
- }
1190
-
1191
- .ui-box[hidden],
1192
- .ui-pin[hidden] {
1193
- display: none;
1194
- }
1195
-
1196
- /*
1197
- * Side by side: what the user sees together, in one row. A fixed viewport
1198
- * keeps its width as long as the row allows it, a fluid one takes the rest;
1199
- * a row wider than the canvas scrolls sideways instead of squeezing a device.
1200
- */
1201
- .panes {
1202
- display: flex;
1203
- align-items: flex-start;
1204
- justify-content: safe center;
1205
- gap: 28px;
1206
- width: 100%;
1207
- min-width: 0;
1208
- overflow-x: auto;
1209
- padding-bottom: 4px;
1210
- }
1211
-
1212
- /* A device shrinks at most to a width its layout still reads at, then the row scrolls. */
1213
- .pane {
1214
- display: grid;
1215
- gap: 8px;
1216
- flex: 0 1 var(--pane-width);
1217
- min-width: min(var(--pane-width), 720px);
1218
- }
1219
-
1220
- .pane[data-viewport='mobile'] {
1221
- --pane-width: 390px;
1222
- }
1223
-
1224
- .pane[data-viewport='tablet'] {
1225
- --pane-width: 834px;
1226
- }
1227
-
1228
- .pane[data-viewport='desktop'] {
1229
- --pane-width: 1180px;
1230
- }
1231
-
1232
- .pane[data-viewport='fluid'] {
1233
- flex: 1 1 0;
1234
- min-width: 240px;
1235
- }
1236
-
1237
- .pane .frame {
1238
- width: 100%;
1239
- }
1240
-
1241
- .pane-head {
1242
- display: flex;
1243
- flex-wrap: wrap;
1244
- align-items: center;
1245
- justify-content: space-between;
1246
- gap: 8px;
1247
- }
1248
-
1249
- .pane-head .tabs {
1250
- padding: 2px;
1251
- }
1252
-
1253
- .pane-head .tab {
1254
- padding: 3px 11px;
1255
- font-size: 11.5px;
1256
- }
1257
-
1258
- .pane-label {
1259
- justify-self: start;
1260
- padding: 2px 9px;
1261
- border-radius: 999px;
1262
- background: var(--dpk-paper-raised);
1263
- box-shadow: var(--dpk-bevel), var(--dpk-shadow-xs);
1264
- font-size: 11.5px;
1265
- font-weight: 600;
1266
- color: var(--dpk-ink-soft);
1267
- }
1268
-
1269
- /*
1270
- * Maximized: the stage covers the tab — the page head, the tabs and the canvas
1271
- * alone. It is also a manual popover in the top layer, so the UA popover box
1272
- * (fit-content, margin, border, padding, colors) is reset here. The canvas
1273
- * scrolls instead of the page, and a browser preview is at least as tall as
1274
- * the tab allows; a phone keeps its device shape. Whatever sits above the
1275
- * canvas (the situation, the comment-on-UI hint) keeps its own height, and the
1276
- * canvas takes the rest.
1277
- */
1278
- .stage.is-maximized {
1279
- position: fixed;
1280
- inset: 0;
1281
- z-index: 2147483000;
1282
- display: flex;
1283
- flex-direction: column;
1284
- width: auto;
1285
- height: auto;
1286
- max-width: none;
1287
- max-height: none;
1288
- margin: 0;
1289
- padding: 16px 20px 20px;
1290
- border: 0;
1291
- color: var(--dpk-ink);
1292
- background: var(--dpk-paper);
1293
- overflow: hidden;
1294
- }
1295
-
1296
- .stage.is-maximized > * {
1297
- flex: none;
1298
- }
1299
-
1300
- .canvas:has(> .frame[data-window='device']) {
1301
- align-items: flex-start;
1302
- /* A device wider than the stage is drawn smaller to fit it, so it never widens the page. */
1303
- min-width: 0;
1304
- contain: inline-size;
1305
- }
1306
-
1307
- .stage.is-maximized > .canvas {
1308
- flex: 1 1 0;
1309
- min-height: 0;
1310
- align-items: flex-start;
1311
- overflow: auto;
1312
- overscroll-behavior: contain;
1313
- }
1314
-
1315
- .stage.is-maximized .frame:not([data-kind='native'], [data-kind='plain']) {
1316
- display: flex;
1317
- flex-direction: column;
1318
- min-height: 100%;
1319
- }
1320
-
1321
- .stage.is-maximized .frame:not([data-kind='native'], [data-kind='plain']) .viewport {
1322
- flex: 1 0 auto;
1323
- }
1324
-
1325
- /*
1326
- * Demo: the app view's browser alone across the tab, as if the reader were
1327
- * using the app — no title, no tools, no canvas around it. The browser fills
1328
- * the tab and its page scrolls inside the viewport; a phone stays phone wide.
1329
- */
1330
- .stage.is-demo {
1331
- position: fixed;
1332
- inset: 0;
1333
- z-index: 2147483000;
1334
- display: flex;
1335
- flex-direction: column;
1336
- width: auto;
1337
- height: auto;
1338
- max-width: none;
1339
- max-height: none;
1340
- margin: 0;
1341
- padding: 0;
1342
- border: 0;
1343
- color: var(--dpk-ink);
1344
- background: var(--dpk-paper-sunken);
1345
- overflow: hidden;
1346
- }
1347
-
1348
- .stage.is-demo > .canvas {
1349
- flex: 1 1 0;
1350
- min-height: 0;
1351
- padding: 0;
1352
- border: 0;
1353
- border-radius: 0;
1354
- background: var(--dpk-dots), var(--dpk-paper-sunken);
1355
- box-shadow: none;
1356
- overflow: auto;
1357
- overscroll-behavior: contain;
1358
- }
1359
-
1360
- .stage.is-demo .frame[data-window='fill'] {
1361
- width: 100%;
1362
- height: 100%;
1363
- border: 0;
1364
- border-radius: 0;
1365
- box-shadow: none;
1366
- }
1367
-
1368
- /* A device keeps its size, in the middle of the tab (the element leaves 24px around it). */
1369
- .stage.is-demo > .canvas > .frame[data-window='device'] {
1370
- margin: auto;
1371
- }
1372
-
1373
- .stage.is-demo > .canvas > .frame:not([data-window]) {
1374
- margin: 24px auto;
1375
- }
1376
-
1377
- /* Over a phone or a frame outside the browser, the way out floats at the top right. */
1378
- .demo-exit {
1379
- position: absolute;
1380
- top: 12px;
1381
- right: 16px;
1382
- z-index: 3;
1383
- display: inline-flex;
1384
- align-items: center;
1385
- gap: 6px;
1386
- height: 30px;
1387
- padding: 0 8px 0 10px;
1388
- border: 1px solid var(--dpk-rule-strong);
1389
- border-radius: 999px;
1390
- background: color-mix(in srgb, var(--dpk-paper-raised) 82%, transparent);
1391
- backdrop-filter: blur(10px);
1392
- box-shadow: var(--dpk-shadow);
1393
- color: var(--dpk-ink-soft);
1394
- font: 600 12px/1 var(--dpk-body);
1395
- cursor: pointer;
1396
- opacity: 0.55;
1397
- transition:
1398
- opacity 160ms var(--dpk-ease),
1399
- color 160ms var(--dpk-ease);
1400
- }
1401
-
1402
- .demo-exit:hover,
1403
- .demo-exit:focus-visible {
1404
- opacity: 1;
1405
- color: var(--dpk-ink);
1406
- }
1407
-
1408
- .demo-exit:focus-visible {
1409
- outline: none;
1410
- box-shadow: var(--dpk-focus), var(--dpk-shadow);
1411
- }
1412
-
1413
- .demo-exit svg {
1414
- width: 12px;
1415
- height: 12px;
1416
- }
1417
-
1418
- /* A desktop browser has it at the free end of the tab strip, like a window control. */
1419
- .browser-tabs .demo-exit {
1420
- position: static;
1421
- flex: none;
1422
- align-self: center;
1423
- margin: 0 0 3px auto;
1424
- height: 26px;
1425
- opacity: 0.85;
1426
- }
1427
-
1428
- .demo-exit kbd {
1429
- padding: 2px 5px;
1430
- border: 1px solid var(--dpk-rule-strong);
1431
- border-radius: var(--dpk-radius-xs);
1432
- background: var(--dpk-paper-sunken);
1433
- font: 600 10px/1 var(--dpk-mono);
1434
- }
1435
-
1436
- /* ------------------------------------------------------------------ frame */
1437
-
1438
- .frame {
1439
- width: min(var(--frame-width), 100%);
1440
- max-width: 100%;
1441
- margin: 0;
1442
- border: 1px solid var(--dpk-rule);
1443
- border-radius: var(--dpk-radius-lg);
1444
- background: var(--dpk-paper-raised);
1445
- box-shadow: var(--dpk-bevel), var(--dpk-shadow-lg);
1446
- overflow: hidden;
1447
- /* However high the mock stacks its own layers, they stay under what the stage draws over the frame. */
1448
- isolation: isolate;
1449
- transition: box-shadow 200ms var(--dpk-ease);
1450
- }
1451
-
1452
- .chrome {
1453
- display: flex;
1454
- align-items: center;
1455
- gap: 8px;
1456
- padding: 8px 14px;
1457
- background: linear-gradient(
1458
- 180deg,
1459
- color-mix(in srgb, var(--dpk-paper-raised) 88%, transparent),
1460
- color-mix(in srgb, var(--dpk-paper-inset) 88%, transparent)
1461
- );
1462
- backdrop-filter: blur(10px);
1463
- border-bottom: 1px solid var(--dpk-rule);
1464
- box-shadow: inset 0 1px 0 var(--dpk-highlight);
1465
- }
1466
-
1467
- .dots {
1468
- display: inline-flex;
1469
- gap: 5px;
1470
- }
1471
-
1472
- .dots i {
1473
- width: 10px;
1474
- height: 10px;
1475
- border-radius: 50%;
1476
- background: var(--dpk-rule-strong);
1477
- }
1478
-
1479
- .dots i:nth-child(1) {
1480
- background: #ff5f57;
1481
- }
1482
-
1483
- .dots i:nth-child(2) {
1484
- background: #febc2e;
1485
- }
1486
-
1487
- .dots i:nth-child(3) {
1488
- background: #28c840;
1489
- }
1490
-
1491
- .chrome .url {
1492
- flex: 1;
1493
- min-width: 0;
1494
- padding: 4px 14px;
1495
- border: 1px solid var(--dpk-rule);
1496
- border-radius: var(--dpk-radius-sm);
1497
- background: var(--dpk-paper-raised);
1498
- box-shadow: inset 0 1px 2px rgba(20, 28, 44, 0.04);
1499
- font-family: var(--dpk-mono);
1500
- font-size: 10.5px;
1501
- color: var(--dpk-ink-faint);
1502
- overflow: hidden;
1503
- white-space: nowrap;
1504
- text-overflow: ellipsis;
1505
- }
1506
-
1507
- /*
1508
- * Native previews are recognised by their device shape: a slim bezel, a status
1509
- * bar with a punch-hole camera, and a home indicator. No address bar.
1510
- */
1511
- .frame[data-kind='native'] {
1512
- padding: 10px;
1513
- border-color: #22262e;
1514
- border-radius: 28px;
1515
- background: linear-gradient(160deg, #2e3440, #1a1d24);
1516
- box-shadow:
1517
- var(--dpk-shadow-lg),
1518
- inset 0 1px 0 rgba(255, 255, 255, 0.06);
1519
- }
1520
-
1521
- .frame[data-kind='native'] .viewport {
1522
- overflow: hidden;
1523
- border-radius: 18px;
1524
- }
1525
-
1526
- /* A phone is portrait: derive the screen height from its width (~1:2.05)
1527
- instead of reusing the browser preview heights. */
1528
- .frame[data-kind='native'][data-viewport='mobile'] .viewport {
1529
- min-height: calc((var(--frame-width, 390px) - 16px) * 2.05);
1530
- }
1531
-
1532
- /*
1533
- * A mail preview reads as one opened message in a mail client: the subject,
1534
- * the sender's avatar and the envelope rows, then the body (the light DOM).
1535
- */
1536
- .mail-head {
1537
- display: grid;
1538
- gap: 12px;
1539
- padding: 18px 22px 14px;
1540
- border-bottom: 1px solid #e3e6ec;
1541
- background: #fff;
1542
- color: #1f2430;
1543
- color-scheme: light;
1544
- }
1545
-
1546
- .mail-subject {
1547
- margin: 0;
1548
- font-size: 18px;
1549
- font-weight: 650;
1550
- line-height: 1.35;
1551
- letter-spacing: -0.01em;
1552
- }
1553
-
1554
- .mail-envelope {
1555
- display: flex;
1556
- align-items: flex-start;
1557
- gap: 12px;
1558
- min-width: 0;
1559
- }
1560
-
1561
- .mail-avatar {
1562
- display: inline-grid;
1563
- flex: none;
1564
- place-items: center;
1565
- width: 34px;
1566
- height: 34px;
1567
- border-radius: 50%;
1568
- background: linear-gradient(160deg, #6b8af5, #3f5fd8);
1569
- color: #fff;
1570
- font-size: 14px;
1571
- font-weight: 650;
1572
- }
1573
-
1574
- .mail-meta {
1575
- display: grid;
1576
- gap: 2px;
1577
- min-width: 0;
1578
- margin: 0;
1579
- font-size: 12px;
1580
- line-height: 1.5;
1581
- }
1582
-
1583
- .mail-row {
1584
- display: flex;
1585
- gap: 8px;
1586
- min-width: 0;
1587
- }
1588
-
1589
- .mail-row dt {
1590
- flex: none;
1591
- min-width: 3.5em;
1592
- color: #7a8294;
1593
- }
1594
-
1595
- .mail-row dd {
1596
- min-width: 0;
1597
- margin: 0;
1598
- overflow-wrap: anywhere;
1599
- color: #1f2430;
1600
- }
1601
-
1602
- .mail-row:first-child dd {
1603
- font-weight: 600;
1604
- }
1605
-
1606
- /*
1607
- * A plain preview is not a screen: no chrome, no bezel, no frame of its own.
1608
- * The light DOM draws the whole object (a memo, a FAX, a paper form) and the
1609
- * canvas is its desk, so it is as tall as its content.
1610
- */
1611
- .frame[data-kind='plain'] {
1612
- border: none;
1613
- border-radius: 0;
1614
- background: transparent;
1615
- box-shadow: none;
1616
- overflow: visible;
1617
- }
1618
-
1619
- .frame[data-kind='plain'] .viewport {
1620
- min-height: 0;
1621
- background: transparent;
1622
- }
1623
-
1624
- .frame[data-kind='plain'][data-empty] .viewport {
1625
- min-height: 180px;
1626
- }
1627
-
1628
- .status-bar {
1629
- position: relative;
1630
- display: flex;
1631
- flex: 0 0 auto;
1632
- align-items: center;
1633
- justify-content: space-between;
1634
- height: 30px;
1635
- padding: 0 12px;
1636
- background: #0c0e13;
1637
- color: #e9edf4;
1638
- font-size: 11.5px;
1639
- font-weight: 550;
1640
- font-variant-numeric: tabular-nums;
1641
- }
1642
-
1643
- .status-time {
1644
- letter-spacing: 0.02em;
1645
- }
1646
-
1647
- .punch-hole {
1648
- position: absolute;
1649
- top: 50%;
1650
- left: 50%;
1651
- width: 10px;
1652
- height: 10px;
1653
- transform: translate(-50%, -50%);
1654
- border-radius: 50%;
1655
- background: #04060a;
1656
- box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.07);
1657
- }
1658
-
1659
- .status-wifi {
1660
- width: 15px;
1661
- height: 12px;
1662
- fill: currentColor;
1663
- color: #e9edf4;
1664
- }
1665
-
1666
- /* Home indicator. */
1667
- .frame[data-kind='native'] .viewport::after {
1668
- content: '';
1669
- position: absolute;
1670
- bottom: 8px;
1671
- left: 50%;
1672
- width: 88px;
1673
- height: 4px;
1674
- transform: translateX(-50%);
1675
- border-radius: 999px;
1676
- background: rgba(138, 146, 160, 0.55);
1677
- }
1678
-
1679
- /*
1680
- * The preview is never scrolled on its own: it shows everything it contains and
1681
- * the page scrolls as a whole. The flex column keeps a short mock filling
1682
- * the frame's minimum height without pinning a maximum.
1683
- */
1684
- .viewport {
1685
- position: relative;
1686
- contain: layout;
1687
- display: flex;
1688
- flex-direction: column;
1689
- width: 100%;
1690
- min-height: var(--frame-min-height, 480px);
1691
- /* A preview is the product's screen, not the kit's chrome: it stays light in a dark theme. */
1692
- color-scheme: light;
1693
- background: #fff;
1694
- }
1695
-
1696
- /*
1697
- * The author's wrapper becomes the frame's filling layer: a one-cell grid makes
1698
- * its height definite, so a mock that asks for height:100% fills the frame
1699
- * instead of collapsing to its content.
1700
- */
1701
- /*
1702
- * The author's wrapper is a stretch row: a mock fills a short frame and grows
1703
- * the frame when its own content is taller. Stretching (rather than a
1704
- * percentage height) is what makes the fill reliable.
1705
- */
1706
- /* Only the viewport carries the minimum height; the wrapper grows to fill it. */
1707
- .viewport ::slotted(*) {
1708
- display: grid;
1709
- flex: 1 0 auto;
1710
- min-width: 0;
1711
- }
1712
-
1713
- /*
1714
- * The app view is a simulation: a screen runs in a window of a fixed size (a
1715
- * device's screen, or the whole demo) and what does not fit scrolls inside
1716
- * the author's wrapper, the way the real page scrolls under the device's own
1717
- * chrome — the status bar, the address bar and a phone browser's bottom bar
1718
- * stay where they are. The viewport contains layout, so a mock's
1719
- * fixed position element (a tab bar, a modal) stays on the device screen.
1720
- */
1721
- .frame[data-window] {
1722
- display: flex;
1723
- flex: none;
1724
- flex-direction: column;
1725
- box-sizing: border-box;
1726
- max-width: none;
1727
- }
1728
-
1729
- .frame[data-window='device'] {
1730
- width: var(--device-width);
1731
- height: var(--device-height);
1732
- }
1733
-
1734
- .frame[data-kind][data-window] .viewport {
1735
- flex: 1 1 0;
1736
- min-height: 0;
1737
- overflow: hidden;
1738
- }
1739
-
1740
- .frame[data-window] .viewport ::slotted(*) {
1741
- flex: 1 1 0;
1742
- min-height: 0;
1743
- overflow: auto;
1744
- overscroll-behavior: contain;
1745
- }
1746
-
1747
- .frame-placeholder {
1748
- position: absolute;
1749
- inset: 12px;
1750
- display: grid;
1751
- align-content: center;
1752
- justify-items: center;
1753
- gap: 8px;
1754
- padding: 12px;
1755
- text-align: center;
1756
- color: var(--dpk-ink-faint);
1757
- border: 1px dashed var(--dpk-rule-strong);
1758
- border-radius: var(--dpk-radius);
1759
- background: var(--dpk-dots), var(--dpk-paper-sunken);
1760
- }
1761
-
1762
- .frame-placeholder code {
1763
- padding: 3px 7px;
1764
- border: 1px solid var(--dpk-rule);
1765
- border-radius: var(--dpk-radius-xs);
1766
- background: var(--dpk-paper-raised);
1767
- font-family: var(--dpk-mono);
1768
- font-size: 10px;
1769
- }
1770
-
1771
- /* ---------------------------------------------------------------- browser */
1772
-
1773
- /*
1774
- * The app view's browser: a tab strip on a darker band, the active tab merged
1775
- * into the toolbar below it, round navigation buttons, a pill address bar and
1776
- * the profile of the user the window belongs to.
1777
- */
1778
- .frame.browser {
1779
- display: flex;
1780
- flex-direction: column;
1781
- --browser-band: var(--dpk-paper-inset);
1782
- --browser-bar: var(--dpk-paper-raised);
1783
- }
1784
-
1785
- .browser-tabs {
1786
- display: flex;
1787
- align-items: flex-end;
1788
- gap: 4px;
1789
- min-width: 0;
1790
- padding: 7px 10px 0;
1791
- background: var(--browser-band);
1792
- }
1793
-
1794
- .browser-tab-list {
1795
- display: flex;
1796
- flex: 0 1 auto;
1797
- align-items: flex-end;
1798
- gap: 2px;
1799
- min-width: 0;
1800
- }
1801
-
1802
- .browser-tab {
1803
- position: relative;
1804
- display: flex;
1805
- flex: 0 1 220px;
1806
- align-items: center;
1807
- gap: 8px;
1808
- min-width: 64px;
1809
- height: 32px;
1810
- padding: 0 8px 0 12px;
1811
- border-radius: 9px 9px 0 0;
1812
- color: var(--dpk-ink-soft);
1813
- font-size: 12px;
1814
- cursor: default;
1815
- user-select: none;
1816
- transition: background 140ms var(--dpk-ease);
1817
- }
1818
-
1819
- .browser-tab:not([aria-selected='true']):hover {
1820
- background: color-mix(in srgb, var(--browser-bar) 55%, transparent);
1821
- }
1822
-
1823
- /* A thin rule between two inactive tabs, as in Chrome. */
1824
- .browser-tab:not([aria-selected='true']) + .browser-tab:not([aria-selected='true'])::before {
1825
- content: '';
1826
- position: absolute;
1827
- left: -2px;
1828
- top: 9px;
1829
- bottom: 9px;
1830
- width: 1px;
1831
- background: var(--dpk-rule-strong);
1832
- }
1833
-
1834
- .browser-tab[aria-selected='true'] {
1835
- background: var(--browser-bar);
1836
- color: var(--dpk-ink);
1837
- box-shadow: 0 -1px 0 var(--dpk-rule);
1838
- }
1839
-
1840
- .browser-tab:focus-visible {
1841
- outline: none;
1842
- box-shadow: var(--dpk-focus);
1843
- }
1844
-
1845
- .browser-favicon {
1846
- display: inline-flex;
1847
- flex: none;
1848
- color: var(--dpk-ink-faint);
1849
- }
1850
-
1851
- .browser-favicon svg {
1852
- width: 14px;
1853
- height: 14px;
1854
- }
1855
-
1856
- .browser-tab-title {
1857
- flex: 1;
1858
- min-width: 0;
1859
- overflow: hidden;
1860
- white-space: nowrap;
1861
- text-overflow: ellipsis;
1862
- }
1863
-
1864
- .browser-tab-close,
1865
- .browser-new-tab,
1866
- .browser-nav {
1867
- display: inline-grid;
1868
- flex: none;
1869
- place-items: center;
1870
- padding: 0;
1871
- border: 0;
1872
- border-radius: 50%;
1873
- background: transparent;
1874
- color: var(--dpk-ink-soft);
1875
- cursor: pointer;
1876
- transition:
1877
- background 140ms var(--dpk-ease),
1878
- color 140ms var(--dpk-ease);
1879
- }
1880
-
1881
- .browser-tab-close {
1882
- width: 18px;
1883
- height: 18px;
1884
- }
1885
-
1886
- .browser-tab-close svg {
1887
- width: 10px;
1888
- height: 10px;
1889
- }
1890
-
1891
- .browser-new-tab {
1892
- width: 26px;
1893
- height: 26px;
1894
- margin-bottom: 3px;
1895
- }
1896
-
1897
- .browser-new-tab svg {
1898
- width: 14px;
1899
- height: 14px;
1900
- }
1901
-
1902
- .browser-tab-close:hover,
1903
- .browser-new-tab:hover,
1904
- .browser-nav:not(:disabled):hover {
1905
- background: color-mix(in srgb, var(--dpk-ink) 9%, transparent);
1906
- color: var(--dpk-ink);
1907
- }
1908
-
1909
- .browser-tab-close:focus-visible,
1910
- .browser-new-tab:focus-visible,
1911
- .browser-nav:focus-visible {
1912
- outline: none;
1913
- box-shadow: var(--dpk-focus);
1914
- }
1915
-
1916
- .browser-toolbar {
1917
- display: flex;
1918
- align-items: center;
1919
- gap: 4px;
1920
- min-width: 0;
1921
- padding: 6px 10px;
1922
- background: var(--browser-bar);
1923
- border-bottom: 1px solid var(--dpk-rule);
1924
- }
1925
-
1926
- .browser-nav {
1927
- width: 30px;
1928
- height: 30px;
1929
- }
1930
-
1931
- .browser-nav svg {
1932
- width: 15px;
1933
- height: 15px;
1934
- }
1935
-
1936
- .browser-nav:disabled {
1937
- color: var(--dpk-ink-faint);
1938
- opacity: 0.5;
1939
- cursor: default;
1940
- }
1941
-
1942
- .browser-address-form {
1943
- position: relative;
1944
- display: flex;
1945
- flex: 1;
1946
- align-items: center;
1947
- min-width: 0;
1948
- margin: 0 4px;
1949
- }
1950
-
1951
- .browser-lock {
1952
- position: absolute;
1953
- left: 12px;
1954
- display: inline-flex;
1955
- color: var(--dpk-ink-faint);
1956
- pointer-events: none;
1957
- }
1958
-
1959
- .browser-lock svg {
1960
- width: 13px;
1961
- height: 13px;
1962
- }
1963
-
1964
- .browser-address {
1965
- width: 100%;
1966
- min-width: 0;
1967
- height: 30px;
1968
- padding: 0 14px 0 33px;
1969
- border: 1px solid transparent;
1970
- border-radius: 999px;
1971
- background: var(--dpk-paper-sunken);
1972
- color: var(--dpk-ink);
1973
- font: 13px/1 var(--dpk-body);
1974
- text-overflow: ellipsis;
1975
- transition:
1976
- background 140ms var(--dpk-ease),
1977
- border-color 140ms var(--dpk-ease);
1978
- }
1979
-
1980
- .browser-address:hover {
1981
- background: var(--dpk-paper-inset);
1982
- }
1983
-
1984
- .browser-address:focus {
1985
- outline: none;
1986
- border-color: var(--dpk-blue);
1987
- background: var(--browser-bar);
1988
- box-shadow: 0 0 0 1px var(--dpk-blue);
1989
- }
1990
-
1991
- .browser-profile {
1992
- display: inline-flex;
1993
- flex: none;
1994
- align-items: center;
1995
- gap: 6px;
1996
- max-width: 160px;
1997
- height: 28px;
1998
- padding: 0 10px 0 3px;
1999
- border-radius: 999px;
2000
- background: var(--dpk-blue-soft);
2001
- color: var(--dpk-blue-strong, var(--dpk-blue));
2002
- font-size: 12px;
2003
- font-weight: 600;
2004
- }
2005
-
2006
- .browser-avatar {
2007
- display: inline-grid;
2008
- flex: none;
2009
- place-items: center;
2010
- width: 22px;
2011
- height: 22px;
2012
- border-radius: 50%;
2013
- background: var(--dpk-blue);
2014
- color: #fff;
2015
- font-size: 11px;
2016
- font-weight: 700;
2017
- }
2018
-
2019
- .browser-profile-name {
2020
- min-width: 0;
2021
- overflow: hidden;
2022
- white-space: nowrap;
2023
- text-overflow: ellipsis;
2024
- }
2025
-
2026
- /* The bar a reload draws under the toolbar while the page comes back. */
2027
- .browser-progress {
2028
- position: relative;
2029
- height: 2px;
2030
- margin-top: -2px;
2031
- overflow: hidden;
2032
- pointer-events: none;
2033
- }
2034
-
2035
- .browser[data-loading] .browser-progress::after {
2036
- content: '';
2037
- position: absolute;
2038
- inset: 0;
2039
- background: var(--dpk-blue);
2040
- transform-origin: left;
2041
- animation: dpk-browser-load 360ms var(--dpk-ease) forwards;
2042
- }
2043
-
2044
- @keyframes dpk-browser-load {
2045
- from {
2046
- transform: scaleX(0.08);
2047
- }
2048
- to {
2049
- transform: scaleX(1);
2050
- }
2051
- }
2052
-
2053
- .browser .viewport {
2054
- transition: opacity 160ms var(--dpk-ease);
2055
- }
2056
-
2057
- .browser[data-loading] .viewport {
2058
- opacity: 0.45;
2059
- }
2060
-
2061
- /* The new tab page: the pages of the app the reader is in, as tiles. */
2062
- .browser-newtab {
2063
- display: grid;
2064
- flex: 1;
2065
- align-content: start;
2066
- justify-items: center;
2067
- gap: 18px;
2068
- padding: 72px 24px 40px;
2069
- background: #f8f9fb;
2070
- color: #3c4250;
2071
- }
2072
-
2073
- .browser-newtab-label {
2074
- margin: 0;
2075
- font-size: 13px;
2076
- font-weight: 600;
2077
- color: #6b7282;
2078
- }
2079
-
2080
- .browser-shortcuts {
2081
- display: grid;
2082
- grid-template-columns: repeat(auto-fill, 112px);
2083
- justify-content: center;
2084
- gap: 8px;
2085
- width: min(100%, 600px);
2086
- }
2087
-
2088
- .browser-shortcut {
2089
- display: grid;
2090
- justify-items: center;
2091
- gap: 6px;
2092
- padding: 14px 8px 12px;
2093
- border-radius: 12px;
2094
- color: inherit;
2095
- text-align: center;
2096
- text-decoration: none;
2097
- transition: background 140ms var(--dpk-ease);
2098
- }
2099
-
2100
- .browser-shortcut:hover,
2101
- .browser-shortcut:focus-visible {
2102
- outline: none;
2103
- background: #eceef2;
2104
- }
2105
-
2106
- .browser-shortcut-icon {
2107
- display: grid;
2108
- place-items: center;
2109
- width: 44px;
2110
- height: 44px;
2111
- border-radius: 50%;
2112
- background: #e3e7ee;
2113
- color: #3563d9;
2114
- font-size: 17px;
2115
- font-weight: 700;
2116
- }
2117
-
2118
- .browser-shortcut-title,
2119
- .browser-shortcut-url {
2120
- max-width: 100%;
2121
- overflow: hidden;
2122
- white-space: nowrap;
2123
- text-overflow: ellipsis;
2124
- }
2125
-
2126
- .browser-shortcut-title {
2127
- font-size: 12.5px;
2128
- font-weight: 600;
2129
- }
2130
-
2131
- .browser-shortcut-url {
2132
- font-size: 10.5px;
2133
- color: #8a91a0;
2134
- }
2135
-
2136
- .browser-unreachable {
2137
- display: grid;
2138
- flex: 1;
2139
- align-content: start;
2140
- gap: 10px;
2141
- padding: 88px max(24px, 12%) 40px;
2142
- background: #fff;
2143
- color: #3c4250;
2144
- }
2145
-
2146
- .browser-unreachable::before {
2147
- content: '';
2148
- width: 40px;
2149
- height: 40px;
2150
- margin-bottom: 8px;
2151
- border-radius: 10px;
2152
- background:
2153
- linear-gradient(135deg, transparent 46%, #9aa1ae 46% 54%, transparent 54%),
2154
- linear-gradient(45deg, transparent 46%, #9aa1ae 46% 54%, transparent 54%), #eceef2;
2155
- }
2156
-
2157
- .browser-unreachable h3 {
2158
- margin: 0;
2159
- font-size: 20px;
2160
- font-weight: 600;
2161
- color: #1f2430;
2162
- }
2163
-
2164
- .browser-unreachable p {
2165
- margin: 0;
2166
- font-size: 13.5px;
2167
- line-height: 1.6;
2168
- }
2169
-
2170
- .browser-unreachable code {
2171
- justify-self: start;
2172
- max-width: 100%;
2173
- overflow-wrap: anywhere;
2174
- font-family: var(--dpk-mono);
2175
- font-size: 12px;
2176
- color: #6b7282;
2177
- }
2178
-
2179
- /*
2180
- * A phone browser: the address and the avatar on top, the controls and the
2181
- * tab count in a bar under the page, the tabs as cards over the page.
2182
- */
2183
- .browser[data-viewport='mobile'] .browser-toolbar {
2184
- gap: 8px;
2185
- padding: 8px 10px;
2186
- }
2187
-
2188
- .browser[data-viewport='mobile'] .browser-profile {
2189
- padding-right: 3px;
2190
- }
2191
-
2192
- .browser[data-viewport='mobile'] .browser-shortcuts {
2193
- grid-template-columns: repeat(auto-fill, 96px);
2194
- }
2195
-
2196
- .browser-bottom {
2197
- display: flex;
2198
- align-items: center;
2199
- justify-content: space-around;
2200
- padding: 6px 8px 10px;
2201
- border-top: 1px solid var(--dpk-rule);
2202
- background: var(--browser-bar);
2203
- }
2204
-
2205
- .browser-bottom .browser-new-tab {
2206
- width: 30px;
2207
- height: 30px;
2208
- margin: 0;
2209
- }
2210
-
2211
- .browser-tab-count-box {
2212
- display: inline-grid;
2213
- place-items: center;
2214
- min-width: 17px;
2215
- height: 17px;
2216
- padding: 0 3px;
2217
- border: 1.5px solid currentColor;
2218
- border-radius: 4px;
2219
- font: 700 10px/1 var(--dpk-body);
2220
- }
2221
-
2222
- .browser-tab-count[aria-expanded='true'] {
2223
- background: color-mix(in srgb, var(--dpk-ink) 9%, transparent);
2224
- color: var(--dpk-ink);
2225
- }
2226
-
2227
- .browser-switcher {
2228
- position: absolute;
2229
- inset: 0;
2230
- z-index: 2;
2231
- display: grid;
2232
- grid-template-columns: repeat(2, minmax(0, 1fr));
2233
- align-content: start;
2234
- gap: 10px;
2235
- padding: 12px;
2236
- color-scheme: normal;
2237
- background: var(--browser-band);
2238
- overflow: auto;
2239
- }
2240
-
2241
- .browser-card {
2242
- position: relative;
2243
- border: 1px solid var(--dpk-rule-strong);
2244
- border-radius: 12px;
2245
- background: var(--browser-bar);
2246
- box-shadow: var(--dpk-shadow);
2247
- }
2248
-
2249
- .browser-card[aria-current='true'] {
2250
- border-color: var(--dpk-blue);
2251
- box-shadow: 0 0 0 1px var(--dpk-blue);
2252
- }
2253
-
2254
- .browser-card-open {
2255
- display: grid;
2256
- grid-template-columns: auto minmax(0, 1fr);
2257
- align-items: center;
2258
- gap: 4px 6px;
2259
- width: 100%;
2260
- min-height: 84px;
2261
- padding: 10px 30px 10px 10px;
2262
- border: 0;
2263
- border-radius: inherit;
2264
- background: transparent;
2265
- color: var(--dpk-ink);
2266
- font: 600 12px/1.3 var(--dpk-body);
2267
- text-align: left;
2268
- align-content: start;
2269
- cursor: pointer;
2270
- }
2271
-
2272
- .browser-card-open:focus-visible {
2273
- outline: none;
2274
- box-shadow: var(--dpk-focus);
2275
- }
2276
-
2277
- .browser-card-title,
2278
- .browser-card-url {
2279
- min-width: 0;
2280
- overflow: hidden;
2281
- white-space: nowrap;
2282
- text-overflow: ellipsis;
2283
- }
2284
-
2285
- .browser-card-url {
2286
- grid-column: 1 / -1;
2287
- color: var(--dpk-ink-faint);
2288
- font: 400 11px/1.3 var(--dpk-mono);
2289
- }
2290
-
2291
- .browser-card .browser-tab-close {
2292
- position: absolute;
2293
- top: 8px;
2294
- right: 8px;
2295
- }
2296
-
2297
- .parked {
2298
- display: none;
2299
- }
2300
- `,Kn=`
2301
- dpk-template-prototype > [data-preview-id]:has(dialog[${xe}][open]) {
2302
- position: relative;
2303
- }
2304
-
2305
- dpk-template-prototype > [data-preview-id]:has(dialog[${xe}][open])::after {
2306
- content: '';
2307
- position: absolute;
2308
- inset: 0;
2309
- z-index: 1;
2310
- background: color-mix(in srgb, var(--dpk-ink, #111827) 38%, transparent);
2311
- }
2312
-
2313
- dpk-template-prototype > [data-preview-id] dialog[${xe}][open] {
2314
- position: absolute;
2315
- inset: 0;
2316
- z-index: 2;
2317
- max-width: calc(100% - 32px);
2318
- max-height: calc(100% - 32px);
2319
- margin: auto;
2320
- }
2321
- `,Fe={kind:"off"},Xn=(e,t)=>{switch(t.kind){case"toggle":return e.kind==="off"?{kind:"picking"}:Fe;case"exit":return Fe;case"pick":return e.kind==="off"?e:{kind:"composing",target:t.target,body:e.kind==="composing"?e.body:""};case"input":return e.kind==="composing"?{...e,body:t.body}:e;case"dismiss":case"submitted":return e.kind==="off"?e:{kind:"picking"};default:return e}},Jn={width:300,height:300},Zn=360,yr="dpk-template-prototype-document-styles",Qn=24,eo=()=>{if(document.getElementById(yr)!==null)return;const e=Object.assign(document.createElement("style"),{id:yr,textContent:Kn});document.head.append(e)},to=(e,t,r)=>{const i=getComputedStyle(e),n=/auto|scroll/.test(i.overflowX)&&e.scrollWidth>e.clientWidth,o=/auto|scroll/.test(i.overflowY)&&e.scrollHeight>e.clientHeight,s=t<0?e.scrollLeft>0:t>0&&e.scrollLeft+e.clientWidth<e.scrollWidth-1,a=r<0?e.scrollTop>0:r>0&&e.scrollTop+e.clientHeight<e.scrollHeight-1;return n&&s||o&&a},ro=e=>{if(e.assignedSlot!==null)return e.assignedSlot;if(e.parentElement!==null)return e.parentElement;const t=e.getRootNode();return t instanceof ShadowRoot?t.host:null};class kr extends it{static{this.styles=[it.styles,Yr,Ur,jn]}#e=Fe;#u=!1;#a=null;#o=[];#O=new Fr(this);#y=!1;#t=null;#r=null;#k=!1;#p=!1;#h=!1;#i=null;#v=null;#f={};#g=1;#l=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>this.#P());#d=null;definitionFor(t){return Vt(t)}connectedCallback(){super.connectedCallback(),window.addEventListener("keydown",this.#T),window.addEventListener("resize",this.#b),this.addEventListener("toggle",this.#_,!0),this.addEventListener("click",this.#c,!0),this.addEventListener("auxclick",this.#c,!0),eo()}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("keydown",this.#T),window.removeEventListener("resize",this.#b),this.removeEventListener("toggle",this.#_,!0),this.removeEventListener("click",this.#c,!0),this.removeEventListener("auxclick",this.#c,!0),this.#l?.disconnect(),this.#d=null,this.#D()}renderRegions(t){const r=be(this.locale),i=J(t.state,t.navigation),n=oe(t.navigation)==="app";this.#t!==null&&this.#t.mode==="demo"!==n&&this.#R();const o=n?this.#q(t,r):null;return this.#k=o!==null,this.#o=i!==void 0&&i.kind!=="story"&&(o===null||o.view.entry?.kind==="page")?Ye(t.state,i,t.navigation).shown.map(s=>s.id):[],this.#i!==null&&this.#i.page!==this.#o.join(" ")&&this.#D(),{sidebar:sr(t,r),main:gr(t,r,{hasPreviewContent:s=>this.#Q(s),lift:this.#t,onToggleMaximize:()=>this.#m(this.#t===null?"maximized":null),onToggleDemo:()=>this.#m(this.#t===null?"demo":null),onLiftedWheel:this.#F,browser:o===null?null:{...o,loading:this.#i!==null},devices:n?{choice:this.#f,zoom:this.#g,onPick:s=>{this.#f=dn(this.#f,s),this.requestUpdate()}}:null,uiComment:this.#C(t),canvasEvents:{click:this.#N,pointermove:this.#z,pointerleave:this.#V,wheel:this.#Y,scroll:this.#b}})}}updated(){super.updated(),this.#H(),this.#W(),this.#U(),this.#P();const t=this.#e;if(t.kind==="composing"&&!this.#o.includes(t.target.previewId)){this.#s({kind:"dismiss"});return}this.#G(),this.#h&&(this.#h=!1,this.renderRoot.querySelector('.browser-tab[aria-selected="true"]')?.focus()),this.#I();const r=t.kind==="composing"&&!this.#u;if(this.#u=t.kind==="composing",t.kind!=="composing"||this.#a===null)return;const i=this.renderRoot.querySelector(".comment-pop");i&&(this.#O.open(i,this.#a,Jn,{placement:"right-start"}),r&&i.querySelector("textarea")?.focus({preventScroll:!0}))}#C(t){const r=this.#e,i=r.kind==="composing"?r.target:void 0,n=i?I(t.state,i.previewId)?.preview:void 0,o=i?ct(i):void 0;return{mode:r,pins:r.kind==="off"?[]:Et(t.comments,this.#o),...i&&n?{targetLabel:$t(n,i)}:{},notes:t.comments.filter(s=>s.target.type===re&&s.target.id===o).map(s=>Qe(s)),composer:Gr(this.locale),send:s=>this.#s(s),submit:s=>this.#L(s)}}#s(t){const r=Xn(this.#e,t);r!==this.#e&&(this.#e=r,r.kind!=="composing"&&(this.#a=null),this.requestUpdate())}#L(t){const r=this.#e;if(r.kind!=="composing")return;this.dispatch({type:Wr,target:{type:re,id:ct(r.target)},payload:{body:t}}).ok&&this.#s({kind:"submitted"})}#x(t){const r=t.composedPath(),i=r[0];if(i instanceof Element&&i.classList.contains("ui-catcher"))return this.#M(t.clientX,t.clientY);const n=r.find(o=>o instanceof Element&&o.parentElement===this&&o.hasAttribute("data-preview-id"));return!n||!(i instanceof Element)||!n.contains(i)?null:this.#E(i,n)}#M(t,r){const i=this.#$(t,r);return i===null?null:this.#E(i.element,i.wrapper)}#$(t,r){if(typeof document.elementsFromPoint!="function")return null;const i=this.#S();for(const n of document.elementsFromPoint(t,r)){const o=i.find(s=>s.contains(n));if(o!==void 0)return{element:n,wrapper:o}}return null}#E(t,r){const i=r.getAttribute("data-preview-id");if(!i)return null;const n=Vi(t,r),o=Bi(n,r);return{element:n,target:{previewId:i,selector:o.selector,...o.text===void 0?{}:{text:o.text}}}}#S(){return Array.from(this.children).filter(t=>{const r=t.getAttribute("data-preview-id");return r!==null&&this.#o.includes(r)})}#N=t=>{if(this.#e.kind==="off")return;const r=this.#x(t);r&&(t.preventDefault(),t.stopPropagation(),this.#a=r.element,this.#s({kind:"pick",target:r.target}))};#z=t=>{if(this.#e.kind==="off")return;const r=this.#x(t);this.#w(".ui-hover",r?.element??null)};#V=()=>{this.#w(".ui-hover",null)};#Y=t=>{const r=t.composedPath()[0];if(!(r instanceof Element)||!r.classList.contains("ui-catcher"))return;const i=this.renderRoot.querySelector(".canvas");let n=this.#$(t.clientX,t.clientY)?.element??null;for(;n!==null&&n!==i;){if(to(n,t.deltaX,t.deltaY)){t.preventDefault(),n.scrollBy({left:t.deltaX,top:t.deltaY});return}n=ro(n)}};#T=t=>{t.key!=="Escape"||t.defaultPrevented||(this.#e.kind!=="off"?this.#s({kind:"exit"}):this.#m(null))};#b=()=>{this.#e.kind!=="off"&&this.#I()};#I(){if(this.#e.kind==="off")return;this.#w(".ui-picked",this.#a);const t=this.renderRoot.querySelector(".canvas");if(!t)return;const r=this.renderRoot.querySelector(".ui-catcher");r&&(r.style.width=`${t.scrollWidth}px`,r.style.height=`${t.scrollHeight}px`);for(const i of this.renderRoot.querySelectorAll(".ui-pin")){const n=this.#B(i.dataset.preview??""),s=(n?Hi(n,i.dataset.selector??""):null)?.getBoundingClientRect();if(!s||s.width===0&&s.height===0){i.hidden=!0;continue}const a=this.#A(t);i.hidden=!1,i.style.left=`${s.right-a.left}px`,i.style.top=`${s.top-a.top}px`}}#w(t,r){const i=this.renderRoot.querySelector(t),n=this.renderRoot.querySelector(".canvas");if(!i||!n)return;const o=r?.getBoundingClientRect();if(!o){i.hidden=!0;return}const s=this.#A(n);i.hidden=!1,i.style.left=`${o.left-s.left}px`,i.style.top=`${o.top-s.top}px`,i.style.width=`${o.width}px`,i.style.height=`${o.height}px`}#A(t){const r=t.getBoundingClientRect();return{left:r.left+t.clientLeft-t.scrollLeft,top:r.top+t.clientTop-t.scrollTop}}#U(){const t=this.renderRoot.querySelector(".canvas");t===this.#d||this.#l===null||(this.#d!==null&&this.#l.unobserve(this.#d),this.#d=t,t!==null&&this.#l.observe(t))}#P(){const t=this.renderRoot.querySelector('.frame[data-window="device"]'),r=t?.closest(".canvas");if(!t||!(r instanceof HTMLElement))return;const i=getComputedStyle(t),n={width:parseFloat(i.getPropertyValue("--device-width")),height:parseFloat(i.getPropertyValue("--device-height"))},o=getComputedStyle(r),s=r.clientWidth-parseFloat(o.paddingLeft)-parseFloat(o.paddingRight),a=this.#t?.mode==="demo",p=a?Qn*2:0,l=ln(n,{width:s-p,...a?{height:r.clientHeight-p}:{}});l!==this.#g&&(this.#g=l,this.requestUpdate())}#W(){for(const t of this.querySelectorAll(":scope > [data-preview-id]"))for(const r of t.querySelectorAll("dialog"))Ut(r),Wt(this,r)}#_=t=>{const r=t.target;!(r instanceof HTMLDialogElement)||!r.open||Array.from(this.children).some(i=>i.hasAttribute("data-preview-id")&&i.contains(r))&&(Ut(r),Wt(this,r))};#B(t){return Array.from(this.children).find(r=>r.getAttribute("data-preview-id")===t)}#H(){if(this.#y||this.renderRoot.querySelector(".stage")===null)return;this.#y=!0;const t=this.derivation.state,r=[];for(const i of Array.from(this.children)){const n=i.getAttribute("data-preview-id");if(n!==null)for(const o of i.querySelectorAll("a, [data-dpk-navigate]")){const s=Ti(t,{href:o.getAttribute("href"),navigate:o.getAttribute("data-dpk-navigate")});if(s===null)continue;const a=(o.textContent??"").replace(/\s+/g," ").trim().slice(0,40),p=o.getAttribute("data-dpk-navigate")??o.getAttribute("href")??"(no href)";r.push(` ${n}: <${o.tagName.toLowerCase()}> "${a}" \u2192 ${p} (${s})`)}}r.length!==0&&console.warn(`[dev-process-kit] <dpk-template-prototype>: ${r.length} link(s) in the previews lead nowhere. Point each at the screen it opens (data-dpk-navigate="screen=\u2026"); a link that only moves the scenario on can name a step (data-dpk-navigate="step=\u2026") or a user story (data-dpk-navigate="story=\u2026"):
2322
- `+r.join(`
2323
- `))}#m(t){if(t===(this.#t?.mode??null))return;const r=this.renderRoot.querySelector(".stage"),i=this.#t?.height??r?.offsetHeight??0;this.#R(),t==="demo"&&this.#e.kind!=="off"&&this.#s({kind:"exit"}),t!==null&&(this.#t={mode:t,height:i}),t!==null&&this.#e.kind==="composing"&&(qr(this.renderRoot.querySelector(".comment-pop")),this.#u=!1),this.requestUpdate()}#R(){this.#t=null,this.#v=null}#G(){const t=this.renderRoot.querySelector(".stage");if(!(this.#t===null||!t||typeof t.showPopover!="function")&&t!==this.#v){this.#v=t;try{t.showPopover()}catch{}}}#F=t=>{const r=this.renderRoot.querySelector(".canvas");(r===null||!t.composedPath().includes(r))&&t.preventDefault()};#q(t,r){const i=Xt(t.state,t.navigation);this.#r=this.#r===null?i===null?null:Fi(i):Kt(this.#r,{kind:"observe",page:i});const n=this.#r;if(n===null)return null;const o=de(n),s=o?.kind!=="page"&&n.seen!==null;if(i===null&&!s)return null;const a=rn(n)??i;return{view:rr(t.state,n,r,a),shortcuts:o?.kind==="new-tab"?nn(t.state,a):[],switcher:this.#p,send:p=>this.#K(p)}}#n(t){if(this.#r===null)return;const r=Kt(this.#r,t);if(r===this.#r)return;this.#r=r;const i=de(r);i?.kind==="page"&&this.#j(i.page),this.requestUpdate()}#j(t){this.navigate({screen:t.screen??null,preview:t.preview??null})}#K(t){switch(t.kind){case"reload":this.#J();return;case"address":this.#X(t.input);return;case"back":case"forward":case"new-tab":this.#p=!1,this.#n({kind:t.kind});return;case"switcher":this.#p=t.open,this.requestUpdate();return;case"activate":this.#p=!1,this.#h=t.focus===!0,this.#n({kind:"activate",id:t.id}),this.requestUpdate();return;case"close-tab":this.#n({kind:t.kind,id:t.id});return;case"visit":this.#n({kind:"visit",page:t.page});return;default:return}}#X(t){const r=this.#r;if(r===null)return;const i=this.derivation.state,n=rr(i,r,be(this.locale)).url||"https://page.example.com/",o=Qi(i,t,n);if(o!==null){this.#n({kind:"visit",page:o});return}const s=t.trim(),a=s.startsWith("/")?new URL(s,n).href:/^[a-z][a-z0-9+.-]*:\/\//i.test(s)?s:`https://${s}`;this.#n({kind:"unreachable",url:a})}#J(){if(this.#i!==null)return;const t=setTimeout(()=>{this.#i=null;for(const r of this.#S()){for(const i of r.querySelectorAll("form"))i.reset();for(const i of r.querySelectorAll("dialog"))i.close();r.scrollTop=0,r.dispatchEvent(new CustomEvent("dpk-reload",{bubbles:!0}))}this.renderRoot.querySelector(".browser .viewport")?.scrollTo?.({top:0}),this.requestUpdate()},Zn);this.#i={page:this.#o.join(" "),timer:t},this.requestUpdate()}#D(){this.#i!==null&&(clearTimeout(this.#i.timer),this.#i=null)}#c=t=>{if(!this.#k||this.#e.kind!=="off"||this.#r===null||t.type==="auxclick"&&t.button!==1)return;const r=this.#Z(t);if(r===null)return;const i=t.metaKey||t.ctrlKey||t.button===1;if(!r.blank&&!i)return;t.preventDefault(),t.stopPropagation();const n=Xt(this.derivation.state,Ae(this.hashFor(r.patch)));if(n===null){i||this.navigate(r.patch);return}this.#n({kind:"open-tab",entry:{kind:"page",page:n},background:i})};#Z(t){const r=t.composedPath();if(!r.some(n=>n instanceof Element&&n.parentElement===this&&n.hasAttribute("data-preview-id")))return null;for(const n of r){if(!(n instanceof Element)||n===this)break;const o=n.getAttribute("data-dpk-navigate"),s=n instanceof HTMLAnchorElement?n.getAttribute("href"):null,a=o??(s?.startsWith("#")?s:null);if(a===null)continue;const p=o!==null&&!o.includes("=")?`step=${o}`:a;return{patch:{...Ae(p)},blank:n.getAttribute("target")==="_blank"}}return null}#Q(t){return Array.from(this.querySelectorAll("[data-preview-id]")).some(r=>r.getAttribute("data-preview-id")===t)}}const xr=()=>{customElements.get("dpk-template-prototype")||customElements.define("dpk-template-prototype",kr)},io=Object.freeze(Object.defineProperty({__proto__:null,DpkTemplatePrototype:kr,VIEWPORT_MIN_HEIGHT:hr,VIEWPORT_WIDTH:ur,allScreens:U,allStepIds:ft,applyPrototypeAction:gt,definePrototypeElement:xr,describePrototypeAction:yt,emptyPrototypeBase:ht,findActivity:L,findPreview:I,findScreen:C,findStep:k,findStory:$,flattenSteps:W,parsePrototypeBase:ut,prototypeAction:ie,prototypeActions:g,prototypeBaseSchema:dt,prototypeCommentTargets:Rt,prototypeDefinitionFor:Vt,prototypeMessages:be,prototypePageHeading:Dt,prototypeTargetLabel:xt,prototypeTitle:Ue,renderFrame:Ge,renderNav:sr,renderStage:gr,resolvePrototypeNavigation:ke,serializePrototypeAction:kt},Symbol.toStringTag,{value:"Module"}));export{xr as d,io as i};