blacklight-spotlight 5.3.0 → 5.3.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.
Files changed (154) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +18 -1
  3. data/app/assets/javascripts/spotlight/spotlight.esm.js +1696 -1229
  4. data/app/assets/javascripts/spotlight/spotlight.esm.js.map +1 -1
  5. data/app/assets/javascripts/spotlight/spotlight.js +1718 -1232
  6. data/app/assets/javascripts/spotlight/spotlight.js.map +1 -1
  7. data/app/assets/stylesheets/spotlight/_multi_up_item_grid.scss +1 -10
  8. data/app/assets/stylesheets/spotlight/_nestable.scss +18 -1
  9. data/app/assets/stylesheets/spotlight/_pages.scss +3 -3
  10. data/app/components/spotlight/analytics/aggregation_component.html.erb +1 -1
  11. data/app/components/spotlight/document_admin_table_component.html.erb +2 -2
  12. data/app/components/spotlight/edit_view_links_component.html.erb +1 -1
  13. data/app/components/spotlight/header_component.html.erb +1 -1
  14. data/app/components/spotlight/tag_list_form_component.html.erb +1 -1
  15. data/app/components/spotlight/tag_selector_component.html.erb +2 -2
  16. data/app/components/spotlight/translations/subheading_component.html.erb +1 -1
  17. data/app/controllers/spotlight/resources_controller.rb +1 -1
  18. data/app/javascript/spotlight/admin/add_another.js +22 -15
  19. data/app/javascript/spotlight/admin/add_image_selector.js +27 -25
  20. data/app/javascript/spotlight/admin/add_new_button.js +47 -43
  21. data/app/javascript/spotlight/admin/blacklight_configuration.js +52 -38
  22. data/app/javascript/spotlight/admin/block_mixins/autocompleteable.js +68 -60
  23. data/app/javascript/spotlight/admin/block_mixins/formable.js +55 -47
  24. data/app/javascript/spotlight/admin/block_mixins/plustextable.js +19 -20
  25. data/app/javascript/spotlight/admin/blocks/block.js +20 -16
  26. data/app/javascript/spotlight/admin/blocks/browse_block.js +42 -37
  27. data/app/javascript/spotlight/admin/blocks/browse_group_categories_block.js +33 -31
  28. data/app/javascript/spotlight/admin/blocks/iframe_block.js +14 -11
  29. data/app/javascript/spotlight/admin/blocks/link_to_search_block.js +4 -7
  30. data/app/javascript/spotlight/admin/blocks/oembed_block.js +13 -10
  31. data/app/javascript/spotlight/admin/blocks/pages_block.js +20 -13
  32. data/app/javascript/spotlight/admin/blocks/resources_block.js +150 -117
  33. data/app/javascript/spotlight/admin/blocks/rule_block.js +11 -10
  34. data/app/javascript/spotlight/admin/blocks/search_result_block.js +16 -17
  35. data/app/javascript/spotlight/admin/blocks/solr_documents_base_block.js +123 -64
  36. data/app/javascript/spotlight/admin/blocks/solr_documents_block.js +8 -8
  37. data/app/javascript/spotlight/admin/blocks/solr_documents_carousel_block.js +63 -43
  38. data/app/javascript/spotlight/admin/blocks/solr_documents_embed_block.js +9 -9
  39. data/app/javascript/spotlight/admin/blocks/solr_documents_features_block.js +17 -16
  40. data/app/javascript/spotlight/admin/blocks/solr_documents_grid_block.js +6 -7
  41. data/app/javascript/spotlight/admin/blocks/uploaded_items_block.js +84 -64
  42. data/app/javascript/spotlight/admin/crop.js +203 -156
  43. data/app/javascript/spotlight/admin/croppable.js +4 -4
  44. data/app/javascript/spotlight/admin/croppable_modal.js +59 -37
  45. data/app/javascript/spotlight/admin/edit_in_place.js +50 -47
  46. data/app/javascript/spotlight/admin/exhibits.js +52 -41
  47. data/app/javascript/spotlight/admin/form_observer.js +59 -53
  48. data/app/javascript/spotlight/admin/iiif.js +26 -25
  49. data/app/javascript/spotlight/admin/index.js +44 -47
  50. data/app/javascript/spotlight/admin/locks.js +14 -14
  51. data/app/javascript/spotlight/admin/multi_image_selector.js +127 -111
  52. data/app/javascript/spotlight/admin/pages.js +21 -21
  53. data/app/javascript/spotlight/admin/progress_monitor.js +67 -65
  54. data/app/javascript/spotlight/admin/readonly_checkbox.js +3 -3
  55. data/app/javascript/spotlight/admin/search_typeahead.js +55 -43
  56. data/app/javascript/spotlight/admin/select_related_input.js +17 -17
  57. data/app/javascript/spotlight/admin/sir-trevor/block_controls.js +100 -84
  58. data/app/javascript/spotlight/admin/sir-trevor/block_limits.js +36 -31
  59. data/app/javascript/spotlight/admin/sir-trevor/locales.js +52 -39
  60. data/app/javascript/spotlight/admin/spotlight_nestable.js +126 -91
  61. data/app/javascript/spotlight/admin/tabs.js +19 -3
  62. data/app/javascript/spotlight/admin/translation_progress.js +13 -7
  63. data/app/javascript/spotlight/admin/users.js +41 -41
  64. data/app/javascript/spotlight/admin/visibility_toggle.js +4 -4
  65. data/app/javascript/spotlight/controllers/clipboard_controller.js +14 -0
  66. data/app/javascript/spotlight/controllers/index.js +4 -2
  67. data/app/javascript/spotlight/controllers/tag_selector_controller.js +116 -79
  68. data/app/javascript/spotlight/core.js +18 -15
  69. data/app/javascript/spotlight/index.js +4 -4
  70. data/app/javascript/spotlight/user/browse_group_categories.js +24 -22
  71. data/app/javascript/spotlight/user/carousel.js +23 -19
  72. data/app/javascript/spotlight/user/clear_form_button.js +15 -15
  73. data/app/javascript/spotlight/user/index.js +4 -4
  74. data/app/javascript/spotlight/user/zpr_links.js +18 -18
  75. data/app/models/spotlight/analytics/ga.rb +0 -1
  76. data/app/models/spotlight/resources/iiif_manifest_v3.rb +2 -2
  77. data/app/services/spotlight/exhibit_import_export_service.rb +0 -2
  78. data/app/views/blacklight/nav/_bookmark.html.erb +1 -1
  79. data/app/views/catalog/_remove_tags.html.erb +1 -1
  80. data/app/views/layouts/spotlight/base.html.erb +1 -1
  81. data/app/views/shared/_header_navbar.html.erb +1 -1
  82. data/app/views/shared/_masthead.html.erb +2 -2
  83. data/app/views/shared/_site_sidebar.html.erb +1 -1
  84. data/app/views/shared/_user_util_links.html.erb +2 -2
  85. data/app/views/spotlight/about_pages/_contacts.html.erb +1 -1
  86. data/app/views/spotlight/accessibility/alt_text.html.erb +1 -1
  87. data/app/views/spotlight/admin_users/index.html.erb +11 -9
  88. data/app/views/spotlight/appearances/edit.html.erb +1 -1
  89. data/app/views/spotlight/browse/_search_box.html.erb +1 -1
  90. data/app/views/spotlight/bulk_updates/_download.html.erb +1 -1
  91. data/app/views/spotlight/bulk_updates/_progress_panel.html.erb +6 -6
  92. data/app/views/spotlight/bulk_updates/edit.html.erb +1 -1
  93. data/app/views/spotlight/catalog/_admin_header.html.erb +1 -1
  94. data/app/views/spotlight/catalog/_admin_index_header_default.html.erb +1 -1
  95. data/app/views/spotlight/catalog/_curation_mode_toggle_default.html.erb +1 -1
  96. data/app/views/spotlight/catalog/_document.html.erb +2 -2
  97. data/app/views/spotlight/catalog/_document_admin_table.html.erb +1 -1
  98. data/app/views/spotlight/catalog/_edit_sidecar.html.erb +1 -1
  99. data/app/views/spotlight/catalog/_index_compact_default.html.erb +1 -1
  100. data/app/views/spotlight/catalog/_reindex_progress_panel.html.erb +6 -6
  101. data/app/views/spotlight/catalog/select_image.html.erb +1 -1
  102. data/app/views/spotlight/contact_mailer/report_problem.html.erb +2 -2
  103. data/app/views/spotlight/exhibits/_contact.html.erb +2 -2
  104. data/app/views/spotlight/exhibits/_delete.html.erb +2 -2
  105. data/app/views/spotlight/exhibits/_exhibit_card.html.erb +1 -1
  106. data/app/views/spotlight/exhibits/_export.html.erb +1 -1
  107. data/app/views/spotlight/exhibits/_form.html.erb +2 -2
  108. data/app/views/spotlight/exhibits/_languages.html.erb +7 -7
  109. data/app/views/spotlight/exhibits/_missing_exhibits.html.erb +1 -1
  110. data/app/views/spotlight/locks/_lock.html.erb +2 -2
  111. data/app/views/spotlight/metadata_configurations/edit.html.erb +1 -1
  112. data/app/views/spotlight/pages/_order_pages.html.erb +3 -3
  113. data/app/views/spotlight/pages/preview.html.erb +1 -1
  114. data/app/views/spotlight/pages/show.html.erb +2 -2
  115. data/app/views/spotlight/resources/_form.html.erb +1 -1
  116. data/app/views/spotlight/resources/csv_upload/_form.html.erb +1 -1
  117. data/app/views/spotlight/resources/upload/_form.html.erb +1 -1
  118. data/app/views/spotlight/roles/index.html.erb +5 -5
  119. data/app/views/spotlight/search_configurations/_search_fields.html.erb +1 -1
  120. data/app/views/spotlight/search_configurations/edit.html.erb +1 -1
  121. data/app/views/spotlight/searches/index.html.erb +2 -2
  122. data/app/views/spotlight/shared/_configuration_sidebar.html.erb +1 -1
  123. data/app/views/spotlight/shared/_curation_sidebar.html.erb +1 -1
  124. data/app/views/spotlight/shared/_dd3_item.html.erb +1 -1
  125. data/app/views/spotlight/sir_trevor/_sir_trevor_block_array.html.erb +1 -1
  126. data/app/views/spotlight/sir_trevor/blocks/_browse_block.html.erb +1 -1
  127. data/app/views/spotlight/sir_trevor/blocks/_browse_group_categories_block.html.erb +1 -1
  128. data/app/views/spotlight/sir_trevor/blocks/_featured_pages_block.html.erb +2 -2
  129. data/app/views/spotlight/sir_trevor/blocks/_link_to_search_block.html.erb +1 -1
  130. data/app/views/spotlight/sir_trevor/blocks/_rule_block.html.erb +1 -1
  131. data/app/views/spotlight/sir_trevor/blocks/_search_results_block.html.erb +1 -1
  132. data/app/views/spotlight/sir_trevor/blocks/_solr_documents_block.html.erb +1 -1
  133. data/app/views/spotlight/sir_trevor/blocks/_solr_documents_carousel_block.html.erb +1 -1
  134. data/app/views/spotlight/sir_trevor/blocks/_solr_documents_features_block.html.erb +1 -1
  135. data/app/views/spotlight/sir_trevor/blocks/_solr_documents_grid_block.html.erb +1 -1
  136. data/app/views/spotlight/sites/edit_exhibits.html.erb +3 -3
  137. data/app/views/spotlight/translations/_browse_categories.html.erb +2 -2
  138. data/app/views/spotlight/translations/_general.html.erb +21 -21
  139. data/app/views/spotlight/translations/_groups.html.erb +1 -1
  140. data/app/views/spotlight/translations/_metadata.html.erb +8 -8
  141. data/app/views/spotlight/translations/_pages_table.html.erb +2 -2
  142. data/app/views/spotlight/translations/_search_fields.html.erb +13 -13
  143. data/app/views/spotlight/translations/edit.html.erb +5 -5
  144. data/config/importmap.rb +0 -1
  145. data/lib/generators/spotlight/assets/propshaft_generator.rb +0 -1
  146. data/lib/generators/spotlight/templates/solr/conf/admin-extra.html +31 -31
  147. data/lib/spotlight/version.rb +1 -1
  148. data/spec/factories/contact_images.rb +1 -1
  149. data/spec/factories/exhibit_thumbnails.rb +1 -1
  150. data/spec/factories/featured_images.rb +1 -1
  151. data/spec/support/features/test_features_helpers.rb +41 -1
  152. metadata +4 -61
  153. data/app/javascript/spotlight/admin/copy_email_addresses.js +0 -7
  154. data/vendor/assets/javascripts/jquery.waitforimages.min.js +0 -2
