blacklight-gallery 6.0.0 → 6.1.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.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/.env +2 -0
  3. data/.github/workflows/ruby.yml +10 -26
  4. data/Gemfile +5 -12
  5. data/README.md +3 -5
  6. data/Rakefile +53 -32
  7. data/app/assets/config/blacklight_gallery/manifest.js +0 -1
  8. data/app/assets/javascripts/blacklight_gallery/blacklight-gallery.esm.js +959 -484
  9. data/app/assets/javascripts/blacklight_gallery/blacklight-gallery.esm.js.map +1 -1
  10. data/app/assets/javascripts/blacklight_gallery/blacklight-gallery.js +959 -484
  11. data/app/assets/javascripts/blacklight_gallery/blacklight-gallery.js.map +1 -1
  12. data/app/assets/stylesheets/blacklight_gallery/masonry.css +9 -3
  13. data/app/assets/stylesheets/blacklight_gallery/slideshow.css +2 -13
  14. data/app/components/blacklight/gallery/document_component.html.erb +1 -5
  15. data/app/components/blacklight/gallery/document_component.rb +0 -4
  16. data/app/components/blacklight/gallery/openseadragon_embed_component.rb +4 -5
  17. data/app/components/blacklight/gallery/slideshow_component.html.erb +1 -1
  18. data/app/components/blacklight/gallery/slideshow_component.rb +3 -6
  19. data/app/{views/catalog/_slideshow_modal.html.erb → components/blacklight/gallery/slideshow_modal_component.html.erb} +2 -3
  20. data/app/components/blacklight/gallery/slideshow_modal_component.rb +6 -0
  21. data/app/components/blacklight/gallery/slideshow_presenter_component.html.erb +14 -0
  22. data/app/components/blacklight/gallery/slideshow_presenter_component.rb +17 -0
  23. data/app/components/blacklight/gallery/slideshow_preview_component.html.erb +1 -5
  24. data/app/components/blacklight/gallery/slideshow_preview_component.rb +0 -13
  25. data/app/javascript/blacklight-gallery/grid-lanes-polyfill.js +1067 -0
  26. data/app/javascript/blacklight-gallery/index.js +18 -4
  27. data/app/views/catalog/_document_gallery.html.erb +1 -1
  28. data/app/views/catalog/_document_masonry.html.erb +1 -1
  29. data/app/views/catalog/_document_slideshow.html.erb +5 -25
  30. data/app/views/catalog/_openseadragon_default.html.erb +1 -1
  31. data/blacklight-gallery.gemspec +19 -20
  32. data/compose.yaml +18 -0
  33. data/config/importmap.rb +0 -1
  34. data/config/locales/blacklight-gallery.ar.yml +0 -3
  35. data/config/locales/blacklight-gallery.de.yml +3 -0
  36. data/config/locales/blacklight-gallery.en.yml +0 -3
  37. data/config/locales/blacklight-gallery.es.yml +3 -3
  38. data/config/locales/blacklight-gallery.fr.yml +3 -3
  39. data/config/locales/blacklight-gallery.it.yml +3 -3
  40. data/config/locales/blacklight-gallery.pt-BR.yml +3 -3
  41. data/config/locales/blacklight-gallery.zh.yml +3 -3
  42. data/lib/blacklight/gallery/version.rb +1 -1
  43. data/lib/generators/blacklight_gallery/install_generator.rb +15 -29
  44. data/package.json +2 -4
  45. data/rollup.config.js +13 -16
  46. data/spec/components/blacklight/gallery/document_component_spec.rb +2 -10
  47. data/spec/components/blacklight/gallery/openseadragon_embed_component_spec.rb +1 -6
  48. data/spec/components/blacklight/gallery/slideshow_component_spec.rb +28 -25
  49. data/spec/components/blacklight/gallery/slideshow_preview_component_spec.rb +3 -12
  50. data/spec/features/slideshow_spec.rb +23 -1
  51. data/spec/views/catalog/_document_slideshow.html.erb_spec.rb +6 -10
  52. metadata +49 -53
  53. data/app/components/blacklight/gallery/icons/pause_slideshow_component.rb +0 -18
  54. data/app/components/blacklight/gallery/icons/start_slideshow_component.rb +0 -18
  55. data/app/javascript/blacklight-gallery/masonry.js +0 -12
  56. data/app/javascript/blacklight-gallery/slideshow.js +0 -122
  57. data/vendor/assets/javascripts/imagesloaded.pkgd.js +0 -441
  58. data/vendor/assets/javascripts/masonry.min.js +0 -9
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: afc388305ae4f5c94d0db93b84263384c06fd63ceceb1fdb1ba1a6de3dd63df0
4
- data.tar.gz: 07edb913bd3e3ef52416f195f2e931401da662ccdd290f183d0c56173fc1fc43
3
+ metadata.gz: e46d19afef2a73a0d960fc1ad28a8ae3d6e3a226dc574471be1c741511ae9d02
4
+ data.tar.gz: 06eacaef480be2254d90bb5eee685983428c650992ac7d05a2271f43f6bf05a0
5
5
  SHA512:
