station 0.0.102 → 0.0.107

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/bin/nexmo-developer +1 -44
  3. data/docs/How-To-Use.md +1 -1
  4. data/lib/nexmo_developer/.rspec +0 -1
  5. data/lib/nexmo_developer/Gemfile +4 -4
  6. data/lib/nexmo_developer/Gemfile.lock +21 -19
  7. data/lib/nexmo_developer/app/helpers/application_helper.rb +2 -0
  8. data/lib/nexmo_developer/app/presenters/sidenav_item.rb +2 -2
  9. data/lib/nexmo_developer/app/views/layouts/partials/_footer.html.erb +4 -4
  10. data/lib/nexmo_developer/app/views/layouts/partials/_head.html.erb +4 -4
  11. data/lib/nexmo_developer/app/views/layouts/partials/_header.html.erb +3 -3
  12. data/lib/nexmo_developer/app/views/layouts/partials/_improve_this_page.html.erb +1 -1
  13. data/lib/nexmo_developer/app/views/static/_products.html.erb +6 -6
  14. data/lib/nexmo_developer/app/views/tutorial/list.html.erb +1 -1
  15. data/lib/nexmo_developer/app/views/use_case/_index.html.erb +1 -1
  16. data/lib/nexmo_developer/app/webpacker/javascript/volta/volta.js +108 -21
  17. data/lib/nexmo_developer/app/webpacker/stylesheets/application.scss +1 -1
  18. data/lib/nexmo_developer/app/webpacker/stylesheets/custom/_core.scss +1 -1
  19. data/lib/nexmo_developer/app/webpacker/stylesheets/objects/_icons.scss +1 -0
  20. data/lib/nexmo_developer/app/webpacker/stylesheets/objects/_navigation.scss +1 -2
  21. data/lib/nexmo_developer/app/webpacker/stylesheets/objects/_use_cases.scss +1 -1
  22. data/lib/nexmo_developer/config/environments/production.rb +8 -1
  23. data/lib/nexmo_developer/config/initializers/assets.rb +0 -2
  24. data/lib/nexmo_developer/nexmo_developer.rb +44 -0
  25. data/lib/nexmo_developer/version.rb +1 -1
  26. data/package.json +13 -12
  27. data/station.gemspec +3 -3
  28. data/yarn.lock +1684 -357
  29. metadata +34 -46
  30. data/lib/nexmo_developer/app/assets/fonts/Lato-Black.woff +0 -0
  31. data/lib/nexmo_developer/app/assets/fonts/Lato-Black.woff2 +0 -0
  32. data/lib/nexmo_developer/app/assets/fonts/Lato-Regular.woff +0 -0
  33. data/lib/nexmo_developer/app/assets/fonts/Lato-Regular.woff2 +0 -0
  34. data/lib/nexmo_developer/app/assets/fonts/Lato-Semibold.woff +0 -0
  35. data/lib/nexmo_developer/app/assets/fonts/Lato-Semibold.woff2 +0 -0
  36. data/lib/nexmo_developer/app/assets/fonts/icomoon.eot +0 -0
  37. data/lib/nexmo_developer/app/assets/fonts/icomoon.json +0 -1257
  38. data/lib/nexmo_developer/app/assets/fonts/icomoon.svg +0 -55
  39. data/lib/nexmo_developer/app/assets/fonts/icomoon.ttf +0 -0
  40. data/lib/nexmo_developer/app/assets/fonts/icomoon.woff +0 -0
  41. data/lib/nexmo_developer/app/assets/fonts/nexmo-developer.json +0 -36483
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 731c9ae04b6db8aabd750d8a19a35f6c7a561fa1ef1dfebeaa4038b182c288f2
4
- data.tar.gz: 80ebc07b60b8757bbcca9469fe64d5fdc7c123cf84e20fc9ffedd912570d07de
3
+ metadata.gz: 5a1fab3242c94d821bff710a79ea714937f9b6f8aa2f5d21f5958d8a68b7a232
4
+ data.tar.gz: b2f26a3b0f4d7ce301e119010a91aade280d8c9290f624fb37dfe6c62a80abd7
5
5
  SHA512:
6
- metadata.gz: 41c85d4da7b9c1546150b05dcd717a8ce2b5bfc52d92cef4741858d07b58f79995a782aea88e904109b0c5978f390d0962d5789becca2a9cf216e8297f3ead86
7
- data.tar.gz: ac8d0143cc76403a1138663d7a3120d0a3b292a7ecfff5aca371d7aef01dc99750961a2786a23deb47f02922c81772cbb53803703d55e5bb868065b6312b7e1f
6
+ metadata.gz: 70bcfb3474cb0da1f53868a538af240bcc3767d7e297d8f34c11fffe2ed544fcb050f326bb8b4d2b3bcbf5af47fc80c03614e77ea885ed6ba643c099c1cbc791
7
+ data.tar.gz: 77311ab520f9a7be85452226ef671160fbb2c9fda406f7751580a8aff82b5507a8bf4a41df610e592ee1051906e57e3efcb45de0f057d05d68f7ab925df00921
@@ -44,50 +44,7 @@ end.parse!
44
44
  $LOAD_PATH.unshift(File.expand_path('../lib/nexmo_developer', __dir__))