@@ -1,10 +1,10 @@
1
1
  <div role="tabpanel" class="tab-pane <%= 'active' if @tab == 'search_fields' %>" id="search_fields">
2
2
  <%= bootstrap_form_for current_exhibit, url: spotlight.exhibit_translations_path(current_exhibit), layout: :horizontal do |f| %>
3
- <% # Add hidden fields for the language and tab so the redirect knows how to come back here %>
3
+ <%# Add hidden fields for the language and tab so the redirect knows how to come back here %>
4
4
  <%= hidden_field_tag :language, @language %>
5
5
  <%= hidden_field_tag :tab, 'search_fields', id: nil %>
6
6
 
7
- <div class='translation-field-based-search-fields'>
7
+ <div class="translation-field-based-search-fields">
8
8
  <%= render Spotlight::Translations::SubheadingComponent.new(key: 'search_fields.field_based_search_fields.label') %>
9
9
 
10
10
  <% current_exhibit.blacklight_config.search_fields.select { |_, config| config.if }.each do |key, search_config| %>
@@ -12,15 +12,15 @@
12
12
  <%= f.fields_for :translations, translation do |translation_fields| %>
13
13
  <%= translation_fields.hidden_field :key %>
14
14
  <%= translation_fields.hidden_field :locale %>
15
- <div data-translation-progress-item='true' class='row form-group mb-3 translation-form'>
15
+ <div data-translation-progress-item="true" class="row form-group mb-3 translation-form">
16
16
  <%= translation_fields.label :value, t("spotlight.search.fields.search.#{key}", locale: I18n.default_locale), class: 'col-form-label col-12 col-sm-2' %>
