govuk_publishing_components 17.5.0 → 17.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 36ffc6adb457eb3a50384d4f70cb662aad748f8c846910298eac869ab85e16e8
4
- data.tar.gz: 0c54cbe36fe79aecdbccf79777d52b5be76e4430474b4f23a53bcfadcf15c40a
3
+ metadata.gz: 8651dd059443fe10e5427099eb551d6d38e766671e3b85da2965a2d8d88fa210
4
+ data.tar.gz: 10f295771ea3de1c3d02613ad7c9308efe1bc452ababa999c284ca0a18c47f2c
5
5
  SHA512:
6
- metadata.gz: 2cc367ffbc827b9b67083ac71620324c394f720c91d61491b4278e3c8e77fa276c117c8a0ddc01fd397e98657f047cd3c4e82d92f75f45844aa21221abc6902a
7
- data.tar.gz: b8794c4a6b9d2624ac25defdf29f6218635fd54bdda63b9718b50636186aa50d6a83f71512f82152329e5e43a3e25f86468cf98d8a3f398e7553a724740b2b93
6
+ metadata.gz: b1c4286f50885f7da74dec49930a7c3562b156ddf0a71dd3e634b6e87c8af51fe7bb757ee43f1dec640ec16db8bb0f6e267c819e8140715c5b77f7052c032ae0
7
+ data.tar.gz: b7aa46cd63fa06f2a50f927d0a4941dbd1dbfe78e70075cbffea5f0b4880345a9bbf009e5999c30bffd519390d1d16bfc9ca85494ea2099dc8a15053e623b359
@@ -11,6 +11,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
11
11
  this.$module.setCookieConsent = this.setCookieConsent.bind(this)
12
12
 
13
13
  this.$module.newCookieBanner = document.querySelector('.gem-c-cookie-banner--new')
14
+ this.$module.cookieBannerConfirmationMessage = document.querySelector('.gem-c-cookie-banner__confirmation')
14
15
 
15
16
  // Temporary check while we have 2 banners co-existing.
16
17
  // Once the new banner has been deployed, we will be able to remove code relating to the old banner
@@ -62,10 +63,8 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
62
63
  }
63
64
 