6
- metadata.gz: 6d83d6abd455fe7816d959d6e77156090e9476440d6763e3d0ce0bd97eda0e0ed4e4b4fff90b61818dd2871bd835fddc1df0f1faf4792e70468fbffc3c2ac319
7
- data.tar.gz: 88daf8b07b7433adb30ee28b36d25fabe2407003f768d48e9a6f2322e0bf826a14b0459884442e160e1d6bf50cc0bb4a8810f6be10bc5e4bf22209d81753e16c
6
+ metadata.gz: d83f792de40711259077f22f486ca0d13abb06c2ca7ae6bdfdd7bf304087adc5dfbf1b317b471abd283eaa60222d26de2bb8ccd2c7d7765adeb0354a3513d942
7
+ data.tar.gz: '095c95d7bf7009a46d89561554ffde63cc2a65f47d08b2ba5118206ab028913cb9078ebcc6485a18592b2e4d9dec4d23b44e402083d35a16e5ef7af42c908195'
data/.env ADDED
@@ -0,0 +1,2 @@
1
+ SOLR_VERSION=9.6.1
2
+ SOLR_PORT=8983
@@ -13,43 +13,27 @@ jobs:
13
13
  name: test (ruby ${{ matrix.ruby }} / rails ${{ matrix.rails_version }} / blacklight ${{ matrix.blacklight_version }} ${{ matrix.additional_name }})
14
14
  strategy:
15
15
  matrix:
16
- ruby: ["3.2", "3.3", "3.4"]
17
- rails_version: ["8.0.1"]
18
- blacklight_version: ["~> 9.0.0beta1"]
16
+ ruby: ["3.3", "3.4", "4.0"]
17
+ rails_version: ["8.1.3"]
18
+ blacklight_version: ["~> 9.0"]
19
19
  experimental: [false]
20
20
  additional_engine_cart_rails_options: [""] # default: propshaft, bootstrap, importmaps
21
21
  additional_name: [""]
22
22
  include:
23
23
  - ruby: "3.4"
24
- rails_version: "7.2.2.1"
25
- blacklight_version: "~> 9.0.0beta1"
24
+ rails_version: "7.2.3.1"
26
25
  experimental: false
27
- additional_engine_cart_rails_options: ""
28
- additional_name: ""
29
- - ruby: "3.2"
30
- rails_version: "7.1.5.1"
31
- blacklight_version: "~> 9.0.0beta1"
32
- experimental: false
33
- additional_engine_cart_rails_options: ""
34
- additional_name: ""
35
- - ruby: "3.4"
36
- rails_version: "7.2.2.1"
37
- blacklight_version: "github"
38
- experimental: true
39
- additional_engine_cart_rails_options: ""
40
- additional_name: "/ Blacklight main"
26
+ additional_name: "Rails 7.2"
41
27
  - ruby: "3.4"
42
- rails_version: "8.0.1"
43
- blacklight_version: "github"
44
- experimental: true
45
- additional_engine_cart_rails_options: ""
46
- additional_name: "/ Blacklight main"
28
+ rails_version: "8.0.5"
29
+ experimental: false
30
+ additional_name: "Rails 8.0"
47
31
  env:
48
32
  RAILS_VERSION: ${{ matrix.rails_version }}
49
33
  BLACKLIGHT_VERSION: ${{ matrix.blacklight_version }}
