diff --git a/demo/map-test/.gitignore b/demo/map-test/.gitignore new file mode 100644 index 00000000..f9d72a20 --- /dev/null +++ b/demo/map-test/.gitignore @@ -0,0 +1,15 @@ +# Node.js ignores +node_modules/ + +# Prototype ignores - per-user +.tmp/ +.env +migrate.log + +# General ignores +.DS_Store +.idea + +# Local consumer-install artifacts (regenerate with scripts/install-local-packages.sh) +.tarballs/ +package-lock.json diff --git a/demo/map-test/.npmrc b/demo/map-test/.npmrc new file mode 100644 index 00000000..f5fc3a7f --- /dev/null +++ b/demo/map-test/.npmrc @@ -0,0 +1,3 @@ +audit=false +ignore-scripts=true +allow-git=none diff --git a/demo/map-test/LICENCE.txt b/demo/map-test/LICENCE.txt new file mode 100644 index 00000000..036ee249 --- /dev/null +++ b/demo/map-test/LICENCE.txt @@ -0,0 +1,21 @@ +The MIT License + +Copyright (C) 2014 Crown Copyright (Government Digital Service) + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/demo/map-test/README.md b/demo/map-test/README.md new file mode 100644 index 00000000..3bdd1230 --- /dev/null +++ b/demo/map-test/README.md @@ -0,0 +1,25 @@ +# Defra Interactive Map Test + +A GOV.UK Prototype Kit site with a collection of examples using the DEFRA InteractiveMap component, imported from [defra-design/map-test](https://github.com/defra-design/map-test). + +The purpose of this site is **accessibility testing only**. It provides a consistent set of scenarios to verify accessibility behaviour, identify issues, and validate fixes across different browsers, assistive technologies, and devices. + +It also validates the UMD builds through the exact consumer path: each provider and plugin is installed as its own packed npm package (`@defra/interactive-map-provider-maplibre`, `@defra/interactive-map-plugin-search`, …) so npm resolves peer dependencies for real. Every package ships a `govuk-prototype-kit.config.json`, so the prototype kit serves each package's `dist` at `/plugin-assets//dist/…` and every page loads the bundles from there with standard ` +{% endblock %} + +{% block beforeContent %} + {{ govukBackLink({ + text: "Back", + href: "javascript:window.history.back()" + }) }} +{% endblock %} + +{% block content %} +
+
+ +

+ 11. Add polygons +

+ +
+ +
+
+{% endblock %} + +{% block pageScripts %} + + + + + + +{% endblock %} diff --git a/demo/map-test/app/views/add-symbols.html b/demo/map-test/app/views/add-symbols.html new file mode 100644 index 00000000..4921c708 --- /dev/null +++ b/demo/map-test/app/views/add-symbols.html @@ -0,0 +1,119 @@ +{% extends "layouts/main.html" %} + +{% block pageTitle %} + 10. Add symbols – GOV.UK Prototype Kit +{% endblock %} + +{% block head %} + + + +{% endblock %} + +{% block bodyStart %} + +{% endblock %} + +{% block beforeContent %} + {{ govukBackLink({ + text: "Back", + href: "javascript:window.history.back()" + }) }} +{% endblock %} + +{% block content %} +
+
+ +

+ 10. Add symbols +

+ +
+ +
+
+{% endblock %} + +{% block pageScripts %} + + + + + + +{% endblock %} diff --git a/demo/map-test/app/views/basic-map.html b/demo/map-test/app/views/basic-map.html new file mode 100644 index 00000000..76a47375 --- /dev/null +++ b/demo/map-test/app/views/basic-map.html @@ -0,0 +1,60 @@ +{% extends "layouts/main.html" %} + +{% block pageTitle %} + 1. Basic map – GOV.UK Prototype Kit +{% endblock %} + +{% block head %} + + +{% endblock %} + +{% block bodyStart %} + +{% endblock %} + +{% block beforeContent %} + {{ govukBackLink({ + text: "Back", + href: "javascript:window.history.back()" + }) }} +{% endblock %} + +{% block content %} +
+
+ +