17
- <div class='col-11 col-sm-9 card card-body panel-translation'>
17
+ <div class="col-11 col-sm-9 card card-body panel-translation">
18
18
  <%= translation_fields.text_field_without_bootstrap :value, class: 'form-control' %>
19
19
  <div class="form-text text-muted mb-3">
20
20
  <%= search_config.label %>
21
21
  </div>
22
22
  </div>
23
- <div class='col-1'>
23
+ <div class="col-1">
24
24
  <% if translation.value.present? %>
25
25
  <span data-translation-present="true">
26
26
  <%= blacklight_icon('check', classes: 'translation-complete') %>
@@ -32,7 +32,7 @@
32
32
  <% end %>
33
33
  </div>
34
34
 
35
- <div class='translation-facet-fields'>
35
+ <div class="translation-facet-fields">
36
36
  <%= render Spotlight::Translations::SubheadingComponent.new(key: 'search_fields.facet_fields.label') %>
37
37
 
38
38
  <% current_exhibit.blacklight_config.facet_fields.each do |key, facet_config| %>
@@ -40,15 +40,15 @@
40
40
  <%= f.fields_for :translations, translation do |translation_fields| %>
41
41
  <%= translation_fields.hidden_field :key %>
42
42
  <%= translation_fields.hidden_field :locale %>