50
- ENGINE_CART_RAILS_OPTIONS: "--skip-git --skip-listen --skip-spring --skip-keeps --skip-action-cable --skip-coffee --skip-test ${{ matrix.additional_engine_cart_rails_options }}"
34
+ ENGINE_CART_RAILS_OPTIONS: "--skip-git --skip-listen --skip-spring --skip-keeps --skip-action-cable --skip-coffee --skip-kamal --skip-solid --skip-thruster --skip-docker --skip-test ${{ matrix.additional_engine_cart_rails_options }}"
51
35
  steps:
52
- - uses: actions/checkout@v4
36
+ - uses: actions/checkout@v6
53
37
  - name: Set up Ruby ${{ matrix.ruby }}
54
38
  uses: ruby/setup-ruby@v1
55
39
  with:
data/Gemfile CHANGED
@@ -1,20 +1,15 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in blacklight-gallery.gemspec
4
- gemspec
5
-
6
- git_source(:github) do |repo_name|
7
- repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?('/')
8
- "https://github.com/#{repo_name}.git"
9
- end
10
-
11
- gem 'activerecord-jdbcsqlite3-adapter', :platform => :jruby
4
+ gemspec path: File.expand_path(__dir__)
12
5
 
13
6
  # BEGIN ENGINE_CART BLOCK
14
7
  # engine_cart: 2.5.0
15
8
  # engine_cart stanza: 2.5.0
16
9
  # the below comes from engine_cart, a gem used to test this Rails engine gem in the context of a Rails app.
17
- file = File.expand_path('Gemfile', ENV['ENGINE_CART_DESTINATION'] || ENV['RAILS_ROOT'] || File.expand_path('.internal_test_app', File.dirname(__FILE__)))
10
+ file = File.expand_path('Gemfile',
11
+ ENV['ENGINE_CART_DESTINATION'] || ENV['RAILS_ROOT'] || File.expand_path('.internal_test_app',
12
+ File.dirname(__FILE__)))
18
13
  if File.exist?(file)
19
14
  begin
20
15
  eval_gemfile file
@@ -36,6 +31,4 @@ else
36
31
  end
37
32
  # END ENGINE_CART BLOCK
38
33
 
39
- unless File.exist?(file)
40
- eval_gemfile File.expand_path('spec/test_app_templates/Gemfile.extra', File.dirname(__FILE__))
41
- end
34
+ eval_gemfile File.expand_path('spec/test_app_templates/Gemfile.extra', File.dirname(__FILE__)) unless File.exist?(file)
data/README.md CHANGED
@@ -11,7 +11,7 @@ Add this line to your Blacklight application's Gemfile:
11
11
 
12
12
  And then execute:
13
13
 
14
- $ bundle
14
+ $ bundle install
15
15
 
16
16
  Or install it yourself as:
17
17
 
@@ -29,11 +29,9 @@ $ rails g blacklight_gallery:install
29
29
 
30
30
  ### Installation for Node-based JS bundlers
31
31
 
32
- For node-based bundlers add `blacklight-gallery masonry-layout@v4` as a dependency and add this to your entrypoint:
32
+ For node-based bundlers add this to your entrypoint:
33
33
  ```js
34
- import 'blacklight-gallery/vendor/assets/javascripts/imagesloaded.pkgd.js'
35
- import 'blacklight-gallery/app/javascript/blacklight-gallery/slideshow'
36
- import 'blacklight-gallery/app/javascript/blacklight-gallery/masonry'
34
+ import 'blacklight-gallery'
37
35
  ```
38
36
 
39
37
  ## Manual Installation
data/Rakefile CHANGED
@@ -1,13 +1,42 @@
1
- require "bundler/gem_tasks"
1
+ require 'bundler/gem_tasks'
2
2
 
3
3
  APP_ROOT = File.dirname(__FILE__)
4
4
 
5
5
  require 'rspec/core/rake_task'
6
6
  require 'engine_cart/rake_task'
