blacklight-gallery 4.9.0 → 5.0.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 +4 -4
- data/README.md +29 -85
- data/Rakefile +9 -3
- data/app/assets/javascripts/blacklight_gallery/blacklight-gallery.esm.js +0 -11
- data/app/assets/javascripts/blacklight_gallery/blacklight-gallery.esm.js.map +1 -1
- data/app/assets/javascripts/blacklight_gallery/blacklight-gallery.js +4 -14
- data/app/assets/javascripts/blacklight_gallery/blacklight-gallery.js.map +1 -1
- data/app/javascript/blacklight-gallery/masonry.js +0 -6
- data/app/javascript/blacklight-gallery/slideshow.js +0 -7
- data/lib/blacklight/gallery/version.rb +1 -1
- data/lib/generators/blacklight_gallery/install_generator.rb +57 -2
- data/package.json +1 -1
- data/spec/features/slideshow_spec.rb +1 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 13baf24ed76a1d17d236045a5c0cc02d58c9c6705f5d65b522931c3e195c6cb9
|
4
|
+
data.tar.gz: f79f91f11e213e7faa9afbf8e482cb3e28dd128aac06febc89d9f6e949cbd568
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a435ab07aea7fe74f4189523f5f3b5c1dd2dd6ccee5b11e9d58eab3cd618b0e5cef945cdb2ee59d8d44899dfe004463040c700cca6a6934f78c35bd5cbdf56b5
|
7
|
+
data.tar.gz: 2337f6bb523acc96a45f9fe262a6774f125f8d29f5c6788d170cf877305f4971005ccb22d0fa90bd39d40473324ec9ddbc21d2a68a909faf41aa31665362a880
|
data/README.md
CHANGED
@@ -19,32 +19,15 @@ Or install it yourself as:
|
|
19
19
|
|
20
20
|
## Usage
|
21
21
|
|
22
|
-
###
|
22
|
+
### Installation with Sprockets/Propshaft and Importmaps
|
23
23
|
|
24
|
-
If your asset pipeline uses Sprockets,
|
24
|
+
If your asset pipeline uses Sprockets/Propshaft with Importmaps, run the gallery generator:
|
25
25
|
|
26
26
|
```sh
|
27
27
|
$ rails g blacklight_gallery:install
|
28
28
|
```
|
29
29
|
|
30
|
-
###
|
31
|
-
|
32
|
-
New installations of Blacklight will probably use [Importmaps](https://github.com/rails/importmap-rails) to manage javascript assets. In order to support the masonry and slideshow views, jQuery needs to be added to your application Importmaps configuration.
|
33
|
-
|
34
|
-
In addition to running the `blacklight_gallery:install` generator, add this line to `/config/importmap.rb`:
|
35
|
-
|
36
|
-
```ruby
|
37
|
-
pin "jquery", to: "https://code.jquery.com/jquery-3.7.1.min.js"
|
38
|
-
```
|
39
|
-
|
40
|
-
Then append import declarations in your `app/assets/javascript/application.js`:
|
41
|
-
|
42
|
-
```js
|
43
|
-
import 'jquery'
|
44
|
-
import 'blacklight-gallery'
|
45
|
-
```
|
46
|
-
|
47
|
-
### With Node-based JS bundlers
|
30
|
+
### Installation for Node-based JS bundlers
|
48
31
|
|
49
32
|
For node-based bundlers add `blacklight-gallery masonry-layout@v4` as a dependency and add this to your entrypoint:
|
50
33
|
```js
|
@@ -53,11 +36,6 @@ import 'blacklight-gallery/app/javascript/blacklight-gallery/slideshow'
|
|
53
36
|
import 'blacklight-gallery/app/javascript/blacklight-gallery/masonry'
|
54
37
|
```
|
55
38
|
|
56
|
-
### With Propshaft
|
57
|
-
|
58
|
-
Propshaft will process and include any CSS files in your `app/assets/stylesheets` directory. The `blacklight_gallery:install` generator adds [a file](https://github.com/projectblacklight/blacklight-gallery/blob/v4.8.4/lib/generators/blacklight_gallery/templates/blacklight_gallery.css.scss) to `app/assets/stylesheets` that loads the included styles for all views.
|
59
|
-
The styles require compilation from SASS to CSS, which will require usage of a compiler like [`dartsass-rails`](https://github.com/rails/dartsass-rails).
|
60
|
-
|
61
39
|
## Manual Installation
|
62
40
|
|
63
41
|
See the wiki page on [manual installation](https://github.com/projectblacklight/blacklight-gallery/wiki/Manual-Installation) to customize which views and related assets to install into your application.
|
@@ -76,73 +54,39 @@ See the wiki page on [manual installation](https://github.com/projectblacklight/
|
|
76
54
|
- Java >= openjdk-21
|
77
55
|
- Building the internal test app will install Solr 9.6.1 locally via [`solr_wrapper`](https://github.com/cbeer/solr_wrapper)
|
78
56
|
|
79
|
-
### Building
|
57
|
+
### Building and testing test application
|
58
|
+
By default, the rake tasks below run with the current Rails and Blacklight versions defined in the gemspec file. You can modify the rake task with the following environment variables:
|
59
|
+
- Pass custom options to the rails engine cart using the `ENGINE_CART_RAILS_OPTIONS` environment variable.
|
60
|
+
- Set a specific Rails version with `export RAILS_VERSION=some_version_#`.
|
61
|
+
- Set a specific Blacklight version with `export BLACKLIGHT_VERSION=some_version_#`.
|
62
|
+
- Use Blacklight on the latest commit from the repository with `export BLACKLIGHT_VERSION=github`
|
80
63
|
|
81
|
-
|
64
|
+
#### Building Internal Test App
|
65
|
+
Within the blacklight-gallery root directory:
|
82
66
|
- Install gems
|
83
|
-
```
|
84
|
-
bundle install
|
85
|
-
```
|
86
|
-
- Run the rake task that builds internal test app and runs the test suite.
|
87
|
-
```
|
88
|
-
bundle exec rake
|
89
|
-
```
|
90
|
-
|
91
|
-
- By default, the rake task runs with the current rails and blacklight versions defined in the gemspec file, you can modify the rake task with the following environment variables:
|
92
|
-
- Pass custom options to the rails engine cart using the `ENGINE_CART_OPTIONS` environment variable.
|
93
|
-
- Set a specific rails version with `export RAILS_VERSION=some_version_#`.
|
94
|
-
- Set a specific blacklight version with `export BLACKLIGHT_VERSION=some_version_#`.
|
95
|
-
|
96
|
-
|
97
|
-
### Stylesheets
|
98
|
-
|
99
|
-
- When using the modern rails asset pipeline (`importmap` + `propshaft`) to build the internal test app, we need to manually include the `.scss` stylesheets in the host application's stylesheet entrypoint
|
100
|
-
- Copy the gem's `.scss` stylesheets in `/app/assets/stylesheets` to `/.internal_test_app/assets/stylesheets`
|
101
|
-
- Import stylesheets in internal test app stylesheet entrypoint.
|
102
|
-
```
|
103
|
-
# internal_test_app stylesheet entrypoint
|
104
|
-
|
105
|
-
@import 'gallery';
|
106
|
-
@import 'slideshow';
|
107
|
-
@import 'masonry';
|
108
|
-
@import 'osd_viewer';
|
109
67
|
```
|
110
|
-
|
111
|
-
|
112
|
-
```
|
113
|
-
yarn build:css
|
114
|
-
```
|
115
|
-
|
116
|
-
### Jquery
|
117
|
-
- The masonry and slideshow views require jquery. There are multiple ways to do this, and we document the
|
118
|
-
- When running the generator with the current gemspec, and the modern rails asset pipeline (`importmap`, `propshaft`, and/or `node` based bundlers),
|
119
|
-
we have to import jquery manually in the internal test app. You can do this with importmaps with the following additions to your `/.internal_test_app/config/importmap.rb` file:
|
120
|
-
|
121
|
-
```
|
122
|
-
# /.internal_test_app/config/importmap.rb
|
123
|
-
|
124
|
-
pin "jquery", to: "https://code.jquery.com/jquery-3.7.1.min.js"
|
125
|
-
```
|
126
|
-
- Once jquery is added to the internal test app, import the following to the internal test app `application.js` entrypoint
|
127
|
-
```
|
128
|
-
# /.internal_test_app/javascrpt/application.js
|
129
|
-
|
130
|
-
# import jquery and 'blacklight-gallery'
|
68
|
+
bundle install
|
69
|
+
```
|
131
70
|
|
132
|
-
|
133
|
-
|
134
|
-
|
71
|
+
- Run the rake task that builds internal test app
|
72
|
+
```
|
73
|
+
bundle exec rake engine_cart:generate
|
74
|
+
```
|
135
75
|
|
136
|
-
|
137
|
-
- Run the rake task to start the rails server for the internal test app from the blacklight gallery root directory
|
138
|
-
```
|
139
|
-
bundle exec rake server
|
140
|
-
```
|
76
|
+
- A test Rails application is built in the `.internal_test_app` directory with Blacklight and Blacklight-Gallery
|
141
77
|
|
142
|
-
|
78
|
+
#### Start Rails Server
|
79
|
+
Within the blacklight-gallery root directory:
|
80
|
+
- Run the rake task to start the rails server and Solr for the internal test app
|
81
|
+
```
|
82
|
+
bundle exec rake server
|
83
|
+
```
|
143
84
|
|
144
|
-
|
145
|
-
|
85
|
+
#### Run Specs in test application
|
86
|
+
- Run specs with current internal test app configuration. Generates internal test app, if not already present.
|
87
|
+
```
|
88
|
+
bundle exec rake
|
89
|
+
```
|
146
90
|
|
147
91
|
### Solr
|
148
92
|
- The default solr port is at 8983
|
data/Rakefile
CHANGED
@@ -13,7 +13,7 @@ task :default => :ci
|
|
13
13
|
rails_options = ENV.fetch('ENGINE_CART_RAILS_OPTIONS', '')
|
14
14
|
rails_options = "#{rails_options} -a propshaft" unless rails_options.match?(/-a\s|--asset-pipeline/)
|
15
15
|
rails_options = "#{rails_options} -j importmap" unless rails_options.match?(/-j\s|--javascript/)
|
16
|
-
rails_options = "#{rails_options} --css bootstrap" unless rails_options.match?(/--css/)
|
16
|
+
rails_options = "#{rails_options} --css bootstrap" unless rails_options.match?(/--css\s|sprockets/)
|
17
17
|
ENV['ENGINE_CART_RAILS_OPTIONS'] = rails_options
|
18
18
|
|
19
19
|
desc "Load fixtures"
|
@@ -26,10 +26,14 @@ end
|
|
26
26
|
|
27
27
|
desc "Execute Continuous Integration build"
|
28
28
|
task :ci => ['engine_cart:generate'] do
|
29
|
-
|
30
29
|
require 'solr_wrapper'
|
31
30
|
SolrWrapper.wrap(port: '8983') do |solr|
|
32
31
|
solr.with_collection(name: 'blacklight-core', dir: File.join(File.expand_path(File.dirname(__FILE__)), 'solr', 'conf')) do
|
32
|
+
within_test_app do
|
33
|
+
# Precompiles the assets
|
34
|
+
`bin/rails spec:prepare`
|
35
|
+
end
|
36
|
+
|
33
37
|
Rake::Task['fixtures'].invoke
|
34
38
|
Rake::Task['spec'].invoke
|
35
39
|
end
|
@@ -47,7 +51,9 @@ task :server do
|
|
47
51
|
ENV['FILE'] = File.join(__dir__, 'spec', 'fixtures', 'sample_solr_documents.yml')
|
48
52
|
system 'rake blacklight:index:seed'
|
49
53
|
ENV.delete('FILE')
|
50
|
-
|
54
|
+
|
55
|
+
system "yarn build:css"
|
56
|
+
system "bundle exec rails s"
|
51
57
|
end
|
52
58
|
end
|
53
59
|
end
|
@@ -1,5 +1,3 @@
|
|
1
|
-
import Blacklight from 'blacklight-frontend';
|
2
|
-
|
3
1
|
/*!
|
4
2
|
* imagesLoaded PACKAGED v5.0.0
|
5
3
|
* JavaScript is all like "You images are done yet or what?"
|
@@ -574,11 +572,6 @@ return ImagesLoaded;
|
|
574
572
|
|
575
573
|
})(jQuery);
|
576
574
|
|
577
|
-
|
578
|
-
Blacklight.onLoad(function() {
|
579
|
-
$('.documents-slideshow').slideshow();
|
580
|
-
});
|
581
|
-
|
582
575
|
(function($){
|
583
576
|
$.fn.BlacklightMasonry = function() {
|
584
577
|
var container = this;
|
@@ -591,8 +584,4 @@ Blacklight.onLoad(function() {
|
|
591
584
|
|
592
585
|
$.fn.BlacklightMasonry.options = { gutter: 8 };
|
593
586
|
})(jQuery);
|
594
|
-
|
595
|
-
Blacklight.onLoad(function() {
|
596
|
-
$('.documents-masonry').BlacklightMasonry();
|
597
|
-
});
|
598
587
|
//# sourceMappingURL=blacklight-gallery.esm.js.map
|