blacklight-gallery 4.5.4 → 4.6.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: e3be75dee9c5f78414f77d47940c36dc5ddf47725dd09547ea4e03cd8d5b803d
4
- data.tar.gz: 4dfb92722fcaf7233321db99aa46316accd61972da2160da2b7dfebc5548046e
3
+ metadata.gz: b3f0a42b90e61a4eb36e76d0be574f4d8f3f2a8c55afb3de20e69bca1f88a086
4
+ data.tar.gz: b74abe92f757dd6a2cfd6a7043364915a591030fd1bd6560bb6f64f973d80f94
5
5
  SHA512:
6
- metadata.gz: dc5997b7fea7e04c1d3d5cf2124daa02aec25a784411df4ea8904fc6db82550bcbcb670d7d46f2ecba63a51575a67363dfdd8780162b8b8e1c6ecf502d4d3a0e
7
- data.tar.gz: 957e12b77b748b861e9e55de8390a4339ae7fa95837eed47c2ad71d1185e74587bea54ff282e08773e7c989df04789b2fb64a446747e3ba6dbe29dc015402cbb
6
+ metadata.gz: 6bdc5e6d5bb2eba2f1d425513ce9d8623e73968734601c2fc239cb9937b809cfb7b86a6e3334ace2cd4c4a0d3155448597258b259f2d66ed329c95f43d2e5c77
7
+ data.tar.gz: f8019948c79a90819b928c8548430fd7df8dce919de4f3d3e0a331ab54e344c4d7ed2f987c9df937f308663ca360c6cde6a751b06edeebfc1f3458423b9ad48d
@@ -2,9 +2,9 @@ name: CI
2
2
 
3
3
  on:
4
4
  push:
5
- branches: [ main ]
5
+ branches: [main]
6
6
  pull_request:
7
- branches: [ main ]
7
+ branches: [main]
8
8
 
9
9
  jobs:
10
10
  test:
@@ -13,42 +13,45 @@ 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: [2.7, '3.0']
17
- rails_version: ['6.1.7', '7.0.4']
18
- blacklight_version: ['~> 7.0']
16
+ ruby: ["3.2", "3.3"]
17
+ rails_version: ["7.0.4"]
18
+ blacklight_version: ["~> 7.0"]
19
19
  experimental: [false]
20
- additional_engine_cart_rails_options: ['']
21
- additional_name: ['']
20
+ additional_engine_cart_rails_options: [""]
21
+ additional_name: [""]
22
22
  include:
23
- - ruby: '3.1'
24
- rails_version: '7.0.4'
25
- blacklight_version: '~> 7.0'
26
- experimental: false
27
- - ruby: '3.2'
28
- rails_version: '7.0.4'
29
- blacklight_version: '~> 8.0'
30
- experimental: false
31
- - ruby: '3.2'
32
- rails_version: '7.0.4'
33
- blacklight_version: 'github'
34
- experimental: true
35
- - ruby: '3.2'
36
- rails_version: '7.0.4'
37
- blacklight_version: 'github'
38
- experimental: true
39
- additional_engine_cart_rails_options: -a propshaft
40
- additional_name: '/ Propshaft'
23
+ - ruby: "3.1"
24
+ rails_version: 6.1.7
25
+ blacklight_version: "~> 7.0"
26
+ experimental: false
27
+ additional_name: Rails 6.1, Ruby 3.1
28
+ - ruby: "3.2"
29
+ rails_version: "7.0.4"
30
+ blacklight_version: "~> 8.0"
31
+ experimental: false
32
+ additional_name: Blacklight 8
33
+ - ruby: "3.2"
34
+ rails_version: "7.0.4"
35
+ blacklight_version: "github"
36
+ experimental: true
37
+ additional_name: Blacklight main branch
38
+ - ruby: "3.2"
39
+ rails_version: "7.0.4"
40
+ blacklight_version: "github"
41
+ experimental: true
42
+ additional_engine_cart_rails_options: -a propshaft
43
+ additional_name: "/ Propshaft"
41
44
  env:
42
45
  RAILS_VERSION: ${{ matrix.rails_version }}
43
46
  BLACKLIGHT_VERSION: ${{ matrix.blacklight_version }}
44
47
  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 }}"
45
48
  steps:
46
- - uses: actions/checkout@v4
47
- - name: Set up Ruby ${{ matrix.ruby }}
48
- uses: ruby/setup-ruby@v1
49
- with:
50
- ruby-version: ${{ matrix.ruby }}
51
- - name: Install dependencies with Rails ${{ matrix.rails_version }}
52
- run: bundle install
53
- - name: Run tests
54
- run: bundle exec rake
49
+ - uses: actions/checkout@v4
50
+ - name: Set up Ruby ${{ matrix.ruby }}
51
+ uses: ruby/setup-ruby@v1
52
+ with:
53
+ ruby-version: ${{ matrix.ruby }}
54
+ - name: Install dependencies with Rails ${{ matrix.rails_version }}
55
+ run: bundle install
56
+ - name: Run tests
57
+ run: bundle exec rake
@@ -0,0 +1,19 @@
1
+ <div class="openseadragon-container <%= class_names(classes) %>">
2
+ <div class="osd-toolbar row">
3
+ <div class="col-md-6 pagination">
4
+ <% if count > 1 %>
5
+ <% osd_config = osd_config_referencestrip.merge(osd_config) %>
6
+ <a id="<%= id_prefix %>-previous"><%= render Blacklight::Gallery::Icons::ChevronLeftComponent.new %></a>
7
+ <span id="<%= id_prefix %>-page">1</span> of <%= count %>
8
+ <a id="<%= id_prefix %>-next"><%= render Blacklight::Gallery::Icons::ChevronRightComponent.new %></a>
9
+ <% end %>
10
+ </div>
11
+ <div class="col-md-6 controls">
12
+ <a id="<%= id_prefix %>-zoom-in"><%= render Blacklight::Gallery::Icons::AddCircleComponent.new %></a>
13
+ <a id="<%= id_prefix %>-zoom-out"><%= render Blacklight::Gallery::Icons::RemoveCircleComponent.new %></a>
14
+ <a id="<%= id_prefix %>-home"><%= render Blacklight::Gallery::Icons::ResizeSmallComponent.new %></a>
15
+ <a id="<%= id_prefix %>-full-page"><%= render Blacklight::Gallery::Icons::CustomFullscreenComponent.new %></a>
16
+ </div>
17
+ </div>
18
+ <%= helpers.openseadragon_picture_tag image, class: 'osd-image row', data: { openseadragon: osd_config } %>
19
+ </div>
@@ -0,0 +1,60 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Blacklight
4
+ module Gallery
5
+ class OpenseadragonEmbedComponent < Blacklight::Component
6
+ attr_reader :document, :presenter, :classes
7
+
8
+ def initialize(document:, presenter:, view_config: nil, classes: [], **kwargs)
9
+ super
10
+
11
+ @document = document
12
+ @presenter = presenter
13
+ @view_config = view_config
14
+ @classes = classes
15
+ end
16
+
17
+ def image
18
+ @image ||= document.to_openseadragon(view_config)
19
+ end
20
+
21
+ def count
22
+ Array(image).length
23
+ end
24
+
25
+ def view_config
26
+ @view_config || presenter.view_config
27
+ end
28
+
29
+ def render?
30
+ !image.nil?
31
+ end
32
+
33
+ def osd_config
34
+ {
35
+ crossOriginPolicy: false,
36
+ zoomInButton: "#{id_prefix}-zoom-in",
37
+ zoomOutButton: "#{id_prefix}-zoom-out",
38
+ homeButton: "#{id_prefix}-home",
39
+ fullPageButton: "#{id_prefix}-full-page",
40
+ nextButton: "#{id_prefix}-next",
41
+ previousButton: "#{id_prefix}-previous"
42
+ }
43
+ end
44
+
45
+ def osd_config_referencestrip
46
+ {
47
+ showReferenceStrip: true,
48
+ referenceStripPosition: 'OUTSIDE',
49
+ referenceStripScroll: 'vertical',
50
+ referenceStripWidth: 100,
51
+ referenceStripBackgroundColor: 'transparent'
52
+ }
53
+ end
54
+
55
+ def id_prefix
56
+ "osd-#{Blacklight::OpenseadragonHelper.mint_id}".to_param
57
+ end
58
+ end
59
+ end
60
+ end
@@ -14,9 +14,10 @@ module Blacklight
14
14
  end
15
15
 
16
16
  def osd_container_class
17
- "col-md-6"
17
+ 'col-md-6'
18
18
  end
19
19
 
20
+ # @deprecated
20
21
  def osd_html_id_prefix
21
22
  "osd-#{Blacklight::OpenseadragonHelper.mint_id}".to_param
22
23
  end