7
+ require 'open3'
8
+
9
+ def system_with_error_handling(*args)
10
+ Open3.popen3(*args) do |_stdin, stdout, stderr, thread|
11
+ puts stdout.read
12
+ raise "Unable to run #{args.inspect}: #{stderr.read}" unless thread.value.success?
13
+ end
14
+ end
15
+
16
+ def with_solr(&block)
17
+ # We're being invoked by the app entrypoint script and solr is already up via docker compose
18
+ if ENV['SOLR_ENV'] == 'docker-compose'
19
+ yield
20
+ elsif system('docker compose version')
21
+ # We're not running `docker compose up' but still want to use a docker instance of solr.
22
+ begin
23
+ puts 'Starting Solr'
24
+ system_with_error_handling 'docker compose up -d solr'
25
+ yield
26
+ ensure
27
+ puts 'Stopping Solr'
28
+ system_with_error_handling 'docker compose stop solr'
29
+ end
30
+ else
31
+ SolrWrapper.wrap do |solr|
32
+ solr.with_collection(&block)
33
+ end
34
+ end
35
+ end
7
36
 
8
37
  RSpec::Core::RakeTask.new(:spec)
9
38
 
10
- task :default => :ci
39
+ task default: :ci
11
40
 
12
41
  # Build with our opinionated defaults if none are provided.
13
42
  rails_options = ENV.fetch('ENGINE_CART_RAILS_OPTIONS', '')
@@ -15,45 +44,37 @@ rails_options = "#{rails_options} -a propshaft" unless rails_options.match?(/-a\
15
44
  rails_options = "#{rails_options} -j importmap" unless rails_options.match?(/-j\s|--javascript/)
16
45
  ENV['ENGINE_CART_RAILS_OPTIONS'] = rails_options
17
46
 
18
- desc "Load fixtures"
19
- task :fixtures => ['engine_cart:generate'] do
47
+ desc 'Load fixtures'
48
+ task fixtures: ['engine_cart:generate'] do
20
49
  within_test_app do
21
- system "rake blacklight:index:seed RAILS_ENV=test"
22
- abort "Error running fixtures" unless $?.success?
50
+ system 'rake blacklight:index:seed RAILS_ENV=test'
51
+ abort 'Error running fixtures' unless $?.success?
23
52
  end
24
53
  end
25
54
 
26
- desc "Execute Continuous Integration build"
27
- task :ci => ['engine_cart:generate'] do
28
- require 'solr_wrapper'
29
- SolrWrapper.wrap(port: '8983') do |solr|
30
- solr.with_collection(name: 'blacklight-core', dir: File.join(File.expand_path(File.dirname(__FILE__)), 'solr', 'conf')) do
31
- within_test_app do
32
- # Precompiles the assets
33
- `bin/rails spec:prepare`
34
- end
35
-
36
- Rake::Task['fixtures'].invoke
37
- Rake::Task['spec'].invoke
55
+ desc 'Execute Continuous Integration build'
56
+ task :ci do
57
+ with_solr do
58
+ Rake::Task['fixtures'].invoke
59
+ within_test_app do
60
+ # Precompiles the assets
61
+ `bin/rails spec:prepare`
38
62
  end
63
+ Rake::Task['spec'].invoke
39
64
  end
40
65
  end
41
66
 
42
- desc "Run Solr and Blacklight for interactive development"
67
+ desc 'Run Solr and Blacklight for interactive development'
43
68
  task :server do
44
- require 'solr_wrapper'
45
- SolrWrapper.wrap(port: '8983') do |solr|
46
- solr.with_collection(name: 'blacklight-core',
47
- dir: File.join(__dir__, 'solr', 'conf')) do
48
- within_test_app do
49
- # Set `FILE` to the local fixture so we get thumbnails
50
- ENV['FILE'] = File.join(__dir__, 'spec', 'fixtures', 'sample_solr_documents.yml')
51
- system 'rake blacklight:index:seed'
52
- ENV.delete('FILE')
53
-
54
- system "yarn build:css"
55
- system "bundle exec rails s"
56
- end
69
+ with_solr do
70
+ within_test_app do
71
+ # Set `FILE` to the local fixture so we get thumbnails
72
+ ENV['FILE'] = File.join(__dir__, 'spec', 'fixtures', 'sample_solr_documents.yml')
73
+ system 'rake blacklight:index:seed'
74
+ ENV.delete('FILE')
75
+
76
+ system 'yarn build:css'
77
+ system 'bundle exec rails s'
57
78
  end
58
79
  end
59
80
  end
@@ -1,2 +1 @@
1
1
  //= link_tree ../../../javascript .js
2
- //= link_tree ../../../../vendor/assets/javascripts .js