64
65
  CookieBanner.prototype.showNewCookieMessage = function () {
65
- var newCookieBanner = document.querySelector('.gem-c-cookie-banner--new')
66
-
67
66
  // Hide the cookie banner on the cookie settings page, to avoid circular journeys
68
- if (newCookieBanner && window.location.pathname === '/help/cookies') {
67
+ if (this.$module.newCookieBanner && window.location.pathname === '/help/cookies') {
69
68
  this.$module.style.display = 'none'
70
69
  } else {
71
70
  var shouldHaveCookieMessage = (this.$module && window.GOVUK.cookie('seen_cookie_message') !== 'true')
@@ -95,15 +94,15 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
95
94
  CookieBanner.prototype.setCookieConsent = function () {
96
95
  window.GOVUK.approveAllCookieTypes()
97
96
  this.$module.showConfirmationMessage()
97
+ this.$module.cookieBannerConfirmationMessage.focus()
98
98
  window.GOVUK.cookie('seen_cookie_message', 'true', { days: 365 })
99
99
  }
100
100
 
101
101
  CookieBanner.prototype.showConfirmationMessage = function () {
102
102
  this.$cookieBannerMainContent = document.querySelector('.gem-c-cookie-banner__wrapper')
103
- this.$cookieBannerConfirmationMessage = document.querySelector('.gem-c-cookie-banner__confirmation')
104
103
 
105
104
  this.$cookieBannerMainContent.style.display = 'none'
106
- this.$cookieBannerConfirmationMessage.style.display = 'block'
105
+ this.$module.cookieBannerConfirmationMessage.style.display = 'block'
107
106
  }
108
107
 
109
108
  Modules.CookieBanner = CookieBanner
@@ -9,7 +9,7 @@
9
9
  message = cookie_banner_helper.message
10
10
  %>
11
11
 
12
- <div id="<%= id %>" class="<%= cookie_banner_class %>" data-module="cookie-banner" aria-live="polite">
12
+ <div id="<%= id %>" class="<%= cookie_banner_class %>" data-module="cookie-banner" aria-live="polite" role="region" aria-label="cookie banner">
13
13
  <div class="gem-c-cookie-banner__wrapper govuk-width-container">
14
14
  <p class="gem-c-cookie-banner__message"><%= message %></p>
15
15
  <% if new_cookie_banner %>
@@ -45,7 +45,7 @@
45
45
  </div>
46
46
 
47
47
  <% if new_cookie_banner %>
48
- <div class="gem-c-cookie-banner__confirmation govuk-width-container">
48
+ <div class="gem-c-cookie-banner__confirmation govuk-width-container" tabindex="-1">
49
49
  <p class="gem-c-cookie-banner__confirmation-message">
50
50
  You&#8217;ve accepted all cookies. You can <a class="govuk-link" href="/help/cookies" data-module="track-click" data-track-category="cookieBanner" data-track-action="Cookie banner settings clicked from confirmation">change your cookie settings</a> at any time.
51
51
  </p>
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = '17.5.0'.freeze
2
+ VERSION = '17.6.0'.freeze
3
3
  end
@@ -49,7 +49,7 @@
49
49
  "/"
50
50
  ],
51
51
  "_resolved": "git://github.com/alphagov/accessible-autocomplete.git#3523dd9fffc70cbd9f6f555f75863c33a709f49e",
52
- "_shasum": "efc904831e7b0323c5495b35554bd3bc167ae18c",
52
+ "_shasum": "709a9f211b61c5c83da1c6f4e8c904ef30803db3",
53
53
  "_shrinkwrap": null,
54
54
  "_spec": "accessible-autocomplete@git://github.com/alphagov/accessible-autocomplete.git#add-multiselect-support",
55
55
  "_where": "/var/lib/jenkins/workspace/ublishing_components_master-N4FWJIUY4CIFHKGZOAAEVVXODRY3YBORQOPIBBXWX72VUPSGJRRQ",
@@ -73,8 +73,8 @@ module.exports = function resolve(x, options, callback) {
73
73
  } else loadAsFile(res, opts.package, onfile);
74
74
  } else loadNodeModules(x, basedir, function (err, n, pkg) {
75
75
  if (err) cb(err);
76
- else if (n) cb(null, n, pkg);
77
76
  else if (core[x]) return cb(null, x);
77
+ else if (n) cb(null, n, pkg);
78
78
  else {
79
79
  var moduleError = new Error("Cannot find module '" + x + "' from '" + parent + "'");
80
80
  moduleError.code = 'MODULE_NOT_FOUND';
@@ -18,7 +18,7 @@ var getNodeModulesDirs = function getNodeModulesDirs(absoluteStart, modules) {
18
18
 
19
19
  return paths.reduce(function (dirs, aPath) {
20
20
  return dirs.concat(modules.map(function (moduleDir) {
21
- return path.join(prefix, aPath, moduleDir);
21
+ return path.resolve(prefix, aPath, moduleDir);
22
22
  }));
23
23
  }, []);
24
24
  };
@@ -59,6 +59,8 @@ module.exports = function (x, options) {
59
59
  if (x === '..' || x.slice(-1) === '/') res += '/';
60
60
  var m = loadAsFileSync(res) || loadAsDirectorySync(res);
61
61
  if (m) return m;
62
+ } else if (core[x]) {
63
+ return x;
62
64
  } else {
63
65
  var n = loadNodeModulesSync(x, absoluteStart);
64
66
  if (n) return n;
@@ -15,13 +15,13 @@
15
15
  ],
16
16
  "_from": "resolve@>=1.6.0 <2.0.0",
17
17
  "_hasShrinkwrap": false,
18
- "_id": "resolve@1.11.0",
18
+ "_id": "resolve@1.11.1",
19
19
  "_inCache": true,
20
20
  "_location": "/resolve",
21
- "_nodeVersion": "12.1.0",
21
+ "_nodeVersion": "12.3.1",
22
22
  "_npmOperationalInternal": {
23
23
  "host": "s3://npm-registry-packages",
24
- "tmp": "tmp/resolve_1.11.0_1557946811120_0.4088999308496508"
24
+ "tmp": "tmp/resolve_1.11.1_1559588786109_0.9881098789520049"
25
25
  },
26
26
  "_npmUser": {
27
27
  "name": "ljharb",
@@ -44,8 +44,8 @@
44
44
  "/eslint-plugin-node",
45
45
  "/normalize-package-data"
46
46
  ],
47
- "_resolved": "https://registry.npmjs.org/resolve/-/resolve-1.11.0.tgz",
48
- "_shasum": "4014870ba296176b86343d50b60f3b50609ce232",
47
+ "_resolved": "https://registry.npmjs.org/resolve/-/resolve-1.11.1.tgz",
48
+ "_shasum": "ea10d8110376982fef578df8fc30b9ac30a07a3e",
49
49
  "_shrinkwrap": null,
50
50
  "_spec": "resolve@^1.6.0",
51
51
  "_where": "/var/lib/jenkins/workspace/ublishing_components_master-N4FWJIUY4CIFHKGZOAAEVVXODRY3YBORQOPIBBXWX72VUPSGJRRQ/node_modules/eslint-plugin-import",
@@ -71,14 +71,14 @@
71
71
  },
72
72
  "directories": {},
73
73
  "dist": {
74
- "integrity": "sha512-WL2pBDjqT6pGUNSUzMw00o4T7If+z4H2x3Gz893WoUQ5KW8Vr9txp00ykiP16VBaZF5+j/OcXJHZ9+PCvdiDKw==",
75
- "shasum": "4014870ba296176b86343d50b60f3b50609ce232",
76
- "tarball": "https://registry.npmjs.org/resolve/-/resolve-1.11.0.tgz",
77
- "fileCount": 85,
78
- "unpackedSize": 140059,
79
- "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc3GG7CRA9TVsSAnZWagAAHfUP/14z/m0dy+F21lIsBxHb\nVecF7kLUXXzSuYuIUIE/bh4WGsY3sy6VZPTgPKdZv5BZf4EWWQIGSGwu1x11\nAkjx9P0+lMS8VOEO5bWgX36hMMZXp+cL4uFMgqWKyyNOS2uNGIoaQVgBKWQH\nTfNST4DGMZtc5VhJNg8mCTJP6puwCNNGm3jVRPmVQgOUZ+38JEmZY+BmcUK4\nxWOTSTRKFjc3w5QozCTvHMTHaG9TDKDDYL82Fahr7j8/p5NQ9zFTxVv1C2RL\nqz5sThGQKHKL9Jbhosbu/hpByfxDaYcYstAmFOQI9CsL+w5D327Q6bQ1IK5F\nDa4PO0tFQM2dhzSI/hwqJb8kzDcxIk11ToHcI0M5xsYy3tOgGjUrQcjhrqxi\nKaNXkEcBy2r4Pl/A3JXJi6jGUb4xt7evADsAypW0gCS8vktY7Ty9Ru6mcGWU\n+NFRYrz0xWgIfV70G1FNxQ/FXniJsiy6tPZy/eMducmGMUV39enpCmloREgh\ntOrxrU1wY60x5SCp6cT+B6IK7tmSsPsfbLLres9T1vWemDkKmWgSr5rh6LVA\n1VUrDI8qjtIhMfiQLNJSizlk+pBdrk2I5NWjiBQgDAi+YDOvQesIitTQ1veW\n4CGJ165gQ7IYvWKiRC9BSdcQ+GbHsbJOC/R8K/tThcrnfeNSEHCL1u/covlX\nsezS\r\n=s5dL\r\n-----END PGP SIGNATURE-----\r\n"
74
+ "integrity": "sha512-vIpgF6wfuJOZI7KKKSP+HmiKggadPQAdsp5HiC1mvqnfp0gF1vdwgBWZIdrVft9pgqoMFQN+R7BSWZiBxx+BBw==",
75
+ "shasum": "ea10d8110376982fef578df8fc30b9ac30a07a3e",
76
+ "tarball": "https://registry.npmjs.org/resolve/-/resolve-1.11.1.tgz",
77
+ "fileCount": 88,
78
+ "unpackedSize": 141483,
79
+ "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc9W+yCRA9TVsSAnZWagAAAnoP/3ljhkyB1pqgkVpT+3z8\nDjM5zmU/Iy3IXo28jJGas8WSL5cVrlIsdAw+uWxbj3LzBhz3v8VwAPLHcMfo\nuaW6Q6hRdKRhhzRkFl1Ip2nG9x5JQQDBOVKUF4RJ9CRh/DxxTjPQYsexO0jm\nxTJveQCHUG7ZtPq69hR/gTXQsUWTxxwOgaODCnoUKHGa5hKXoeVQgqETxM0r\nPzr0qbMe32zNxpjbhzlmDN+dCWaWD9th+IpdjQHevRZK+K7MpLO7KyXegRoW\n3pqdYtxbJZaDSk8m7EmYzzNecdcBmATsJXRqjip2fQvpd5tOiUAN39F3D7I5\nOaXipbR6x8oLu0yYQzQmtEeAH+l58Wig3JF0j00/9PTkBDEWpASiJ9jWMqbC\n+eESL7W9GhCjGCmG3sfdyPCJRKdOalLwrks8vNuuHh0ER594uqxmm5aJONeo\ndHa0leuuFd777oU1mUptcRY8T5U2oSCHvezeIbDAJ4L3DBCziPTB6t09Devs\nmo2GHQTspSHbfeGQBi2Awo1ZaDRisvOpL6ZQYB7xAx1EfdmsNjUWu3fGR99l\nuR8KELYRRQk16ZZxmkxoJ4Am5ocaOh18q/oBxo1p02mUUy7mW3kH86KC8uNy\n+V8Yr6PXW/81JUz0uV3bKrHqC7UiL6dByOGzLRNDzfBkblIgJere8mg2VAgY\nVSBr\r\n=Nz4z\r\n-----END PGP SIGNATURE-----\r\n"
80
80
  },
81
- "gitHead": "da345f39588998003a53a7d9959c4df40e04fb23",
81
+ "gitHead": "b234492f27a2437b1b281edd432b4d97163db95c",
82
82
  "homepage": "https://github.com/browserify/resolve#readme",
83
83
  "keywords": [
84
84
  "resolve",
@@ -270,5 +270,5 @@
270
270
  "test:multirepo": "cd ./test/resolver/multirepo && npm install && npm test",
271
271
  "tests-only": "tape test/*.js"
272
272
  },
273
- "version": "1.11.0"
273
+ "version": "1.11.1"
274
274
  }
File without changes
@@ -118,4 +118,26 @@ test('node-modules-paths', function (t) {
118
118
 
119
119
  t.end();
120
120
  });
121
+
122
+ t.test('combine paths correctly on Windows', function (t) {
123
+ var start = 'C:\\Users\\username\\myProject\\src';
124
+ var paths = [];
125
+ var moduleDirectories = ['node_modules', start];
126
+ var dirs = nodeModulesPaths(start, { paths: paths, moduleDirectory: moduleDirectories });
127
+
128
+ t.equal(dirs.indexOf(path.resolve(start)) > -1, true, 'should contain start dir');
129
+
130
+ t.end();
131
+ });
132
+
133
+ t.test('combine paths correctly on non-Windows', { skip: process.platform === 'win32' }, function (t) {
134
+ var start = '/Users/username/git/myProject/src';
135
+ var paths = [];
136
+ var moduleDirectories = ['node_modules', '/Users/username/git/myProject/src'];
137
+ var dirs = nodeModulesPaths(start, { paths: paths, moduleDirectory: moduleDirectories });
138
+
139
+ t.equal(dirs.indexOf(path.resolve(start)) > -1, true, 'should contain start dir');
140
+
141
+ t.end();
142
+ });
121
143
  });