43
- <div data-translation-progress-item='true' class='row form-group mb-3 translation-form'>
43
+ <div data-translation-progress-item="true" class="row form-group mb-3 translation-form">
44
44
  <%= translation_fields.label :value, t("spotlight.search.fields.facet.#{key}", locale: I18n.default_locale), class: 'col-form-label col-12 col-sm-2' %>
45
- <div class='col-11 col-sm-9 card card-body panel-translation'>
45
+ <div class="col-11 col-sm-9 card card-body panel-translation">
46
46
  <%= translation_fields.text_field_without_bootstrap :value, class: 'form-control' %>
47
47
  <div class="form-text text-muted mb-3">
48
48
  <%= facet_config.label %>
49
49
  </div>
50
50
  </div>
51
- <div class='col-1'>
51
+ <div class="col-1">
52
52
  <% if translation.value.present? %>
53
53
  <span data-translation-present="true">
54
54
  <%= blacklight_icon('check', classes: 'translation-complete') %>
@@ -60,7 +60,7 @@
60
60
  <% end %>
61
61
  </div>
62
62
 
63
- <div class='translation-sort-fields'>
63
+ <div class="translation-sort-fields">
64
64
  <%= render Spotlight::Translations::SubheadingComponent.new(key: 'search_fields.sort_fields.label') %>
65
65
 
66
66
  <% current_exhibit.blacklight_config.sort_fields.each do |key, sort_config| %>
@@ -68,15 +68,15 @@
68
68
  <%= f.fields_for :translations, translation do |translation_fields| %>
69
69
  <%= translation_fields.hidden_field :key %>
70
70
  <%= translation_fields.hidden_field :locale %>
71
- <div data-translation-progress-item='true' class='row form-group mb-3 translation-form'>
71
+ <div data-translation-progress-item="true" class="row form-group mb-3 translation-form">
72
72
  <%= translation_fields.label :value, t("spotlight.search.fields.sort.#{key}", locale: I18n.default_locale), class: 'col-form-label col-12 col-sm-2' %>
