arclight 1.0.0.beta1 → 1.0.0.beta2
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/.github/workflows/ruby.yml +1 -1
- data/app/assets/javascripts/arclight/arclight.js +2 -2
- data/app/assets/javascripts/arclight/{oembed_viewer.js → oembed_controller.js} +12 -19
- data/app/components/arclight/oembed_viewer_component.html.erb +1 -1
- data/app/components/arclight/search_result_component.rb +0 -6
- data/lib/arclight/engine.rb +1 -1
- data/lib/arclight/version.rb +1 -1
- data/lib/generators/arclight/install_generator.rb +2 -4
- data/lib/generators/arclight/templates/arclight.scss +1 -0
- data/package.json +1 -1
- metadata +5 -5
- /data/app/assets/images/{blacklight → arclight}/logo.png +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b1390f6e3757bd6b696874a8eb4e02c06e31a3c51d03a85bb25880e6536133fd
|
4
|
+
data.tar.gz: e55f6e430f6b88974ca1c73b8353fe2869936b43c784027fb7c443eebce94170
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d685048894b2c9ef5821c845c1630e8b375ccb9192cff406a1d58fc38475f07b03055c28c9d1568489a6bbd8c68ba856f359feb780d3a4fe4bba0355e9994d41
|
7
|
+
data.tar.gz: 2a3593117293b05a325d140a58f60cdfd34218b40222f7a13ccf7f9c1d62a07a244e08ee894fd5b991efa0d2da6c7521c8fde8e8fb5fa33eec62529e2ca1cb6a
|
data/.github/workflows/ruby.yml
CHANGED
@@ -1,23 +1,23 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
import { Controller } from '@hotwired/stimulus'
|
2
|
+
|
3
|
+
export default class extends Controller {
|
4
|
+
static values = {
|
5
|
+
url: String
|
4
6
|
}
|
5
7
|
|
6
|
-
|
7
|
-
const loadedAttr = this.
|
8
|
-
const { arclightOembed, arclightOembedUrl, ...extraOembedParams } = this.el.dataset
|
9
|
-
const extraParams = OembedLoader.normalizeParams(extraOembedParams)
|
8
|
+
connect() {
|
9
|
+
const loadedAttr = this.element.getAttribute('loaded')
|
10
10
|
|
11
11
|
if (loadedAttr && loadedAttr === 'loaded') {
|
12
12
|
return
|
13
13
|
}
|
14
14
|
|
15
|
-
fetch(
|
15
|
+
fetch(this.urlTarget)
|
16
16
|
.then((response) => response.text())
|
17
17
|
.then((body) => {
|
18
|
-
const oEmbedEndPoint =
|
18
|
+
const oEmbedEndPoint = this.findOEmbedEndPoint(body)
|
19
19
|
if (!oEmbedEndPoint || oEmbedEndPoint.length === 0) {
|
20
|
-
console.warn(`No oEmbed endpoint found in <head> at ${
|
20
|
+
console.warn(`No oEmbed endpoint found in <head> at ${this.urlTarget}`)
|
21
21
|
return
|
22
22
|
}
|
23
23
|
this.loadEndPoint(oEmbedEndPoint)
|
@@ -57,15 +57,8 @@ class OembedLoader {
|
|
57
57
|
fetch(oEmbedEndPoint)
|
58
58
|
.then((response) => response.json())
|
59
59
|
.then((json) => {
|
60
|
-
this.
|
61
|
-
this.
|
60
|
+
this.element.innerHTML = json.html
|
61
|
+
this.element.setAttribute('loaded', 'loaded')
|
62
62
|
})
|
63
63
|
}
|
64
64
|
}
|
65
|
-
|
66
|
-
Blacklight.onLoad(function () {
|
67
|
-
document.querySelectorAll('[data-arclight-oembed="true"]').forEach((element) => {
|
68
|
-
const loader = new OembedLoader(element)
|
69
|
-
loader.load()
|
70
|
-
})
|
71
|
-
})
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<%= tag.div(class: 'al-oembed-viewer',
|
1
|
+
<%= tag.div(class: 'al-oembed-viewer', data: { controller: 'arclight-oembed', arclight_oembed_url_value: @resource.href }) do %>
|
2
2
|
<div class="al-digital-object">
|
3
3
|
<%= link_to(@resource.label, @resource.href) %>
|
4
4
|
</div>
|
@@ -7,12 +7,6 @@ module Arclight
|
|
7
7
|
class SearchResultComponent < Blacklight::DocumentComponent
|
8
8
|
attr_reader :document
|
9
9
|
|
10
|
-
# We need to initialize the view component counter variable
|
11
|
-
# See https://viewcomponent.org/guide/collections.html#collection-counter
|
12
|
-
def initialize(search_result_counter: nil, **kwargs)
|
13
|
-
super
|
14
|
-
end
|
15
|
-
|
16
10
|
def compact?
|
17
11
|
presenter.view_config.key.to_s == 'compact'
|
18
12
|
end
|
data/lib/arclight/engine.rb
CHANGED
@@ -36,7 +36,7 @@ module Arclight
|
|
36
36
|
|
37
37
|
initializer 'arclight.assets', before: 'assets' do |app|
|
38
38
|
app.config.assets.precompile << 'arclight/arclight.js'
|
39
|
-
app.config.assets.precompile << 'arclight/
|
39
|
+
app.config.assets.precompile << 'arclight/oembed_controller.js'
|
40
40
|
app.config.assets.precompile << 'arclight/truncate_controller.js'
|
41
41
|
end
|
42
42
|
|
data/lib/arclight/version.rb
CHANGED
@@ -114,15 +114,13 @@ module Arclight
|
|
114
114
|
append_to_file 'config/importmap.rb', <<~RUBY
|
115
115
|
pin "arclight", to: "arclight/arclight.js"
|
116
116
|
# TODO: We may be able to move these to a single importmap for arclight.
|
117
|
-
pin "arclight/
|
117
|
+
pin "arclight/oembed_controller", to: "arclight/oembed_controller.js"
|
118
118
|
pin "arclight/truncate_controller", to: "arclight/truncate_controller.js"
|
119
119
|
RUBY
|
120
120
|
end
|
121
121
|
|
122
122
|
def import_arclight_javascript
|
123
|
-
|
124
|
-
"\nimport \"arclight\""
|
125
|
-
end
|
123
|
+
append_to_file 'app/javascript/application.js', "\nimport \"arclight\""
|
126
124
|
end
|
127
125
|
end
|
128
126
|
end
|
data/package.json
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: arclight
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.
|
4
|
+
version: 1.0.0.beta2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Darren Hardy
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: exe
|
13
13
|
cert_chain: []
|
14
|
-
date: 2023-02-
|
14
|
+
date: 2023-02-27 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: blacklight
|
@@ -310,6 +310,7 @@ files:
|
|
310
310
|
- LICENSE.txt
|
311
311
|
- README.md
|
312
312
|
- Rakefile
|
313
|
+
- app/assets/images/arclight/logo.png
|
313
314
|
- app/assets/images/blacklight/bookmark.svg
|
314
315
|
- app/assets/images/blacklight/collection.svg
|
315
316
|
- app/assets/images/blacklight/compact.svg
|
@@ -318,14 +319,13 @@ files:
|
|
318
319
|
- app/assets/images/blacklight/file.svg
|
319
320
|
- app/assets/images/blacklight/folder.svg
|
320
321
|
- app/assets/images/blacklight/list.svg
|
321
|
-
- app/assets/images/blacklight/logo.png
|
322
322
|
- app/assets/images/blacklight/minus.svg
|
323
323
|
- app/assets/images/blacklight/online.svg
|
324
324
|
- app/assets/images/blacklight/pdf.svg
|
325
325
|
- app/assets/images/blacklight/plus.svg
|
326
326
|
- app/assets/images/blacklight/repository.svg
|
327
327
|
- app/assets/javascripts/arclight/arclight.js
|
328
|
-
- app/assets/javascripts/arclight/
|
328
|
+
- app/assets/javascripts/arclight/oembed_controller.js
|
329
329
|
- app/assets/javascripts/arclight/truncate_controller.js
|
330
330
|
- app/assets/stylesheets/arclight/application.scss
|
331
331
|
- app/assets/stylesheets/arclight/modules/collection_search.scss
|
@@ -512,7 +512,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
512
512
|
- !ruby/object:Gem::Version
|
513
513
|
version: 1.3.1
|
514
514
|
requirements: []
|
515
|
-
rubygems_version: 3.3.
|
515
|
+
rubygems_version: 3.3.26
|
516
516
|
signing_key:
|
517
517
|
specification_version: 4
|
518
518
|
summary: ''
|
File without changes
|