dev-process-kit 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -13
- package/dist/chunks/{shared-CKG_SQh5.js → shared-ARDbveKk.js} +1 -1
- package/dist/chunks/{shared-DqB_TR20.js → shared-B76KHxdC.js} +1 -1
- package/dist/chunks/shared-BAvT77LJ.js +3448 -0
- package/dist/chunks/{shared-DaoPCw6-.js → shared-By_biQNN.js} +5 -5
- package/dist/chunks/{shared-BqW3KAJ4.js → shared-C0ctJXPv.js} +1 -1
- package/dist/chunks/{shared-DBDgdVsd.js → shared-CAzb0Ecs.js} +1 -1
- package/dist/chunks/{shared-DsVxrO_3.js → shared-CBM3Dha3.js} +1 -1
- package/dist/chunks/{shared-CwbzACTe.js → shared-CU-s47EI.js} +2 -2
- package/dist/chunks/{shared-DMlMTd3c.js → shared-CtB9MFc6.js} +1 -1
- package/dist/chunks/{shared-CPAT0Cgk.js → shared-CvU8S9Oz.js} +1 -1
- package/dist/chunks/{shared-B2K3LoOU.js → shared-CzhOCQdU.js} +1 -1
- package/dist/chunks/shared-DOi0CODr.js +736 -0
- package/dist/components.js +1 -1
- package/dist/index.js +1 -1
- package/dist/templates/event-storming.js +1 -1
- package/dist/templates/example-mapping.js +1 -1
- package/dist/templates/grill.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/package.json +1 -1
- package/dist/chunks/shared-Byv6cc0r.js +0 -2779
- package/dist/chunks/shared-iQIywbRc.js +0 -676
|
@@ -1,676 +0,0 @@
|
|
|
1
|
-
import{a9 as Re,aB as X,aa as V,ab as _,ac as N,at as m,ad as p,au as I,af as T,ag as b,ae as P,q as f,an as g,v as z,as as Y,P as Pe,f as Ae,_ as De,V as C,U as $e,R as E,a2 as h,a1 as x,aC as oe,a3 as Oe,z as Ve,av as se,m as Ne,a0 as Ye,T as ne}from"./shared-CwbzACTe.js";import{i as Ce}from"./shared-CKG_SQh5.js";const K=["browser","native"],j=["mobile","tablet","desktop","fluid"],Le=V({id:I,kind:_(P(K),"browser"),viewport:_(P(j),"fluid"),label:m(p()),url:m(p())}),Me=V({id:I,name:T(p(),b(1)),description:m(p()),title:m(T(p(),b(1))),actor:m(T(p(),b(1))),previews:_(N(Le),[])}),We=V({id:I,name:T(p(),b(1)),description:m(p()),actor:m(T(p(),b(1))),steps:_(N(Me),[])}),Ge=V({id:I,name:T(p(),b(1)),description:m(p()),actor:m(T(p(),b(1))),stories:_(N(We),[])}),de=V({title:m(p()),baseUrl:m(p()),activities:_(N(Ge),[])}),Be=e=>{const t=new Set,i=new Set;for(const a of e.activities){if(i.has(a.id))return`duplicate activity id "${a.id}"`;i.add(a.id);const r=new Set;for(const o of a.stories){if(r.has(o.id))return`duplicate story id "${o.id}" in activity "${a.id}"`;r.add(o.id);const s=new Set;for(const d of o.steps){if(s.has(d.id))return`duplicate step id "${d.id}" in story "${o.id}"`;s.add(d.id);for(const n of d.previews){if(t.has(n.id))return`duplicate preview id "${n.id}": preview ids are global, they name a light DOM slot`;t.add(n.id)}}}}return null},pe=e=>{const t=Re(de,e),i=Be(t);if(i!==null)throw new Error(i);return t},le=()=>({activities:[]}),A=(e,t)=>{if(t!==void 0)return e.activities.find(i=>i.id===t)},R=(e,t)=>`${e}.${t}`,w=(e,t)=>{if(t===void 0)return;const i=X(t,2);if(i){const[r,o]=i;if(r===void 0||o===void 0)return;const s=e.activities.find(n=>n.id===r),d=s?.stories.find(n=>n.id===o);return s&&d?{activity:s,story:d}:void 0}if(t.includes("."))return;const a=e.activities.flatMap(r=>r.stories.filter(o=>o.id===t).map(o=>({activity:r,story:o})));return a.length===1?a[0]:void 0},ce=e=>{const t=e.lastIndexOf(".");return t>=0?e.slice(t+1):e},L=e=>`${e.activity.id}.${e.story.id}.${e.step.id}`,q=(e,t,i)=>`${e.id}.${t.id}.${i.id}`,S=(e,t)=>{if(t===void 0)return;const i=X(t,3);if(i){const[r,o,s]=i;if(r===void 0||o===void 0||s===void 0)return;const d=e.activities.find(c=>c.id===r),n=d?.stories.find(c=>c.id===o),u=n?n.steps.findIndex(c=>c.id===s):-1,l=n&&u>=0?n.steps[u]:void 0;return d&&n&&l?{activity:d,story:n,step:l,stepIndex:u}:void 0}if(t.includes("."))return;const a=F(e).filter(r=>r.step.id===t);return a.length===1?a[0]:void 0},k=(e,t)=>{if(t===void 0)return;const i=X(t,4);if(i){const[a,r,o,s]=i;if(a===void 0||r===void 0||o===void 0||s===void 0)return;const d=S(e,`${a}.${r}.${o}`),n=d?.step.previews.find(u=>u.id===s);return d&&n?{location:d,preview:n}:void 0}if(!t.includes("."))for(const a of e.activities)for(const r of a.stories)for(const[o,s]of r.steps.entries()){const d=s.previews.find(n=>n.id===t);if(d)return{location:{activity:a,story:r,step:s,stepIndex:o},preview:d}}},F=e=>e.activities.flatMap(t=>t.stories.flatMap(i=>i.steps.map((a,r)=>({activity:t,story:i,step:a,stepIndex:r})))),ue=e=>F(e).map(t=>t.step.id),y={SET_ACTIVITY_NAME:f("SET_ACTIVITY_NAME","activity",g({name:T(p(),b(1))})),SET_ACTIVITY_DESCRIPTION:f("SET_ACTIVITY_DESCRIPTION","activity",g({description:p()})),SET_STORY_NAME:f("SET_STORY_NAME","story",g({name:T(p(),b(1))})),SET_STORY_DESCRIPTION:f("SET_STORY_DESCRIPTION","story",g({description:p()})),SET_STEP_NAME:f("SET_STEP_NAME","step",g({name:T(p(),b(1))})),SET_STEP_DESCRIPTION:f("SET_STEP_DESCRIPTION","step",g({description:p()})),SET_PREVIEW_KIND:f("SET_PREVIEW_KIND","preview",g({kind:P(K)})),SET_PREVIEW_VIEWPORT:f("SET_PREVIEW_VIEWPORT","preview",g({viewport:P(j)})),SET_PREVIEW_LABEL:f("SET_PREVIEW_LABEL","preview",g({label:p()})),REORDER_ACTIVITY:f("REORDER_ACTIVITY","activity",g({after:Y(p())}),{mode:"sequence"}),REORDER_STORY:f("REORDER_STORY","story",g({after:Y(p())}),{mode:"sequence"}),REORDER_STEP:f("REORDER_STEP","step",g({after:Y(p())}),{mode:"sequence"}),MOVE_STORY:f("MOVE_STORY","story",g({toActivity:T(p(),b(1)),after:Y(p())}),{mode:"sequence"}),MOVE_STEP:f("MOVE_STEP","step",g({toStory:T(p(),b(1)),after:Y(p())}),{mode:"sequence"}),ADD_ACTIVITY:f("ADD_ACTIVITY","page",g({id:I,name:T(p(),b(1)),description:m(p())}),{dedupeKey:z}),ADD_STORY:f("ADD_STORY","activity",g({id:I,name:T(p(),b(1)),description:m(p())}),{dedupeKey:z}),ADD_STEP:f("ADD_STEP","story",g({id:I,name:T(p(),b(1)),description:m(p()),previews:m(N(g({id:I,kind:_(P(K),"browser"),viewport:_(P(j),"fluid"),label:m(p()),url:m(p())})))}),{dedupeKey:z}),ADD_PREVIEW:f("ADD_PREVIEW","step",g({id:I,kind:_(P(K),"browser"),viewport:_(P(j),"fluid"),label:m(p()),url:m(p())}),{dedupeKey:z}),DELETE_ACTIVITY:f("DELETE_ACTIVITY","activity",g({})),DELETE_STORY:f("DELETE_STORY","story",g({})),DELETE_STEP:f("DELETE_STEP","step",g({})),DELETE_PREVIEW:f("DELETE_PREVIEW","preview",g({}))},M={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,a)=>({type:"ADD_STORY",target:{type:"activity",id:e},payload:{id:t,name:i,...a===void 0?{}:{description:a}}}),addStep:(e,t,i,a)=>({type:"ADD_STEP",target:{type:"story",id:e},payload:{id:t,name:i,...a===void 0?{}:{previews:a}}}),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:{}})},ve=(e,t)=>{const i=Pe(y,t);if(i===null)return null;const a=i.target.id;switch(i.type){case"SET_ACTIVITY_NAME":return $(e,a,r=>({...r,name:i.payload.name}));case"SET_ACTIVITY_DESCRIPTION":return $(e,a,r=>({...r,description:i.payload.description}));case"SET_STORY_NAME":return O(e,a,r=>({...r,name:i.payload.name}));case"SET_STORY_DESCRIPTION":return O(e,a,r=>({...r,description:i.payload.description}));case"SET_STEP_NAME":return W(e,a,r=>({...r,name:i.payload.name}));case"SET_STEP_DESCRIPTION":return W(e,a,r=>({...r,description:i.payload.description}));case"SET_PREVIEW_KIND":return Q(e,a,r=>({...r,kind:i.payload.kind}));case"SET_PREVIEW_VIEWPORT":return Q(e,a,r=>({...r,viewport:i.payload.viewport}));case"SET_PREVIEW_LABEL":return Q(e,a,r=>({...r,label:i.payload.label}));case"REORDER_ACTIVITY":{const{after:r}=i.payload,o=G(e.activities,a,r);return o===null?null:{...e,activities:o}}case"REORDER_STORY":{const{after:r}=i.payload,o=w(e,a);if(!o)return null;const s=r===null?null:w(e,r);if(r!==null&&(!s||s.activity!==o.activity))return null;const d=G(o.activity.stories,o.story.id,s?.story.id??null);return d===null?null:$(e,o.activity.id,n=>({...n,stories:d}))}case"REORDER_STEP":{const{after:r}=i.payload,o=S(e,a);if(!o)return null;const s=r===null?null:S(e,r);if(r!==null&&(!s||s.story!==o.story))return null;const d=G(o.story.steps,o.step.id,s?.step.id??null);return d===null?null:O(e,R(o.activity.id,o.story.id),n=>({...n,steps:d}))}case"MOVE_STORY":{const{toActivity:r,after:o}=i.payload,s=w(e,a);if(!s)return null;const d=e.activities.find(c=>c.id===r);if(!d)return null;const n=o===null?null:w(e,o);if(o!==null&&(!n||n.activity!==d))return null;const u=n?.story.id??null;if(s.activity.id===r){const c=G(s.activity.stories,s.story.id,u);return c===null?null:$(e,r,v=>({...v,stories:c}))}if(d.stories.some(c=>c.id===s.story.id))return null;const l=ee(d.stories,s.story,u);return Z(e,c=>c.id===s.activity.id?{...c,stories:c.stories.filter(v=>v.id!==ce(a))}:c.id===r?{...c,stories:l}:c)}case"MOVE_STEP":{const{toStory:r,after:o}=i.payload,s=S(e,a);if(!s)return null;const d=w(e,r);if(!d)return null;const n=o===null?null:S(e,o);if(o!==null&&(!n||n.story!==d.story))return null;const u=n?.step.id??null;if(s.story===d.story){const c=G(s.story.steps,s.step.id,u);return c===null?null:O(e,r,v=>({...v,steps:c}))}if(d.story.steps.some(c=>c.id===s.step.id))return null;const l=ee(d.story.steps,s.step,u);return Z(e,c=>({...c,stories:c.stories.map(v=>v===s.story?{...v,steps:v.steps.filter(D=>D.id!==ce(a))}:v===d.story?{...v,steps:l}:v)}))}case"ADD_ACTIVITY":{const r=i.payload;if(e.activities.some(s=>s.id===r.id))return e;const o={id:r.id,name:r.name,...r.description===void 0?{}:{description:r.description},stories:[]};return{...e,activities:[...e.activities,o]}}case"ADD_STORY":{const r=i.payload,o=e.activities.find(d=>d.id===a);if(!o)return null;if(o.stories.some(d=>d.id===r.id))return e;const s={id:r.id,name:r.name,...r.description===void 0?{}:{description:r.description},steps:[]};return $(e,a,d=>({...d,stories:[...d.stories,s]}))}case"ADD_STEP":{const r=i.payload,o=w(e,a)?.story;if(!o)return null;if(o.steps.some(n=>n.id===r.id))return e;const s=(r.previews??[]).map(n=>n.id);if(new Set(s).size!==s.length||s.some(n=>k(e,n)))return null;const d={id:r.id,name:r.name,...r.description===void 0?{}:{description:r.description},previews:r.previews??[]};return O(e,a,n=>({...n,steps:[...n.steps,d]}))}case"ADD_PREVIEW":{const r=i.payload,o=S(e,a)?.step;return o?o.previews.some(s=>s.id===r.id)?e:k(e,r.id)?null:W(e,a,s=>({...s,previews:[...s.previews,r]})):null}case"DELETE_ACTIVITY":{const r=a;return e.activities.some(o=>o.id===r)?{...e,activities:e.activities.filter(o=>o.id!==r)}:null}case"DELETE_STORY":{const r=w(e,a);return r?$(e,r.activity.id,o=>({...o,stories:o.stories.filter(s=>s.id!==r.story.id)})):null}case"DELETE_STEP":{const r=S(e,a);return r?O(e,R(r.activity.id,r.story.id),o=>({...o,steps:o.steps.filter(s=>s.id!==r.step.id)})):null}case"DELETE_PREVIEW":{const r=k(e,a);return r?W(e,L(r.location),o=>({...o,previews:o.previews.filter(s=>s.id!==r.preview.id)})):null}default:return Ae(i)}},Z=(e,t)=>({...e,activities:e.activities.map(t)}),$=(e,t,i)=>{const a=t;return e.activities.some(r=>r.id===a)?Z(e,r=>r.id===a?i(r):r):null},O=(e,t,i)=>{const a=w(e,t);if(!a)return null;const r=a.story.id;return $(e,a.activity.id,o=>({...o,stories:o.stories.map(s=>s.id===r?i(s):s)}))},W=(e,t,i)=>{const a=S(e,t);if(!a)return null;const r=a.step.id;return O(e,R(a.activity.id,a.story.id),o=>({...o,steps:o.steps.map(s=>s.id===r?i(s):s)}))},Q=(e,t,i)=>{const a=k(e,t);if(!a)return null;const r=a.preview.id;return W(e,L(a.location),o=>({...o,previews:o.previews.map(s=>s.id===r?i(s):s)}))},G=(e,t,i)=>{const a=e.findIndex(s=>s.id===t);if(a<0||i!==null&&!e.some(s=>s.id===i))return null;if(t===i)return[...e];const r=e[a];if(r===void 0)return null;const o=e.filter(s=>s.id!==t);return ee(o,r,i)},ee=(e,t,i)=>{const a=[...e],r=i===null?-1:a.findIndex(o=>o.id===i);return a.splice(r+1,0,t),a},te=De({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",previewGroup:"Preview",pageGroup:"Page",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",noStepBefore:"There are no Steps yet. A Prototype has the meaning structure ",noStepAfter:" \u2014 one Step is one screen / one experience state. Add a Step to the base JSON, and a Preview will appear here.",noPreviewMetadata:"No preview metadata \u2014 ask the agent to add it.",pageActor:e=>`Used by ${e}`},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",previewGroup:"Preview",pageGroup:"Page",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",noStepBefore:"Step \u304C\u307E\u3060\u3042\u308A\u307E\u305B\u3093\u3002Prototype \u306F ",noStepAfter:" \u306E\u610F\u5473\u69CB\u9020\u3092\u6301\u3061\u30011 Step = 1 \u753B\u9762 / 1 \u4F53\u9A13\u72B6\u614B\u3067\u3059\u3002base JSON \u306B Step \u3092\u8FFD\u52A0\u3059\u308B\u3068\u3001\u3053\u3053\u306B Preview \u304C\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",pageActor:e=>`\u5229\u7528\u8005: ${e}`}}),B=(e,t)=>e===void 0?`\u2192 "${t}"`:`"${e}" \u2192 "${t}"`,Ue=e=>({SET_ACTIVITY_NAME:(t,i)=>({title:e.renameActivity,tone:"update",body:B(A(i,t.target.id)?.name,E(y.SET_ACTIVITY_NAME,t).name)}),SET_ACTIVITY_DESCRIPTION:(t,i)=>({title:e.updateActivityDescription,tone:"update",body:ie(A(i,t.target.id)?.description,E(y.SET_ACTIVITY_DESCRIPTION,t).description)}),SET_STORY_NAME:(t,i)=>({title:e.renameStory,tone:"update",body:B(w(i,t.target.id)?.story.name,E(y.SET_STORY_NAME,t).name)}),SET_STORY_DESCRIPTION:(t,i)=>({title:e.updateStoryDescription,tone:"update",body:ie(w(i,t.target.id)?.story.description,E(y.SET_STORY_DESCRIPTION,t).description)}),SET_STEP_NAME:(t,i)=>({title:e.renameStep,tone:"update",body:B(S(i,t.target.id)?.step.name,E(y.SET_STEP_NAME,t).name)}),SET_STEP_DESCRIPTION:(t,i)=>({title:e.updateStepDescription,tone:"update",body:ie(S(i,t.target.id)?.step.description,E(y.SET_STEP_DESCRIPTION,t).description)}),SET_PREVIEW_KIND:(t,i)=>({title:e.changePreviewKind,tone:"update",body:B(k(i,t.target.id)?.preview.kind,E(y.SET_PREVIEW_KIND,t).kind)}),SET_PREVIEW_VIEWPORT:(t,i)=>({title:e.changePreviewViewport,tone:"update",body:B(k(i,t.target.id)?.preview.viewport,E(y.SET_PREVIEW_VIEWPORT,t).viewport)}),SET_PREVIEW_LABEL:t=>({title:e.changePreviewLabel,tone:"update",body:`\u2192 "${E(y.SET_PREVIEW_LABEL,t).label}"`}),REORDER_ACTIVITY:t=>re(e,e.activityGroup,E(y.REORDER_ACTIVITY,t).after),REORDER_STORY:t=>re(e,e.storyGroup,E(y.REORDER_STORY,t).after),REORDER_STEP:t=>re(e,e.stepGroup,E(y.REORDER_STEP,t).after),MOVE_STORY:(t,i)=>({title:e.moveStory,tone:"move",body:`\u2192 ${A(i,E(y.MOVE_STORY,t).toActivity)?.name??E(y.MOVE_STORY,t).toActivity}`}),MOVE_STEP:(t,i)=>({title:e.moveStep,tone:"move",body:`\u2192 ${w(i,E(y.MOVE_STEP,t).toStory)?.story.name??E(y.MOVE_STEP,t).toStory}`}),ADD_ACTIVITY:t=>H(e,e.activityGroup,E(y.ADD_ACTIVITY,t).name),ADD_STORY:t=>H(e,e.storyGroup,E(y.ADD_STORY,t).name),ADD_STEP:t=>H(e,e.stepGroup,E(y.ADD_STEP,t).name),ADD_PREVIEW:t=>H(e,e.previewGroup,E(y.ADD_PREVIEW,t).label??E(y.ADD_PREVIEW,t).id),DELETE_ACTIVITY:(t,i)=>J(e,A(i,t.target.id)?.name),DELETE_STORY:(t,i)=>J(e,w(i,t.target.id)?.story.name),DELETE_STEP:(t,i)=>J(e,S(i,t.target.id)?.step.name),DELETE_PREVIEW:(t,i)=>J(e,k(i,t.target.id)?.preview.label)}),ie=(e,t)=>{const i=t.length>90?`${t.slice(0,90)}\u2026`:t;return e===void 0||e===""?`\u2192 "${i}"`:`"${ze(e)}" \u2192 "${i}"`},ze=e=>e.length>60?`${e.slice(0,60)}\u2026`:e,re=(e,t,i)=>({title:e.reorderTitle(t),tone:"move",body:i===null?e.toFront:e.afterName(i)}),H=(e,t,i)=>({title:e.addTitle(t),tone:"create",body:`+ "${i}"`}),J=(e,t)=>({title:e.deleteTitle,tone:"delete",body:t===void 0?e.unknownTarget:`\u2212 "${t}"`}),ye=(e,t,i,a)=>{const r=Ue(e),o=Object.hasOwn(r,t.type)?r[t.type]:void 0,s=o?o(t,a??i):{title:t.type,tone:"meta"};return{title:s.title,targetLabel:fe(e,i,t.target),tone:s.tone,...s.body===void 0?{}:{summary:s.body}}},ge=e=>`${e.type} ${C(e.target)} ${JSON.stringify(e.payload)}`,fe=(e,t,i)=>{switch(i.type){case"activity":{const a=A(t,i.id);return a?e.targetLabel(e.activityGroup,a.name):e.targetMissing(e.activityGroup,i.id)}case"story":{const a=w(t,i.id)?.story;return a?e.targetLabel(e.storyGroup,a.name):e.targetMissing(e.storyGroup,i.id)}case"step":{const a=S(t,i.id)?.step;return a?e.targetLabel(e.stepGroup,a.name):e.targetMissing(e.stepGroup,i.id)}case"preview":{const a=k(t,i.id)?.preview;return a?e.targetLabel(e.previewGroup,a.label??a.id):e.targetMissing(e.previewGroup,i.id)}case"page":return e.targetLabel(e.pageGroup,ae(t));default:return e.targetLabel(i.type,i.id)}},Ke=(e,t)=>{if(t.url)return t.url;const i=e.baseUrl?.trim(),a=$e(e.title??"");return`${(i?i.startsWith("http")?i:`https://${i}`:`https://${a==="item"?"page":a}.example.com`).replace(/\/+$/,"")}/${t.id}`},Ee=(e,t)=>{const i=[];for(const a of t.activities){i.push({value:C({type:"activity",id:a.id}),label:a.name,group:e.activityGroup});for(const r of a.stories){i.push({value:C({type:"story",id:R(a.id,r.id)}),label:`${a.name} \u203A ${r.name}`,group:e.storyGroup});for(const o of r.steps)i.push({value:C({type:"step",id:q(a,r,o)}),label:`${r.name} \u203A ${o.name}`,group:e.stepGroup})}}return i},je=(e,t,i)=>{const a=S(t,i.step);return a?{value:C({type:"step",id:L(a)}),label:a.step.name,group:e.stepGroup}:null},he=e=>{const{activity:t,story:i,step:a}=e,r=a.actor??i.actor??t.actor,o=a.title??a.name;return r===void 0?{title:o}:{actor:r,title:o}},ae=e=>e.title??"UX Prototype",Se=(e,t)=>{const i=A(e,t.activity),a=t.story,r=i?.stories.find(U=>U.id===a||R(i.id,U.id)===a),o=t.step,d=(i&&r&&o?S(e,`${R(i.id,r.id)}.${o}`):void 0)??S(e,o),n=r&&i?{activity:i,story:r}:w(e,a),u=d?.activity??i??n?.activity??e.activities[0],l=d?.story??(n&&n.activity===u?n.story:void 0)??u?.stories[0],c=d?.step??l?.steps[0],v={...t};u?v.activity=u.id:delete v.activity,l&&u?v.story=w(e,l.id)?l.id:R(u.id,l.id):delete v.story,c&&l&&u?v.step=S(e,c.id)?c.id:q(u,l,c):delete v.step;const D=c&&t.preview&&c.previews.some(U=>U.id===t.preview)?t.preview:c?.previews[0]?.id;return D?v.preview=D:delete v.preview,v},qe=(e,t)=>{switch(t.type){case"activity":return A(e,t.id)!==void 0;case"story":return w(e,t.id)!==void 0;case"step":return S(e,t.id)!==void 0;case"preview":return k(e,t.id)!==void 0;case"page":return!0;default:return!1}},me=e=>{const t=te(e);return{name:"prototype",label:"UX Prototype",parseBase:pe,emptyBase:le,actions:y,apply:ve,hasTarget:qe,canonicalTarget:(i,a)=>{if(a.type==="step"){const r=S(i,a.id);return r?{...a,id:L(r)}:a}if(a.type==="story"){const r=w(i,a.id);return r?{...a,id:R(r.activity.id,r.story.id)}:a}if(a.type==="preview"){const r=k(i,a.id);return r?{...a,id:r.preview.id}:a}return a},describe:(i,a,r)=>ye(t,i,a,r),serialize:ge,resolveNavigation:Se,commentTargets:(i,a)=>Ee(t,i),currentTarget:(i,a)=>je(t,i,a),title:ae}},we=(e,t)=>{const{state:i,navigation:a}=e,r=S(i,a.step),o=r?.activity??i.activities[0],s=r?.story??o?.stories[0];if(!o||!s)return h`<p class="nav-empty">${t.noActivityBefore}<code>activities</code>${t.noActivityAfter}</p>`;const d=s.steps,n=r?.step,u=r?L(r):void 0;return h`
|
|
2
|
-
<div class="nav">
|
|
3
|
-
<div class="field">
|
|
4
|
-
<span class="dpk-label">Activity</span>
|
|
5
|
-
<select
|
|
6
|
-
class="dpk-select"
|
|
7
|
-
aria-label="Activity"
|
|
8
|
-
@change=${oe(l=>e.navigate({activity:l,story:null,step:null}))}
|
|
9
|
-
>
|
|
10
|
-
${i.activities.map(l=>h`<option value=${l.id} ?selected=${l.id===o.id}>${l.name}</option>`)}
|
|
11
|
-
</select>
|
|
12
|
-
</div>
|
|
13
|
-
<div class="field">
|
|
14
|
-
<span class="dpk-label">User Story</span>
|
|
15
|
-
<select
|
|
16
|
-
class="dpk-select"
|
|
17
|
-
aria-label="User Story"
|
|
18
|
-
@change=${oe(l=>e.navigate({activity:o.id,story:l,step:null}))}
|
|
19
|
-
>
|
|
20
|
-
${o.stories.map(l=>h`<option value=${l.id} ?selected=${l.id===s.id}>${l.name}</option>`)}
|
|
21
|
-
</select>
|
|
22
|
-
</div>
|
|
23
|
-
<div class="steps-head">
|
|
24
|
-
<span class="dpk-label">Step</span>
|
|
25
|
-
<span class="dpk-label">${d.length}</span>
|
|
26
|
-
</div>
|
|
27
|
-
<ol class="steps">
|
|
28
|
-
${Oe(d,l=>q(o,s,l),(l,c)=>{const v=q(o,s,l),D=e.commentCount({type:"step",id:v});return h`
|
|
29
|
-
<li class="step-row" data-current=${String(l.id===n?.id)}>
|
|
30
|
-
<a class="step-link" href=${e.hashFor({activity:o.id,story:s.id,step:l.id})}>
|
|
31
|
-
<span class="step-index">${String(c+1).padStart(2,"0")}</span>
|
|
32
|
-
<span class="step-name">${l.name}</span>
|
|
33
|
-
${D>0?h`<span class="step-note">${D}</span>`:x}
|
|
34
|
-
</a>
|
|
35
|
-
<span class="row-tools">
|
|
36
|
-
<button
|
|
37
|
-
class="dpk-icon-btn"
|
|
38
|
-
type="button"
|
|
39
|
-
aria-label=${t.deleteStepAria}
|
|
40
|
-
@click=${()=>e.dispatch(M.deleteStep(v))}
|
|
41
|
-
>
|
|
42
|
-
${Ve()}
|
|
43
|
-
</button>
|
|
44
|
-
</span>
|
|
45
|
-
</li>
|
|
46
|
-
`})}
|
|
47
|
-
</ol>
|
|
48
|
-
<button class="dpk-btn" type="button" @click=${()=>Fe(e,t,R(o.id,s.id))}>
|
|
49
|
-
${t.addStepButton}
|
|
50
|
-
</button>
|
|
51
|
-
${n?Ce(u,h`<div class="detail">
|
|
52
|
-
<div class="detail-row">
|
|
53
|
-
<span class="dpk-label">${t.stepNameLabel}</span>
|
|
54
|
-
<span class="detail-value">
|
|
55
|
-
<dpk-component-inline-edit
|
|
56
|
-
.value=${n.name}
|
|
57
|
-
.label=${t.stepNameLabel}
|
|
58
|
-
@dpk-commit=${se(l=>e.dispatch(M.setStepName(u??n.id,l)))}
|
|
59
|
-
></dpk-component-inline-edit>
|
|
60
|
-
</span>
|
|
61
|
-
</div>
|
|
62
|
-
<div class="detail-row">
|
|
63
|
-
<span class="dpk-label">${t.descriptionLabel}</span>
|
|
64
|
-
<span class="detail-value">
|
|
65
|
-
<dpk-component-inline-edit
|
|
66
|
-
multiline
|
|
67
|
-
.value=${n.description??""}
|
|
68
|
-
.placeholder=${t.descriptionPlaceholder}
|
|
69
|
-
.label=${t.descriptionLabel}
|
|
70
|
-
@dpk-commit=${se(l=>e.dispatch(M.setStepDescription(u??n.id,l)))}
|
|
71
|
-
></dpk-component-inline-edit>
|
|
72
|
-
</span>
|
|
73
|
-
</div>
|
|
74
|
-
</div>`):x}
|
|
75
|
-
</div>
|
|
76
|
-
`},Fe=(e,t,i)=>{const a=Ne("new-step",ue(e.state));e.dispatch(M.addStep(i,a,t.newStepName)).ok&&e.navigate({story:i,step:a})},Te={mobile:"390px",tablet:"834px",desktop:"1180px",fluid:"100%"},be={mobile:"620px",tablet:"640px",desktop:"520px",fluid:"420px"},ke=(e,t,i)=>{const{state:a,navigation:r}=e,o=S(a,r.step),s=o?o.step.previews.find(u=>u.id===r.preview)??o.step.previews[0]:void 0,d=Ze(a,s?.id);if(!o)return h`
|
|
77
|
-
<div class="stage">
|
|
78
|
-
<p class="stage-empty">
|
|
79
|
-
${t.noStepBefore}<strong>Activity › UserStory › Step › Preview</strong>${t.noStepAfter}
|
|
80
|
-
</p>
|
|
81
|
-
${d}
|
|
82
|
-
</div>
|
|
83
|
-
`;const n=o.step.previews;return h`
|
|
84
|
-
<div class="stage">
|
|
85
|
-
<div class="stage-bar">
|
|
86
|
-
${He(t,he(o))}
|
|
87
|
-
${n.length>1?Je(e,n,s?.id):x}
|
|
88
|
-
</div>
|
|
89
|
-
<div class="canvas">
|
|
90
|
-
${s?_e(e,s,i.hasPreviewContent(s.id)):x}
|
|
91
|
-
${n.length===0?h`<p class="dpk-label">${t.noPreviewMetadata}</p>`:x}
|
|
92
|
-
</div>
|
|
93
|
-
${d}
|
|
94
|
-
</div>
|
|
95
|
-
`},He=(e,t)=>h`<div class="page-head">
|
|
96
|
-
${t.actor===void 0?x:h`<span class="page-actor" role="note" aria-label=${e.pageActor(t.actor)}>
|
|
97
|
-
<svg viewBox="0 0 16 16" aria-hidden="true">
|
|
98
|
-
<circle cx="8" cy="5.2" r="2.7" />
|
|
99
|
-
<path d="M2.8 14c.5-3 2.6-4.6 5.2-4.6s4.7 1.6 5.2 4.6Z" />
|
|
100
|
-
</svg>
|
|
101
|
-
${t.actor}
|
|
102
|
-
</span>`}
|
|
103
|
-
<h2 class="page-title">${t.title}</h2>
|
|
104
|
-
</div>`,Je=(e,t,i)=>h`<div class="tabs" role="tablist">
|
|
105
|
-
${t.map(a=>h`<a
|
|
106
|
-
class="tab"
|
|
107
|
-
role="tab"
|
|
108
|
-
data-current=${String(a.id===i)}
|
|
109
|
-
aria-selected=${a.id===i?"true":"false"}
|
|
110
|
-
href=${e.hashFor({preview:a.id})}
|
|
111
|
-
>${a.label??a.viewport}</a
|
|
112
|
-
>`)}
|
|
113
|
-
</div>`,_e=(e,t,i)=>h`
|
|
114
|
-
<figure
|
|
115
|
-
class="frame"
|
|
116
|
-
data-kind=${t.kind}
|
|
117
|
-
data-viewport=${t.viewport}
|
|
118
|
-
style=${`--frame-width:${Te[t.viewport]};--frame-min-height:${be[t.viewport]}`}
|
|
119
|
-
>
|
|
120
|
-
${t.kind==="browser"?h`<div class="chrome">
|
|
121
|
-
<span class="dots"><i></i><i></i><i></i></span>
|
|
122
|
-
<span class="url">${Ke(e.state,t)}</span>
|
|
123
|
-
</div>`:x}
|
|
124
|
-
<div class="viewport">
|
|
125
|
-
${t.kind==="native"?Xe():x}
|
|
126
|
-
<slot name=${`preview:${t.id}`}></slot>
|
|
127
|
-
${i?x:h`<div class="frame-placeholder">
|
|
128
|
-
<span class="dpk-label">light dom preview</span>
|
|
129
|
-
<code><div slot="preview" data-preview-id="${t.id}"></code>
|
|
130
|
-
</div>`}
|
|
131
|
-
</div>
|
|
132
|
-
</figure>
|
|
133
|
-
`,Xe=()=>h`<div class="status-bar">
|
|
134
|
-
<span class="status-time">9:41</span>
|
|
135
|
-
<span class="punch-hole" aria-hidden="true"></span>
|
|
136
|
-
<svg class="status-wifi" viewBox="0 0 16 12" aria-hidden="true">
|
|
137
|
-
<path d="M8 9.2a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3Z" />
|
|
138
|
-
<path
|
|
139
|
-
d="M4.7 7.4a4.8 4.8 0 0 1 6.6 0"
|
|
140
|
-
fill="none"
|
|
141
|
-
stroke="currentColor"
|
|
142
|
-
stroke-width="1.5"
|
|
143
|
-
stroke-linecap="round"
|
|
144
|
-
/>
|
|
145
|
-
<path
|
|
146
|
-
d="M2.1 4.7a8.4 8.4 0 0 1 11.8 0"
|
|
147
|
-
fill="none"
|
|
148
|
-
stroke="currentColor"
|
|
149
|
-
stroke-width="1.5"
|
|
150
|
-
stroke-linecap="round"
|
|
151
|
-
/>
|
|
152
|
-
</svg>
|
|
153
|
-
</div>`,Ze=(e,t)=>{const i=F(e).flatMap(a=>a.step.previews.filter(r=>r.id!==t));return i.length===0?h`${x}`:h`<div class="parked" aria-hidden="true">
|
|
154
|
-
${i.map(a=>h`<slot name=${`preview:${a.id}`}></slot>`)}
|
|
155
|
-
</div>`},Qe=Ye`
|
|
156
|
-
:host {
|
|
157
|
-
--dpk-prototype-accent: var(--dpk-blue);
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
/* ---------------------------------------------------------------- sidebar */
|
|
161
|
-
|
|
162
|
-
.nav {
|
|
163
|
-
display: grid;
|
|
164
|
-
gap: 14px;
|
|
165
|
-
align-content: start;
|
|
166
|
-
min-width: 188px;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
.field {
|
|
170
|
-
display: grid;
|
|
171
|
-
gap: 5px;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
.steps-head {
|
|
175
|
-
display: flex;
|
|
176
|
-
align-items: baseline;
|
|
177
|
-
justify-content: space-between;
|
|
178
|
-
padding-bottom: 5px;
|
|
179
|
-
border-bottom: 1px solid var(--dpk-rule);
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
.steps {
|
|
183
|
-
list-style: none;
|
|
184
|
-
margin: 0;
|
|
185
|
-
padding: 0;
|
|
186
|
-
display: grid;
|
|
187
|
-
gap: 2px;
|
|
188
|
-
max-height: 38vh;
|
|
189
|
-
overflow: auto;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
.step-row {
|
|
193
|
-
position: relative;
|
|
194
|
-
display: flex;
|
|
195
|
-
align-items: center;
|
|
196
|
-
gap: 4px;
|
|
197
|
-
padding: 0 4px 0 9px;
|
|
198
|
-
border-radius: var(--dpk-radius-sm);
|
|
199
|
-
transition:
|
|
200
|
-
background 140ms ease,
|
|
201
|
-
box-shadow 140ms ease;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
.step-row:hover {
|
|
205
|
-
background: var(--dpk-paper-inset);
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
.step-row[data-current='true'] {
|
|
209
|
-
background: linear-gradient(
|
|
210
|
-
180deg,
|
|
211
|
-
color-mix(in srgb, var(--dpk-prototype-accent) 10%, var(--dpk-paper-raised)),
|
|
212
|
-
color-mix(in srgb, var(--dpk-prototype-accent) 5%, var(--dpk-paper-raised))
|
|
213
|
-
);
|
|
214
|
-
box-shadow:
|
|
215
|
-
inset 0 0 0 1px color-mix(in srgb, var(--dpk-prototype-accent) 22%, transparent),
|
|
216
|
-
var(--dpk-shadow-xs);
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
.step-row[data-current='true']::before {
|
|
220
|
-
content: '';
|
|
221
|
-
position: absolute;
|
|
222
|
-
left: 0;
|
|
223
|
-
top: 8px;
|
|
224
|
-
bottom: 8px;
|
|
225
|
-
width: 3px;
|
|
226
|
-
border-radius: var(--dpk-radius-xs);
|
|
227
|
-
background: linear-gradient(180deg, var(--dpk-blue), var(--dpk-blue-strong));
|
|
228
|
-
box-shadow: 0 0 8px color-mix(in srgb, var(--dpk-prototype-accent) 45%, transparent);
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
.step-link {
|
|
232
|
-
display: flex;
|
|
233
|
-
flex: 1;
|
|
234
|
-
min-width: 0;
|
|
235
|
-
align-items: center;
|
|
236
|
-
gap: 7px;
|
|
237
|
-
padding: 7px 0;
|
|
238
|
-
text-decoration: none;
|
|
239
|
-
color: var(--dpk-ink-soft);
|
|
240
|
-
font-size: 12.5px;
|
|
241
|
-
font-weight: 460;
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
.step-row[data-current='true'] .step-link {
|
|
245
|
-
color: var(--dpk-ink);
|
|
246
|
-
font-weight: 550;
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
.step-index {
|
|
250
|
-
flex: 0 0 auto;
|
|
251
|
-
min-width: 17px;
|
|
252
|
-
padding: 1px 4px;
|
|
253
|
-
border-radius: var(--dpk-radius-xs);
|
|
254
|
-
background: var(--dpk-paper-inset);
|
|
255
|
-
font-family: var(--dpk-mono);
|
|
256
|
-
font-size: 9.5px;
|
|
257
|
-
font-variant-numeric: tabular-nums;
|
|
258
|
-
text-align: center;
|
|
259
|
-
color: var(--dpk-ink-faint);
|
|
260
|
-
transition:
|
|
261
|
-
background 140ms ease,
|
|
262
|
-
color 140ms ease;
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
.step-row[data-current='true'] .step-index {
|
|
266
|
-
background: linear-gradient(180deg, var(--dpk-blue), var(--dpk-blue-strong));
|
|
267
|
-
color: #fff;
|
|
268
|
-
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
.step-name {
|
|
272
|
-
min-width: 0;
|
|
273
|
-
overflow: hidden;
|
|
274
|
-
white-space: nowrap;
|
|
275
|
-
text-overflow: ellipsis;
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
.step-note {
|
|
279
|
-
margin-left: auto;
|
|
280
|
-
min-width: 16px;
|
|
281
|
-
padding: 1px 5px;
|
|
282
|
-
border-radius: 999px;
|
|
283
|
-
background: var(--dpk-accent);
|
|
284
|
-
color: var(--dpk-accent-ink);
|
|
285
|
-
font-family: var(--dpk-mono);
|
|
286
|
-
font-size: 9px;
|
|
287
|
-
font-variant-numeric: tabular-nums;
|
|
288
|
-
text-align: center;
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
.row-tools {
|
|
292
|
-
display: flex;
|
|
293
|
-
gap: 0;
|
|
294
|
-
opacity: 0;
|
|
295
|
-
transition: opacity 120ms ease;
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
.step-row:hover .row-tools,
|
|
299
|
-
.step-row[data-current='true'] .row-tools {
|
|
300
|
-
opacity: 1;
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
.detail {
|
|
304
|
-
display: grid;
|
|
305
|
-
gap: 12px;
|
|
306
|
-
padding: 12px 12px 14px;
|
|
307
|
-
border: 1px solid var(--dpk-rule);
|
|
308
|
-
border-radius: var(--dpk-radius);
|
|
309
|
-
background: var(--dpk-paper-raised);
|
|
310
|
-
box-shadow: var(--dpk-bevel), var(--dpk-shadow-sm);
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
.detail-row {
|
|
314
|
-
display: grid;
|
|
315
|
-
gap: 4px;
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
.detail-value {
|
|
319
|
-
font-size: 12.5px;
|
|
320
|
-
color: var(--dpk-ink-soft);
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
.nav-empty {
|
|
324
|
-
font-size: 12px;
|
|
325
|
-
line-height: 1.6;
|
|
326
|
-
color: var(--dpk-ink-faint);
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
/* ------------------------------------------------------------------ stage */
|
|
330
|
-
|
|
331
|
-
.stage {
|
|
332
|
-
display: grid;
|
|
333
|
-
gap: 14px;
|
|
334
|
-
width: 100%;
|
|
335
|
-
min-width: 0;
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
.stage-bar {
|
|
339
|
-
display: flex;
|
|
340
|
-
align-items: center;
|
|
341
|
-
justify-content: space-between;
|
|
342
|
-
gap: 10px 16px;
|
|
343
|
-
min-width: 0;
|
|
344
|
-
flex-wrap: wrap;
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
/* ------------------------------------------------------------- page head */
|
|
348
|
-
|
|
349
|
-
.page-head {
|
|
350
|
-
display: flex;
|
|
351
|
-
align-items: center;
|
|
352
|
-
gap: 12px;
|
|
353
|
-
min-width: 0;
|
|
354
|
-
animation: dpk-page-head-in 260ms var(--dpk-ease) backwards;
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
@keyframes dpk-page-head-in {
|
|
358
|
-
from {
|
|
359
|
-
opacity: 0;
|
|
360
|
-
transform: translateY(4px);
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
.page-actor {
|
|
365
|
-
display: inline-flex;
|
|
366
|
-
flex: none;
|
|
367
|
-
align-items: center;
|
|
368
|
-
gap: 6px;
|
|
369
|
-
height: 26px;
|
|
370
|
-
padding: 0 11px 0 8px;
|
|
371
|
-
border-radius: 999px;
|
|
372
|
-
background: linear-gradient(
|
|
373
|
-
180deg,
|
|
374
|
-
color-mix(in srgb, var(--dpk-blue) 16%, var(--dpk-paper-raised)),
|
|
375
|
-
color-mix(in srgb, var(--dpk-blue) 9%, var(--dpk-paper-raised))
|
|
376
|
-
);
|
|
377
|
-
box-shadow:
|
|
378
|
-
var(--dpk-bevel),
|
|
379
|
-
inset 0 0 0 1px color-mix(in srgb, var(--dpk-blue) 32%, transparent),
|
|
380
|
-
var(--dpk-shadow-xs);
|
|
381
|
-
color: var(--dpk-blue);
|
|
382
|
-
font-size: 12px;
|
|
383
|
-
font-weight: 650;
|
|
384
|
-
letter-spacing: 0.01em;
|
|
385
|
-
white-space: nowrap;
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
.page-actor svg {
|
|
389
|
-
width: 13px;
|
|
390
|
-
height: 13px;
|
|
391
|
-
fill: currentColor;
|
|
392
|
-
opacity: 0.9;
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
.page-title {
|
|
396
|
-
margin: 0;
|
|
397
|
-
min-width: 0;
|
|
398
|
-
overflow: hidden;
|
|
399
|
-
font-size: 19px;
|
|
400
|
-
font-weight: 700;
|
|
401
|
-
line-height: 1.3;
|
|
402
|
-
letter-spacing: -0.02em;
|
|
403
|
-
color: var(--dpk-ink);
|
|
404
|
-
text-overflow: ellipsis;
|
|
405
|
-
white-space: nowrap;
|
|
406
|
-
}
|
|
407
|
-
|
|
408
|
-
.tabs {
|
|
409
|
-
display: inline-flex;
|
|
410
|
-
gap: 2px;
|
|
411
|
-
padding: 3px;
|
|
412
|
-
border: 1px solid var(--dpk-rule);
|
|
413
|
-
border-radius: 999px;
|
|
414
|
-
background: var(--dpk-paper-sunken);
|
|
415
|
-
box-shadow: inset 0 1px 2px rgba(20, 28, 44, 0.04);
|
|
416
|
-
}
|
|
417
|
-
|
|
418
|
-
.tab {
|
|
419
|
-
padding: 4px 14px;
|
|
420
|
-
border-radius: 999px;
|
|
421
|
-
font-size: 12px;
|
|
422
|
-
font-weight: 500;
|
|
423
|
-
text-decoration: none;
|
|
424
|
-
color: var(--dpk-ink-soft);
|
|
425
|
-
white-space: nowrap;
|
|
426
|
-
transition:
|
|
427
|
-
background 120ms ease,
|
|
428
|
-
color 120ms ease;
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
.tab:hover {
|
|
432
|
-
color: var(--dpk-ink);
|
|
433
|
-
background: var(--dpk-paper-raised);
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
.tab[data-current='true'] {
|
|
437
|
-
background: var(--dpk-paper-raised);
|
|
438
|
-
color: var(--dpk-ink);
|
|
439
|
-
font-weight: 600;
|
|
440
|
-
box-shadow: var(--dpk-bevel), var(--dpk-shadow-xs);
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
.stage-empty {
|
|
444
|
-
max-width: 62ch;
|
|
445
|
-
padding: 16px 18px;
|
|
446
|
-
border: 1px dashed var(--dpk-rule-strong);
|
|
447
|
-
border-radius: var(--dpk-radius-lg);
|
|
448
|
-
background: var(--dpk-paper-sunken);
|
|
449
|
-
font-size: 13px;
|
|
450
|
-
line-height: 1.7;
|
|
451
|
-
color: var(--dpk-ink-soft);
|
|
452
|
-
}
|
|
453
|
-
|
|
454
|
-
/* ----------------------------------------------------------------- canvas */
|
|
455
|
-
|
|
456
|
-
/*
|
|
457
|
-
* The work surface the frame sits on: a quiet dot lattice that reads as a
|
|
458
|
-
* canvas rather than empty page background, giving the frame somewhere to
|
|
459
|
-
* cast its shadow.
|
|
460
|
-
*/
|
|
461
|
-
.canvas {
|
|
462
|
-
display: flex;
|
|
463
|
-
justify-content: center;
|
|
464
|
-
padding: 30px;
|
|
465
|
-
border: 1px solid var(--dpk-rule);
|
|
466
|
-
border-radius: var(--dpk-radius-xl);
|
|
467
|
-
background: var(--dpk-dots), var(--dpk-paper-sunken);
|
|
468
|
-
box-shadow: inset 0 1px 3px var(--dpk-shade-1);
|
|
469
|
-
}
|
|
470
|
-
|
|
471
|
-
/* ------------------------------------------------------------------ frame */
|
|
472
|
-
|
|
473
|
-
.frame {
|
|
474
|
-
width: min(var(--frame-width), 100%);
|
|
475
|
-
max-width: 100%;
|
|
476
|
-
margin: 0;
|
|
477
|
-
border: 1px solid var(--dpk-rule);
|
|
478
|
-
border-radius: var(--dpk-radius-lg);
|
|
479
|
-
background: var(--dpk-paper-raised);
|
|
480
|
-
box-shadow: var(--dpk-bevel), var(--dpk-shadow-lg);
|
|
481
|
-
overflow: hidden;
|
|
482
|
-
transition: box-shadow 200ms var(--dpk-ease);
|
|
483
|
-
}
|
|
484
|
-
|
|
485
|
-
.chrome {
|
|
486
|
-
display: flex;
|
|
487
|
-
align-items: center;
|
|
488
|
-
gap: 8px;
|
|
489
|
-
padding: 8px 14px;
|
|
490
|
-
background: linear-gradient(
|
|
491
|
-
180deg,
|
|
492
|
-
color-mix(in srgb, var(--dpk-paper-raised) 88%, transparent),
|
|
493
|
-
color-mix(in srgb, var(--dpk-paper-inset) 88%, transparent)
|
|
494
|
-
);
|
|
495
|
-
backdrop-filter: blur(10px);
|
|
496
|
-
border-bottom: 1px solid var(--dpk-rule);
|
|
497
|
-
box-shadow: inset 0 1px 0 var(--dpk-highlight);
|
|
498
|
-
}
|
|
499
|
-
|
|
500
|
-
.dots {
|
|
501
|
-
display: inline-flex;
|
|
502
|
-
gap: 5px;
|
|
503
|
-
}
|
|
504
|
-
|
|
505
|
-
.dots i {
|
|
506
|
-
width: 10px;
|
|
507
|
-
height: 10px;
|
|
508
|
-
border-radius: 50%;
|
|
509
|
-
background: var(--dpk-rule-strong);
|
|
510
|
-
}
|
|
511
|
-
|
|
512
|
-
.dots i:nth-child(1) {
|
|
513
|
-
background: #ff5f57;
|
|
514
|
-
}
|
|
515
|
-
|
|
516
|
-
.dots i:nth-child(2) {
|
|
517
|
-
background: #febc2e;
|
|
518
|
-
}
|
|
519
|
-
|
|
520
|
-
.dots i:nth-child(3) {
|
|
521
|
-
background: #28c840;
|
|
522
|
-
}
|
|
523
|
-
|
|
524
|
-
.chrome .url {
|
|
525
|
-
flex: 1;
|
|
526
|
-
min-width: 0;
|
|
527
|
-
padding: 4px 14px;
|
|
528
|
-
border: 1px solid var(--dpk-rule);
|
|
529
|
-
border-radius: var(--dpk-radius-sm);
|
|
530
|
-
background: var(--dpk-paper-raised);
|
|
531
|
-
box-shadow: inset 0 1px 2px rgba(20, 28, 44, 0.04);
|
|
532
|
-
font-family: var(--dpk-mono);
|
|
533
|
-
font-size: 10.5px;
|
|
534
|
-
color: var(--dpk-ink-faint);
|
|
535
|
-
overflow: hidden;
|
|
536
|
-
white-space: nowrap;
|
|
537
|
-
text-overflow: ellipsis;
|
|
538
|
-
}
|
|
539
|
-
|
|
540
|
-
/*
|
|
541
|
-
* Native previews are recognised by their device shape: a slim bezel, a status
|
|
542
|
-
* bar with a punch-hole camera, and a home indicator. No address bar.
|
|
543
|
-
*/
|
|
544
|
-
.frame[data-kind='native'] {
|
|
545
|
-
padding: 10px;
|
|
546
|
-
border-color: #22262e;
|
|
547
|
-
border-radius: 28px;
|
|
548
|
-
background: linear-gradient(160deg, #2e3440, #1a1d24);
|
|
549
|
-
box-shadow:
|
|
550
|
-
var(--dpk-shadow-lg),
|
|
551
|
-
inset 0 1px 0 rgba(255, 255, 255, 0.06);
|
|
552
|
-
}
|
|
553
|
-
|
|
554
|
-
.frame[data-kind='native'] .viewport {
|
|
555
|
-
overflow: hidden;
|
|
556
|
-
border-radius: 18px;
|
|
557
|
-
}
|
|
558
|
-
|
|
559
|
-
/* A phone is portrait: derive the screen height from its width (~1:2.05)
|
|
560
|
-
instead of reusing the browser preview heights. */
|
|
561
|
-
.frame[data-kind='native'][data-viewport='mobile'] .viewport {
|
|
562
|
-
min-height: calc((var(--frame-width, 390px) - 16px) * 2.05);
|
|
563
|
-
}
|
|
564
|
-
|
|
565
|
-
.status-bar {
|
|
566
|
-
position: relative;
|
|
567
|
-
display: flex;
|
|
568
|
-
flex: 0 0 auto;
|
|
569
|
-
align-items: center;
|
|
570
|
-
justify-content: space-between;
|
|
571
|
-
height: 30px;
|
|
572
|
-
padding: 0 12px;
|
|
573
|
-
background: #0c0e13;
|
|
574
|
-
color: #e9edf4;
|
|
575
|
-
font-size: 11.5px;
|
|
576
|
-
font-weight: 550;
|
|
577
|
-
font-variant-numeric: tabular-nums;
|
|
578
|
-
}
|
|
579
|
-
|
|
580
|
-
.status-time {
|
|
581
|
-
letter-spacing: 0.02em;
|
|
582
|
-
}
|
|
583
|
-
|
|
584
|
-
.punch-hole {
|
|
585
|
-
position: absolute;
|
|
586
|
-
top: 50%;
|
|
587
|
-
left: 50%;
|
|
588
|
-
width: 10px;
|
|
589
|
-
height: 10px;
|
|
590
|
-
transform: translate(-50%, -50%);
|
|
591
|
-
border-radius: 50%;
|
|
592
|
-
background: #04060a;
|
|
593
|
-
box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.07);
|
|
594
|
-
}
|
|
595
|
-
|
|
596
|
-
.status-wifi {
|
|
597
|
-
width: 15px;
|
|
598
|
-
height: 12px;
|
|
599
|
-
fill: currentColor;
|
|
600
|
-
color: #e9edf4;
|
|
601
|
-
}
|
|
602
|
-
|
|
603
|
-
/* Home indicator. */
|
|
604
|
-
.frame[data-kind='native'] .viewport::after {
|
|
605
|
-
content: '';
|
|
606
|
-
position: absolute;
|
|
607
|
-
bottom: 8px;
|
|
608
|
-
left: 50%;
|
|
609
|
-
width: 88px;
|
|
610
|
-
height: 4px;
|
|
611
|
-
transform: translateX(-50%);
|
|
612
|
-
border-radius: 999px;
|
|
613
|
-
background: rgba(138, 146, 160, 0.55);
|
|
614
|
-
}
|
|
615
|
-
|
|
616
|
-
/*
|
|
617
|
-
* The preview is never scrolled on its own: it shows everything it contains and
|
|
618
|
-
* the page scrolls as a whole. The flex column keeps a short mock filling
|
|
619
|
-
* the frame's minimum height without pinning a maximum.
|
|
620
|
-
*/
|
|
621
|
-
.viewport {
|
|
622
|
-
position: relative;
|
|
623
|
-
display: flex;
|
|
624
|
-
flex-direction: column;
|
|
625
|
-
width: 100%;
|
|
626
|
-
min-height: var(--frame-min-height, 480px);
|
|
627
|
-
/* A preview is the product's screen, not the kit's chrome: it stays light in a dark theme. */
|
|
628
|
-
color-scheme: light;
|
|
629
|
-
background: #fff;
|
|
630
|
-
}
|
|
631
|
-
|
|
632
|
-
/*
|
|
633
|
-
* The author's wrapper becomes the frame's filling layer: a one-cell grid makes
|
|
634
|
-
* its height definite, so a mock that asks for height:100% fills the frame
|
|
635
|
-
* instead of collapsing to its content.
|
|
636
|
-
*/
|
|
637
|
-
/*
|
|
638
|
-
* The author's wrapper is a stretch row: a mock fills a short frame and grows
|
|
639
|
-
* the frame when its own content is taller. Stretching (rather than a
|
|
640
|
-
* percentage height) is what makes the fill reliable.
|
|
641
|
-
*/
|
|
642
|
-
/* Only the viewport carries the minimum height; the wrapper grows to fill it. */
|
|
643
|
-
.viewport ::slotted(*) {
|
|
644
|
-
display: grid;
|
|
645
|
-
flex: 1 0 auto;
|
|
646
|
-
min-width: 0;
|
|
647
|
-
}
|
|
648
|
-
|
|
649
|
-
.frame-placeholder {
|
|
650
|
-
position: absolute;
|
|
651
|
-
inset: 12px;
|
|
652
|
-
display: grid;
|
|
653
|
-
align-content: center;
|
|
654
|
-
justify-items: center;
|
|
655
|
-
gap: 8px;
|
|
656
|
-
padding: 12px;
|
|
657
|
-
text-align: center;
|
|
658
|
-
color: var(--dpk-ink-faint);
|
|
659
|
-
border: 1px dashed var(--dpk-rule-strong);
|
|
660
|
-
border-radius: var(--dpk-radius);
|
|
661
|
-
background: var(--dpk-dots), var(--dpk-paper-sunken);
|
|
662
|
-
}
|
|
663
|
-
|
|
664
|
-
.frame-placeholder code {
|
|
665
|
-
padding: 3px 7px;
|
|
666
|
-
border: 1px solid var(--dpk-rule);
|
|
667
|
-
border-radius: var(--dpk-radius-xs);
|
|
668
|
-
background: var(--dpk-paper-raised);
|
|
669
|
-
font-family: var(--dpk-mono);
|
|
670
|
-
font-size: 10px;
|
|
671
|
-
}
|
|
672
|
-
|
|
673
|
-
.parked {
|
|
674
|
-
display: none;
|
|
675
|
-
}
|
|
676
|
-
`;class xe extends ne{static{this.styles=[ne.styles,Qe]}definitionFor(t){return me(t)}renderRegions(t){const i=te(this.locale);return{sidebar:we(t,i),main:ke(t,i,{hasPreviewContent:a=>this.#e(a)})}}#e(t){return Array.from(this.querySelectorAll("[data-preview-id]")).some(i=>i.getAttribute("data-preview-id")===t)}}const Ie=()=>{customElements.get("dpk-template-prototype")||customElements.define("dpk-template-prototype",xe)},et=Object.freeze(Object.defineProperty({__proto__:null,DpkTemplatePrototype:xe,VIEWPORT_MIN_HEIGHT:be,VIEWPORT_WIDTH:Te,allStepIds:ue,applyPrototypeAction:ve,definePrototypeElement:Ie,describePrototypeAction:ye,emptyPrototypeBase:le,findActivity:A,findPreview:k,findStep:S,findStory:w,flattenSteps:F,parsePrototypeBase:pe,prototypeAction:M,prototypeActions:y,prototypeBaseSchema:de,prototypeCommentTargets:Ee,prototypeDefinitionFor:me,prototypeMessages:te,prototypePageHeading:he,prototypeTargetLabel:fe,prototypeTitle:ae,renderFrame:_e,renderNav:we,renderStage:ke,resolvePrototypeNavigation:Se,serializePrototypeAction:ge},Symbol.toStringTag,{value:"Module"}));export{Ie as d,et as i};
|