73
- <div class='col-11 col-sm-9 card card-body panel-translation'>
73
+ <div class="col-11 col-sm-9 card card-body panel-translation">
74
74
  <%= translation_fields.text_field_without_bootstrap :value, class: 'form-control' %>
75
75
  <div class="form-text text-muted mb-3">
76
76
  <%= sort_config.label %>
77
77
  </div>
78
78
  </div>
79
- <div class='col-1'>
79
+ <div class="col-1">
80
80
  <% if translation.value.present? %>
81
81
  <span data-translation-present="true">
82
82
  <%= blacklight_icon('check', classes: 'translation-complete') %>
@@ -2,11 +2,11 @@
2
2
  <%= render 'spotlight/shared/exhibit_sidebar' %>
3
3
  <% end %>
4
4
 
5
- <div class='translation-edit-form'>
5
+ <div class="translation-edit-form">
6
6
  <%= curation_page_title t('.title') %>
7
7
 
8
- <div class='text-center'>
9
- <ul class='nav nav-pills'>
8
+ <div class="text-center">
9
+ <ul class="nav nav-pills">
10
10
  <% current_exhibit.available_locales.each do |language| %>
11
11
  <li role="presentation" class="nav-item">
12
12
  <%= link_to spotlight.edit_exhibit_translations_path(current_exhibit, language: language), class: "nav-link #{'active' if @language == language}" do %>
@@ -20,9 +20,9 @@
20
20
  <%= render partial: 'import' %>
21
21
 
22
22
  <div role="tabpanel">
23
- <ul class='nav nav-tabs' role="tablist">
23
+ <ul class="nav nav-tabs" role="tablist">
24
24
  <li role="presentation" class="nav-item">
25
- <a href='#general' class="nav-link <%= 'active' if @tab.blank? %>" aria-controls="general" role="tab" data-bs-toggle="tab" data-behavior="translation-progress">
25
+ <a href="#general" class="nav-link <%= 'active' if @tab.blank? %>" aria-controls="general" role="tab" data-bs-toggle="tab" data-behavior="translation-progress">
26
26
  <%= t('spotlight.translations.general.label') %> <span class="badge"></span>
27
27
  </a>
28
28
  </li>
data/config/importmap.rb CHANGED
@@ -3,7 +3,6 @@
3
3
  pin_all_from File.expand_path('../app/javascript/spotlight', __dir__), under: 'spotlight'
4
4
  pin_all_from File.expand_path('../vendor/assets/javascripts', __dir__)
5
5
 
6
- pin 'clipboard', to: 'https://cdn.jsdelivr.net/npm/clipboard@2.0.11/+esm'
7
6
  pin 'sir-trevor', to: 'https://cdn.jsdelivr.net/npm/sir-trevor@0.8.2/+esm'
8
7
  pin 'sortablejs', to: 'https://cdn.jsdelivr.net/npm/sortablejs@^1.15.3/+esm'
9
8
  pin '@github/auto-complete-element', to: 'https://cdn.jsdelivr.net/npm/@github/auto-complete-element@3.8.0/+esm'
@@ -26,7 +26,6 @@ module Spotlight
26
26
  def install_dependencies
27
27
  run 'yarn add @github/auto-complete-element'
28
28
  run 'yarn add @hotwired/turbo-rails'
29
- run 'yarn add clipboard'
30
29
  run 'yarn add leaflet'
31
30
  run 'yarn add sir-trevor'
32
31
  run 'yarn add sortablejs'
