Skip to content

Commit

Permalink
Merge branch 'master' into callback-disable-all-submodes
Browse files Browse the repository at this point in the history
  • Loading branch information
josh-willis-arcadis committed Oct 7, 2024
2 parents 4791982 + a80bdd3 commit 0644f49
Show file tree
Hide file tree
Showing 37 changed files with 4,668 additions and 1,018 deletions.
2 changes: 1 addition & 1 deletion .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module.exports = {

stories: [
"../packages/**/*.story.mdx",
"../packages/**/*.story.@(js|jsx|ts|tsx)"
"../packages/*/src/**/*.story.@(js|jsx|ts|tsx)"
],
staticDirs: ['../public'],

Expand Down
33 changes: 18 additions & 15 deletions .storybook/react-intl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,25 @@ const messages = {};

// Populate messages if not running snapshots.
// (Message printouts would be unnecessary replicated in snapshots without that check.)
packages.forEach((pkg) => {
locales.forEach((locale) => {
// Chinese-simplified is assigned a special file name by Weblate.
const localeFile = locale === "zh" ? "zh_Hans" : locale;
try {
messages[locale] = {
...messages[locale],
...flatten(require(`../packages/${pkg}/i18n/${localeFile}.yml`).default)
};
} catch (e) {
// There is no yml files for the "unknown" locale,
// so it should fail, and we won't display an error message in that case.
if (locale !== "unknown") console.error(e);
}
if (typeof window !== "undefined") {

packages.forEach((pkg) => {
locales.forEach((locale) => {
// Chinese-simplified is assigned a special file name by Weblate.
const localeFile = locale === "zh" ? "zh_Hans" : locale;
try {
messages[locale] = {
...messages[locale],
...flatten(require(`../packages/${pkg}/i18n/${localeFile}.yml`).default)
};
} catch (e) {
// There is no yml files for the "unknown" locale,
// so it should fail, and we won't display an error message in that case.
if (locale !== "unknown") console.error(e);
}
});
});
});
}

// TODO: place any applicable (date, time, etc) format parameters here.
const formats = {};
Expand Down
2 changes: 1 addition & 1 deletion packages/base-map/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"mapbox-gl": "npm:[email protected]",
"maplibre-gl": "^2.1.9",
"react-map-gl": "^7.0.15",
"@opentripplanner/building-blocks": "^1.2.2"
"@opentripplanner/building-blocks": "^2.0.0"
},
"peerDependencies": {
"react": "^18.2.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/building-blocks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"private": false,
"devDependencies": {
"@opentripplanner/types": "^6.5.2",
"@opentripplanner/core-utils": "^11.4.4"
"@opentripplanner/core-utils": "^12.0.0"
},
"peerDependencies": {
"react": "^18.2.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/endpoints-overlay/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
"url": "https://github.com/opentripplanner/otp-ui/issues"
},
"dependencies": {
"@opentripplanner/base-map": "^3.2.2",
"@opentripplanner/base-map": "^4.0.0",
"@opentripplanner/location-icon": "^1.4.1",
"@opentripplanner/core-utils": "^11.4.4",
"@opentripplanner/core-utils": "^12.0.0",
"flat": "^5.0.2",
"@styled-icons/fa-solid": "^10.34.0",
"@opentripplanner/building-blocks": "^1.2.2"
"@opentripplanner/building-blocks": "^2.0.0"
},
"devDependencies": {
"@opentripplanner/types": "^6.5.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/icons/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"license": "MIT",
"private": false,
"dependencies": {
"@opentripplanner/core-utils": "^11.4.4",
"@opentripplanner/core-utils": "^12.0.0",
"prop-types": "^15.7.2"
},
"peerDependencies": {
Expand Down
1 change: 1 addition & 0 deletions packages/itinerary-body/i18n/en-US.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ otpUi:
carHail: Ride
escooter: Ride
walk: Walk
transfer: Transfer{duration, select, undefined {} other {, wait {duration}}}
unnamedPath: Unnamed Path
unnamedRoad: Unnamed Road
vehicleTitle: "{company} {vehicleType}"
Expand Down
3 changes: 3 additions & 0 deletions packages/itinerary-body/i18n/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ otpUi:
carHail: Course en voiture
escooter: Trottinette
walk: Marche
transfer: >-
Correspondance{duration, select, undefined {} other {, attente
{duration}}}
unnamedPath: Chemin sans nom
unnamedRoad: Route sans nom
vehicleTitle: "{vehicleType} {company}"
Expand Down
6 changes: 3 additions & 3 deletions packages/itinerary-body/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@opentripplanner/itinerary-body",
"version": "6.0.0",
"version": "6.0.1",
"description": "A component for displaying an itinerary body of a trip planning result",
"main": "lib/index.js",
"module": "esm/index.js",
Expand All @@ -10,9 +10,9 @@
"license": "MIT",
"private": false,
"dependencies": {
"@opentripplanner/core-utils": "^11.4.4",
"@opentripplanner/core-utils": "^12.0.0",
"@opentripplanner/humanize-distance": "^1.2.0",
"@opentripplanner/icons": "^2.0.12",
"@opentripplanner/icons": "^3.0.0",
"@opentripplanner/location-icon": "^1.4.1",
"@styled-icons/fa-solid": "^10.34.0",
"@styled-icons/foundation": "^10.34.0",
Expand Down
112 changes: 58 additions & 54 deletions packages/itinerary-body/src/AccessLegBody/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,63 +125,67 @@ class AccessLegBody extends Component<Props, State> {
onSummaryClick={this.onSummaryClick}
showLegIcon={showLegIcon}
/>
<S.LegDetails>
{hideDrivingDirections ? (
<S.StepsHeaderAndMapLink>
<S.StepsHeaderSpan>
<Duration seconds={leg.duration} />
</S.StepsHeaderSpan>
{mapillary}
</S.StepsHeaderAndMapLink>
) : (
<>
{leg.distance !== 0 && (
<S.LegDetails>
{hideDrivingDirections ? (
<S.StepsHeaderAndMapLink>
<S.StepsHeaderButton
aria-expanded={expanded}
onClick={this.onStepsHeaderClick}
>
<Duration
seconds={leg.duration}
showApproximatePrefix={
showApproximateTravelTime && !isTransit(leg.mode)
}
/>
{leg.steps && leg.steps.length > 0 && (
<S.CaretToggle expanded={expanded} />
)}

<S.InvisibleAdditionalDetails>
<FormattedMessage
defaultMessage={
defaultMessages["otpUi.TransitLegBody.expandDetails"]
}
description="Screen reader text added to expand steps"
id="otpUi.TransitLegBody.expandDetails"
/>
</S.InvisibleAdditionalDetails>
</S.StepsHeaderButton>
<S.StepsHeaderSpan>
<Duration seconds={leg.duration} />
</S.StepsHeaderSpan>
{mapillary}
</S.StepsHeaderAndMapLink>
<AnimateHeight
duration={500}
height={expanded ? "auto" : 0}
style={{ gridColumn: "1 / span 2" }}
>
<AccessLegSteps
mapillaryCallback={mapillaryCallback}
mapillaryKey={mapillaryKey}
steps={leg.steps}
/>
</AnimateHeight>
</>
)}
<LegDiagramPreview
diagramVisible={diagramVisible}
leg={leg}
setLegDiagram={setLegDiagram}
showElevationProfile={showElevationProfile}
/>
</S.LegDetails>
) : (
<>
<S.StepsHeaderAndMapLink>
<S.StepsHeaderButton
aria-expanded={expanded}
onClick={this.onStepsHeaderClick}
>
<Duration
seconds={leg.duration}
showApproximatePrefix={
showApproximateTravelTime && !isTransit(leg.mode)
}
/>
{leg.steps && leg.steps.length > 0 && (
<S.CaretToggle expanded={expanded} />
)}

<S.InvisibleAdditionalDetails>
<FormattedMessage
defaultMessage={
defaultMessages[
"otpUi.TransitLegBody.expandDetails"
]
}
description="Screen reader text added to expand steps"
id="otpUi.TransitLegBody.expandDetails"
/>
</S.InvisibleAdditionalDetails>
</S.StepsHeaderButton>
{mapillary}
</S.StepsHeaderAndMapLink>
<AnimateHeight
duration={500}
height={expanded ? "auto" : 0}
style={{ gridColumn: "1 / span 2" }}
>
<AccessLegSteps
mapillaryCallback={mapillaryCallback}
mapillaryKey={mapillaryKey}
steps={leg.steps}
/>
</AnimateHeight>
</>
)}
<LegDiagramPreview
diagramVisible={diagramVisible}
leg={leg}
setLegDiagram={setLegDiagram}
showElevationProfile={showElevationProfile}
/>
</S.LegDetails>
)}
</S.LegBody>
</>
);
Expand Down
Loading

0 comments on commit 0644f49

Please sign in to comment.