dev-process-kit 0.3.0-beta.2 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -8
- package/dist/boards.js +1 -1
- package/dist/chunks/shared-BFraiskj.js +3662 -0
- package/dist/chunks/{shared-B-DAJvq3.js → shared-BYbcHniE.js} +34 -34
- package/dist/chunks/{shared-D2qgtKhc.js → shared-B_Tiv_T3.js} +1 -1
- package/dist/chunks/shared-BfByEotW.js +6322 -0
- package/dist/chunks/{shared-CPNa9lTa.js → shared-Bs2YYFvO.js} +1 -1
- package/dist/chunks/shared-D4PPk0Dk.js +1 -0
- package/dist/chunks/shared-DMksNmni.js +1 -0
- package/dist/chunks/{shared-Dgse8blZ.js → shared-DNsl9DK1.js} +1 -1
- package/dist/chunks/shared-DYDJzB79.js +5222 -0
- package/dist/chunks/shared-DegJ_tfw.js +767 -0
- package/dist/chunks/{shared-C7wOrDIL.js → shared-DqlTHpRQ.js} +1 -1
- package/dist/chunks/{shared-BdIN9A6O.js → shared-FMBoDqPg.js} +1 -1
- package/dist/chunks/shared-Ln6ei2B2.js +1864 -0
- package/dist/chunks/shared-RvLH2Fqp.js +1598 -0
- package/dist/chunks/{shared-BT5Ayp_z.js → shared-TtB-p2Zh.js} +1 -1
- package/dist/chunks/{shared-DOKOFdYm.js → shared-WtWbdwp_.js} +3 -3
- package/dist/chunks/{shared-CPwjSgu0.js → shared-epAjO2d1.js} +1 -1
- package/dist/components.js +1 -1
- package/dist/index.js +1 -1
- package/dist/views/delegation-poker.js +1 -1
- package/dist/views/plain.js +1 -1
- package/dist/views/prototype.js +1 -1
- package/dist/views/slides.js +1 -1
- package/dist/views/task-board.js +1 -1
- package/dist/views/usm.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/shared-BTf38OnF.js +0 -1
- package/dist/chunks/shared-BXejn2ZQ.js +0 -4928
- package/dist/chunks/shared-CE8X9qCv.js +0 -1636
- package/dist/chunks/shared-CpJDPnHA.js +0 -573
- package/dist/chunks/shared-DgexE4u1.js +0 -1862
- package/dist/chunks/shared-DnJcdL52.js +0 -3586
- package/dist/chunks/shared-HdOOfyqP.js +0 -6208
- package/dist/chunks/shared-TrlnHjrJ.js +0 -1
|
@@ -0,0 +1,1864 @@
|
|
|
1
|
+
import{ax as y,bi as Ae,av as D,aM as _,aL as g,ac as u,aw as M,az as he,bj as Yi,aD as Ie,au as Hi,bk as Je,bl as Bi,aa as N,ay as x,b9 as Wi,aB as qi,p as w,a9 as b,t as oe,aO as se,a8 as Fi,N as Gi,e as ji,a5 as Ki,h as Qe,K as _e,S as Y,R as Xi,P as k,as as l,ai as h,bm as Pe,bn as De,aH as Zi,y as Re,aP as et,l as tt,b0 as q,bo as Ji,z as it,bp as nt,G as Qi,I as en,b4 as tn,b5 as nn,ah as on,V as ot,ag as sn,bq as rn,aE as an,aF as ve,aG as st,C as dn,br as ln}from"./shared-DYDJzB79.js";import{c as pn,a as cn}from"./shared-TtB-p2Zh.js";import{m as un}from"./shared-B_Tiv_T3.js";import{h as rt,d as at,e as hn,f as vn,a as dt,b as lt,i as pt,p as fn,r as gn,k as mn,l as yn,m as wn,g as bn,c as kn,s as xn,n as ct,j as ut,t as En}from"./shared-WtWbdwp_.js";const Sn=[["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"}]],$n=[["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"}]],Tn=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2"}],["path",{d:"M12 18h.01"}]],An=[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2"}],["line",{x1:"12",x2:"12.01",y1:"18",y2:"18"}]],In=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"}],["circle",{cx:"12",cy:"7",r:"4"}]],_n=[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72"}],["path",{d:"m14 7 3 3"}],["path",{d:"M5 6v4"}],["path",{d:"M19 14v4"}],["path",{d:"M10 2v2"}],["path",{d:"M7 8H3"}],["path",{d:"M21 16h-4"}],["path",{d:"M11 3H9"}]],ht=["browser","native","mail","plain"],vt=["mobile","tablet","desktop","fluid"],J=t=>"screen"in t,Pn=D({from:g(u()),to:g(u()),cc:g(u()),subject:g(u()),date:g(u())}),ft={id:_,kind:M(he(ht),"browser"),viewport:M(he(vt),"fluid"),label:g(u()),url:g(u()),mail:g(Pn)},Ne=y(u(),Ae(t=>t.trim()!=="","a note needs some text")),gt=y(u(),Yi()),Dn=D({id:_,selector:y(u(),x(1)),text:g(u()),body:Ne,createdAt:g(gt)}),mt='a preview `mail` envelope needs `"kind": "mail"`',yt=y(D(ft),Ae(t=>t.mail===void 0||t.kind==="mail",mt)),wt=y(D({...ft,notes:g(N(Dn))}),Ae(t=>t.mail===void 0||t.kind==="mail",mt)),bt=D({screen:_,preview:g(_)}),Rn=Ie([bt,D({material:yt})]),Nn=Ie([bt,D({material:wt})]),On=D({id:_,name:y(u(),x(1)),description:g(u()),actor:g(y(u(),x(1))),situation:g(y(u(),x(1))),panes:M(N(Nn),[])}),Cn=D({id:_,name:y(u(),x(1)),description:g(u()),actor:g(y(u(),x(1))),steps:M(N(On),[])}),Mn=D({id:_,name:y(u(),x(1)),description:g(u()),actor:g(y(u(),x(1))),stories:M(N(Cn),[])}),kt=y(u(),x(1)),Ln=D({id:_,label:y(u(),x(1)),description:g(u()),fill:g(Wi(kt,Ie([u(),qi()]))),click:g(N(kt))}),Un=D({id:_,title:y(u(),x(1)),description:g(u()),previews:M(N(wt),[]),actions:M(N(Ln),[])}),Vn=D({id:_,name:y(u(),x(1)),description:g(u()),actor:g(y(u(),x(1))),screens:M(N(Un),[])}),xt=D({title:g(u()),baseUrl:g(u()),apps:M(N(Vn),[]),activities:M(N(Mn),[])}),Et=t=>t.flatMap(e=>J(e)?[]:[e.material]),zn=t=>{const e=new Set,i=new Set,n=a=>{for(const d of a){if(e.has(d.id))return`duplicate preview id "${d.id}": preview ids are global, they name a light DOM slot`;e.add(d.id);for(const p of d.notes??[]){if(i.has(p.id))return`duplicate note id "${p.id}": note ids are global`;i.add(p.id)}}return null},o=new Set,s=new Set;for(const a of t.apps){if(o.has(a.id))return`duplicate app id "${a.id}"`;o.add(a.id);for(const d of a.screens){if(s.has(d.id))return`duplicate screen id "${d.id}": screen ids are global`;s.add(d.id);const p=n(d.previews);if(p!==null)return p;const c=new Set;for(const v of d.actions){if(c.has(v.id))return`duplicate action id "${v.id}" on screen "${d.id}"`;c.add(v.id)}}}const r=new Set;for(const a of t.activities){if(r.has(a.id))return`duplicate activity id "${a.id}"`;r.add(a.id);const d=new Set;for(const p of a.stories){if(d.has(p.id))return`duplicate story id "${p.id}" in activity "${a.id}"`;d.add(p.id);const c=new Set;for(const v of p.steps){if(c.has(v.id))return`duplicate step id "${v.id}" in story "${p.id}"`;c.add(v.id);const f=n(Et(v.panes));if(f!==null)return f}}}return null},St=(t,e)=>{const i=new Map;for(const n of e.panes){if(!J(n))continue;const o=t(n.screen);if(o===void 0)return`unknown screen "${n.screen}" on step "${e.id}": declare it under \`apps[].screens\``;if(n.preview!==void 0&&!o.includes(n.preview))return`preview "${n.preview}" on step "${e.id}" is not a rendition of screen "${n.screen}"`;const s=i.get(n.screen)??[];if(s.length>0&&(n.preview===void 0||s.includes(n.preview)||s.includes(void 0)))return`screen "${n.screen}" is shown twice on step "${e.id}": give each pane a different \`preview\``;i.set(n.screen,[...s,n.preview])}return null},Yn=t=>{const e=new Map(t.apps.flatMap(i=>i.screens.map(n=>[n.id,n.previews.map(o=>o.id)])));for(const i of t.activities.flatMap(n=>n.stories.flatMap(o=>o.steps))){const n=St(o=>e.get(o),i);if(n!==null)return n}return null},Hn=(t,e)=>St(i=>L(t,i)?.screen.previews.map(n=>n.id),e),O="ui",re=t=>{const e=t.text?.replaceAll('"',"'");return`${t.previewId}/${t.selector}${e===void 0?"":` "${e}"`}`},Q=t=>{const e=t.indexOf("/");if(e<=0)return;const i=t.slice(0,e);if(!Bi(_,i))return;const n=t.slice(e+1),o=/ "([^"]*)"$/.exec(n),s=(o?n.slice(0,o.index):n).trim();if(s!=="")return o?.[1]===void 0?{previewId:i,selector:s}:{previewId:i,selector:s,text:o[1]}},$t=t=>{const e=Hi(xt,t),i=zn(e)??Yn(e);if(i!==null)throw new Error(i);return e},Tt=()=>({apps:[],activities:[]}),H=t=>t.apps.flatMap(e=>e.screens.map(i=>({app:e,screen:i}))),L=(t,e)=>{if(e!==void 0)return H(t).find(i=>i.screen.id===e)},fe=(t,e)=>e.panes.flatMap(i=>{const n=J(i)?L(t,i.screen):void 0;return n?[n]:[]}),F=t=>Et(t.panes),Bn=(t,e)=>t.panes.some(i=>J(i)&&i.screen===e),U=(t,e)=>{if(e!==void 0)return t.activities.find(i=>i.id===e)},C=(t,e)=>`${t}.${e}`,$=(t,e)=>{if(e===void 0)return;const i=Je(e,2);if(i){const[o,s]=i;if(o===void 0||s===void 0)return;const r=t.activities.find(d=>d.id===o),a=r?.stories.find(d=>d.id===s);return r&&a?{activity:r,story:a}:void 0}if(e.includes("."))return;const n=t.activities.flatMap(o=>o.stories.filter(s=>s.id===e).map(s=>({activity:o,story:s})));return n.length===1?n[0]:void 0},At=t=>{const e=t.lastIndexOf(".");return e>=0?t.slice(e+1):t},ae=t=>`${t.activity.id}.${t.story.id}.${t.step.id}`,ge=(t,e,i)=>`${t.id}.${e.id}.${i.id}`,S=(t,e)=>{if(e===void 0)return;const i=Je(e,3);if(i){const[o,s,r]=i;if(o===void 0||s===void 0||r===void 0)return;const a=t.activities.find(v=>v.id===o),d=a?.stories.find(v=>v.id===s),p=d?d.steps.findIndex(v=>v.id===r):-1,c=d&&p>=0?d.steps[p]:void 0;return a&&d&&c?{activity:a,story:d,step:c,stepIndex:p}:void 0}if(e.includes("."))return;const n=B(t).filter(o=>o.step.id===e);return n.length===1?n[0]:void 0},E=(t,e)=>{if(e!==void 0){for(const i of H(t)){const n=i.screen.previews.find(o=>o.id===e);if(n)return{owner:{kind:"screen",...i},preview:n}}for(const i of B(t)){const n=F(i.step).find(o=>o.id===e);if(n)return{owner:{kind:"step",...i},preview:n}}}},It=t=>[...H(t).flatMap(e=>e.screen.previews),...B(t).flatMap(e=>F(e.step))],_t=t=>It(t).flatMap(e=>(e.notes??[]).map(i=>i.id)),B=t=>t.activities.flatMap(e=>e.stories.flatMap(i=>i.steps.map((n,o)=>({activity:e,story:i,step:n,stepIndex:o})))),Pt=t=>B(t).map(e=>e.step.id),Oe=y(u(),x(1)),Dt=t=>{const e=Fi(b({noteId:Oe}),t.payload);return`${t.type}|${e.success?e.output.noteId:JSON.stringify(t.payload)}`},m={SET_ACTIVITY_NAME:w("SET_ACTIVITY_NAME","activity",b({name:y(u(),x(1))})),SET_ACTIVITY_DESCRIPTION:w("SET_ACTIVITY_DESCRIPTION","activity",b({description:u()})),SET_STORY_NAME:w("SET_STORY_NAME","story",b({name:y(u(),x(1))})),SET_STORY_DESCRIPTION:w("SET_STORY_DESCRIPTION","story",b({description:u()})),SET_STEP_NAME:w("SET_STEP_NAME","step",b({name:y(u(),x(1))})),SET_STEP_DESCRIPTION:w("SET_STEP_DESCRIPTION","step",b({description:u()})),SET_PREVIEW_KIND:w("SET_PREVIEW_KIND","preview",b({kind:he(ht)})),SET_PREVIEW_VIEWPORT:w("SET_PREVIEW_VIEWPORT","preview",b({viewport:he(vt)})),SET_PREVIEW_LABEL:w("SET_PREVIEW_LABEL","preview",b({label:u()})),REORDER_ACTIVITY:w("REORDER_ACTIVITY","activity",b({after:se(u())}),{mode:"sequence"}),REORDER_STORY:w("REORDER_STORY","story",b({after:se(u())}),{mode:"sequence"}),REORDER_STEP:w("REORDER_STEP","step",b({after:se(u())}),{mode:"sequence"}),MOVE_STORY:w("MOVE_STORY","story",b({toActivity:y(u(),x(1)),after:se(u())}),{mode:"sequence"}),MOVE_STEP:w("MOVE_STEP","step",b({toStory:y(u(),x(1)),after:se(u())}),{mode:"sequence"}),ADD_ACTIVITY:w("ADD_ACTIVITY","page",b({id:_,name:y(u(),x(1)),description:g(u())}),{dedupeKey:oe}),ADD_STORY:w("ADD_STORY","activity",b({id:_,name:y(u(),x(1)),description:g(u())}),{dedupeKey:oe}),ADD_STEP:w("ADD_STEP","story",b({id:_,name:y(u(),x(1)),description:g(u()),panes:g(N(Rn))}),{dedupeKey:oe}),ADD_PREVIEW:w("ADD_PREVIEW","step",yt,{dedupeKey:oe}),DELETE_ACTIVITY:w("DELETE_ACTIVITY","activity",b({})),DELETE_STORY:w("DELETE_STORY","story",b({})),DELETE_STEP:w("DELETE_STEP","step",b({})),DELETE_PREVIEW:w("DELETE_PREVIEW","preview",b({})),ADD_UI_NOTE:w("ADD_UI_NOTE",O,b({id:_,body:Ne,createdAt:g(gt)}),{dedupeKey:oe}),SET_UI_NOTE_BODY:w("SET_UI_NOTE_BODY",O,b({noteId:Oe,body:Ne}),{dedupeKey:Dt}),DELETE_UI_NOTE:w("DELETE_UI_NOTE",O,b({noteId:Oe}),{dedupeKey:Dt})},W={setActivityName:(t,e)=>({type:"SET_ACTIVITY_NAME",target:{type:"activity",id:t},payload:{name:e}}),setActivityDescription:(t,e)=>({type:"SET_ACTIVITY_DESCRIPTION",target:{type:"activity",id:t},payload:{description:e}}),setStoryName:(t,e)=>({type:"SET_STORY_NAME",target:{type:"story",id:t},payload:{name:e}}),setStoryDescription:(t,e)=>({type:"SET_STORY_DESCRIPTION",target:{type:"story",id:t},payload:{description:e}}),setStepName:(t,e)=>({type:"SET_STEP_NAME",target:{type:"step",id:t},payload:{name:e}}),setStepDescription:(t,e)=>({type:"SET_STEP_DESCRIPTION",target:{type:"step",id:t},payload:{description:e}}),setPreviewViewport:(t,e)=>({type:"SET_PREVIEW_VIEWPORT",target:{type:"preview",id:t},payload:{viewport:e}}),setPreviewKind:(t,e)=>({type:"SET_PREVIEW_KIND",target:{type:"preview",id:t},payload:{kind:e}}),setPreviewLabel:(t,e)=>({type:"SET_PREVIEW_LABEL",target:{type:"preview",id:t},payload:{label:e}}),reorderActivity:(t,e)=>({type:"REORDER_ACTIVITY",target:{type:"activity",id:t},payload:{after:e}}),reorderStory:(t,e)=>({type:"REORDER_STORY",target:{type:"story",id:t},payload:{after:e}}),reorderStep:(t,e)=>({type:"REORDER_STEP",target:{type:"step",id:t},payload:{after:e}}),moveStep:(t,e,i)=>({type:"MOVE_STEP",target:{type:"step",id:t},payload:{toStory:e,after:i}}),moveStory:(t,e,i)=>({type:"MOVE_STORY",target:{type:"story",id:t},payload:{toActivity:e,after:i}}),addActivity:(t,e,i)=>({type:"ADD_ACTIVITY",target:{type:"page",id:"prototype"},payload:{id:t,name:e,...i===void 0?{}:{description:i}}}),addStory:(t,e,i,n)=>({type:"ADD_STORY",target:{type:"activity",id:t},payload:{id:e,name:i,...n===void 0?{}:{description:n}}}),addStep:(t,e,i,n)=>({type:"ADD_STEP",target:{type:"story",id:t},payload:{id:e,name:i,...n===void 0?{}:{panes:n}}}),addPreview:(t,e)=>({type:"ADD_PREVIEW",target:{type:"step",id:t},payload:{...e}}),deleteActivity:t=>({type:"DELETE_ACTIVITY",target:{type:"activity",id:t},payload:{}}),deleteStory:t=>({type:"DELETE_STORY",target:{type:"story",id:t},payload:{}}),deleteStep:t=>({type:"DELETE_STEP",target:{type:"step",id:t},payload:{}}),deletePreview:t=>({type:"DELETE_PREVIEW",target:{type:"preview",id:t},payload:{}}),addUiNote:(t,e,i,n)=>({type:"ADD_UI_NOTE",target:{type:O,id:re(t)},payload:{id:e,body:i,...n===void 0?{}:{createdAt:n}}}),setUiNoteBody:(t,e,i)=>({type:"SET_UI_NOTE_BODY",target:{type:O,id:re(t)},payload:{noteId:e,body:i}}),deleteUiNote:(t,e)=>({type:"DELETE_UI_NOTE",target:{type:O,id:re(t)},payload:{noteId:e}})},Rt=(t,e)=>{const i=Gi(m,e);if(i===null)return null;const n=i.target.id;switch(i.type){case"SET_ACTIVITY_NAME":return G(t,n,o=>({...o,name:i.payload.name}));case"SET_ACTIVITY_DESCRIPTION":return G(t,n,o=>({...o,description:i.payload.description}));case"SET_STORY_NAME":return j(t,n,o=>({...o,name:i.payload.name}));case"SET_STORY_DESCRIPTION":return j(t,n,o=>({...o,description:i.payload.description}));case"SET_STEP_NAME":return me(t,n,o=>({...o,name:i.payload.name}));case"SET_STEP_DESCRIPTION":return me(t,n,o=>({...o,description:i.payload.description}));case"SET_PREVIEW_KIND":return ee(t,n,o=>({...o,kind:i.payload.kind}));case"SET_PREVIEW_VIEWPORT":return ee(t,n,o=>({...o,viewport:i.payload.viewport}));case"SET_PREVIEW_LABEL":return ee(t,n,o=>({...o,label:i.payload.label}));case"REORDER_ACTIVITY":{const{after:o}=i.payload,s=de(t.activities,n,o);return s===null?null:{...t,activities:s}}case"REORDER_STORY":{const{after:o}=i.payload,s=$(t,n);if(!s)return null;const r=o===null?null:$(t,o);if(o!==null&&(!r||r.activity!==s.activity))return null;const a=de(s.activity.stories,s.story.id,r?.story.id??null);return a===null?null:G(t,s.activity.id,d=>({...d,stories:a}))}case"REORDER_STEP":{const{after:o}=i.payload,s=S(t,n);if(!s)return null;const r=o===null?null:S(t,o);if(o!==null&&(!r||r.story!==s.story))return null;const a=de(s.story.steps,s.step.id,r?.step.id??null);return a===null?null:j(t,C(s.activity.id,s.story.id),d=>({...d,steps:a}))}case"MOVE_STORY":{const{toActivity:o,after:s}=i.payload,r=$(t,n);if(!r)return null;const a=t.activities.find(v=>v.id===o);if(!a)return null;const d=s===null?null:$(t,s);if(s!==null&&(!d||d.activity!==a))return null;const p=d?.story.id??null;if(r.activity.id===o){const v=de(r.activity.stories,r.story.id,p);return v===null?null:G(t,o,f=>({...f,stories:v}))}if(a.stories.some(v=>v.id===r.story.id))return null;const c=Me(a.stories,r.story,p);return Ce(t,v=>v.id===r.activity.id?{...v,stories:v.stories.filter(f=>f.id!==At(n))}:v.id===o?{...v,stories:c}:v)}case"MOVE_STEP":{const{toStory:o,after:s}=i.payload,r=S(t,n);if(!r)return null;const a=$(t,o);if(!a)return null;const d=s===null?null:S(t,s);if(s!==null&&(!d||d.story!==a.story))return null;const p=d?.step.id??null;if(r.story===a.story){const v=de(r.story.steps,r.step.id,p);return v===null?null:j(t,o,f=>({...f,steps:v}))}if(a.story.steps.some(v=>v.id===r.step.id))return null;const c=Me(a.story.steps,r.step,p);return Ce(t,v=>({...v,stories:v.stories.map(f=>f===r.story?{...f,steps:f.steps.filter(I=>I.id!==At(n))}:f===a.story?{...f,steps:c}:f)}))}case"ADD_ACTIVITY":{const o=i.payload;if(t.activities.some(r=>r.id===o.id))return t;const s={id:o.id,name:o.name,...o.description===void 0?{}:{description:o.description},stories:[]};return{...t,activities:[...t.activities,s]}}case"ADD_STORY":{const o=i.payload,s=t.activities.find(a=>a.id===n);if(!s)return null;if(s.stories.some(a=>a.id===o.id))return t;const r={id:o.id,name:o.name,...o.description===void 0?{}:{description:o.description},steps:[]};return G(t,n,a=>({...a,stories:[...a.stories,r]}))}case"ADD_STEP":{const o=i.payload,s=$(t,n)?.story;if(!s)return null;if(s.steps.some(d=>d.id===o.id))return t;const r=o.panes??[],a={id:o.id,name:o.name,...o.description===void 0?{}:{description:o.description},panes:r};return Wn(t,a)?j(t,n,d=>({...d,steps:[...d.steps,a]})):null}case"ADD_PREVIEW":{const o=i.payload,s=S(t,n)?.step;return s?F(s).some(r=>r.id===o.id)?t:E(t,o.id)?null:me(t,n,r=>({...r,panes:[...r.panes,{material:o}]})):null}case"DELETE_ACTIVITY":{const o=n;return t.activities.some(s=>s.id===o)?{...t,activities:t.activities.filter(s=>s.id!==o)}:null}case"DELETE_STORY":{const o=$(t,n);return o?G(t,o.activity.id,s=>({...s,stories:s.stories.filter(r=>r.id!==o.story.id)})):null}case"DELETE_STEP":{const o=S(t,n);return o?j(t,C(o.activity.id,o.story.id),s=>({...s,steps:s.steps.filter(r=>r.id!==o.step.id)})):null}case"DELETE_PREVIEW":{const o=E(t,n);return o?Nt(t,o.owner,s=>s.filter(r=>r.id!==o.preview.id)):null}case"ADD_UI_NOTE":{const{id:o,body:s,createdAt:r}=i.payload,a=Q(n),d=a===void 0?void 0:E(t,a.previewId);if(a===void 0||d===void 0)return null;if(d.preview.notes?.some(c=>c.id===o&&c.selector===a.selector))return t;if(_t(t).includes(o))return null;const p={id:o,selector:a.selector,...a.text===void 0?{}:{text:a.text},body:s,...r===void 0?{}:{createdAt:r}};return ee(t,d.preview.id,c=>({...c,notes:[...c.notes??[],p]}))}case"SET_UI_NOTE_BODY":{const{noteId:o,body:s}=i.payload,r=Q(n),a=r===void 0?void 0:E(t,r.previewId);return a?.preview.notes?.some(d=>d.id===o)?ee(t,a.preview.id,d=>({...d,notes:(d.notes??[]).map(p=>p.id===o?{...p,body:s}:p)})):null}case"DELETE_UI_NOTE":{const{noteId:o}=i.payload,s=Q(n),r=s===void 0?void 0:E(t,s.previewId);return r?.preview.notes?.some(a=>a.id===o)?ee(t,r.preview.id,a=>{const d=(a.notes??[]).filter(v=>v.id!==o),{notes:p,...c}=a;return d.length===0?c:{...c,notes:d}}):null}default:return ji(i)}},Ce=(t,e)=>({...t,activities:t.activities.map(e)}),G=(t,e,i)=>{const n=e;return t.activities.some(o=>o.id===n)?Ce(t,o=>o.id===n?i(o):o):null},j=(t,e,i)=>{const n=$(t,e);if(!n)return null;const o=n.story.id;return G(t,n.activity.id,s=>({...s,stories:s.stories.map(r=>r.id===o?i(r):r)}))},me=(t,e,i)=>{const n=S(t,e);if(!n)return null;const o=n.step.id;return j(t,C(n.activity.id,n.story.id),s=>({...s,steps:s.steps.map(r=>r.id===o?i(r):r)}))},ee=(t,e,i)=>{const n=E(t,e);if(!n)return null;const o=n.preview.id;return Nt(t,n.owner,s=>s.map(r=>r.id===o?i(r):r))},Wn=(t,e)=>{const i=F(e).map(n=>n.id);return Hn(t,e)===null&&new Set(i).size===i.length&&!i.some(n=>E(t,n))},Nt=(t,e,i)=>{if(e.kind==="step")return me(t,ae(e),o=>{const s=new Map(i([...F(o)]).map(r=>[r.id,r]));return{...o,panes:o.panes.flatMap(r=>{if(J(r))return[r];const a=s.get(r.material.id);return a?[{material:a}]:[]})}});const n=e.screen.id;return{...t,apps:t.apps.map(o=>o.id===e.app.id?{...o,screens:o.screens.map(s=>s.id===n?{...s,previews:i(s.previews)}:s)}:o)}},de=(t,e,i)=>{const n=t.findIndex(r=>r.id===e);if(n<0||i!==null&&!t.some(r=>r.id===i))return null;if(e===i)return[...t];const o=t[n];if(o===void 0)return null;const s=t.filter(r=>r.id!==e);return Me(s,o,i)},Me=(t,e,i)=>{const n=[...t],o=i===null?-1:n.findIndex(s=>s.id===i);return n.splice(o+1,0,e),n},Ot={"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"'},qn={"laptop-13":'13" laptop',"laptop-15":'15" laptop',"full-hd":"Full HD","monitor-27":'27" monitor',ultrawide:"Ultrawide"},Fn={"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"},le=Ki({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:t=>`Reorder ${t}`,addTitle:t=>`Add ${t}`,toFront:"\u2192 To the front",afterName:t=>`\u2192 Right after "${t}"`,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:(t,e)=>`${t} \xB7 ${e}`,targetMissing:(t,e)=>`${t} \xB7 ${e} (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:t=>`Used by ${t}`,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",commentOnElement:"Comment on element",uiCommentPin:(t,e)=>`Comment ${t}: ${e}`,uiCommentAs:"What it is",uiCommentFeedback:"Review comment",uiCommentFeedbackHint:"Sent to the Agent as a message. Gone once it is reflected.",uiCommentNote:"Note",uiCommentNoteHint:"Kept on the element as part of the prototype, shown as a badge in the scenario view.",uiNoteSubmit:"Keep",uiNotes:t=>t===1?"1 note":`${t} notes`,uiNotesOn:t=>`Notes on ${t}`,uiNoteDate:t=>Ct("en-US",t),deleteUiNoteAria:"Delete the note",editUiNoteAria:"Edit the note",editUiNoteLabel:"Note",editUiNoteHint:"Ctrl/Cmd + Enter to save, Esc to close",saveUiNote:"Save",cancelUiNote:"Cancel",closeUiNotes:"Close",addUiNote:"Add a note",editUiNote:"Edit a note",deleteUiNote:"Delete a note",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:t=>`Profile: ${t}`,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:t=>Ot[t]??qn[t]??t,deviceZoom:t=>`Shown at ${t}% to fit`,actions:"Actions",actionsHint:"Make the screen do something in one go, e.g. fill its form with sample data"},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:t=>`${t} \u306E\u9806\u5E8F\u3092\u5909\u66F4`,addTitle:t=>`${t} \u3092\u8FFD\u52A0`,toFront:"\u2192 \u5148\u982D\u3078",afterName:t=>`\u2192 "${t}" \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:(t,e)=>`${t} \xB7 ${e}`,targetMissing:(t,e)=>`${t} \xB7 ${e} (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:t=>`\u5229\u7528\u8005: ${t}`,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",commentOnElement:"\u8981\u7D20\u306B\u30B3\u30E1\u30F3\u30C8",uiCommentPin:(t,e)=>`\u30B3\u30E1\u30F3\u30C8 ${t}: ${e}`,uiCommentAs:"\u30B3\u30E1\u30F3\u30C8\u306E\u7A2E\u985E",uiCommentFeedback:"\u30EC\u30D3\u30E5\u30FC\u30B3\u30E1\u30F3\u30C8",uiCommentFeedbackHint:"Agent \u3078\u306E\u30E1\u30C3\u30BB\u30FC\u30B8\u3068\u3057\u3066\u9001\u4FE1\u3055\u308C\u307E\u3059\u3002\u53CD\u6620\u3055\u308C\u308B\u3068\u6D88\u3048\u307E\u3059\u3002",uiCommentNote:"\u30E1\u30E2",uiCommentNoteHint:"\u30D7\u30ED\u30C8\u30BF\u30A4\u30D7\u306E\u4E00\u90E8\u3068\u3057\u3066\u8981\u7D20\u306B\u6B8B\u308A\u3001\u30B7\u30CA\u30EA\u30AA\u30D3\u30E5\u30FC\u3067\u30D0\u30C3\u30B8\u3068\u3057\u3066\u8868\u793A\u3055\u308C\u307E\u3059\u3002",uiNoteSubmit:"\u6B8B\u3059",uiNotes:t=>`\u30E1\u30E2 ${t} \u4EF6`,uiNotesOn:t=>`${t} \u306E\u30E1\u30E2`,uiNoteDate:t=>Ct("ja-JP",t),deleteUiNoteAria:"\u30E1\u30E2\u3092\u524A\u9664",editUiNoteAria:"\u30E1\u30E2\u3092\u7DE8\u96C6",editUiNoteLabel:"\u30E1\u30E2",editUiNoteHint:"Ctrl/Cmd + Enter \u3067\u4FDD\u5B58\u3001Esc \u3067\u9589\u3058\u308B",saveUiNote:"\u4FDD\u5B58",cancelUiNote:"\u30AD\u30E3\u30F3\u30BB\u30EB",closeUiNotes:"\u9589\u3058\u308B",addUiNote:"\u30E1\u30E2\u3092\u8FFD\u52A0",editUiNote:"\u30E1\u30E2\u3092\u7DE8\u96C6",deleteUiNote:"\u30E1\u30E2\u3092\u524A\u9664",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:t=>`\u30D7\u30ED\u30D5\u30A3\u30FC\u30EB: ${t}`,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:t=>Ot[t]??Fn[t]??t,deviceZoom:t=>`\u53CE\u307E\u308B\u3088\u3046 ${t}% \u3067\u8868\u793A`,actions:"\u30A2\u30AF\u30B7\u30E7\u30F3",actionsHint:"\u30D5\u30A9\u30FC\u30E0\u306B\u30B5\u30F3\u30D7\u30EB\u30C7\u30FC\u30BF\u3092\u5165\u308C\u308B\u306A\u3069\u3001\u753B\u9762\u306B\u7528\u610F\u3055\u308C\u305F\u64CD\u4F5C\u3092\u4E00\u5EA6\u306B\u884C\u3046"}}),Ct=(t,e)=>new Intl.DateTimeFormat(t,{dateStyle:"medium",timeStyle:"short"}).format(new Date(e)),Gn=["scenario","app"],V="view",pe=t=>t[V]==="app"?"app":"scenario",Mt=t=>({[V]:t==="app"?"app":null}),ce=(t,e)=>t===void 0?`\u2192 "${e}"`:`"${t}" \u2192 "${e}"`,jn=t=>({SET_ACTIVITY_NAME:(e,i)=>({title:t.renameActivity,tone:"update",body:ce(U(i,e.target.id)?.name,k(m.SET_ACTIVITY_NAME,e).name)}),SET_ACTIVITY_DESCRIPTION:(e,i)=>({title:t.updateActivityDescription,tone:"update",body:ye(U(i,e.target.id)?.description,k(m.SET_ACTIVITY_DESCRIPTION,e).description)}),SET_STORY_NAME:(e,i)=>({title:t.renameStory,tone:"update",body:ce($(i,e.target.id)?.story.name,k(m.SET_STORY_NAME,e).name)}),SET_STORY_DESCRIPTION:(e,i)=>({title:t.updateStoryDescription,tone:"update",body:ye($(i,e.target.id)?.story.description,k(m.SET_STORY_DESCRIPTION,e).description)}),SET_STEP_NAME:(e,i)=>({title:t.renameStep,tone:"update",body:ce(S(i,e.target.id)?.step.name,k(m.SET_STEP_NAME,e).name)}),SET_STEP_DESCRIPTION:(e,i)=>({title:t.updateStepDescription,tone:"update",body:ye(S(i,e.target.id)?.step.description,k(m.SET_STEP_DESCRIPTION,e).description)}),SET_PREVIEW_KIND:(e,i)=>({title:t.changePreviewKind,tone:"update",body:ce(E(i,e.target.id)?.preview.kind,k(m.SET_PREVIEW_KIND,e).kind)}),SET_PREVIEW_VIEWPORT:(e,i)=>({title:t.changePreviewViewport,tone:"update",body:ce(E(i,e.target.id)?.preview.viewport,k(m.SET_PREVIEW_VIEWPORT,e).viewport)}),SET_PREVIEW_LABEL:e=>({title:t.changePreviewLabel,tone:"update",body:`\u2192 "${k(m.SET_PREVIEW_LABEL,e).label}"`}),REORDER_ACTIVITY:e=>Ue(t,t.activityGroup,k(m.REORDER_ACTIVITY,e).after),REORDER_STORY:e=>Ue(t,t.storyGroup,k(m.REORDER_STORY,e).after),REORDER_STEP:e=>Ue(t,t.stepGroup,k(m.REORDER_STEP,e).after),MOVE_STORY:(e,i)=>({title:t.moveStory,tone:"move",body:`\u2192 ${U(i,k(m.MOVE_STORY,e).toActivity)?.name??k(m.MOVE_STORY,e).toActivity}`}),MOVE_STEP:(e,i)=>({title:t.moveStep,tone:"move",body:`\u2192 ${$(i,k(m.MOVE_STEP,e).toStory)?.story.name??k(m.MOVE_STEP,e).toStory}`}),ADD_ACTIVITY:e=>we(t,t.activityGroup,k(m.ADD_ACTIVITY,e).name),ADD_STORY:e=>we(t,t.storyGroup,k(m.ADD_STORY,e).name),ADD_STEP:e=>we(t,t.stepGroup,k(m.ADD_STEP,e).name),ADD_PREVIEW:e=>we(t,t.previewGroup,k(m.ADD_PREVIEW,e).label??k(m.ADD_PREVIEW,e).id),DELETE_ACTIVITY:(e,i)=>be(t,U(i,e.target.id)?.name),DELETE_STORY:(e,i)=>be(t,$(i,e.target.id)?.story.name),DELETE_STEP:(e,i)=>be(t,S(i,e.target.id)?.step.name),DELETE_PREVIEW:(e,i)=>be(t,E(i,e.target.id)?.preview.label),ADD_UI_NOTE:e=>({title:t.addUiNote,tone:"create",body:`+ "${Le(k(m.ADD_UI_NOTE,e).body)}"`}),SET_UI_NOTE_BODY:(e,i)=>{const{noteId:n,body:o}=k(m.SET_UI_NOTE_BODY,e);return{title:t.editUiNote,tone:"update",body:ye(Yt(i,n)?.body,o)}},DELETE_UI_NOTE:(e,i)=>{const{noteId:n}=k(m.DELETE_UI_NOTE,e),o=Yt(i,n);return{title:t.deleteUiNote,tone:"delete",body:o===void 0?t.unknownTarget:`\u2212 "${Le(o.body)}"`}}}),ye=(t,e)=>{const i=e.length>90?`${e.slice(0,90)}\u2026`:e;return t===void 0||t===""?`\u2192 "${i}"`:`"${Le(t)}" \u2192 "${i}"`},Le=t=>t.length>60?`${t.slice(0,60)}\u2026`:t,Ue=(t,e,i)=>({title:t.reorderTitle(e),tone:"move",body:i===null?t.toFront:t.afterName(i)}),we=(t,e,i)=>({title:t.addTitle(e),tone:"create",body:`+ "${i}"`}),be=(t,e)=>({title:t.deleteTitle,tone:"delete",body:e===void 0?t.unknownTarget:`\u2212 "${e}"`}),Lt=(t,e,i,n)=>{const o=jn(t),s=Object.hasOwn(o,e.type)?o[e.type]:void 0,r=s?s(e,n??i):{title:e.type,tone:"meta"};return{title:r.title,targetLabel:Vt(t,i,e.target),tone:r.tone,...r.body===void 0?{}:{summary:r.body}}},Ut=t=>`${t.type} ${Y(t.target)} ${JSON.stringify(t.payload)}`,Vt=(t,e,i)=>{switch(i.type){case"activity":{const n=U(e,i.id);return n?t.targetLabel(t.activityGroup,n.name):t.targetMissing(t.activityGroup,i.id)}case"story":{const n=$(e,i.id)?.story;return n?t.targetLabel(t.storyGroup,n.name):t.targetMissing(t.storyGroup,i.id)}case"step":{const n=S(e,i.id)?.step;return n?t.targetLabel(t.stepGroup,n.name):t.targetMissing(t.stepGroup,i.id)}case"screen":{const n=L(e,i.id)?.screen;return n?t.targetLabel(t.screenGroup,n.title):t.targetMissing(t.screenGroup,i.id)}case"preview":{const n=E(e,i.id)?.preview;return n?t.targetLabel(t.previewGroup,n.label??n.id):t.targetMissing(t.previewGroup,i.id)}case"page":return t.targetLabel(t.pageGroup,He(e));case O:{const n=Q(i.id),o=n?E(e,n.previewId)?.preview:void 0;return n&&o?t.targetLabel(t.uiGroup,Ve(o,n)):t.targetMissing(t.uiGroup,i.id)}default:return t.targetLabel(i.type,i.id)}},Ve=(t,e)=>{const i=e.text===void 0?e.selector:`"${e.text}"`;return`${t.label??t.id} \u203A ${i}`},zt=(t,e)=>{const i=[];for(const n of t){if(n.target.type!==O)continue;const o=Q(n.target.id);!o||!e.includes(o.previewId)||i.push({id:n.id,previewId:o.previewId,selector:o.selector,number:i.length+1,body:Qe(n)})}return i},Kn=(t,e)=>e.flatMap(i=>{const n=E(t,i)?.preview,o=new Map;for(const s of n?.notes??[])o.set(s.selector,[...o.get(s.selector)??[],s]);return n===void 0?[]:[...o].map(([s,r])=>({previewId:i,selector:s,label:Ve(n,{selector:s,...Xn(r)}),notes:r}))}),Xn=t=>{const e=[...t].reverse().find(i=>i.text!==void 0)?.text;return e===void 0?{}:{text:e}},Yt=(t,e)=>It(t).flatMap(i=>i.notes??[]).find(i=>i.id===e),Ht=(t,e)=>zt(t,e).length,Zn=/^[a-z][a-z0-9+.-]*:/i,Jn=t=>{const e=t.baseUrl?.trim(),i=Xi(t.title??"");return`${(e?e.startsWith("http")?e:`https://${e}`:`https://${i==="item"?"page":i}.example.com`).replace(/\/+$/,"")}/`},ke=(t,e)=>{const i=Jn(t);if(!e.url)return`${i}${e.id}`;if(Zn.test(e.url))return e.url;try{return decodeURI(new URL(e.url,i).href)}catch{return e.url}},Qn=t=>{switch(t.type){case"activity":return{[V]:null,activity:t.id};case"story":return{[V]:null,activity:null,story:t.id};case"step":return{[V]:null,activity:null,story:null,step:t.id};case"screen":return{screen:t.id};default:return null}},Bt=(t,e)=>{const i=t.kind==="screen"?[{type:"screen",id:t.screen.id}]:[{type:"activity",id:t.activity.id},{type:"story",id:C(t.activity.id,t.story.id)},...t.kind==="step"?[{type:"step",id:ae(t)}]:[]];for(const n of e?.panes??[])n.kind==="screen"&&i.push({type:"screen",id:n.screen.screen.id});return[...new Set(i.map(Y))].join(" ")},ze=",",Wt=t=>t.preview?.split(ze)??[],eo=(t,e)=>t.kind===e.kind&&t.viewport===e.viewport,qt=(t,e,i)=>{const n=e.find(s=>i.includes(s.id));if(n)return n;const o=i.flatMap(s=>E(t,s)?.preview??[]);return e.find(s=>o.some(r=>eo(s,r)))??e[0]},Ft=(t,e,i,n)=>{const o=e.screen.previews,s=i===void 0?qt(t,o,Wt(n)):o.find(a=>a.id===i);if(!s)return;const r=i===void 0&&o.length>1;return{kind:"screen",screen:e,preview:s,pinned:i!==void 0,tabs:r?o:[]}},Gt=t=>({layout:t.length>1?"side-by-side":"single",panes:t,shown:t.map(e=>e.preview)}),jt=(t,e,i)=>e.panes.flatMap(n=>{if(!J(n))return[{kind:"material",preview:n.material}];const o=L(t,n.screen),s=o&&Ft(t,o,n.preview,i);return s?[s]:[]}),Ye=(t,e,i)=>{if(e.kind==="screen"){const n=Ft(t,e,void 0,i);return Gt(n?[n]:[])}return Gt(jt(t,e.step,i))},to=(t,e)=>t.panes.flatMap(i=>i.kind!=="screen"||i.tabs.length===0?[]:[i.tabs.some(n=>n.id===e)?e:i.preview.id]).join(ze),Kt=(t,e)=>{const i=new Map;for(const n of e){const o=E(t,n)?.owner;if(o?.kind!=="screen"||o.screen.actions.length===0)continue;const s=i.get(o.screen.id)??{screen:o.screen,previewIds:[]};s.previewIds.push(n),i.set(o.screen.id,s)}return[...i.values()].map(({screen:n,previewIds:o})=>({screen:n,previewIds:o,actions:n.actions}))},io=(t,e)=>[...F(e),...fe(t,e).flatMap(i=>i.screen.previews)],no=["activity","story","step","screen","preview"],oo=(t,e,i)=>{switch(e){case"activity":return U(t,i)!==void 0;case"story":return $(t,i)!==void 0||t.activities.some(n=>n.stories.some(o=>o.id===i));case"step":return S(t,i)!==void 0||B(t).some(n=>n.step.id===i);case"screen":return L(t,i)!==void 0;case"preview":return E(t,i)!==void 0;default:return!1}},so=(t,e)=>{let i;if(e.navigate!==null)i=e.navigate.includes("=")?e.navigate:`step=${e.navigate}`;else{const s=e.href?.trim()??"";if(s===""||s==="#"||s.toLowerCase().startsWith("javascript:"))return"no-destination";if(!s.startsWith("#"))return null;i=s}const n=_e(i),o=no.filter(s=>n[s]!==void 0);return o.length===0?e.navigate===null?null:"unknown-target":o.every(s=>oo(t,s,n[s]??""))?null:"unknown-target"},ro=(t,e)=>{const i=e.mail??{},n=[{label:t.mailFrom,value:i.from},{label:t.mailTo,value:i.to},{label:t.mailCc,value:i.cc},{label:t.mailDate,value:i.date}].flatMap(r=>r.value===void 0||r.value.trim()===""?[]:[{label:r.label,value:r.value}]),o=i.from?.replace(/<[^>]*>/g,"").replace(/["']/g,"").trim()||i.from?.trim(),s=o?Array.from(o)[0]?.toUpperCase():void 0;return{...i.subject===void 0||i.subject.trim()===""?{}:{subject:i.subject},...o?{sender:o}:{},...s===void 0?{}:{initial:s},rows:n}},Xt=(t,e)=>{const i=[];for(const n of e.activities){i.push({value:Y({type:"activity",id:n.id}),label:n.name,group:t.activityGroup});for(const o of n.stories){i.push({value:Y({type:"story",id:C(n.id,o.id)}),label:`${n.name} \u203A ${o.name}`,group:t.storyGroup});for(const s of o.steps)i.push({value:Y({type:"step",id:ge(n,o,s)}),label:`${o.name} \u203A ${s.name}`,group:t.stepGroup})}}for(const{app:n,screen:o}of H(e))i.push({value:Y({type:"screen",id:o.id}),label:`${n.name} \u203A ${o.title}`,group:t.screenGroup});return i},ao=(t,e,i)=>{const n=te(e,i);if(n?.kind==="screen"){const{screen:o}=n;return{value:Y({type:"screen",id:o.id}),label:o.title,group:t.screenGroup}}return n?.kind!=="step"?null:{value:Y({type:"step",id:ae(n)}),label:n.step.name,group:t.stepGroup}},te=(t,e)=>{if(pe(e)==="app"){const s=L(t,e.screen);return s?{kind:"screen",...s}:void 0}const i=S(t,e.step);if(i)return{kind:"step",...i};const n=U(t,e.activity),o=n?.stories.find(s=>s.id===e.story||C(n.id,s.id)===e.story);return n&&o?{kind:"story",activity:n,story:o}:void 0},Zt=(t,e)=>{const i=(d,p)=>p===void 0?{title:d}:{actor:p,title:d};if(e.kind==="screen")return i(e.screen.title,e.app.actor);const{activity:n,story:o,step:s}=e,r=fe(t,s),a=r.length===1?r[0]:void 0;return i(a?.screen.title??s.name,s.actor??o.actor??n.actor??a?.app.actor)},lo=(t,e)=>{const i=e.actor??t.actor;return i===void 0?{title:e.name}:{actor:i,title:e.name}},He=t=>t.title??"UX Prototype",Jt=(t,e)=>(e?t.preview=e:delete t.preview,t),po=(t,e,i)=>{if(!e)return;const n=jt(t,e,i).flatMap(o=>o.kind==="screen"&&!o.pinned?[o.preview.id]:[]);return n.length===0?void 0:n.join(ze)},Qt=(t,e)=>{const i=()=>{if(e.step===void 0&&e.story===void 0)return;const s=ei(t,{...e,[V]:""}),r=S(t,s.step);return r&&fe(t,r.step)[0]},n=L(t,e.screen)??i()??H(t)[0],o={...e,[V]:"app"};for(const s of["activity","story","step"])delete o[s];return n?o.screen=n.screen.id:delete o.screen,Jt(o,n&&qt(t,n.screen.previews,Wt(e))?.id)},co=(t,e,i)=>{const n=r=>Bn(r.step,e);if(i&&n(i))return i;const o=i?.story.steps??[],s=r=>{const a=o[r];return i&&a?{...i,step:a,stepIndex:r}:void 0};for(let r=(i?.stepIndex??0)+1;r<o.length;r+=1){const a=s(r);if(a&&n(a))return a}for(let r=(i?.stepIndex??0)-1;r>=0;r-=1){const a=s(r);if(a&&n(a))return a}return B(t).find(n)},ei=(t,e)=>{const i=U(t,e.activity),n=e.story,o=i?.stories.find(z=>z.id===n||C(i.id,z.id)===n),s=o&&i?{activity:i,story:o}:$(t,n),r=e.step,d=(s&&r?S(t,`${C(s.activity.id,s.story.id)}.${r}`):void 0)??S(t,r),p=e.screen,c=p===void 0?void 0:co(t,p,d);if(p!==void 0&&!c&&L(t,p))return Qt(t,{...e,[V]:"app"});const v=c??d,f=v?.activity??s?.activity??i??t.activities[0],I=v?.story??(s&&s.activity===f?s.story:void 0)??f?.stories[0],P=v?.step??I?.steps[0],T={...e};return delete T.screen,f?T.activity=f.id:delete T.activity,I&&f?T.story=$(t,I.id)?I.id:C(f.id,I.id):delete T.story,P&&I&&f?T.step=S(t,P.id)?P.id:ge(f,I,P):delete T.step,delete T[V],Jt(T,po(t,P,e))},uo=["activity","story","step","screen"],xe=(t,e)=>pe(e)==="app"?Qt(t,e):ei(t,e),ho=(t,e)=>{const i=e.screen.previews.find(s=>s.kind==="browser");if(!i)return;let n;try{n=new URL(ke(t,i),"https://page.example.com")}catch{return}const o=n.pathname.split("/").filter(s=>s!=="").map(s=>{try{return decodeURIComponent(s)}catch{return s}});return{origin:n.origin,segments:o}},ti=()=>({screens:[],children:new Map}),Be=(t,e,i)=>{const[n,...o]=t.children.entries();if(t.screens.length===0&&n&&o.length===0&&i!=="/"){const[s,r]=n;return Be(r,`${e}/${s}`,`${i}/${s}`)}return{segment:e,path:i,screens:t.screens,children:[...t.children.entries()].map(([s,r])=>Be(r,`/${s}`,`${i==="/"?"":i}/${s}`))}},vo=t=>{const e=new Map;for(const[i,n]of t){const o=e.get(n.origin)??ti();e.set(n.origin,o);let s=o;for(const r of n.segments){const a=s.children.get(r)??ti();s.children.set(r,a),s=a}s.screens.push(i)}return[...e.entries()].map(([i,n])=>({origin:i,root:Be(n,"/","/")}))},fo=(t,e)=>{const i=e.screens.map(s=>({app:e,screen:s})),n=[],o=[];for(const s of i){const r=ho(t,s);r?n.push([s,r]):o.push(s)}return{app:e,screens:i,trees:vo(n),others:o}},ii=t=>t.apps.map(e=>fo(t,e)).filter(e=>e.screens.length>0),ni=(t,e)=>e?.kind!=="screen"?t[0]:t.find(i=>i.app.id===e.app.id)??t[0],go=(t,e)=>{switch(e.type){case"activity":return U(t,e.id)!==void 0;case"story":return $(t,e.id)!==void 0;case"step":return S(t,e.id)!==void 0;case"screen":return L(t,e.id)!==void 0;case"preview":return E(t,e.id)!==void 0;case"page":return!0;case O:{const i=Q(e.id);return i!==void 0&&E(t,i.previewId)!==void 0}default:return!1}},oi=t=>{const e=le(t);return{kind:"view",name:"prototype",label:"UX Prototype",addable:!1,parseBase:$t,emptyBase:Tt,actions:m,apply:Rt,hasTarget:go,canonicalTarget:(i,n)=>{if(n.type==="step"){const o=S(i,n.id);return o?{...n,id:ae(o)}:n}if(n.type==="story"){const o=$(i,n.id);return o?{...n,id:C(o.activity.id,o.story.id)}:n}if(n.type==="preview"){const o=E(i,n.id);return o?{...n,id:o.preview.id}:n}return n},describe:(i,n,o)=>Lt(e,i,n,o),serialize:Ut,resolveNavigation:xe,navigationHierarchy:uo,navigationFor:(i,n)=>Qn(n),commentTargets:(i,n)=>Xt(e,i),currentTarget:(i,n)=>ao(e,i,n),title:He}},mo=(t,e)=>{const i=e.flatMap(n=>{const o=Math.max(n.left,t.left)-t.left,s=Math.max(n.top,t.top)-t.top,r=Math.min(n.right,t.right)-t.left-o,a=Math.min(n.bottom,t.bottom)-t.top-s;return r>0&&a>0?[`M${o} ${s}h${r}v${a}h-${r}Z`]:[]});return i.length===0?"none":`path(evenodd, 'M0 0H${t.width}V${t.height}H0Z ${i.join(" ")}')`},Ee="data-dpk-modal",yo=t=>{try{return t.matches(":modal")}catch{return!1}},si=t=>{t.setAttribute(Ee,""),t.open||t.show()},ri=t=>{Object.hasOwn(t,"showModal")||Object.defineProperty(t,"showModal",{configurable:!0,value:()=>si(t)})},ai=(t,e)=>{if(!yo(e))return;const i=n=>{n.target===e&&(n.stopImmediatePropagation(),t.removeEventListener("close",i,!0))};t.addEventListener("close",i,!0),e.close(),si(e)},di=(t,e)=>{try{return Array.from(t.querySelectorAll(e))}catch{return[]}},wo=(t,e)=>{const i=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(t),"value");i?.set?i.set.call(t,e):t.value=e},bo=t=>t instanceof HTMLInputElement&&(t.type==="checkbox"||t.type==="radio"),ko=(t,e)=>{if(bo(t)){const n=typeof e=="boolean"?e:t.value===e;return typeof e=="string"&&!n?!1:(t.checked=n,!0)}const i=String(e);return t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement?(wo(t,i),!0):(t.textContent=i,!1)},xo=(t,e)=>{const i=[];for(const[n,o]of Object.entries(e)){const s=di(t,n);s.length===0&&i.push(n);for(const r of s)ko(r,o)&&(r.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),r.dispatchEvent(new Event("change",{bubbles:!0})))}return i},Eo=(t,e)=>{const i=[];for(const n of e){const[o]=di(t,n);o instanceof HTMLElement?o.click():i.push(n)}return i},So='a, button, input, select, textarea, label, summary, [role="button"], [role="link"], [role="tab"]',li=/^-?[A-Za-z_][\w-]*$/,pi=40,$o=(t,e)=>{const i=t.closest(So);return i!==null&&i!==e&&e.contains(i)?i:t},Se=t=>{const e=t.replace(/\s+/g," ").trim();if(e==="")return;const i=Array.from(e);return i.length>pi?`${i.slice(0,pi).join("")}\u2026`:e},To=t=>{const e=t.getAttribute("aria-label")??t.getAttribute("title");if(e)return Se(e);const i=t.tagName.toLowerCase();return Se(i==="input"||i==="textarea"||i==="select"?t.getAttribute("placeholder")??t.getAttribute("name")??"":i==="img"?t.getAttribute("alt")??"":t.textContent??"")},Ao=t=>{const e=t.getAttribute("id");if(e&&li.test(e))return`#${e}`;const i=t.tagName.toLowerCase(),n=Array.from(t.classList).filter(a=>li.test(a)).slice(0,2).map(a=>`.${a}`).join(""),o=t.parentElement,s=o?Array.from(o.children).filter(a=>a.tagName===t.tagName):[],r=s.length>1?`:nth-of-type(${s.indexOf(t)+1})`:"";return`${i}${n}${r}`},Io=(t,e,i)=>{try{const n=t.querySelectorAll(e);return n.length===1&&n[0]===i}catch{return!1}},_o=(t,e)=>{const i=[];let n=t;for(;n!==null&&n!==e;){const s=Ao(n);if(i.unshift(s),s.startsWith("#")||Io(e,i.join(" > "),t))break;n=n.parentElement}const o=To(t);return{selector:i.length===0?":scope":i.join(" > "),tag:t.tagName.toLowerCase(),...o===void 0?{}:{text:o}}},Po=(t,e)=>{if(e===":scope")return t;try{return t.querySelector(e)}catch{return null}},ci=(t,e)=>{const i=xe(t,e),n=te(t,i);if(n?.kind!=="screen")return null;const[o]=Ye(t,n,i).shown;return o?.kind!=="browser"?null:{screen:n.screen.id,preview:o.id}},$e=(t,e)=>{const i=te(t,xe(t,{[V]:"app",...e}));return i?.kind==="screen"?i:void 0},Do=(t,e,i)=>{const n=dt(e,i);if(n===null)return null;const o=lt(n);for(const{screen:s}of H(t))for(const r of s.previews){if(r.kind!=="browser")continue;const a=dt(ke(t,r),i);if(a!==null&<(a)===o)return{screen:s.id,preview:r.id}}return null},Ro=(t,e,i)=>e===void 0||e.kind==="new-tab"?i.newTab:e.kind==="unreachable"?rt(e.url):$e(t,e.page)?.screen.title??i.newTab,ui=(t,e)=>{if(e===void 0||e.kind==="new-tab")return"";if(e.kind==="unreachable")return e.url;const i=$e(t,e.page)?.screen.previews.find(n=>n.id===e.page.preview);return i===void 0?"":ke(t,i)},hi=t=>{const e=at(t);for(let i=e.index;i>=0;i-=1){const n=e.history[i];if(n?.kind==="page")return n.page}for(const i of t.tabs){const n=i.history[i.index];if(n?.kind==="page")return n.page}},No=(t,e)=>e===void 0?void 0:$e(t,e)?.app.actor,vi=(t,e,i,n=null)=>{const o=at(e),s=o.history[o.index],r=No(t,hi(e)??n??void 0);return{tabs:e.tabs.map(a=>({id:a.id,title:Ro(t,a.history[a.index],i),url:ui(t,a.history[a.index]),active:a.id===o.id})),entry:s,url:ui(t,s),canBack:vn(e),canForward:hn(e),...r===void 0?{}:{profile:r}}},Oo=t=>hi(t)??null,Co=(t,e)=>{const i=e===null?void 0:$e(t,e),n=ni(ii(t),i),o=[],s=(r,a)=>{for(const{screen:d}of a.screens){const p=d.previews.find(c=>c.kind==="browser");p!==void 0&&o.push({title:d.title,url:`${r}${a.path==="/"?"":a.path}`,page:{screen:d.id,preview:p.id}})}for(const d of a.children)s(r,d)};for(const r of n?.trees??[])s(rt(r.origin),r.root);return o},A=(t,e,i,n)=>({id:e,deviceClass:t,width:i,height:n}),fi=[A("phone","iphone-se",375,667),A("phone","iphone-16",393,852),A("phone","iphone-16-pro-max",440,956),A("phone","pixel-7",412,915),A("phone","galaxy-s24",360,780),A("tablet","ipad-mini",744,1133),A("tablet","ipad-air-11",820,1180),A("tablet","ipad-pro-11",834,1194),A("tablet","ipad-pro-13",1024,1366),A("desktop","laptop-13",1280,800),A("desktop","laptop-15",1440,900),A("desktop","full-hd",1920,1080),A("desktop","monitor-27",2560,1440),A("desktop","ultrawide",3440,1440)],Mo={phone:A("phone","iphone-16",393,852),tablet:A("tablet","ipad-pro-11",834,1194),desktop:A("desktop","laptop-13",1280,800)},gi=t=>t==="mobile"?"phone":t==="tablet"?"tablet":"desktop",Lo=t=>t!=="plain",mi=t=>fi.filter(e=>e.deviceClass===t),Uo=(t,e)=>{const i=gi(t),n=e[i];return mi(i).find(o=>o.id===n)??Mo[i]},Vo=(t,e)=>{const i=fi.find(n=>n.id===e);return i===void 0||t[i.deviceClass]===e?t:{...t,[i.deviceClass]:e}},zo=(t,e)=>`${t.deviceName(e.id)} \xB7 ${e.width}\xD7${e.height}`,Yo=(t,e)=>{const i=[1,e.width/t.width];e.height!==void 0&&i.push(e.height/t.height);const n=Math.min(...i);return!Number.isFinite(n)||n<=0?1:Math.max(.1,Math.floor(n*100)/100)},yi=(t,e,i)=>{const{state:n,navigation:o}=t,s=te(n,o),r=pe(o);return l`
|
|
2
|
+
<div class="nav">
|
|
3
|
+
${Wo(t,e,r)}
|
|
4
|
+
${r==="app"?qo(t,e,s,i.app):s!==void 0&&s.kind!=="screen"?jo(t,e,s,i):l`<p class="nav-empty">${e.noActivityBefore}<code>activities</code>${e.noActivityAfter}</p>`}
|
|
5
|
+
</div>
|
|
6
|
+
`},Ho={scenario:"viewScenario",app:"viewApp"},Bo={scenario:"viewScenarioHint",app:"viewAppHint"},Wo=(t,e,i)=>l`<nav class="dpk-segmented view-switch" aria-label=${e.viewLabel}>
|
|
7
|
+
${Gn.map(n=>l`<a
|
|
8
|
+
class="view-option"
|
|
9
|
+
href=${t.hashFor(Mt(n))}
|
|
10
|
+
title=${e[Bo[n]]}
|
|
11
|
+
aria-current=${n===i?"page":h}
|
|
12
|
+
data-view=${n}
|
|
13
|
+
>${e[Ho[n]]}</a
|
|
14
|
+
>`)}
|
|
15
|
+
</nav>`,qo=(t,e,i,n)=>{const o=i?.kind==="screen"?i:void 0,s=ii(t.state),r=ni(s,i),a={context:t,currentId:o?.screen.id},d=r?.others??[];return l`
|
|
16
|
+
${s.length>1&&r?Fo(t,e,s,r,n):h}
|
|
17
|
+
${s.length===1&&r?.app.description?l`<p class="app-description">${r.app.description}</p>`:h}
|
|
18
|
+
<div class="steps-head">
|
|
19
|
+
<span class="dpk-label">${e.appScreens}</span>
|
|
20
|
+
<span class="dpk-label">${r?.screens.length??0}</span>
|
|
21
|
+
</div>
|
|
22
|
+
<p class="app-hint">${e.appScreensHint}</p>
|
|
23
|
+
${r?.trees.map(p=>l`<section class="app-tree">
|
|
24
|
+
<h3 class="app-origin">${Go(p.origin)}</h3>
|
|
25
|
+
<ul class="tree">
|
|
26
|
+
${wi(a,p.root,0)}
|
|
27
|
+
</ul>
|
|
28
|
+
</section>`)}
|
|
29
|
+
${d.length===0?h:l`<section class="app-group">
|
|
30
|
+
${(r?.trees.length??0)>0?l`<h3 class="app-group-heading">${e.appOutsideBrowser}</h3>`:h}
|
|
31
|
+
<ul class="steps app-screens">
|
|
32
|
+
${d.map(p=>{const c=bi(a,p);return l`<li class="step-row" data-current=${String(c)}>
|
|
33
|
+
<a class="step-link" href=${xi(t,p)} aria-current=${c?"page":h}>
|
|
34
|
+
<span class="step-name">${p.screen.title}</span>
|
|
35
|
+
${Ei(t,p)}
|
|
36
|
+
</a>
|
|
37
|
+
</li>`})}
|
|
38
|
+
</ul>
|
|
39
|
+
</section>`}
|
|
40
|
+
${o?.screen.description?l`<div class="detail">
|
|
41
|
+
<div class="screen-description dpk-prose">${Pe(De(o.screen.description))}</div>
|
|
42
|
+
</div>`:h}
|
|
43
|
+
`},Fo=(t,e,i,n,o)=>l`<div class="field">
|
|
44
|
+
<span class="dpk-label">${e.appSelectLabel}</span>
|
|
45
|
+
${o.render({options:i.map((s,r)=>({value:String(r),label:s.app.name})),value:String(i.indexOf(n)),onChange:s=>{const r=i[Number(s)]?.screens[0];r&&t.navigate(ki(r))},ariaLabel:e.appSelectLabel})}
|
|
46
|
+
${n.app.description?l`<p class="app-description">${n.app.description}</p>`:h}
|
|
47
|
+
</div>`,wi=(t,e,i)=>l`<li
|
|
48
|
+
class="tree-node"
|
|
49
|
+
>
|
|
50
|
+
${e.screens.length===0&&i===0?h:e.screens.length===0?l`<div class="tree-row" data-depth=${String(i)} data-current="false">
|
|
51
|
+
<span class="tree-link" title=${e.path}><code class="tree-path">${e.segment}</code></span>
|
|
52
|
+
</div>`:e.screens.map(n=>{const o=bi(t,n);return l`<div class="tree-row" data-depth=${String(i)} data-current=${String(o)}>
|
|
53
|
+
<a
|
|
54
|
+
class="tree-link"
|
|
55
|
+
href=${xi(t.context,n)}
|
|
56
|
+
title=${e.path}
|
|
57
|
+
aria-current=${o?"page":h}
|
|
58
|
+
>
|
|
59
|
+
<code class="tree-path">${e.segment}</code>
|
|
60
|
+
<span class="tree-title">${n.screen.title}</span>
|
|
61
|
+
${Ei(t.context,n)}
|
|
62
|
+
</a>
|
|
63
|
+
</div>`})}
|
|
64
|
+
${e.children.length>0?l`<ul class="tree">
|
|
65
|
+
${e.children.map(n=>wi(t,n,i+1))}
|
|
66
|
+
</ul>`:h}
|
|
67
|
+
</li>`,bi=(t,e)=>e.screen.id===t.currentId,ki=t=>({screen:t.screen.id,preview:null}),xi=(t,e)=>t.hashFor(ki(e)),Ei=(t,e)=>{const i=t.commentCount({type:"screen",id:e.screen.id})+Ht(t.comments,e.screen.previews.map(n=>n.id));return i>0?l`<span class="step-note">${i}</span>`:h},Go=t=>t.replace(/^[a-z][a-z0-9+.-]*:\/\//i,""),jo=(t,e,i,n)=>{const{state:o}=t,{activity:s,story:r}=i,a=r.steps,d=i.kind==="step"?i.step:void 0,p=i.kind==="step"?ae(i):void 0;return l`
|
|
68
|
+
<div class="field">
|
|
69
|
+
<span class="dpk-label">Activity</span>
|
|
70
|
+
${n.activity.render({options:o.activities.map(c=>({value:c.id,label:c.name})),value:s.id,onChange:c=>t.navigate({activity:c,story:null,step:null}),ariaLabel:"Activity"})}
|
|
71
|
+
</div>
|
|
72
|
+
<div class="field">
|
|
73
|
+
<span class="dpk-label">User Story</span>
|
|
74
|
+
${n.story.render({options:s.stories.map(c=>({value:c.id,label:c.name})),value:r.id,onChange:c=>t.navigate({activity:s.id,story:c,step:null}),ariaLabel:"User Story"})}
|
|
75
|
+
</div>
|
|
76
|
+
<div class="steps-head">
|
|
77
|
+
<span class="dpk-label">Step</span>
|
|
78
|
+
<span class="dpk-label">${a.length}</span>
|
|
79
|
+
</div>
|
|
80
|
+
<ol class="steps">
|
|
81
|
+
${Zi(a,c=>ge(s,r,c),(c,v)=>{const f=ge(s,r,c),I=t.commentCount({type:"step",id:f})+Ht(t.comments,io(o,c).map(P=>P.id));return l`
|
|
82
|
+
<li class="step-row" data-current=${String(c.id===d?.id)}>
|
|
83
|
+
<a class="step-link" href=${t.hashFor({activity:s.id,story:r.id,step:c.id})}>
|
|
84
|
+
<span class="step-index">${String(v+1).padStart(2,"0")}</span>
|
|
85
|
+
<span class="step-name">${c.name}</span>
|
|
86
|
+
${I>0?l`<span class="step-note">${I}</span>`:h}
|
|
87
|
+
</a>
|
|
88
|
+
<span class="row-tools">
|
|
89
|
+
<button
|
|
90
|
+
class="dpk-icon-btn"
|
|
91
|
+
type="button"
|
|
92
|
+
aria-label=${e.deleteStepAria}
|
|
93
|
+
@click=${()=>t.dispatch(W.deleteStep(f))}
|
|
94
|
+
>
|
|
95
|
+
${Re()}
|
|
96
|
+
</button>
|
|
97
|
+
</span>
|
|
98
|
+
</li>
|
|
99
|
+
`})}
|
|
100
|
+
</ol>
|
|
101
|
+
<button class="dpk-btn" type="button" @click=${()=>Xo(t,e,C(s.id,r.id))}>
|
|
102
|
+
${e.addStepButton}
|
|
103
|
+
</button>
|
|
104
|
+
${d?pt(p,l`<div class="detail">
|
|
105
|
+
<div class="detail-row">
|
|
106
|
+
<span class="dpk-label">${e.stepNameLabel}</span>
|
|
107
|
+
<span class="detail-value">
|
|
108
|
+
<dpk-inline-edit
|
|
109
|
+
wrap
|
|
110
|
+
.value=${d.name}
|
|
111
|
+
.label=${e.stepNameLabel}
|
|
112
|
+
@dpk-commit=${et(c=>t.dispatch(W.setStepName(p??d.id,c)))}
|
|
113
|
+
></dpk-inline-edit>
|
|
114
|
+
</span>
|
|
115
|
+
</div>
|
|
116
|
+
<div class="detail-row">
|
|
117
|
+
<span class="dpk-label">${e.descriptionLabel}</span>
|
|
118
|
+
<span class="detail-value">
|
|
119
|
+
<dpk-inline-edit
|
|
120
|
+
multiline
|
|
121
|
+
markdown
|
|
122
|
+
.value=${d.description??""}
|
|
123
|
+
.placeholder=${e.descriptionPlaceholder}
|
|
124
|
+
.label=${e.descriptionLabel}
|
|
125
|
+
@dpk-commit=${et(c=>t.dispatch(W.setStepDescription(p??d.id,c)))}
|
|
126
|
+
></dpk-inline-edit>
|
|
127
|
+
</span>
|
|
128
|
+
</div>
|
|
129
|
+
${Ko(t,e,d)}
|
|
130
|
+
</div>`):h}
|
|
131
|
+
`},Ko=(t,e,i)=>{const n=fe(t.state,i);return n.length===0?h:l`<div class="detail-row">
|
|
132
|
+
<span class="dpk-label">${e.screenGroup}</span>
|
|
133
|
+
<span class="detail-value">
|
|
134
|
+
${n.map(({app:o,screen:s})=>l`<div class="step-screen-entry">
|
|
135
|
+
<a
|
|
136
|
+
class="step-screen"
|
|
137
|
+
href=${t.hashFor({...Mt("app"),screen:s.id})}
|
|
138
|
+
title=${e.openInApp}
|
|
139
|
+
>${o.name} › ${s.title}</a
|
|
140
|
+
>
|
|
141
|
+
${s.description?l`<div class="screen-description dpk-prose">
|
|
142
|
+
${Pe(De(s.description))}
|
|
143
|
+
</div>`:h}
|
|
144
|
+
</div>`)}
|
|
145
|
+
</span>
|
|
146
|
+
</div>`},Xo=(t,e,i)=>{const n=tt("new-step",Pt(t.state));t.dispatch(W.addStep(i,n,e.newStepName)).ok&&t.navigate({story:i,step:n})},Zo=q(_n),Jo=q(Ji),Si=(t,e,i="bar")=>l`<button
|
|
147
|
+
class=${i==="demo"?"demo-control actions-toggle":"dpk-btn actions-toggle"}
|
|
148
|
+
type="button"
|
|
149
|
+
data-role="actions"
|
|
150
|
+
aria-haspopup="menu"
|
|
151
|
+
aria-expanded=${String(e.open)}
|
|
152
|
+
title=${t.actionsHint}
|
|
153
|
+
@click=${e.toggle}
|
|
154
|
+
>
|
|
155
|
+
${Zo()} ${t.actions} ${Jo()}
|
|
156
|
+
</button>`,Qo=t=>{const e=t.currentTarget;if(!(e instanceof HTMLElement))return;const i=[...e.querySelectorAll('[role="menuitem"]')],n=i.findIndex(a=>a===t.composedPath()[0]),o=t.key==="ArrowDown"?1:t.key==="ArrowUp"?-1:0,s=t.key==="Home"?0:t.key==="End"?i.length-1:o===0?-1:(n+o+i.length)%i.length,r=i[s];r!==void 0&&(t.preventDefault(),r.focus())},es=(t,e)=>{if(!e.open||e.groups.length===0)return h;const i=e.groups.length>1;return l`<div
|
|
157
|
+
class="comment-pop actions-menu"
|
|
158
|
+
popover="manual"
|
|
159
|
+
role="menu"
|
|
160
|
+
aria-label=${t.actions}
|
|
161
|
+
@keydown=${Qo}
|
|
162
|
+
>
|
|
163
|
+
${e.groups.map(n=>l`<div class="actions-group" role="group" aria-label=${n.screen.title}>
|
|
164
|
+
${i?l`<span class="actions-group-title" aria-hidden="true">${n.screen.title}</span>`:h}
|
|
165
|
+
${n.actions.map(o=>l`<button
|
|
166
|
+
class="actions-item"
|
|
167
|
+
type="button"
|
|
168
|
+
role="menuitem"
|
|
169
|
+
data-action=${o.id}
|
|
170
|
+
@click=${()=>e.run(n.screen.id,o.id)}
|
|
171
|
+
>
|
|
172
|
+
<span class="actions-label">${o.label}</span>
|
|
173
|
+
${o.description===void 0?h:l`<span class="actions-description">${o.description}</span>`}
|
|
174
|
+
</button>`)}
|
|
175
|
+
</div>`)}
|
|
176
|
+
</div>`},$i=(t,e,i="bar")=>{const n=e.mode.kind!=="off";return l`<button
|
|
177
|
+
class=${`${i==="demo"?"demo-control":n?"dpk-btn dpk-btn--accent":"dpk-btn"} ui-comment-toggle`}
|
|
178
|
+
type="button"
|
|
179
|
+
aria-pressed=${n?"true":"false"}
|
|
180
|
+
title=${t.uiCommentHint}
|
|
181
|
+
@click=${()=>e.send({kind:"toggle"})}
|
|
182
|
+
>
|
|
183
|
+
${it()} ${t.uiComment}
|
|
184
|
+
</button>`},ts=(t,e)=>e.mode.kind==="off"?h:l`<p class="ui-comment-hint" role="status">${it()} ${t.uiCommentHint}</p>`,is=(t,e)=>e.mode.kind==="off"?h:l`<div class="ui-layer" aria-hidden="true">
|
|
185
|
+
<div class="ui-catcher"></div>
|
|
186
|
+
<div class="ui-box ui-hover" hidden></div>
|
|
187
|
+
<div class="ui-box ui-picked" hidden></div>
|
|
188
|
+
${e.pins.map(i=>l`<span
|
|
189
|
+
class="ui-pin"
|
|
190
|
+
hidden
|
|
191
|
+
data-preview=${i.previewId}
|
|
192
|
+
data-selector=${i.selector}
|
|
193
|
+
title=${t.uiCommentPin(i.number,i.body)}
|
|
194
|
+
>${i.number}</span
|
|
195
|
+
>`)}
|
|
196
|
+
</div>`,ns=t=>t==="feedback"||t==="note",os=(t,e)=>{const i=e.mode;if(i.kind!=="composing")return h;const n=fn(i.body,e.notes,{key:`ui:${i.target.previewId}/${i.target.selector}`,...e.targetLabel===void 0?{}:{label:e.targetLabel},choice:{label:t.uiCommentAs,value:i.as,options:[{value:"feedback",label:t.uiCommentFeedback,hint:t.uiCommentFeedbackHint},{value:"note",label:t.uiCommentNote,hint:t.uiCommentNoteHint}]},...i.as==="note"?{submitLabel:t.uiNoteSubmit}:{}});return l`${pt(`${i.target.previewId}/${i.target.selector}`,gn(e.composer,n,o=>{o.kind==="input"?e.send({kind:"input",body:o.body}):o.kind==="comment"?e.submit(o.body):o.kind==="choose"?ns(o.value)&&e.send({kind:"choose",as:o.value}):e.send({kind:"dismiss"})}))}`},Ti=(t,e)=>l`<div class="demo-controls">
|
|
197
|
+
${e.actions.groups.length>0?Si(t,e.actions,"demo"):h}
|
|
198
|
+
${$i(t,e.uiComment,"demo")}
|
|
199
|
+
<button class="demo-control demo-exit" type="button" title=${t.exitDemo} @click=${e.onExit}>
|
|
200
|
+
${Re()} ${t.exitDemo} <kbd>Esc</kbd>
|
|
201
|
+
</button>
|
|
202
|
+
</div>`,Ai={mobile:"390px",tablet:"834px",desktop:"1180px",fluid:"100%"},Ii={mobile:"620px",tablet:"640px",desktop:"520px",fluid:"420px"},ss={browser:0,native:22,mail:0,plain:0},_i=(t,e,i)=>{const n=`--frame-width:${Ai[e]};--frame-min-height:${Ii[e]}`;if(i?.kind!=="device")return n;const o=ss[t];return`${n};--device-width:${i.width+o}px;--device-height:${i.height+o}px;zoom:${i.zoom}`},rs=t=>({back:t.browserBack,forward:t.browserForward,reload:t.browserReload,address:t.browserAddress,tabs:t.browserTabs,newTab:t.newTab,closeTab:t.closeTab,profile:t.browserProfile,guest:t.browserGuest,shortcuts:t.newTabShortcuts,unreachableTitle:t.unreachableTitle,unreachableBody:t.unreachableBody}),as=(t,e)=>l`<slot name=${`preview:${t.id}`}></slot> ${e?h:l`<div class="frame-placeholder">
|
|
203
|
+
<span class="dpk-label">light dom preview</span>
|
|
204
|
+
<code><div slot="preview" data-preview-id="${t.id}"></code>
|
|
205
|
+
</div>`}`,ds=(t,e,i)=>{const{preview:n,viewport:o}=i,s={view:i.view,phone:o==="mobile",switcher:i.switcher,shortcuts:i.shortcuts.map(r=>({...r,href:t.hashFor(r.page)})),labels:rs(e),...i.demo===void 0?{}:{extra:Ti(e,i.demo)},send:i.send};return l`<figure
|
|
206
|
+
class="frame browser"
|
|
207
|
+
data-kind="browser"
|
|
208
|
+
data-viewport=${o}
|
|
209
|
+
?data-loading=${i.loading}
|
|
210
|
+
?data-empty=${n!==void 0&&!i.hasContent}
|
|
211
|
+
data-window=${i.window.kind}
|
|
212
|
+
style=${_i("browser",o,i.window)}
|
|
213
|
+
>
|
|
214
|
+
${mn(s)}
|
|
215
|
+
<div class="viewport browser-page">
|
|
216
|
+
${yn(s,n===void 0?void 0:as(n,i.hasContent))}
|
|
217
|
+
</div>
|
|
218
|
+
${wn(s)}
|
|
219
|
+
</figure>`},ie=t=>`${t.previewId}/${t.selector}`,ls=(t,e)=>e.badges.length===0?h:l`<div class="ui-notes">
|
|
220
|
+
${e.badges.map(i=>{const n=e.open!==null&&ie(e.open)===ie(i);return l`<button
|
|
221
|
+
class="ui-note-badge"
|
|
222
|
+
type="button"
|
|
223
|
+
hidden
|
|
224
|
+
data-preview=${i.previewId}
|
|
225
|
+
data-selector=${i.selector}
|
|
226
|
+
data-key=${ie(i)}
|
|
227
|
+
aria-label=${t.uiNotesOn(i.label)}
|
|
228
|
+
aria-expanded=${n?"true":"false"}
|
|
229
|
+
title=${t.uiNotes(i.notes.length)}
|
|
230
|
+
@click=${()=>e.toggle(i)}
|
|
231
|
+
>
|
|
232
|
+
${nt()}<span>${i.notes.length}</span>
|
|
233
|
+
</button>`})}
|
|
234
|
+
</div>`,ps=(t,e)=>{const i=e.open;return i===null?h:l`<div
|
|
235
|
+
class="comment-pop ui-notes-pop"
|
|
236
|
+
popover="manual"
|
|
237
|
+
role="dialog"
|
|
238
|
+
aria-label=${t.uiNotesOn(i.label)}
|
|
239
|
+
data-key=${ie(i)}
|
|
240
|
+
>
|
|
241
|
+
<div class="ui-notes-head">
|
|
242
|
+
${nt()}
|
|
243
|
+
<strong class="comment-target" title=${i.label}>${i.label}</strong>
|
|
244
|
+
<button
|
|
245
|
+
class="dpk-icon-btn"
|
|
246
|
+
type="button"
|
|
247
|
+
data-role="close-notes"
|
|
248
|
+
aria-label=${t.closeUiNotes}
|
|
249
|
+
@click=${e.close}
|
|
250
|
+
>
|
|
251
|
+
${Re()}
|
|
252
|
+
</button>
|
|
253
|
+
</div>
|
|
254
|
+
<ol class="ui-note-list">
|
|
255
|
+
${i.notes.map(n=>e.editing?.noteId===n.id?l`<li data-id=${n.id}>${cs(t,e,e.editing)}</li>`:l`<li data-id=${n.id}>
|
|
256
|
+
<div class="ui-note-main">
|
|
257
|
+
<p class="ui-note-body">${n.body}</p>
|
|
258
|
+
${n.createdAt===void 0?h:l`<time class="ui-note-time" datetime=${n.createdAt}>${t.uiNoteDate(n.createdAt)}</time>`}
|
|
259
|
+
</div>
|
|
260
|
+
<button
|
|
261
|
+
class="dpk-icon-btn"
|
|
262
|
+
type="button"
|
|
263
|
+
data-role="edit-note"
|
|
264
|
+
aria-label=${t.editUiNoteAria}
|
|
265
|
+
title=${t.editUiNoteAria}
|
|
266
|
+
@click=${()=>e.edit(n.id,n.body)}
|
|
267
|
+
>
|
|
268
|
+
${Qi()}
|
|
269
|
+
</button>
|
|
270
|
+
<button
|
|
271
|
+
class="dpk-icon-btn"
|
|
272
|
+
type="button"
|
|
273
|
+
data-role="delete-note"
|
|
274
|
+
aria-label=${t.deleteUiNoteAria}
|
|
275
|
+
@click=${()=>e.remove(i,n.id)}
|
|
276
|
+
>
|
|
277
|
+
${en()}
|
|
278
|
+
</button>
|
|
279
|
+
</li>`)}
|
|
280
|
+
</ol>
|
|
281
|
+
</div>`},cs=(t,e,i)=>l`
|
|
282
|
+
<div class="ui-note-editor">
|
|
283
|
+
<textarea
|
|
284
|
+
class="dpk-textarea"
|
|
285
|
+
aria-label=${t.editUiNoteLabel}
|
|
286
|
+
title=${t.editUiNoteHint}
|
|
287
|
+
.value=${i.body}
|
|
288
|
+
@input=${n=>{n.currentTarget instanceof HTMLTextAreaElement&&e.input(n.currentTarget.value)}}
|
|
289
|
+
@keydown=${n=>{n.isComposing||(n.key==="Enter"&&(n.metaKey||n.ctrlKey)?(n.preventDefault(),e.save()):n.key==="Escape"&&(n.preventDefault(),n.stopPropagation(),e.cancel()))}}
|
|
290
|
+
></textarea>
|
|
291
|
+
<div class="ui-note-editor-actions">
|
|
292
|
+
<button class="dpk-btn dpk-btn--ghost" type="button" data-dpk-text-discard @click=${e.cancel}>
|
|
293
|
+
${t.cancelUiNote}
|
|
294
|
+
</button>
|
|
295
|
+
<button
|
|
296
|
+
class="dpk-btn dpk-btn--accent"
|
|
297
|
+
type="button"
|
|
298
|
+
data-role="save-note"
|
|
299
|
+
?disabled=${i.body.trim()===""}
|
|
300
|
+
@click=${e.save}
|
|
301
|
+
>
|
|
302
|
+
${t.saveUiNote}
|
|
303
|
+
</button>
|
|
304
|
+
</div>
|
|
305
|
+
</div>
|
|
306
|
+
`,Pi=(t,e,i)=>{const{state:n,navigation:o}=t,s=te(n,o),r=s===void 0||s.kind==="story"?void 0:s,a=pe(o)==="app",d=Ni(n,[]);if(s?.kind==="story"){const{activity:R,story:Te}=s;return l`
|
|
307
|
+
<div class="stage">
|
|
308
|
+
<section class="stage-story" data-dpk-target=${Bt(s,null)}>
|
|
309
|
+
${Di(e,lo(R,Te))}
|
|
310
|
+
${Te.description?l`<div class="story-description dpk-prose">${Pe(De(Te.description))}</div>`:h}
|
|
311
|
+
<p class="stage-empty">${e.storyWithoutSteps}</p>
|
|
312
|
+
</section>
|
|
313
|
+
${d}
|
|
314
|
+
</div>
|
|
315
|
+
`}if(!r)return l`
|
|
316
|
+
<div class="stage">
|
|
317
|
+
${a?l`<p class="stage-empty">${e.noScreens}</p>`:l`<p class="stage-empty">
|
|
318
|
+
${e.noStepBefore}<strong>Activity › UserStory › Step</strong>${e.noStepAfter}
|
|
319
|
+
</p>`}
|
|
320
|
+
${d}
|
|
321
|
+
</div>
|
|
322
|
+
`;const p=Ye(n,r,o),{layout:c,panes:v,shown:f}=p,[I]=c==="single"?v:[],P=i.uiComment,T=i.lift,z=T?.mode==="demo",K=i.browser,Fe=K!==null&&K.view.entry?.kind!=="page"?[]:f,[X]=Fe,ue=(X??f[0])?.viewport??"desktop",Ge=z&&K!==null&&ue!=="mobile",je={onExit:i.onToggleDemo,uiComment:P,actions:i.actions},zi=X??f[0],Ke=K!==null?"browser":zi?.kind??"browser",Xe=z&&Ke==="browser"&&gi(ue)==="desktop",Z=i.devices,ne=Z===null||Xe||!Lo(Ke)?null:Uo(ue,Z.choice),Ze=ne!==null&&Z!==null?{kind:"device",width:ne.width,height:ne.height,zoom:Z.zoom}:Xe?{kind:"fill"}:null;return l`
|
|
323
|
+
${T===null?h:l`<div class="stage-placeholder" style=${`height:${T.height}px`}></div>`}
|
|
324
|
+
<div
|
|
325
|
+
class=${T===null?"stage":z?"stage is-demo":"stage is-maximized"}
|
|
326
|
+
data-ui-comment=${P.mode.kind}
|
|
327
|
+
popover=${T===null?h:"manual"}
|
|
328
|
+
@wheel=${T===null?h:{handleEvent:i.onLiftedWheel,passive:!1}}
|
|
329
|
+
>
|
|
330
|
+
${z?Ge?h:Ti(e,je):l`<div class="stage-bar">
|
|
331
|
+
${Di(e,Zt(n,r))}
|
|
332
|
+
<div class="stage-tools">
|
|
333
|
+
${I?.kind==="screen"&&I.tabs.length>0?Ri(t,p,I):h}
|
|
334
|
+
${ne!==null&&Z!==null?ms(e,ne,Z,i.deviceSelect):h}
|
|
335
|
+
${i.actions.groups.length>0?Si(e,i.actions):h}
|
|
336
|
+
${f.length>0?$i(e,P):h}
|
|
337
|
+
${f.length===0?h:a?ys(e,i.onToggleDemo):ws(e,T!==null,i.onToggleMaximize)}
|
|
338
|
+
</div>
|
|
339
|
+
</div>`}
|
|
340
|
+
${r.kind==="step"&&r.step.situation!==void 0?fs(e,r.step.situation):h}
|
|
341
|
+
${z?h:ts(e,P)}
|
|
342
|
+
<div
|
|
343
|
+
class="canvas"
|
|
344
|
+
data-layout=${c}
|
|
345
|
+
data-dpk-target=${Bt(r,p)}
|
|
346
|
+
@click=${{handleEvent:i.canvasEvents.click,capture:!0}}
|
|
347
|
+
@pointermove=${{handleEvent:i.canvasEvents.pointermove,capture:!0}}
|
|
348
|
+
@pointerleave=${i.canvasEvents.pointerleave}
|
|
349
|
+
@wheel=${{handleEvent:i.canvasEvents.wheel,passive:!1}}
|
|
350
|
+
@scroll=${{handleEvent:i.canvasEvents.scroll,capture:!0}}
|
|
351
|
+
>
|
|
352
|
+
${K!==null?ds(t,e,{...K,...X===void 0?{}:{preview:X},...Ge?{demo:je}:{},hasContent:X===void 0||i.hasPreviewContent(X.id),viewport:ue,window:Ze??{kind:"fill"}}):c==="side-by-side"?l`<div class="panes">
|
|
353
|
+
${v.map(R=>l`<div class="pane" data-viewport=${R.preview.viewport} data-pane=${R.kind}>
|
|
354
|
+
${gs(t,p,R)}
|
|
355
|
+
${We(t,e,R.preview,i.hasPreviewContent(R.preview.id))}
|
|
356
|
+
</div>`)}
|
|
357
|
+
</div>`:f.map(R=>We(t,e,R,i.hasPreviewContent(R.id),Ze))}
|
|
358
|
+
${f.length===0?l`<p class="dpk-label">${e.noPreviewMetadata}</p>`:h}
|
|
359
|
+
${ls(e,i.uiNotes)} ${is(e,P)}
|
|
360
|
+
</div>
|
|
361
|
+
${os(e,P)} ${ps(e,i.uiNotes)} ${es(e,i.actions)}
|
|
362
|
+
${Ni(n,Fe.map(R=>R.id))}
|
|
363
|
+
</div>
|
|
364
|
+
`},us=q(In),hs=q($n),vs={phone:q(Tn),tablet:q(An),desktop:q(Sn)},Di=(t,e)=>l`<div class="page-head">
|
|
365
|
+
${e.actor===void 0?h:l`<span class="page-actor" role="note" aria-label=${t.pageActor(e.actor)} title=${e.actor}>
|
|
366
|
+
${us()} <span class="page-actor-name">${e.actor}</span>
|
|
367
|
+
</span>`}
|
|
368
|
+
<h2 class="page-title">${e.title}</h2>
|
|
369
|
+
</div>`,fs=(t,e)=>l`<aside class="situation">
|
|
370
|
+
<span class="situation-label">${t.situation}</span>
|
|
371
|
+
<p class="situation-text">${e}</p>
|
|
372
|
+
</aside>`,Ri=(t,e,i)=>l`<div class="dpk-segmented tabs" role="tablist">
|
|
373
|
+
${i.tabs.map(n=>{const o=n.id===i.preview.id;return l`<a
|
|
374
|
+
class="tab"
|
|
375
|
+
role="tab"
|
|
376
|
+
data-current=${String(o)}
|
|
377
|
+
aria-selected=${o?"true":"false"}
|
|
378
|
+
href=${t.hashFor({preview:to(e,n.id)})}
|
|
379
|
+
>${n.label??n.viewport}</a
|
|
380
|
+
>`})}
|
|
381
|
+
</div>`,gs=(t,e,i)=>i.kind==="material"?i.preview.label===void 0?h:l`<span class="pane-label" title=${i.preview.label}>${i.preview.label}</span>`:l`<div class="pane-head">
|
|
382
|
+
<span class="pane-label" title=${i.screen.screen.title}>${i.screen.screen.title}</span>
|
|
383
|
+
${i.tabs.length>0?Ri(t,e,i):h}
|
|
384
|
+
</div>`,ms=(t,e,i,n)=>{const o=Math.round(i.zoom*100);return l`<span class="device-pick" title=${t.deviceHint}>
|
|
385
|
+
${vs[e.deviceClass]()}
|
|
386
|
+
${n.render({options:mi(e.deviceClass).map(s=>({value:s.id,label:zo(t,s)})),value:e.id,onChange:s=>i.onPick(s),ariaLabel:t.device,className:"device-select"})}
|
|
387
|
+
${o<100?l`<span class="device-zoom" title=${t.deviceZoom(o)}>${o}%</span>`:h}
|
|
388
|
+
</span>`},ys=(t,e)=>l`<button class="dpk-btn stage-demo" type="button" title=${t.demoHint} @click=${e}>
|
|
389
|
+
${hs()} ${t.demo}
|
|
390
|
+
</button>`,ws=(t,e,i)=>l`<button
|
|
391
|
+
class="dpk-btn stage-maximize"
|
|
392
|
+
type="button"
|
|
393
|
+
aria-pressed=${e?"true":"false"}
|
|
394
|
+
title=${t.maximizeHint}
|
|
395
|
+
@click=${i}
|
|
396
|
+
>
|
|
397
|
+
${e?l`${tn()} ${t.restore}`:l`${nn()} ${t.maximize}`}
|
|
398
|
+
</button>`,We=(t,e,i,n,o=null)=>l`
|
|
399
|
+
<figure
|
|
400
|
+
class="frame"
|
|
401
|
+
data-kind=${i.kind}
|
|
402
|
+
data-viewport=${i.viewport}
|
|
403
|
+
data-window=${o?.kind??h}
|
|
404
|
+
?data-empty=${!n}
|
|
405
|
+
style=${_i(i.kind,i.viewport,o)}
|
|
406
|
+
>
|
|
407
|
+
${i.kind==="browser"?l`<div class="dpk-browser-frame-bar">
|
|
408
|
+
<span class="dpk-browser-frame-url">${ke(t.state,i)}</span>
|
|
409
|
+
</div>`:i.kind==="mail"?bs(ro(e,i)):h}
|
|
410
|
+
<div class="viewport">
|
|
411
|
+
${i.kind==="native"?ks():h}
|
|
412
|
+
<slot name=${`preview:${i.id}`}></slot>
|
|
413
|
+
${n?h:l`<div class="frame-placeholder">
|
|
414
|
+
<span class="dpk-label">light dom preview</span>
|
|
415
|
+
<code><div slot="preview" data-preview-id="${i.id}"></code>
|
|
416
|
+
</div>`}
|
|
417
|
+
</div>
|
|
418
|
+
</figure>
|
|
419
|
+
`,bs=t=>l`<header class="dpk-received-mail">
|
|
420
|
+
${t.subject===void 0?h:l`<h3 class="dpk-received-mail-subject">${t.subject}</h3>`}
|
|
421
|
+
<div class="dpk-received-mail-envelope">
|
|
422
|
+
${t.initial===void 0?h:l`<span class="dpk-avatar" data-size="lg" aria-hidden="true">${t.initial}</span>`}
|
|
423
|
+
<dl class="dpk-received-mail-meta">
|
|
424
|
+
${t.rows.map(e=>l`<div>
|
|
425
|
+
<dt>${e.label}</dt>
|
|
426
|
+
<dd>${e.value}</dd>
|
|
427
|
+
</div>`)}
|
|
428
|
+
</dl>
|
|
429
|
+
</div>
|
|
430
|
+
</header>`,ks=()=>l`<div class="dpk-status-bar"><span>9:41</span></div>`,Ni=(t,e)=>{const n=[...H(t).flatMap(o=>o.screen.previews),...B(t).flatMap(o=>F(o.step))].filter(o=>!e.includes(o.id));return n.length===0?l`${h}`:l`<div class="parked" aria-hidden="true">
|
|
431
|
+
${n.map(o=>l`<slot name=${`preview:${o.id}`}></slot>`)}
|
|
432
|
+
</div>`},xs=on`
|
|
433
|
+
:host {
|
|
434
|
+
--dpk-prototype-accent: var(--dpk-blue);
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
/* ---------------------------------------------------------------- sidebar */
|
|
438
|
+
|
|
439
|
+
.nav {
|
|
440
|
+
display: grid;
|
|
441
|
+
/* The sidebar's column, never its content's: a long story name is ellipsized
|
|
442
|
+
inside the rich select instead of widening the rail. */
|
|
443
|
+
grid-template-columns: minmax(0, 1fr);
|
|
444
|
+
gap: 14px;
|
|
445
|
+
align-content: start;
|
|
446
|
+
min-width: 0;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
.nav > * {
|
|
450
|
+
min-width: 0;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
.field {
|
|
454
|
+
display: grid;
|
|
455
|
+
grid-template-columns: minmax(0, 1fr);
|
|
456
|
+
gap: 5px;
|
|
457
|
+
min-width: 0;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
.field > * {
|
|
461
|
+
min-width: 0;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
/* Scenario or app: the segmented atom, stretched across the top of the sidebar. */
|
|
465
|
+
.view-switch {
|
|
466
|
+
display: flex;
|
|
467
|
+
min-width: 0;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
.view-switch > * {
|
|
471
|
+
min-width: 0;
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
.view-option {
|
|
475
|
+
flex: 1 1 0;
|
|
476
|
+
text-align: center;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
.app-hint {
|
|
480
|
+
margin: -6px 0 0;
|
|
481
|
+
font-size: 11.5px;
|
|
482
|
+
line-height: 1.55;
|
|
483
|
+
color: var(--dpk-ink-faint);
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
.app-group {
|
|
487
|
+
display: grid;
|
|
488
|
+
gap: 4px;
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
.app-group-heading {
|
|
492
|
+
margin: 0;
|
|
493
|
+
padding-left: 9px;
|
|
494
|
+
font-size: 11px;
|
|
495
|
+
font-weight: 600;
|
|
496
|
+
color: var(--dpk-ink-soft);
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
.app-description {
|
|
500
|
+
margin: 2px 0 0;
|
|
501
|
+
font-size: 11.5px;
|
|
502
|
+
line-height: 1.5;
|
|
503
|
+
color: var(--dpk-ink-faint);
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
.step-screen {
|
|
507
|
+
color: var(--dpk-ink);
|
|
508
|
+
font-size: 12.5px;
|
|
509
|
+
font-weight: 550;
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
.screen-description {
|
|
513
|
+
font-size: 12.5px;
|
|
514
|
+
line-height: 1.6;
|
|
515
|
+
color: var(--dpk-ink);
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
.app-tree {
|
|
519
|
+
display: grid;
|
|
520
|
+
gap: 4px;
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
.app-origin {
|
|
524
|
+
margin: 0;
|
|
525
|
+
padding-left: 9px;
|
|
526
|
+
font-family: var(--dpk-mono);
|
|
527
|
+
font-size: 10.5px;
|
|
528
|
+
font-weight: 500;
|
|
529
|
+
color: var(--dpk-ink-faint);
|
|
530
|
+
overflow-wrap: anywhere;
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
.tree {
|
|
534
|
+
list-style: none;
|
|
535
|
+
margin: 0;
|
|
536
|
+
padding: 0;
|
|
537
|
+
display: grid;
|
|
538
|
+
gap: 2px;
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
/* A path below another one is indented under it, with a guide line. */
|
|
542
|
+
.tree .tree {
|
|
543
|
+
margin-left: 14px;
|
|
544
|
+
padding-left: 6px;
|
|
545
|
+
border-left: 1px solid var(--dpk-rule);
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
.tree-node {
|
|
549
|
+
display: grid;
|
|
550
|
+
gap: 2px;
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
.tree-row {
|
|
554
|
+
position: relative;
|
|
555
|
+
border-radius: var(--dpk-radius-sm);
|
|
556
|
+
transition: background 140ms ease;
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
.tree-row:has(a):hover {
|
|
560
|
+
background: var(--dpk-paper-inset);
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
.tree-row[data-current='true'] {
|
|
564
|
+
background: linear-gradient(
|
|
565
|
+
180deg,
|
|
566
|
+
color-mix(in srgb, var(--dpk-prototype-accent) 10%, var(--dpk-paper-raised)),
|
|
567
|
+
color-mix(in srgb, var(--dpk-prototype-accent) 5%, var(--dpk-paper-raised))
|
|
568
|
+
);
|
|
569
|
+
box-shadow:
|
|
570
|
+
inset 0 0 0 1px color-mix(in srgb, var(--dpk-prototype-accent) 22%, transparent),
|
|
571
|
+
var(--dpk-shadow-xs);
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
.tree-link {
|
|
575
|
+
display: flex;
|
|
576
|
+
align-items: baseline;
|
|
577
|
+
flex-wrap: wrap;
|
|
578
|
+
gap: 2px 8px;
|
|
579
|
+
padding: 6px 4px 6px 9px;
|
|
580
|
+
text-decoration: none;
|
|
581
|
+
color: var(--dpk-ink-soft);
|
|
582
|
+
font-size: 12.5px;
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
.tree-path {
|
|
586
|
+
font-family: var(--dpk-mono);
|
|
587
|
+
font-size: 11.5px;
|
|
588
|
+
color: var(--dpk-ink);
|
|
589
|
+
overflow-wrap: anywhere;
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
span.tree-link .tree-path {
|
|
593
|
+
color: var(--dpk-ink-faint);
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
.tree-title {
|
|
597
|
+
min-width: 0;
|
|
598
|
+
color: var(--dpk-ink-soft);
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
.tree-row[data-current='true'] .tree-path,
|
|
602
|
+
.tree-row[data-current='true'] .tree-title {
|
|
603
|
+
color: var(--dpk-ink);
|
|
604
|
+
font-weight: 550;
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
.tree-link .step-note {
|
|
608
|
+
align-self: center;
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
.tree-link:focus-visible {
|
|
612
|
+
outline: none;
|
|
613
|
+
border-radius: var(--dpk-radius-sm);
|
|
614
|
+
box-shadow: var(--dpk-focus);
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
.steps.app-screens {
|
|
618
|
+
max-height: none;
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
.steps-head {
|
|
622
|
+
display: flex;
|
|
623
|
+
align-items: baseline;
|
|
624
|
+
justify-content: space-between;
|
|
625
|
+
padding-bottom: 5px;
|
|
626
|
+
border-bottom: 1px solid var(--dpk-rule);
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
.steps {
|
|
630
|
+
list-style: none;
|
|
631
|
+
margin: 0;
|
|
632
|
+
padding: 0;
|
|
633
|
+
display: grid;
|
|
634
|
+
/* A row is no wider than the list: a long step name ends in an ellipsis. */
|
|
635
|
+
grid-template-columns: minmax(0, 1fr);
|
|
636
|
+
gap: 2px;
|
|
637
|
+
max-height: 38vh;
|
|
638
|
+
overflow: auto;
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
.step-row {
|
|
642
|
+
position: relative;
|
|
643
|
+
display: flex;
|
|
644
|
+
align-items: center;
|
|
645
|
+
gap: 4px;
|
|
646
|
+
padding: 0 4px 0 9px;
|
|
647
|
+
border-radius: var(--dpk-radius-sm);
|
|
648
|
+
transition:
|
|
649
|
+
background 140ms ease,
|
|
650
|
+
box-shadow 140ms ease;
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
.step-row:hover {
|
|
654
|
+
background: var(--dpk-paper-inset);
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
.step-row[data-current='true'] {
|
|
658
|
+
background: linear-gradient(
|
|
659
|
+
180deg,
|
|
660
|
+
color-mix(in srgb, var(--dpk-prototype-accent) 10%, var(--dpk-paper-raised)),
|
|
661
|
+
color-mix(in srgb, var(--dpk-prototype-accent) 5%, var(--dpk-paper-raised))
|
|
662
|
+
);
|
|
663
|
+
box-shadow:
|
|
664
|
+
inset 0 0 0 1px color-mix(in srgb, var(--dpk-prototype-accent) 22%, transparent),
|
|
665
|
+
var(--dpk-shadow-xs);
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
.step-link {
|
|
669
|
+
display: flex;
|
|
670
|
+
flex: 1;
|
|
671
|
+
min-width: 0;
|
|
672
|
+
align-items: center;
|
|
673
|
+
gap: 7px;
|
|
674
|
+
padding: 7px 0;
|
|
675
|
+
text-decoration: none;
|
|
676
|
+
color: var(--dpk-ink-soft);
|
|
677
|
+
font-size: 12.5px;
|
|
678
|
+
font-weight: 460;
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
.step-row[data-current='true'] .step-link {
|
|
682
|
+
color: var(--dpk-ink);
|
|
683
|
+
font-weight: 550;
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
.step-index {
|
|
687
|
+
flex: 0 0 auto;
|
|
688
|
+
min-width: 17px;
|
|
689
|
+
padding: 1px 4px;
|
|
690
|
+
border-radius: var(--dpk-radius-xs);
|
|
691
|
+
background: var(--dpk-paper-inset);
|
|
692
|
+
font-family: var(--dpk-mono);
|
|
693
|
+
font-size: 9.5px;
|
|
694
|
+
font-variant-numeric: tabular-nums;
|
|
695
|
+
text-align: center;
|
|
696
|
+
color: var(--dpk-ink-faint);
|
|
697
|
+
transition:
|
|
698
|
+
background 140ms ease,
|
|
699
|
+
color 140ms ease;
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
.step-row[data-current='true'] .step-index {
|
|
703
|
+
background: linear-gradient(180deg, var(--dpk-blue), var(--dpk-blue-strong));
|
|
704
|
+
color: #fff;
|
|
705
|
+
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
.step-name {
|
|
709
|
+
min-width: 0;
|
|
710
|
+
overflow: hidden;
|
|
711
|
+
white-space: nowrap;
|
|
712
|
+
text-overflow: ellipsis;
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
.step-note {
|
|
716
|
+
margin-left: auto;
|
|
717
|
+
min-width: 16px;
|
|
718
|
+
padding: 1px 5px;
|
|
719
|
+
border-radius: 999px;
|
|
720
|
+
background: var(--dpk-accent);
|
|
721
|
+
color: var(--dpk-accent-ink);
|
|
722
|
+
font-family: var(--dpk-mono);
|
|
723
|
+
font-size: 9px;
|
|
724
|
+
font-variant-numeric: tabular-nums;
|
|
725
|
+
text-align: center;
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
.row-tools {
|
|
729
|
+
display: flex;
|
|
730
|
+
gap: 0;
|
|
731
|
+
opacity: 0;
|
|
732
|
+
transition: opacity 120ms ease;
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
.step-row:hover .row-tools,
|
|
736
|
+
.step-row[data-current='true'] .row-tools {
|
|
737
|
+
opacity: 1;
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
.detail {
|
|
741
|
+
display: grid;
|
|
742
|
+
/* As wide as the panel, not as a description's widest table or code line: those scroll. */
|
|
743
|
+
grid-template-columns: minmax(0, 1fr);
|
|
744
|
+
gap: 12px;
|
|
745
|
+
padding: 12px 12px 14px;
|
|
746
|
+
border: 1px solid var(--dpk-rule);
|
|
747
|
+
border-radius: var(--dpk-radius);
|
|
748
|
+
background: var(--dpk-paper-raised);
|
|
749
|
+
box-shadow: var(--dpk-bevel), var(--dpk-shadow-sm);
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
.detail-row {
|
|
753
|
+
display: grid;
|
|
754
|
+
grid-template-columns: minmax(0, 1fr);
|
|
755
|
+
gap: 4px;
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
.detail-value {
|
|
759
|
+
font-size: 12.5px;
|
|
760
|
+
color: var(--dpk-ink-soft);
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
.nav-empty {
|
|
764
|
+
font-size: 12px;
|
|
765
|
+
line-height: 1.6;
|
|
766
|
+
color: var(--dpk-ink-faint);
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
/* ------------------------------------------------------------------ stage */
|
|
770
|
+
|
|
771
|
+
.stage {
|
|
772
|
+
display: grid;
|
|
773
|
+
/* One column no wider than the main area: a wide row of panes scrolls inside the canvas. */
|
|
774
|
+
grid-template-columns: minmax(0, 1fr);
|
|
775
|
+
gap: 14px;
|
|
776
|
+
width: 100%;
|
|
777
|
+
min-width: 0;
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
/* A tighter top than the shell's leaves the preview more of the main column. */
|
|
781
|
+
:host {
|
|
782
|
+
--dpk-main-padding: 12px 24px 24px;
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
.stage-bar {
|
|
786
|
+
display: flex;
|
|
787
|
+
align-items: center;
|
|
788
|
+
justify-content: space-between;
|
|
789
|
+
gap: 10px 16px;
|
|
790
|
+
min-width: 0;
|
|
791
|
+
flex-wrap: wrap;
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
/*
|
|
795
|
+
* The page head and its tools stick to the top of the main column, so they
|
|
796
|
+
* stay in reach while a tall preview scrolls under them; the situation and
|
|
797
|
+
* the canvas scroll on. The bar spans the column edge to edge (cancelling
|
|
798
|
+
* the body's padding) on a frosted ground the content passes beneath. Above
|
|
799
|
+
* the UI-comment layer, below the memo, which opens over everything.
|
|
800
|
+
*/
|
|
801
|
+
.stage:not(.is-maximized) > .stage-bar {
|
|
802
|
+
position: sticky;
|
|
803
|
+
top: 0;
|
|
804
|
+
z-index: 5;
|
|
805
|
+
margin: -12px -24px 0;
|
|
806
|
+
/* Its leading text clears the fold button a folded sidebar floats over this corner. */
|
|
807
|
+
padding: 10px 24px 10px calc(24px + var(--dpk-fold-clearance-left, 0px));
|
|
808
|
+
border-bottom: 1px solid var(--dpk-rule);
|
|
809
|
+
background: color-mix(in srgb, var(--dpk-paper-raised) 92%, transparent);
|
|
810
|
+
backdrop-filter: saturate(1.6) blur(14px);
|
|
811
|
+
}
|
|
812
|
+
|
|
813
|
+
/* ------------------------------------------------------------- page head */
|
|
814
|
+
|
|
815
|
+
.page-head {
|
|
816
|
+
display: flex;
|
|
817
|
+
align-items: center;
|
|
818
|
+
gap: 12px;
|
|
819
|
+
min-width: 0;
|
|
820
|
+
animation: dpk-page-head-in 260ms var(--dpk-ease) backwards;
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
@keyframes dpk-page-head-in {
|
|
824
|
+
from {
|
|
825
|
+
opacity: 0;
|
|
826
|
+
transform: translateY(4px);
|
|
827
|
+
}
|
|
828
|
+
}
|
|
829
|
+
|
|
830
|
+
.page-actor {
|
|
831
|
+
display: inline-flex;
|
|
832
|
+
/* A long role name gives way to the title first, down to a recognizable stub. */
|
|
833
|
+
flex: 0 1000 auto;
|
|
834
|
+
min-width: 72px;
|
|
835
|
+
align-items: center;
|
|
836
|
+
gap: 6px;
|
|
837
|
+
height: 26px;
|
|
838
|
+
padding: 0 11px 0 8px;
|
|
839
|
+
border-radius: 999px;
|
|
840
|
+
background: linear-gradient(
|
|
841
|
+
180deg,
|
|
842
|
+
color-mix(in srgb, var(--dpk-blue) 16%, var(--dpk-paper-raised)),
|
|
843
|
+
color-mix(in srgb, var(--dpk-blue) 9%, var(--dpk-paper-raised))
|
|
844
|
+
);
|
|
845
|
+
box-shadow:
|
|
846
|
+
var(--dpk-bevel),
|
|
847
|
+
inset 0 0 0 1px color-mix(in srgb, var(--dpk-blue) 32%, transparent),
|
|
848
|
+
var(--dpk-shadow-xs);
|
|
849
|
+
color: var(--dpk-blue);
|
|
850
|
+
font-size: 12px;
|
|
851
|
+
font-weight: 650;
|
|
852
|
+
letter-spacing: 0.01em;
|
|
853
|
+
white-space: nowrap;
|
|
854
|
+
max-width: 280px;
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
.page-actor-name {
|
|
858
|
+
min-width: 0;
|
|
859
|
+
overflow: hidden;
|
|
860
|
+
text-overflow: ellipsis;
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
.page-actor svg {
|
|
864
|
+
flex: none;
|
|
865
|
+
width: 13px;
|
|
866
|
+
height: 13px;
|
|
867
|
+
opacity: 0.9;
|
|
868
|
+
}
|
|
869
|
+
|
|
870
|
+
.page-title {
|
|
871
|
+
margin: 0;
|
|
872
|
+
min-width: 0;
|
|
873
|
+
overflow: hidden;
|
|
874
|
+
font-size: 19px;
|
|
875
|
+
font-weight: 700;
|
|
876
|
+
line-height: 1.3;
|
|
877
|
+
letter-spacing: -0.02em;
|
|
878
|
+
color: var(--dpk-ink);
|
|
879
|
+
text-overflow: ellipsis;
|
|
880
|
+
white-space: nowrap;
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
/* Wraps on a phone rather than pushing the last tools off the screen. */
|
|
884
|
+
.stage-tools {
|
|
885
|
+
display: flex;
|
|
886
|
+
flex-wrap: wrap;
|
|
887
|
+
justify-content: flex-end;
|
|
888
|
+
align-items: center;
|
|
889
|
+
gap: 8px;
|
|
890
|
+
min-width: 0;
|
|
891
|
+
margin-left: auto;
|
|
892
|
+
}
|
|
893
|
+
|
|
894
|
+
.stage-maximize svg,
|
|
895
|
+
.stage-demo svg {
|
|
896
|
+
width: 13px;
|
|
897
|
+
height: 13px;
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
.stage-demo {
|
|
901
|
+
display: inline-flex;
|
|
902
|
+
align-items: center;
|
|
903
|
+
gap: 6px;
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
.actions-toggle {
|
|
907
|
+
display: inline-flex;
|
|
908
|
+
align-items: center;
|
|
909
|
+
gap: 6px;
|
|
910
|
+
}
|
|
911
|
+
|
|
912
|
+
.actions-toggle svg {
|
|
913
|
+
width: 13px;
|
|
914
|
+
height: 13px;
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
.actions-toggle svg:last-child {
|
|
918
|
+
width: 12px;
|
|
919
|
+
height: 12px;
|
|
920
|
+
margin-left: -2px;
|
|
921
|
+
opacity: 0.7;
|
|
922
|
+
}
|
|
923
|
+
|
|
924
|
+
.actions-toggle[aria-expanded='true'] {
|
|
925
|
+
opacity: 1;
|
|
926
|
+
color: var(--dpk-ink);
|
|
927
|
+
}
|
|
928
|
+
|
|
929
|
+
/* A menu of what each screen on stage can do in one go. */
|
|
930
|
+
.actions-menu {
|
|
931
|
+
gap: 8px;
|
|
932
|
+
width: max-content;
|
|
933
|
+
min-width: 220px;
|
|
934
|
+
max-width: min(320px, calc(100vw - 24px));
|
|
935
|
+
padding: 6px;
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
.actions-group {
|
|
939
|
+
display: grid;
|
|
940
|
+
gap: 2px;
|
|
941
|
+
}
|
|
942
|
+
|
|
943
|
+
.actions-group + .actions-group {
|
|
944
|
+
padding-top: 6px;
|
|
945
|
+
border-top: 1px solid var(--dpk-rule);
|
|
946
|
+
}
|
|
947
|
+
|
|
948
|
+
.actions-group-title {
|
|
949
|
+
padding: 4px 10px 2px;
|
|
950
|
+
font-size: 11px;
|
|
951
|
+
font-weight: 600;
|
|
952
|
+
color: var(--dpk-ink-faint);
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
.actions-item {
|
|
956
|
+
display: grid;
|
|
957
|
+
gap: 2px;
|
|
958
|
+
width: 100%;
|
|
959
|
+
padding: 8px 10px;
|
|
960
|
+
border: 0;
|
|
961
|
+
border-radius: var(--dpk-radius-sm);
|
|
962
|
+
background: transparent;
|
|
963
|
+
color: var(--dpk-ink);
|
|
964
|
+
font: inherit;
|
|
965
|
+
text-align: left;
|
|
966
|
+
cursor: pointer;
|
|
967
|
+
}
|
|
968
|
+
|
|
969
|
+
.actions-item:hover,
|
|
970
|
+
.actions-item:focus-visible {
|
|
971
|
+
background: var(--dpk-accent-soft);
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
.actions-item:focus-visible {
|
|
975
|
+
outline: none;
|
|
976
|
+
box-shadow: var(--dpk-focus);
|
|
977
|
+
}
|
|
978
|
+
|
|
979
|
+
.actions-label {
|
|
980
|
+
font-weight: 600;
|
|
981
|
+
}
|
|
982
|
+
|
|
983
|
+
.actions-description {
|
|
984
|
+
font-size: 11.5px;
|
|
985
|
+
line-height: 1.45;
|
|
986
|
+
color: var(--dpk-ink-soft);
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
/* The app view's device: a pill like the rendition tabs, with the zoom it is drawn at. */
|
|
990
|
+
.device-pick {
|
|
991
|
+
position: relative;
|
|
992
|
+
display: inline-flex;
|
|
993
|
+
align-items: center;
|
|
994
|
+
gap: 6px;
|
|
995
|
+
height: 32px;
|
|
996
|
+
padding: 0 6px 0 10px;
|
|
997
|
+
box-sizing: border-box;
|
|
998
|
+
border: 1px solid var(--dpk-rule);
|
|
999
|
+
border-radius: 999px;
|
|
1000
|
+
background: var(--dpk-paper-sunken);
|
|
1001
|
+
box-shadow: inset 0 1px 2px rgba(20, 28, 44, 0.04);
|
|
1002
|
+
color: var(--dpk-ink-soft);
|
|
1003
|
+
}
|
|
1004
|
+
|
|
1005
|
+
.device-pick:focus-within {
|
|
1006
|
+
box-shadow: var(--dpk-focus);
|
|
1007
|
+
}
|
|
1008
|
+
|
|
1009
|
+
.device-pick svg {
|
|
1010
|
+
flex: none;
|
|
1011
|
+
width: 14px;
|
|
1012
|
+
height: 14px;
|
|
1013
|
+
}
|
|
1014
|
+
|
|
1015
|
+
.device-select {
|
|
1016
|
+
min-width: 0;
|
|
1017
|
+
padding: 0 4px 0 0;
|
|
1018
|
+
border: 0;
|
|
1019
|
+
background: transparent;
|
|
1020
|
+
color: var(--dpk-ink);
|
|
1021
|
+
font: 600 12px/1 var(--dpk-body);
|
|
1022
|
+
}
|
|
1023
|
+
|
|
1024
|
+
.device-zoom {
|
|
1025
|
+
padding: 3px 7px;
|
|
1026
|
+
border-radius: 999px;
|
|
1027
|
+
background: var(--dpk-paper-raised);
|
|
1028
|
+
box-shadow: var(--dpk-bevel), var(--dpk-shadow-xs);
|
|
1029
|
+
font: 600 10.5px/1 var(--dpk-mono);
|
|
1030
|
+
font-variant-numeric: tabular-nums;
|
|
1031
|
+
color: var(--dpk-ink-soft);
|
|
1032
|
+
}
|
|
1033
|
+
|
|
1034
|
+
.stage-empty {
|
|
1035
|
+
max-width: 62ch;
|
|
1036
|
+
padding: 16px 18px;
|
|
1037
|
+
border: 1px dashed var(--dpk-rule-strong);
|
|
1038
|
+
border-radius: var(--dpk-radius-lg);
|
|
1039
|
+
background: var(--dpk-paper-sunken);
|
|
1040
|
+
font-size: 13px;
|
|
1041
|
+
line-height: 1.7;
|
|
1042
|
+
color: var(--dpk-ink-soft);
|
|
1043
|
+
}
|
|
1044
|
+
|
|
1045
|
+
/* A story that has no steps yet: its heading, what it is for, and why no frame. */
|
|
1046
|
+
.stage-story {
|
|
1047
|
+
display: grid;
|
|
1048
|
+
gap: 12px;
|
|
1049
|
+
justify-items: start;
|
|
1050
|
+
}
|
|
1051
|
+
|
|
1052
|
+
.story-description {
|
|
1053
|
+
max-width: 62ch;
|
|
1054
|
+
margin: 0;
|
|
1055
|
+
font-size: 14px;
|
|
1056
|
+
line-height: 1.7;
|
|
1057
|
+
color: var(--dpk-ink);
|
|
1058
|
+
}
|
|
1059
|
+
|
|
1060
|
+
/* -------------------------------------------------------------- situation */
|
|
1061
|
+
|
|
1062
|
+
/*
|
|
1063
|
+
* What is going on around the previews: a stage direction, read before them.
|
|
1064
|
+
* The band spans the stage at any width (a maximized stage too); only the
|
|
1065
|
+
* text keeps a readable line length.
|
|
1066
|
+
*/
|
|
1067
|
+
.situation {
|
|
1068
|
+
display: flex;
|
|
1069
|
+
align-items: baseline;
|
|
1070
|
+
gap: 10px;
|
|
1071
|
+
margin: -4px 0 -2px;
|
|
1072
|
+
padding: 8px 14px 8px 10px;
|
|
1073
|
+
border: 1px solid color-mix(in srgb, var(--dpk-prototype-accent) 16%, var(--dpk-rule));
|
|
1074
|
+
border-radius: var(--dpk-radius);
|
|
1075
|
+
background: color-mix(in srgb, var(--dpk-prototype-accent) 5%, var(--dpk-paper-raised));
|
|
1076
|
+
box-shadow: var(--dpk-bevel);
|
|
1077
|
+
}
|
|
1078
|
+
|
|
1079
|
+
.situation-label {
|
|
1080
|
+
flex: none;
|
|
1081
|
+
padding: 2px 8px;
|
|
1082
|
+
border-radius: 999px;
|
|
1083
|
+
background: color-mix(in srgb, var(--dpk-prototype-accent) 13%, transparent);
|
|
1084
|
+
font-size: 10.5px;
|
|
1085
|
+
font-weight: 650;
|
|
1086
|
+
letter-spacing: 0.06em;
|
|
1087
|
+
color: var(--dpk-prototype-accent);
|
|
1088
|
+
}
|
|
1089
|
+
|
|
1090
|
+
.situation-text {
|
|
1091
|
+
max-width: 90ch;
|
|
1092
|
+
margin: 0;
|
|
1093
|
+
min-width: 0;
|
|
1094
|
+
font-size: 13px;
|
|
1095
|
+
line-height: 1.65;
|
|
1096
|
+
color: var(--dpk-ink);
|
|
1097
|
+
white-space: pre-line;
|
|
1098
|
+
overflow-wrap: anywhere;
|
|
1099
|
+
}
|
|
1100
|
+
|
|
1101
|
+
/* ----------------------------------------------------------------- canvas */
|
|
1102
|
+
|
|
1103
|
+
/*
|
|
1104
|
+
* The work surface the frame sits on: a quiet dot lattice that reads as a
|
|
1105
|
+
* canvas rather than empty page background, giving the frame somewhere to
|
|
1106
|
+
* cast its shadow.
|
|
1107
|
+
*/
|
|
1108
|
+
.canvas {
|
|
1109
|
+
display: flex;
|
|
1110
|
+
justify-content: center;
|
|
1111
|
+
padding: 30px;
|
|
1112
|
+
border: 1px solid var(--dpk-rule);
|
|
1113
|
+
border-radius: var(--dpk-radius-xl);
|
|
1114
|
+
background: var(--dpk-dots), var(--dpk-paper-sunken);
|
|
1115
|
+
box-shadow: inset 0 1px 3px var(--dpk-shade-1);
|
|
1116
|
+
}
|
|
1117
|
+
|
|
1118
|
+
/* ---------------------------------------------------------- comment on UI */
|
|
1119
|
+
|
|
1120
|
+
.ui-comment-toggle svg,
|
|
1121
|
+
.ui-comment-hint svg {
|
|
1122
|
+
width: 14px;
|
|
1123
|
+
height: 14px;
|
|
1124
|
+
}
|
|
1125
|
+
|
|
1126
|
+
.ui-comment-toggle {
|
|
1127
|
+
display: inline-flex;
|
|
1128
|
+
align-items: center;
|
|
1129
|
+
gap: 6px;
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1132
|
+
.ui-comment-hint {
|
|
1133
|
+
display: flex;
|
|
1134
|
+
align-items: center;
|
|
1135
|
+
gap: 8px;
|
|
1136
|
+
margin: -4px 0 -2px;
|
|
1137
|
+
padding: 7px 12px;
|
|
1138
|
+
border-radius: var(--dpk-radius);
|
|
1139
|
+
background: var(--dpk-accent-soft);
|
|
1140
|
+
color: var(--dpk-accent-strong, var(--dpk-accent));
|
|
1141
|
+
font-size: 12.5px;
|
|
1142
|
+
font-weight: 550;
|
|
1143
|
+
}
|
|
1144
|
+
|
|
1145
|
+
.canvas {
|
|
1146
|
+
position: relative;
|
|
1147
|
+
}
|
|
1148
|
+
|
|
1149
|
+
.stage:not([data-ui-comment='off']) .canvas ::slotted(*) {
|
|
1150
|
+
cursor: crosshair;
|
|
1151
|
+
}
|
|
1152
|
+
|
|
1153
|
+
/* Sized to the canvas's scroll area by the element; the boxes and pins show through. */
|
|
1154
|
+
.ui-catcher {
|
|
1155
|
+
position: absolute;
|
|
1156
|
+
top: 0;
|
|
1157
|
+
left: 0;
|
|
1158
|
+
z-index: 4;
|
|
1159
|
+
cursor: crosshair;
|
|
1160
|
+
}
|
|
1161
|
+
|
|
1162
|
+
/* Positioned against the canvas by the element, which measures the author's markup. */
|
|
1163
|
+
.ui-layer {
|
|
1164
|
+
display: contents;
|
|
1165
|
+
}
|
|
1166
|
+
|
|
1167
|
+
.ui-box {
|
|
1168
|
+
position: absolute;
|
|
1169
|
+
z-index: 2;
|
|
1170
|
+
box-sizing: border-box;
|
|
1171
|
+
border-radius: 4px;
|
|
1172
|
+
pointer-events: none;
|
|
1173
|
+
}
|
|
1174
|
+
|
|
1175
|
+
.ui-hover {
|
|
1176
|
+
outline: 2px solid var(--dpk-accent);
|
|
1177
|
+
outline-offset: 1px;
|
|
1178
|
+
background: color-mix(in srgb, var(--dpk-accent) 8%, transparent);
|
|
1179
|
+
}
|
|
1180
|
+
|
|
1181
|
+
.ui-picked {
|
|
1182
|
+
outline: 2px solid var(--dpk-accent);
|
|
1183
|
+
outline-offset: 2px;
|
|
1184
|
+
background: color-mix(in srgb, var(--dpk-accent) 14%, transparent);
|
|
1185
|
+
box-shadow: 0 0 0 6px color-mix(in srgb, var(--dpk-accent) 18%, transparent);
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1188
|
+
.ui-pin {
|
|
1189
|
+
position: absolute;
|
|
1190
|
+
z-index: 3;
|
|
1191
|
+
display: grid;
|
|
1192
|
+
place-items: center;
|
|
1193
|
+
min-width: 20px;
|
|
1194
|
+
height: 20px;
|
|
1195
|
+
padding: 0 5px;
|
|
1196
|
+
box-sizing: border-box;
|
|
1197
|
+
transform: translate(-50%, -50%);
|
|
1198
|
+
border: 2px solid var(--dpk-paper-raised);
|
|
1199
|
+
border-radius: 999px 999px 999px 2px;
|
|
1200
|
+
background: var(--dpk-accent);
|
|
1201
|
+
color: var(--dpk-accent-ink);
|
|
1202
|
+
box-shadow: var(--dpk-shadow-sm);
|
|
1203
|
+
font-family: var(--dpk-mono);
|
|
1204
|
+
font-size: 10px;
|
|
1205
|
+
font-weight: 700;
|
|
1206
|
+
pointer-events: none;
|
|
1207
|
+
}
|
|
1208
|
+
|
|
1209
|
+
.ui-box[hidden],
|
|
1210
|
+
.ui-pin[hidden] {
|
|
1211
|
+
display: none;
|
|
1212
|
+
}
|
|
1213
|
+
|
|
1214
|
+
/* ---------------------------------------------------------- notes on the UI */
|
|
1215
|
+
|
|
1216
|
+
/* Positioned against the canvas by the element, like the pins; blue, so a note never reads as feedback. */
|
|
1217
|
+
.ui-notes {
|
|
1218
|
+
display: contents;
|
|
1219
|
+
}
|
|
1220
|
+
|
|
1221
|
+
.ui-note-badge {
|
|
1222
|
+
position: absolute;
|
|
1223
|
+
z-index: 3;
|
|
1224
|
+
display: inline-flex;
|
|
1225
|
+
align-items: center;
|
|
1226
|
+
gap: 3px;
|
|
1227
|
+
height: 20px;
|
|
1228
|
+
padding: 0 6px 0 5px;
|
|
1229
|
+
box-sizing: border-box;
|
|
1230
|
+
transform: translate(-50%, -50%);
|
|
1231
|
+
border: 2px solid var(--dpk-paper-raised);
|
|
1232
|
+
border-radius: 999px;
|
|
1233
|
+
background: var(--dpk-blue);
|
|
1234
|
+
color: #fff;
|
|
1235
|
+
box-shadow: var(--dpk-shadow-sm);
|
|
1236
|
+
font-family: var(--dpk-mono);
|
|
1237
|
+
font-size: 10px;
|
|
1238
|
+
font-weight: 700;
|
|
1239
|
+
line-height: 1;
|
|
1240
|
+
cursor: pointer;
|
|
1241
|
+
}
|
|
1242
|
+
|
|
1243
|
+
.ui-note-badge svg {
|
|
1244
|
+
width: 11px;
|
|
1245
|
+
height: 11px;
|
|
1246
|
+
}
|
|
1247
|
+
|
|
1248
|
+
.ui-note-badge:hover,
|
|
1249
|
+
.ui-note-badge[aria-expanded='true'] {
|
|
1250
|
+
background: var(--dpk-blue-strong);
|
|
1251
|
+
}
|
|
1252
|
+
|
|
1253
|
+
.ui-note-badge:focus-visible {
|
|
1254
|
+
outline: 2px solid var(--dpk-focus);
|
|
1255
|
+
outline-offset: 1px;
|
|
1256
|
+
}
|
|
1257
|
+
|
|
1258
|
+
.ui-note-badge[hidden] {
|
|
1259
|
+
display: none;
|
|
1260
|
+
}
|
|
1261
|
+
|
|
1262
|
+
.ui-notes-head {
|
|
1263
|
+
display: flex;
|
|
1264
|
+
align-items: center;
|
|
1265
|
+
gap: 6px;
|
|
1266
|
+
}
|
|
1267
|
+
|
|
1268
|
+
/* The badge's icon and blue: the list reads as the badge opened. */
|
|
1269
|
+
.ui-notes-head > svg {
|
|
1270
|
+
flex: none;
|
|
1271
|
+
width: 14px;
|
|
1272
|
+
height: 14px;
|
|
1273
|
+
color: var(--dpk-blue);
|
|
1274
|
+
}
|
|
1275
|
+
|
|
1276
|
+
.ui-notes-head .comment-target {
|
|
1277
|
+
flex: 1 1 auto;
|
|
1278
|
+
min-width: 0;
|
|
1279
|
+
overflow: hidden;
|
|
1280
|
+
text-overflow: ellipsis;
|
|
1281
|
+
white-space: nowrap;
|
|
1282
|
+
}
|
|
1283
|
+
|
|
1284
|
+
.ui-note-list {
|
|
1285
|
+
display: grid;
|
|
1286
|
+
gap: 6px;
|
|
1287
|
+
max-height: 240px;
|
|
1288
|
+
margin: 0;
|
|
1289
|
+
padding: 0;
|
|
1290
|
+
overflow: auto;
|
|
1291
|
+
list-style: none;
|
|
1292
|
+
}
|
|
1293
|
+
|
|
1294
|
+
.ui-note-list li {
|
|
1295
|
+
display: flex;
|
|
1296
|
+
align-items: flex-start;
|
|
1297
|
+
gap: 4px;
|
|
1298
|
+
padding: 8px 4px 8px 10px;
|
|
1299
|
+
border-radius: var(--dpk-radius-sm);
|
|
1300
|
+
background: var(--dpk-paper-sunken);
|
|
1301
|
+
}
|
|
1302
|
+
|
|
1303
|
+
.ui-note-main {
|
|
1304
|
+
display: grid;
|
|
1305
|
+
flex: 1 1 auto;
|
|
1306
|
+
gap: 2px;
|
|
1307
|
+
min-width: 0;
|
|
1308
|
+
}
|
|
1309
|
+
|
|
1310
|
+
.ui-note-body {
|
|
1311
|
+
margin: 0;
|
|
1312
|
+
color: var(--dpk-ink);
|
|
1313
|
+
font-size: 12.5px;
|
|
1314
|
+
line-height: 1.6;
|
|
1315
|
+
white-space: pre-wrap;
|
|
1316
|
+
overflow-wrap: anywhere;
|
|
1317
|
+
}
|
|
1318
|
+
|
|
1319
|
+
.ui-note-time {
|
|
1320
|
+
color: var(--dpk-ink-faint);
|
|
1321
|
+
font-family: var(--dpk-mono);
|
|
1322
|
+
font-size: 10.5px;
|
|
1323
|
+
}
|
|
1324
|
+
|
|
1325
|
+
/* Rewrite and delete sit together at the end of the row. */
|
|
1326
|
+
.ui-note-list li .dpk-icon-btn + .dpk-icon-btn {
|
|
1327
|
+
margin-left: -4px;
|
|
1328
|
+
}
|
|
1329
|
+
|
|
1330
|
+
.ui-note-list li:has(.ui-note-editor) {
|
|
1331
|
+
padding: 6px;
|
|
1332
|
+
}
|
|
1333
|
+
|
|
1334
|
+
.ui-note-editor {
|
|
1335
|
+
display: grid;
|
|
1336
|
+
flex: 1 1 auto;
|
|
1337
|
+
gap: 6px;
|
|
1338
|
+
min-width: 0;
|
|
1339
|
+
}
|
|
1340
|
+
|
|
1341
|
+
.ui-note-editor textarea {
|
|
1342
|
+
min-height: 72px;
|
|
1343
|
+
background: var(--dpk-paper-raised);
|
|
1344
|
+
font-size: 12.5px;
|
|
1345
|
+
}
|
|
1346
|
+
|
|
1347
|
+
.ui-note-editor-actions {
|
|
1348
|
+
display: flex;
|
|
1349
|
+
justify-content: flex-end;
|
|
1350
|
+
gap: 6px;
|
|
1351
|
+
}
|
|
1352
|
+
|
|
1353
|
+
/*
|
|
1354
|
+
* Side by side: what the user sees together, in one row. A fixed viewport
|
|
1355
|
+
* keeps its width as long as the row allows it, a fluid one takes the rest;
|
|
1356
|
+
* a row wider than the canvas scrolls sideways instead of squeezing a device.
|
|
1357
|
+
*/
|
|
1358
|
+
.panes {
|
|
1359
|
+
display: flex;
|
|
1360
|
+
align-items: flex-start;
|
|
1361
|
+
justify-content: safe center;
|
|
1362
|
+
gap: 28px;
|
|
1363
|
+
width: 100%;
|
|
1364
|
+
min-width: 0;
|
|
1365
|
+
overflow-x: auto;
|
|
1366
|
+
padding-bottom: 4px;
|
|
1367
|
+
}
|
|
1368
|
+
|
|
1369
|
+
/*
|
|
1370
|
+
* A row wider than the stage fades out at the edge it scrolls toward, so the
|
|
1371
|
+
* panes past it read as a scroll away rather than cut off. The scroll timeline
|
|
1372
|
+
* is inactive while the row fits, which leaves it unmasked.
|
|
1373
|
+
*/
|
|
1374
|
+
@supports (animation-timeline: scroll()) {
|
|
1375
|
+
.panes {
|
|
1376
|
+
animation: panes-edge linear both;
|
|
1377
|
+
animation-timeline: scroll(self inline);
|
|
1378
|
+
}
|
|
1379
|
+
|
|
1380
|
+
@keyframes panes-edge {
|
|
1381
|
+
0% {
|
|
1382
|
+
mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent);
|
|
1383
|
+
}
|
|
1384
|
+
2%,
|
|
1385
|
+
98% {
|
|
1386
|
+
mask-image: linear-gradient(90deg, transparent, #000 40px, #000 calc(100% - 40px), transparent);
|
|
1387
|
+
}
|
|
1388
|
+
100% {
|
|
1389
|
+
mask-image: linear-gradient(90deg, transparent, #000 40px);
|
|
1390
|
+
}
|
|
1391
|
+
}
|
|
1392
|
+
}
|
|
1393
|
+
|
|
1394
|
+
/* A device shrinks at most to a width its layout still reads at, then the row scrolls. */
|
|
1395
|
+
.pane {
|
|
1396
|
+
display: grid;
|
|
1397
|
+
/* The pane's width is the device's: a long label never widens it. */
|
|
1398
|
+
grid-template-columns: minmax(0, 1fr);
|
|
1399
|
+
gap: 8px;
|
|
1400
|
+
flex: 0 1 var(--pane-width);
|
|
1401
|
+
min-width: min(var(--pane-width), 720px);
|
|
1402
|
+
}
|
|
1403
|
+
|
|
1404
|
+
.pane[data-viewport='mobile'] {
|
|
1405
|
+
--pane-width: 390px;
|
|
1406
|
+
}
|
|
1407
|
+
|
|
1408
|
+
.pane[data-viewport='tablet'] {
|
|
1409
|
+
--pane-width: 834px;
|
|
1410
|
+
}
|
|
1411
|
+
|
|
1412
|
+
.pane[data-viewport='desktop'] {
|
|
1413
|
+
--pane-width: 1180px;
|
|
1414
|
+
}
|
|
1415
|
+
|
|
1416
|
+
.pane[data-viewport='fluid'] {
|
|
1417
|
+
flex: 1 1 0;
|
|
1418
|
+
min-width: 240px;
|
|
1419
|
+
}
|
|
1420
|
+
|
|
1421
|
+
.pane .frame {
|
|
1422
|
+
width: 100%;
|
|
1423
|
+
}
|
|
1424
|
+
|
|
1425
|
+
.pane-head {
|
|
1426
|
+
display: flex;
|
|
1427
|
+
flex-wrap: wrap;
|
|
1428
|
+
align-items: center;
|
|
1429
|
+
justify-content: space-between;
|
|
1430
|
+
gap: 8px;
|
|
1431
|
+
}
|
|
1432
|
+
|
|
1433
|
+
.pane-head .tabs {
|
|
1434
|
+
padding: 2px;
|
|
1435
|
+
}
|
|
1436
|
+
|
|
1437
|
+
.pane-head .tab {
|
|
1438
|
+
padding: 3px 11px;
|
|
1439
|
+
font-size: 11.5px;
|
|
1440
|
+
}
|
|
1441
|
+
|
|
1442
|
+
/* One line over the pane; hovering names the whole label. */
|
|
1443
|
+
.pane-label {
|
|
1444
|
+
justify-self: start;
|
|
1445
|
+
min-width: 0;
|
|
1446
|
+
max-width: 100%;
|
|
1447
|
+
overflow: hidden;
|
|
1448
|
+
text-overflow: ellipsis;
|
|
1449
|
+
white-space: nowrap;
|
|
1450
|
+
padding: 2px 9px;
|
|
1451
|
+
border-radius: 999px;
|
|
1452
|
+
background: var(--dpk-paper-raised);
|
|
1453
|
+
box-shadow: var(--dpk-bevel), var(--dpk-shadow-xs);
|
|
1454
|
+
font-size: 11.5px;
|
|
1455
|
+
font-weight: 600;
|
|
1456
|
+
color: var(--dpk-ink-soft);
|
|
1457
|
+
}
|
|
1458
|
+
|
|
1459
|
+
/*
|
|
1460
|
+
* Maximized: the stage covers the tab — the page head, the tabs and the canvas
|
|
1461
|
+
* alone. It is also a manual popover in the top layer, so the UA popover box
|
|
1462
|
+
* (fit-content, margin, border, padding, colors) is reset here. The canvas
|
|
1463
|
+
* scrolls instead of the page, and a browser preview is at least as tall as
|
|
1464
|
+
* the tab allows; a phone keeps its device shape. Whatever sits above the
|
|
1465
|
+
* canvas (the situation, the comment-on-UI hint) keeps its own height, and the
|
|
1466
|
+
* canvas takes the rest.
|
|
1467
|
+
*/
|
|
1468
|
+
.stage.is-maximized {
|
|
1469
|
+
position: fixed;
|
|
1470
|
+
inset: 0;
|
|
1471
|
+
z-index: 2147483000;
|
|
1472
|
+
display: flex;
|
|
1473
|
+
flex-direction: column;
|
|
1474
|
+
width: auto;
|
|
1475
|
+
height: auto;
|
|
1476
|
+
max-width: none;
|
|
1477
|
+
max-height: none;
|
|
1478
|
+
margin: 0;
|
|
1479
|
+
padding: 16px 20px 20px;
|
|
1480
|
+
border: 0;
|
|
1481
|
+
color: var(--dpk-ink);
|
|
1482
|
+
background: var(--dpk-paper);
|
|
1483
|
+
overflow: hidden;
|
|
1484
|
+
}
|
|
1485
|
+
|
|
1486
|
+
.stage.is-maximized > * {
|
|
1487
|
+
flex: none;
|
|
1488
|
+
}
|
|
1489
|
+
|
|
1490
|
+
.canvas:has(> .frame[data-window='device']) {
|
|
1491
|
+
align-items: flex-start;
|
|
1492
|
+
/* A device wider than the stage is drawn smaller to fit it, so it never widens the page. */
|
|
1493
|
+
min-width: 0;
|
|
1494
|
+
contain: inline-size;
|
|
1495
|
+
}
|
|
1496
|
+
|
|
1497
|
+
.stage.is-maximized > .canvas {
|
|
1498
|
+
flex: 1 1 0;
|
|
1499
|
+
min-height: 0;
|
|
1500
|
+
align-items: flex-start;
|
|
1501
|
+
overflow: auto;
|
|
1502
|
+
overscroll-behavior: contain;
|
|
1503
|
+
}
|
|
1504
|
+
|
|
1505
|
+
.stage.is-maximized .frame:not([data-kind='native'], [data-kind='plain']) {
|
|
1506
|
+
display: flex;
|
|
1507
|
+
flex-direction: column;
|
|
1508
|
+
min-height: 100%;
|
|
1509
|
+
}
|
|
1510
|
+
|
|
1511
|
+
.stage.is-maximized .frame:not([data-kind='native'], [data-kind='plain']) .viewport {
|
|
1512
|
+
flex: 1 0 auto;
|
|
1513
|
+
}
|
|
1514
|
+
|
|
1515
|
+
/*
|
|
1516
|
+
* Demo: the app view's browser alone across the tab, as if the reader were
|
|
1517
|
+
* using the app — no title, no tools, no canvas around it. The browser fills
|
|
1518
|
+
* the tab and its page scrolls inside the viewport; a phone stays phone wide.
|
|
1519
|
+
*/
|
|
1520
|
+
.stage.is-demo {
|
|
1521
|
+
position: fixed;
|
|
1522
|
+
inset: 0;
|
|
1523
|
+
z-index: 2147483000;
|
|
1524
|
+
display: flex;
|
|
1525
|
+
flex-direction: column;
|
|
1526
|
+
width: auto;
|
|
1527
|
+
height: auto;
|
|
1528
|
+
max-width: none;
|
|
1529
|
+
max-height: none;
|
|
1530
|
+
margin: 0;
|
|
1531
|
+
padding: 0;
|
|
1532
|
+
border: 0;
|
|
1533
|
+
color: var(--dpk-ink);
|
|
1534
|
+
background: var(--dpk-paper-sunken);
|
|
1535
|
+
overflow: hidden;
|
|
1536
|
+
}
|
|
1537
|
+
|
|
1538
|
+
.stage.is-demo > .canvas {
|
|
1539
|
+
flex: 1 1 0;
|
|
1540
|
+
min-height: 0;
|
|
1541
|
+
padding: 0;
|
|
1542
|
+
border: 0;
|
|
1543
|
+
border-radius: 0;
|
|
1544
|
+
background: var(--dpk-dots), var(--dpk-paper-sunken);
|
|
1545
|
+
box-shadow: none;
|
|
1546
|
+
overflow: auto;
|
|
1547
|
+
overscroll-behavior: contain;
|
|
1548
|
+
}
|
|
1549
|
+
|
|
1550
|
+
.stage.is-demo .frame[data-window='fill'] {
|
|
1551
|
+
width: 100%;
|
|
1552
|
+
height: 100%;
|
|
1553
|
+
border: 0;
|
|
1554
|
+
border-radius: 0;
|
|
1555
|
+
box-shadow: none;
|
|
1556
|
+
}
|
|
1557
|
+
|
|
1558
|
+
/* A device keeps its size, in the middle of the tab (the element leaves 24px around it). */
|
|
1559
|
+
.stage.is-demo > .canvas > .frame[data-window='device'] {
|
|
1560
|
+
margin: auto;
|
|
1561
|
+
}
|
|
1562
|
+
|
|
1563
|
+
.stage.is-demo > .canvas > .frame:not([data-window]) {
|
|
1564
|
+
margin: 24px auto;
|
|
1565
|
+
}
|
|
1566
|
+
|
|
1567
|
+
/*
|
|
1568
|
+
* The demo's controls (commenting on the UI, the way out). Over a phone or a
|
|
1569
|
+
* frame outside the browser, they float at the top right.
|
|
1570
|
+
*/
|
|
1571
|
+
.demo-controls {
|
|
1572
|
+
position: absolute;
|
|
1573
|
+
top: 12px;
|
|
1574
|
+
right: 16px;
|
|
1575
|
+
z-index: 3;
|
|
1576
|
+
display: flex;
|
|
1577
|
+
align-items: center;
|
|
1578
|
+
gap: 6px;
|
|
1579
|
+
}
|
|
1580
|
+
|
|
1581
|
+
.demo-control {
|
|
1582
|
+
display: inline-flex;
|
|
1583
|
+
align-items: center;
|
|
1584
|
+
gap: 6px;
|
|
1585
|
+
height: 30px;
|
|
1586
|
+
padding: 0 10px;
|
|
1587
|
+
border: 1px solid var(--dpk-rule-strong);
|
|
1588
|
+
border-radius: 999px;
|
|
1589
|
+
background: color-mix(in srgb, var(--dpk-paper-raised) 82%, transparent);
|
|
1590
|
+
backdrop-filter: blur(10px);
|
|
1591
|
+
box-shadow: var(--dpk-shadow);
|
|
1592
|
+
color: var(--dpk-ink-soft);
|
|
1593
|
+
font: 600 12px/1 var(--dpk-body);
|
|
1594
|
+
cursor: pointer;
|
|
1595
|
+
opacity: 0.55;
|
|
1596
|
+
transition:
|
|
1597
|
+
opacity 160ms var(--dpk-ease),
|
|
1598
|
+
color 160ms var(--dpk-ease);
|
|
1599
|
+
}
|
|
1600
|
+
|
|
1601
|
+
.demo-exit {
|
|
1602
|
+
padding-right: 8px;
|
|
1603
|
+
}
|
|
1604
|
+
|
|
1605
|
+
.demo-control:hover,
|
|
1606
|
+
.demo-control:focus-visible {
|
|
1607
|
+
opacity: 1;
|
|
1608
|
+
color: var(--dpk-ink);
|
|
1609
|
+
}
|
|
1610
|
+
|
|
1611
|
+
.demo-control:focus-visible {
|
|
1612
|
+
outline: none;
|
|
1613
|
+
box-shadow: var(--dpk-focus), var(--dpk-shadow);
|
|
1614
|
+
}
|
|
1615
|
+
|
|
1616
|
+
/* Commenting stays in sight: a click on the app now picks an element instead of using it. */
|
|
1617
|
+
.demo-control[aria-pressed='true'] {
|
|
1618
|
+
opacity: 1;
|
|
1619
|
+
border-color: var(--dpk-accent-strong);
|
|
1620
|
+
background: var(--dpk-accent);
|
|
1621
|
+
color: var(--dpk-accent-ink);
|
|
1622
|
+
}
|
|
1623
|
+
|
|
1624
|
+
.demo-control svg {
|
|
1625
|
+
width: 12px;
|
|
1626
|
+
height: 12px;
|
|
1627
|
+
}
|
|
1628
|
+
|
|
1629
|
+
/* A desktop browser has them at the free end of the tab strip, like window controls. */
|
|
1630
|
+
.browser-tabs .demo-controls {
|
|
1631
|
+
position: static;
|
|
1632
|
+
flex: none;
|
|
1633
|
+
align-self: center;
|
|
1634
|
+
margin: 0 0 3px auto;
|
|
1635
|
+
}
|
|
1636
|
+
|
|
1637
|
+
.browser-tabs .demo-control {
|
|
1638
|
+
height: 26px;
|
|
1639
|
+
}
|
|
1640
|
+
|
|
1641
|
+
.browser-tabs .demo-control:not([aria-pressed='true']) {
|
|
1642
|
+
opacity: 0.85;
|
|
1643
|
+
}
|
|
1644
|
+
|
|
1645
|
+
.demo-exit kbd {
|
|
1646
|
+
padding: 2px 5px;
|
|
1647
|
+
border: 1px solid var(--dpk-rule-strong);
|
|
1648
|
+
border-radius: var(--dpk-radius-xs);
|
|
1649
|
+
background: var(--dpk-paper-sunken);
|
|
1650
|
+
font: 600 10px/1 var(--dpk-mono);
|
|
1651
|
+
}
|
|
1652
|
+
|
|
1653
|
+
/* ------------------------------------------------------------------ frame */
|
|
1654
|
+
|
|
1655
|
+
.frame {
|
|
1656
|
+
width: min(var(--frame-width), 100%);
|
|
1657
|
+
max-width: 100%;
|
|
1658
|
+
margin: 0;
|
|
1659
|
+
border: 1px solid var(--dpk-rule);
|
|
1660
|
+
border-radius: var(--dpk-radius-lg);
|
|
1661
|
+
background: var(--dpk-paper-raised);
|
|
1662
|
+
box-shadow: var(--dpk-bevel), var(--dpk-shadow-lg);
|
|
1663
|
+
overflow: hidden;
|
|
1664
|
+
/* However high the mock stacks its own layers, they stay under what the stage draws over the frame. */
|
|
1665
|
+
isolation: isolate;
|
|
1666
|
+
transition: box-shadow 200ms var(--dpk-ease);
|
|
1667
|
+
}
|
|
1668
|
+
|
|
1669
|
+
/*
|
|
1670
|
+
* Native previews are recognised by their device shape: a slim bezel, a status
|
|
1671
|
+
* bar with a punch-hole camera, and a home indicator. No address bar.
|
|
1672
|
+
*/
|
|
1673
|
+
.frame[data-kind='native'] {
|
|
1674
|
+
padding: 10px;
|
|
1675
|
+
border-color: #22262e;
|
|
1676
|
+
border-radius: 28px;
|
|
1677
|
+
background: linear-gradient(160deg, #2e3440, #1a1d24);
|
|
1678
|
+
box-shadow:
|
|
1679
|
+
var(--dpk-shadow-lg),
|
|
1680
|
+
inset 0 1px 0 rgba(255, 255, 255, 0.06);
|
|
1681
|
+
}
|
|
1682
|
+
|
|
1683
|
+
.frame[data-kind='native'] .viewport {
|
|
1684
|
+
overflow: hidden;
|
|
1685
|
+
border-radius: 18px;
|
|
1686
|
+
}
|
|
1687
|
+
|
|
1688
|
+
/* A phone is portrait: derive the screen height from its width (~1:2.05)
|
|
1689
|
+
instead of reusing the browser preview heights. */
|
|
1690
|
+
.frame[data-kind='native'][data-viewport='mobile'] .viewport {
|
|
1691
|
+
min-height: calc((var(--frame-width, 390px) - 16px) * 2.05);
|
|
1692
|
+
}
|
|
1693
|
+
|
|
1694
|
+
/*
|
|
1695
|
+
* A plain preview is not a screen: no chrome, no bezel, no frame of its own.
|
|
1696
|
+
* The light DOM draws the whole object (a memo, a FAX, a paper form) and the
|
|
1697
|
+
* canvas is its desk, so it is as tall as its content.
|
|
1698
|
+
*/
|
|
1699
|
+
.frame[data-kind='plain'] {
|
|
1700
|
+
border: none;
|
|
1701
|
+
border-radius: 0;
|
|
1702
|
+
background: transparent;
|
|
1703
|
+
box-shadow: none;
|
|
1704
|
+
overflow: visible;
|
|
1705
|
+
}
|
|
1706
|
+
|
|
1707
|
+
.frame[data-kind='plain'] .viewport {
|
|
1708
|
+
min-height: 0;
|
|
1709
|
+
background: transparent;
|
|
1710
|
+
}
|
|
1711
|
+
|
|
1712
|
+
.frame[data-kind='plain'][data-empty] .viewport {
|
|
1713
|
+
min-height: 180px;
|
|
1714
|
+
}
|
|
1715
|
+
|
|
1716
|
+
/* Home indicator. */
|
|
1717
|
+
.frame[data-kind='native'] .viewport::after {
|
|
1718
|
+
content: '';
|
|
1719
|
+
position: absolute;
|
|
1720
|
+
bottom: 8px;
|
|
1721
|
+
left: 50%;
|
|
1722
|
+
width: 88px;
|
|
1723
|
+
height: 4px;
|
|
1724
|
+
transform: translateX(-50%);
|
|
1725
|
+
border-radius: 999px;
|
|
1726
|
+
background: rgba(138, 146, 160, 0.55);
|
|
1727
|
+
}
|
|
1728
|
+
|
|
1729
|
+
/*
|
|
1730
|
+
* The preview is never scrolled on its own: it shows everything it contains and
|
|
1731
|
+
* the page scrolls as a whole. The flex column keeps a short mock filling
|
|
1732
|
+
* the frame's minimum height without pinning a maximum.
|
|
1733
|
+
*/
|
|
1734
|
+
.viewport {
|
|
1735
|
+
position: relative;
|
|
1736
|
+
contain: layout;
|
|
1737
|
+
display: flex;
|
|
1738
|
+
flex-direction: column;
|
|
1739
|
+
width: 100%;
|
|
1740
|
+
min-height: var(--frame-min-height, 480px);
|
|
1741
|
+
/* A preview is the product's screen, not the kit's chrome: it stays light in a dark theme. */
|
|
1742
|
+
color-scheme: light;
|
|
1743
|
+
background: #fff;
|
|
1744
|
+
/* …and so does its ink: the kit's dark-theme text color would be invisible on it. */
|
|
1745
|
+
color: #1f2430;
|
|
1746
|
+
}
|
|
1747
|
+
|
|
1748
|
+
/*
|
|
1749
|
+
* The author's wrapper becomes the frame's filling layer: a one-cell grid makes
|
|
1750
|
+
* its height definite, so a mock that asks for height:100% fills the frame
|
|
1751
|
+
* instead of collapsing to its content.
|
|
1752
|
+
*/
|
|
1753
|
+
/*
|
|
1754
|
+
* The author's wrapper is a stretch row: a mock fills a short frame and grows
|
|
1755
|
+
* the frame when its own content is taller. Stretching (rather than a
|
|
1756
|
+
* percentage height) is what makes the fill reliable.
|
|
1757
|
+
*/
|
|
1758
|
+
/* Only the viewport carries the minimum height; the wrapper grows to fill it. */
|
|
1759
|
+
.viewport ::slotted(*) {
|
|
1760
|
+
display: grid;
|
|
1761
|
+
flex: 1 0 auto;
|
|
1762
|
+
min-width: 0;
|
|
1763
|
+
}
|
|
1764
|
+
|
|
1765
|
+
/*
|
|
1766
|
+
* The app view is a simulation: a screen runs in a window of a fixed size (a
|
|
1767
|
+
* device's screen, or the whole demo) and what does not fit scrolls inside
|
|
1768
|
+
* the author's wrapper, the way the real page scrolls under the device's own
|
|
1769
|
+
* chrome — the status bar, the address bar and a phone browser's bottom bar
|
|
1770
|
+
* stay where they are. The viewport contains layout, so a mock's
|
|
1771
|
+
* fixed position element (a tab bar, a modal) stays on the device screen.
|
|
1772
|
+
*/
|
|
1773
|
+
.frame[data-window] {
|
|
1774
|
+
display: flex;
|
|
1775
|
+
flex: none;
|
|
1776
|
+
flex-direction: column;
|
|
1777
|
+
box-sizing: border-box;
|
|
1778
|
+
max-width: none;
|
|
1779
|
+
}
|
|
1780
|
+
|
|
1781
|
+
.frame[data-window='device'] {
|
|
1782
|
+
width: var(--device-width);
|
|
1783
|
+
height: var(--device-height);
|
|
1784
|
+
}
|
|
1785
|
+
|
|
1786
|
+
.frame[data-kind][data-window] .viewport {
|
|
1787
|
+
flex: 1 1 0;
|
|
1788
|
+
min-height: 0;
|
|
1789
|
+
overflow: hidden;
|
|
1790
|
+
}
|
|
1791
|
+
|
|
1792
|
+
.frame[data-window] .viewport ::slotted(*) {
|
|
1793
|
+
flex: 1 1 0;
|
|
1794
|
+
min-height: 0;
|
|
1795
|
+
overflow: auto;
|
|
1796
|
+
overscroll-behavior: contain;
|
|
1797
|
+
}
|
|
1798
|
+
|
|
1799
|
+
.frame-placeholder {
|
|
1800
|
+
position: absolute;
|
|
1801
|
+
inset: 12px;
|
|
1802
|
+
display: grid;
|
|
1803
|
+
align-content: center;
|
|
1804
|
+
justify-items: center;
|
|
1805
|
+
gap: 8px;
|
|
1806
|
+
padding: 12px;
|
|
1807
|
+
text-align: center;
|
|
1808
|
+
color: var(--dpk-ink-faint);
|
|
1809
|
+
border: 1px dashed var(--dpk-rule-strong);
|
|
1810
|
+
border-radius: var(--dpk-radius);
|
|
1811
|
+
background: var(--dpk-dots), var(--dpk-paper-sunken);
|
|
1812
|
+
}
|
|
1813
|
+
|
|
1814
|
+
.frame-placeholder code {
|
|
1815
|
+
padding: 3px 7px;
|
|
1816
|
+
border: 1px solid var(--dpk-rule);
|
|
1817
|
+
border-radius: var(--dpk-radius-xs);
|
|
1818
|
+
background: var(--dpk-paper-raised);
|
|
1819
|
+
font-family: var(--dpk-mono);
|
|
1820
|
+
font-size: 10px;
|
|
1821
|
+
}
|
|
1822
|
+
|
|
1823
|
+
.parked {
|
|
1824
|
+
display: none;
|
|
1825
|
+
}
|
|
1826
|
+
`,Es=`
|
|
1827
|
+
/*
|
|
1828
|
+
* The wrapper is a stretch grid (see \`.viewport ::slotted(*)\`): one child
|
|
1829
|
+
* fills the frame, but several would share the extra height as gaps between
|
|
1830
|
+
* them, so they stack from the top instead (a \`<style>\` or \`<script>\` beside
|
|
1831
|
+
* the one child draws nothing and does not count). A shadow tree cannot see a
|
|
1832
|
+
* slotted element's children, hence the document rule; \`:where\` lets the
|
|
1833
|
+
* author's own \`align-content\` win.
|
|
1834
|
+
*/
|
|
1835
|
+
:where(
|
|
1836
|
+
dpk-view-prototype
|
|
1837
|
+
> [data-preview-id]:has(> :not(style, script, template, link) ~ :not(style, script, template, link))
|
|
1838
|
+
) {
|
|
1839
|
+
align-content: start;
|
|
1840
|
+
}
|
|
1841
|
+
|
|
1842
|
+
dpk-view-prototype > [data-preview-id]:has(dialog[${Ee}][open]) {
|
|
1843
|
+
position: relative;
|
|
1844
|
+
}
|
|
1845
|
+
|
|
1846
|
+
dpk-view-prototype > [data-preview-id]:has(dialog[${Ee}][open])::after {
|
|
1847
|
+
content: '';
|
|
1848
|
+
position: absolute;
|
|
1849
|
+
inset: 0;
|
|
1850
|
+
z-index: 1;
|
|
1851
|
+
background: color-mix(in srgb, var(--dpk-ink, #111827) 38%, transparent);
|
|
1852
|
+
}
|
|
1853
|
+
|
|
1854
|
+
dpk-view-prototype > [data-preview-id] dialog[${Ee}][open] {
|
|
1855
|
+
position: absolute;
|
|
1856
|
+
inset: 0;
|
|
1857
|
+
z-index: 2;
|
|
1858
|
+
max-width: calc(100% - 32px);
|
|
1859
|
+
max-height: calc(100% - 32px);
|
|
1860
|
+
margin: auto;
|
|
1861
|
+
}
|
|
1862
|
+
`,qe={kind:"off"},Ss=(t,e)=>{switch(e.kind){case"toggle":return t.kind==="off"?{kind:"picking",as:"feedback"}:qe;case"exit":return qe;case"pick":return t.kind==="off"?t:{kind:"composing",target:e.target,body:t.kind==="composing"?t.body:"",as:t.as};case"input":return t.kind==="composing"?{...t,body:e.body}:t;case"choose":return t.kind==="off"||t.as===e.as?t:{...t,as:e.as};case"dismiss":case"submitted":return t.kind==="off"?t:{kind:"picking",as:t.as};default:return t}},$s={width:300,height:300},Ts=360,As={width:280,height:360},Is={width:300,height:320},Oi=(t,e)=>({previewId:t.previewId,selector:e.selector,...e.text===void 0?{}:{text:e.text}}),Ci=".comment-pop:not(.ui-notes-pop)",_s="prototype-ui-comment",Ps="comment-ui-element",Mi="dpk-view-prototype-document-styles",Ds=24,Rs=()=>{if(document.getElementById(Mi)!==null)return;const t=Object.assign(document.createElement("style"),{id:Mi,textContent:Es});document.head.append(t)},Ns=(t,e,i)=>{const n=getComputedStyle(t),o=/auto|scroll/.test(n.overflowX)&&t.scrollWidth>t.clientWidth,s=/auto|scroll/.test(n.overflowY)&&t.scrollHeight>t.clientHeight,r=e<0?t.scrollLeft>0:e>0&&t.scrollLeft+t.clientWidth<t.scrollWidth-1,a=i<0?t.scrollTop>0:i>0&&t.scrollTop+t.clientHeight<t.scrollHeight-1;return o&&r||s&&a},Li=t=>{if(t.assignedSlot!==null)return t.assignedSlot;if(t.parentElement!==null)return t.parentElement;const e=t.getRootNode();return e instanceof ShadowRoot?e.host:null},Os=(t,e)=>{let i=t;for(;i!==null;){if(i===e)return!0;i=Li(i)}return!1};class Ui extends ot{static{this.styles=[ot.styles,sn,rn,pn,cn,un,bn,xs]}#e=qe;#k=!1;#p=null;#o=[];#x=new an(this);#K={app:new ve(this),activity:new ve(this),story:new ve(this)};#X=new ve(this);#O=!1;#i=null;#s=null;#C=!1;#h=!1;#E=!1;#r=null;#S=null;#$={};#T=1;#v=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>{this.#q(),this.#w()});#c=null;#u=null;#f=null;#A=!1;#n=null;#I=null;#g=null;#t=null;#m=null;#M=typeof MutationObserver>"u"?null:new MutationObserver(()=>this.#ue());#d=null;constructor(){super(),new st(this,{open:()=>this.#f!==null,closesOn:e=>!e.some(i=>i instanceof Element&&this.#Q(i)),ownsEscape:()=>!0,dismiss:()=>this.#_(!0)}),new st(this,{open:()=>this.#n!==null,closesOn:e=>!e.some(i=>i instanceof Element&&(i.classList.contains("ui-notes-pop")||i.classList.contains("ui-note-badge"))),ownsEscape:()=>!0,dismiss:()=>this.#P(!0)})}definitionFor(e){return oi(e)}connectedCallback(){super.connectedCallback(),window.addEventListener("keydown",this.#H),window.addEventListener("resize",this.#D),this.addEventListener("toggle",this.#F,!0),this.addEventListener("click",this.#b,!0),this.addEventListener("auxclick",this.#b,!0),this.#M?.observe(this,{subtree:!0,childList:!0,attributes:!0,characterData:!0}),Rs()}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("keydown",this.#H),window.removeEventListener("resize",this.#D),this.removeEventListener("toggle",this.#F,!0),this.removeEventListener("click",this.#b,!0),this.removeEventListener("auxclick",this.#b,!0),this.#v?.disconnect(),this.#c=null,this.#M?.disconnect(),this.#d!==null&&cancelAnimationFrame(this.#d),this.#d=null,this.#j()}renderRegions(e){const i=le(this.locale),n=te(e.state,e.navigation),o=pe(e.navigation)==="app";this.#i!==null&&this.#i.mode==="demo"!==o&&this.#G();const s=o?this.#we(e,i):null;return this.#C=s!==null,this.#o=n!==void 0&&n.kind!=="story"&&(s===null||s.view.entry?.kind==="page")?Ye(e.state,n,e.navigation).shown.map(r=>r.id):[],this.#r!==null&&this.#r.page!==this.#o.join(" ")&&this.#j(),{sidebar:yi(e,i,this.#K),main:Pi(e,i,{deviceSelect:this.#X,hasPreviewContent:r=>this.#$e(r),lift:this.#i,onToggleMaximize:()=>this.#N(this.#i===null?"maximized":null),onToggleDemo:()=>this.#N(this.#i===null?"demo":null),onLiftedWheel:this.#ye,browser:s===null?null:{...s,loading:this.#r!==null},devices:o?{choice:this.#$,zoom:this.#T,onPick:r=>{this.#$=Vo(this.#$,r),this.requestUpdate()}}:null,uiComment:this.#ne(e),uiNotes:this.#se(e,o),actions:this.#Z(e),canvasEvents:{click:this.#de,pointermove:this.#le,pointerleave:this.#pe,wheel:this.#ce,scroll:this.#D}})}}updated(){super.updated(),this.#ge(),this.#ve(),this.#he(),this.#q();const e=this.#e;if(e.kind==="composing"&&!this.#o.includes(e.target.previewId)){this.#l({kind:"dismiss"});return}this.#me(),this.#ee(),this.#E&&(this.#E=!1,this.renderRoot.querySelector('.browser-tab[aria-selected="true"]')?.focus()),this.#w(),this.#re();const i=e.kind==="composing"&&!this.#k;if(this.#k=e.kind==="composing",e.kind!=="composing"||this.#p===null)return;const n=this.renderRoot.querySelector(Ci);n&&(this.#x.open(n,this.#p,$s,{placement:"right-start"}),i&&n.querySelector("textarea")?.focus({preventScroll:!0}))}#Z(e){const i=Kt(e.state,this.#o),n=i.map(s=>s.screen.id).join(" "),o=i.length>0&&this.#u===n;return{groups:i,open:o,toggle:()=>o?this.#_(!1):this.#J(n),run:(s,r)=>this.#te(s,r)}}#J(e){this.#u=e,this.requestUpdate()}#_(e){this.#u!==null&&(this.#u=null,this.#A=e,this.requestUpdate())}#Q(e){return e.classList.contains("actions-menu")||e.getAttribute("data-role")==="actions"}#ee(){const e=this.renderRoot.querySelector(".actions-menu"),i=this.renderRoot.querySelector('[data-role="actions"]');if(e===null){this.#f=null,this.#A&&i?.focus({preventScroll:!0}),this.#A=!1;return}e===this.#f||i===null||(this.#f=e,this.#x.open(e,i,As),e.querySelector('[role="menuitem"]')?.focus({preventScroll:!0}))}#te(e,i){this.#_(!0);const n=Kt(this.derivation.state,this.#o).find(d=>d.screen.id===e),o=n?.actions.find(d=>d.id===i);if(n===void 0||o===void 0)return;const r=this.#y().filter(d=>n.previewIds.includes(d.getAttribute("data-preview-id")??"")).map(d=>{const p=[...xo(d,o.fill??{}),...Eo(d,o.click??[])];return d.dispatchEvent(new CustomEvent("dpk-action",{bubbles:!0,detail:{id:o.id,screen:n.screen.id}})),p}),a=(r[0]??[]).filter(d=>r.every(p=>p.includes(d)));a.length!==0&&console.warn(`[dev-process-kit] <dpk-view-prototype>: action "${o.id}" of screen "${n.screen.id}" found nothing on screen for: ${a.join(", ")}`)}getContextMenuItems(e){const i=e.origin??null;return!(i instanceof Element)||this.#o.length===0||!this.#ie(i)?null:[{id:_s,entries:[{kind:"item",id:Ps,label:le(this.locale).commentOnElement,run:()=>{this.#e.kind==="off"&&this.#l({kind:"toggle"})}}]}]}#ie(e){const i=this.renderRoot.querySelector(".stage");return i!==null&&Os(e,i)?!0:this.#y().some(n=>n===e||n.contains(e))}#ne(e){const i=this.#e,n=i.kind==="composing"?i.target:void 0,o=n?E(e.state,n.previewId)?.preview:void 0,s=n?re(n):void 0,r=i.kind==="composing"&&i.as==="note"?(o?.notes??[]).filter(a=>a.selector===n?.selector).map(a=>a.body):e.comments.filter(a=>a.target.type===O&&a.target.id===s).map(a=>Qe(a));return{mode:i,pins:i.kind==="off"?[]:zt(e.comments,this.#o),...n&&o?{targetLabel:Ve(o,n)}:{},notes:r,composer:kn(this.locale),send:a=>this.#l(a),submit:a=>this.#oe(e.state,a)}}#l(e){const i=Ss(this.#e,e);i!==this.#e&&(this.#e=i,i.kind!=="composing"&&(this.#p=null),i.kind!=="off"&&(this.#n=null),this.requestUpdate())}#oe(e,i){const n=this.#e;if(n.kind!=="composing")return;(n.as==="note"?this.dispatch(W.addUiNote(n.target,tt("note",_t(e)),i,new Date().toISOString())):this.dispatch({type:dn,target:{type:O,id:re(n.target)},payload:{body:i}})).ok&&this.#l({kind:"submitted"})}#se(e,i){const n=i?[]:Kn(e.state,this.#o),o=this.#e.kind==="off"&&this.#n!==null?n.find(r=>ie(r)===this.#n)??null:null;o===null&&(this.#n=null);const s=this.#t;return s!==null&&!o?.notes.some(r=>r.id===s.noteId)&&(this.#t=null),{badges:n,open:o,toggle:r=>{const a=ie(r);this.#n===a?this.#P(!1):(this.#n=a,this.#t=null,this.requestUpdate())},close:()=>this.#P(!0),remove:(r,a)=>{const d=r.notes.find(p=>p.id===a);d!==void 0&&this.dispatch(W.deleteUiNote(Oi(r,d),a))},editing:this.#t,edit:(r,a)=>{this.#t={noteId:r,body:a},this.#m={noteId:r,part:"editor"},this.requestUpdate()},input:r=>{this.#t!==null&&(this.#t={...this.#t,body:r}),this.requestUpdate()},save:()=>{const r=this.#t,a=o?.notes.find(p=>p.id===r?.noteId),d=r?.body.trim()??"";o===null||r===null||a===void 0||d===""||(d!==a.body&&this.dispatch(W.setUiNoteBody(Oi(o,a),a.id,d)),this.#L())},cancel:()=>this.#L()}}#L(){this.#t!==null&&(this.#m={noteId:this.#t.noteId,part:"edit"},this.#t=null,this.requestUpdate())}#P(e){this.#n!==null&&(this.#g=e?this.#n:null,this.#n=null,this.requestUpdate())}#re(){const e=this.renderRoot.querySelector(".ui-notes-pop");if(e===null){this.#I=null,this.#g!==null&&this.#U(this.#g)?.focus({preventScroll:!0}),this.#g=null;return}const i=this.#U(e.dataset.key??""),n=this.#m;this.#m=null,n!==null&&e.querySelector(`li[data-id="${CSS.escape(n.noteId)}"]`)?.querySelector(n.part==="editor"?"textarea":'[data-role="edit-note"]')?.focus({preventScroll:!0}),!(e===this.#I||i===null)&&(this.#I=e,this.#x.open(e,i,Is,{placement:"bottom-start"}),e.querySelector('[data-role="close-notes"]')?.focus({preventScroll:!0}))}#U(e){return Array.from(this.renderRoot.querySelectorAll(".ui-note-badge")).find(i=>i.dataset.key===e)??null}#V(e){const i=e.composedPath(),n=i[0];if(n instanceof Element&&n.classList.contains("ui-catcher"))return this.#ae(e.clientX,e.clientY);const o=i.find(s=>s instanceof Element&&s.parentElement===this&&s.hasAttribute("data-preview-id"));return!o||!(n instanceof Element)||!o.contains(n)?null:this.#Y(n,o)}#ae(e,i){const n=this.#z(e,i);return n===null?null:this.#Y(n.element,n.wrapper)}#z(e,i){if(typeof document.elementsFromPoint!="function")return null;const n=this.#y();for(const o of document.elementsFromPoint(e,i)){const s=n.find(r=>r.contains(o));if(s!==void 0)return{element:o,wrapper:s}}return null}#Y(e,i){const n=i.getAttribute("data-preview-id");if(!n)return null;const o=$o(e,i),s=_o(o,i);return{element:o,target:{previewId:n,selector:s.selector,...s.text===void 0?{}:{text:s.text}}}}#y(){return Array.from(this.children).filter(e=>{const i=e.getAttribute("data-preview-id");return i!==null&&this.#o.includes(i)})}#de=e=>{if(this.#e.kind==="off")return;const i=this.#V(e);i&&(e.preventDefault(),e.stopPropagation(),this.#p=i.element,this.#l({kind:"pick",target:i.target}))};#le=e=>{if(this.#e.kind==="off")return;const i=this.#V(e);this.#R(".ui-hover",i?.element??null)};#pe=()=>{this.#R(".ui-hover",null)};#ce=e=>{const i=e.composedPath()[0];if(!(i instanceof Element)||!i.classList.contains("ui-catcher"))return;const n=this.renderRoot.querySelector(".canvas");let o=this.#z(e.clientX,e.clientY)?.element??null;for(;o!==null&&o!==n;){if(Ns(o,e.deltaX,e.deltaY)){e.preventDefault(),o.scrollBy({left:e.deltaX,top:e.deltaY});return}o=Li(o)}};#H=e=>{e.key!=="Escape"||e.defaultPrevented||(this.#e.kind!=="off"?this.#l({kind:"exit"}):this.#N(null))};#D=()=>{this.#w()};#ue(){this.#d!==null||typeof requestAnimationFrame!="function"||(this.#d=requestAnimationFrame(()=>{this.#d=null,this.#w()}))}#w(){const e=this.renderRoot.querySelector(".canvas");if(e&&this.#B(e,".ui-note-badge","left"),this.#e.kind==="off"||(this.#R(".ui-picked",this.#p),!e))return;const i=this.renderRoot.querySelector(".ui-catcher");if(i){i.style.width=`${e.scrollWidth}px`,i.style.height=`${e.scrollHeight}px`;const n=[...this.renderRoot.querySelectorAll(".demo-controls")].map(o=>o.getBoundingClientRect());i.style.clipPath=mo(i.getBoundingClientRect(),n)}this.#B(e,".ui-pin","right")}#B(e,i,n){for(const o of this.renderRoot.querySelectorAll(i)){const s=this.#fe(o.dataset.preview??""),a=(s?Po(s,o.dataset.selector??""):null)?.getBoundingClientRect();if(!a||a.width===0&&a.height===0){o.hidden=!0;continue}const d=this.#W(e);o.hidden=!1,o.style.left=`${a[n]-d.left}px`,o.style.top=`${a.top-d.top}px`}}#R(e,i){const n=this.renderRoot.querySelector(e),o=this.renderRoot.querySelector(".canvas");if(!n||!o)return;const s=i?.getBoundingClientRect();if(!s){n.hidden=!0;return}const r=this.#W(o);n.hidden=!1,n.style.left=`${s.left-r.left}px`,n.style.top=`${s.top-r.top}px`,n.style.width=`${s.width}px`,n.style.height=`${s.height}px`}#W(e){const i=e.getBoundingClientRect();return{left:i.left+e.clientLeft-e.scrollLeft,top:i.top+e.clientTop-e.scrollTop}}#he(){const e=this.renderRoot.querySelector(".canvas");e===this.#c||this.#v===null||(this.#c!==null&&this.#v.unobserve(this.#c),this.#c=e,e!==null&&this.#v.observe(e))}#q(){const e=this.renderRoot.querySelector('.frame[data-window="device"]'),i=e?.closest(".canvas");if(!e||!(i instanceof HTMLElement))return;const n=getComputedStyle(e),o={width:parseFloat(n.getPropertyValue("--device-width")),height:parseFloat(n.getPropertyValue("--device-height"))},s=getComputedStyle(i),r=i.clientWidth-parseFloat(s.paddingLeft)-parseFloat(s.paddingRight),a=this.#i?.mode==="demo",d=a?Ds*2:0,p=Yo(o,{width:r-d,...a?{height:i.clientHeight-d}:{}});p!==this.#T&&(this.#T=p,this.requestUpdate())}#ve(){for(const e of this.querySelectorAll(":scope > [data-preview-id]"))for(const i of e.querySelectorAll("dialog"))ri(i),ai(this,i)}#F=e=>{const i=e.target;!(i instanceof HTMLDialogElement)||!i.open||Array.from(this.children).some(n=>n.hasAttribute("data-preview-id")&&n.contains(i))&&(ri(i),ai(this,i))};#fe(e){return Array.from(this.children).find(i=>i.getAttribute("data-preview-id")===e)}#ge(){if(this.#O||this.renderRoot.querySelector(".stage")===null)return;this.#O=!0;const e=this.derivation.state,i=[];for(const n of Array.from(this.children)){const o=n.getAttribute("data-preview-id");if(o!==null)for(const s of n.querySelectorAll("a, [data-dpk-navigate]")){const r=so(e,{href:s.getAttribute("href"),navigate:s.getAttribute("data-dpk-navigate")});if(r===null)continue;const a=(s.textContent??"").replace(/\s+/g," ").trim().slice(0,40),d=s.getAttribute("data-dpk-navigate")??s.getAttribute("href")??"(no href)";i.push(` ${o}: <${s.tagName.toLowerCase()}> "${a}" \u2192 ${d} (${r})`)}}i.length!==0&&console.warn(`[dev-process-kit] <dpk-view-prototype>: ${i.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"):
|
|
1863
|
+
`+i.join(`
|
|
1864
|
+
`))}#N(e){if(e===(this.#i?.mode??null))return;const i=this.renderRoot.querySelector(".stage"),n=this.#i?.height??i?.offsetHeight??0;this.#G(),e!==null&&(this.#i={mode:e,height:n}),this.#u=null,this.#n=null,e!==null&&this.#e.kind==="composing"&&(ln(this.renderRoot.querySelector(Ci)),this.#k=!1),this.requestUpdate()}#G(){this.#i=null,this.#S=null}#me(){const e=this.renderRoot.querySelector(".stage");if(!(this.#i===null||!e||typeof e.showPopover!="function")&&e!==this.#S){this.#S=e;try{e.showPopover()}catch{}}}#ye=e=>{const i=this.renderRoot.querySelector(".canvas");(i===null||!e.composedPath().includes(i))&&e.preventDefault()};#we(e,i){const n=ci(e.state,e.navigation);this.#s=this.#s===null?n===null?null:xn(n):ct(this.#s,{kind:"observe",page:n});const o=this.#s;if(o===null)return null;const s=ut(o),r=s?.kind!=="page"&&o.seen!==null;if(n===null&&!r)return null;const a=Oo(o)??n;return{view:vi(e.state,o,i,a),shortcuts:s?.kind==="new-tab"?Co(e.state,a):[],switcher:this.#h,send:d=>this.#ke(d)}}#a(e){if(this.#s===null)return;const i=ct(this.#s,e);if(i===this.#s)return;this.#s=i;const n=ut(i);n?.kind==="page"&&this.#be(n.page),this.requestUpdate()}#be(e){this.navigate({screen:e.screen??null,preview:e.preview??null})}#ke(e){switch(e.kind){case"reload":this.#Ee();return;case"address":this.#xe(e.input);return;case"back":case"forward":case"new-tab":this.#h=!1,this.#a({kind:e.kind});return;case"switcher":this.#h=e.open,this.requestUpdate();return;case"activate":this.#h=!1,this.#E=e.focus===!0,this.#a({kind:"activate",id:e.id}),this.requestUpdate();return;case"close-tab":this.#a({kind:e.kind,id:e.id});return;case"visit":this.#a({kind:"visit",page:e.page});return;default:return}}#xe(e){const i=this.#s;if(i===null)return;const n=this.derivation.state,o=vi(n,i,le(this.locale)).url||"https://page.example.com/",s=Do(n,e,o);if(s!==null){this.#a({kind:"visit",page:s});return}this.#a({kind:"unreachable",url:En(e,o)})}#Ee(){if(this.#r!==null)return;const e=setTimeout(()=>{this.#r=null;for(const i of this.#y()){for(const n of i.querySelectorAll("form"))n.reset();for(const n of i.querySelectorAll("dialog"))n.close();i.scrollTop=0,i.dispatchEvent(new CustomEvent("dpk-reload",{bubbles:!0}))}this.renderRoot.querySelector(".browser .viewport")?.scrollTo?.({top:0}),this.requestUpdate()},Ts);this.#r={page:this.#o.join(" "),timer:e},this.requestUpdate()}#j(){this.#r!==null&&(clearTimeout(this.#r.timer),this.#r=null)}#b=e=>{if(!this.#C||this.#e.kind!=="off"||this.#s===null||e.type==="auxclick"&&e.button!==1)return;const i=this.#Se(e);if(i===null)return;const n=e.metaKey||e.ctrlKey||e.button===1;if(!i.blank&&!n)return;e.preventDefault(),e.stopPropagation();const o=ci(this.derivation.state,_e(this.hashFor(i.patch)));if(o===null){n||this.navigate(i.patch);return}this.#a({kind:"open-tab",entry:{kind:"page",page:o},background:n})};#Se(e){const i=e.composedPath();if(!i.some(o=>o instanceof Element&&o.parentElement===this&&o.hasAttribute("data-preview-id")))return null;for(const o of i){if(!(o instanceof Element)||o===this)break;const s=o.getAttribute("data-dpk-navigate"),r=o instanceof HTMLAnchorElement?o.getAttribute("href"):null,a=s??(r?.startsWith("#")?r:null);if(a===null)continue;const d=s!==null&&!s.includes("=")?`step=${s}`:a;return{patch:{..._e(d)},blank:o.getAttribute("target")==="_blank"}}return null}#$e(e){return Array.from(this.querySelectorAll("[data-preview-id]")).some(i=>i.getAttribute("data-preview-id")===e)}}const Vi=()=>{customElements.get("dpk-view-prototype")||customElements.define("dpk-view-prototype",Ui)},Cs=Object.freeze(Object.defineProperty({__proto__:null,DpkViewPrototype:Ui,VIEWPORT_MIN_HEIGHT:Ii,VIEWPORT_WIDTH:Ai,allScreens:H,allStepIds:Pt,applyPrototypeAction:Rt,definePrototypeElement:Vi,describePrototypeAction:Lt,emptyPrototypeBase:Tt,findActivity:U,findPreview:E,findScreen:L,findStep:S,findStory:$,flattenSteps:B,parsePrototypeBase:$t,prototypeAction:W,prototypeActions:m,prototypeBaseSchema:xt,prototypeCommentTargets:Xt,prototypeDefinitionFor:oi,prototypeMessages:le,prototypePageHeading:Zt,prototypeTargetLabel:Vt,prototypeTitle:He,renderFrame:We,renderNav:yi,renderStage:Pi,resolvePrototypeNavigation:xe,serializePrototypeAction:Ut},Symbol.toStringTag,{value:"Module"}));export{Vi as d,Cs as i};
|