45
45
  APP_PATH = File.expand_path('../lib/nexmo_developer/config/application', __dir__)
46
46
 
47
- require 'rails/all'
48
- require 'activeadmin'
49
- require 'bootsnap'
50
- require 'bugsnag'
51
- require 'devise'
52
- require 'geocoder'
53
- require 'gravatar_image_tag'
54
- require 'greenhouse_io'
55
- require 'recaptcha'
56
- require 'split/dashboard'
57
- require 'listen'
58
- require 'inherited_resources'
59
- require 'msgpack'
60
- require 'pg'
61
- require 'coffee-rails'
62
- require 'octokit'
63
- require 'webpacker'
64
- require 'clipboard/rails'
65
- require 'gmaps4rails'
66
- require 'nexmo_markdown_renderer'
67
- require 'truncato'
68
- require 'puma'
69
- require 'barnes'
70
- require 'woothee'
71
- require 'algoliasearch'
72
- require 'rest-client'
73
- require 'chartkick'
74
- require 'groupdate'
75
- require 'terminal-table'
76
- require 'lograge'
77
- require 'jbuilder'
78
- require 'nokogiri'
79
- require 'colorize'
80
- require 'neatjson'
81
- require 'slack-notifier'
82
- require 'autoprefixer-rails'
83
- require 'titleize'
84
- require 'countries'
85
- require 'country_select'
86
- require 'smartling'
87
- require 'newrelic_rpm'
88
- require 'redis'
89
- require 'rake'
90
-
47
+ require_relative '../lib/nexmo_developer/nexmo_developer'
91
48
  require 'config/application'
92
49
  require 'rails/command'
93
50
 
@@ -49,7 +49,7 @@ The files required are:
49
49
  * `business_info.yml`: Specific business/organizational information for the platform. This includes the platform name, the path to the header and footer logos, and more.
50
50
  * `top_navigation.yml`: The links for the top navigation bar of the platform.
51
51
  * `meta_info.yml`: Information used to generate the links in the platform's `<head>` tags, such as search engine optimization details.
52
- * `products.yml`: A list of each product or item covered in the platform's content. The icon, documentation path and color schema for each product is also specified here.
52
+ * `products.yml`: A list of each product or item covered in the platform's content. The icon, documentation path, color schema and automated translation frequency for each product is also specified here.
53
53
 
54
54
  In addition to the above configuration files, Station also expects the following files to be created and placed inside the `/public/meta` path. These files are meta icons also used in the generation of the `<head>` content:
55
55
 
@@ -1,3 +1,2 @@
1
1
  --color
2
2
  --require spec_helper
3
- --tag ~ndp
@@ -13,7 +13,7 @@ gem 'webpacker'
13
13
  # Use postgresql as the database for Active Record
14
14
  gem 'pg', '~> 1.2'
15
15
  # Use Puma as the app server
16
- gem 'puma', '~> 5.0'
16
+ gem 'puma', '~> 5.1'
17
17
  # Use SCSS for stylesheets
18
18
  gem 'sassc-rails', '~> 2.1'
19
19
  # Use Uglifier as compressor for JavaScript assets
@@ -110,8 +110,8 @@ gem 'bootsnap', require: false
110
110
  gem 'diffy', require: false
111
111
 
112
112
  # Automatic Ruby code style checking tool. Aims to enforce the community-driven Ruby Style Guide.
113
- gem 'rubocop', '~> 1.4.2', require: false
114
- gem 'rubocop-rails', '~> 2.8', require: false
113
+ gem 'rubocop', '~> 1.6.1', require: false
114
+ gem 'rubocop-rails', '~> 2.9', require: false
115
115
 
116
116
  # Volta needs a CSS autoprefixer
117
117
  gem 'autoprefixer-rails'
@@ -131,7 +131,7 @@ gem 'country_select', '~> 4.0'
131
131
 
132
132
  gem 'nexmo-oas-renderer', '~> 2.4.1', require: false
133
133
 
134
- gem 'nexmo_markdown_renderer', '~> 0.7'
134
+ gem 'nexmo_markdown_renderer', '~> 0.7.3'
135
135
 
136
136
  gem 'smartling'
137
137
 
@@ -93,7 +93,7 @@ GEM
93
93
  activesupport (>= 3.0.0, < 6.1)
94
94
  ruby2_keywords (>= 0.0.2, < 1.0)
95
95
  ast (2.4.1)
96
- autoprefixer-rails (10.0.2.0)
96
+ autoprefixer-rails (10.1.0.0)
97
97
  execjs
