@geops/rvf-mobility-web-component 0.1.88 → 0.1.89
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/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [0.1.89](https://github.com/geops/rvf-mobility-web-component/compare/v0.1.88...v0.1.89) (2025-11-20)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* fix padding ([853c54f](https://github.com/geops/rvf-mobility-web-component/commit/853c54f6a6a4616a07d19d41bf1e1f41032b449e))
|
|
11
|
+
|
|
5
12
|
### [0.1.88](https://github.com/geops/rvf-mobility-web-component/compare/v0.1.87...v0.1.88) (2025-11-20)
|
|
6
13
|
|
|
7
14
|
|
package/index.js
CHANGED
|
@@ -1281,7 +1281,7 @@ end`};t.events.push(["putFont",function(n){(function(l){var h=l.font,d=l.out,p=l
|
|
|
1281
1281
|
/* transform: rotate(-45deg); */
|
|
1282
1282
|
`,children:j("path",{d:"M13.2928932,5.29289322 C13.6834175,4.90236893 14.3165825,4.90236893 14.7071068,5.29289322 L20.7071068,11.2928932 C20.7355731,11.3213595 20.7623312,11.3515341 20.787214,11.3832499 C20.7927155,11.3901576 20.7982466,11.397397 20.8036654,11.4046934 C20.8215099,11.4288693 20.8382813,11.453725 20.8539326,11.4793398 C20.8613931,11.4913869 20.8685012,11.5036056 20.8753288,11.5159379 C20.8862061,11.5357061 20.8966234,11.5561086 20.9063462,11.5769009 C20.914321,11.5939015 20.9218036,11.6112044 20.9287745,11.628664 C20.9366843,11.6484208 20.9438775,11.6682023 20.9504533,11.6882636 C20.9552713,11.7031487 20.9599023,11.7185367 20.9641549,11.734007 C20.9701664,11.7555635 20.9753602,11.7772539 20.9798348,11.7992059 C20.9832978,11.8166247 20.9863719,11.834051 20.9889822,11.8515331 C20.9962388,11.8996379 21,11.9493797 21,12 L20.9962979,11.9137692 C20.9978436,11.9317345 20.9989053,11.9497336 20.9994829,11.9677454 L21,12 C21,12.0112225 20.9998151,12.0224019 20.9994483,12.0335352 C20.9988772,12.050591 20.997855,12.0679231 20.996384,12.0852242 C20.994564,12.1070574 20.9920941,12.1281144 20.9889807,12.1489612 C20.9863719,12.165949 20.9832978,12.1833753 20.9797599,12.2007258 C20.9753602,12.2227461 20.9701664,12.2444365 20.964279,12.2658396 C20.9599023,12.2814633 20.9552713,12.2968513 20.9502619,12.3121425 C20.9438775,12.3317977 20.9366843,12.3515792 20.928896,12.3710585 C20.9218036,12.3887956 20.914321,12.4060985 20.9063266,12.4232215 C20.8966234,12.4438914 20.8862061,12.4642939 20.8751242,12.484277 C20.8685012,12.4963944 20.8613931,12.5086131 20.8540045,12.5207088 C20.8382813,12.546275 20.8215099,12.5711307 20.8036865,12.5951593 C20.774687,12.6343256 20.7425008,12.6717127 20.7071068,12.7071068 L20.787214,12.6167501 C20.7849289,12.6196628 20.7826279,12.6225624 20.7803112,12.625449 L20.7071068,12.7071068 L14.7071068,18.7071068 C14.3165825,19.0976311 13.6834175,19.0976311 13.2928932,18.7071068 C12.9023689,18.3165825 12.9023689,17.6834175 13.2928932,17.2928932 L17.585,13 L4,13 C3.48716416,13 3.06449284,12.6139598 3.00672773,12.1166211 L3,12 C3,11.4477153 3.44771525,11 4,11 L17.585,11 L13.2928932,6.70710678 C12.9324093,6.34662282 12.9046797,5.77939176 13.2097046,5.38710056 Z",fill:"currentColor",fillRule:"nonzero",id:"Combined-Shape",style:`
|
|
1283
1283
|
/* transform: rotate(-45deg); */
|
|
1284
|
-
`})})]})}var eF=Zd1;var Nd1="my-1 flex items-center leading-[1.1] underline text-base items-center justify-left font-semibold gap-1",Ud1={primary:{classes:"bg-red text-white disabled:bg-lightgrey hover:bg-darkred hover:border-darkred active:bg-lightred active:border-lightred ",selectedClasses:"bg-darkred border-darkred"},secondary:{classes:"bg-white text-black hover:text-red active:text-lightred",selectedClasses:"text-red"}};function Qd1({children:r,className:t,theme:e="secondary",...i}){let o=It(()=>oe(`${Nd1} ${Ud1[e].classes} ${t||""}`),[t,e]);return j("a",{className:o,rel:"noreferrer",target:"_blank",...i,children:[(!i.href?.includes(window.location.hostname)||!i.href?.startsWith("(https?|ftp)"))&&j(eF,{height:"20",width:"20"}),r]})}var ds=et(Qd1);var cX=(r,t,e,i=!0)=>{let o=r.toLocaleTimeString(["de"],{hour:"2-digit",minute:"2-digit"});return`${r.toLocaleDateString(["de"],{day:"2-digit",month:i?"short":"long",year:e?"numeric":void 0})}${t&&o?` ${o}`:""}`.replace(",","")};function Hd1({canToggle:r=!1,headerClassName:t,iconClassName:e,publicationClassName:i,reasonClassName:o,situation:n,timeIntervalClassName:l,useShortMonth:h=!0}){let{locale:d,t:p}=er(),[C,M]=pt(!r);if(!n)return null;let S={},y={},O=[],Q=[],H=[];return Q=(n?.publications||[])?.filter(({publicationWindows:t1})=>(!t1?.length&&n?.publicationWindows?.length&&(t1=n?.publicationWindows),t1.find(({endTime:e1,startTime:J})=>{let g1=new Date,b1=new Date(J),T1=new Date(e1);return b1<=g1&&g1<=T1})))||[],O=(n?.affectedTimeIntervals||[]).filter(({endTime:t1,startTime:e1})=>{let J=new Date,g1=new Date(e1),b1=new Date(t1);return g1<=J&&J<=b1||J<g1})||[],H=(n?.reasons||[]).map(({name:t1})=>t1),j(Xe,{children:Q?.map(({id:t1,publicationLines:e1,publicationStops:J,textualContentLarge:g1,textualContentMedium:b1,textualContentSmall:T1})=>{S=g1||b1||T1,y=S?.[d()],y?.summary||(y=S?.de);let x1=e1?.flatMap(D1=>D1.lines?.map(({name:a1})=>a1)||[])||[],C1=J.map(D1=>D1?.name||"");return j("div",{className:oe("text-base",i),children:[j("div",{className:oe("text-xs uppercase",o),children:H}),j("h3",{className:oe("space-x-2 text-xl leading-[1.3] font-bold text-balance",t),children:[j("span",{className:"inline-block align-middle",children:j(tF,{className:oe(e)})}),j("span",{className:"align-middle *:inline",dangerouslySetInnerHTML:{__html:y?.summary}})]}),j("hr",{className:"my-1"}),O?.map(({dailyEndTime:D1,dailyStartTime:a1,endTime:w1,startTime:Q1},j1)=>{let c2=D1&&a1,C2=w1.includes("2500"),Y1=cX(new Date(Q1),!1,!0,h),H1=C2?void 0:cX(new Date(w1),!1,!0,h);return j("button",{className:oe("flex w-full items-center",r&&"cursor-pointer"),onClick:()=>{M(!C)},tabIndex:r?0:-1,children:[j("div",{className:oe("flex-1 text-left text-sm font-bold text-balance",l),children:[j("span",{children:[Y1&&H1?`${Y1} \u2013 ${H1}`:null,Y1&&!H1?p("from",{from:Y1}):null]}),c2&&j("span",{children:` (${p("daily_from_to",{from:a1,to:D1})})`})]},Q1),r&&j1==0&&j(Xe,{children:C?j(sL,{className:"text-red"}):j(_c,{className:"text-red"})})]},Q1)}),j("div",{className:C?"my-4 flex flex-col gap-4":"hidden",children:[y?.description&&j("div",{dangerouslySetInnerHTML:{__html:y?.description}}),!!S?.images?.length&&j("div",{className:"flex flex-wrap gap-2",children:S.images.map(({image:{absoluteUrl:D1,label:a1}})=>j("img",{alt:a1,className:"h-fit",src:D1,title:a1},D1+a1))}),!!S?.infoLinks?.length&&j("div",{children:S.infoLinks.map(({label:D1,uri:a1})=>{let w1=D1[d()]||D1.de||a1;return j(ds,{href:a1,title:w1,children:w1},a1)})}),!!x1?.length&&j("div",{children:[j("div",{className:"font-bold",children:[p("affected_lines"),":"]}),j("div",{className:"flex flex-wrap gap-1 text-sm",children:x1?.map(D1=>j("div",{className:"bg-red rounded-md px-[8px] py-[4px] font-bold text-white",children:D1},D1))})]}),!!C1?.length&&j("div",{children:[j("div",{className:"font-bold",children:[p("affected_stops"),":"]}),j("div",{className:"flex flex-wrap gap-1 text-sm",children:C1.map(D1=>j("div",{className:"bg-red rounded-md px-[8px] py-[4px] font-bold text-white",children:D1},D1))})]})]}),r&&j("hr",{className:"my-1"})]},t1)})})}var lL=et(Hd1);function Vd1(r,t){let{lang:e,notificationsLayer:i,previewNotifications:o}=Ct(),[n,l]=pt(),h=It(()=>i?.api,[i]);return G2(()=>{let d=o?.find(C=>C.id===r);if(d){l(d);return}let p=new AbortController;return h?.exportById(r,{contentLarge:!0,contentMedium:!0,contentSmall:!0,includeGeoms:!1,includeLines:!0,includeStops:!0,[e]:!0,limit:1,...t||{}}).then(C=>{l(C)}).catch(C=>{if(C.code!==20){l(void 0),console.error("Failed to fetch situation",C);return}}),()=>{p.abort()}},[h,r,t,e,o]),n}var uX=Vd1;function Gd1({className:r,feature:t,...e}){let{situationId:i}=t.getProperties(),o=uX(i);return j(Sn,{...e,className:oe("px-4 text-base",r),children:j(lL,{situation:o})})}var Fy=Gd1;var rF=(r,t)=>t?j("a",{className:"whitespace-normal underline",href:t,rel:"noreferrer",target:"_blank",children:r}):r;function jd1({stopSequence:r}){return!r.operator&&!r.publisher?null:j(Xe,{children:j("div",{className:"m-4 mb-0 flex flex-wrap text-[10px] text-gray-500",children:[r.operator&&rF(r.operator,r.operatorUrl),r.operator&&r.publisher&&j("span",{children:" - "}),r.publisher&&rF(r.publisher,r.publisherUrl),r.license&&j("span",{children:"\xA0("}),r.license&&rF(r.license,r.licenseUrl),r.license&&")"]})})}var iF=et(jd1);function qd1({...r}){return j("svg",{fill:"none",height:"24",part:"svg",viewBox:"0 0 14 14",width:"24",xmlns:"http://www.w3.org/2000/svg",...r,children:[j("path",{clipRule:"evenodd",d:"M7 0.333344C7.375 0.333344 7.66667 0.62501 7.66667 0.97921V2.35414C9.7292 2.66668 11.3333 4.27081 11.625 6.33334H13C13.375 6.33334 13.6667 6.62501 13.6667 7.00001C13.6667 7.37501 13.375 7.66668 13 7.66668H11.625C11.3333 9.70834 9.70833 11.3333 7.66667 11.625V13C7.66667 13.375 7.375 13.6667 7 13.6667C6.64587 13.6667 6.33333 13.375 6.33333 13V11.625C4.29167 11.3333 2.68747 9.70834 2.39587 7.66668H1C0.625 7.66668 0.333333 7.37501 0.333333 7.00001C0.333333 6.62501 0.625 6.33334 1 6.33334H2.39587C2.68747 4.27081 4.29167 2.66668 6.33333 2.35414V0.97921C6.33333 0.62501 6.64587 0.333344 7 0.333344ZM7 3.66668C5.16667 3.66668 3.66667 5.16668 3.66667 7.00001C3.66667 8.79168 5.08333 10.3125 7 10.3125C8.89587 10.3125 10.3333 8.81254 10.3333 7.00001C10.3333 5.16668 8.83333 3.66668 7 3.66668Z",fill:"currentColor",fillRule:"evenodd"}),j("path",{clipRule:"evenodd",d:"M5.66667 7.00001C5.66667 6.27081 6.2708 5.66668 7 5.66668C7.7292 5.66668 8.33333 6.27081 8.33333 7.00001C8.33333 7.72921 7.7292 8.33334 7 8.33334C6.2708 8.33334 5.66667 7.72921 5.66667 7.00001Z",fill:"currentColor",fillRule:"evenodd",part:"circle"})]})}var nF=qd1;function Kd1({stopSequence:r,...t}){let{destination:e}=r||{};return j("span",{...t,children:e})}var oF=et(Kd1);function Wd1({stopSequence:r,...t}){let{longName:e,routeIdentifier:i}=r||{},o=e;if(i){let n=i;i.includes(".")?[n]=i.split("."):i.includes("_")?[n]=i.split("_"):i.includes(":")&&([n]=i.split(":")),/^\d*$/.test(n)&&(n=`${parseInt(n,10)}`),e.includes(n)||(o=`${e} (${n})`)}return j("span",{...t,children:o})}var aF=et(Wd1);function $d1({stopSequence:r,...t}){return j("div",{...t,children:[j(oF,{className:"text-base font-bold",stopSequence:r}),j(aF,{className:"text-sm",stopSequence:r})]})}var sF=et($d1);function Xd1({stopSequence:r}){let{isFollowing:t,setIsFollowing:e}=Ct();return j("div",{className:"flex items-center gap-x-4 bg-slate-100 p-4 py-2",children:[j(n4,{stopSequence:r}),j(sF,{className:"flex grow flex-col",stopSequence:r}),j(p0,{className:`${t?"animate-pulse":""}`,onClick:()=>{e(!t)},selected:t,children:j(nF,{})})]})}var lF=et(Xd1);var Yd1=()=>It(()=>{let t=new URLSearchParams(window.location.search).get("debug");return!t||t==="false"?!1:t},[]),Py=Yd1;var cF=L8({index:null,invertColor:null,station:null,status:null,stop:null,stopSequence:null}),Jd1=()=>{let r=C6(cF);if(!r)throw new Error("useRouteStop must be used within a ContextProvider");return r},F9=Jd1;function tf1(r){let{status:t,stop:e}=F9();return Py()?j("div",{className:"p-4 text-left text-xs",...r,children:[j("div",{children:["State: ",j("b",{children:e.state})," (isPassed: ",`${t.isPassed}`,") (cancelled: ",`${e.cancelled}`,")"]}),j("div",{children:["Arrival time: ",e.arrivalTime," (delay: ",j("b",{children:`${e.arrivalDelay}`}),") (aimed: ",e.aimedArrivalTime,")"]}),j("div",{children:["Departure time: ",e.arrivalTime," (delay:"," ",j("b",{children:`${e.departureDelay}`}),") (aimed: ",e.aimedArrivalTime,")"]}),j("div",{children:Object.entries(t).map(([o,n])=>n===!1?null:j("div",{children:[o,": ",`${n}`]},o))})]}):null}var hX=tf1;var ef1=(r,t=!1)=>{let e=Math.round(r/1e3/60);return e>5?"#dc2626":e>=3?"#ea580c":t?"#16a34a":"transparent"},cL=ef1;var rf1=r=>{let t=r;t<0&&(t=0);let e=Math.floor(t/36e5),i=Math.round(t%36e5/6e4),o="";return e>0&&(o+=`${e}h`),i>0&&(o+=`${i}m`),o||"0"},uL=rf1;function if1(r){let{status:t,stop:e}=F9(),{arrivalDelay:i,departureDelay:o}=e,n=t.isNotRealtime||t.isCancelled||t.isNotStop||t.isPassed;return j("div",{...r,children:[n||i===null||t.isFirst?null:j("span",{style:{color:cL(i)},children:`+${uL(i)}`}),n||o===null||t.isLast?null:j("span",{style:{color:cL(i)},children:`+${uL(o)}`})]})}var uF=et(if1);function nf1({svgProps:r,...t}){let{invertColor:e,status:i,stopSequence:o}=F9(),{isBoarding:n,isFirst:l,isLast:h,isLeft:d,isPassed:p,progress:C}=i,M=l?"50%":"-100%",S=h?"50%":"100%",y=`${C}%`,O="rgb(156, 163, 175)",Q=_A(o),H=p?O:Q,G=p?Q:O,t1=O;e&&(H=p?Q:O,G=p?O:Q,t1=Q);let e1=!p&&(d||n)?G:H;return j("div",{...t,children:j("svg",{fill:"none",height:"100%",stroke:H,width:"16",xmlns:"http://www.w3.org/2000/svg",...r,children:[j("circle",{cx:"50%",cy:"50%",r:"5",stroke:"black",strokeWidth:"6"}),j("line",{stroke:"black",strokeWidth:"6",x1:"50%",x2:"50%",y1:M,y2:S}),j("line",{stroke:t1,strokeWidth:"4",x1:"50%",x2:"50%",y1:M,y2:y}),j("line",{strokeWidth:"4",x1:"50%",x2:"50%",y1:`${C-2}%`,y2:S}),j("circle",{cx:"50%",cy:"50%",r:"5",strokeWidth:"4"}),j("circle",{className:n?"animate-pulse":"",cx:"50%",cy:"50%",r:"5",stroke:e1,strokeWidth:"4"}),j("circle",{cx:"50%",cy:"50%",fill:"white",r:"3",stroke:"black",strokeWidth:"1"})]})})}var hF=et(nf1);function of1({...r}){let{stop:t,stopSequence:e}=F9(),{type:i}=e,{t:o}=er(),{platform:n}=t||{};if(!n)return null;let l=o(`platform_${i||"rail"}`);return j("span",{...r,children:[l||o("platform_rail")," ",n]})}var AF=et(of1);function af1({children:r,...t}){let{stop:e}=F9(),{stationName:i}=e||{};return j("div",{...t,children:[i,j("br",{}),j(AF,{className:"rounded-sm bg-slate-100 px-0.5 py-px text-xs group-hover:bg-slate-50"}),r]})}var dF=et(af1);function sf1({...r}){return j("svg",{fill:"currentColor",height:"24",version:"1.1",viewBox:"0 0 14 14",width:"24",xmlns:"http://www.w3.org/2000/svg",...r,children:j("path",{d:"m 14,8 0,1 -6,-1 0,3 2,2 0,1 L 7,13 4,14 4,13 6,11 6,8 0,9 0,8 6,5 6,2 C 6,1 6.22222,0 7,0 7.77777,0 8,1 8,2 l 0,3 z"})})}var fF=sf1;function lf1({...r}){return j("svg",{fill:"currentColor",height:"24px",version:"1.1",viewBox:"0 -3.84 122.88 122.88",width:"24px",xmlns:"http://www.w3.org/2000/svg",...r,children:j("path",{d:"M29.03,100.46l20.79-25.21l9.51,12.13L41,110.69C33.98,119.61,20.99,110.21,29.03,100.46L29.03,100.46z M53.31,43.05 c1.98-6.46,1.07-11.98-6.37-20.18L28.76,1c-2.58-3.03-8.66,1.42-6.12,5.09L37.18,24c2.75,3.34-2.36,7.76-5.2,4.32L16.94,9.8 c-2.8-3.21-8.59,1.03-5.66,4.7c4.24,5.1,10.8,13.43,15.04,18.53c2.94,2.99-1.53,7.42-4.43,3.69L6.96,18.32 c-2.19-2.38-5.77-0.9-6.72,1.88c-1.02,2.97,1.49,5.14,3.2,7.34L20.1,49.06c5.17,5.99,10.95,9.54,17.67,7.53 c1.03-0.31,2.29-0.94,3.64-1.77l44.76,57.78c2.41,3.11,7.06,3.44,10.08,0.93l0.69-0.57c3.4-2.83,3.95-8,1.04-11.34L50.58,47.16 C51.96,45.62,52.97,44.16,53.31,43.05L53.31,43.05z M65.98,55.65l7.37-8.94C63.87,23.21,99-8.11,116.03,6.29 C136.72,23.8,105.97,66,84.36,55.57l-8.73,11.09L65.98,55.65L65.98,55.65z"})})}var pF=lf1;function cf1({...r}){return j("svg",{fill:"currentColor",height:"24px",version:"1.1",viewBox:"0 0 512 512",width:"24px",xmlns:"http://www.w3.org/2000/svg",...r,children:[j("g",{children:j("g",{children:j("path",{d:`M256,0c-9.217,0-16.696,7.473-16.696,16.696v478.609c0,9.223,7.479,16.696,16.696,16.696
|
|
1284
|
+
`})})]})}var eF=Zd1;var Nd1="my-1 flex items-center leading-[1.1] underline text-base items-center justify-left font-semibold gap-1",Ud1={primary:{classes:"bg-red text-white disabled:bg-lightgrey hover:bg-darkred hover:border-darkred active:bg-lightred active:border-lightred ",selectedClasses:"bg-darkred border-darkred"},secondary:{classes:"bg-white text-black hover:text-red active:text-lightred",selectedClasses:"text-red"}};function Qd1({children:r,className:t,theme:e="secondary",...i}){let o=It(()=>oe(`${Nd1} ${Ud1[e].classes} ${t||""}`),[t,e]);return j("a",{className:o,rel:"noreferrer",target:"_blank",...i,children:[(!i.href?.includes(window.location.hostname)||!i.href?.startsWith("(https?|ftp)"))&&j(eF,{height:"20",width:"20"}),r]})}var ds=et(Qd1);var cX=(r,t,e,i=!0)=>{let o=r.toLocaleTimeString(["de"],{hour:"2-digit",minute:"2-digit"});return`${r.toLocaleDateString(["de"],{day:"2-digit",month:i?"short":"long",year:e?"numeric":void 0})}${t&&o?` ${o}`:""}`.replace(",","")};function Hd1({canToggle:r=!1,headerClassName:t,iconClassName:e,publicationClassName:i,reasonClassName:o,situation:n,timeIntervalClassName:l,useShortMonth:h=!0}){let{locale:d,t:p}=er(),[C,M]=pt(!r);if(!n)return null;let S={},y={},O=[],Q=[],H=[];return Q=(n?.publications||[])?.filter(({publicationWindows:t1})=>(!t1?.length&&n?.publicationWindows?.length&&(t1=n?.publicationWindows),t1.find(({endTime:e1,startTime:J})=>{let g1=new Date,b1=new Date(J),T1=new Date(e1);return b1<=g1&&g1<=T1})))||[],O=(n?.affectedTimeIntervals||[]).filter(({endTime:t1,startTime:e1})=>{let J=new Date,g1=new Date(e1),b1=new Date(t1);return g1<=J&&J<=b1||J<g1})||[],H=(n?.reasons||[]).map(({name:t1})=>t1),j(Xe,{children:Q?.map(({id:t1,publicationLines:e1,publicationStops:J,textualContentLarge:g1,textualContentMedium:b1,textualContentSmall:T1})=>{S=g1||b1||T1,y=S?.[d()],y?.summary||(y=S?.de);let x1=e1?.flatMap(D1=>D1.lines?.map(({name:a1})=>a1)||[])||[],C1=J.map(D1=>D1?.name||"");return j("div",{className:oe("text-base",i),children:[j("div",{className:oe("text-xs uppercase",o),children:H}),j("h3",{className:oe("space-x-2 text-xl leading-[1.3] font-bold text-balance",t),children:[j("span",{className:"inline-block align-middle",children:j(tF,{className:oe(e)})}),j("span",{className:"align-middle *:inline",dangerouslySetInnerHTML:{__html:y?.summary}})]}),j("hr",{className:"my-1"}),O?.map(({dailyEndTime:D1,dailyStartTime:a1,endTime:w1,startTime:Q1},j1)=>{let c2=D1&&a1,C2=w1.includes("2500"),Y1=cX(new Date(Q1),!1,!0,h),H1=C2?void 0:cX(new Date(w1),!1,!0,h);return j("button",{className:oe("flex w-full items-center",r&&"cursor-pointer"),onClick:()=>{M(!C)},tabIndex:r?0:-1,children:[j("div",{className:oe("flex-1 text-left text-sm font-bold text-balance",l),children:[j("span",{children:[Y1&&H1?`${Y1} \u2013 ${H1}`:null,Y1&&!H1?p("from",{from:Y1}):null]}),c2&&j("span",{children:` (${p("daily_from_to",{from:a1,to:D1})})`})]},Q1),r&&j1==0&&j(Xe,{children:C?j(sL,{className:"text-red"}):j(_c,{className:"text-red"})})]},Q1)}),j("div",{className:C?"my-4 flex flex-col gap-4":"hidden",children:[y?.description&&j("div",{dangerouslySetInnerHTML:{__html:y?.description}}),!!S?.images?.length&&j("div",{className:"flex flex-wrap gap-2",children:S.images.map(({image:{absoluteUrl:D1,label:a1}})=>j("img",{alt:a1,className:"h-fit",src:D1,title:a1},D1+a1))}),!!S?.infoLinks?.length&&j("div",{children:S.infoLinks.map(({label:D1,uri:a1})=>{let w1=D1[d()]||D1.de||a1;return j(ds,{href:a1,title:w1,children:w1},a1)})}),!!x1?.length&&j("div",{children:[j("div",{className:"font-bold",children:[p("affected_lines"),":"]}),j("div",{className:"flex flex-wrap gap-1 text-sm",children:x1?.map(D1=>j("div",{className:"bg-red rounded-sm px-[2px] py-[0px] font-semibold text-white",children:D1},D1))})]}),!!C1?.length&&j("div",{children:[j("div",{className:"font-bold",children:[p("affected_stops"),":"]}),j("div",{className:"flex flex-wrap gap-1 text-sm",children:C1.map(D1=>j("div",{className:"bg-red rounded-sm px-[2px] py-[0px] font-semibold text-white",children:D1},D1))})]})]}),r&&j("hr",{className:"my-1"})]},t1)})})}var lL=et(Hd1);function Vd1(r,t){let{lang:e,notificationsLayer:i,previewNotifications:o}=Ct(),[n,l]=pt(),h=It(()=>i?.api,[i]);return G2(()=>{let d=o?.find(C=>C.id===r);if(d){l(d);return}let p=new AbortController;return h?.exportById(r,{contentLarge:!0,contentMedium:!0,contentSmall:!0,includeGeoms:!1,includeLines:!0,includeStops:!0,[e]:!0,limit:1,...t||{}}).then(C=>{l(C)}).catch(C=>{if(C.code!==20){l(void 0),console.error("Failed to fetch situation",C);return}}),()=>{p.abort()}},[h,r,t,e,o]),n}var uX=Vd1;function Gd1({className:r,feature:t,...e}){let{situationId:i}=t.getProperties(),o=uX(i);return console.log("situationParsed",t.getProperties()),j(Sn,{...e,className:oe("px-4 text-base",r),children:j(lL,{situation:o})})}var Fy=Gd1;var rF=(r,t)=>t?j("a",{className:"whitespace-normal underline",href:t,rel:"noreferrer",target:"_blank",children:r}):r;function jd1({stopSequence:r}){return!r.operator&&!r.publisher?null:j(Xe,{children:j("div",{className:"m-4 mb-0 flex flex-wrap text-[10px] text-gray-500",children:[r.operator&&rF(r.operator,r.operatorUrl),r.operator&&r.publisher&&j("span",{children:" - "}),r.publisher&&rF(r.publisher,r.publisherUrl),r.license&&j("span",{children:"\xA0("}),r.license&&rF(r.license,r.licenseUrl),r.license&&")"]})})}var iF=et(jd1);function qd1({...r}){return j("svg",{fill:"none",height:"24",part:"svg",viewBox:"0 0 14 14",width:"24",xmlns:"http://www.w3.org/2000/svg",...r,children:[j("path",{clipRule:"evenodd",d:"M7 0.333344C7.375 0.333344 7.66667 0.62501 7.66667 0.97921V2.35414C9.7292 2.66668 11.3333 4.27081 11.625 6.33334H13C13.375 6.33334 13.6667 6.62501 13.6667 7.00001C13.6667 7.37501 13.375 7.66668 13 7.66668H11.625C11.3333 9.70834 9.70833 11.3333 7.66667 11.625V13C7.66667 13.375 7.375 13.6667 7 13.6667C6.64587 13.6667 6.33333 13.375 6.33333 13V11.625C4.29167 11.3333 2.68747 9.70834 2.39587 7.66668H1C0.625 7.66668 0.333333 7.37501 0.333333 7.00001C0.333333 6.62501 0.625 6.33334 1 6.33334H2.39587C2.68747 4.27081 4.29167 2.66668 6.33333 2.35414V0.97921C6.33333 0.62501 6.64587 0.333344 7 0.333344ZM7 3.66668C5.16667 3.66668 3.66667 5.16668 3.66667 7.00001C3.66667 8.79168 5.08333 10.3125 7 10.3125C8.89587 10.3125 10.3333 8.81254 10.3333 7.00001C10.3333 5.16668 8.83333 3.66668 7 3.66668Z",fill:"currentColor",fillRule:"evenodd"}),j("path",{clipRule:"evenodd",d:"M5.66667 7.00001C5.66667 6.27081 6.2708 5.66668 7 5.66668C7.7292 5.66668 8.33333 6.27081 8.33333 7.00001C8.33333 7.72921 7.7292 8.33334 7 8.33334C6.2708 8.33334 5.66667 7.72921 5.66667 7.00001Z",fill:"currentColor",fillRule:"evenodd",part:"circle"})]})}var nF=qd1;function Kd1({stopSequence:r,...t}){let{destination:e}=r||{};return j("span",{...t,children:e})}var oF=et(Kd1);function Wd1({stopSequence:r,...t}){let{longName:e,routeIdentifier:i}=r||{},o=e;if(i){let n=i;i.includes(".")?[n]=i.split("."):i.includes("_")?[n]=i.split("_"):i.includes(":")&&([n]=i.split(":")),/^\d*$/.test(n)&&(n=`${parseInt(n,10)}`),e.includes(n)||(o=`${e} (${n})`)}return j("span",{...t,children:o})}var aF=et(Wd1);function $d1({stopSequence:r,...t}){return j("div",{...t,children:[j(oF,{className:"text-base font-bold",stopSequence:r}),j(aF,{className:"text-sm",stopSequence:r})]})}var sF=et($d1);function Xd1({stopSequence:r}){let{isFollowing:t,setIsFollowing:e}=Ct();return j("div",{className:"flex items-center gap-x-4 bg-slate-100 p-4 py-2",children:[j(n4,{stopSequence:r}),j(sF,{className:"flex grow flex-col",stopSequence:r}),j(p0,{className:`${t?"animate-pulse":""}`,onClick:()=>{e(!t)},selected:t,children:j(nF,{})})]})}var lF=et(Xd1);var Yd1=()=>It(()=>{let t=new URLSearchParams(window.location.search).get("debug");return!t||t==="false"?!1:t},[]),Py=Yd1;var cF=L8({index:null,invertColor:null,station:null,status:null,stop:null,stopSequence:null}),Jd1=()=>{let r=C6(cF);if(!r)throw new Error("useRouteStop must be used within a ContextProvider");return r},F9=Jd1;function tf1(r){let{status:t,stop:e}=F9();return Py()?j("div",{className:"p-4 text-left text-xs",...r,children:[j("div",{children:["State: ",j("b",{children:e.state})," (isPassed: ",`${t.isPassed}`,") (cancelled: ",`${e.cancelled}`,")"]}),j("div",{children:["Arrival time: ",e.arrivalTime," (delay: ",j("b",{children:`${e.arrivalDelay}`}),") (aimed: ",e.aimedArrivalTime,")"]}),j("div",{children:["Departure time: ",e.arrivalTime," (delay:"," ",j("b",{children:`${e.departureDelay}`}),") (aimed: ",e.aimedArrivalTime,")"]}),j("div",{children:Object.entries(t).map(([o,n])=>n===!1?null:j("div",{children:[o,": ",`${n}`]},o))})]}):null}var hX=tf1;var ef1=(r,t=!1)=>{let e=Math.round(r/1e3/60);return e>5?"#dc2626":e>=3?"#ea580c":t?"#16a34a":"transparent"},cL=ef1;var rf1=r=>{let t=r;t<0&&(t=0);let e=Math.floor(t/36e5),i=Math.round(t%36e5/6e4),o="";return e>0&&(o+=`${e}h`),i>0&&(o+=`${i}m`),o||"0"},uL=rf1;function if1(r){let{status:t,stop:e}=F9(),{arrivalDelay:i,departureDelay:o}=e,n=t.isNotRealtime||t.isCancelled||t.isNotStop||t.isPassed;return j("div",{...r,children:[n||i===null||t.isFirst?null:j("span",{style:{color:cL(i)},children:`+${uL(i)}`}),n||o===null||t.isLast?null:j("span",{style:{color:cL(i)},children:`+${uL(o)}`})]})}var uF=et(if1);function nf1({svgProps:r,...t}){let{invertColor:e,status:i,stopSequence:o}=F9(),{isBoarding:n,isFirst:l,isLast:h,isLeft:d,isPassed:p,progress:C}=i,M=l?"50%":"-100%",S=h?"50%":"100%",y=`${C}%`,O="rgb(156, 163, 175)",Q=_A(o),H=p?O:Q,G=p?Q:O,t1=O;e&&(H=p?Q:O,G=p?O:Q,t1=Q);let e1=!p&&(d||n)?G:H;return j("div",{...t,children:j("svg",{fill:"none",height:"100%",stroke:H,width:"16",xmlns:"http://www.w3.org/2000/svg",...r,children:[j("circle",{cx:"50%",cy:"50%",r:"5",stroke:"black",strokeWidth:"6"}),j("line",{stroke:"black",strokeWidth:"6",x1:"50%",x2:"50%",y1:M,y2:S}),j("line",{stroke:t1,strokeWidth:"4",x1:"50%",x2:"50%",y1:M,y2:y}),j("line",{strokeWidth:"4",x1:"50%",x2:"50%",y1:`${C-2}%`,y2:S}),j("circle",{cx:"50%",cy:"50%",r:"5",strokeWidth:"4"}),j("circle",{className:n?"animate-pulse":"",cx:"50%",cy:"50%",r:"5",stroke:e1,strokeWidth:"4"}),j("circle",{cx:"50%",cy:"50%",fill:"white",r:"3",stroke:"black",strokeWidth:"1"})]})})}var hF=et(nf1);function of1({...r}){let{stop:t,stopSequence:e}=F9(),{type:i}=e,{t:o}=er(),{platform:n}=t||{};if(!n)return null;let l=o(`platform_${i||"rail"}`);return j("span",{...r,children:[l||o("platform_rail")," ",n]})}var AF=et(of1);function af1({children:r,...t}){let{stop:e}=F9(),{stationName:i}=e||{};return j("div",{...t,children:[i,j("br",{}),j(AF,{className:"rounded-sm bg-slate-100 px-0.5 py-px text-xs group-hover:bg-slate-50"}),r]})}var dF=et(af1);function sf1({...r}){return j("svg",{fill:"currentColor",height:"24",version:"1.1",viewBox:"0 0 14 14",width:"24",xmlns:"http://www.w3.org/2000/svg",...r,children:j("path",{d:"m 14,8 0,1 -6,-1 0,3 2,2 0,1 L 7,13 4,14 4,13 6,11 6,8 0,9 0,8 6,5 6,2 C 6,1 6.22222,0 7,0 7.77777,0 8,1 8,2 l 0,3 z"})})}var fF=sf1;function lf1({...r}){return j("svg",{fill:"currentColor",height:"24px",version:"1.1",viewBox:"0 -3.84 122.88 122.88",width:"24px",xmlns:"http://www.w3.org/2000/svg",...r,children:j("path",{d:"M29.03,100.46l20.79-25.21l9.51,12.13L41,110.69C33.98,119.61,20.99,110.21,29.03,100.46L29.03,100.46z M53.31,43.05 c1.98-6.46,1.07-11.98-6.37-20.18L28.76,1c-2.58-3.03-8.66,1.42-6.12,5.09L37.18,24c2.75,3.34-2.36,7.76-5.2,4.32L16.94,9.8 c-2.8-3.21-8.59,1.03-5.66,4.7c4.24,5.1,10.8,13.43,15.04,18.53c2.94,2.99-1.53,7.42-4.43,3.69L6.96,18.32 c-2.19-2.38-5.77-0.9-6.72,1.88c-1.02,2.97,1.49,5.14,3.2,7.34L20.1,49.06c5.17,5.99,10.95,9.54,17.67,7.53 c1.03-0.31,2.29-0.94,3.64-1.77l44.76,57.78c2.41,3.11,7.06,3.44,10.08,0.93l0.69-0.57c3.4-2.83,3.95-8,1.04-11.34L50.58,47.16 C51.96,45.62,52.97,44.16,53.31,43.05L53.31,43.05z M65.98,55.65l7.37-8.94C63.87,23.21,99-8.11,116.03,6.29 C136.72,23.8,105.97,66,84.36,55.57l-8.73,11.09L65.98,55.65L65.98,55.65z"})})}var pF=lf1;function cf1({...r}){return j("svg",{fill:"currentColor",height:"24px",version:"1.1",viewBox:"0 0 512 512",width:"24px",xmlns:"http://www.w3.org/2000/svg",...r,children:[j("g",{children:j("g",{children:j("path",{d:`M256,0c-9.217,0-16.696,7.473-16.696,16.696v478.609c0,9.223,7.479,16.696,16.696,16.696
|
|
1285
1285
|
c9.217,0,16.696-7.473,16.696-16.696V16.696C272.696,7.473,265.217,0,256,0z`})})}),j("g",{children:j("g",{children:j("path",{d:`M105.739,44.522c-36.826,0-66.783,29.956-66.783,66.783c0,36.826,29.956,66.783,66.783,66.783
|
|
1286
1286
|
s66.783-29.956,66.783-66.783C172.522,74.478,142.565,44.522,105.739,44.522z`})})}),j("g",{children:j("g",{children:j("path",{d:`M406.261,44.522c-36.826,0-66.783,29.956-66.783,66.783c0,36.826,29.956,66.783,66.783,66.783
|
|
1287
1287
|
s66.783-29.956,66.783-66.783C473.043,74.478,443.087,44.522,406.261,44.522z`})})}),j("g",{children:j("g",{children:j("path",{d:`M202.935,218.664c-3.109-4.501-8.239-7.186-13.717-7.186H22.261c-5.478,0-10.608,2.685-13.717,7.185
|
|
@@ -2531,6 +2531,9 @@ where:
|
|
|
2531
2531
|
.px-4 {
|
|
2532
2532
|
padding-inline: calc(var(--spacing) * 4);
|
|
2533
2533
|
}
|
|
2534
|
+
.px-\\[2px\\] {
|
|
2535
|
+
padding-inline: 2px;
|
|
2536
|
+
}
|
|
2534
2537
|
.px-\\[4px\\] {
|
|
2535
2538
|
padding-inline: 4px;
|
|
2536
2539
|
}
|
|
@@ -2555,6 +2558,9 @@ where:
|
|
|
2555
2558
|
.py-4 {
|
|
2556
2559
|
padding-block: calc(var(--spacing) * 4);
|
|
2557
2560
|
}
|
|
2561
|
+
.py-\\[0px\\] {
|
|
2562
|
+
padding-block: 0px;
|
|
2563
|
+
}
|
|
2558
2564
|
.py-\\[2px\\] {
|
|
2559
2565
|
padding-block: 2px;
|
|
2560
2566
|
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@geops/rvf-mobility-web-component",
|
|
3
3
|
"license": "UNLICENSED",
|
|
4
4
|
"description": "Web components for rvf in the domains of mobility and logistics.",
|
|
5
|
-
"version": "0.1.
|
|
5
|
+
"version": "0.1.89",
|
|
6
6
|
"homepage": "https://rvf-mobility-web-component-geops.vercel.app/",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "index.js",
|
|
@@ -22,7 +22,7 @@ function NotificationDetails({
|
|
|
22
22
|
}) {
|
|
23
23
|
const { situationId } = feature.getProperties();
|
|
24
24
|
const situationParsed = useMocoSituation(situationId);
|
|
25
|
-
|
|
25
|
+
console.log("situationParsed", feature.getProperties());
|
|
26
26
|
return (
|
|
27
27
|
<ShadowOverflow {...props} className={twMerge("px-4 text-base", className)}>
|
|
28
28
|
<SituationDetails situation={situationParsed} />
|
|
@@ -293,7 +293,7 @@ function SituationDetails({
|
|
|
293
293
|
// px-[8px] py-[4px] are important for bermekt
|
|
294
294
|
<div
|
|
295
295
|
className={
|
|
296
|
-
"bg-red rounded-
|
|
296
|
+
"bg-red rounded-sm px-[2px] py-[0px] font-semibold text-white"
|
|
297
297
|
}
|
|
298
298
|
key={name}
|
|
299
299
|
>
|
|
@@ -314,7 +314,7 @@ function SituationDetails({
|
|
|
314
314
|
<div
|
|
315
315
|
// px-[8px] py-[4px] are important for bermekt
|
|
316
316
|
className={
|
|
317
|
-
"bg-red rounded-
|
|
317
|
+
"bg-red rounded-sm px-[2px] py-[0px] font-semibold text-white"
|
|
318
318
|
}
|
|
319
319
|
key={name}
|
|
320
320
|
>
|