Skip to content

Commit

Permalink
Make prettier handle closing tags better
Browse files Browse the repository at this point in the history
  • Loading branch information
dabreegster committed Jul 14, 2023
1 parent 15df8d7 commit f44a5bd
Show file tree
Hide file tree
Showing 22 changed files with 215 additions and 102 deletions.
3 changes: 2 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"importOrderTypeScriptVersion": "5.0.0"
"importOrderTypeScriptVersion": "5.0.0",
"htmlWhitespaceSensitivity": "ignore"
}
38 changes: 30 additions & 8 deletions src/lib/Legend.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,39 @@
<CollapsibleCard label="Objects" open>
<ul>
{#if schema == "planning"}
<li><span style:background={colors.preapp} />Preapp</li>
<li><span style:background={colors.outline} />Outline</li>
<li>
<span style:background={colors["reserved matters"]} />Reserved matters
<span style:background={colors.preapp} />
Preapp
</li>
<li>
<span style:background={colors.outline} />
Outline
</li>
<li>
<span style:background={colors["reserved matters"]} />
Reserved matters
</li>
<li>
<span style:background={colors["local plan"]} />
Local plan
</li>
<li><span style:background={colors["local plan"]} />Local plan</li>
{:else}
<li><span style:background={colors.area} />Areas</li>
<li><span style:background={colors.route} />Routes</li>
<li><span style:background={colors.crossing} />Crossings</li>
<li><span style:background={colors.other} />Other</li>
<li>
<span style:background={colors.area} />
Areas
</li>
<li>
<span style:background={colors.route} />
Routes
</li>
<li>
<span style:background={colors.crossing} />
Crossings
</li>
<li>
<span style:background={colors.other} />
Other
</li>
{/if}
</ul>
</CollapsibleCard>
Expand Down
6 changes: 3 additions & 3 deletions src/lib/common/ConfirmationModal.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
<p>{message}</p>
<div class="govuk-button-group">
<WarningButton on:click={onClickConfirm}>{confirmButtonText}</WarningButton>
<SecondaryButton on:click={onClickCancel}
>{cancelButtonText}</SecondaryButton
>
<SecondaryButton on:click={onClickCancel}>
{cancelButtonText}
</SecondaryButton>
</div>
</Modal>
4 changes: 3 additions & 1 deletion src/lib/common/Layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@
<button
type="button"
class="sidebar-toggle rounded-rect"
on:click={toggleSidebar}>&rarr;</button
on:click={toggleSidebar}
>
&rarr;
</button>
</aside>
<main>
<slot name="main" />
Expand Down
4 changes: 3 additions & 1 deletion src/lib/draw/SelectToolButton.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@
type="button"
on:click={() => changeMode(thisMode)}
disabled={$currentMode == thisMode}
><img src={icon} alt={label} /> {label}</button
>
<img src={icon} alt={label} />
{label}
</button>

<style>
button {
Expand Down
8 changes: 6 additions & 2 deletions src/lib/draw/StreetViewMode.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,13 @@
<CollapsibleCard label="Help">
<ul>
<li>
<b>Click</b> on the map to open a new tab with a 3rd-party imagery provider
<b>Click</b>
on the map to open a new tab with a 3rd-party imagery provider
</li>
<li>
Press <b>Escape</b>
to exit this mode
</li>
<li>Press <b>Escape</b> to exit this mode</li>
</ul>
</CollapsibleCard>
{/if}
5 changes: 4 additions & 1 deletion src/lib/draw/point/PointControls.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
{:else}
<li>Click to add a new point</li>
{/if}
<li>Press <b>Escape</b> to cancel</li>
<li>
Press <b>Escape</b>
to cancel
</li>
</ul>
</CollapsibleCard>

Expand Down
32 changes: 25 additions & 7 deletions src/lib/draw/polygon/PolygonControls.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,34 @@

<CollapsibleCard label="Help">
<ul>
<li><b>Click</b> the map to add a vertex</li>
<li><b>Click</b> a vertex to delete it</li>
<li><b>Drag</b> a vertex or the polygon to move it</li>
<li>Press <b>Enter</b> or <b>double click</b> to finish</li>
<li>Press <b>Escape</b> to cancel</li>
<li>
<b>Click</b>
the map to add a vertex
</li>
<li>
<b>Click</b>
a vertex to delete it
</li>
<li>
<b>Drag</b>
a vertex or the polygon to move it
</li>
<li>
Press <b>Enter</b>
or
<b>double click</b>
to finish
</li>
<li>
Press <b>Escape</b>
to cancel
</li>
</ul>
</CollapsibleCard>

<div style="display: flex; justify-content: space-between">
<DefaultButton on:click={() => polygonTool.finish()}>Finish</DefaultButton>
<SecondaryButton on:click={() => polygonTool.cancel()}>Cancel</SecondaryButton
>
<SecondaryButton on:click={() => polygonTool.cancel()}>
Cancel
</SecondaryButton>
</div>
30 changes: 24 additions & 6 deletions src/lib/draw/route/RouteControls.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,31 @@
<CollapsibleCard label="Help">
<ul>
<li>
<b>Click</b> green points on the transport network to create snapped routes
<b>Click</b>
green points on the transport network to create snapped routes
</li>
<li>
Hold <b>Shift</b>
to draw a point anywhere
</li>
<li>
<b>Click and drag</b>
any point to move it
</li>
<li>
<b>Click</b>
a red waypoint to delete it
</li>
<li>
Press <b>Enter</b>
or
<b>double click</b>
to finish
</li>
<li>
Press <b>Escape</b>
to cancel
</li>
<li>Hold <b>Shift</b> to draw a point anywhere</li>
<li><b>Click and drag</b> any point to move it</li>
<li><b>Click</b> a red waypoint to delete it</li>
<li>Press <b>Enter</b> or <b>double click</b> to finish</li>
<li>Press <b>Escape</b> to cancel</li>
</ul>
</CollapsibleCard>

Expand Down
12 changes: 10 additions & 2 deletions src/lib/draw/route/SplitRouteMode.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,16 @@
{#if $currentMode == thisMode}
<CollapsibleCard label="Help">
<ul>
<li><b>Click</b> on a route to split it</li>
<li><b>Click</b> on the map or press <b>Escape</b> to cancel</li>
<li>
<b>Click</b>
on a route to split it
</li>
<li>
<b>Click</b>
on the map or press
<b>Escape</b>
to cancel
</li>
</ul>
</CollapsibleCard>
{/if}
25 changes: 20 additions & 5 deletions src/lib/draw/snap_polygon/SnapPolygonControls.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,27 @@
<CollapsibleCard label="Help">
<ul>
<li>
<b>Click</b> green points on the transport network to create snapped routes
<b>Click</b>
green points on the transport network to create snapped routes
</li>
<li>
<b>Click and drag</b>
any point to move it
</li>
<li>
<b>Click</b>
a red waypoint to delete it
</li>
<li>
Press <b>Enter</b>
or
<b>double click</b>
to finish
</li>
<li>
Press <b>Escape</b>
to cancel
</li>
<li><b>Click and drag</b> any point to move it</li>
<li><b>Click</b> a red waypoint to delete it</li>
<li>Press <b>Enter</b> or <b>double click</b> to finish</li>
<li>Press <b>Escape</b> to cancel</li>
</ul>
</CollapsibleCard>

Expand Down
3 changes: 2 additions & 1 deletion src/lib/forms/AutogenerateForm.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@
on:change={otherOneOf}
value={x.name}
/>
{x.name}<br />
{x.name}
<br />
</label>

{#if oneOfCase == x.name && typeof value == "object"}
Expand Down
6 changes: 3 additions & 3 deletions src/lib/forms/FormV1.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
<input type="text" class="govuk-input" bind:value={name} />
<!-- Only LineStrings can be auto-named, and length_meters being set is the simplest proxy for that -->
{#if length_meters}
<SecondaryButton on:click={() => autoFillName()} disabled={!$routeInfo}
>Auto-fill</SecondaryButton
>
<SecondaryButton on:click={() => autoFillName()} disabled={!$routeInfo}>
Auto-fill
</SecondaryButton>
{/if}
</FormElement>

Expand Down
6 changes: 3 additions & 3 deletions src/lib/govuk/Checkbox.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<div class="govuk-checkboxes__item">
<input type="checkbox" class="govuk-checkboxes__input" {id} bind:checked />
<label class="govuk-label govuk-checkboxes__label" for={id} title={hint}
>{label}</label
>
<label class="govuk-label govuk-checkboxes__label" for={id} title={hint}>
{label}
</label>
</div>
57 changes: 32 additions & 25 deletions src/lib/sidebar/About.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,27 @@
<div class="govuk-prose">
<p>
ATIP v2 is an
<ExternalLink href="https://github.com/acteng/atip"
>open source project</ExternalLink
> supported by Active Travel England and developed by:
<ExternalLink href="https://github.com/acteng/atip">
open source project
</ExternalLink> supported by Active Travel England and developed by:
</p>

<ul>
<li>
<ExternalLink
href="https://www.turing.ac.uk/people/researchers/dustin-carlino"
>Dustin Carlino</ExternalLink
>: lead developer, from The Alan Turing Institute
>
Dustin Carlino
</ExternalLink>: lead developer, from The Alan Turing Institute
</li>
<li>
With UX help from
<ExternalLink href="https://www.linkedin.com/in/madison-wang-841977bb/"
>Madison Wang</ExternalLink
> and CSS help from
<ExternalLink href="https://github.com/BudgieInWA"
>Ben Ritter</ExternalLink
>
<ExternalLink href="https://www.linkedin.com/in/madison-wang-841977bb/">
Madison Wang
</ExternalLink> and CSS help from
<ExternalLink href="https://github.com/BudgieInWA">
Ben Ritter
</ExternalLink>
</li>
<li>
With great thanks to ATIP's various users for feedback, testing, and
Expand All @@ -38,39 +39,45 @@

<p>
ATIP builds on
<ExternalLink href="https://www.openstreetmap.org/about"
>OpenStreetMap</ExternalLink
>
<ExternalLink href="https://www.openstreetmap.org/about">
OpenStreetMap
</ExternalLink>
contributors,
<ExternalLink href="https://maplibre.org/">MapLibre</ExternalLink>,
<ExternalLink href="https://georust.org/">GeoRust</ExternalLink>,
<ExternalLink href="https://github.com/a-b-street/osm2streets"
>osm2streets</ExternalLink
>,
<ExternalLink href="https://material.io/resources/icons/"
>Material icons</ExternalLink
>, and other open source projects.
<ExternalLink href="https://github.com/a-b-street/osm2streets">
osm2streets
</ExternalLink>,
<ExternalLink href="https://material.io/resources/icons/">
Material icons
</ExternalLink>, and other open source projects.
</p>

<p>
We want your feedback about ATIP! Please <ExternalLink
href="https://github.com/acteng/atip/issues/new"
>start an issue on Github</ExternalLink
>
start an issue on Github
</ExternalLink>
or email
<a href="mailto: dcarlino@turing.ac.uk">dcarlino@turing.ac.uk</a>.
<a href="mailto: dcarlino@turing.ac.uk">dcarlino@turing.ac.uk</a>
.
</p>

<hr />

<h2>Recent changes</h2>
<ul>
<li>
<b>v2</b> launched on 2 June 2023. Changes: a complete UI rewrite, new draw
tools, drawing areas snapped to roads, splitting routes, multiple data schemas,
<b>v2</b>
launched on 2 June 2023. Changes: a complete UI rewrite, new draw tools,
drawing areas snapped to roads, splitting routes, multiple data schemas,
speed limit layer, lane visualization layer
</li>
<li><b>v1</b> launched in March 2023</li>
<li>
<b>v1</b>
launched in March 2023
</li>
</ul>
</div>
</Modal>
Loading

0 comments on commit f44a5bd

Please sign in to comment.