98
98
  awesome_print (1.8.0)
99
99
  banzai (0.1.3)
@@ -114,7 +114,7 @@ GEM
114
114
  concurrent-ruby (~> 1.0)
115
115
  builder (3.2.4)
116
116
  byebug (11.1.3)
117
- capybara (3.33.0)
117
+ capybara (3.34.0)
118
118
  addressable
119
119
  mini_mime (>= 0.1.3)
120
120
  nokogiri (~> 1.8)
@@ -258,7 +258,7 @@ GEM
258
258
  activerecord
259
259
  kaminari-core (= 1.2.1)
260
260
  kaminari-core (1.2.1)
261
- listen (3.3.1)
261
+ listen (3.3.3)
262
262
  rb-fsevent (~> 0.10, >= 0.10.3)
263
263
  rb-inotify (~> 0.9, >= 0.9.10)
264
264
  lograge (0.11.2)
@@ -277,7 +277,7 @@ GEM
277
277
  method_source (1.0.0)
278
278
  mime-types (3.3.1)
279
279
  mime-types-data (~> 3.2015)
280
- mime-types-data (3.2020.0512)
280
+ mime-types-data (3.2020.1104)
281
281
  mimemagic (0.3.5)
282
282
  mini_mime (1.0.2)
283
283
  mini_portile2 (2.4.0)
@@ -308,7 +308,7 @@ GEM
308
308
  sass (~> 3.1)
309
309
  shotgun (~> 0.9)
310
310
  sinatra (~> 2.0)
311
- nexmo_markdown_renderer (0.7.0)
311
+ nexmo_markdown_renderer (0.7.3)
312
312
  activemodel (~> 6.0)
313
313
  banzai (~> 0.1.2)
314
314
  i18n (~> 1.7)
@@ -338,7 +338,7 @@ GEM
338
338
  octokit (4.19.0)
339
339
  faraday (>= 0.9)
340
340
  sawyer (~> 0.8.0, >= 0.5.3)
341
- oj (3.10.15)
341
+ oj (3.10.16)
342
342
  orm_adapter (0.5.0)
343
343
  parallel (1.20.1)
344
344
  parser (2.7.2.0)
@@ -350,7 +350,7 @@ GEM
350
350
  coderay (~> 1.1)
351
351
  method_source (~> 1.0)
352
352
  public_suffix (4.0.6)
353
- puma (5.0.4)
353
+ puma (5.1.1)
354
354
  nio4r (~> 2.0)
355
355
  rack (2.2.3)
356
356
  rack-protection (2.1.0)
@@ -437,21 +437,21 @@ GEM
437
437
  rspec-snapshot (0.1.2)
438
438
  rspec (> 3.0.0)
439
439
  rspec-support (3.10.0)
440
- rubocop (1.4.2)
440
+ rubocop (1.6.1)
441
441
  parallel (~> 1.10)
442
442
  parser (>= 2.7.1.5)
443
443
  rainbow (>= 2.2.2, < 4.0)
444
- regexp_parser (>= 1.8)
444
+ regexp_parser (>= 1.8, < 3.0)
445
445
  rexml
446
- rubocop-ast (>= 1.1.1)
446
+ rubocop-ast (>= 1.2.0, < 2.0)
447
447
  ruby-progressbar (~> 1.7)
448
448
  unicode-display_width (>= 1.4.0, < 2.0)
449
- rubocop-ast (1.2.0)
449
+ rubocop-ast (1.3.0)
450
450
  parser (>= 2.7.1.5)
451
- rubocop-rails (2.8.1)
451
+ rubocop-rails (2.9.0)
452
452
  activesupport (>= 4.2.0)
453
453
  rack (>= 1.1)
454
- rubocop (>= 0.87.0)
454
+ rubocop (>= 0.90.0, < 2.0)
455
455
  ruby-progressbar (1.10.1)
456
456
  ruby2_keywords (0.0.2)
457
457
  sass (3.7.4)
@@ -475,10 +475,12 @@ GEM
475
475
  shotgun (0.9.2)
476
476
  rack (>= 1.0)
477
477
  simple-random (1.0.3)
478
- simplecov (0.19.1)
478
+ simplecov (0.20.0)
479
479
  docile (~> 1.1)
480
480
  simplecov-html (~> 0.11)
481
+ simplecov_json_formatter (~> 0.1)
481
482
  simplecov-html (0.12.3)
483
+ simplecov_json_formatter (0.1.2)
482
484
  sinatra (2.1.0)
483
485
  mustermann (~> 1.0)
484
486
  rack (~> 2.2)
@@ -544,7 +546,7 @@ GEM
544
546
  woothee (1.11.1)
545
547
  xpath (3.2.0)
546
548
  nokogiri (~> 1.8)
547
- zeitwerk (2.4.1)
549
+ zeitwerk (2.4.2)
548
550
 