@@ -1,31 +1,31 @@
1
- <!--
2
- Licensed to the Apache Software Foundation (ASF) under one or more
3
- contributor license agreements. See the NOTICE file distributed with
4
- this work for additional information regarding copyright ownership.
5
- The ASF licenses this file to You under the Apache License, Version 2.0
6
- (the "License"); you may not use this file except in compliance with
7
- the License. You may obtain a copy of the License at
8
-
9
- http://www.apache.org/licenses/LICENSE-2.0
10
-
11
- Unless required by applicable law or agreed to in writing, software
12
- distributed under the License is distributed on an "AS IS" BASIS,
13
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- See the License for the specific language governing permissions and
15
- limitations under the License.
16
- -->
17
-
18
- <!-- The content of this page will be statically included into the top
19
- of the admin page. Uncomment this as an example to see there the content
20
- will show up.
21
-
22
- <hr>
23
- <i>This line will appear before the first table</i>
24
- <tr>
25
- <td colspan="2">
26
- This row will be appended to the end of the first table
27
- </td>
28
- </tr>
29
- <hr>
30
-
31
- -->
1
+ <!--
2
+ Licensed to the Apache Software Foundation (ASF) under one or more
3
+ contributor license agreements. See the NOTICE file distributed with
4
+ this work for additional information regarding copyright ownership.
5
+ The ASF licenses this file to You under the Apache License, Version 2.0
6
+ (the "License"); you may not use this file except in compliance with
7
+ the License. You may obtain a copy of the License at
8
+
9
+ http://www.apache.org/licenses/LICENSE-2.0
10
+
11
+ Unless required by applicable law or agreed to in writing, software
12
+ distributed under the License is distributed on an "AS IS" BASIS,
13
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ See the License for the specific language governing permissions and
15
+ limitations under the License.
16
+ -->
17
+
18
+ <!-- The content of this page will be statically included into the top
19
+ of the admin page. Uncomment this as an example to see there the content
20
+ will show up.
21
+
22
+ <hr>
23
+ <i>This line will appear before the first table</i>
24
+ <tr>
25
+ <td colspan="2">
26
+ This row will be appended to the end of the first table
27
+ </td>
28
+ </tr>
29
+ <hr>
30
+
31
+ -->
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Spotlight
4
- VERSION = '5.3.0'
4
+ VERSION = '5.3.2'
5
5
  end
@@ -3,6 +3,6 @@
3
3
  FactoryBot.define do
4
4
  factory :contact_image, class: 'Spotlight::ContactImage' do
5
5
  image { Rack::Test::UploadedFile.new(File.expand_path(File.join('..', 'fixtures', 'avatar.png'), __dir__)) }
6
- iiif_tilesource { 'https://exhibits-stage.stanford.edu/images/78' }
6
+ iiif_tilesource { 'http://127.0.0.1:9999/images/78' }
7
7
  end
8
8
  end
@@ -3,6 +3,6 @@
3
3
  FactoryBot.define do
4
4
  factory :exhibit_thumbnail, class: 'Spotlight::ExhibitThumbnail' do
5
5
  image { Rack::Test::UploadedFile.new(File.expand_path(File.join('..', 'fixtures', 'avatar.png'), __dir__)) }
6
- iiif_tilesource { 'https://exhibits-stage.stanford.edu/images/78' }
6
+ iiif_tilesource { 'http://127.0.0.1:9999/images/78' }
7
7
  end
8
8
  end
@@ -3,7 +3,7 @@
3
3
  FactoryBot.define do
4
4
  factory :featured_image, class: 'Spotlight::FeaturedImage' do
5
5
  image { Rack::Test::UploadedFile.new(File.expand_path(File.join('..', 'fixtures', 'avatar.png'), __dir__)) }
6
- iiif_tilesource { 'https://exhibits-stage.stanford.edu/images/78' }
6
+ iiif_tilesource { 'http://127.0.0.1:9999/images/78' }
7
7
  end
8
8
 
9
9
  factory :temporary_image, class: 'Spotlight::TemporaryImage' do
@@ -9,7 +9,16 @@ module Spotlight
9
9
  find("auto-complete [data-#{type}-typeahead][role='combobox']").fill_in(with: opts[:with])
10
10
  # Wait for the autocomplete to show both 'open' and 'aria-expanded="true"' or the results might be stale
11
11
  expect(page).to have_css("auto-complete[open] [data-#{type}-typeahead][role='combobox'][aria-expanded='true']")
12
- first('auto-complete[open] [role="option"]', text: opts[:with]).click
12
+ # The auto-complete element fires one fetch on focus and another debounced fetch on input. In CI
13
+ # they can land out of order, and whichever returns second replaces the results <ul> wholesale
14
+ # turning any <li> we just located into a stale reference. Retry find+click as one unit so each
15
+ # attempt resolves against the latest DOM.
16
+ page.document.synchronize(
17
+ Capybara.default_max_wait_time,
18
+ errors: [Selenium::WebDriver::Error::StaleElementReferenceError, Capybara::ElementNotFound]
19
+ ) do
20
+ first('auto-complete[open] [role="option"]', text: opts[:with], minimum: 1).click
21
+ end
13
22
  end
14
23
 
15
24
  # just like #fill_in_typeahead_field, but wait for the
