govuk_publishing_components 17.10.0 → 17.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/govuk_publishing_components/components/feedback.js +21 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_translation-nav.scss +10 -10
- data/app/views/govuk_publishing_components/components/_feedback.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/docs/accordion.yml +2 -1
- data/app/views/govuk_publishing_components/components/docs/layout_footer.yml +1 -1
- data/app/views/govuk_publishing_components/components/docs/layout_for_admin.yml +3 -16
- data/app/views/govuk_publishing_components/components/docs/layout_header.yml +1 -1
- data/app/views/govuk_publishing_components/components/docs/modal_dialogue.yml +2 -2
- data/app/views/govuk_publishing_components/components/docs/skip_link.yml +1 -1
- data/app/views/govuk_publishing_components/components/docs/tabs.yml +1 -2
- data/app/views/govuk_publishing_components/components/feedback/_survey_signup_form.html.erb +2 -5
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/node_modules/accessible-autocomplete/package.json +1 -1
- data/node_modules/graceful-fs/package.json +15 -15
- data/node_modules/graceful-fs/polyfills.js +16 -9
- data/node_modules/jsx-ast-utils/CHANGELOG.md +4 -0
- data/node_modules/jsx-ast-utils/__tests__/helper.js +41 -3
- data/node_modules/jsx-ast-utils/__tests__/src/elementType-test.js +4 -1
- data/node_modules/jsx-ast-utils/__tests__/src/getProp-test.js +4 -1
- data/node_modules/jsx-ast-utils/__tests__/src/{getPropLiteralValue-test.js → getPropLiteralValue-babelparser-test.js} +23 -5
- data/node_modules/jsx-ast-utils/__tests__/src/getPropLiteralValue-flowparser-test.js +522 -0
- data/node_modules/jsx-ast-utils/__tests__/src/{getPropValue-test.js → getPropValue-babelparser-test.js} +38 -5
- data/node_modules/jsx-ast-utils/__tests__/src/getPropValue-flowparser-test.js +938 -0
- data/node_modules/jsx-ast-utils/__tests__/src/hasProp-test.js +4 -1
- data/node_modules/jsx-ast-utils/__tests__/src/propName-test.js +4 -1
- data/node_modules/jsx-ast-utils/lib/values/expressions/TypeCastExpression.js +19 -0
- data/node_modules/jsx-ast-utils/lib/values/expressions/index.js +8 -2
- data/node_modules/jsx-ast-utils/package.json +17 -14
- data/node_modules/jsx-ast-utils/src/values/expressions/TypeCastExpression.js +13 -0
- data/node_modules/jsx-ast-utils/src/values/expressions/index.js +3 -0
- data/node_modules/pkg-conf/package.json +1 -1
- metadata +8 -4
@@ -1,9 +1,12 @@
|
|
1
1
|
/* eslint-env mocha */
|
2
2
|
import assert from 'assert';
|
3
|
-
import { getOpeningElement } from '../helper';
|
3
|
+
import { getOpeningElement, setParserName } from '../helper';
|
4
4
|
import hasProp, { hasAnyProp, hasEveryProp } from '../../src/hasProp';
|
5
5
|
|
6
6
|
describe('hasProp', () => {
|
7
|
+
beforeEach(() => {
|
8
|
+
setParserName('babel');
|
9
|
+
});
|
7
10
|
it('should export a function', () => {
|
8
11
|
const expected = 'function';
|
9
12
|
const actual = typeof hasProp;
|
@@ -1,9 +1,12 @@
|
|
1
1
|
/* eslint-env mocha */
|
2
2
|
import assert from 'assert';
|
3
|
-
import { extractProp } from '../helper';
|
3
|
+
import { extractProp, setParserName } from '../helper';
|
4
4
|
import propName from '../../src/propName';
|
5
5
|
|
6
6
|
describe('propName', () => {
|
7
|
+
beforeEach(() => {
|
8
|
+
setParserName('babel');
|
9
|
+
});
|
7
10
|
it('should export a function', () => {
|
8
11
|
const expected = 'function';
|
9
12
|
const actual = typeof propName;
|
@@ -0,0 +1,19 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.default = extractValueFromTypeCastExpression;
|
7
|
+
/**
|
8
|
+
* Extractor function for a TypeCastExpression type value node.
|
9
|
+
* A type cast expression looks like `(this.handleClick: (event: MouseEvent) => void))`
|
10
|
+
* This will return the expression `this.handleClick`.
|
11
|
+
*
|
12
|
+
* @param - value - AST Value object with type `TypeCastExpression`
|
13
|
+
* @returns - The extracted value converted to correct type.
|
14
|
+
*/
|
15
|
+
function extractValueFromTypeCastExpression(value) {
|
16
|
+
// eslint-disable-next-line global-require
|
17
|
+
var getValue = require('./index.js').default;
|
18
|
+
return getValue(value.expression);
|
19
|
+
}
|
@@ -90,6 +90,10 @@ var _SpreadElement = require('./SpreadElement');
|
|
90
90
|
|
91
91
|
var _SpreadElement2 = _interopRequireDefault(_SpreadElement);
|
92
92
|
|
93
|
+
var _TypeCastExpression = require('./TypeCastExpression');
|
94
|
+
|
95
|
+
var _TypeCastExpression2 = _interopRequireDefault(_TypeCastExpression);
|
96
|
+
|
93
97
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
94
98
|
|
95
99
|
// Composition map of types to their extractor functions.
|
@@ -114,7 +118,8 @@ var TYPES = {
|
|
114
118
|
UpdateExpression: _UpdateExpression2.default,
|
115
119
|
ArrayExpression: _ArrayExpression2.default,
|
116
120
|
BindExpression: _BindExpression2.default,
|
117
|
-
SpreadElement: _SpreadElement2.default
|
121
|
+
SpreadElement: _SpreadElement2.default,
|
122
|
+
TypeCastExpression: _TypeCastExpression2.default
|
118
123
|
};
|
119
124
|
|
120
125
|
var noop = function noop() {
|
@@ -209,7 +214,8 @@ var LITERAL_TYPES = (0, _object2.default)({}, TYPES, {
|
|
209
214
|
BindExpression: noop,
|
210
215
|
SpreadElement: noop,
|
211
216
|
TSNonNullExpression: noop,
|
212
|
-
TSAsExpression: noop
|
217
|
+
TSAsExpression: noop,
|
218
|
+
TypeCastExpression: noop
|
213
219
|
});
|
214
220
|
|
215
221
|
/**
|
@@ -15,17 +15,19 @@
|
|
15
15
|
],
|
16
16
|
"_from": "jsx-ast-utils@>=2.0.1 <3.0.0",
|
17
17
|
"_hasShrinkwrap": false,
|
18
|
-
"_id": "jsx-ast-utils@2.2.
|
18
|
+
"_id": "jsx-ast-utils@2.2.1",
|
19
19
|
"_inCache": true,
|
20
20
|
"_location": "/jsx-ast-utils",
|
21
|
+
"_nodeVersion": "10.12.0",
|
21
22
|
"_npmOperationalInternal": {
|
22
23
|
"host": "s3://npm-registry-packages",
|
23
|
-
"tmp": "tmp/jsx-ast-utils_2.2.
|
24
|
+
"tmp": "tmp/jsx-ast-utils_2.2.1_1561875238272_0.046196696438407736"
|
24
25
|
},
|
25
26
|
"_npmUser": {
|
26
|
-
"name": "
|
27
|
-
"email": "
|
27
|
+
"name": "jessebeach",
|
28
|
+
"email": "splendidnoise@gmail.com"
|
28
29
|
},
|
30
|
+
"_npmVersion": "6.9.2",
|
29
31
|
"_phantomChildren": {},
|
30
32
|
"_requested": {
|
31
33
|
"raw": "jsx-ast-utils@^2.0.1",
|
@@ -39,8 +41,8 @@
|
|
39
41
|
"_requiredBy": [
|
40
42
|
"/eslint-plugin-react"
|
41
43
|
],
|
42
|
-
"_resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-2.2.
|
43
|
-
"_shasum": "
|
44
|
+
"_resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-2.2.1.tgz",
|
45
|
+
"_shasum": "4d4973ebf8b9d2837ee91a8208cc66f3a2776cfb",
|
44
46
|
"_shrinkwrap": null,
|
45
47
|
"_spec": "jsx-ast-utils@^2.0.1",
|
46
48
|
"_where": "/var/lib/jenkins/workspace/ublishing_components_master-N4FWJIUY4CIFHKGZOAAEVVXODRY3YBORQOPIBBXWX72VUPSGJRRQ/node_modules/eslint-plugin-react",
|
@@ -69,6 +71,7 @@
|
|
69
71
|
"eslint": "^6.0.0",
|
70
72
|
"eslint-config-airbnb-base": "^13.1.0",
|
71
73
|
"eslint-plugin-import": "^2.17.2",
|
74
|
+
"flow-parser": "^0.102.0",
|
72
75
|
"in-publish": "^2.0.0",
|
73
76
|
"jest": "^20.0.4",
|
74
77
|
"jest-cli": "^20.0.4",
|
@@ -76,16 +79,17 @@
|
|
76
79
|
},
|
77
80
|
"directories": {},
|
78
81
|
"dist": {
|
79
|
-
"
|
80
|
-
"
|
81
|
-
"tarball": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-2.2.
|
82
|
-
"fileCount":
|
83
|
-
"unpackedSize":
|
84
|
-
"npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\
|
82
|
+
"integrity": "sha512-v3FxCcAf20DayI+uxnCuw795+oOIkVu6EnJ1+kSzhqqTZHNkTZ7B66ZgLp4oLJ/gbA64cI0B7WRoHZMSRdyVRQ==",
|
83
|
+
"shasum": "4d4973ebf8b9d2837ee91a8208cc66f3a2776cfb",
|
84
|
+
"tarball": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-2.2.1.tgz",
|
85
|
+
"fileCount": 89,
|
86
|
+
"unpackedSize": 184673,
|
87
|
+
"npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdGFMmCRA9TVsSAnZWagAALO8P/3HnKhdOoYqsYLJ2gwQq\nwck8e7yfEPBqHgXlG7WNbFTJtNT6deQ105/v/EdNXz1IhgCcmi3LLLvxnY+O\njw5A5KYq7cnBqcwWsaH36XACTZ00uRfc7WteW+eabvw438UpW5coAV5zt0a0\nlGium8DQF9TwHQZv29BOKh+iWi0oErZsLVIJ3zqTPMJxE3I956PB8RmtDU9z\nguwLeukERY8AcJZAqO6Vlthuxe1MLS7XYG6BTxvPaxdtgw+XySODj6zk1mYI\ncvqoB0riBkzjdFlpv5Stqco1mlI5uIkh98DC7XxBS38Tz7yUqwB9O5gIjM/4\nOqfnEqqdJtYPuzqDE9d8qICgZcmwp4SIrLOmP8FNA0l6Qn9yjcteq9uOan+Y\nSUddSNyOk+qbKUwMQAHbN60OBkdZxVCwzenf5EEFaiw4eBDLQ9/pQeEnWLQi\nPZ23R07F5EhNK3KcTIN4zZkMPEMxlDRfbp2hYc+TCuHUZthhM8+VW28Cz477\n/oOUACZWriNFp3hqE2HP7LFwwPnKXUkxRy4uvagk0dAEP2WeuSN39jWNXfWr\nWfASGzM9LRrsdGiaNW9QCI/eGm+awxNQfQZxvQc5gzLBmqOxoUOaBCbzc2TU\nKoU8vQEKXaJnE2GREJ42rINavyk/NmWSChuDHYlH17Oi3MDf05YELJYHj9t5\nfEJq\r\n=KCTT\r\n-----END PGP SIGNATURE-----\r\n"
|
85
88
|
},
|
86
89
|
"engines": {
|
87
90
|
"node": ">=4.0"
|
88
91
|
},
|
92
|
+
"gitHead": "794e5c5389d11b0bc8579fa59fd29073e1c957a2",
|
89
93
|
"homepage": "https://github.com/evcohen/jsx-ast-utils#readme",
|
90
94
|
"jest": {
|
91
95
|
"coverageReporters": [
|
@@ -104,7 +108,6 @@
|
|
104
108
|
"eslint"
|
105
109
|
],
|
106
110
|
"license": "MIT",
|
107
|
-
"licenseText": "The MIT License (MIT)\nCopyright (c) 2016 Ethan Cohen\n\nPermission 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:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE 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.\n",
|
108
111
|
"main": "lib/index.js",
|
109
112
|
"maintainers": [
|
110
113
|
{
|
@@ -130,5 +133,5 @@
|
|
130
133
|
"test:watch": "npm test -- --watch",
|
131
134
|
"tests-only": "jest --coverage"
|
132
135
|
},
|
133
|
-
"version": "2.2.
|
136
|
+
"version": "2.2.1"
|
134
137
|
}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
/**
|
2
|
+
* Extractor function for a TypeCastExpression type value node.
|
3
|
+
* A type cast expression looks like `(this.handleClick: (event: MouseEvent) => void))`
|
4
|
+
* This will return the expression `this.handleClick`.
|
5
|
+
*
|
6
|
+
* @param - value - AST Value object with type `TypeCastExpression`
|
7
|
+
* @returns - The extracted value converted to correct type.
|
8
|
+
*/
|
9
|
+
export default function extractValueFromTypeCastExpression(value) {
|
10
|
+
// eslint-disable-next-line global-require
|
11
|
+
const getValue = require('./index.js').default;
|
12
|
+
return getValue(value.expression);
|
13
|
+
}
|
@@ -18,6 +18,7 @@ import UpdateExpression from './UpdateExpression';
|
|
18
18
|
import ArrayExpression from './ArrayExpression';
|
19
19
|
import BindExpression from './BindExpression';
|
20
20
|
import SpreadElement from './SpreadElement';
|
21
|
+
import TypeCastExpression from './TypeCastExpression';
|
21
22
|
|
22
23
|
// Composition map of types to their extractor functions.
|
23
24
|
const TYPES = {
|
@@ -42,6 +43,7 @@ const TYPES = {
|
|
42
43
|
ArrayExpression,
|
43
44
|
BindExpression,
|
44
45
|
SpreadElement,
|
46
|
+
TypeCastExpression,
|
45
47
|
};
|
46
48
|
|
47
49
|
const noop = () => null;
|
@@ -129,6 +131,7 @@ const LITERAL_TYPES = Object.assign({}, TYPES, {
|
|
129
131
|
SpreadElement: noop,
|
130
132
|
TSNonNullExpression: noop,
|
131
133
|
TSAsExpression: noop,
|
134
|
+
TypeCastExpression: noop,
|
132
135
|
});
|
133
136
|
|
134
137
|
/**
|
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.
|
4
|
+
version: 17.11.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-
|
11
|
+
date: 2019-07-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gds-api-adapters
|
@@ -4277,8 +4277,10 @@ files:
|
|
4277
4277
|
- node_modules/jsx-ast-utils/__tests__/src/elementType-test.js
|
4278
4278
|
- node_modules/jsx-ast-utils/__tests__/src/eventHandlers-test.js
|
4279
4279
|
- node_modules/jsx-ast-utils/__tests__/src/getProp-test.js
|
4280
|
-
- node_modules/jsx-ast-utils/__tests__/src/getPropLiteralValue-test.js
|
4281
|
-
- node_modules/jsx-ast-utils/__tests__/src/
|
4280
|
+
- node_modules/jsx-ast-utils/__tests__/src/getPropLiteralValue-babelparser-test.js
|
4281
|
+
- node_modules/jsx-ast-utils/__tests__/src/getPropLiteralValue-flowparser-test.js
|
4282
|
+
- node_modules/jsx-ast-utils/__tests__/src/getPropValue-babelparser-test.js
|
4283
|
+
- node_modules/jsx-ast-utils/__tests__/src/getPropValue-flowparser-test.js
|
4282
4284
|
- node_modules/jsx-ast-utils/__tests__/src/hasProp-test.js
|
4283
4285
|
- node_modules/jsx-ast-utils/__tests__/src/index-test.js
|
4284
4286
|
- node_modules/jsx-ast-utils/__tests__/src/propName-test.js
|
@@ -4316,6 +4318,7 @@ files:
|
|
4316
4318
|
- node_modules/jsx-ast-utils/lib/values/expressions/TaggedTemplateExpression.js
|
4317
4319
|
- node_modules/jsx-ast-utils/lib/values/expressions/TemplateLiteral.js
|
4318
4320
|
- node_modules/jsx-ast-utils/lib/values/expressions/ThisExpression.js
|
4321
|
+
- node_modules/jsx-ast-utils/lib/values/expressions/TypeCastExpression.js
|
4319
4322
|
- node_modules/jsx-ast-utils/lib/values/expressions/UnaryExpression.js
|
4320
4323
|
- node_modules/jsx-ast-utils/lib/values/expressions/UpdateExpression.js
|
4321
4324
|
- node_modules/jsx-ast-utils/lib/values/expressions/index.js
|
@@ -4347,6 +4350,7 @@ files:
|
|
4347
4350
|
- node_modules/jsx-ast-utils/src/values/expressions/TaggedTemplateExpression.js
|
4348
4351
|
- node_modules/jsx-ast-utils/src/values/expressions/TemplateLiteral.js
|
4349
4352
|
- node_modules/jsx-ast-utils/src/values/expressions/ThisExpression.js
|
4353
|
+
- node_modules/jsx-ast-utils/src/values/expressions/TypeCastExpression.js
|
4350
4354
|
- node_modules/jsx-ast-utils/src/values/expressions/UnaryExpression.js
|
4351
4355
|
- node_modules/jsx-ast-utils/src/values/expressions/UpdateExpression.js
|
4352
4356
|
- node_modules/jsx-ast-utils/src/values/expressions/index.js
|