549
551
  PLATFORMS
550
552
  ruby
@@ -590,12 +592,12 @@ DEPENDENCIES
590
592
  neatjson
591
593
  newrelic_rpm
592
594
  nexmo-oas-renderer (~> 2.4.1)
593
- nexmo_markdown_renderer (~> 0.7)
595
+ nexmo_markdown_renderer (~> 0.7.3)
594
596
  nokogiri (~> 1.10.9)
595
597
  octokit
596
598
  pg (~> 1.2)
597
599
  pry
598
- puma (~> 5.0)
600
+ puma (~> 5.1)
599
601
  rack (>= 2.0.6)
600
602
  rails (~> 6.0.3)
601
603
  rawler!
@@ -605,8 +607,8 @@ DEPENDENCIES
605
607
  rspec-collection_matchers
606
608
  rspec-rails (~> 4.0)
607
609
  rspec-snapshot (~> 0.1.2)
608
- rubocop (~> 1.4.2)
609
- rubocop-rails (~> 2.8)
610
+ rubocop (~> 1.6.1)
611
+ rubocop-rails (~> 2.9)
610
612
  ruby-progressbar
611
613
  sassc-rails (~> 2.1)
612
614
  simplecov
@@ -34,6 +34,8 @@ module ApplicationHelper
34
34
  end
35
35
 
36
36
  def canonical_base
37
+ return "https://#{ENV['HEROKU_APP_NAME']}.herokuapp.com" if ENV['HEROKU_APP_NAME']
38
+
37
39
  canonical_base_from_config || request.base_url
38
40
  end
39
41
 
@@ -38,8 +38,8 @@ class SidenavItem
38
38
 
39
39
  def css_classes
40
40
  classes = ['Nxd-sidenav-badge Vlt-badge Vlt-badge--margin-left Vlt-badge--small']
41
- classes << 'Vlt-bg-green-lighter Vlt-green' if label.casecmp('beta').zero?
42
- classes << 'Vlt-bg-blue-lighter Vlt-blue' if label.casecmp('dev preview').zero?
41
+ classes << 'Vlt-badge--transparent Vlt-badge--green' if label.casecmp('beta').zero?
42
+ classes << 'Vlt-badge--transparent Vlt-badge--blue' if label.casecmp('dev preview').zero?
43
43
 
44
44
  classes.join(' ')
45
45
  end
@@ -6,7 +6,7 @@
6
6
 
7
7
 
8
8
  <div class="Nxd-logo Vlt-white" id="footer-logo">
9
- <a href="/" id="logo" class="Nxd-logo__image">
9
+ <a href="/" class="Nxd-logo__image">
10
10
  <%= image_tag info[:logo_path], alt: info[:logo_alt] %>
11
11
  </a>
12
12
  <hr class="Nxd-product__separator">
@@ -17,7 +17,7 @@
17
17
  </div>
18
18
 
19
19
  <% if info[:status] %>
20
- <a href=<%= info[:status]['path'] %> target="_blank" class="Vlt-badge-combined">
20
+ <a href=<%= info[:status]['path'] %> target="_blank" class="Vlt-badge-combined" rel="noopener">
21
21
  <span class="Vlt-badge Vlt-white Nxd-api-badge"><%= info[:status]['text'] %></span><span class="Vlt-badge Vlt-badge--purple Nxd-api-status">Loading</span>
22
22
  </a>
23
23
  <% end %>
@@ -25,7 +25,7 @@
25
25
  <% if info[:social_links] %>
26
26
  <div id="footer-social-links">
27
27
  <% info[:social_links].each do |target, url| %>
28
- <a href=<%= url %> class="footer-link" target="_blank"><i class="icon icon-<%= target %>"></i></a>
28
+ <a href=<%= url %> class="footer-link" target="_blank" rel="noopener" title="<%= target %>"><i class="icon icon-<%= target %>"></i></a>
29
29
  <% end %>
30
30
  </div>
31
31
  <% end %>
@@ -43,7 +43,7 @@
43
43
  <div id="footer-support">
44
44
  <h5>Support</h5>
45
45
  <% info[:support_links].each do |name, url| %>
46
- <a href=<%= Footer.support_link(url) %> target="_blank"><%= Footer.support_link_text(name) %></a>
46
+ <a href=<%= Footer.support_link(url) %> target="_blank" rel="noopener"><%= Footer.support_link_text(name) %></a>
47
47
  <% end %>
48
48
  </div>
49
49
  </div>
@@ -1,4 +1,4 @@
1
- <% head = Head.new %>
1
+ <% head = Head.new(@frontmatter) %>
2
2
 
3
3
  <head>
4
4
  <meta charset="utf-8" />
@@ -73,7 +73,7 @@
73
73
 
74
74
  <link rel="canonical" href="<%= canonical_url %>">
75
75
 
