bs5 0.0.22 → 0.0.23

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: feb6bdfa563dc0c4a846de69be606f33deacb0eca228319bb670b2f668103ce2
4
- data.tar.gz: 51fd44d6cf62d4fcb10aa237f9eb0b1b4e5451bd77235d209c735f991b3eb830
3
+ metadata.gz: fde2cc4be44c7ef1b396e7761904765ee31f1801acb7a88b1f4507cf302994c2
4
+ data.tar.gz: d69a795e889ece4139479843c7e2e5f6ffa48df347f0463529513060c1401214
5
5
  SHA512:
6
- metadata.gz: 0cd5058a2b39382182e3f3de2138f0b9c19f0c700c61ff64e7b92e889bc765cb8c292ea69e6c4fba87d3f649756c22b6901c8c8a2f989191672758e66ccc6994
7
- data.tar.gz: 63705942d873ecd5ddee1cfe12cc0144b24d8c842319d389fb0eeef545b0d45eaab6f3b8133863a8885af811fc1b5c0d896e96c797470f8c5a7b128e86567d09
6
+ metadata.gz: 4474fe20875677d9e8f45ca929d8e3ee95d6919a65065d472d2e12d9b74b765c6f491398b7691b8bf85b8a35d2b4cdc807839648f007a4836c47768ab865ac74
7
+ data.tar.gz: d70751a40bda629d0ba59324cab991b94dca962248ec22625edd36344750476830ed655a4fd21c3b3e3a7b133609217c33267c96df3af39125a3600f3be5539b
@@ -1 +1,2 @@
1
1
  //= link_directory ../stylesheets/bs5 .css
2
+ //= link_directory ../javascripts/bs5 .js
@@ -0,0 +1,13 @@
1
+ window.addEventListener("load", initBs5);
2
+ window.addEventListener("turbolinks:load", initBs5);
3
+
4
+ function initBs5(event) {
5
+ document.querySelectorAll('[data-bs5="copy"]').forEach(function (item) {
6
+ item.addEventListener("click", handleBs5CopyButtonClick);
7
+ });
8
+ }
9
+
10
+ function handleBs5CopyButtonClick(event) {
11
+ var code = event.target.closest("div").querySelector("code").innerText;
12
+ navigator.clipboard.writeText(code);
13
+ }
@@ -2,7 +2,8 @@
2
2
  <div class="border rounded-2 p-4">
3
3
  <%= render template: snippet %>
4
4
  </div>
5
- <div class="highlight p-4">
5
+ <div class="highlight p-4 position-relative">
6
+ <%= bs5_button_tag('Copy', color: :primary, outline: true, size: :small, class: 'position-absolute top-0 end-0 mt-2 me-2', data: { bs5: 'copy' }) %>
6
7
  <pre class='mb-0'><code><%= highlight %></code></pre>
7
8
  </div>
8
9
  </div>
@@ -4,6 +4,7 @@
4
4
  <title>Bs5</title>
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1">
6
6
  <%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %>
7
+ <%= javascript_include_tag 'bs5/application', 'data-turbolinks-track': 'reload' %>
7
8
  <%= stylesheet_pack_tag 'styles', media: 'all', 'data-turbolinks-track': 'reload' %>
8
9
  <style><%= Rouge::Themes::Github.render(scope: '.highlight') %></style>
9
10
  </head>
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'view_component/engine'
4
+ require 'sprockets/railtie'
4
5
  module Bs5
5
6
  class Engine < ::Rails::Engine
6
7
  isolate_namespace Bs5
@@ -9,5 +10,10 @@ module Bs5
9
10
  config.before_configuration do |app|
10
11
  app.config.view_component.preview_paths << "#{Bs5::Engine.root}/spec/components/previews"
11
12
  end
13
+
14
+ initializer 'bs5.assets.precompile' do |app|
15
+ app.config.assets.paths << Rails.root.join('app/assets/javascripts')
16
+ app.config.assets.precompile << 'bs5/application.js'
17
+ end
12
18
  end
13
19
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bs5
4
- VERSION = '0.0.22'
4
+ VERSION = '0.0.23'
5
5
  end
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- return unless defined?(RuboCop)
4
-
5
3
  require 'rubocop/rake_task'
6
4
 
7
5
  RuboCop::RakeTask.new(:rubocop)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bs5
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.22
4
+ version: 0.0.23
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrick Baselier
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-12 00:00:00.000000000 Z
11
+ date: 2020-12-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -100,20 +100,6 @@ dependencies:
100
100
  - - "~>"
101
101
  - !ruby/object:Gem::Version
102
102
  version: 4.0.1
103
- - !ruby/object:Gem::Dependency
104
- name: rubocop-rails
105
- requirement: !ruby/object:Gem::Requirement
106
- requirements:
107
- - - "~>"
108
- - !ruby/object:Gem::Version
109
- version: '2.8'
110
- type: :development
111
- prerelease: false
112
- version_requirements: !ruby/object:Gem::Requirement
113
- requirements:
114
- - - "~>"
115
- - !ruby/object:Gem::Version
116
- version: '2.8'
117
103
  - !ruby/object:Gem::Dependency
118
104
  name: sqlite3
119
105
  requirement: !ruby/object:Gem::Requirement
@@ -139,6 +125,7 @@ files:
139
125
  - README.md
140
126
  - Rakefile
141
127
  - app/assets/config/bs5_manifest.js
128
+ - app/assets/javascripts/bs5/application.js
142
129
  - app/assets/stylesheets/bs5/application.css
143
130
  - app/components/bs5/accordion_component.html.erb
144
131
  - app/components/bs5/accordion_component.rb