dev-process-kit 0.0.2-beta.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -9
- package/dist/chunks/shared-B2K3LoOU.js +1016 -0
- package/dist/chunks/shared-BqW3KAJ4.js +613 -0
- package/dist/chunks/shared-Byv6cc0r.js +2779 -0
- package/dist/chunks/{shared-CmM4cgd6.js → shared-CKG_SQh5.js} +1 -1
- package/dist/chunks/shared-CPAT0Cgk.js +29 -0
- package/dist/chunks/shared-CwbzACTe.js +1874 -0
- package/dist/chunks/shared-DBDgdVsd.js +1 -0
- package/dist/chunks/shared-DMlMTd3c.js +1018 -0
- package/dist/chunks/shared-DaoPCw6-.js +556 -0
- package/dist/chunks/shared-DqB_TR20.js +1599 -0
- package/dist/chunks/shared-DsVxrO_3.js +609 -0
- package/dist/chunks/shared-iQIywbRc.js +676 -0
- package/dist/chunks/shared-xrCdgpNS.js +1 -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 -0
- package/dist/templates/task-board.js +1 -0
- package/dist/templates/usm.js +1 -1
- package/package.json +4 -2
- package/dist/chunks/shared-5C6fORCL.js +0 -1404
- package/dist/chunks/shared-B1lFGiYZ.js +0 -1
- package/dist/chunks/shared-BEjjbZ0X.js +0 -2543
- package/dist/chunks/shared-BFAVBf4I.js +0 -1
- package/dist/chunks/shared-BybvAQye.js +0 -579
- package/dist/chunks/shared-DKxAm7wL.js +0 -27
- package/dist/chunks/shared-DgusMFKr.js +0 -1
- package/dist/chunks/shared-Dx0MEuAf.js +0 -921
- package/dist/chunks/shared-RclF4vSf.js +0 -692
- package/dist/chunks/shared-ao1beBgL.js +0 -544
- package/dist/chunks/shared-eiZoh1aF.js +0 -521
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function d(n){return n===null?1:n===void 0?2:0}function f(n,t){const e=d(n),r=d(t);return e<r?-1:e>r?1:e!==0?0:n<t?-1:n>t?1:0}function p(n,t,e){return e==="asc"?f(n,t):f(t,n)}function m(n,t,e){return n.slice().sort((r,i)=>{const s=e.length;for(let a=0;a<t.length;a++){const g=s>a?e[a]:e[s-1],c=t[a],o=typeof c=="function",l=p(o?c(r):r[c],o?c(i):i[c],g);if(l!==0)return l}return 0})}function v(n,t){return m(n,t,["asc"])}const u={kind:"idle"},h="text/plain",D=n=>`${n.type}:${n.id}`,k=(n,t)=>{const e=(n??"").trim();if(e.length===0)return null;const r=e.indexOf(":");if(r<0)return{type:t,id:e};const i=e.slice(0,r),s=e.slice(r+1);return i.length===0||s.length===0?null:{type:i,id:s}},y=(n,t)=>t<=n.top+n.height/2?"before":"after";class T{#i;#t=u;#r;constructor(t){this.#i=t,t.addController(this)}hostDisconnected(){this.reset()}get state(){return this.#t}get item(){return this.#t.kind==="dragging"?this.#t.item:null}isDragging(t,e){const r=this.item;return r!==null&&r.type===t&&r.id===e}isOver(t){return this.#t.kind!=="idle"&&this.#t.over===t}reset(){clearTimeout(this.#r),this.#r=void 0,this.#e(u)}source(t){return{dragstart:e=>{e.dataTransfer&&(e.dataTransfer.setData(h,D(t)),e.dataTransfer.effectAllowed="move"),clearTimeout(this.#r),this.#r=setTimeout(()=>{this.#r=void 0,this.#e({kind:"dragging",item:t,over:null})},0)},dragend:()=>this.reset()}}target(t){return{dragenter:r=>{this.#s(t.accepts)&&(r.preventDefault(),this.#n(t.key))},dragover:r=>{this.#s(t.accepts)&&(r.preventDefault(),r.dataTransfer&&(r.dataTransfer.dropEffect="move"),this.#n(t.key))},dragleave:()=>{this.isOver(t.key)&&this.#n(null)},drop:r=>{r.preventDefault();const i=k(r.dataTransfer?.getData(h),t.accepts)??this.item;if(this.#e(u),!i||i.type!==t.accepts)return;const s=t.hovered?.(r)??null;t.onDrop({item:{type:t.accepts,id:i.id},hoveredId:s?.id??null,place:s?y(s.element.getBoundingClientRect(),r.clientY):"end",event:r})}}}#s(t){const e=this.item;return e===null||e.type===t}#n(t){const e=this.#t;if(e.kind==="dragging"){e.over!==t&&this.#e({...e,over:t});return}if(t===null){e.kind==="receiving"&&this.#e(u);return}(e.kind==="idle"||e.over!==t)&&this.#e({kind:"receiving",over:t})}#e(t){this.#t!==t&&(this.#t=t,this.#i.requestUpdate())}}export{T as D,v as s};
|
|
@@ -1,579 +0,0 @@
|
|
|
1
|
-
import{a7 as Re,ax as G,a8 as O,a9 as k,aa as V,ar as h,ab as c,as as I,ad as w,ae as b,ac as P,q as E,al as y,v as K,aq as Y,P as xe,f as Pe,V as C,R as m,U as De,a1 as T,a0 as R,a2 as Ae,z as $e,m as Oe,$ as Ve,T as se}from"./shared-5C6fORCL.js";import{i as Ye}from"./shared-CmM4cgd6.js";import{a as oe,o as ae}from"./shared-DgusMFKr.js";const q=["browser","native"],j=["mobile","tablet","desktop","fluid"],Ce=O({id:I,kind:k(P(q),"browser"),viewport:k(P(j),"fluid"),label:h(c()),url:h(c())}),Ne=O({id:I,name:w(c(),b(1)),description:h(c()),previews:k(V(Ce),[])}),We=O({id:I,name:w(c(),b(1)),description:h(c()),steps:k(V(Ne),[])}),Me=O({id:I,name:w(c(),b(1)),description:h(c()),stories:k(V(We),[])}),ne=O({title:h(c()),baseUrl:h(c()),activities:k(V(Me),[])}),Le=e=>{const t=new Set,r=new Set;for(const s of e.activities){if(r.has(s.id))return`duplicate activity id "${s.id}"`;r.add(s.id);const i=new Set;for(const o of s.stories){if(i.has(o.id))return`duplicate story id "${o.id}" in activity "${s.id}"`;i.add(o.id);const a=new Set;for(const n of o.steps){if(a.has(n.id))return`duplicate step id "${n.id}" in story "${o.id}"`;a.add(n.id);for(const d of n.previews){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)}}}}return null},de=e=>{const t=Re(ne,e),r=Le(t);if(r!==null)throw new Error(r);return t},pe=()=>({activities:[]}),D=(e,t)=>{if(t!==void 0)return e.activities.find(r=>r.id===t)},x=(e,t)=>`${e}.${t}`,S=(e,t)=>{if(t===void 0)return;const r=G(t,2);if(r){const[i,o]=r;if(i===void 0||o===void 0)return;const a=e.activities.find(d=>d.id===i),n=a?.stories.find(d=>d.id===o);return a&&n?{activity:a,story:n}:void 0}if(t.includes("."))return;const s=e.activities.flatMap(i=>i.stories.filter(o=>o.id===t).map(o=>({activity:i,story:o})));return s.length===1?s[0]:void 0},le=e=>{const t=e.lastIndexOf(".");return t>=0?e.slice(t+1):e},N=e=>`${e.activity.id}.${e.story.id}.${e.step.id}`,H=(e,t,r)=>`${e.id}.${t.id}.${r.id}`,f=(e,t)=>{if(t===void 0)return;const r=G(t,3);if(r){const[i,o,a]=r;if(i===void 0||o===void 0||a===void 0)return;const n=e.activities.find(l=>l.id===i),d=n?.stories.find(l=>l.id===o),p=d?d.steps.findIndex(l=>l.id===a):-1,g=d&&p>=0?d.steps[p]:void 0;return n&&d&&g?{activity:n,story:d,step:g,stepIndex:p}:void 0}if(t.includes("."))return;const s=F(e).filter(i=>i.step.id===t);return s.length===1?s[0]:void 0},_=(e,t)=>{if(t===void 0)return;const r=G(t,4);if(r){const[s,i,o,a]=r;if(s===void 0||i===void 0||o===void 0||a===void 0)return;const n=f(e,`${s}.${i}.${o}`),d=n?.step.previews.find(p=>p.id===a);return n&&d?{location:n,preview:d}:void 0}if(!t.includes("."))for(const s of e.activities)for(const i of s.stories)for(const[o,a]of i.steps.entries()){const n=a.previews.find(d=>d.id===t);if(n)return{location:{activity:s,story:i,step:a,stepIndex:o},preview:n}}},F=e=>e.activities.flatMap(t=>t.stories.flatMap(r=>r.steps.map((s,i)=>({activity:t,story:r,step:s,stepIndex:i})))),ce=e=>F(e).map(t=>t.step.id),v={SET_ACTIVITY_NAME:E("SET_ACTIVITY_NAME","activity",y({name:w(c(),b(1))})),SET_ACTIVITY_DESCRIPTION:E("SET_ACTIVITY_DESCRIPTION","activity",y({description:c()})),SET_STORY_NAME:E("SET_STORY_NAME","story",y({name:w(c(),b(1))})),SET_STORY_DESCRIPTION:E("SET_STORY_DESCRIPTION","story",y({description:c()})),SET_STEP_NAME:E("SET_STEP_NAME","step",y({name:w(c(),b(1))})),SET_STEP_DESCRIPTION:E("SET_STEP_DESCRIPTION","step",y({description:c()})),SET_PREVIEW_KIND:E("SET_PREVIEW_KIND","preview",y({kind:P(q)})),SET_PREVIEW_VIEWPORT:E("SET_PREVIEW_VIEWPORT","preview",y({viewport:P(j)})),SET_PREVIEW_LABEL:E("SET_PREVIEW_LABEL","preview",y({label:c()})),REORDER_ACTIVITY:E("REORDER_ACTIVITY","activity",y({after:Y(c())}),{mode:"sequence"}),REORDER_STORY:E("REORDER_STORY","story",y({after:Y(c())}),{mode:"sequence"}),REORDER_STEP:E("REORDER_STEP","step",y({after:Y(c())}),{mode:"sequence"}),MOVE_STORY:E("MOVE_STORY","story",y({toActivity:w(c(),b(1)),after:Y(c())}),{mode:"sequence"}),MOVE_STEP:E("MOVE_STEP","step",y({toStory:w(c(),b(1)),after:Y(c())}),{mode:"sequence"}),ADD_ACTIVITY:E("ADD_ACTIVITY","page",y({id:I,name:w(c(),b(1)),description:h(c())}),{dedupeKey:K}),ADD_STORY:E("ADD_STORY","activity",y({id:I,name:w(c(),b(1)),description:h(c())}),{dedupeKey:K}),ADD_STEP:E("ADD_STEP","story",y({id:I,name:w(c(),b(1)),description:h(c()),previews:h(V(y({id:I,kind:k(P(q),"browser"),viewport:k(P(j),"fluid"),label:h(c()),url:h(c())})))}),{dedupeKey:K}),ADD_PREVIEW:E("ADD_PREVIEW","step",y({id:I,kind:k(P(q),"browser"),viewport:k(P(j),"fluid"),label:h(c()),url:h(c())}),{dedupeKey:K}),DELETE_ACTIVITY:E("DELETE_ACTIVITY","activity",y({})),DELETE_STORY:E("DELETE_STORY","story",y({})),DELETE_STEP:E("DELETE_STEP","step",y({})),DELETE_PREVIEW:E("DELETE_PREVIEW","preview",y({}))},W={setActivityName:(e,t)=>({type:"SET_ACTIVITY_NAME",target:{type:"activity",id:e},payload:{name:t}}),setActivityDescription:(e,t)=>({type:"SET_ACTIVITY_DESCRIPTION",target:{type:"activity",id:e},payload:{description:t}}),setStoryName:(e,t)=>({type:"SET_STORY_NAME",target:{type:"story",id:e},payload:{name:t}}),setStoryDescription:(e,t)=>({type:"SET_STORY_DESCRIPTION",target:{type:"story",id:e},payload:{description:t}}),setStepName:(e,t)=>({type:"SET_STEP_NAME",target:{type:"step",id:e},payload:{name:t}}),setStepDescription:(e,t)=>({type:"SET_STEP_DESCRIPTION",target:{type:"step",id:e},payload:{description:t}}),setPreviewViewport:(e,t)=>({type:"SET_PREVIEW_VIEWPORT",target:{type:"preview",id:e},payload:{viewport:t}}),setPreviewKind:(e,t)=>({type:"SET_PREVIEW_KIND",target:{type:"preview",id:e},payload:{kind:t}}),setPreviewLabel:(e,t)=>({type:"SET_PREVIEW_LABEL",target:{type:"preview",id:e},payload:{label:t}}),reorderActivity:(e,t)=>({type:"REORDER_ACTIVITY",target:{type:"activity",id:e},payload:{after:t}}),reorderStory:(e,t)=>({type:"REORDER_STORY",target:{type:"story",id:e},payload:{after:t}}),reorderStep:(e,t)=>({type:"REORDER_STEP",target:{type:"step",id:e},payload:{after:t}}),moveStep:(e,t,r)=>({type:"MOVE_STEP",target:{type:"step",id:e},payload:{toStory:t,after:r}}),moveStory:(e,t,r)=>({type:"MOVE_STORY",target:{type:"story",id:e},payload:{toActivity:t,after:r}}),addActivity:(e,t,r)=>({type:"ADD_ACTIVITY",target:{type:"page",id:"prototype"},payload:{id:e,name:t,...r===void 0?{}:{description:r}}}),addStory:(e,t,r,s)=>({type:"ADD_STORY",target:{type:"activity",id:e},payload:{id:t,name:r,...s===void 0?{}:{description:s}}}),addStep:(e,t,r,s)=>({type:"ADD_STEP",target:{type:"story",id:e},payload:{id:t,name:r,...s===void 0?{}:{previews:s}}}),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:{}})},ue=(e,t)=>{const r=xe(v,t);if(r===null)return null;const s=r.target.id;switch(r.type){case"SET_ACTIVITY_NAME":return A(e,s,i=>({...i,name:r.payload.name}));case"SET_ACTIVITY_DESCRIPTION":return A(e,s,i=>({...i,description:r.payload.description}));case"SET_STORY_NAME":return $(e,s,i=>({...i,name:r.payload.name}));case"SET_STORY_DESCRIPTION":return $(e,s,i=>({...i,description:r.payload.description}));case"SET_STEP_NAME":return M(e,s,i=>({...i,name:r.payload.name}));case"SET_STEP_DESCRIPTION":return M(e,s,i=>({...i,description:r.payload.description}));case"SET_PREVIEW_KIND":return Q(e,s,i=>({...i,kind:r.payload.kind}));case"SET_PREVIEW_VIEWPORT":return Q(e,s,i=>({...i,viewport:r.payload.viewport}));case"SET_PREVIEW_LABEL":return Q(e,s,i=>({...i,label:r.payload.label}));case"REORDER_ACTIVITY":{const{after:i}=r.payload,o=L(e.activities,s,i);return o===null?null:{...e,activities:o}}case"REORDER_STORY":{const{after:i}=r.payload,o=S(e,s);if(!o)return null;const a=i===null?null:S(e,i);if(i!==null&&(!a||a.activity!==o.activity))return null;const n=L(o.activity.stories,o.story.id,a?.story.id??null);return n===null?null:A(e,o.activity.id,d=>({...d,stories:n}))}case"REORDER_STEP":{const{after:i}=r.payload,o=f(e,s);if(!o)return null;const a=i===null?null:f(e,i);if(i!==null&&(!a||a.story!==o.story))return null;const n=L(o.story.steps,o.step.id,a?.step.id??null);return n===null?null:$(e,x(o.activity.id,o.story.id),d=>({...d,steps:n}))}case"MOVE_STORY":{const{toActivity:i,after:o}=r.payload,a=S(e,s);if(!a)return null;const n=e.activities.find(l=>l.id===i);if(!n)return null;const d=o===null?null:S(e,o);if(o!==null&&(!d||d.activity!==n))return null;const p=d?.story.id??null;if(a.activity.id===i){const l=L(a.activity.stories,a.story.id,p);return l===null?null:A(e,i,u=>({...u,stories:l}))}if(n.stories.some(l=>l.id===a.story.id))return null;const g=ee(n.stories,a.story,p);return Z(e,l=>l.id===a.activity.id?{...l,stories:l.stories.filter(u=>u.id!==le(s))}:l.id===i?{...l,stories:g}:l)}case"MOVE_STEP":{const{toStory:i,after:o}=r.payload,a=f(e,s);if(!a)return null;const n=S(e,i);if(!n)return null;const d=o===null?null:f(e,o);if(o!==null&&(!d||d.story!==n.story))return null;const p=d?.step.id??null;if(a.story===n.story){const l=L(a.story.steps,a.step.id,p);return l===null?null:$(e,i,u=>({...u,steps:l}))}if(n.story.steps.some(l=>l.id===a.step.id))return null;const g=ee(n.story.steps,a.step,p);return Z(e,l=>({...l,stories:l.stories.map(u=>u===a.story?{...u,steps:u.steps.filter(z=>z.id!==le(s))}:u===n.story?{...u,steps:g}:u)}))}case"ADD_ACTIVITY":{const i=r.payload;if(e.activities.some(a=>a.id===i.id))return e;const o={id:i.id,name:i.name,...i.description===void 0?{}:{description:i.description},stories:[]};return{...e,activities:[...e.activities,o]}}case"ADD_STORY":{const i=r.payload,o=e.activities.find(n=>n.id===s);if(!o)return null;if(o.stories.some(n=>n.id===i.id))return e;const a={id:i.id,name:i.name,...i.description===void 0?{}:{description:i.description},steps:[]};return A(e,s,n=>({...n,stories:[...n.stories,a]}))}case"ADD_STEP":{const i=r.payload,o=S(e,s)?.story;if(!o)return null;if(o.steps.some(d=>d.id===i.id))return e;const a=(i.previews??[]).map(d=>d.id);if(new Set(a).size!==a.length||a.some(d=>_(e,d)))return null;const n={id:i.id,name:i.name,...i.description===void 0?{}:{description:i.description},previews:i.previews??[]};return $(e,s,d=>({...d,steps:[...d.steps,n]}))}case"ADD_PREVIEW":{const i=r.payload,o=f(e,s)?.step;return o?o.previews.some(a=>a.id===i.id)?e:_(e,i.id)?null:M(e,s,a=>({...a,previews:[...a.previews,i]})):null}case"DELETE_ACTIVITY":{const i=s;return e.activities.some(o=>o.id===i)?{...e,activities:e.activities.filter(o=>o.id!==i)}:null}case"DELETE_STORY":{const i=S(e,s);return i?A(e,i.activity.id,o=>({...o,stories:o.stories.filter(a=>a.id!==i.story.id)})):null}case"DELETE_STEP":{const i=f(e,s);return i?$(e,x(i.activity.id,i.story.id),o=>({...o,steps:o.steps.filter(a=>a.id!==i.step.id)})):null}case"DELETE_PREVIEW":{const i=_(e,s);return i?M(e,N(i.location),o=>({...o,previews:o.previews.filter(a=>a.id!==i.preview.id)})):null}default:return Pe(r)}},Z=(e,t)=>({...e,activities:e.activities.map(t)}),A=(e,t,r)=>{const s=t;return e.activities.some(i=>i.id===s)?Z(e,i=>i.id===s?r(i):i):null},$=(e,t,r)=>{const s=S(e,t);if(!s)return null;const i=s.story.id;return A(e,s.activity.id,o=>({...o,stories:o.stories.map(a=>a.id===i?r(a):a)}))},M=(e,t,r)=>{const s=f(e,t);if(!s)return null;const i=s.step.id;return $(e,x(s.activity.id,s.story.id),o=>({...o,steps:o.steps.map(a=>a.id===i?r(a):a)}))},Q=(e,t,r)=>{const s=_(e,t);if(!s)return null;const i=s.preview.id;return M(e,N(s.location),o=>({...o,previews:o.previews.map(a=>a.id===i?r(a):a)}))},L=(e,t,r)=>{const s=e.findIndex(a=>a.id===t);if(s<0||r!==null&&!e.some(a=>a.id===r))return null;if(t===r)return[...e];const i=e[s];if(i===void 0)return null;const o=e.filter(a=>a.id!==t);return ee(o,i,r)},ee=(e,t,r)=>{const s=[...e],i=r===null?-1:s.findIndex(o=>o.id===r);return s.splice(i+1,0,t),s},U=(e,t)=>e===void 0?`\u2192 "${t}"`:`"${e}" \u2192 "${t}"`,ve={SET_ACTIVITY_NAME:(e,t)=>({title:"Activity \u540D\u3092\u5909\u66F4",tone:"update",body:U(D(t,e.target.id)?.name,m(v.SET_ACTIVITY_NAME,e).name)}),SET_ACTIVITY_DESCRIPTION:(e,t)=>({title:"Activity \u306E\u8AAC\u660E\u3092\u66F4\u65B0",tone:"update",body:te(D(t,e.target.id)?.description,m(v.SET_ACTIVITY_DESCRIPTION,e).description)}),SET_STORY_NAME:(e,t)=>({title:"UserStory \u540D\u3092\u5909\u66F4",tone:"update",body:U(S(t,e.target.id)?.story.name,m(v.SET_STORY_NAME,e).name)}),SET_STORY_DESCRIPTION:(e,t)=>({title:"UserStory \u306E\u8AAC\u660E\u3092\u66F4\u65B0",tone:"update",body:te(S(t,e.target.id)?.story.description,m(v.SET_STORY_DESCRIPTION,e).description)}),SET_STEP_NAME:(e,t)=>({title:"Step \u540D\u3092\u5909\u66F4",tone:"update",body:U(f(t,e.target.id)?.step.name,m(v.SET_STEP_NAME,e).name)}),SET_STEP_DESCRIPTION:(e,t)=>({title:"Step \u306E\u8AAC\u660E\u3092\u66F4\u65B0",tone:"update",body:te(f(t,e.target.id)?.step.description,m(v.SET_STEP_DESCRIPTION,e).description)}),SET_PREVIEW_KIND:(e,t)=>({title:"Preview \u306E\u7A2E\u5225\u3092\u5909\u66F4",tone:"update",body:U(_(t,e.target.id)?.preview.kind,m(v.SET_PREVIEW_KIND,e).kind)}),SET_PREVIEW_VIEWPORT:(e,t)=>({title:"Preview \u306E\u30D3\u30E5\u30FC\u30DD\u30FC\u30C8\u3092\u5909\u66F4",tone:"update",body:U(_(t,e.target.id)?.preview.viewport,m(v.SET_PREVIEW_VIEWPORT,e).viewport)}),SET_PREVIEW_LABEL:e=>({title:"Preview \u306E\u30E9\u30D9\u30EB\u3092\u5909\u66F4",tone:"update",body:`\u2192 "${m(v.SET_PREVIEW_LABEL,e).label}"`}),REORDER_ACTIVITY:e=>ie("Activity",m(v.REORDER_ACTIVITY,e).after),REORDER_STORY:e=>ie("UserStory",m(v.REORDER_STORY,e).after),REORDER_STEP:e=>ie("Step",m(v.REORDER_STEP,e).after),MOVE_STORY:(e,t)=>({title:"UserStory \u3092\u79FB\u52D5",tone:"move",body:`\u2192 ${D(t,m(v.MOVE_STORY,e).toActivity)?.name??m(v.MOVE_STORY,e).toActivity}`}),MOVE_STEP:(e,t)=>({title:"Step \u3092\u79FB\u52D5",tone:"move",body:`\u2192 ${S(t,m(v.MOVE_STEP,e).toStory)?.story.name??m(v.MOVE_STEP,e).toStory}`}),ADD_ACTIVITY:e=>J("Activity",m(v.ADD_ACTIVITY,e).name),ADD_STORY:e=>J("UserStory",m(v.ADD_STORY,e).name),ADD_STEP:e=>J("Step",m(v.ADD_STEP,e).name),ADD_PREVIEW:e=>J("Preview",m(v.ADD_PREVIEW,e).label??m(v.ADD_PREVIEW,e).id),DELETE_ACTIVITY:(e,t)=>X(D(t,e.target.id)?.name),DELETE_STORY:(e,t)=>X(S(t,e.target.id)?.story.name),DELETE_STEP:(e,t)=>X(f(t,e.target.id)?.step.name),DELETE_PREVIEW:(e,t)=>X(_(t,e.target.id)?.preview.label)},te=(e,t)=>{const r=t.length>90?`${t.slice(0,90)}\u2026`:t;return e===void 0||e===""?`\u2192 "${r}"`:`"${Ue(e)}" \u2192 "${r}"`},Ue=e=>e.length>60?`${e.slice(0,60)}\u2026`:e,ie=(e,t)=>({title:`${e} \u306E\u9806\u5E8F\u3092\u5909\u66F4`,tone:"move",body:t===null?"\u2192 \u5148\u982D\u3078":`\u2192 "${t}" \u306E\u76F4\u5F8C\u3078`}),J=(e,t)=>({title:`${e} \u3092\u8FFD\u52A0`,tone:"create",body:`+ "${t}"`}),X=e=>({title:"\u524A\u9664",tone:"delete",body:e===void 0?"(unknown target)":`\u2212 "${e}"`}),ye=(e,t,r)=>{const s=Object.hasOwn(ve,e.type)?ve[e.type]:void 0,i=s?s(e,r??t):{title:e.type,tone:"meta"};return{title:i.title,targetLabel:me(t,e.target),tone:i.tone,...i.body===void 0?{}:{summary:i.body}}},Ee=e=>`${e.type} ${C(e.target)} ${JSON.stringify(e.payload)}`,me=(e,t)=>{switch(t.type){case"activity":{const r=D(e,t.id);return r?`Activity \xB7 ${r.name}`:`Activity \xB7 ${t.id} (missing)`}case"story":{const r=S(e,t.id)?.story;return r?`UserStory \xB7 ${r.name}`:`UserStory \xB7 ${t.id} (missing)`}case"step":{const r=f(e,t.id)?.step;return r?`Step \xB7 ${r.name}`:`Step \xB7 ${t.id} (missing)`}case"preview":{const r=_(e,t.id)?.preview;return r?`Preview \xB7 ${r.label??r.id}`:`Preview \xB7 ${t.id} (missing)`}case"page":return`Page \xB7 ${re(e)}`;default:return`${t.type} \xB7 ${t.id}`}},ze=(e,t)=>{if(t.url)return t.url;const r=e.baseUrl?.trim(),s=De(e.title??"");return`${(r?r.startsWith("http")?r:`https://${r}`:`https://${s==="item"?"page":s}.example.com`).replace(/\/+$/,"")}/${t.id}`},fe=e=>{const t=[];for(const r of e.activities){t.push({value:C({type:"activity",id:r.id}),label:r.name,group:"Activity"});for(const s of r.stories){t.push({value:C({type:"story",id:x(r.id,s.id)}),label:`${r.name} \u203A ${s.name}`,group:"UserStory"});for(const i of s.steps)t.push({value:C({type:"step",id:H(r,s,i)}),label:`${s.name} \u203A ${i.name}`,group:"Step"})}}return t},Be=(e,t)=>{const r=f(e,t.step);return r?{value:C({type:"step",id:N(r)}),label:r.step.name,group:"Step"}:null},re=e=>e.title??"UX Prototype",Te=(e,t)=>{const r=D(e,t.activity),s=t.story,i=r?.stories.find(B=>B.id===s||x(r.id,B.id)===s),o=t.step,n=(r&&i&&o?f(e,`${x(r.id,i.id)}.${o}`):void 0)??f(e,o),d=i&&r?{activity:r,story:i}:S(e,s),p=n?.activity??r??d?.activity??e.activities[0],g=n?.story??(d&&d.activity===p?d.story:void 0)??p?.stories[0],l=n?.step??g?.steps[0],u={...t};p?u.activity=p.id:delete u.activity,g&&p?u.story=S(e,g.id)?g.id:x(p.id,g.id):delete u.story,l&&g&&p?u.step=f(e,l.id)?l.id:H(p,g,l):delete u.step;const z=l&&t.preview&&l.previews.some(B=>B.id===t.preview)?t.preview:l?.previews[0]?.id;return z?u.preview=z:delete u.preview,u},Ke=(e,t)=>{switch(t.type){case"activity":return D(e,t.id)!==void 0;case"story":return S(e,t.id)!==void 0;case"step":return f(e,t.id)!==void 0;case"preview":return _(e,t.id)!==void 0;case"page":return!0;default:return!1}},Se={name:"prototype",label:"UX Prototype",parseBase:de,emptyBase:pe,actions:v,apply:ue,hasTarget:Ke,canonicalTarget:(e,t)=>{if(t.type==="step"){const r=f(e,t.id);return r?{...t,id:N(r)}:t}if(t.type==="story"){const r=S(e,t.id);return r?{...t,id:x(r.activity.id,r.story.id)}:t}if(t.type==="preview"){const r=_(e,t.id);return r?{...t,id:r.preview.id}:t}return t},describe:ye,serialize:Ee,resolveNavigation:Te,commentTargets:(e,t)=>fe(e),currentTarget:(e,t)=>Be(e,t),title:re},ge=e=>{const{state:t,navigation:r}=e,s=f(t,r.step),i=s?.activity??t.activities[0],o=s?.story??i?.stories[0];if(!i||!o)return T`<p class="nav-empty">
|
|
2
|
-
Activity がまだありません。base JSON の <code>activities</code> を追加するか、Agent に依頼してください。
|
|
3
|
-
</p>`;const a=o.steps,n=s?.step,d=s?N(s):void 0;return T`
|
|
4
|
-
<div class="nav">
|
|
5
|
-
<div class="field">
|
|
6
|
-
<span class="dpk-label">Activity</span>
|
|
7
|
-
<select
|
|
8
|
-
class="dpk-select"
|
|
9
|
-
aria-label="Activity"
|
|
10
|
-
@change=${oe(p=>e.navigate({activity:p,story:null,step:null}))}
|
|
11
|
-
>
|
|
12
|
-
${t.activities.map(p=>T`<option value=${p.id} ?selected=${p.id===i.id}>${p.name}</option>`)}
|
|
13
|
-
</select>
|
|
14
|
-
</div>
|
|
15
|
-
<div class="field">
|
|
16
|
-
<span class="dpk-label">User Story</span>
|
|
17
|
-
<select
|
|
18
|
-
class="dpk-select"
|
|
19
|
-
aria-label="User Story"
|
|
20
|
-
@change=${oe(p=>e.navigate({activity:i.id,story:p,step:null}))}
|
|
21
|
-
>
|
|
22
|
-
${i.stories.map(p=>T`<option value=${p.id} ?selected=${p.id===o.id}>${p.name}</option>`)}
|
|
23
|
-
</select>
|
|
24
|
-
</div>
|
|
25
|
-
<div class="steps-head">
|
|
26
|
-
<span class="dpk-label">Step</span>
|
|
27
|
-
<span class="dpk-label">${a.length}</span>
|
|
28
|
-
</div>
|
|
29
|
-
<ol class="steps">
|
|
30
|
-
${Ae(a,p=>H(i,o,p),(p,g)=>{const l=H(i,o,p),u=e.commentCount({type:"step",id:l});return T`
|
|
31
|
-
<li class="step-row" data-current=${String(p.id===n?.id)}>
|
|
32
|
-
<a class="step-link" href=${e.hashFor({activity:i.id,story:o.id,step:p.id})}>
|
|
33
|
-
<span class="step-index">${String(g+1).padStart(2,"0")}</span>
|
|
34
|
-
<span class="step-name">${p.name}</span>
|
|
35
|
-
${u>0?T`<span class="step-note">${u}</span>`:R}
|
|
36
|
-
</a>
|
|
37
|
-
<span class="row-tools">
|
|
38
|
-
<button
|
|
39
|
-
class="dpk-icon-btn"
|
|
40
|
-
type="button"
|
|
41
|
-
aria-label="ステップを削除"
|
|
42
|
-
@click=${()=>e.dispatch(W.deleteStep(l))}
|
|
43
|
-
>
|
|
44
|
-
${$e()}
|
|
45
|
-
</button>
|
|
46
|
-
</span>
|
|
47
|
-
</li>
|
|
48
|
-
`})}
|
|
49
|
-
</ol>
|
|
50
|
-
<button class="dpk-btn" type="button" @click=${()=>qe(e,x(i.id,o.id))}>
|
|
51
|
-
+ Step
|
|
52
|
-
</button>
|
|
53
|
-
${n?Ye(d,T`<div class="detail">
|
|
54
|
-
<div class="detail-row">
|
|
55
|
-
<span class="dpk-label">Step 名</span>
|
|
56
|
-
<span class="detail-value">
|
|
57
|
-
<dpk-component-inline-edit
|
|
58
|
-
.value=${n.name}
|
|
59
|
-
.label=${"Step \u540D"}
|
|
60
|
-
@dpk-commit=${ae(p=>e.dispatch(W.setStepName(d??n.id,p)))}
|
|
61
|
-
></dpk-component-inline-edit>
|
|
62
|
-
</span>
|
|
63
|
-
</div>
|
|
64
|
-
<div class="detail-row">
|
|
65
|
-
<span class="dpk-label">説明</span>
|
|
66
|
-
<span class="detail-value">
|
|
67
|
-
<dpk-component-inline-edit
|
|
68
|
-
multiline
|
|
69
|
-
.value=${n.description??""}
|
|
70
|
-
.placeholder=${"\u3053\u306E Step \u3067\u4F55\u304C\u8D77\u304D\u308B\u304B\uFF08\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u7DE8\u96C6\uFF09"}
|
|
71
|
-
.label=${"\u8AAC\u660E"}
|
|
72
|
-
@dpk-commit=${ae(p=>e.dispatch(W.setStepDescription(d??n.id,p)))}
|
|
73
|
-
></dpk-component-inline-edit>
|
|
74
|
-
</span>
|
|
75
|
-
</div>
|
|
76
|
-
</div>`):R}
|
|
77
|
-
</div>
|
|
78
|
-
`},qe=(e,t)=>{const r=Oe("new-step",ce(e.state));e.dispatch(W.addStep(t,r,"\u65B0\u3057\u3044\u30B9\u30C6\u30C3\u30D7")).ok&&e.navigate({story:t,step:r})},he={mobile:"390px",tablet:"834px",desktop:"1180px",fluid:"100%"},we={mobile:"620px",tablet:"640px",desktop:"520px",fluid:"420px"},be=(e,t)=>{const{state:r,navigation:s}=e,i=f(r,s.step),o=i?i.step.previews.find(d=>d.id===s.preview)??i.step.previews[0]:void 0,a=Fe(r,o?.id);if(!i)return T`
|
|
79
|
-
<div class="stage">
|
|
80
|
-
<p class="stage-empty">
|
|
81
|
-
Step がまだありません。Prototype は
|
|
82
|
-
<strong>Activity › UserStory › Step › Preview</strong> の意味構造を持ち、 1 Step = 1 画面 / 1
|
|
83
|
-
体験状態です。base JSON に Step を追加すると、ここに Preview が現れます。
|
|
84
|
-
</p>
|
|
85
|
-
${a}
|
|
86
|
-
</div>
|
|
87
|
-
`;const n=i.step.previews;return T`
|
|
88
|
-
<div class="stage">
|
|
89
|
-
${n.length>1?je(e,n,o?.id):R}
|
|
90
|
-
${o?_e(e,o,t.hasPreviewContent(o.id)):R}
|
|
91
|
-
${n.length===0?T`<p class="dpk-label">preview metadata がありません — 追加は Agent に依頼してください</p>`:R}
|
|
92
|
-
${a}
|
|
93
|
-
</div>
|
|
94
|
-
`},je=(e,t,r)=>T`<div class="stage-bar">
|
|
95
|
-
<div class="tabs" role="tablist">
|
|
96
|
-
${t.map(s=>T`<a
|
|
97
|
-
class="tab"
|
|
98
|
-
role="tab"
|
|
99
|
-
data-current=${String(s.id===r)}
|
|
100
|
-
aria-selected=${s.id===r?"true":"false"}
|
|
101
|
-
href=${e.hashFor({preview:s.id})}
|
|
102
|
-
>${s.label??s.viewport}</a
|
|
103
|
-
>`)}
|
|
104
|
-
</div>
|
|
105
|
-
</div>`,_e=(e,t,r)=>T`
|
|
106
|
-
<figure
|
|
107
|
-
class="frame"
|
|
108
|
-
data-kind=${t.kind}
|
|
109
|
-
data-viewport=${t.viewport}
|
|
110
|
-
style=${`--frame-width:${he[t.viewport]};--frame-min-height:${we[t.viewport]}`}
|
|
111
|
-
>
|
|
112
|
-
${t.kind==="browser"?T`<div class="chrome">
|
|
113
|
-
<span class="dots"><i></i><i></i><i></i></span>
|
|
114
|
-
<span class="url">${ze(e.state,t)}</span>
|
|
115
|
-
</div>`:R}
|
|
116
|
-
<div class="viewport">
|
|
117
|
-
${t.kind==="native"?He():R}
|
|
118
|
-
<slot name=${`preview:${t.id}`}></slot>
|
|
119
|
-
${r?R:T`<div class="frame-placeholder">
|
|
120
|
-
<span class="dpk-label">light dom preview</span>
|
|
121
|
-
<code><div slot="preview" data-preview-id="${t.id}"></code>
|
|
122
|
-
</div>`}
|
|
123
|
-
</div>
|
|
124
|
-
</figure>
|
|
125
|
-
`,He=()=>T`<div class="status-bar">
|
|
126
|
-
<span class="status-time">9:41</span>
|
|
127
|
-
<span class="punch-hole" aria-hidden="true"></span>
|
|
128
|
-
<svg class="status-wifi" viewBox="0 0 16 12" aria-hidden="true">
|
|
129
|
-
<path d="M8 9.2a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3Z" />
|
|
130
|
-
<path
|
|
131
|
-
d="M4.7 7.4a4.8 4.8 0 0 1 6.6 0"
|
|
132
|
-
fill="none"
|
|
133
|
-
stroke="currentColor"
|
|
134
|
-
stroke-width="1.5"
|
|
135
|
-
stroke-linecap="round"
|
|
136
|
-
/>
|
|
137
|
-
<path
|
|
138
|
-
d="M2.1 4.7a8.4 8.4 0 0 1 11.8 0"
|
|
139
|
-
fill="none"
|
|
140
|
-
stroke="currentColor"
|
|
141
|
-
stroke-width="1.5"
|
|
142
|
-
stroke-linecap="round"
|
|
143
|
-
/>
|
|
144
|
-
</svg>
|
|
145
|
-
</div>`,Fe=(e,t)=>{const r=F(e).flatMap(s=>s.step.previews.filter(i=>i.id!==t));return r.length===0?T`${R}`:T`<div class="parked" aria-hidden="true">
|
|
146
|
-
${r.map(s=>T`<slot name=${`preview:${s.id}`}></slot>`)}
|
|
147
|
-
</div>`},Je=Ve`
|
|
148
|
-
:host {
|
|
149
|
-
--dpk-prototype-accent: var(--dpk-blue);
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
/* ---------------------------------------------------------------- sidebar */
|
|
153
|
-
|
|
154
|
-
.nav {
|
|
155
|
-
display: grid;
|
|
156
|
-
gap: 14px;
|
|
157
|
-
align-content: start;
|
|
158
|
-
min-width: 188px;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
.field {
|
|
162
|
-
display: grid;
|
|
163
|
-
gap: 5px;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
.steps-head {
|
|
167
|
-
display: flex;
|
|
168
|
-
align-items: baseline;
|
|
169
|
-
justify-content: space-between;
|
|
170
|
-
padding-bottom: 5px;
|
|
171
|
-
border-bottom: 1px solid var(--dpk-rule);
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
.steps {
|
|
175
|
-
list-style: none;
|
|
176
|
-
margin: 0;
|
|
177
|
-
padding: 0;
|
|
178
|
-
display: grid;
|
|
179
|
-
gap: 2px;
|
|
180
|
-
max-height: 38vh;
|
|
181
|
-
overflow: auto;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
.step-row {
|
|
185
|
-
position: relative;
|
|
186
|
-
display: flex;
|
|
187
|
-
align-items: center;
|
|
188
|
-
gap: 4px;
|
|
189
|
-
padding: 0 4px 0 9px;
|
|
190
|
-
border-radius: var(--dpk-radius-sm);
|
|
191
|
-
transition:
|
|
192
|
-
background 140ms ease,
|
|
193
|
-
box-shadow 140ms ease;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
.step-row:hover {
|
|
197
|
-
background: var(--dpk-paper-inset);
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
.step-row[data-current='true'] {
|
|
201
|
-
background: var(--dpk-paper-raised);
|
|
202
|
-
box-shadow: var(--dpk-shadow-sm);
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
.step-row[data-current='true']::before {
|
|
206
|
-
content: '';
|
|
207
|
-
position: absolute;
|
|
208
|
-
left: 0;
|
|
209
|
-
top: 8px;
|
|
210
|
-
bottom: 8px;
|
|
211
|
-
width: 3px;
|
|
212
|
-
border-radius: var(--dpk-radius-xs);
|
|
213
|
-
background: linear-gradient(180deg, var(--dpk-blue), var(--dpk-blue-strong));
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
.step-link {
|
|
217
|
-
display: flex;
|
|
218
|
-
flex: 1;
|
|
219
|
-
min-width: 0;
|
|
220
|
-
align-items: center;
|
|
221
|
-
gap: 7px;
|
|
222
|
-
padding: 7px 0;
|
|
223
|
-
text-decoration: none;
|
|
224
|
-
color: var(--dpk-ink-soft);
|
|
225
|
-
font-size: 12.5px;
|
|
226
|
-
font-weight: 460;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
.step-row[data-current='true'] .step-link {
|
|
230
|
-
color: var(--dpk-ink);
|
|
231
|
-
font-weight: 550;
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
.step-index {
|
|
235
|
-
flex: 0 0 auto;
|
|
236
|
-
min-width: 17px;
|
|
237
|
-
padding: 1px 4px;
|
|
238
|
-
border-radius: var(--dpk-radius-xs);
|
|
239
|
-
background: var(--dpk-paper-inset);
|
|
240
|
-
font-family: var(--dpk-mono);
|
|
241
|
-
font-size: 9.5px;
|
|
242
|
-
font-variant-numeric: tabular-nums;
|
|
243
|
-
text-align: center;
|
|
244
|
-
color: var(--dpk-ink-faint);
|
|
245
|
-
transition:
|
|
246
|
-
background 140ms ease,
|
|
247
|
-
color 140ms ease;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
.step-row[data-current='true'] .step-index {
|
|
251
|
-
background: var(--dpk-blue-soft);
|
|
252
|
-
color: var(--dpk-blue);
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
.step-name {
|
|
256
|
-
min-width: 0;
|
|
257
|
-
overflow: hidden;
|
|
258
|
-
white-space: nowrap;
|
|
259
|
-
text-overflow: ellipsis;
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
.step-note {
|
|
263
|
-
margin-left: auto;
|
|
264
|
-
min-width: 16px;
|
|
265
|
-
padding: 1px 5px;
|
|
266
|
-
border-radius: 999px;
|
|
267
|
-
background: var(--dpk-accent);
|
|
268
|
-
color: var(--dpk-accent-ink);
|
|
269
|
-
font-family: var(--dpk-mono);
|
|
270
|
-
font-size: 9px;
|
|
271
|
-
font-variant-numeric: tabular-nums;
|
|
272
|
-
text-align: center;
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
.row-tools {
|
|
276
|
-
display: flex;
|
|
277
|
-
gap: 0;
|
|
278
|
-
opacity: 0;
|
|
279
|
-
transition: opacity 120ms ease;
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
.step-row:hover .row-tools,
|
|
283
|
-
.step-row[data-current='true'] .row-tools {
|
|
284
|
-
opacity: 1;
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
.detail {
|
|
288
|
-
display: grid;
|
|
289
|
-
gap: 12px;
|
|
290
|
-
padding: 12px 12px 14px;
|
|
291
|
-
border: 1px solid var(--dpk-rule);
|
|
292
|
-
border-radius: var(--dpk-radius);
|
|
293
|
-
background: var(--dpk-paper-raised);
|
|
294
|
-
box-shadow: var(--dpk-shadow-sm);
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
.detail-row {
|
|
298
|
-
display: grid;
|
|
299
|
-
gap: 4px;
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
.detail-value {
|
|
303
|
-
font-size: 12.5px;
|
|
304
|
-
color: var(--dpk-ink-soft);
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
.nav-empty {
|
|
308
|
-
font-size: 12px;
|
|
309
|
-
line-height: 1.6;
|
|
310
|
-
color: var(--dpk-ink-faint);
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
/* ------------------------------------------------------------------ stage */
|
|
314
|
-
|
|
315
|
-
.stage {
|
|
316
|
-
display: grid;
|
|
317
|
-
gap: 14px;
|
|
318
|
-
width: 100%;
|
|
319
|
-
min-width: 0;
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
.stage-bar {
|
|
323
|
-
display: flex;
|
|
324
|
-
align-items: center;
|
|
325
|
-
gap: 10px;
|
|
326
|
-
min-width: 0;
|
|
327
|
-
flex-wrap: wrap;
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
.tabs {
|
|
331
|
-
display: inline-flex;
|
|
332
|
-
gap: 2px;
|
|
333
|
-
padding: 3px;
|
|
334
|
-
border: 1px solid var(--dpk-rule);
|
|
335
|
-
border-radius: 999px;
|
|
336
|
-
background: var(--dpk-paper-sunken);
|
|
337
|
-
box-shadow: inset 0 1px 2px rgba(20, 28, 44, 0.04);
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
.tab {
|
|
341
|
-
padding: 4px 14px;
|
|
342
|
-
border-radius: 999px;
|
|
343
|
-
font-size: 12px;
|
|
344
|
-
font-weight: 500;
|
|
345
|
-
text-decoration: none;
|
|
346
|
-
color: var(--dpk-ink-soft);
|
|
347
|
-
white-space: nowrap;
|
|
348
|
-
transition:
|
|
349
|
-
background 120ms ease,
|
|
350
|
-
color 120ms ease;
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
.tab:hover {
|
|
354
|
-
color: var(--dpk-ink);
|
|
355
|
-
background: var(--dpk-paper-raised);
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
.tab[data-current='true'] {
|
|
359
|
-
background: var(--dpk-paper-raised);
|
|
360
|
-
color: var(--dpk-ink);
|
|
361
|
-
font-weight: 600;
|
|
362
|
-
box-shadow: var(--dpk-shadow-xs);
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
.stage-empty {
|
|
366
|
-
max-width: 62ch;
|
|
367
|
-
padding: 16px 18px;
|
|
368
|
-
border: 1px dashed var(--dpk-rule-strong);
|
|
369
|
-
border-radius: var(--dpk-radius-lg);
|
|
370
|
-
background: var(--dpk-paper-sunken);
|
|
371
|
-
font-size: 13px;
|
|
372
|
-
line-height: 1.7;
|
|
373
|
-
color: var(--dpk-ink-soft);
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
/* ------------------------------------------------------------------ frame */
|
|
377
|
-
|
|
378
|
-
.frame {
|
|
379
|
-
width: min(var(--frame-width), 100%);
|
|
380
|
-
max-width: 100%;
|
|
381
|
-
margin: 0;
|
|
382
|
-
border: 1px solid var(--dpk-rule);
|
|
383
|
-
border-radius: var(--dpk-radius-lg);
|
|
384
|
-
background: var(--dpk-paper-raised);
|
|
385
|
-
box-shadow: var(--dpk-shadow-lg);
|
|
386
|
-
overflow: hidden;
|
|
387
|
-
transition: box-shadow 200ms ease;
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
.chrome {
|
|
391
|
-
display: flex;
|
|
392
|
-
align-items: center;
|
|
393
|
-
gap: 8px;
|
|
394
|
-
padding: 8px 14px;
|
|
395
|
-
background: linear-gradient(180deg, var(--dpk-paper-sunken), var(--dpk-paper-inset));
|
|
396
|
-
border-bottom: 1px solid var(--dpk-rule);
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
.dots {
|
|
400
|
-
display: inline-flex;
|
|
401
|
-
gap: 5px;
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
.dots i {
|
|
405
|
-
width: 10px;
|
|
406
|
-
height: 10px;
|
|
407
|
-
border-radius: 50%;
|
|
408
|
-
background: var(--dpk-rule-strong);
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
.dots i:nth-child(1) {
|
|
412
|
-
background: #ff5f57;
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
.dots i:nth-child(2) {
|
|
416
|
-
background: #febc2e;
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
.dots i:nth-child(3) {
|
|
420
|
-
background: #28c840;
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
.chrome .url {
|
|
424
|
-
flex: 1;
|
|
425
|
-
min-width: 0;
|
|
426
|
-
padding: 4px 14px;
|
|
427
|
-
border: 1px solid var(--dpk-rule);
|
|
428
|
-
border-radius: var(--dpk-radius-sm);
|
|
429
|
-
background: var(--dpk-paper-raised);
|
|
430
|
-
box-shadow: inset 0 1px 2px rgba(20, 28, 44, 0.04);
|
|
431
|
-
font-family: var(--dpk-mono);
|
|
432
|
-
font-size: 10.5px;
|
|
433
|
-
color: var(--dpk-ink-faint);
|
|
434
|
-
overflow: hidden;
|
|
435
|
-
white-space: nowrap;
|
|
436
|
-
text-overflow: ellipsis;
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
/*
|
|
440
|
-
* Native previews are recognised by their device shape: a slim bezel, a status
|
|
441
|
-
* bar with a punch-hole camera, and a home indicator. No address bar.
|
|
442
|
-
*/
|
|
443
|
-
.frame[data-kind='native'] {
|
|
444
|
-
padding: 10px;
|
|
445
|
-
border-color: #22262e;
|
|
446
|
-
border-radius: 28px;
|
|
447
|
-
background: linear-gradient(160deg, #2e3440, #1a1d24);
|
|
448
|
-
box-shadow:
|
|
449
|
-
var(--dpk-shadow-lg),
|
|
450
|
-
inset 0 1px 0 rgba(255, 255, 255, 0.06);
|
|
451
|
-
}
|
|
452
|
-
|
|
453
|
-
.frame[data-kind='native'] .viewport {
|
|
454
|
-
overflow: hidden;
|
|
455
|
-
border-radius: 18px;
|
|
456
|
-
}
|
|
457
|
-
|
|
458
|
-
/* A phone is portrait: derive the screen height from its width (~1:2.05)
|
|
459
|
-
instead of reusing the browser preview heights. */
|
|
460
|
-
.frame[data-kind='native'][data-viewport='mobile'] .viewport {
|
|
461
|
-
min-height: calc((var(--frame-width, 390px) - 16px) * 2.05);
|
|
462
|
-
}
|
|
463
|
-
|
|
464
|
-
.status-bar {
|
|
465
|
-
position: relative;
|
|
466
|
-
display: flex;
|
|
467
|
-
flex: 0 0 auto;
|
|
468
|
-
align-items: center;
|
|
469
|
-
justify-content: space-between;
|
|
470
|
-
height: 30px;
|
|
471
|
-
padding: 0 12px;
|
|
472
|
-
background: #0c0e13;
|
|
473
|
-
color: #e9edf4;
|
|
474
|
-
font-size: 11.5px;
|
|
475
|
-
font-weight: 550;
|
|
476
|
-
font-variant-numeric: tabular-nums;
|
|
477
|
-
}
|
|
478
|
-
|
|
479
|
-
.status-time {
|
|
480
|
-
letter-spacing: 0.02em;
|
|
481
|
-
}
|
|
482
|
-
|
|
483
|
-
.punch-hole {
|
|
484
|
-
position: absolute;
|
|
485
|
-
top: 50%;
|
|
486
|
-
left: 50%;
|
|
487
|
-
width: 10px;
|
|
488
|
-
height: 10px;
|
|
489
|
-
transform: translate(-50%, -50%);
|
|
490
|
-
border-radius: 50%;
|
|
491
|
-
background: #04060a;
|
|
492
|
-
box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.07);
|
|
493
|
-
}
|
|
494
|
-
|
|
495
|
-
.status-wifi {
|
|
496
|
-
width: 15px;
|
|
497
|
-
height: 12px;
|
|
498
|
-
fill: currentColor;
|
|
499
|
-
color: #e9edf4;
|
|
500
|
-
}
|
|
501
|
-
|
|
502
|
-
/* Home indicator. */
|
|
503
|
-
.frame[data-kind='native'] .viewport::after {
|
|
504
|
-
content: '';
|
|
505
|
-
position: absolute;
|
|
506
|
-
bottom: 8px;
|
|
507
|
-
left: 50%;
|
|
508
|
-
width: 88px;
|
|
509
|
-
height: 4px;
|
|
510
|
-
transform: translateX(-50%);
|
|
511
|
-
border-radius: 999px;
|
|
512
|
-
background: rgba(138, 146, 160, 0.55);
|
|
513
|
-
}
|
|
514
|
-
|
|
515
|
-
/*
|
|
516
|
-
* The preview is never scrolled on its own: it shows everything it contains and
|
|
517
|
-
* the page scrolls as a whole. The flex column keeps a short mock filling
|
|
518
|
-
* the frame's minimum height without pinning a maximum.
|
|
519
|
-
*/
|
|
520
|
-
.viewport {
|
|
521
|
-
position: relative;
|
|
522
|
-
display: flex;
|
|
523
|
-
flex-direction: column;
|
|
524
|
-
width: 100%;
|
|
525
|
-
min-height: var(--frame-min-height, 480px);
|
|
526
|
-
/* A preview is the product's screen, not the kit's chrome: it stays light in a dark theme. */
|
|
527
|
-
color-scheme: light;
|
|
528
|
-
background: #fff;
|
|
529
|
-
}
|
|
530
|
-
|
|
531
|
-
/*
|
|
532
|
-
* The author's wrapper becomes the frame's filling layer: a one-cell grid makes
|
|
533
|
-
* its height definite, so a mock that asks for height:100% fills the frame
|
|
534
|
-
* instead of collapsing to its content.
|
|
535
|
-
*/
|
|
536
|
-
/*
|
|
537
|
-
* The author's wrapper is a stretch row: a mock fills a short frame and grows
|
|
538
|
-
* the frame when its own content is taller. Stretching (rather than a
|
|
539
|
-
* percentage height) is what makes the fill reliable.
|
|
540
|
-
*/
|
|
541
|
-
/* Only the viewport carries the minimum height; the wrapper grows to fill it. */
|
|
542
|
-
.viewport ::slotted(*) {
|
|
543
|
-
display: grid;
|
|
544
|
-
flex: 1 0 auto;
|
|
545
|
-
min-width: 0;
|
|
546
|
-
}
|
|
547
|
-
|
|
548
|
-
.frame-placeholder {
|
|
549
|
-
position: absolute;
|
|
550
|
-
inset: 0;
|
|
551
|
-
display: grid;
|
|
552
|
-
align-content: center;
|
|
553
|
-
justify-items: center;
|
|
554
|
-
gap: 8px;
|
|
555
|
-
padding: 12px;
|
|
556
|
-
text-align: center;
|
|
557
|
-
color: var(--dpk-ink-faint);
|
|
558
|
-
background: repeating-linear-gradient(
|
|
559
|
-
-45deg,
|
|
560
|
-
var(--dpk-paper-sunken),
|
|
561
|
-
var(--dpk-paper-sunken) 8px,
|
|
562
|
-
var(--dpk-paper) 8px,
|
|
563
|
-
var(--dpk-paper) 16px
|
|
564
|
-
);
|
|
565
|
-
}
|
|
566
|
-
|
|
567
|
-
.frame-placeholder code {
|
|
568
|
-
padding: 3px 7px;
|
|
569
|
-
border: 1px solid var(--dpk-rule);
|
|
570
|
-
border-radius: var(--dpk-radius-xs);
|
|
571
|
-
background: var(--dpk-paper-raised);
|
|
572
|
-
font-family: var(--dpk-mono);
|
|
573
|
-
font-size: 10px;
|
|
574
|
-
}
|
|
575
|
-
|
|
576
|
-
.parked {
|
|
577
|
-
display: none;
|
|
578
|
-
}
|
|
579
|
-
`;class ke extends se{constructor(){super(...arguments),this.definition=Se}static{this.styles=[se.styles,Je]}renderRegions(t){return{sidebar:ge(t),main:be(t,{hasPreviewContent:r=>this.#e(r)})}}#e(t){return Array.from(this.querySelectorAll("[data-preview-id]")).some(r=>r.getAttribute("data-preview-id")===t)}}const Ie=()=>{customElements.get("dpk-template-prototype")||customElements.define("dpk-template-prototype",ke)},Xe=Object.freeze(Object.defineProperty({__proto__:null,DpkTemplatePrototype:ke,VIEWPORT_MIN_HEIGHT:we,VIEWPORT_WIDTH:he,allStepIds:ce,applyPrototypeAction:ue,definePrototypeElement:Ie,describePrototypeAction:ye,emptyPrototypeBase:pe,findActivity:D,findPreview:_,findStep:f,findStory:S,flattenSteps:F,parsePrototypeBase:de,prototypeAction:W,prototypeActions:v,prototypeBaseSchema:ne,prototypeCommentTargets:fe,prototypeDefinition:Se,prototypeTargetLabel:me,prototypeTitle:re,renderFrame:_e,renderNav:ge,renderStage:be,resolvePrototypeNavigation:Te,serializePrototypeAction:Ee},Symbol.toStringTag,{value:"Module"}));export{Ie as d,Xe as i};
|