76
- <%= javascript_include_tag 'application' %>
76
+ <%= javascript_include_tag 'application', defer: true %>
77
77
 
78
78
  <%= javascript_packs_with_chunks_tag 'application', defer: true %>
79
79
  <% if @additional_scripts %>
@@ -86,8 +86,8 @@
86
86
  <%= ENV['ENVIRONMENT_SCRIPTS'].html_safe %>
87
87
  <% end %>
88
88
 
89
- <%= stylesheet_pack_tag 'application' %>
90
- <%= stylesheet_link_tag 'application' %>
89
+ <%= stylesheet_pack_tag 'application', preload: true %>
90
+ <%= stylesheet_link_tag 'application', preload: true %>
91
91
 
92
92
  <%= javascript_include_tag 'https://www.google.com/recaptcha/api.js', async: true, defer: true %>
93
93
 
@@ -2,7 +2,7 @@
2
2
  <%= render partial: 'layouts/partials/post-body-tags' %>
3
3
 
4
4
  <div class="Nxd-header">
5
- <header id="header" class="Nxd-header__main" tabindex="2">
5
+ <header id="header" class="Nxd-header__main">
6
6
  <a tabindex="0" id="skip-to-navigation" href="#sidenav-first" class="Vlt-btn Vlt-btn--outline Vlt-btn--primary Vlt-btn--app">Skip to navigation</a>
7
7
  <a tabindex="0" id="skip-to-content" href="#primary-content" class="Vlt-btn Vlt-btn--outline Vlt-btn--primary Vlt-btn--app">Skip to content</a>
8
8
  <div class="Nxd-logo">
@@ -15,7 +15,7 @@
15
15
  <small><%= header.subtitle %></small>
16
16
  </div>
17
17
  </a>
18
- <a href="/" id="logo" class="Nxd-logo__image Vlt-S-only">
18
+ <a href="/" id="logo-small" class="Nxd-logo__image Vlt-S-only">
19
19
  <%= image_tag header.small_logo_path, alt: header.logo_alt %>
20
20
  </a>
21
21
  <% if header.hiring_link? %>
@@ -38,7 +38,7 @@
38
38
  </header>
39
39
 
40
40
  <nav id="subnav" class="Nxd-header__sub">
41
- <a id="Vlt-sidenav-mobile-trigger"><svg><use xlink:href="/symbol/volta-icons.svg#Vlt-icon-menu"></use></svg></a>
41
+ <button id="Vlt-sidenav-mobile-trigger" class="Vlt-btn Vlt-btn--link"><svg><use xlink:href="/symbol/volta-icons.svg#Vlt-icon-menu"></use></svg></button>
42
42
 
43
43
  <div class="Nxd-header__sub__menu">
44
44
  <% Topnav.new(@navigation).items.each do |item| %>
@@ -8,7 +8,7 @@
8
8
  <svg class="Vlt-icon Vlt-black">
9
9
  <use xlink:href="/symbol/volta-icons.svg#Vlt-icon-github" />
10
10
  </svg>
11
- <a href="<%= presenter.github_url %>" target="_blank" class="Vlt-text-link Vlt-black">Improve this page</a>
11
+ <a href="<%= presenter.github_url %>" target="_blank" class="Vlt-text-link Vlt-black" rel="noopener">Improve this page</a>
12
12
  </span>
13
13
  </div>
14
14
  </div>
@@ -67,7 +67,7 @@
67
67
  <svg class="Vlt-icon Vlt-icon--larger Vlt-purple-dark"><use xlink:href="/symbol/volta-icons.svg#Vlt-icon-video" /></svg>
68
68
  <div class="Nxd-card--product__subtitle"><small>PROGRAMMABLE</small></div>
69
69
  <h2>
70
- <a target="_blank" href="https://tokbox.com/developer/">
70
+ <a target="_blank" href="https://tokbox.com/developer/" rel="noopener">
71
71
  Video
72
72
  </a>
73
73
  <small class="Vlt-grey-dark" style="font-size:1.4rem; font-weight:normal;">
@@ -77,20 +77,20 @@
77
77
  </small>
78
78
  </h2>
79
79
  <nav>
80
- <a target="_blank" href="https://tokbox.com/developer/guides/basics/"><svg class="Vlt-icon Vlt-icon--small Vlt-icon--text-bottom Vlt-gray-darker"
80
+ <a target="_blank" href="https://tokbox.com/developer/guides/basics/" rel="noopener"><svg class="Vlt-icon Vlt-icon--small Vlt-icon--text-bottom Vlt-gray-darker"
81
81
  aria-hidden="true">
82
82
  <use xlink:href="/symbol/volta-icons.svg#Vlt-icon-home" /></svg>Overview</a>
