blacklight-oembed 1.4.0 → 1.4.2
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 +27 -25
- data/app/assets/config/manifest.js +1 -0
- data/app/assets/javascripts/blacklight_oembed/oembed.esm.js.map +1 -1
- data/app/assets/javascripts/blacklight_oembed/oembed.js +1 -1
- data/app/assets/javascripts/blacklight_oembed/oembed.js.map +1 -1
- data/config/importmap.rb +3 -0
- data/lib/blacklight/oembed/engine.rb +5 -0
- data/lib/blacklight/oembed/version.rb +1 -1
- data/lib/generators/blacklight_oembed/install_generator.rb +6 -0
- data/package.json +1 -1
- data/rollup.config.js +2 -2
- metadata +5 -3
- /data/app/javascript/{oembed.js → blacklight-oembed/oembed.js} +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c0c853761558362f5e6e1292cfbdb4f644e93e79757a0066690a55047352fea
|
4
|
+
data.tar.gz: 39773774a0dff4245a920a1884927be49a4baad5bcd8d6d0e18b2f68f194f14a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e0f64919c741b49fb79c9b76aebb3f05689af7d8daddb73db8628708d5d8f8575c12c0f14e899e756b488d9b5e8863e764e3c7b71e5e61a31ce514a4402238c
|
7
|
+
data.tar.gz: 5a420f515997fa5160ab1d881d2e5c35e5f97906b2dcba62e230ffa79fe9c72c5a07dd00e33af8e5c4c3c7962d165ef71425fd3532bdca4e19293dd683157c18
|
data/.github/workflows/ruby.yml
CHANGED
@@ -2,9 +2,9 @@ name: CI
|
|
2
2
|
|
3
3
|
on:
|
4
4
|
push:
|
5
|
-
branches: [
|
5
|
+
branches: [main]
|
6
6
|
pull_request:
|
7
|
-
branches: [
|
7
|
+
branches: [main]
|
8
8
|
|
9
9
|
jobs:
|
10
10
|
test:
|
@@ -12,32 +12,34 @@ jobs:
|
|
12
12
|
name: test (ruby ${{ matrix.ruby }} / rails ${{ matrix.rails_version }} / blacklight ${{ matrix.blacklight_version }} ${{ matrix.additional_name }})
|
13
13
|
strategy:
|
14
14
|
matrix:
|
15
|
-
ruby: [
|
16
|
-
rails_version: [
|
17
|
-
blacklight_version: [
|
18
|
-
|
19
|
-
|
15
|
+
ruby: ["3.3"]
|
16
|
+
rails_version: ["7.1.5.1", "7.2.2.1", "8.0.1"]
|
17
|
+
blacklight_version: ["~> 8.0"]
|
18
|
+
additional_engine_cart_rails_options: ["--css bootstrap"]
|
19
|
+
additional_name: [""]
|
20
|
+
legacy_config: [""]
|
20
21
|
include:
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
22
|
+
- ruby: "3.3"
|
23
|
+
rails_version: "7.2.2.1"
|
24
|
+
blacklight_version: "~> 7.0"
|
25
|
+
additional_name: ""
|
26
|
+
- ruby: "3.3"
|
27
|
+
rails_version: "7.2.2.1"
|
28
|
+
blacklight_version: "~> 8.0"
|
29
|
+
additional_name: "with legacy partial config"
|
30
|
+
legacy_config: "true"
|
30
31
|
env:
|
31
32
|
RAILS_VERSION: ${{ matrix.rails_version }}
|
32
33
|
BLACKLIGHT_VERSION: ${{ matrix.blacklight_version }}
|
33
34
|
CI_TEST_LEGACY_CONFIGURATION: ${{ matrix.legacy_config }}
|
35
|
+
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
36
|
steps:
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
37
|
+
- uses: actions/checkout@v2
|
38
|
+
- name: Set up Ruby ${{ matrix.ruby }}
|
39
|
+
uses: ruby/setup-ruby@v1
|
40
|
+
with:
|
41
|
+
ruby-version: ${{ matrix.ruby }}
|
42
|
+
- name: Install dependencies with Rails ${{ matrix.rails_version }}
|
43
|
+
run: bundle install
|
44
|
+
- name: Run tests
|
45
|
+
run: bundle exec rake
|
@@ -0,0 +1 @@
|
|
1
|
+
//= link_tree ../../javascript .js
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"oembed.esm.js","sources":["../../../javascript/oembed.js"],"sourcesContent":["export default function oEmbed(elements) {\n if (!elements) return;\n\n // Ensure elements is an array-like collection\n elements = elements instanceof NodeList ? Array.from(elements) : [elements];\n\n elements.forEach(function(embedViewer) {\n const embedURL = embedViewer.dataset.embedUrl; // Get the embed URL from the data attribute\n\n if (!embedURL) return;\n\n // Fetch JSON data from the embed URL\n fetch(embedURL)\n .then(response => {\n if (!response.ok) {\n throw new Error('Network response was not ok');\n }\n return response.json();\n })\n .then(data => {\n if (data === null) {\n return;\n }\n // Set the inner HTML of the element\n embedViewer.innerHTML = data.html;\n })\n .catch(error => {\n console.error('Error fetching embed data:', error);\n });\n });\n}\n"],"names":[],"mappings":"AAAe,SAAS,MAAM,CAAC,QAAQ,EAAE;AACzC,EAAE,IAAI,CAAC,QAAQ,EAAE;;AAEjB;AACA,EAAE,QAAQ,GAAG,QAAQ,YAAY,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC;;AAE7E,EAAE,QAAQ,CAAC,OAAO,CAAC,SAAS,WAAW,EAAE;AACzC,IAAI,MAAM,QAAQ,GAAG,WAAW,CAAC,OAAO,CAAC,QAAQ,CAAC;;AAElD,IAAI,IAAI,CAAC,QAAQ,EAAE;;AAEnB;AACA,IAAI,KAAK,CAAC,QAAQ;AAClB,OAAO,IAAI,CAAC,QAAQ,IAAI;AACxB,QAAQ,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE;AAC1B,UAAU,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC;AACxD;AACA,QAAQ,OAAO,QAAQ,CAAC,IAAI,EAAE;AAC9B,OAAO;AACP,OAAO,IAAI,CAAC,IAAI,IAAI;AACpB,QAAQ,IAAI,IAAI,KAAK,IAAI,EAAE;AAC3B,UAAU;AACV;AACA;AACA,QAAQ,WAAW,CAAC,SAAS,GAAG,IAAI,CAAC,IAAI;AACzC,OAAO;AACP,OAAO,KAAK,CAAC,KAAK,IAAI;AACtB,QAAQ,OAAO,CAAC,KAAK,CAAC,4BAA4B,EAAE,KAAK,CAAC;AAC1D,OAAO,CAAC;AACR,GAAG,CAAC;AACJ;;;;"}
|
1
|
+
{"version":3,"file":"oembed.esm.js","sources":["../../../javascript/blacklight-oembed/oembed.js"],"sourcesContent":["export default function oEmbed(elements) {\n if (!elements) return;\n\n // Ensure elements is an array-like collection\n elements = elements instanceof NodeList ? Array.from(elements) : [elements];\n\n elements.forEach(function(embedViewer) {\n const embedURL = embedViewer.dataset.embedUrl; // Get the embed URL from the data attribute\n\n if (!embedURL) return;\n\n // Fetch JSON data from the embed URL\n fetch(embedURL)\n .then(response => {\n if (!response.ok) {\n throw new Error('Network response was not ok');\n }\n return response.json();\n })\n .then(data => {\n if (data === null) {\n return;\n }\n // Set the inner HTML of the element\n embedViewer.innerHTML = data.html;\n })\n .catch(error => {\n console.error('Error fetching embed data:', error);\n });\n });\n}\n"],"names":[],"mappings":"AAAe,SAAS,MAAM,CAAC,QAAQ,EAAE;AACzC,EAAE,IAAI,CAAC,QAAQ,EAAE;;AAEjB;AACA,EAAE,QAAQ,GAAG,QAAQ,YAAY,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC;;AAE7E,EAAE,QAAQ,CAAC,OAAO,CAAC,SAAS,WAAW,EAAE;AACzC,IAAI,MAAM,QAAQ,GAAG,WAAW,CAAC,OAAO,CAAC,QAAQ,CAAC;;AAElD,IAAI,IAAI,CAAC,QAAQ,EAAE;;AAEnB;AACA,IAAI,KAAK,CAAC,QAAQ;AAClB,OAAO,IAAI,CAAC,QAAQ,IAAI;AACxB,QAAQ,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE;AAC1B,UAAU,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC;AACxD;AACA,QAAQ,OAAO,QAAQ,CAAC,IAAI,EAAE;AAC9B,OAAO;AACP,OAAO,IAAI,CAAC,IAAI,IAAI;AACpB,QAAQ,IAAI,IAAI,KAAK,IAAI,EAAE;AAC3B,UAAU;AACV;AACA;AACA,QAAQ,WAAW,CAAC,SAAS,GAAG,IAAI,CAAC,IAAI;AACzC,OAAO;AACP,OAAO,KAAK,CAAC,KAAK,IAAI;AACtB,QAAQ,OAAO,CAAC,KAAK,CAAC,4BAA4B,EAAE,KAAK,CAAC;AAC1D,OAAO,CAAC;AACR,GAAG,CAAC;AACJ;;;;"}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
(function (global, factory) {
|
2
2
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
3
3
|
typeof define === 'function' && define.amd ? define(factory) :
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.oembed = factory());
|
5
5
|
})(this, (function () { 'use strict';
|
6
6
|
|
7
7
|
function oEmbed(elements) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"oembed.js","sources":["../../../javascript/oembed.js"],"sourcesContent":["export default function oEmbed(elements) {\n if (!elements) return;\n\n // Ensure elements is an array-like collection\n elements = elements instanceof NodeList ? Array.from(elements) : [elements];\n\n elements.forEach(function(embedViewer) {\n const embedURL = embedViewer.dataset.embedUrl; // Get the embed URL from the data attribute\n\n if (!embedURL) return;\n\n // Fetch JSON data from the embed URL\n fetch(embedURL)\n .then(response => {\n if (!response.ok) {\n throw new Error('Network response was not ok');\n }\n return response.json();\n })\n .then(data => {\n if (data === null) {\n return;\n }\n // Set the inner HTML of the element\n embedViewer.innerHTML = data.html;\n })\n .catch(error => {\n console.error('Error fetching embed data:', error);\n });\n });\n}\n"],"names":[],"mappings":";;;;;;EAAe,SAAS,MAAM,CAAC,QAAQ,EAAE;EACzC,EAAE,IAAI,CAAC,QAAQ,EAAE;;EAEjB;EACA,EAAE,QAAQ,GAAG,QAAQ,YAAY,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC;;EAE7E,EAAE,QAAQ,CAAC,OAAO,CAAC,SAAS,WAAW,EAAE;EACzC,IAAI,MAAM,QAAQ,GAAG,WAAW,CAAC,OAAO,CAAC,QAAQ,CAAC;;EAElD,IAAI,IAAI,CAAC,QAAQ,EAAE;;EAEnB;EACA,IAAI,KAAK,CAAC,QAAQ;EAClB,OAAO,IAAI,CAAC,QAAQ,IAAI;EACxB,QAAQ,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE;EAC1B,UAAU,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC;EACxD;EACA,QAAQ,OAAO,QAAQ,CAAC,IAAI,EAAE;EAC9B,OAAO;EACP,OAAO,IAAI,CAAC,IAAI,IAAI;EACpB,QAAQ,IAAI,IAAI,KAAK,IAAI,EAAE;EAC3B,UAAU;EACV;EACA;EACA,QAAQ,WAAW,CAAC,SAAS,GAAG,IAAI,CAAC,IAAI;EACzC,OAAO;EACP,OAAO,KAAK,CAAC,KAAK,IAAI;EACtB,QAAQ,OAAO,CAAC,KAAK,CAAC,4BAA4B,EAAE,KAAK,CAAC;EAC1D,OAAO,CAAC;EACR,GAAG,CAAC;EACJ;;;;;;;;"}
|
1
|
+
{"version":3,"file":"oembed.js","sources":["../../../javascript/blacklight-oembed/oembed.js"],"sourcesContent":["export default function oEmbed(elements) {\n if (!elements) return;\n\n // Ensure elements is an array-like collection\n elements = elements instanceof NodeList ? Array.from(elements) : [elements];\n\n elements.forEach(function(embedViewer) {\n const embedURL = embedViewer.dataset.embedUrl; // Get the embed URL from the data attribute\n\n if (!embedURL) return;\n\n // Fetch JSON data from the embed URL\n fetch(embedURL)\n .then(response => {\n if (!response.ok) {\n throw new Error('Network response was not ok');\n }\n return response.json();\n })\n .then(data => {\n if (data === null) {\n return;\n }\n // Set the inner HTML of the element\n embedViewer.innerHTML = data.html;\n })\n .catch(error => {\n console.error('Error fetching embed data:', error);\n });\n });\n}\n"],"names":[],"mappings":";;;;;;EAAe,SAAS,MAAM,CAAC,QAAQ,EAAE;EACzC,EAAE,IAAI,CAAC,QAAQ,EAAE;;EAEjB;EACA,EAAE,QAAQ,GAAG,QAAQ,YAAY,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC;;EAE7E,EAAE,QAAQ,CAAC,OAAO,CAAC,SAAS,WAAW,EAAE;EACzC,IAAI,MAAM,QAAQ,GAAG,WAAW,CAAC,OAAO,CAAC,QAAQ,CAAC;;EAElD,IAAI,IAAI,CAAC,QAAQ,EAAE;;EAEnB;EACA,IAAI,KAAK,CAAC,QAAQ;EAClB,OAAO,IAAI,CAAC,QAAQ,IAAI;EACxB,QAAQ,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE;EAC1B,UAAU,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC;EACxD;EACA,QAAQ,OAAO,QAAQ,CAAC,IAAI,EAAE;EAC9B,OAAO;EACP,OAAO,IAAI,CAAC,IAAI,IAAI;EACpB,QAAQ,IAAI,IAAI,KAAK,IAAI,EAAE;EAC3B,UAAU;EACV;EACA;EACA,QAAQ,WAAW,CAAC,SAAS,GAAG,IAAI,CAAC,IAAI;EACzC,OAAO;EACP,OAAO,KAAK,CAAC,KAAK,IAAI;EACtB,QAAQ,OAAO,CAAC,KAAK,CAAC,4BAA4B,EAAE,KAAK,CAAC;EAC1D,OAAO,CAAC;EACR,GAAG,CAAC;EACJ;;;;;;;;"}
|
data/config/importmap.rb
ADDED
@@ -10,6 +10,11 @@ module Blacklight
|
|
10
10
|
# Allows an adopter to pass additional parameters through to an OEmbed
|
11
11
|
# service. Examples of this could include `:canvas_index`, or `:max_width`
|
12
12
|
config.additional_params = []
|
13
|
+
|
14
|
+
initializer 'blacklight_oembed.importmap', before: 'importmap' do |app|
|
15
|
+
app.config.assets.paths << Engine.root.join("app/javascript")
|
16
|
+
app.config.importmap.paths << Engine.root.join('config/importmap.rb') if app.config.respond_to?(:importmap)
|
17
|
+
end
|
13
18
|
end
|
14
19
|
end
|
15
20
|
end
|
@@ -18,6 +18,12 @@ module BlacklightOembed
|
|
18
18
|
copy_file "oembed_providers.rb", "config/initializers/oembed_providers.rb"
|
19
19
|
end
|
20
20
|
|
21
|
+
def appease_sprockets4
|
22
|
+
return unless File.exist?('app/assets/config/manifest.js')
|
23
|
+
|
24
|
+
append_to_file 'app/assets/config/manifest.js', "\n//= link blacklight-oembed/oembed.js"
|
25
|
+
end
|
26
|
+
|
21
27
|
def configuration
|
22
28
|
inject_into_file 'app/controllers/catalog_controller.rb', after: 'configure_blacklight do |config|' do
|
23
29
|
if ENV['CI_TEST_LEGACY_CONFIGURATION'].present? || Gem::Version.new(Blacklight::VERSION) < Gem::Version.new('8.0')
|
data/package.json
CHANGED
data/rollup.config.js
CHANGED
@@ -14,12 +14,12 @@ let includePathOptions = {
|
|
14
14
|
};
|
15
15
|
|
16
16
|
const rollupConfig = {
|
17
|
-
input: 'app/javascript/oembed.js',
|
17
|
+
input: 'app/javascript/blacklight-oembed/oembed.js',
|
18
18
|
output: {
|
19
19
|
file: `app/assets/javascripts/blacklight_oembed/${fileDest}.js`,
|
20
20
|
format: ESM ? 'es' : 'umd',
|
21
21
|
generatedCode: { preset: 'es2015' },
|
22
|
-
name: ESM ? undefined : '
|
22
|
+
name: ESM ? undefined : 'oembed'
|
23
23
|
},
|
24
24
|
plugins: [includePaths(includePathOptions)]
|
25
25
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blacklight-oembed
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Beer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-01-
|
11
|
+
date: 2025-01-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -212,6 +212,7 @@ files:
|
|
212
212
|
- LICENSE
|
213
213
|
- README.md
|
214
214
|
- Rakefile
|
215
|
+
- app/assets/config/manifest.js
|
215
216
|
- app/assets/javascripts/blacklight_oembed/jquery.oembed.js
|
216
217
|
- app/assets/javascripts/blacklight_oembed/oembed.esm.js
|
217
218
|
- app/assets/javascripts/blacklight_oembed/oembed.esm.js.map
|
@@ -221,9 +222,10 @@ files:
|
|
221
222
|
- app/components/blacklight/oembed/document_oembed_component.rb
|
222
223
|
- app/controllers/blacklight/oembed/embed_controller.rb
|
223
224
|
- app/helpers/blacklight/oembed/oembed_helper.rb
|
224
|
-
- app/javascript/oembed.js
|
225
|
+
- app/javascript/blacklight-oembed/oembed.js
|
225
226
|
- app/views/catalog/_oembed_default.html.erb
|
226
227
|
- blacklight-oembed.gemspec
|
228
|
+
- config/importmap.rb
|
227
229
|
- config/jetty.yml
|
228
230
|
- config/locales/blacklight-oembed.ar.yml
|
229
231
|
- config/locales/blacklight-oembed.en.yml
|
File without changes
|