@@ -49,6 +58,37 @@ module Spotlight
49
58
  expect(page).to have_no_selector('.alert-danger')
50
59
  end
51
60
 
61
+ # Capybara's HTML5 drag emulation sends the drag events to a given element. This drags
62
+ # to a point instead, so the test covers what is under the pointer.
63
+ def drag_horizontally(handle, by:)
64
+ # elementFromPoint returns null for a point outside the viewport
65
+ page.scroll_to(handle, align: :center)
66
+ page.driver.browser.action.click_and_hold(handle.native).perform
67
+ error = page.evaluate_async_script(DRAG_HORIZONTALLY_SCRIPT, handle, by)
68
+ page.driver.browser.action.release.perform
69
+ raise error if error
70
+ end
71
+
72
+ DRAG_HORIZONTALLY_SCRIPT = <<~JS
73
+ const [handle, offset, done] = arguments
74
+ const item = handle.closest('.dd-item')
75
+ const tick = () => new Promise((resolve) => setTimeout(resolve, 50))
76
+ const opts = { bubbles: true, cancelable: true, dataTransfer: new DataTransfer() }
77
+
78
+ item.dispatchEvent(new DragEvent('dragstart', opts))
79
+ tick().then(() => {
80
+ const rect = handle.getBoundingClientRect()
81
+ const point = { clientX: rect.left + rect.width / 2 + offset, clientY: rect.top + rect.height / 2 }
82
+ const target = document.elementFromPoint(point.clientX, point.clientY)
83
+ target.dispatchEvent(new DragEvent('dragover', { ...opts, ...point }))
84
+ return tick().then(() => {
85
+ target.dispatchEvent(new DragEvent('drop', { ...opts, ...point }))
86
+ item.dispatchEvent(new DragEvent('dragend', { ...opts, ...point }))
87
+ done()
88
+ })
89
+ }).catch((error) => done(String(error)))
90
+ JS
91
+
52
92
  RSpec::Matchers.define :have_breadcrumbs do |*expected|
53
93
  match do |actual|
54
94
  errors = []
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blacklight-spotlight
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.3.0
4
+ version: 5.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Beer
@@ -10,7 +10,7 @@ authors:
10
10
  - Justin Coyne
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 1980-01-02 00:00:00.000000000 Z
13
+ date: 2026-09-30 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activejob-status
@@ -328,20 +328,6 @@ dependencies:
328
328
  - - ">="
329
329
  - !ruby/object:Gem::Version
330
330
  version: '0'
331
- - !ruby/object:Gem::Dependency
332
- name: oauth2
333
- requirement: !ruby/object:Gem::Requirement
334
- requirements:
335
- - - ">="
336
- - !ruby/object:Gem::Version
337
- version: '0'
338
- type: :runtime
339
- prerelease: false
340
- version_requirements: !ruby/object:Gem::Requirement
341
- requirements:
342
- - - ">="
343
- - !ruby/object:Gem::Version
344
- version: '0'
345
331
  - !ruby/object:Gem::Dependency
346
332
  name: openseadragon
347
333
  requirement: !ruby/object:Gem::Requirement
@@ -456,48 +442,6 @@ dependencies:
456
442
  - - "~>"
457
443
  - !ruby/object:Gem::Version
458
444
  version: '2.0'
459
- - !ruby/object:Gem::Dependency
460
- name: roar
461
- requirement: !ruby/object:Gem::Requirement
462
- requirements:
463
- - - "~>"
464
- - !ruby/object:Gem::Version
465
- version: '1.1'
466
- type: :runtime
467
- prerelease: false
468
- version_requirements: !ruby/object:Gem::Requirement
469
- requirements:
470
- - - "~>"
471
- - !ruby/object:Gem::Version
472
- version: '1.1'
473
- - !ruby/object:Gem::Dependency
474
- name: roar-rails
475
- requirement: !ruby/object:Gem::Requirement
476
- requirements:
477
- - - ">="
478
- - !ruby/object:Gem::Version
479
- version: '0'
480
- type: :runtime
481
- prerelease: false
482
- version_requirements: !ruby/object:Gem::Requirement
483
- requirements:
484
- - - ">="
485
- - !ruby/object:Gem::Version
486
- version: '0'
487
- - !ruby/object:Gem::Dependency
488
- name: signet
489
- requirement: !ruby/object:Gem::Requirement
490
- requirements:
491
- - - ">="
492
- - !ruby/object:Gem::Version
493
- version: '0'
494
- type: :runtime
495
- prerelease: false
496
- version_requirements: !ruby/object:Gem::Requirement
497
- requirements:
498
- - - ">="
499
- - !ruby/object:Gem::Version
500
- version: '0'
501
445
  - !ruby/object:Gem::Dependency