83
- <a target="_blank" href="https://tokbox.com/developer/guides/"><svg class="Vlt-icon Vlt-icon--small Vlt-icon--text-bottom Vlt-gray-darker"
83
+ <a target="_blank" href="https://tokbox.com/developer/guides/" rel="noopener"><svg class="Vlt-icon Vlt-icon--small Vlt-icon--text-bottom Vlt-gray-darker"
84
84
  aria-hidden="true">
85
85
  <use xlink:href="/symbol/volta-icons.svg#Vlt-icon-books" /></svg>Guides</a>
86
- <a target="_blank" href="https://tokbox.com/developer/samples/"><svg class="Vlt-icon Vlt-icon--small Vlt-icon--text-bottom Vlt-gray-darker"
86
+ <a target="_blank" href="https://tokbox.com/developer/samples/" rel="noopener"><svg class="Vlt-icon Vlt-icon--small Vlt-icon--text-bottom Vlt-gray-darker"
87
87
  aria-hidden="true">
88
88
  <use xlink:href="/symbol/volta-icons.svg#Vlt-icon-code" /></svg>Code Snippets</a>
89
- <a target="_blank" href="https://tokbox.com/developer/tutorials/"><svg class="Vlt-icon Vlt-icon--small Vlt-icon--text-bottom Vlt-gray-darker"
89
+ <a target="_blank" href="https://tokbox.com/developer/tutorials/" rel="noopener"><svg class="Vlt-icon Vlt-icon--small Vlt-icon--text-bottom Vlt-gray-darker"
90
90
  aria-hidden="true">
91
91
  <use xlink:href="/symbol/volta-icons.svg#Vlt-icon-mockup" /></svg>Tutorials</a>
92
92
  <hr class="hr--short">
93
- <a target="_blank" href="https://tokbox.com/developer/sdks/client/">API Reference</a>
93
+ <a target="_blank" href="https://tokbox.com/developer/sdks/client/" rel="noopener">API Reference</a>
94
94
  </nav>
95
95
  </div>
96
96
  </div>
@@ -38,7 +38,7 @@
38
38
 
39
39
  <p><%= tutorial.description %></p>
40
40
 
41
- <a href="<%= tutorial.url %>/<%= params[:code_language] %>" class="Vlt-<%= Card::COLOUR.fetch(tutorial.subtitle, 'blue') %>-dark Nxd-card__cta">
41
+ <a href="<%= tutorial.url %>/<%= params[:code_language] %>" class="Vlt-<%= Card::COLOUR.fetch(tutorial.subtitle, 'blue') %>-darker Nxd-card__cta">
42
42
  <%= t('read_more') %>
43
43
  <svg class="Vlt-icon Vlt-icon--smaller">
44
44
  <use xlink:href="/symbol/volta-icons.svg#Vlt-icon-arrow-thin-right" />
@@ -27,7 +27,7 @@
27
27
 
28
28
  <p><%= use_case.description %></p>
29
29
 
30
- <a href="<%= url_for(controller: 'use_case', action: :show, document: use_case.relative_path, only_path: true) %>" class="Vlt-<%= Card::COLOUR.fetch(use_case.subtitle, 'blue') %>-dark">
30
+ <a href="<%= url_for(controller: 'use_case', action: :show, document: use_case.relative_path, only_path: true) %>" class="Vlt-<%= Card::COLOUR.fetch(use_case.subtitle, 'blue') %>-darker">
31
31
  <%= t('read_more') %>
32
32
  <svg class="Vlt-icon Vlt-icon--smaller">
33
33
  <use xlink:href="/symbol/volta-icons.svg#Vlt-icon-arrow-thin-right" />
@@ -1,6 +1,6 @@
1
1
  import Tooltip from './tooltip.min.js';
2
2
 