+ 1. Basic map +

+ +
+ +
+
+{% endblock %} + +{% block pageScripts %} + + + + + + +{% endblock %} diff --git a/demo/map-test/app/views/button-map.html b/demo/map-test/app/views/button-map.html new file mode 100644 index 00000000..6adc3343 --- /dev/null +++ b/demo/map-test/app/views/button-map.html @@ -0,0 +1,56 @@ +{% extends "layouts/main.html" %} + +{% block pageTitle %} + 2. Button-triggered map – GOV.UK Prototype Kit +{% endblock %} + +{% block head %} + + +{% endblock %} + +{% block bodyStart %} + +{% endblock %} + +{% block beforeContent %} + {{ govukBackLink({ + text: "Back", + href: "javascript:window.history.back()" + }) }} +{% endblock %} + +{% block content %} +
+
+ +

+ 2. Button-triggered map +

+ +
+ +
+
+{% endblock %} + +{% block pageScripts %} + + + + + +{% endblock %} diff --git a/demo/map-test/app/views/draw-tools.html b/demo/map-test/app/views/draw-tools.html new file mode 100644 index 00000000..0ea89246 --- /dev/null +++ b/demo/map-test/app/views/draw-tools.html @@ -0,0 +1,167 @@ +{% extends "layouts/main.html" %} + +{% block pageTitle %} + 9. Draw tools – GOV.UK Prototype Kit +{% endblock %} + +{% block head %} + + +{% endblock %} + +{% block bodyStart %} + +{% endblock %} + +{% block beforeContent %} + {{ govukBackLink({ + text: "Back", + href: "javascript:window.history.back()" + }) }} +{% endblock %} + +{% block content %} +
+
+ +

+ 9. Draw tools +

+ +
+ +
+
+{% endblock %} + +{% block pageScripts %} + + + + + + + +{% endblock %} diff --git a/demo/map-test/app/views/index.html b/demo/map-test/app/views/index.html new file mode 100644 index 00000000..ac4d1a78 --- /dev/null +++ b/demo/map-test/app/views/index.html @@ -0,0 +1,77 @@ +{% extends "layouts/main.html" %} + +{% set pageName="Home" %} + +{% block content %} + +
+
+ +

+ {{ serviceName }} +

+ +

+ This prototype contains a set of Defra InteractiveMap examples. Each page + demonstrates a single map feature or interaction in isolation, so it can be + tested on its own. Select an example to open its page and test the map. +

+ +

+ 1. Basic map +

+

A simple inline map with no interaction.

+ +

+ 2. Button-triggered map +

+

A map that opens from a button rather than loading inline.

+ +

+ 3. Change map style +

+

Switch between the Outdoor, Dark and Black and white base maps.

+ +

+ 4. Map with marker and panel +

+

A marker that opens an information panel when selected.

+ +

+ 5. Toggle marker label +

+

Show or hide the text label on a marker.

+ +

+ 6. Place a marker to continue +

+

Place a marker on the map, then continue in a task flow.

+ +

+ 7. Add a search control +

+

Search for and locate places on the map.

+ +

+ 8. Select a feature +

+

Select a map feature to reveal information about it.

+ +

+ 9. Draw tools +

+

Draw and edit polygons and lines on the map.

+ +

+ 10. Add symbols +

+

Display point symbols from a dataset.

+ +

+ 11. Add polygons +

+

Display polygon data on the map.

