blacklight-oembed 1.4.0 → 1.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7c4944caa252256a06f3db9bb7d7f9f007729917dfaf28a308891344b2343d4c
4
- data.tar.gz: b751021ec49bd9064a41b0f954e6343fdaa462a72b1f1e92c472649f2e3ea578
3
+ metadata.gz: 9dd1000e07ba6fd737d35bc9523688050ac88f02c17d9b11d843f5fd26537413
4
+ data.tar.gz: 222e686b52915f68c6aa471b658ec23dffcfb186abe6cf266ec65ee4210e1d42
5
5
  SHA512:
6
- metadata.gz: 185a2f95792bca7d9ea4a76a534d4be09e58da59956c24344149c290f34c551863f0c4dbe61fad47ca893deb6f62ded16415504dbc186758dd7cbe0237e0aeec
7
- data.tar.gz: 1b431ee4d17ae3b9ca1240c3c23ec01efcf49340c06a8aba575a2cfa3736f5130efd019613701630265287af34e8303a1c2d8811196ff5d4aa6e8704a6074835
6
+ metadata.gz: 82ba4038c2ed1082fb19582a874b311924b0b85ab4127cee0667e89134d3636221889e1670a3b104af045992cf9fb1e115aab179ae01f31d3469e08ce637993c
7
+ data.tar.gz: 37bb62f22038526d2fcba2d88a800527a63b4df6db432cab1e66bea0bb5d53d2624a13acbcad92a82f0ddfa62b23f1746913353c0821febda524de9a737c3f58
@@ -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:
@@ -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: ['3.3']
16
- rails_version: ['7.1.4', '7.2.1']
17
- blacklight_version: ['~> 7.0']
18
- additional_name: ['']
19
- legacy_config: ['']
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
- - ruby: '3.3'
22
- rails_version: '7.2.1'
23
- blacklight_version: '~> 8.0'
24
- additional_name: ''
25
- - ruby: '3.3'
26
- rails_version: '7.2.1'
27
- blacklight_version: '~> 8.0'
28
- additional_name: 'with legacy partial config'
29
- legacy_config: 'true'
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
- - uses: actions/checkout@v2
36
- - name: Set up Ruby ${{ matrix.ruby }}
37
- uses: ruby/setup-ruby@v1
38
- with:
39
- ruby-version: ${{ matrix.ruby }}
40
- - name: Install dependencies with Rails ${{ matrix.rails_version }}
41
- run: bundle install
42
- - name: Run tests
43
- run: bundle exec rake
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.BlacklightOembed = factory());
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;;;;;;;;"}
@@ -0,0 +1,3 @@
1
+ # frozen_string_literal: true
2
+
3
+ pin_all_from File.expand_path("../app/javascript/blacklight-oembed", __dir__), under: "blacklight-oembed"
@@ -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
@@ -1,5 +1,5 @@
1
1
  module Blacklight
2
2
  module Oembed
3
- VERSION = '1.4.0'
3
+ VERSION = '1.4.1'
4
4
  end
5
5
  end
@@ -18,6 +18,10 @@ module BlacklightOembed
18
18
  copy_file "oembed_providers.rb", "config/initializers/oembed_providers.rb"
19
19
  end
20
20
 
21
+ def appease_sprockets4
22
+ append_to_file 'app/assets/config/manifest.js', "\n//= link blacklight-oembed/oembed.js"
23
+ end
24
+
21
25
  def configuration
22
26
  inject_into_file 'app/controllers/catalog_controller.rb', after: 'configure_blacklight do |config|' do
23
27
  if ENV['CI_TEST_LEGACY_CONFIGURATION'].present? || Gem::Version.new(Blacklight::VERSION) < Gem::Version.new('8.0')
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blacklight-oembed",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "description": "Oembed behavior for Blacklight",
5
5
  "main": "app/assets/javascripts/blacklight_oembed/oembed.js",
6
6
  "type": "module",
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 : 'BlacklightOembed'
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.0
4
+ version: 1.4.1
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-10 00:00:00.000000000 Z
11
+ date: 2025-01-13 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