3
- /**
3
+ /* @preserve
4
4
  * Copyright (c) 2001-present, Vonage.
5
5
  *
6
6
  * Core of volta
@@ -310,6 +310,11 @@ Volta.accordion = function () {
310
310
  this.trigger.addEventListener('click', function(){
311
311
  self.toggle();
312
312
  });
313
+ this.trigger.addEventListener('keydown', function(event) {
314
+ if (event.code === 'Space' || event.code === 'Enter') {
315
+ this.trigger.click();
316
+ }
317
+ });
313
318
  }
314
319
  },
315
320
  close: function(trigger) {
@@ -319,6 +324,7 @@ Volta.accordion = function () {
319
324
 
320
325
  trigger.classList.remove(classes.triggerActive);
321
326
  panel.classList.add(classes.contentClosing);
327
+ trigger.setAttribute("aria-expanded", "false");
322
328
 
323
329
  panel.style.height = window.getComputedStyle(panel).height;
324
330
  panel.offsetHeight; // force repaint
@@ -361,6 +367,7 @@ Volta.accordion = function () {
361
367
 
362
368
  trig.classList.add(classes.triggerActive);
363
369
  panel.classList.add(classes.contentOpening);
370
+ trig.setAttribute("aria-expanded", "true");
364
371
 
365
372
  var startHeight = panel.style.height;
366
373
  panel.style.height = 'auto';
@@ -640,6 +647,7 @@ Volta.dropdown = function () {
640
647
  noCloseBlock: 'Vlt-dropdown__block--noclose',
641
648
  panel: 'Vlt-dropdown__panel',
642
649
  panelContent: 'Vlt-dropdown__panel__content',
650
+ selected: 'Vlt-dropdown__link--selected',
643
651
  selection: 'Vlt-dropdown__selection',
644
652
  switch: 'Vlt-switch',
645
653
  switchSlider: 'Vlt-switch__slider'
@@ -653,21 +661,32 @@ Volta.dropdown = function () {
653
661
  this.selection = this.dropdown.querySelector('.' + _class.selection);
654
662
  this.isSelectionVisible = !!this.selection;
655
663
  this.btn = this.dropdown.querySelector('.' + _class.btn) || this.dropdown.querySelector('.' + _class.btnLegacy);
664
+ this._links = this.dropdown.querySelectorAll('.' + _class.link);
656
665
  this._suppress = supressClickHandler;
657
666
 
658
667
  if(!this._suppress) {
659
668
  this._addEventListener();
660
669
  }
661
670
  },
671
+ _openEventHandler: undefined,
672
+ _keyboardEventHandler: undefined,
662
673
  _addEventListener: function(){
663
- var openHandler = this.open.bind(this);
664
- this.dropdown.addEventListener('click', openHandler, { once: true })
674
+ this._openEventHandler = this.open.bind(this);
675
+ this._keyboardEventHandler = this.keyboardNavigation.bind(this);
676
+
677
+ this.dropdown.addEventListener('click', this._openEventHandler, { once: true });
678
+ this.dropdown.addEventListener('keydown', this._keyboardEventHandler, { once: true });
679
+
680
+ this._links.forEach(function(link) {
681
+ link.addEventListener('keydown', this._keyboardEventHandler);
682
+ }.bind(this));
665
683
  },
666
684
  close: function(text) {
667
685
  if(text) {
668
686
  this._setDropdownSelectionText(text);
669
687
  }
670
688
  this.dropdown.classList.remove(_class.expanded);
689
+ this.dropdown.setAttribute("aria-expanded", "false");
671
690
 
672
691
  if(!this._suppress){
673
692
  this._addEventListener();
@@ -696,31 +715,95 @@ Volta.dropdown = function () {
696
715
  }
697
716
 
698
717
  var text;
699
- if(parentIsPanel && Volta._hasClass(e.target, _class.label)) {
718
+ if (parentIsPanel && Volta._hasClass(e.target, _class.label)) {
700
719
  text = e.target.innerHTML;
701
- } else if (parentIsPanel) {
720
+ } else if (parentIsPanel && e.keyCode !== 27) { // esc
702
721
  var label = e.target.querySelector('.' + _class.label);
703
- if(label) {
722
+ if (label) {
704
723
  text = label.innerHTML;
705
724
  }
706
725
  }
707
726
 
727
+ document.querySelector('body').removeEventListener('click', this._closeEventHandler);
728
+ this.dropdown.removeEventListener('keydown', this._keyboardEventHandler, { once: true });
729
+ this.dropdown.removeEventListener('click', this._openEventHandler, { once: true });
730
+
731
+ this._links.forEach(function(link) {
732
+ link.removeEventListener('keydown', this._keyboardEventHandler);
733
+ }.bind(this));
734
+
708
735
  this.close(text);
736
+ },
737
+ keyboardNavigation: function(e) {
738
+ e.preventDefault();
739
+ e.stopPropagation();
740
+
741
+ if (e.keyCode === 27) { // esc
742
+ this._closeEvent(e);
743
+ }
709
744
 
710
- document.querySelector('body').removeEventListener('click', this._closeEventHandler );
745
+ if (e.code === 'ArrowDown' || e.code === 'ArrowUp' || e.code === 'Enter' || e.keyCode === 32) { // 32 = spacebar
746
+ this._links.forEach(function(link) {
747
+ link.setAttribute('tabIndex', '-1');
748
+ });
749
+
750
+ if (e.currentTarget.classList.contains(_class.wrapper)) {
751
+ this.dropdown.classList.add(_class.expanded);
752
+ this.dropdown.removeEventListener('click', this._openEventHandler, { once: true });
753
+
754
+ var selectedLink = this.dropdown.querySelector('.' + _class.selected) || this._links[0];
755
+
756
+ if (selectedLink) {
757
+ selectedLink.setAttribute('tabIndex', '0');
758
+ selectedLink.focus();
759
+ }
760
+ }
761
+
762
+ if (e.code === 'ArrowUp') {
763
+ var nextItem = e.currentTarget.previousElementSibling;
764
+ }
765
+
766
+ if (e.code === 'ArrowDown') {
767
+ var nextItem = e.currentTarget.nextElementSibling;
768
+ }
769
+
770
+ if (nextItem && nextItem.classList.contains(_class.link)) {
771
+ nextItem.setAttribute('tabIndex', '0');
772
+ nextItem.focus();
773
+ }
774
+
775
+ if (!this._suppress && e.currentTarget.classList.contains(_class.wrapper)) {
776
+ this.closeEventHandler();
777
+ }
778
+ }
779
+
780
+ if (e.code === 'Enter' && !e.currentTarget.classList.contains(_class.wrapper)) {
781
+ e.currentTarget.click();
782
+ }
711
783
  },
712
784
  open: function(event) {
713
- if(event) {
785
+ if (event) {
714
786
  event.preventDefault();
715
787
  event.stopPropagation();
716
788
  }
717
789
 
718
790
  this.dropdown.classList.add(_class.expanded);
791
+ this.dropdown.setAttribute("aria-expanded", "true");
719
792
 
720
- if(!this._suppress){
721
- this._closeEventHandler = this._closeEvent.bind(this);
722
- document.querySelector('body').addEventListener('click', this._closeEventHandler );
793
+ var selectedLink = this.dropdown.querySelector('.' + _class.selected) || this._links[0];
794
+
795
+ if (selectedLink) {
796
+ selectedLink.setAttribute('tabIndex', '0');
797
+ selectedLink.focus();
723
798
  }
799
+
800
+ if (!this._suppress) {
801
+ this.closeEventHandler();
802
+ }
803
+ },
804
+ closeEventHandler: function() {
805
+ this._closeEventHandler = this._closeEvent.bind(this);
806
+ document.querySelector('body').addEventListener('click', this._closeEventHandler);
724
807
  },
725
808
  _setDropdownSelectionText: function(text) {
726
809
  if(this.isSelectionVisible) {
@@ -1308,9 +1391,6 @@ Volta.tab = function () {
1308
1391
 
1309
1392
  link.index = index;
1310
1393
  link.addEventListener('keyup', _this._keyUpEventListener.bind(_this));
1311
- link.addEventListener('toggle', function () {
1312
- _this.toggle(link);
1313
- });
1314
1394
  link.addEventListener('click', function () {
1315
1395
  _this.toggle(link);
1316
1396
  });
@@ -1375,6 +1455,7 @@ Volta.tab = function () {
1375
1455
 
1376
1456
  this._activeLink.setAttribute('tabindex', '0');
1377
1457
  this._activeLink.setAttribute('aria-selected', 'true');
1458
+ this._activeLink.focus();
1378
1459
  if (this._activePanel) {
1379
1460
  this._activePanel.removeAttribute('hidden');
1380
1461
  }
@@ -1538,12 +1619,10 @@ Volta.tooltip = function () {
1538
1619
  left: 'Vlt-tooltip--left',
1539
1620
  tooltip: 'Vlt-tooltip',
1540
1621
  top: 'Vlt-tooltip--top',
1541
- right: 'Vlt-tooltip--right'
1622
+ right: 'Vlt-tooltip--right',
1623
+ large: 'Vlt-tooltip--large'
1542
1624
  }
1543
1625
 
1544
- var currentTooltip = undefined,
1545
- currentTooltipContent = undefined;
1546
-
1547
1626
  return {
1548
1627
  create: create,
1549
1628
  init: attachTooltipHandlers
@@ -1567,6 +1646,7 @@ Volta.tooltip = function () {
1567
1646
  */
