govuk_publishing_components 16.27.1 → 16.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2da63277fa05f8468b7f4a53a44418c0a5bdc03f0b8c3b07c088466bfded2afa
4
- data.tar.gz: c8a5790501a0569806990ecebc0df21ca327c2114ed2bbe0a81abf4f691a2084
3
+ metadata.gz: 5019de614e7c4f66b158635d6009879da1cf018f429afea31d5381baeab26e6b
4
+ data.tar.gz: daeb9cb11b64ceb0a8e1c83630ff088efc4e42bec30b38cda3882fd5751dbe1a
5
5
  SHA512:
6
- metadata.gz: 07032bd814de5847144bf0063d0dec422a8bf407829a8e9b568c28c5f3216c729c1e9f55915f7718938c2e9c55fefe62f449867969f45910de7a5eaca783ac4e
7
- data.tar.gz: a4d9104644451cdd5341971dd26a982d882ecfc75f431bbefe38c557abcfb73248587f61c34bbd62bd27bdb2546b1043cbda90fa8d9d06ae188089108d9322af
6
+ metadata.gz: 66c9997ed80951cb65589b5f9c6faad068b5a33eb5e539e0b57f26f5f12a4dc7c6591af146f9fb48f921b9712396734b8037560be4e66785f4ce250b57f2f409
7
+ data.tar.gz: 8a3c7dfd43d53913e1aa8b8c3c7557919f6026d2fc7314d28128ae54e0926110e410be1ef145a02dab90f03a8245f447de907490fd966442d6d900b4c04eaebc
@@ -23,12 +23,17 @@ $gem-quiet-button-hover-colour: darken($gem-quiet-button-colour, 5%);
23
23
  }
24
24
 
25
25
  .gem-c-button--inline {
26
- width: auto;
26
+ display: block;
27
27
  margin-bottom: govuk-spacing(1);
28
- margin-right: govuk-spacing(2);
29
28
 
30
- @include govuk-media-query($from: tablet) {
31
- margin-bottom: 0;
29
+ @include govuk-media-query($from: mobile) {
30
+ @include box-sizing(border-box);
31
+ display: inline-block;
32
+ width: 48%;
33
+ }
34
+
35
+ @include govuk-media-query($from: desktop) {
36
+ width: auto;
32
37
  }
33
38
  }
34
39
 
@@ -41,8 +41,11 @@ $govuk-cookie-banner-background-new: govuk-colour("white");
41
41
  }
42
42
 
43
43
  .gem-c-cookie-banner__buttons {
44
- display: inline-block;
45
44
  vertical-align: middle;
45
+
46
+ @include govuk-media-query($from: desktop) {
47
+ display: inline-block;
48
+ }
46
49
  }
47
50
 
48
51
  .gem-c-cookie-banner__confirmation {
@@ -29,7 +29,18 @@ module GovukPublishingComponents
29
29
  end
30
30
 
31
31
  def pretty_data
32
- JSON.pretty_generate(data).gsub('\\n', "\n ").gsub(/"(\w*)":/, '\1:').strip
32
+ json_key_regex = /"(\w*)":/ # matches quoted keys ending with a colon, i.e. "key":
33
+ output = JSON.pretty_generate(data).gsub('\\n', "\n ").gsub(json_key_regex, '\1:')
34
+
35
+ quoted_string_regex = /"((?:[^"\\]|\\.)*)"/ # matches "some text" - ignores escaped quotes, i.e. \"
36
+ output.gsub(quoted_string_regex) do |group|
37
+ match = Regexp.last_match[1]
38
+ contains_html?(match) ? "sanitize(#{group})" : group
39
+ end
40
+ end
41
+
42
+ def contains_html?(input)
43
+ ActionController::Base.helpers.strip_tags(input) != input
33
44
  end
34
45
 
35
46
  def data?
@@ -1,18 +1,16 @@
1
- name: Attachment (experimental)
1
+ name: Attachment
2
2
  description: Displays a link to download an attachment and metadata about the file
3
3
  body: |
4
- This component is marked as experimental as it is part of a drive to provide
5
- a consistent place for attachment presentation logic (currently this logic is
6
- within [Govspeak][] and [Whitehall][]). The API for this
7
- component may change during this process.
8
-
9
- It shows a link to a document that is attached to GOV.UK content along with a
10
- thumbnail and relevant file data.
4
+ This component shows a link to a document that is attached to GOV.UK content
5
+ along with a thumbnail and relevant file data.
11
6
 
12
7
  It is intended to be rendered in Govspeak and as an attachment 'preview' in
13
8
  Content Publisher.
14
9
 
15
- [Govspeak]: https://github.com/alphagov/govspeak/blob/c3a0742c87537a371108d097cea23688efa90a14/lib/govspeak/presenters/attachment_presenter.rb
10
+ It is not as rich in features as the [attachment rendering][Whitehall]
11
+ provided by Whitehall, it lacks support for multiple languages, CSV previews
12
+ and publication fields
13
+
16
14
  [Whitehall]: https://github.com/alphagov/whitehall/blob/5c760eea912320c5a80ef59791df47161d889f2f/app/helpers/document_helper.rb
17
15
  shared_accessibility_criteria:
18
16
  - link
@@ -1,19 +1,11 @@
1
- name: Attachment link (experimental)
1
+ name: Attachment link
2
2
  description: A link to a file with metadata of the file contents
3
3
  body: |
4
- This component is marked as experimental as it is part of a drive to provide
5
- a consistent place for attachment presentation logic (currently this logic is
6
- within [Govspeak][] and [Whitehall][]). The API for this
7
- component may change during this process.
8
-
9
- It provides a means to show a link to an attachment with some
4
+ This component provides a means to show a link to an attachment with some
10
5
  relevant file data.
11
6
 
12
7
  It is expected to be embedded inside an element that provides text styles
13
8
  (such as `.govuk-body`) so does not provide its own text styling.
14
-
15
- [Govspeak]: https://github.com/alphagov/govspeak/blob/c3a0742c87537a371108d097cea23688efa90a14/lib/govspeak/presenters/attachment_presenter.rb
16
- [Whitehall]: https://github.com/alphagov/whitehall/blob/5c760eea912320c5a80ef59791df47161d889f2f/app/helpers/document_helper.rb
17
9
  shared_accessibility_criteria:
18
10
  - link
19
11
  examples:
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = '16.27.1'.freeze
2
+ VERSION = '16.28.0'.freeze
3
3
  end
@@ -49,7 +49,7 @@
49
49
  "/"
50
50
  ],
51
51
  "_resolved": "git://github.com/alphagov/accessible-autocomplete.git#97727b82f2283469e85523598cb62615a4de944b",
52
- "_shasum": "317f48cac9d096a82143c4f9cbdd4eda24e57dab",
52
+ "_shasum": "86f959f5eb628dc42dbfe9e5cc0c3bea4ac3c15f",
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",
@@ -14,6 +14,7 @@
14
14
  ]
15
15
  ],
16
16
  "_from": "ansi-styles@>=3.2.1 <4.0.0",
17
+ "_hasShrinkwrap": false,
17
18
  "_id": "ansi-styles@3.2.1",
18
19
  "_inCache": true,
19
20
  "_location": "/standard/ansi-styles",
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: 16.27.1
4
+ version: 16.28.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-05-30 00:00:00.000000000 Z
11
+ date: 2019-06-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gds-api-adapters