502
446
  name: view_component
503
447
  requirement: !ruby/object:Gem::Requirement
@@ -1003,7 +947,6 @@ files:
1003
947
  - app/javascript/spotlight/admin/blocks/solr_documents_features_block.js
1004
948
  - app/javascript/spotlight/admin/blocks/solr_documents_grid_block.js
1005
949
  - app/javascript/spotlight/admin/blocks/uploaded_items_block.js
1006
- - app/javascript/spotlight/admin/copy_email_addresses.js
1007
950
  - app/javascript/spotlight/admin/crop.js
1008
951
  - app/javascript/spotlight/admin/croppable.js
1009
952
  - app/javascript/spotlight/admin/croppable_modal.js
@@ -1027,6 +970,7 @@ files:
1027
970
  - app/javascript/spotlight/admin/translation_progress.js
1028
971
  - app/javascript/spotlight/admin/users.js
1029
972
  - app/javascript/spotlight/admin/visibility_toggle.js
973
+ - app/javascript/spotlight/controllers/clipboard_controller.js
1030
974
  - app/javascript/spotlight/controllers/index.js
1031
975
  - app/javascript/spotlight/controllers/tag_selector_controller.js
1032
976
  - app/javascript/spotlight/core.js
@@ -1527,7 +1471,6 @@ files:
1527
1471
  - vendor/assets/images/sir-trevor-icons.svg
1528
1472
  - vendor/assets/javascripts/Leaflet.Editable.js
1529
1473
  - vendor/assets/javascripts/Path.Drag.js
1530
- - vendor/assets/javascripts/jquery.waitforimages.min.js
1531
1474
  - vendor/assets/javascripts/leaflet-iiif.js
1532
1475
  - vendor/assets/javascripts/parameterize.js
1533
1476
  - vendor/assets/javascripts/tiny-slider.js
@@ -1566,7 +1509,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1566
1509
  - !ruby/object:Gem::Version
1567
1510
  version: '0'
1568
1511
  requirements: []
1569
- rubygems_version: 4.0.7
1512
+ rubygems_version: 3.6.2
1570
1513
  specification_version: 4
1571
1514
  summary: Enable librarians, curators, and others who are responsible for digital collections
1572
1515
  to create attractive, feature-rich websites that feature these collections.
@@ -1,7 +0,0 @@
1
- import Clipboard from 'clipboard';
2
-
3
- export default class {
4
- connect() {
5
- new Clipboard('.copy-email-addresses');
6
- }
7
- }
@@ -1,2 +0,0 @@
1
- /*! waitForImages jQuery Plugin 2013-07-20 */
2
- !function(a){var b="waitForImages";a.waitForImages={hasImageProperties:["backgroundImage","listStyleImage","borderImage","borderCornerImage","cursor"]},a.expr[":"].uncached=function(b){if(!a(b).is('img[src!=""]'))return!1;var c=new Image;return c.src=b.src,!c.complete},a.fn.waitForImages=function(c,d,e){var f=0,g=0;if(a.isPlainObject(arguments[0])&&(e=arguments[0].waitForAll,d=arguments[0].each,c=arguments[0].finished),c=c||a.noop,d=d||a.noop,e=!!e,!a.isFunction(c)||!a.isFunction(d))throw new TypeError("An invalid callback was supplied.");return this.each(function(){var h=a(this),i=[],j=a.waitForImages.hasImageProperties||[],k=/url\(\s*(['"]?)(.*?)\1\s*\)/g;e?h.find("*").addBack().each(function(){var b=a(this);b.is("img:uncached")&&i.push({src:b.attr("src"),element:b[0]}),a.each(j,function(a,c){var d,e=b.css(c);if(!e)return!0;for(;d=k.exec(e);)i.push({src:d[2],element:b[0]})})}):h.find("img:uncached").each(function(){i.push({src:this.src,element:this})}),f=i.length,g=0,0===f&&c.call(h[0]),a.each(i,function(e,i){var j=new Image;a(j).on("load."+b+" error."+b,function(a){return g++,d.call(i.element,g,f,"load"==a.type),g==f?(c.call(h[0]),!1):void 0}),j.src=i.src})})}}(jQuery);