@@ -283,17 +283,6 @@ test('without basedir', function (t) {
283
283
  });
284
284
  });
285
285
 
286
- test('#25: node modules with the same name as node stdlib modules', function (t) {
287
- t.plan(1);
288
-
289
- var resolverDir = path.join(__dirname, 'resolver/punycode');
290
-
291
- resolve('punycode', { basedir: resolverDir }, function (err, res, pkg) {
292
- if (err) t.fail(err);
293
- t.equal(res, path.join(resolverDir, 'node_modules/punycode/index.js'));
294
- });
295
- });
296
-
297
286
  test('#52 - incorrectly resolves module-paths like "./someFolder/" when there is a file of the same name', function (t) {
298
287
  t.plan(2);
299
288
 
@@ -184,17 +184,6 @@ test('incorrect main', function (t) {
184
184
  t.end();
185
185
  });
186
186
 
187
- test('#25: node modules with the same name as node stdlib modules', function (t) {
188
- var resolverDir = path.join(__dirname, 'resolver/punycode');
189
-
190
- t.equal(
191
- resolve.sync('punycode', { basedir: resolverDir }),
192
- path.join(resolverDir, 'node_modules/punycode/index.js')
193
- );
194
-
195
- t.end();
196
- });
197
-
198
187
  var stubStatSync = function stubStatSync(fn) {
199
188
  var fs = require('fs');
200
189
  var statSync = fs.statSync;
@@ -0,0 +1,38 @@
1
+ var test = require('tape');
2
+ var resolve = require('../');
3
+ var path = require('path');
4
+
5
+ test('shadowed core modules still return core module', function (t) {
6
+ t.plan(2);
7
+
8
+ resolve('util', { basedir: path.join(__dirname, 'shadowed_core') }, function (err, res) {
9
+ t.ifError(err);
10
+ t.equal(res, 'util');
11
+ });
12
+ });
13
+
14
+ test('shadowed core modules still return core module [sync]', function (t) {
15
+ t.plan(1);
16
+
17
+ var res = resolve.sync('util', { basedir: path.join(__dirname, 'shadowed_core') });
18
+
19
+ t.equal(res, 'util');
20
+ });
21
+
22
+ test('shadowed core modules return shadow when appending `/`', function (t) {
23
+ t.plan(2);
24
+
25
+ resolve('util/', { basedir: path.join(__dirname, 'shadowed_core') }, function (err, res) {
26
+ t.ifError(err);
27
+ t.equal(res, path.join(__dirname, 'shadowed_core/node_modules/util/index.js'));
28
+ });
29
+ });
30
+
31
+ test('shadowed core modules return shadow when appending `/` [sync]', function (t) {
32
+ t.plan(1);
33
+
34
+ var res = resolve.sync('util/', { basedir: path.join(__dirname, 'shadowed_core') });
35
+
36
+ t.equal(res, path.join(__dirname, 'shadowed_core/node_modules/util/index.js'));
37
+ });
38
+
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk_publishing_components
3
3
  version: !ruby/object:Gem::Version
4
- version: 17.5.0
4
+ version: 17.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GOV.UK Dev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-06-21 00:00:00.000000000 Z
11
+ date: 2019-06-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gds-api-adapters
@@ -5787,6 +5787,7 @@ files:
5787
5787
  - node_modules/resolve/lib/sync.js
5788
5788
  - node_modules/resolve/package.json
5789
5789
  - node_modules/resolve/readme.markdown
5790
+ - node_modules/resolve/reaf
5790
5791
  - node_modules/resolve/test/core.js
5791
5792
  - node_modules/resolve/test/dotdot.js
5792
5793
  - node_modules/resolve/test/dotdot/abc/index.js
@@ -5848,6 +5849,8 @@ files:
5848
5849
  - node_modules/resolve/test/resolver/symlinked/_/node_modules/foo.js
5849
5850
  - node_modules/resolve/test/resolver/without_basedir/main.js
5850
5851
  - node_modules/resolve/test/resolver_sync.js
5852
+ - node_modules/resolve/test/shadowed_core.js
5853
+ - node_modules/resolve/test/shadowed_core/node_modules/util/index.js
5851
5854
  - node_modules/resolve/test/subdirs.js
5852
5855
  - node_modules/resolve/test/symlinks.js
5853
5856
  - node_modules/restore-cursor/index.js