1568
1647
  function create(tooltip) {
1569
1648
  var placement;
1649
+ var size;
1570
1650
 
1571
1651
  if (Volta._hasClass(tooltip, _class.bottom)) {
1572
1652
  placement = 'bottom';
@@ -1578,10 +1658,16 @@ Volta.tooltip = function () {
1578
1658
  placement = 'right';
1579
1659
  }
1580
1660
 
1661
+ if (Volta._hasClass(tooltip, _class.large)) {
1662
+ size = ' Vlt-tooltip--large';
1663
+ } else {
1664
+ size='';
1665
+ }
1666
+
1581
1667
  var template =
1582
- '<div class="Vlt-tooltip--js" role="tooltip">' +
1583
- '<div class="tooltip-arrow Vlt-tooltip__arrow"></div>' +
1584
- '<div class="tooltip-inner Vlt-tooltip__content"></div>' +
1668
+ '<div class="Vlt-tooltip--js' + size + '" role="tooltip">' +
1669
+ '<div class="tooltip-arrow Vlt-tooltip__arrow"></div>' +
1670
+ '<div class="tooltip-inner Vlt-tooltip__content"></div>' +
1585
1671
  '</div>';
1586
1672
 
1587
1673
  var title = tooltip.title;
@@ -2142,4 +2228,5 @@ Volta.menu = function () {
2142
2228
  }
2143
2229
  }();
2144
2230
 
2231
+
2145
2232
  export default Volta;