+
+
+ +{% endblock %} diff --git a/demo/map-test/app/views/layouts/main.html b/demo/map-test/app/views/layouts/main.html new file mode 100644 index 00000000..59b50ba3 --- /dev/null +++ b/demo/map-test/app/views/layouts/main.html @@ -0,0 +1,8 @@ +{# +For guidance on how to use layouts see: +https://prototype-kit.service.gov.uk/docs/how-to-use-layouts +#} + +{% extends "govuk-prototype-kit/layouts/govuk-branded.njk" %} + +{% block govukServiceNavigation %}{% endblock %} diff --git a/demo/map-test/app/views/marker-panel.html b/demo/map-test/app/views/marker-panel.html new file mode 100644 index 00000000..84c52159 --- /dev/null +++ b/demo/map-test/app/views/marker-panel.html @@ -0,0 +1,91 @@ +{% extends "layouts/main.html" %} + +{% block pageTitle %} + 4. Map with marker and panel – GOV.UK Prototype Kit +{% endblock %} + +{% block head %} + + +{% endblock %} + +{% block bodyStart %} + +{% endblock %} + +{% block beforeContent %} + {{ govukBackLink({ + text: "Back", + href: "javascript:window.history.back()" + }) }} +{% endblock %} + +{% block content %} +
+
+ +

+ 4. Map with marker and panel +

+ +
+ +
+
+{% endblock %} + +{% block pageScripts %} + + + + + + +{% endblock %} diff --git a/demo/map-test/app/views/place-marker.html b/demo/map-test/app/views/place-marker.html new file mode 100644 index 00000000..3da7e543 --- /dev/null +++ b/demo/map-test/app/views/place-marker.html @@ -0,0 +1,104 @@ +{% extends "layouts/main.html" %} + +{% block pageTitle %} + 6. Place a marker to continue – GOV.UK Prototype Kit +{% endblock %} + +{% block head %} + + +{% endblock %} + +{% block bodyStart %} + +{% endblock %} + +{% block beforeContent %} + {{ govukBackLink({ + text: "Back", + href: "javascript:window.history.back()" + }) }} +{% endblock %} + +{% block content %} +
+
+ +

+ 6. Place a marker to continue +

+ +
+ + + +
+
+{% endblock %} + +{% block pageScripts %} + + + + + + +{% endblock %} diff --git a/demo/map-test/app/views/search-control.html b/demo/map-test/app/views/search-control.html new file mode 100644 index 00000000..2f1d4708 --- /dev/null +++ b/demo/map-test/app/views/search-control.html @@ -0,0 +1,98 @@ +{% extends "layouts/main.html" %} + +{% block pageTitle %} + 7. Add a search control – GOV.UK Prototype Kit +{% endblock %} + +{% block head %} + + + +{% endblock %} + +{% block bodyStart %} + +{% endblock %} + +{% block beforeContent %} + {{ govukBackLink({ + text: "Back", + href: "javascript:window.history.back()" + }) }} +{% endblock %} + +{% block content %} +
+
+ +

+ 7. Add a search control +

+ +
+ +
+
+{% endblock %} + +{% block pageScripts %} + + + + + + +{% endblock %} diff --git a/demo/map-test/app/views/select-feature.html b/demo/map-test/app/views/select-feature.html new file mode 100644 index 00000000..243b6d25 --- /dev/null +++ b/demo/map-test/app/views/select-feature.html @@ -0,0 +1,101 @@ +{% extends "layouts/main.html" %} + +{% block pageTitle %} + 8. Select a feature – GOV.UK Prototype Kit +{% endblock %} + +{% block head %} + + +{% endblock %} + +{% block bodyStart %} + +{% endblock %} + +{% block beforeContent %} + {{ govukBackLink({ + text: "Back", + href: "javascript:window.history.back()" + }) }} +{% endblock %} + +{% block content %} +
+
+ +

+ 8. Select a feature +

+ +
+ +
+
+{% endblock %} + +{% block pageScripts %} + + + + + + +{% endblock %} diff --git a/demo/map-test/app/views/style-switcher.html b/demo/map-test/app/views/style-switcher.html new file mode 100644 index 00000000..2f24957f --- /dev/null +++ b/demo/map-test/app/views/style-switcher.html @@ -0,0 +1,87 @@ +{% extends "layouts/main.html" %} + +{% block pageTitle %} + 3. Change map style – GOV.UK Prototype Kit +{% endblock %} + +{% block head %} + + + +{% endblock %} + +{% block bodyStart %} + +{% endblock %} + +{% block beforeContent %} + {{ govukBackLink({ + text: "Back", + href: "javascript:window.history.back()" + }) }} +{% endblock %} + +{% block content %} +
+
+ +

+ 3. Change map style +

+ +
+ +
+
+{% endblock %} + +{% block pageScripts %} + + + + + + +{% endblock %} diff --git a/demo/map-test/app/views/toggle-marker-label.html b/demo/map-test/app/views/toggle-marker-label.html new file mode 100644 index 00000000..d30fece2 --- /dev/null +++ b/demo/map-test/app/views/toggle-marker-label.html @@ -0,0 +1,74 @@ +{% extends "layouts/main.html" %} + +{% block pageTitle %} + 5. Toggle marker label – GOV.UK Prototype Kit +{% endblock %} + +{% block head %} + + +{% endblock %} + +{% block bodyStart %} + +{% endblock %} + +{% block beforeContent %} + {{ govukBackLink({ + text: "Back", + href: "javascript:window.history.back()" + }) }} +{% endblock %} + +{% block content %} +
+
+ +

+ 5. Toggle marker label +

+ +
+ +
+
+{% endblock %} + +{% block pageScripts %} + + + + + + +{% endblock %} diff --git a/demo/map-test/package.json b/demo/map-test/package.json new file mode 100644 index 00000000..549cac9d --- /dev/null +++ b/demo/map-test/package.json @@ -0,0 +1,22 @@ +{ + "name": "map-test", + "private": true, + "scripts": { + "dev": "govuk-prototype-kit dev", + "serve": "govuk-prototype-kit serve", + "start": "govuk-prototype-kit start" + }, + "dependencies": { + "@defra/interactive-map": "file:.tarballs/defra-interactive-map-0.0.0-development.tgz", + "@defra/interactive-map-plugin-datasets": "file:.tarballs/defra-interactive-map-plugin-datasets-0.0.0-development.tgz", + "@defra/interactive-map-plugin-draw-ml": "file:.tarballs/defra-interactive-map-plugin-draw-ml-0.0.0-development.tgz", + "@defra/interactive-map-plugin-interact": "file:.tarballs/defra-interactive-map-plugin-interact-0.0.0-development.tgz", + "@defra/interactive-map-plugin-map-styles": "file:.tarballs/defra-interactive-map-plugin-map-styles-0.0.0-development.tgz", + "@defra/interactive-map-plugin-search": "file:.tarballs/defra-interactive-map-plugin-search-0.0.0-development.tgz", + "@defra/interactive-map-provider-maplibre": "file:.tarballs/defra-interactive-map-provider-maplibre-0.0.0-development.tgz", + "@defra/interactive-map-provider-open-names": "file:.tarballs/defra-interactive-map-provider-open-names-0.0.0-development.tgz", + "@govuk-prototype-kit/common-templates": "3.0.0", + "govuk-frontend": "6.3.0", + "govuk-prototype-kit": "13.20.2" + } +} diff --git a/demo/map-test/scripts/install-local-packages.sh b/demo/map-test/scripts/install-local-packages.sh new file mode 100755 index 00000000..51f9e2e7 --- /dev/null +++ b/demo/map-test/scripts/install-local-packages.sh @@ -0,0 +1,42 @@ +#!/usr/bin/env bash +# Install the @defra/interactive-map packages exactly as a consumer would: +# build the monorepo, pack each package this app uses into a tarball, and +# npm-install the tarballs (so npm resolves peer dependencies for real). +# Each package ships a govuk-prototype-kit.config.json, so the prototype kit +# serves its dist under /plugin-assets//dist/... and +# pages load the UMD bundles from there with standard