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