@@ -1,48 +1 @@
1
- <%
2
- view_config = local_assigns[:view_config] || blacklight_config&.view_config(:show)
3
- image = document.to_openseadragon(view_config)
4
- id_prefix = osd_html_id_prefix
5
- %>
6
- <%
7
- osd_config = {
8
- crossOriginPolicy: false,
9
- zoomInButton: "#{id_prefix}-zoom-in",
10
- zoomOutButton: "#{id_prefix}-zoom-out",
11
- homeButton: "#{id_prefix}-home",
12
- fullPageButton: "#{id_prefix}-full-page",
13
- nextButton: "#{id_prefix}-next",
14
- previousButton: "#{id_prefix}-previous"
15
- }
16
-
17
- osd_config_referencestrip = {
18
- showReferenceStrip: true,
19
- referenceStripPosition: 'OUTSIDE',
20
- referenceStripScroll: 'vertical',
21
- referenceStripWidth: 100,
22
- referenceStripBackgroundColor: 'transparent'
23
- }
24
- %>
25
-
26
- <% unless image.nil? %>
27
- <% count = Array(image).length %>
28
- <div class="openseadragon-container <%= osd_container_class %>">
29
- <div class="osd-toolbar row">
30
- <div class="col-md-6 pagination">
31
- <% if count > 1 %>
32
- <% osd_config = osd_config_referencestrip.merge(osd_config) %>
33
- <a id="<%= id_prefix %>-previous"><%= render Blacklight::Gallery::Icons::ChevronLeftComponent.new %></a>
34
- <span id="<%= id_prefix %>-page">1</span> of <%= count %>
35
- <a id="<%= id_prefix %>-next"><%= render Blacklight::Gallery::Icons::ChevronRightComponent.new %></a>
36
- <% end %>
37
- </div>
38
- <div class="col-md-6 controls">
39
- <a id="<%= id_prefix %>-zoom-in"><%= render Blacklight::Gallery::Icons::AddCircleComponent.new %></a>
40
- <a id="<%= id_prefix %>-zoom-out"><%= render Blacklight::Gallery::Icons::RemoveCircleComponent.new %></a>
41
- <a id="<%= id_prefix %>-home"><%= render Blacklight::Gallery::Icons::ResizeSmallComponent.new %></a>
42
- <a id="<%= id_prefix %>-full-page"><%= render Blacklight::Gallery::Icons::CustomFullscreenComponent.new %></a>
43
- </div>
44
- </div>
45
- <%= openseadragon_picture_tag image, class: 'osd-image row', data: { openseadragon: osd_config } %>
46
- </div>
47
-
48
- <% end %>
1
+ <%= render Blacklight::Gallery::OpenseadragonEmbedComponent.new(document: document, presenter: document_presenter(document), view_config: local_assigns[:view_config], classes: [osd_container_class]) %>
@@ -1,5 +1,5 @@
1
1
  module Blacklight
2
2
  module Gallery
3
- VERSION = "4.5.4"
3
+ VERSION = "4.6.0"
4
4
  end
5
5
  end
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- RSpec.describe 'Slideshow', default_max_wait_time: 10, js: true do
3
+ RSpec.describe 'Slideshow', default_max_wait_time: 20, js: true do
4
4
 
5
5
  it 'opens when one of the grid panes is clicked' do
6
6
  visit search_catalog_path( q: 'medicine', view: 'slideshow' )
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blacklight-gallery
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.5.4
4
+ version: 4.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Beer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-09-18 00:00:00.000000000 Z
11
+ date: 2024-09-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -239,6 +239,8 @@ files:
239
239
  - app/components/blacklight/gallery/icons/resize_small_component.rb
240
240
  - app/components/blacklight/gallery/icons/slideshow_component.rb
241
241
  - app/components/blacklight/gallery/icons/start_slideshow_component.rb
242
+ - app/components/blacklight/gallery/openseadragon_embed_component.html.erb
243
+ - app/components/blacklight/gallery/openseadragon_embed_component.rb
242
244
  - app/components/blacklight/gallery/slideshow_component.html.erb
243
245
  - app/components/blacklight/gallery/slideshow_component.rb
244
246
  - app/components/blacklight/gallery/slideshow_preview_component.html.erb
@@ -319,7 +321,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
319
321
  - !ruby/object:Gem::Version
320
322
  version: '0'
321
323
  requirements: []
322
- rubygems_version: 3.5.10
324
+ rubygems_version: 3.5.9
323
325
  signing_key:
324
326
  specification_version: 4
325
327
  summary: Gallery display for Blacklight